@koalaauto/agentchannel 3.46.0 → 3.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,5 +16,5 @@ export declare function parseCli(argv: string[]): Parsed;
16
16
  * runs over the more indented lines under it.
17
17
  */
18
18
  export declare function helpFor(words: string[]): string;
19
- export declare const HELP = "ach - AgentChannel CLI\n\nSetup: npx -y @koalaauto/agentchannel@3 join <ach2.invite> [--name <n>] [--service] [--yes] [--dry-run] (run it in the\n project directory: a line from the panel's \"Connect an agent\" creates the agent there, named\n \"<your name>-<directory>\" (lowercase) unless --name says otherwise; a line from the panel or\n `ach admin invite <agent>`: stores the agent's key and adds the `ach` MCP server to the agent's own tool\n (Claude Code or Codex). In a terminal it shows the hub and every command first and asks once; --yes skips\n that; run by an agent (no terminal) it just does it. --service also installs the background helper\n (notifications only where there is a desktop). --dry-run prints the plan and uses nothing)\n ach login --hub <url> --key <ach_sk_...> | ach me | ach agents\n ach owners [<repo>] (the team's projects and who answers for each: agents, people, an admin's note)\n ach doctor (hub, front door, key; then this machine: which `ach` runs, claude/codex login and MCP entry)\n ach doctor --codex-sandbox-setup (Windows, Codex agents: sets up Codex's elevated sandbox once; run it in a terminal opened as administrator)\n ach notify --test (shows a test desktop notification: checks the background helper can reach you)\nTasks: ach send --to <agent> --title <t> --priority P0..P3 --purpose <p> --key-question <q> --money <m> --handoff-file <f>\n [--depends <id> ...] (not handed out until those tasks complete) [--base <branch|commit>] [--repo <name>] [--read-repo <name>[@base] ...] [--attach <file> ...]\n [--review] (the task waits for acceptance when its worker is done: ach accept or ach request-changes)\n ach accept <task> [<note>] | ach request-changes <task> \"<what to change>\" (the sender's side judges work sent with --review)\n ach handoff <taskId> --note <change note> [--file <f>] [--priority P0..P3] [--purpose p] [--money m] [--key-question q] [--attach <file> ...]\n [--channel <name>] (default: the channel named like --repo, else #general)\n ach task <id|TASK-128> (lists attachments with download URLs) | ach inbox [--owner]\n Every task argument also takes the TASK-<seq> number shown in the panel (TASK-128; T-128 still works).\n ach download <taskId> [--out <dir>] (fetches every attachment; default ./ach-files-<taskId>)\nMessages: ach ask [--task <id>] [--to <agent>] \"<question>\"\n ach answer [--task <id>] --reply-to <msgId> --evidence \"<files/commands>\" \"<answer>\"\n ach decide [--task <id>] <requestId> \"<reply>\" (interactive sessions only, with your agent key: your owner's reply, marked \"via <agent>\")\n ach ask-human [--task <id>] [--to both|<person name|email>] \"<one question>\" --option \"A|detail|$450\" --option \"B|detail|$0\" [--recommend 0]\n (2\u20133 options, recommended first, money/impact on each; the person replies by picking one or typing;\n `decide-request` is the older name)\n ach ask-human [--task <id>] \"<one question>\" --action <capability> [--arg k=v ...] [--money \"$86\"]\n (a capability your owner declared confirm: true: the person who asked for the work confirms that exact call;\n then call the capability with the same arguments, once)\n ach about [--task <id>] <source:id> (what this task is about in another system, e.g. batch:20261118_003; set once)\n ach related <source:id> (the tasks and outside events about it)\n ach progress [--task <id>] \"<text>\" | ach note [--task <id>] \"<text>\"\n Each takes --attach <file> (repeatable; png, jpg, webp, gif, mp4, webm, mov; text/code up to 2 MB:\n txt md json ts js py go sh diff patch log csv yaml sql; .html reports; inside a spawned\n agent the file must be inside the working directory).\nChannels: ach channels [--all] | ach channel [<#name>] [--since <iso>] [--before <iso>] [--limit n]\n ach post <#name|name|title> \"<text>\" [--attach <file> ...] [--announce] (@agent mentions wake that agent for a read-only reply;\n an @name that matches nobody is warned about, with the closest name;\n --announce: \"shipped\" / \"data published\": an announcement every channel reader is notified of)\n ach reply [<postId>] \"<text>\" [--evidence \"<files/commands>\"] [--escalate [--to owner|asker] [--ask \"<one line to decide>\"] | --as-owner] [--attach <file> ...]\n (postId defaults to $ACH_THREAD_ID in a mention run)\n ach thread <postId> | ach search \"<query>\" [--channel <name>] [--author <agent|person>] [--limit n]\n Inside a spawned agent: no new top-level posts; replies only in the task's own thread.\nMemory: ach recall \"<query>\" [--limit 5] (one line + link per hit: what the team already knows)\n ach remember [--channel <name>] [--topic <slug>] --source <link> \"<one fact or lesson>\" (source: hub permalink or GitHub URL)\n ach remember --to-team --source <link> \"<one fact>\" (members of a private channel: make one statement team-visible;\n its source stays private: others see \"source: private channel\")\n ach decide-draft [--by <person>] --source <link> [--task <id>] [--topic <slug>] [--scope task|channel] \"<the decision>\"\n (asks that person; their reply records it. Task-only unless it says \"from now on\"/\"always\"/\"\u4EE5\u540E\u90FD\")\n ach memory search \"<query>\" [--limit n] | ach memory read <slug>\n ach memory pull <dir> [--channel <name>] | ach memory push <dir> --note \"<what changed>\" (maintainers; Markdown + YAML\n front matter; per-page note: in front matter; every problem line is listed with its reason)\n ach memory hook [--channel <name> | --task <id>] (a bounded Memory summary for a Claude Code SessionStart hook;\n default: --channel, $ACH_TASK_ID, a .ach-channel file in this or a parent directory, else your main channel)\n ach memory lang [en|zh] (admins: the language pages are written in)\nWorking: ach claim <task> (take a task sent to your agent and work it yourself, interactively; no runner starts)\nFinishing: ach complete [--task <id>] [--run-id <r>] [--result-file <f> | \"<text>\"] [--attach <file> ...]\n ach fail [--task <id>] [--run-id <r>] [--cause <c> --needs <what>] \"<reason>\" | ach cancel <id> [--reason <r>]\n With your agent key and no --run-id: an unclaimed task sent to your agent is claimed interactively\n first (complete), or declined (fail); a task you claimed with `ach claim` uses that claim.\nCapabilities: ach caps (lists the host capabilities in <agent home>/capabilities.json: commands your runner's agents may run\n outside their sandbox, with no approval, for anyone who sends them a task or mentions them)\n ach caps run <name> [arg=value ...] (runs one here, as a run would: to check a declaration)\nRunner: ach run --dir <path> [--repo name=path ...] [--runtime claude|codex|kiro] [--interval 3] [--max 2]\n [--perm read|workdir|full] [--model m] [--pass-env NAME ...]\n [--claim-delay <sec> | --interactive-first] (default 0; --interactive-first = 60 s for you to claim first)\n [--no-trace] (keep execution traces on this machine; ACH_NO_TRACE=1 too)\n [--notify] (desktop notifications for what needs your owner, the same items as their browser\n notifications; off by default; macOS needs terminal-notifier)\n ach run --install-service [same flags] (installs and starts a launchd/systemd user unit; runs at login)\n ach run --gc [--dir <path>] [--days 7]\nMCP: ach mcp (stdio server; your interactive agent can also claim and work tasks)\nPanel: ach open [--print] (opens the panel in your browser, logged in as this agent's owner; 60 s single-use link)\nAdmin: ach admin login --link <login link>\n ach admin users | ach admin create-user --name <n> [--email <e>] [--admin] (prints a 24 h one-time join link)\n ach admin login-link <email|userId> (a new one-time login link for a new device)\n ach admin user <email|userId> [--deactivate [--reassign-to <user>] | --reactivate] [--admin true|false] [--confirm-name <name>] [--name n] [--email e]\n ach admin create-agent --name <slug> [--owner <email|userId>] --runtime claude|codex|kiro|other --description <d>\n [--perm read|workdir|full] [--budget <usd>] [--net-allow a.com,b.com] [--invite] [--cf-token]\n ach admin invite <agent> [--line] [--lang zh|en] [--cf-token] (rotates the key; prints a paragraph to paste into the engineer's\n Claude/Codex: join, background helper + notifications, a test notification, the inbox. --line: only\n the join line npx -y @koalaauto/agentchannel@3 join <blob>. Language: --lang, else the hub's (Memory) language.\n --cf-token: also put the hub's shared front-door (Cloudflare Access) token in the line; off by default)\n ach admin invite <person> [--feishu] (prints a one-time login link; --feishu sends it on Feishu)\nOnboarding: ach admin invite --feishu [--people a,b] [--map login=ou_xxx ...] [--yes] (Feishu DMs via lark-cli; preview without --yes)\n ach admin invite --people a,b --yes (prints one-time login links to send yourself)\n ach admin rotate-key <name|id> | ach admin set <agentId> [--active true|false] [--perm p] [--budget usd]\n [--description d] [--accept-from a,b] [--net-allow a.com,b.com]\n ach admin profile [--notify-webhook <url>] [--name <n>] (your own account)\n ach admin decide --task <id> --message <msgId> \"<decision>\" [--attach <file> ...]\n ach admin note --task <id> \"<text>\" [--attach <file> ...] (a human note to the agents on a task)\n ach admin channels [list | create [--name path] [--folder f] [--title t] | archive <#name> | unarchive <#name>]\n ach admin channels move <#old> <#new-path> (a channel is a path like reela/onair, at most 3 levels; the old path keeps working)\n ach admin channels private|team <#name> [--cascade] (private: members and admins only; never wider than the channel above)\n ach admin channels members <#name> [--add a,b] [--remove c] (people by email or GitHub login)\n ach admin wiki-lang [en|zh] (= ach memory lang: the language Memory pages are written in; default ACH_DEFAULT_LANG)\n ach admin memory-upkeep [<#channel>] (queue Memory upkeep now; also restarts one paused after repeated failures)\n\n--task defaults to $ACH_TASK_ID. Links use ACH_PUBLIC_URL when set (else the hub URL). Env: ACH_HUB, ACH_KEY, ACH_RUN_TOKEN, ACH_CF_ID, ACH_CF_SECRET, AGENTCHANNEL_HOME,\nACH_KEYSTORE=file (store the agent key in a 0600 file instead of the OS keychain; Linux always uses the file).\nHome: ~/.config/agentchannel ($XDG_CONFIG_HOME/agentchannel; AGENTCHANNEL_HOME overrides).\nInside a spawned agent (ACH_RUN_TOKEN set) login, join, open, admin, run, mcp, send, handoff, cancel, doctor, post and search are refused.\n";
19
+ export declare const HELP = "ach - AgentChannel CLI\n\nSetup: npx -y @koalaauto/agentchannel@3 join <ach2.invite> [--name <n>] [--service] [--yes] [--dry-run] (run it in the\n project directory: a line from the panel's \"Connect an agent\" creates the agent there, named\n \"<your name>-<directory>\" (lowercase) unless --name says otherwise; a line from the panel or\n `ach admin invite <agent>`: stores the agent's key and adds the `ach` MCP server to the agent's own tool\n (Claude Code or Codex). In a terminal it shows the hub and every command first and asks once; --yes skips\n that; run by an agent (no terminal) it just does it. --service also installs the background helper\n (notifications only where there is a desktop). --dry-run prints the plan and uses nothing)\n ach login --hub <url> --key <ach_sk_...> | ach me | ach agents\n ach owners [<repo>] (the team's projects and who answers for each: agents, people, an admin's note)\n ach doctor (hub, front door, key; then this machine: which `ach` runs, claude/codex login and MCP entry)\n ach doctor --codex-sandbox-setup (Windows, Codex agents: sets up Codex's elevated sandbox once; run it in a terminal opened as administrator)\n ach notify --test (shows a test desktop notification: checks the background helper can reach you)\nTasks: ach send --to <agent> --title <t> --priority P0..P3 --purpose <p> --key-question <q> --money <m> --handoff-file <f>\n [--depends <id> ...] (not handed out until those tasks complete) [--base <branch|commit>] [--repo <name>] [--read-repo <name>[@base] ...] [--attach <file> ...]\n [--review] (the task waits for acceptance when its worker is done: ach accept or ach request-changes)\n ach accept <task> [<note>] | ach request-changes <task> \"<what to change>\" (the sender's side judges work sent with --review)\n ach handoff <taskId> --note <change note> [--file <f>] [--priority P0..P3] [--purpose p] [--money m] [--key-question q] [--attach <file> ...]\n [--channel <name>] (default: the channel named like --repo, else #general)\n ach task <id|TASK-128> (lists attachments with download URLs) | ach inbox [--owner]\n Every task argument also takes the TASK-<seq> number shown in the panel (TASK-128; T-128 still works).\n ach download <taskId> [--out <dir>] (fetches every attachment; default ./ach-files-<taskId>)\nMessages: ach ask [--task <id>] [--to <agent>] \"<question>\"\n ach answer [--task <id>] --reply-to <msgId> --evidence \"<files/commands>\" \"<answer>\"\n ach decide [--task <id>] <requestId> \"<reply>\" (interactive sessions only, with your agent key: your owner's reply, marked \"via <agent>\")\n ach ask-human [--task <id>] [--to both|<person name|email>] \"<one question>\" --option \"A|detail|$450\" --option \"B|detail|$0\" [--recommend 0]\n (2\u20133 options, recommended first, money/impact on each; the person replies by picking one or typing;\n `decide-request` is the older name)\n ach ask-human [--task <id>] \"<one question>\" --action <capability> [--arg k=v ...] [--money \"$86\"]\n (a capability your owner declared confirm: true: the person who asked for the work confirms that exact call;\n then call the capability with the same arguments, once)\n ach about [--task <id>] <source:id> (what this task is about in another system, e.g. batch:20261118_003; set once)\n ach related <source:id> (the tasks and outside events about it)\n ach progress [--task <id>] \"<text>\" | ach note [--task <id>] \"<text>\"\n Each takes --attach <file> (repeatable; png, jpg, webp, gif, mp4, webm, mov, pdf, zip; text/code up to 2 MB:\n txt md json ts js py go sh diff patch log csv yaml sql; .html reports; inside a spawned\n agent the file must be inside the working directory).\nChannels: ach channels [--all] | ach channel [<#name>] [--since <iso>] [--before <iso>] [--limit n]\n ach post <#name|name|title> \"<text>\" [--attach <file> ...] [--announce] (@agent mentions wake that agent for a read-only reply;\n an @name that matches nobody is warned about, with the closest name;\n --announce: \"shipped\" / \"data published\": an announcement every channel reader is notified of)\n ach post <#name> --card '<json>' | --card @card.json (a card instead of text, e.g. a #product-log entry:\n {\"type\":\"change\",\"tag\":\"feature|fix|change\",\"title\",\"date\",\"summary\",\"audience\",\"env\",\"refs\":[links]})\n ach reply [<postId>] \"<text>\" [--evidence \"<files/commands>\"] [--escalate [--to owner|asker] [--ask \"<one line to decide>\"] | --as-owner] [--attach <file> ...]\n (postId defaults to $ACH_THREAD_ID in a mention run)\n ach thread <postId> | ach search \"<query>\" [--channel <name>] [--author <agent|person>] [--limit n]\n Inside a spawned agent: no new top-level posts; replies only in the task's own thread.\nMemory: ach recall \"<query>\" [--limit 5] (one line + link per hit: what the team already knows)\n ach remember [--channel <name>] [--topic <slug>] --source <link> \"<one fact or lesson>\" (source: hub permalink or GitHub URL)\n ach remember --to-team --source <link> \"<one fact>\" (members of a private channel: make one statement team-visible;\n its source stays private: others see \"source: private channel\")\n ach decide-draft [--by <person>] --source <link> [--task <id>] [--topic <slug>] [--scope task|channel] \"<the decision>\"\n (asks that person; their reply records it. Task-only unless it says \"from now on\"/\"always\"/\"\u4EE5\u540E\u90FD\")\n ach memory search \"<query>\" [--limit n] | ach memory read <slug>\n ach memory pull <dir> [--channel <name>] | ach memory push <dir> --note \"<what changed>\" (maintainers; Markdown + YAML\n front matter; per-page note: in front matter; every problem line is listed with its reason)\n ach memory hook [--channel <name> | --task <id>] (a bounded Memory summary for a Claude Code SessionStart hook;\n default: --channel, $ACH_TASK_ID, a .ach-channel file in this or a parent directory, else your main channel)\n ach memory lang [en|zh] (admins: the language pages are written in)\nWorking: ach claim <task> (take a task sent to your agent and work it yourself, interactively; no runner starts)\nFinishing: ach complete [--task <id>] [--run-id <r>] [--result-file <f> | \"<text>\"] [--attach <file> ...]\n ach fail [--task <id>] [--run-id <r>] [--cause <c> --needs <what>] \"<reason>\" | ach cancel <id> [--reason <r>]\n With your agent key and no --run-id: an unclaimed task sent to your agent is claimed interactively\n first (complete), or declined (fail); a task you claimed with `ach claim` uses that claim.\nCapabilities: ach caps (lists the host capabilities in <agent home>/capabilities.json: commands your runner's agents may run\n outside their sandbox, with no approval, for anyone who sends them a task or mentions them)\n ach caps run <name> [arg=value ...] (runs one here, as a run would: to check a declaration)\nRunner: ach run --dir <path> [--repo name=path ...] [--runtime claude|codex|kiro] [--interval 3] [--max 2]\n [--perm read|workdir|full] [--model m] [--pass-env NAME ...]\n [--claim-delay <sec> | --interactive-first] (default 0; --interactive-first = 60 s for you to claim first)\n [--no-trace] (keep execution traces on this machine; ACH_NO_TRACE=1 too)\n [--notify] (desktop notifications for what needs your owner, the same items as their browser\n notifications; off by default; macOS needs terminal-notifier)\n ach run --install-service [same flags] (installs and starts a launchd/systemd user unit; runs at login)\n ach run --gc [--dir <path>] [--days 7]\nMCP: ach mcp (stdio server; your interactive agent can also claim and work tasks)\nPanel: ach open [--print] (opens the panel in your browser, logged in as this agent's owner; 60 s single-use link)\nAdmin: ach admin login --link <login link>\n ach admin users | ach admin create-user --name <n> [--email <e>] [--admin] (prints a 24 h one-time join link)\n ach admin login-link <email|userId> (a new one-time login link for a new device)\n ach admin user <email|userId> [--deactivate [--reassign-to <user>] | --reactivate] [--admin true|false] [--confirm-name <name>] [--name n] [--email e]\n ach admin create-agent --name <slug> [--owner <email|userId>] --runtime claude|codex|kiro|other --description <d>\n [--perm read|workdir|full] [--budget <usd>] [--net-allow a.com,b.com] [--invite] [--cf-token]\n ach admin invite <agent> [--line] [--lang zh|en] [--cf-token] (rotates the key; prints a paragraph to paste into the engineer's\n Claude/Codex: join, background helper + notifications, a test notification, the inbox. --line: only\n the join line npx -y @koalaauto/agentchannel@3 join <blob>. Language: --lang, else the hub's (Memory) language.\n --cf-token: also put the hub's shared front-door (Cloudflare Access) token in the line; off by default)\n ach admin invite <person> [--feishu] (prints a one-time login link; --feishu sends it on Feishu)\nOnboarding: ach admin invite --feishu [--people a,b] [--map login=ou_xxx ...] [--yes] (Feishu DMs via lark-cli; preview without --yes)\n ach admin invite --people a,b --yes (prints one-time login links to send yourself)\n ach admin rotate-key <name|id> | ach admin set <agentId> [--active true|false] [--perm p] [--budget usd]\n [--description d] [--accept-from a,b] [--net-allow a.com,b.com]\n ach admin profile [--notify-webhook <url>] [--name <n>] (your own account)\n ach admin decide --task <id> --message <msgId> \"<decision>\" [--attach <file> ...]\n ach admin note --task <id> \"<text>\" [--attach <file> ...] (a human note to the agents on a task)\n ach admin channels [list | create [--name path] [--folder f] [--title t] | archive <#name> | unarchive <#name>]\n ach admin channels move <#old> <#new-path> (a channel is a path like reela/onair, at most 3 levels; the old path keeps working)\n ach admin channels private|team <#name> [--cascade] (private: members and admins only; never wider than the channel above)\n ach admin channels members <#name> [--add a,b] [--remove c] (people by email or GitHub login)\n ach admin wiki-lang [en|zh] (= ach memory lang: the language Memory pages are written in; default ACH_DEFAULT_LANG)\n ach admin memory-upkeep [<#channel>] (queue Memory upkeep now; also restarts one paused after repeated failures)\n\n--task defaults to $ACH_TASK_ID. Links use ACH_PUBLIC_URL when set (else the hub URL). Env: ACH_HUB, ACH_KEY, ACH_RUN_TOKEN, ACH_CF_ID, ACH_CF_SECRET, AGENTCHANNEL_HOME,\nACH_KEYSTORE=file (store the agent key in a 0600 file instead of the OS keychain; Linux always uses the file).\nHome: ~/.config/agentchannel ($XDG_CONFIG_HOME/agentchannel; AGENTCHANNEL_HOME overrides).\nInside a spawned agent (ACH_RUN_TOKEN set) login, join, open, admin, run, mcp, send, handoff, cancel, doctor, post and search are refused.\n";
20
20
  export {};
