Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

fix(teamhub-cli): accept heredoc text for in-place replacements

LeoXing1ef0a2ff57fe
diff --git a/apps/teamhub-cli/README.md b/apps/teamhub-cli/README.md
index 3792c6d4..01b2f463 100644
--- a/apps/teamhub-cli/README.md
+++ b/apps/teamhub-cli/README.md
@@ -12,7 +12,7 @@ teamhub docs update --schema
## Common operations
-Pass a body directly with `--content`, or read UTF-8 with `--file <path>`; `--file -` reads stdin. `--json` returns business JSON.
+Pass a body directly with `--content`, or read UTF-8 with `--file <path>`; `--file -` reads stdin, such as a quoted heredoc (`<<'EOF'`), which keeps `$` and backticks as typed. `docs update --command str_replace` and `docs comment replace` drop the line break that ends a file or heredoc, since their text replaces a run of text in place. `--json` returns business JSON.
```bash
teamhub message read --json
diff --git a/apps/teamhub-cli/src/__snapshots__/cli.help-snapshot.test.ts.snap b/apps/teamhub-cli/src/__snapshots__/cli.help-snapshot.test.ts.snap
index 0abefaad..3c7bbc51 100644
--- a/apps/teamhub-cli/src/__snapshots__/cli.help-snapshot.test.ts.snap
+++ b/apps/teamhub-cli/src/__snapshots__/cli.help-snapshot.test.ts.snap
@@ -1832,7 +1832,7 @@ Options:
--title <value> The card's title: one line, at most 120 characters.
--kind <value> Only profile: marks the delivery of the Human's Personal Profile.
--content <value> Inline body text; never read as a path. Outside code, \\n and \\t become a line break and a tab, and \\\\ becomes \\ (write \\\\n for a literal \\n; inside shell double quotes type \\\\\\\\n). Code and --file bodies are never decoded.
- --file <value> Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).
+ --file <value> Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.
--attach <value> Local file published with the card, e.g. from ./playground/<task-id>/; repeatable, no directories.
--document <value> Existing Document ID shown on the card; repeatable.
--json Return machine-readable JSON.
@@ -1848,7 +1848,7 @@ Examples:
teamhub message card --title "Competitor comparison" --content "A cut its enterprise price 15%; B moved its launch to early November." --attach ./playground/task_8f2c/comparison.xlsx
",
"schema": "exit 0
-{"command":["message","card"],"description":"Send one light card to the Room or one of its Threads: a title, a one-line result and files. Deliver a finished background Task's result with it, or point out something the user must notice; reply in ordinary messages otherwise.","read_only":false,"input_schema":{"type":"object","additionalProperties":false,"required":["inbox_id","card_title","message_segments"],"properties":{"inbox_id":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"card_title":{"type":"string","minLength":1,"maxLength":120,"description":"One line shown as the card's title."},"card_kind":{"enum":["profile"],"description":"What the card is; profile delivers the Human's Personal Profile."},"message_segments":{"type":"array","minItems":1,"maxItems":1000,"items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["type","content"],"properties":{"type":{"const":"text"},"content":{"type":"string","minLength":1,"maxLength":50000,"pattern":"\\\\S"}}},{"type":"object","additionalProperties":false,"required":["type","content","target","target_type"],"properties":{"type":{"const":"reference"},"content":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[^\\\\r\\\\n]+$"},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"target_type":{"enum":["user","agent"]}}},{"type":"object","additionalProperties":false,"required":["type","document_id","content"],"properties":{"type":{"const":"document"},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"content":{"type":"string","minLength":1,"maxLength":50000},"presentation":{"enum":["inline","card","canvas"],"default":"inline"}}},{"type":"object","additionalProperties":false,"required":["type","content-path"],"properties":{"type":{"const":"document"},"content-path":{"type":"string","minLength":1,"description":"Local resource path relative to cwd; stdin, URLs, symlinks and private paths are rejected."},"content":{"type":"string","minLength":1,"maxLength":50000},"mode":{"enum":["document","file","tree"]}}},{"type":"object","additionalProperties":false,"required":["type","title","content"],"properties":{"type":{"const":"fragment"},"title":{"type":"string","minLength":1,"maxLength":120,"description":"One plain line naming the fragment, e.g. Launch tracker."},"content":{"type":"string","minLength":1,"maxLength":2097152}}},{"type":"object","additionalProperties":false,"required":["type","title","content-path"],"properties":{"type":{"const":"fragment"},"title":{"type":"string","minLength":1,"maxLength":120,"description":"One plain line naming the fragment, e.g. Launch tracker."},"content-path":{"type":"string","minLength":1,"description":"Local resource path relative to cwd; stdin, URLs, symlinks and private paths are rejected."}}}]}}},"description":"--title is the card's one-line title; --kind profile marks a Personal Profile delivery; --content/--file is its one-line result; --attach publishes local files and --document shows existing Documents, both repeatable. Resource preparation and message submission share one atomic operation."},"output_schema":{"type":"object","additionalProperties":false,"required":["accepted","target","message_id","resources","duplicate_request"],"properties":{"accepted":{"const":true},"target":{"type":"object","additionalProperties":false,"required":["type","id"],"properties":{"type":{"enum":["room","thread","task"]},"id":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"}}},"inbox_id":{"type":"string"},"task_id":{"type":"string"},"message_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"resources":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","segment_index","status","document_id","name"],"properties":{"kind":{"const":"document"},"segment_index":{"type":"integer","minimum":0},"status":{"enum":["published","reused"]},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"revision_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"name":{"type":"string","minLength":1}},"anyOf":[{"required":["version_id"]},{"required":["revision_id"]}]},{"type":"object","additionalProperties":false,"required":["kind","segment_index","status","publication_group_id","root_placement_path","file_count","directory_count","total_bytes","documents"],"properties":{"kind":{"const":"tree"},"segment_index":{"type":"integer","minimum":0},"status":{"enum":["published","reused"]},"publication_group_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"root_placement_path":{"type":"string","minLength":1},"file_count":{"type":"integer","minimum":0},"directory_count":{"type":"integer","minimum":0},"total_bytes":{"type":"integer","minimum":0},"documents":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["relative_path","document_id","document_version_id"],"properties":{"relative_path":{"type":"string","minLength":1},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"document_version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}}}},"entry_document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"entry_document_version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}},"dependencies":{"entry_document_id":["entry_document_version_id"],"entry_document_version_id":["entry_document_id"]}}]}},"duplicate_request":{"type":"boolean"},"reason":{"type":"string","minLength":1}}},"cli":{"usage":["[--thread <id>] [--kind profile] --title <text> (--content <text> | --file <path|->) [--attach <path> ...] [--document <id> ...]"],"arguments":[],"options":{"--thread":{"description":"Bare Thread ID inside the configured Room."},"--title":{"description":"The card's title: one line, at most 120 characters."},"--kind":{"description":"Only profile: marks the delivery of the Human's Personal Profile."},"--content":{"description":"Inline body text; never read as a path. Outside code, \\\\n and \\\\t become a line break and a tab, and \\\\\\\\ becomes \\\\ (write \\\\\\\\n for a literal \\\\n; inside shell double quotes type \\\\\\\\\\\\\\\\n). Code and --file bodies are never decoded."},"--file":{"description":"Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc)."},"--attach":{"description":"Local file published with the card, e.g. from ./playground/<task-id>/; repeatable, no directories.","repeatable":true},"--document":{"description":"Existing Document ID shown on the card; repeatable.","repeatable":true},"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":["The body is a one-line result kept with the card; the Web shows only the title and files (and the body of a profile card). Put details in the files, and say what the user should add or check in one ordinary message after the card.","--content/--file support [@Name](user:actor_id) or [@Name](agent:actor_id).","A failed Task is not delivered as a card; say what happened in an ordinary message.","Resource paths cannot use stdin or URLs. Publication and message commit are atomic."]}}
+{"command":["message","card"],"description":"Send one light card to the Room or one of its Threads: a title, a one-line result and files. Deliver a finished background Task's result with it, or point out something the user must notice; reply in ordinary messages otherwise.","read_only":false,"input_schema":{"type":"object","additionalProperties":false,"required":["inbox_id","card_title","message_segments"],"properties":{"inbox_id":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"card_title":{"type":"string","minLength":1,"maxLength":120,"description":"One line shown as the card's title."},"card_kind":{"enum":["profile"],"description":"What the card is; profile delivers the Human's Personal Profile."},"message_segments":{"type":"array","minItems":1,"maxItems":1000,"items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["type","content"],"properties":{"type":{"const":"text"},"content":{"type":"string","minLength":1,"maxLength":50000,"pattern":"\\\\S"}}},{"type":"object","additionalProperties":false,"required":["type","content","target","target_type"],"properties":{"type":{"const":"reference"},"content":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[^\\\\r\\\\n]+$"},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"target_type":{"enum":["user","agent"]}}},{"type":"object","additionalProperties":false,"required":["type","document_id","content"],"properties":{"type":{"const":"document"},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"content":{"type":"string","minLength":1,"maxLength":50000},"presentation":{"enum":["inline","card","canvas"],"default":"inline"}}},{"type":"object","additionalProperties":false,"required":["type","content-path"],"properties":{"type":{"const":"document"},"content-path":{"type":"string","minLength":1,"description":"Local resource path relative to cwd; stdin, URLs, symlinks and private paths are rejected."},"content":{"type":"string","minLength":1,"maxLength":50000},"mode":{"enum":["document","file","tree"]}}},{"type":"object","additionalProperties":false,"required":["type","title","content"],"properties":{"type":{"const":"fragment"},"title":{"type":"string","minLength":1,"maxLength":120,"description":"One plain line naming the fragment, e.g. Launch tracker."},"content":{"type":"string","minLength":1,"maxLength":2097152}}},{"type":"object","additionalProperties":false,"required":["type","title","content-path"],"properties":{"type":{"const":"fragment"},"title":{"type":"string","minLength":1,"maxLength":120,"description":"One plain line naming the fragment, e.g. Launch tracker."},"content-path":{"type":"string","minLength":1,"description":"Local resource path relative to cwd; stdin, URLs, symlinks and private paths are rejected."}}}]}}},"description":"--title is the card's one-line title; --kind profile marks a Personal Profile delivery; --content/--file is its one-line result; --attach publishes local files and --document shows existing Documents, both repeatable. Resource preparation and message submission share one atomic operation."},"output_schema":{"type":"object","additionalProperties":false,"required":["accepted","target","message_id","resources","duplicate_request"],"properties":{"accepted":{"const":true},"target":{"type":"object","additionalProperties":false,"required":["type","id"],"properties":{"type":{"enum":["room","thread","task"]},"id":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"}}},"inbox_id":{"type":"string"},"task_id":{"type":"string"},"message_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"resources":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","segment_index","status","document_id","name"],"properties":{"kind":{"const":"document"},"segment_index":{"type":"integer","minimum":0},"status":{"enum":["published","reused"]},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"revision_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"name":{"type":"string","minLength":1}},"anyOf":[{"required":["version_id"]},{"required":["revision_id"]}]},{"type":"object","additionalProperties":false,"required":["kind","segment_index","status","publication_group_id","root_placement_path","file_count","directory_count","total_bytes","documents"],"properties":{"kind":{"const":"tree"},"segment_index":{"type":"integer","minimum":0},"status":{"enum":["published","reused"]},"publication_group_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"root_placement_path":{"type":"string","minLength":1},"file_count":{"type":"integer","minimum":0},"directory_count":{"type":"integer","minimum":0},"total_bytes":{"type":"integer","minimum":0},"documents":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["relative_path","document_id","document_version_id"],"properties":{"relative_path":{"type":"string","minLength":1},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"document_version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}}}},"entry_document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"entry_document_version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}},"dependencies":{"entry_document_id":["entry_document_version_id"],"entry_document_version_id":["entry_document_id"]}}]}},"duplicate_request":{"type":"boolean"},"reason":{"type":"string","minLength":1}}},"cli":{"usage":["[--thread <id>] [--kind profile] --title <text> (--content <text> | --file <path|->) [--attach <path> ...] [--document <id> ...]"],"arguments":[],"options":{"--thread":{"description":"Bare Thread ID inside the configured Room."},"--title":{"description":"The card's title: one line, at most 120 characters."},"--kind":{"description":"Only profile: marks the delivery of the Human's Personal Profile."},"--content":{"description":"Inline body text; never read as a path. Outside code, \\\\n and \\\\t become a line break and a tab, and \\\\\\\\ becomes \\\\ (write \\\\\\\\n for a literal \\\\n; inside shell double quotes type \\\\\\\\\\\\\\\\n). Code and --file bodies are never decoded."},"--file":{"description":"Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them."},"--attach":{"description":"Local file published with the card, e.g. from ./playground/<task-id>/; repeatable, no directories.","repeatable":true},"--document":{"description":"Existing Document ID shown on the card; repeatable.","repeatable":true},"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":["The body is a one-line result kept with the card; the Web shows only the title and files (and the body of a profile card). Put details in the files, and say what the user should add or check in one ordinary message after the card.","--content/--file support [@Name](user:actor_id) or [@Name](agent:actor_id).","A failed Task is not delivered as a card; say what happened in an ordinary message.","Resource paths cannot use stdin or URLs. Publication and message commit are atomic."]}}
",
},
"message direct": {
@@ -1859,7 +1859,7 @@ Send private messages to the current Agent's Human sponsor.
Options:
--content <value> Inline body text; never read as a path. Outside code, \\n and \\t become a line break and a tab, and \\\\ becomes \\ (write \\\\n for a literal \\n; inside shell double quotes type \\\\\\\\n). Code and --file bodies are never decoded.
- --file <value> Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).
+ --file <value> Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.
--messages <value> Complete array of 1-100 nonblank strings.
--messages-file <value> Read the complete string array from a file or stdin.
--json Return machine-readable JSON.
@@ -1872,7 +1872,7 @@ TeamHub resolves the Sponsor. No recipient lookup or configured Room fallback.
Bodies do not create structured mentions or upload resources.
",
"schema": "exit 0
-{"command":["message","direct"],"description":"Send private messages to the current Agent's Human sponsor.","read_only":false,"input_schema":{"type":"object","additionalProperties":false,"required":["messages"],"properties":{"messages":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":50000,"pattern":"\\\\S"}}}},"output_schema":{"type":"object","additionalProperties":false,"required":["accepted","inbox_id","message_ids","room_created","duplicate_request"],"properties":{"accepted":{"const":true},"inbox_id":{"type":"string"},"message_ids":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}},"room_created":{"type":"boolean"},"duplicate_request":{"type":"boolean"},"reason":{"type":"string","minLength":1}}},"cli":{"usage":["(--content <text> | --file <path|->) ...","(--messages <JSON> | --messages-file <path|->)"],"arguments":[],"options":{"--content":{"description":"Inline body text; never read as a path. Outside code, \\\\n and \\\\t become a line break and a tab, and \\\\\\\\ becomes \\\\ (write \\\\\\\\n for a literal \\\\n; inside shell double quotes type \\\\\\\\\\\\\\\\n). Code and --file bodies are never decoded.","repeatable":true},"--file":{"description":"Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).","repeatable":true},"--messages":{"description":"Complete array of 1-100 nonblank strings."},"--messages-file":{"description":"Read the complete string array from a file or stdin."},"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":["Each body is one complete message; blank lines do not split messages.","TeamHub resolves the Sponsor. No recipient lookup or configured Room fallback.","Bodies do not create structured mentions or upload resources."]}}
+{"command":["message","direct"],"description":"Send private messages to the current Agent's Human sponsor.","read_only":false,"input_schema":{"type":"object","additionalProperties":false,"required":["messages"],"properties":{"messages":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":50000,"pattern":"\\\\S"}}}},"output_schema":{"type":"object","additionalProperties":false,"required":["accepted","inbox_id","message_ids","room_created","duplicate_request"],"properties":{"accepted":{"const":true},"inbox_id":{"type":"string"},"message_ids":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}},"room_created":{"type":"boolean"},"duplicate_request":{"type":"boolean"},"reason":{"type":"string","minLength":1}}},"cli":{"usage":["(--content <text> | --file <path|->) ...","(--messages <JSON> | --messages-file <path|->)"],"arguments":[],"options":{"--content":{"description":"Inline body text; never read as a path. Outside code, \\\\n and \\\\t become a line break and a tab, and \\\\\\\\ becomes \\\\ (write \\\\\\\\n for a literal \\\\n; inside shell double quotes type \\\\\\\\\\\\\\\\n). Code and --file bodies are never decoded.","repeatable":true},"--file":{"description":"Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.","repeatable":true},"--messages":{"description":"Complete array of 1-100 nonblank strings."},"--messages-file":{"description":"Read the complete string array from a file or stdin."},"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":["Each body is one complete message; blank lines do not split messages.","TeamHub resolves the Sponsor. No recipient lookup or configured Room fallback.","Bodies do not create structured mentions or upload resources."]}}
",
},
"message emoji": {
@@ -1951,7 +1951,7 @@ Send one message and optional resources, or coordinate privately.
Options:
--thread <value> Bare Thread ID inside the configured Room.
--content <value> Inline body text; never read as a path. Outside code, \\n and \\t become a line break and a tab, and \\\\ becomes \\ (write \\\\n for a literal \\n; inside shell double quotes type \\\\\\\\n). Code and --file bodies are never decoded.
- --file <value> Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).
+ --file <value> Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.
--message <value> One complete JSON object.
--message-file <value> Read one complete JSON object from a file or stdin.
--attach <value> Public file delivery appended after the body; repeatable, no directories.
@@ -1973,11 +1973,14 @@ Resource paths cannot use stdin or URLs. Publication and message commit are atom
--continuing keeps the turn shown as working after this message; omit it on the final or only answer.
Examples:
teamhub message send --content "Done."
+teamhub message send --file - <<'EOF'
+Done: $180/store/month, as agreed.
+EOF
teamhub message send --content "[@Reviewer](agent:actor_reviewer) Please review this result."
teamhub message send --message '{"segments":[{"type":"fragment","title":"Weekly sales","content-path":"./playground/weekly-sales.html"}]}'
",
"schema": "exit 0
-{"command":["message","send"],"description":"Send one message and optional resources, or coordinate privately.","read_only":false,"input_schema":{"type":"object","additionalProperties":false,"required":["inbox_id","message_segments"],"properties":{"inbox_id":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"message_segments":{"type":"array","minItems":1,"maxItems":1000,"items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["type","content"],"properties":{"type":{"const":"text"},"content":{"type":"string","minLength":1,"maxLength":50000,"pattern":"\\\\S"}}},{"type":"object","additionalProperties":false,"required":["type","content","target","target_type"],"properties":{"type":{"const":"reference"},"content":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[^\\\\r\\\\n]+$"},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"target_type":{"enum":["user","agent"]}}},{"type":"object","additionalProperties":false,"required":["type","document_id","content"],"properties":{"type":{"const":"document"},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"content":{"type":"string","minLength":1,"maxLength":50000},"presentation":{"enum":["inline","card","canvas"],"default":"inline"}}},{"type":"object","additionalProperties":false,"required":["type","content-path"],"properties":{"type":{"const":"document"},"content-path":{"type":"string","minLength":1,"description":"Local resource path relative to cwd; stdin, URLs, symlinks and private paths are rejected."},"content":{"type":"string","minLength":1,"maxLength":50000},"mode":{"enum":["document","file","tree"]}}},{"type":"object","additionalProperties":false,"required":["type","title","content"],"properties":{"type":{"const":"fragment"},"title":{"type":"string","minLength":1,"maxLength":120,"description":"One plain line naming the fragment, e.g. Launch tracker."},"content":{"type":"string","minLength":1,"maxLength":2097152}}},{"type":"object","additionalProperties":false,"required":["type","title","content-path"],"properties":{"type":{"const":"fragment"},"title":{"type":"string","minLength":1,"maxLength":120,"description":"One plain line naming the fragment, e.g. Launch tracker."},"content-path":{"type":"string","minLength":1,"description":"Local resource path relative to cwd; stdin, URLs, symlinks and private paths are rejected."}}}]}},"source_message_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"continues":{"const":true}},"description":"--content/--file parse ordered text and explicit Actor references; --attach appends local document segments. --message/--message-file accept only {segments:[...]}. The message goes to the configured Room, or --thread. Resource preparation and message submission share one atomic operation."},"output_schema":{"type":"object","additionalProperties":false,"required":["accepted","target","message_id","resources","duplicate_request"],"properties":{"accepted":{"const":true},"target":{"type":"object","additionalProperties":false,"required":["type","id"],"properties":{"type":{"enum":["room","thread","task"]},"id":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"}}},"inbox_id":{"type":"string"},"task_id":{"type":"string"},"message_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"resources":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","segment_index","status","document_id","name"],"properties":{"kind":{"const":"document"},"segment_index":{"type":"integer","minimum":0},"status":{"enum":["published","reused"]},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"revision_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"name":{"type":"string","minLength":1}},"anyOf":[{"required":["version_id"]},{"required":["revision_id"]}]},{"type":"object","additionalProperties":false,"required":["kind","segment_index","status","publication_group_id","root_placement_path","file_count","directory_count","total_bytes","documents"],"properties":{"kind":{"const":"tree"},"segment_index":{"type":"integer","minimum":0},"status":{"enum":["published","reused"]},"publication_group_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"root_placement_path":{"type":"string","minLength":1},"file_count":{"type":"integer","minimum":0},"directory_count":{"type":"integer","minimum":0},"total_bytes":{"type":"integer","minimum":0},"documents":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["relative_path","document_id","document_version_id"],"properties":{"relative_path":{"type":"string","minLength":1},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"document_version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}}}},"entry_document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"entry_document_version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}},"dependencies":{"entry_document_id":["entry_document_version_id"],"entry_document_version_id":["entry_document_id"]}}]}},"duplicate_request":{"type":"boolean"},"reason":{"type":"string","minLength":1}}},"cli":{"usage":["[target] (--content <text> | --file <path|->) [--attach <path> ...]","[target] (--message <JSON> | --message-file <path|->)"],"arguments":[],"options":{"--thread":{"description":"Bare Thread ID inside the configured Room."},"--content":{"description":"Inline body text; never read as a path. Outside code, \\\\n and \\\\t become a line break and a tab, and \\\\\\\\ becomes \\\\ (write \\\\\\\\n for a literal \\\\n; inside shell double quotes type \\\\\\\\\\\\\\\\n). Code and --file bodies are never decoded."},"--file":{"description":"Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc)."},"--message":{"description":"One complete JSON object."},"--message-file":{"description":"Read one complete JSON object from a file or stdin."},"--attach":{"description":"Public file delivery appended after the body; repeatable, no directories.","repeatable":true},"--reply-to":{"description":"Reply source for the whole message; Room/Thread only."},"--continuing":{"description":"Declare that more work in this turn follows this message (acknowledgement or stage update). Never use it on the final answer.","boolean":true},"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":["Complete message: {\\"segments\\":[...]}; 1-1000 ordered segments.","text: content. reference: content, target, target_type=user|agent.","document: document_id + content, optional presentation=inline|card|canvas (canvas also opens it in the side panel of people viewing the Room); OR content-path + optional content/mode=document|file|tree.","Images and videos are files: attach them like any other file (content-path, or --attach).","fragment: a title plus exactly one inline HTML/SVG content or UTF-8 content-path. title is one plain line of at most 120 characters (e.g. Launch tracker) that previews and quotes show; do not repeat it as a heading inside the fragment. Read the chat-card skill for the fragment's shape and theme before writing one.","--content/--file support [@Name](user:actor_id) or [@Name](agent:actor_id); code/escaped mentions stay literal. Complete messages require explicit reference segments.","An Agent receives a Room/Thread handoff notification only when you @ it with an Agent reference; writing its name or plain @Name does not notify it.","Resource paths cannot use stdin or URLs. Publication and message commit are atomic.","--continuing keeps the turn shown as working after this message; omit it on the final or only answer."]}}
+{"command":["message","send"],"description":"Send one message and optional resources, or coordinate privately.","read_only":false,"input_schema":{"type":"object","additionalProperties":false,"required":["inbox_id","message_segments"],"properties":{"inbox_id":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"message_segments":{"type":"array","minItems":1,"maxItems":1000,"items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["type","content"],"properties":{"type":{"const":"text"},"content":{"type":"string","minLength":1,"maxLength":50000,"pattern":"\\\\S"}}},{"type":"object","additionalProperties":false,"required":["type","content","target","target_type"],"properties":{"type":{"const":"reference"},"content":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[^\\\\r\\\\n]+$"},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"target_type":{"enum":["user","agent"]}}},{"type":"object","additionalProperties":false,"required":["type","document_id","content"],"properties":{"type":{"const":"document"},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"content":{"type":"string","minLength":1,"maxLength":50000},"presentation":{"enum":["inline","card","canvas"],"default":"inline"}}},{"type":"object","additionalProperties":false,"required":["type","content-path"],"properties":{"type":{"const":"document"},"content-path":{"type":"string","minLength":1,"description":"Local resource path relative to cwd; stdin, URLs, symlinks and private paths are rejected."},"content":{"type":"string","minLength":1,"maxLength":50000},"mode":{"enum":["document","file","tree"]}}},{"type":"object","additionalProperties":false,"required":["type","title","content"],"properties":{"type":{"const":"fragment"},"title":{"type":"string","minLength":1,"maxLength":120,"description":"One plain line naming the fragment, e.g. Launch tracker."},"content":{"type":"string","minLength":1,"maxLength":2097152}}},{"type":"object","additionalProperties":false,"required":["type","title","content-path"],"properties":{"type":{"const":"fragment"},"title":{"type":"string","minLength":1,"maxLength":120,"description":"One plain line naming the fragment, e.g. Launch tracker."},"content-path":{"type":"string","minLength":1,"description":"Local resource path relative to cwd; stdin, URLs, symlinks and private paths are rejected."}}}]}},"source_message_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"continues":{"const":true}},"description":"--content/--file parse ordered text and explicit Actor references; --attach appends local document segments. --message/--message-file accept only {segments:[...]}. The message goes to the configured Room, or --thread. Resource preparation and message submission share one atomic operation."},"output_schema":{"type":"object","additionalProperties":false,"required":["accepted","target","message_id","resources","duplicate_request"],"properties":{"accepted":{"const":true},"target":{"type":"object","additionalProperties":false,"required":["type","id"],"properties":{"type":{"enum":["room","thread","task"]},"id":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"}}},"inbox_id":{"type":"string"},"task_id":{"type":"string"},"message_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"resources":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","segment_index","status","document_id","name"],"properties":{"kind":{"const":"document"},"segment_index":{"type":"integer","minimum":0},"status":{"enum":["published","reused"]},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"revision_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"name":{"type":"string","minLength":1}},"anyOf":[{"required":["version_id"]},{"required":["revision_id"]}]},{"type":"object","additionalProperties":false,"required":["kind","segment_index","status","publication_group_id","root_placement_path","file_count","directory_count","total_bytes","documents"],"properties":{"kind":{"const":"tree"},"segment_index":{"type":"integer","minimum":0},"status":{"enum":["published","reused"]},"publication_group_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"root_placement_path":{"type":"string","minLength":1},"file_count":{"type":"integer","minimum":0},"directory_count":{"type":"integer","minimum":0},"total_bytes":{"type":"integer","minimum":0},"documents":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["relative_path","document_id","document_version_id"],"properties":{"relative_path":{"type":"string","minLength":1},"document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"document_version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}}}},"entry_document_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"entry_document_version_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}},"dependencies":{"entry_document_id":["entry_document_version_id"],"entry_document_version_id":["entry_document_id"]}}]}},"duplicate_request":{"type":"boolean"},"reason":{"type":"string","minLength":1}}},"cli":{"usage":["[target] (--content <text> | --file <path|->) [--attach <path> ...]","[target] (--message <JSON> | --message-file <path|->)"],"arguments":[],"options":{"--thread":{"description":"Bare Thread ID inside the configured Room."},"--content":{"description":"Inline body text; never read as a path. Outside code, \\\\n and \\\\t become a line break and a tab, and \\\\\\\\ becomes \\\\ (write \\\\\\\\n for a literal \\\\n; inside shell double quotes type \\\\\\\\\\\\\\\\n). Code and --file bodies are never decoded."},"--file":{"description":"Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them."},"--message":{"description":"One complete JSON object."},"--message-file":{"description":"Read one complete JSON object from a file or stdin."},"--attach":{"description":"Public file delivery appended after the body; repeatable, no directories.","repeatable":true},"--reply-to":{"description":"Reply source for the whole message; Room/Thread only."},"--continuing":{"description":"Declare that more work in this turn follows this message (acknowledgement or stage update). Never use it on the final answer.","boolean":true},"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":["Complete message: {\\"segments\\":[...]}; 1-1000 ordered segments.","text: content. reference: content, target, target_type=user|agent.","document: document_id + content, optional presentation=inline|card|canvas (canvas also opens it in the side panel of people viewing the Room); OR content-path + optional content/mode=document|file|tree.","Images and videos are files: attach them like any other file (content-path, or --attach).","fragment: a title plus exactly one inline HTML/SVG content or UTF-8 content-path. title is one plain line of at most 120 characters (e.g. Launch tracker) that previews and quotes show; do not repeat it as a heading inside the fragment. Read the chat-card skill for the fragment's shape and theme before writing one.","--content/--file support [@Name](user:actor_id) or [@Name](agent:actor_id); code/escaped mentions stay literal. Complete messages require explicit reference segments.","An Agent receives a Room/Thread handoff notification only when you @ it with an Agent reference; writing its name or plain @Name does not notify it.","Resource paths cannot use stdin or URLs. Publication and message commit are atomic.","--continuing keeps the turn shown as working after this message; omit it on the final or only answer."]}}
",
},
"message sequence": {
@@ -1988,7 +1991,7 @@ Queue 2-8 ordered conversational bubbles in a Room.
Options:
--content <value> Inline body text; never read as a path. Outside code, \\n and \\t become a line break and a tab, and \\\\ becomes \\ (write \\\\n for a literal \\n; inside shell double quotes type \\\\\\\\n). Code and --file bodies are never decoded.
- --file <value> Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).
+ --file <value> Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.
--message <value> One complete JSON object.
--message-file <value> Read one complete JSON object from a file or stdin.
--pause <value> Required ordinary-mode rhythm: none, brief or natural.
@@ -2003,7 +2006,7 @@ Presentation is queued; accepted does not mean every bubble has been displayed.
Only the current AnotherMe Meta collaboration identity may queue sequences.
",
"schema": "exit 0
-{"command":["message","sequence"],"description":"Queue 2-8 ordered conversational bubbles in a Room.","read_only":false,"input_schema":{"type":"object","additionalProperties":false,"required":["inbox_id","messages"],"properties":{"inbox_id":{"type":"string","pattern":"^room[_-][A-Za-z0-9_-]*$","minLength":6,"maxLength":64},"messages":{"type":"array","minItems":2,"maxItems":8,"items":[{"type":"object","additionalProperties":false,"required":["content","pause_before"],"properties":{"content":{"type":"string","minLength":1,"maxLength":50000,"pattern":"\\\\S"},"pause_before":{"const":"none"}}}],"additionalItems":{"type":"object","additionalProperties":false,"required":["content","pause_before"],"properties":{"content":{"type":"string","minLength":1,"maxLength":50000,"pattern":"\\\\S"},"pause_before":{"enum":["none","brief","natural"]}}}},"source_message_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}}},"output_schema":{"type":"object","additionalProperties":false,"required":["accepted","inbox_id","sequence_id","duplicate_request"],"properties":{"accepted":{"const":true},"inbox_id":{"type":"string"},"sequence_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"duplicate_request":{"type":"boolean"},"reason":{"type":"string","minLength":1}}},"cli":{"usage":["(--content <text> | --file <path|->) ... --pause <tier>","(--message <JSON> | --message-file <path|->)"],"arguments":[],"options":{"--content":{"description":"Inline body text; never read as a path. Outside code, \\\\n and \\\\t become a line break and a tab, and \\\\\\\\ becomes \\\\ (write \\\\\\\\n for a literal \\\\n; inside shell double quotes type \\\\\\\\\\\\\\\\n). Code and --file bodies are never decoded.","repeatable":true},"--file":{"description":"Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).","repeatable":true},"--message":{"description":"One complete JSON object."},"--message-file":{"description":"Read one complete JSON object from a file or stdin."},"--pause":{"description":"Required ordinary-mode rhythm: none, brief or natural."},"--reply-to":{"description":"Shared reply source for the whole sequence."},"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":["First bubble pause_before is always none. Complete input specifies every pause explicitly.","Presentation is queued; accepted does not mean every bubble has been displayed.","Only the current AnotherMe Meta collaboration identity may queue sequences."]}}
+{"command":["message","sequence"],"description":"Queue 2-8 ordered conversational bubbles in a Room.","read_only":false,"input_schema":{"type":"object","additionalProperties":false,"required":["inbox_id","messages"],"properties":{"inbox_id":{"type":"string","pattern":"^room[_-][A-Za-z0-9_-]*$","minLength":6,"maxLength":64},"messages":{"type":"array","minItems":2,"maxItems":8,"items":[{"type":"object","additionalProperties":false,"required":["content","pause_before"],"properties":{"content":{"type":"string","minLength":1,"maxLength":50000,"pattern":"\\\\S"},"pause_before":{"const":"none"}}}],"additionalItems":{"type":"object","additionalProperties":false,"required":["content","pause_before"],"properties":{"content":{"type":"string","minLength":1,"maxLength":50000,"pattern":"\\\\S"},"pause_before":{"enum":["none","brief","natural"]}}}},"source_message_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"}}},"output_schema":{"type":"object","additionalProperties":false,"required":["accepted","inbox_id","sequence_id","duplicate_request"],"properties":{"accepted":{"const":true},"inbox_id":{"type":"string"},"sequence_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"duplicate_request":{"type":"boolean"},"reason":{"type":"string","minLength":1}}},"cli":{"usage":["(--content <text> | --file <path|->) ... --pause <tier>","(--message <JSON> | --message-file <path|->)"],"arguments":[],"options":{"--content":{"description":"Inline body text; never read as a path. Outside code, \\\\n and \\\\t become a line break and a tab, and \\\\\\\\ becomes \\\\ (write \\\\\\\\n for a literal \\\\n; inside shell double quotes type \\\\\\\\\\\\\\\\n). Code and --file bodies are never decoded.","repeatable":true},"--file":{"description":"Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.","repeatable":true},"--message":{"description":"One complete JSON object."},"--message-file":{"description":"Read one complete JSON object from a file or stdin."},"--pause":{"description":"Required ordinary-mode rhythm: none, brief or natural."},"--reply-to":{"description":"Shared reply source for the whole sequence."},"--json":{"description":"Return machine-readable JSON.","boolean":true},"--help":{"description":"Show this offline command reference.","boolean":true},"-h":{"description":"Show help.","boolean":true},"--schema":{"description":"Show offline input and output schemas.","boolean":true},"--operation-id":{"description":"Stable operation identity for recovery."}},"notes":["First bubble pause_before is always none. Complete input specifies every pause explicitly.","Presentation is queued; accepted does not mean every bubble has been displayed.","Only the current AnotherMe Meta collaboration identity may queue sequences."]}}
",
},
"notion append": {
@@ -4192,7 +4195,7 @@ Send one message and optional resources, or coordinate privately.
Options:
--thread <value> Bare Thread ID inside the configured Room.
--content <value> Inline body text; never read as a path. Outside code, \\n and \\t become a line break and a tab, and \\\\ becomes \\ (write \\\\n for a literal \\n; inside shell double quotes type \\\\\\\\n). Code and --file bodies are never decoded.
- --file <value> Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).
+ --file <value> Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.
--message <value> One complete JSON object.
--message-file <value> Read one complete JSON object from a file or stdin.
--attach <value> Public file delivery appended after the body; repeatable, no directories.
@@ -4214,6 +4217,9 @@ Resource paths cannot use stdin or URLs. Publication and message commit are atom
--continuing keeps the turn shown as working after this message; omit it on the final or only answer.
Examples:
teamhub message send --content "Done."
+teamhub message send --file - <<'EOF'
+Done: $180/store/month, as agreed.
+EOF
teamhub message send --content "[@Reviewer](agent:actor_reviewer) Please review this result."
teamhub message send --message '{"segments":[{"type":"fragment","title":"Weekly sales","content-path":"./playground/weekly-sales.html"}]}'
@@ -4225,7 +4231,7 @@ Options:
--title <value> The card's title: one line, at most 120 characters.
--kind <value> Only profile: marks the delivery of the Human's Personal Profile.
--content <value> Inline body text; never read as a path. Outside code, \\n and \\t become a line break and a tab, and \\\\ becomes \\ (write \\\\n for a literal \\n; inside shell double quotes type \\\\\\\\n). Code and --file bodies are never decoded.
- --file <value> Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).
+ --file <value> Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.
--attach <value> Local file published with the card, e.g. from ./playground/<task-id>/; repeatable, no directories.
--document <value> Existing Document ID shown on the card; repeatable.
--json Return machine-readable JSON.
@@ -4246,7 +4252,7 @@ Queue 2-8 ordered conversational bubbles in a Room.
Options:
--content <value> Inline body text; never read as a path. Outside code, \\n and \\t become a line break and a tab, and \\\\ becomes \\ (write \\\\n for a literal \\n; inside shell double quotes type \\\\\\\\n). Code and --file bodies are never decoded.
- --file <value> Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).
+ --file <value> Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.
--message <value> One complete JSON object.
--message-file <value> Read one complete JSON object from a file or stdin.
--pause <value> Required ordinary-mode rhythm: none, brief or natural.
@@ -4302,7 +4308,7 @@ Send private messages to the current Agent's Human sponsor.
Options:
--content <value> Inline body text; never read as a path. Outside code, \\n and \\t become a line break and a tab, and \\\\ becomes \\ (write \\\\n for a literal \\n; inside shell double quotes type \\\\\\\\n). Code and --file bodies are never decoded.
- --file <value> Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).
+ --file <value> Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.
--messages <value> Complete array of 1-100 nonblank strings.
--messages-file <value> Read the complete string array from a file or stdin.
--json Return machine-readable JSON.
diff --git a/apps/teamhub-cli/src/document-commands.test.ts b/apps/teamhub-cli/src/document-commands.test.ts
index 130f19b4..37c426b2 100644
--- a/apps/teamhub-cli/src/document-commands.test.ts
+++ b/apps/teamhub-cli/src/document-commands.test.ts
@@ -131,6 +131,27 @@ describe("Document command boundary", () => {
scope: { kind: "document", id: "document_one" },
});
});
+ it("drops the line break that ends a heredoc only from inline replacements", async () => {
+ const edit = (action: string, ...extra: string[]) =>
+ normalize(
+ ["docs", "update"],
+ ["document_one", "--command", action, ...extra, "--file", "-"],
+ );
+ expect(
+ (await edit("str_replace", "--pattern", "Draft")).input,
+ ).toMatchObject({ content: " Body \u00e9" });
+ expect((await edit("append")).input).toMatchObject({
+ content: " Body \u00e9\n",
+ });
+ expect(
+ (
+ await normalize(
+ ["docs", "comment", "replace"],
+ ["thread_one", "--file", "-"],
+ )
+ ).input,
+ ).toEqual({ thread_id: "thread_one", replace_str: " Body \u00e9" });
+ });
it("maps duplicates only from validated replay flags and retains conflicts", () => {
const def = command("docs", "update");
expect(
diff --git a/apps/teamhub-cli/src/document-commands.ts b/apps/teamhub-cli/src/document-commands.ts
index 06ddfe02..ea2421d8 100644
--- a/apps/teamhub-cli/src/document-commands.ts
+++ b/apps/teamhub-cli/src/document-commands.ts
@@ -1,6 +1,8 @@
import { operationHeaders, teamHubData } from "./http-client.js";
import type {
+ CommandArguments,
CommandDefinition,
+ CommandInputReader,
NormalizedCommandInput,
} from "./command-definition.js";
import { reportInFinalReply } from "./command-definition.js";
@@ -24,6 +26,20 @@ const bodyOptions = {
description: "Read the UTF-8 body from a regular file or - for stdin.",
},
};
+/**
+ * The text of an edit that replaces a run of text in place. A file or heredoc
+ * ends its last line with a line break that is not part of that text, and
+ * would make a str_replace invalid or split the replaced line.
+ */
+async function inlineReplacement(
+ args: CommandArguments,
+ reader: CommandInputReader,
+): Promise<string | undefined> {
+ const text = await markdownBodySource(args, reader);
+ return option(args, "--file") === undefined
+ ? text
+ : text?.replace(/\r?\n$/u, "");
+}
const idPattern = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/u;
const inputError = (message: string) => new CliError("invalid_input", message);
function resource(value: unknown, kind: string): string {
@@ -515,7 +531,10 @@ export const documentCommandDefinitions: readonly CommandDefinition[] = [
if (value !== undefined) input[key] = value;
}
if (allowed.includes("--content"))
- input.content = await markdownBodySource(args, reader);
+ input.content =
+ action === "str_replace"
+ ? await inlineReplacement(args, reader)
+ : await markdownBodySource(args, reader);
const { editDocumentInputSchema } =
await import("./domains/collaboration/tools/document-tools.js");
return target(
@@ -742,7 +761,7 @@ export const documentCommandDefinitions: readonly CommandDefinition[] = [
assertPositionals(args, 1);
const input = {
thread_id: args.positionals[0],
- replace_str: await markdownBodySource(args, reader),
+ replace_str: await inlineReplacement(args, reader),
};
const { replaceDocumentCommentTextInputSchema } =
await import("./domains/collaboration/tools/document-comment-tools.js");
diff --git a/apps/teamhub-cli/src/message-commands.ts b/apps/teamhub-cli/src/message-commands.ts
index 82500aa5..c035da2f 100644
--- a/apps/teamhub-cli/src/message-commands.ts
+++ b/apps/teamhub-cli/src/message-commands.ts
@@ -175,7 +175,7 @@ const bodyOptions: Record<string, CommandOption> = {
},
"--file": {
description:
- "Read a UTF-8 body file; - consumes stdin (multi-line text, e.g. a heredoc).",
+ "Read a UTF-8 body file; - consumes stdin. Pass text through a quoted heredoc (<<'EOF'), which keeps $ and backticks literal; shell double quotes expand them.",
},
};
const completeOptions = {
@@ -569,6 +569,7 @@ export const messageCommandDefinitions: readonly CommandDefinition[] = [
],
examples: [
'teamhub message send --content "Done."',
+ "teamhub message send --file - <<'EOF'\nDone: $180/store/month, as agreed.\nEOF",
'teamhub message send --content "[@Reviewer](agent:actor_reviewer) Please review this result."',
`teamhub message send --message '{"segments":[{"type":"fragment","title":"Weekly sales","content-path":"./playground/weekly-sales.html"}]}'`,
],