@integrity-labs/agt-cli 0.16.9 → 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-
|
|
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.
|
|
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.
|
|
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");
|
|
@@ -3615,6 +3675,18 @@ function buildMcpJson(input) {
|
|
|
3615
3675
|
args: ["mcp"]
|
|
3616
3676
|
};
|
|
3617
3677
|
}
|
|
3678
|
+
const hasXero = input.integrations?.some((i) => i.definition_id === "xero");
|
|
3679
|
+
if (hasXero) {
|
|
3680
|
+
mcpServers["xero"] = {
|
|
3681
|
+
command: "npx",
|
|
3682
|
+
args: ["-y", "@xeroapi/xero-mcp-server@latest"],
|
|
3683
|
+
env: {
|
|
3684
|
+
XERO_CLIENT_BEARER_TOKEN: "${XERO_ACCESS_TOKEN}",
|
|
3685
|
+
PATH: process.env["PATH"] ?? "",
|
|
3686
|
+
HOME: process.env["HOME"] ?? ""
|
|
3687
|
+
}
|
|
3688
|
+
};
|
|
3689
|
+
}
|
|
3618
3690
|
return { mcpServers };
|
|
3619
3691
|
}
|
|
3620
3692
|
function parseIntervalMinutes(scheduleEvery) {
|
|
@@ -3697,7 +3769,16 @@ var claudeCodeAdapter = {
|
|
|
3697
3769
|
{ relativePath: "settings.json", content: JSON.stringify(buildSettingsJson(input), null, 2) },
|
|
3698
3770
|
{ relativePath: ".mcp.json", content: JSON.stringify(buildMcpJson(input), null, 2) },
|
|
3699
3771
|
{ relativePath: "CHARTER.md", content: input.charterContent },
|
|
3700
|
-
{ 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
|
+
}
|
|
3701
3782
|
];
|
|
3702
3783
|
const knowledgeEntries = input.knowledge ?? [];
|
|
3703
3784
|
const delivery = input.knowledgeDelivery ?? "both";
|
|
@@ -4091,6 +4172,18 @@ ${sections}`
|
|
|
4091
4172
|
if (hasQmd) {
|
|
4092
4173
|
this.writeMcpServer(codeName, "qmd", { command: "qmd", args: ["mcp"] });
|
|
4093
4174
|
}
|
|
4175
|
+
const hasXero = integrations.some((i) => i.definition_id === "xero");
|
|
4176
|
+
if (hasXero) {
|
|
4177
|
+
this.writeMcpServer(codeName, "xero", {
|
|
4178
|
+
command: "npx",
|
|
4179
|
+
args: ["-y", "@xeroapi/xero-mcp-server@latest"],
|
|
4180
|
+
env: {
|
|
4181
|
+
XERO_CLIENT_BEARER_TOKEN: "${XERO_ACCESS_TOKEN}",
|
|
4182
|
+
PATH: process.env["PATH"] ?? "",
|
|
4183
|
+
HOME: process.env["HOME"] ?? ""
|
|
4184
|
+
}
|
|
4185
|
+
});
|
|
4186
|
+
}
|
|
4094
4187
|
const projectDir = getProjectDir(codeName);
|
|
4095
4188
|
const claudeMdPath = join4(projectDir, "CLAUDE.md");
|
|
4096
4189
|
try {
|
|
@@ -7673,4 +7766,4 @@ export {
|
|
|
7673
7766
|
managerInstallCommand,
|
|
7674
7767
|
managerUninstallCommand
|
|
7675
7768
|
};
|
|
7676
|
-
//# sourceMappingURL=chunk-
|
|
7769
|
+
//# sourceMappingURL=chunk-RGJV3MV3.js.map
|