@integrity-labs/agt-cli 0.17.0 → 0.17.2

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.
package/dist/bin/agt.js CHANGED
@@ -48,7 +48,7 @@ import {
48
48
  success,
49
49
  table,
50
50
  warn
51
- } from "../chunk-P52H3XS6.js";
51
+ } from "../chunk-RGJV3MV3.js";
52
52
 
53
53
  // src/bin/agt.ts
54
54
  import { join as join10 } from "path";
@@ -3732,7 +3732,7 @@ import { execFileSync, execSync } from "child_process";
3732
3732
  import { existsSync as existsSync5, realpathSync } from "fs";
3733
3733
  import chalk17 from "chalk";
3734
3734
  import ora15 from "ora";
3735
- var cliVersion = true ? "0.17.0" : "dev";
3735
+ var cliVersion = true ? "0.17.2" : "dev";
3736
3736
  async function fetchLatestVersion() {
3737
3737
  const host2 = getHost();
3738
3738
  if (!host2) return null;
@@ -4190,7 +4190,7 @@ function handleError(err) {
4190
4190
  }
4191
4191
 
4192
4192
  // src/bin/agt.ts
4193
- var cliVersion2 = true ? "0.17.0" : "dev";
4193
+ var cliVersion2 = true ? "0.17.2" : "dev";
4194
4194
  var program = new Command();
4195
4195
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
4196
4196
  program.hook("preAction", (thisCommand) => {
@@ -2998,6 +2998,21 @@ The marginal cost of completeness is near zero. Do the whole thing.
2998
2998
  - **Search before building. Test before shipping.**
2999
2999
  - **No excuses.** Time, fatigue, and complexity are not reasons to deliver less than complete.
3000
3000
 
3001
+ ## Channel message triage (ENG-4684)
3002
+
3003
+ Every inbound \`<channel>\` tag (Slack/Telegram/Direct Chat) is a fresh request. Triage it BEFORE doing the work:
3004
+
3005
+ - **Will this reply take longer than ~60 seconds?** Treat as slow if it involves: Xero pulls (any), multi-step Composio chains, web research, reading/writing >5 files, image generation, or a multi-skill activation.
3006
+
3007
+ - **FAST (< 60s):** handle inline. Reply via the channel tool (slack.reply / telegram.reply / directchat.reply) and end your turn.
3008
+
3009
+ - **SLOW (\u2265 60s):**
3010
+ 1. Send this exact acknowledgement via the channel tool: *"This will take a while, I'll ping you when it's done."* Use the verbatim copy \u2014 don't paraphrase or add detail.
3011
+ 2. Invoke the \`channel-message-handler\` subagent (background) with the full message + channel/thread/message_ts metadata as the task.
3012
+ 3. End your turn. The subagent posts the actual reply itself when it's done.
3013
+
3014
+ Why: dispatching short replies wastes ~20s of subagent overhead. Dispatching slow ones keeps you free to acknowledge new inbound messages immediately instead of going silent for 60s+. Get the routing decision right; the rest follows.
3015
+
3001
3016
  ## Rules
3002
3017
 
3003
3018
  - Never expose secrets or API keys in output.
@@ -3160,6 +3175,27 @@ function deployArtifactsToProject(codeName, provisionDir) {
3160
3175
  }
3161
3176
  } catch {
3162
3177
  }
3178
+ const agentsDir = join4(provisionDir, ".claude", "agents");
3179
+ const destAgentsDir = join4(projectDir, ".claude", "agents");
3180
+ try {
3181
+ if (existsSync4(agentsDir)) {
3182
+ for (const agentFile of readdirSync(agentsDir)) {
3183
+ if (!agentFile.endsWith(".md"))
3184
+ continue;
3185
+ const srcPath = join4(agentsDir, agentFile);
3186
+ const destPath = join4(destAgentsDir, agentFile);
3187
+ const srcContent = readFileSync4(srcPath, "utf-8");
3188
+ try {
3189
+ if (existsSync4(destPath) && readFileSync4(destPath, "utf-8") === srcContent)
3190
+ continue;
3191
+ } catch {
3192
+ }
3193
+ mkdirSync4(destAgentsDir, { recursive: true });
3194
+ writeFileSync4(destPath, srcContent);
3195
+ }
3196
+ }
3197
+ } catch {
3198
+ }
3163
3199
  const agentMcpPath = join4(getAgentDir(codeName), "provision", ".mcp.json");
3164
3200
  const projectMcpPath = join4(projectDir, ".mcp.json");
3165
3201
  try {
@@ -3581,6 +3617,30 @@ function buildSettingsJson(input) {
3581
3617
  settings["permissions"] = { deny: SECRETS_DENY_PERMISSIONS };
3582
3618
  return settings;
3583
3619
  }
3620
+ function buildChannelMessageHandlerAgent() {
3621
+ return `---
3622
+ name: channel-message-handler
3623
+ description: Handles a single inbound Slack/Telegram/Direct-Chat message end to end. Posts the reply itself via the matching channel tool. The parent agent dispatches to this subagent only for slow requests (\u2265 ~60s) so the parent's listener turn stays free for new inbound work.
3624
+ background: true
3625
+ tools: Bash, Read, Write, Edit, Grep, Glob, Skill, Agent, mcp__augmented__*, mcp__slack__*, mcp__telegram__*, mcp__direct_chat__*, mcp__xero__*, mcp__composio_attio__*, mcp__composio_canva__*, mcp__composio_gmail__*, mcp__composio_googlecalendar__*, mcp__composio_googledocs__*, mcp__composio_googledrive__*, mcp__composio_googlesheets__*
3626
+ ---
3627
+
3628
+ You are dispatched by the parent agent to handle one channel message.
3629
+
3630
+ The parent passes you in the task description:
3631
+ - The full original message text
3632
+ - Channel metadata: Slack channel ID + thread_ts, Telegram chat_id + message_id, OR Direct Chat conversation_id
3633
+ - Any supporting context the parent thought relevant
3634
+
3635
+ Your job:
3636
+
3637
+ 1. Do the work the message asks for (Xero pull, research, multi-step skill, etc.). Use whichever tools you need.
3638
+ 2. Post the reply yourself via the matching channel tool \u2014 slack.reply for Slack, telegram.reply for Telegram, directchat.reply for Direct Chat. Use the metadata the parent gave you to address the right thread/conversation.
3639
+ 3. End. Do not do additional follow-up work; if more is needed, the user will send another message.
3640
+
3641
+ Do NOT post intermediate progress updates unless the work spans 5+ minutes \u2014 keep noise low. The parent already sent a single-line acknowledgement before dispatching you.
3642
+ `;
3643
+ }
3584
3644
  function buildMcpJson(input) {
3585
3645
  const mcpServers = {};
3586
3646
  const localMcpPath = join4(getHomeDir3(), ".augmented", "_mcp", "index.js");
@@ -3709,7 +3769,16 @@ var claudeCodeAdapter = {
3709
3769
  { relativePath: "settings.json", content: JSON.stringify(buildSettingsJson(input), null, 2) },
3710
3770
  { relativePath: ".mcp.json", content: JSON.stringify(buildMcpJson(input), null, 2) },
3711
3771
  { relativePath: "CHARTER.md", content: input.charterContent },
3712
- { relativePath: "TOOLS.md", content: input.toolsContent }
3772
+ { relativePath: "TOOLS.md", content: input.toolsContent },
3773
+ // ENG-4684: named subagent the parent uses for slow channel-message
3774
+ // handling. Frontmatter `background: true` makes the parent's listener
3775
+ // turn return immediately on dispatch, so new inbound messages get a
3776
+ // fresh turn while the subagent does the work in parallel. Triggered
3777
+ // by the "Channel message triage" instruction in CLAUDE.md.
3778
+ {
3779
+ relativePath: ".claude/agents/channel-message-handler.md",
3780
+ content: buildChannelMessageHandlerAgent()
3781
+ }
3713
3782
  ];
3714
3783
  const knowledgeEntries = input.knowledge ?? [];
3715
3784
  const delivery = input.knowledgeDelivery ?? "both";
@@ -7697,4 +7766,4 @@ export {
7697
7766
  managerInstallCommand,
7698
7767
  managerUninstallCommand
7699
7768
  };
7700
- //# sourceMappingURL=chunk-P52H3XS6.js.map
7769
+ //# sourceMappingURL=chunk-RGJV3MV3.js.map