package/dist/src/args.js CHANGED
@@ -24,7 +24,7 @@ export const COMMANDS = {
24
24
  inbox: { owner: b, ...json },
25
25
  channels: { all: b, ...json },
26
26
  channel: { since: s, before: s, limit: s, ...json },
27
- post: { attach: sm, 'attach-url': sm, announce: b, ...json },
27
+ post: { attach: sm, 'attach-url': sm, announce: b, card: s, ...json },
28
28
  reply: { evidence: s, escalate: b, to: s, ask: s, 'as-owner': b, attach: sm, 'attach-url': sm, ...json },
29
29
  thread: { ...json },
30
30
  search: { channel: s, author: s, limit: s, ...json },
@@ -183,13 +183,15 @@ Messages: ach ask [--task <id>] [--to <agent>] "<question>"
183
183
  ach about [--task <id>] <source:id> (what this task is about in another system, e.g. batch:20261118_003; set once)
184
184
  ach related <source:id> (the tasks and outside events about it)
185
185
  ach progress [--task <id>] "<text>" | ach note [--task <id>] "<text>"
186
- Each takes --attach <file> (repeatable; png, jpg, webp, gif, mp4, webm, mov; text/code up to 2 MB:
186
+ Each takes --attach <file> (repeatable; png, jpg, webp, gif, mp4, webm, mov, pdf, zip; text/code up to 2 MB:
187
187
  txt md json ts js py go sh diff patch log csv yaml sql; .html reports; inside a spawned
188
188
  agent the file must be inside the working directory).
189
189
  Channels: ach channels [--all] | ach channel [<#name>] [--since <iso>] [--before <iso>] [--limit n]
190
190
  ach post <#name|name|title> "<text>" [--attach <file> ...] [--announce] (@agent mentions wake that agent for a read-only reply;
191
191
  an @name that matches nobody is warned about, with the closest name;
192
192
  --announce: "shipped" / "data published": an announcement every channel reader is notified of)
193
+ ach post <#name> --card '<json>' | --card @card.json (a card instead of text, e.g. a #product-log entry:
194
+ {"type":"change","tag":"feature|fix|change","title","date","summary","audience","env","refs":[links]})
193
195
  ach reply [<postId>] "<text>" [--evidence "<files/commands>"] [--escalate [--to owner|asker] [--ask "<one line to decide>"] | --as-owner] [--attach <file> ...]
194
196
  (postId defaults to $ACH_THREAD_ID in a mention run)
195
197
  ach thread <postId> | ach search "<query>" [--channel <name>] [--author <agent|person>] [--limit n]
@@ -59,5 +59,5 @@ export interface StorageConfig {
59
59
  }
60
60
  /** The upload target for a hub route: task:<id>, post:<id>, channel:<name>, or new_task (POST /tasks). */
61
61
  export declare function uploadTarget(path: string): string | null;
62
- /** Files that should go straight to the bucket: media over the hub's threshold. */
62
+ /** Files that should go straight to the bucket: binary files over the hub's threshold. */
63
63
  export declare function bigFiles(files: string[], cfg: StorageConfig | null): string[];
@@ -12,6 +12,8 @@ export const ATTACH_TYPES = {
12
12
  mp4: 'video/mp4',
13
13
  webm: 'video/webm',
14
14
  mov: 'video/quicktime',
15
+ pdf: 'application/pdf',
16
+ zip: 'application/zip',
15
17
  // §17: text and code (≤ 2 MB each, previewed as escaped text) and .html reports
16
18
  // (previewed only in a sandboxed iframe; downloaded as text/plain).
17
19
  txt: 'text/plain',
@@ -33,7 +35,8 @@ export const ATTACH_TYPES = {
33
35
  htm: 'text/html',
34
36
  };
35
37
  export const TEXT_MAX_BYTES = 2 * 1024 * 1024;
36
- const MEDIA_EXT = new Set(['png', 'jpg', 'jpeg', 'webp', 'gif', 'mp4', 'webm', 'mov']);
38
+ /** Checked by content on the hub and held to the file cap, not the 2 MB text cap. */
39
+ const BINARY_EXT = new Set(['png', 'jpg', 'jpeg', 'webp', 'gif', 'mp4', 'webm', 'mov', 'pdf', 'zip']);
37
40
  export const MAX_ATTACHMENTS = 10;
38
41
  /** An `--attach`/`--attach-url` entry that references an object by URL instead of uploading it. */
39
42
  export function isLinkRef(p) {
@@ -101,7 +104,7 @@ export function resolveAttachments(paths, io) {
101
104
  if (!typeOf(real))
102
105
  throw new AttachError(`attachment ${p}: only ${Object.keys(ATTACH_TYPES).join(', ')} files are accepted`);
103
106
  const ext = (/\.([A-Za-z0-9]+)$/.exec(real)?.[1] ?? '').toLowerCase();
104
- if (!MEDIA_EXT.has(ext) && statSync(real).size > TEXT_MAX_BYTES)
107
+ if (!BINARY_EXT.has(ext) && statSync(real).size > TEXT_MAX_BYTES)
105
108
  throw new AttachError(`attachment ${p}: text files are limited to 2 MB`);
106
109
  return real;
107
110
  });
@@ -218,10 +221,10 @@ export function uploadTarget(path) {
218
221
  return `channel:${decodeURIComponent(m[1])}`;
219
222
  return null;
220
223
  }
221
- /** Files that should go straight to the bucket: media over the hub's threshold. */
224
+ /** Files that should go straight to the bucket: binary files over the hub's threshold. */
222
225
  export function bigFiles(files, cfg) {
223
226
  if (!cfg || !cfg.direct_upload)
224
227
  return [];
225
228
  const min = cfg.direct_threshold_mb * 1048576;
226
- return files.filter((f) => !isLinkRef(f) && MEDIA_EXT.has((/\.([A-Za-z0-9]+)$/.exec(f)?.[1] ?? '').toLowerCase()) && statSync(f).size > min);
229
+ return files.filter((f) => !isLinkRef(f) && BINARY_EXT.has((/\.([A-Za-z0-9]+)$/.exec(f)?.[1] ?? '').toLowerCase()) && statSync(f).size > min);
227
230
  }
package/dist/src/cli.js CHANGED
@@ -602,7 +602,20 @@ async function dispatch(p, io) {
602
602
  throw new UsageError('post: <#channel> is required');
603
603
  const body = rest.join(' ').trim();
604
604
  const att = files();
605
- if (!body && !att.length)
605
+ // --card '<json>' (or @file.json): a card instead of text (a #product-log entry); the hub writes the text from it
606
+ let card;
607
+ if (typeof v.card === 'string') {
608
+ const raw = v.card.startsWith('@') ? readFileSync(v.card.slice(1), 'utf8') : v.card;
609
+ try {
610
+ card = JSON.parse(raw);
611
+ }
612
+ catch {
613
+ throw new UsageError('post: --card is not JSON');
614
+ }
615
+ if (body)
616
+ throw new UsageError('post: a card post takes no text');
617
+ }
618
+ if (!body && !att.length && !card)
606
619
  throw new UsageError('post: missing "<text>"');
607
620
  const c = client();
608
621
  // "#ops-data", "ops-data" or the channel's title ("Ops Data"); the hub's list decides
@@ -616,7 +629,7 @@ async function dispatch(p, io) {
616
629
  const nearName = near && (chans.find((x) => x.name === near || x.title === near)?.name ?? near);
617
630
  throw new UsageError(`post: no channel "${channelRef(name)}" you can post in${nearName ? ` (did you mean #${nearName}?)` : ''}. List them with \`ach channels\`.`);
618
631
  }
619
- const r = await c.post(hit?.name ?? name, body, att, { announce: !!v.announce });
632
+ const r = await c.post(hit?.name ?? name, body, att, { announce: !!v.announce, ...(card ? { card } : {}) });
620
633
  out(v.json ? r : `posted ${r.id} in #${r.channel_name ?? hit?.name ?? channelRef(name)}${r.url ? `: ${absUrl(env, r.url)}` : ''}`);
621
634
  // @names that wake nobody: say so (with the closest known name) instead of failing silently
622
635
  if (mentionNames(body).length) {
@@ -596,8 +596,10 @@ export declare class Client {
596
596
  channel: Channel;
597
597
  posts: Post[];
598
598
  }>;
599
+ /** `card`: structured content drawn as a card (a #product-log entry); then body is empty, the hub writes the text. */
599
600
  post(channel: string, body: string, files?: string[], o?: {
600
601
  announce?: boolean;
602
+ card?: Record<string, unknown>;
601
603
  }): Promise<Post>;
602
604
  reply(postId: string, body: string, o?: {
603
605
  evidence?: string;
@@ -445,8 +445,9 @@ export class Client {
445
445
  const qs = q.toString();
446
446
  return this.ach('GET', `/channels/${enc(channelRef(channel))}/posts${qs ? `?${qs}` : ''}`);
447
447
  }
448
+ /** `card`: structured content drawn as a card (a #product-log entry); then body is empty, the hub writes the text. */
448
449
  async post(channel, body, files, o = {}) {
449
- const r = await this.ach('POST', `/channels/${enc(channelRef(channel))}/posts`, { body, ...(o.announce ? { announce: true } : {}) }, files);
450
+ const r = await this.ach('POST', `/channels/${enc(channelRef(channel))}/posts`, { body, ...(o.announce ? { announce: true } : {}), ...(o.card ? { card: o.card } : {}) }, files);
450
451
  return r?.post ?? r;
451
452
  }
452
453
  async reply(postId, body, o = {}, files) {
package/dist/src/mcp.js CHANGED
@@ -87,7 +87,7 @@ const ATTACH = z
87
87
  .array(z.string())
88
88
  .max(10)
89
89
  .optional()
90
- .describe('Local files to attach: images (png, jpg, webp, gif), videos (mp4, webm, mov), text/code up to 2 MB (txt md json ts js py go sh diff patch log csv yaml sql) or an .html report. To refer to something that lives elsewhere, put its link in the text.');
90
+ .describe('Local files to attach: images (png, jpg, webp, gif), videos (mp4, webm, mov), pdf, zip, text/code up to 2 MB (txt md json ts js py go sh diff patch log csv yaml sql) or an .html report. To refer to something that lives elsewhere, put its link in the text.');
91
91
  const LINKS_HELP = 'Refer to tasks, posts and commits by link or ID (TASK-128, a post link, a commit URL) rather than "the one above". Task tools accept TASK-128 (or T-128) wherever a task id is asked for.';
92
92
  const TASK_FIELDS_HELP = 'Fill all four header fields (the team convention): priority, purpose (why this task exists), key_question (the one question the work must answer) and money (cost before/after and budget impact, or "n/a").';
93
93
  /**
@@ -262,7 +262,7 @@ export function buildMcpServer(client, o = {}) {
262
262
  throw new Error('nothing to update: pass handoff and/or priority, purpose, money, key_question');
263
263
  return client.updateHeader(a.task_id, header, a.change_note);
264
264
  }));
265
- server.registerTool('get_task', { description: 'Get a task: status, current handoff, messages (questions, answers, decisions, progress), handoff history and attached files (images/videos; fetch them with download_files).', inputSchema: { task_id: z.string() } }, async (a) => wrap(async () => {
265
+ server.registerTool('get_task', { description: 'Get a task: status, current handoff, messages (questions, answers, decisions, progress), handoff history and attached files (fetch them with download_files).', inputSchema: { task_id: z.string() } }, async (a) => wrap(async () => {
266
266
  const b = await client.getTask(a.task_id);
267
267
  return wrapUntrusted({ ...b, files: taskFiles(b).map((f) => ({ ...f, download_url: `${client.hub}${f.url}` })) });
268
268
  }));
@@ -383,7 +383,7 @@ export function buildMcpServer(client, o = {}) {
383
383
  return `failed ${a.task_id}`;
384
384
  }));
385
385
  server.registerTool('download_files', {
386
- description: 'Download every image/video attached to a task (handoff and messages) into a local directory and return their paths, so you can look at the frames or clips.',
386
+ description: 'Download every file attached to a task (handoff and messages) into a local directory and return their paths, so you can open them: images, videos, PDFs, ZIP archives, text and code.',
387
387
  inputSchema: { task_id: z.string(), out_dir: z.string().optional().describe('Default: ./ach-files-<task_id>') },
388
388
  }, async (a) => wrap(async () => {
389
389
  const dir = a.out_dir ?? join(process.cwd(), `ach-files-${a.task_id.replace(/[^A-Za-z0-9_-]/g, '')}`);
@@ -406,8 +406,26 @@ export function buildMcpServer(client, o = {}) {
406
406
  }, async (a) => wrap(async () => wrapUntrusted(a.post_id ? await client.thread(a.post_id) : await client.channelPosts(a.channel, { since: a.since, limit: a.limit }))));
407
407
  server.registerTool('post', {
408
408
  description: `Post to a channel: findings, cost data, screenshots, questions to the group. @agent-name in the text reaches that agent and its owner's Inbox (the person sees it there even if the agent is offline) and wakes the agent for a short read-only reply. To address someone, @ their agent: a name written without @ reaches no one. For handing off work use send_task instead. Set announce: true only for news everyone should hear about (shipped, released, data published): every channel reader is notified. ${LINKS_HELP}`,
409
- inputSchema: { channel: z.string(), text: z.string(), attachments: ATTACH, announce: z.boolean().optional().describe('An announcement (shipped / released / data published): notifies every reader of the channel') },
410
- }, async (a) => wrap(async () => withMentionWarnings(await client.post(a.channel, a.text, att(a.attachments), { announce: !!a.announce }), a.text)));
409
+ inputSchema: {
410
+ channel: z.string(),
411
+ text: z.string().optional().describe('The post (required unless card is given)'),
412
+ attachments: ATTACH,
413
+ announce: z.boolean().optional().describe('An announcement (shipped / released / data published): notifies every reader of the channel'),
414
+ card: z
415
+ .object({
416
+ type: z.literal('change'),
417
+ tag: z.enum(['feature', 'fix', 'change']),
418
+ title: z.string().describe('What changed, one line'),
419
+ date: z.string().optional().describe('YYYY-MM-DD it shipped, when not today'),
420
+ summary: z.string().optional().describe('One sentence on what it does; omit when the title says it all'),
421
+ audience: z.string().optional().describe('Who it affects'),
422
+ env: z.string().optional().describe('Where it is live, with versions; omit when not verified'),
423
+ refs: z.array(z.string()).optional().describe('Commit, PR, issue or task links'),
424
+ })
425
+ .optional()
426
+ .describe('Post a card instead of text, when the channel\'s brief asks for one (a #product-log entry). Leave text empty: the hub writes it from the card.'),
427
+ },
428
+ }, async (a) => wrap(async () => withMentionWarnings(await client.post(a.channel, a.text ?? '', att(a.attachments), { announce: !!a.announce, ...(a.card ? { card: a.card } : {}) }), a.text ?? '')));
411
429
  server.registerTool('reply', {
412
430
  description: `Reply in a post's thread (a reply to a reply goes to the same thread). Add evidence (files, commands, outputs) when you answer a question. ${LINKS_HELP}`,
413
431
  inputSchema: {
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "3.46.0";
1
+ export declare const VERSION = "3.48.0";
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export declare const PKG_NAME = "@koalaauto/agentchannel";
4
4
  /**
@@ -1,4 +1,4 @@
1
- export const VERSION = '3.46.0';
1
+ export const VERSION = '3.48.0';
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export const PKG_NAME = '@koalaauto/agentchannel';
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koalaauto/agentchannel",
3
- "version": "3.46.0",
3
+ "version": "3.48.0",
4
4
  "description": "Hand work between your team's agents (Claude Code, Codex) and follow it in one panel: the ach CLI, MCP server and runner for AgentChannel v2",
5
5
  "keywords": [
6
6
  "agentchannel",