@integrity-labs/agt-cli 0.27.149 → 0.27.150-test.16
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 +4 -4
- package/dist/bin/agt.js.map +1 -1
- package/dist/chunk-354FAVQR.js +173 -0
- package/dist/chunk-354FAVQR.js.map +1 -0
- package/dist/{chunk-JLS7NQFE.js → chunk-7GKJZBTB.js} +52 -209
- package/dist/chunk-7GKJZBTB.js.map +1 -0
- package/dist/{chunk-XWZMKHHG.js → chunk-QHEAAPEG.js} +57 -142
- package/dist/chunk-QHEAAPEG.js.map +1 -0
- package/dist/{chunk-A75AOK6E.js → chunk-WOOYOAPG.js} +1 -1
- package/dist/chunk-WOOYOAPG.js.map +1 -0
- package/dist/{claude-pair-runtime-3ZIOY3Z5.js → claude-pair-runtime-GIUCD7IG.js} +2 -2
- package/dist/daily-session-PNQX5URX.js +27 -0
- package/dist/lib/manager-worker.js +35 -82
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/{persistent-session-ZLEK4KBF.js → persistent-session-35PWSTLO.js} +4 -3
- package/dist/persistent-session-35PWSTLO.js.map +1 -0
- package/dist/{responsiveness-probe-3EUNCJDU.js → responsiveness-probe-MA4M2QM4.js} +4 -3
- package/dist/{responsiveness-probe-3EUNCJDU.js.map → responsiveness-probe-MA4M2QM4.js.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-A75AOK6E.js.map +0 -1
- package/dist/chunk-JLS7NQFE.js.map +0 -1
- package/dist/chunk-XWZMKHHG.js.map +0 -1
- /package/dist/{claude-pair-runtime-3ZIOY3Z5.js.map → claude-pair-runtime-GIUCD7IG.js.map} +0 -0
- /package/dist/{persistent-session-ZLEK4KBF.js.map → daily-session-PNQX5URX.js.map} +0 -0
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
registerFramework,
|
|
11
11
|
resolveAvatarEnvUrl,
|
|
12
12
|
wrapScheduledTaskPrompt
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WOOYOAPG.js";
|
|
14
14
|
|
|
15
15
|
// ../../packages/core/dist/integrations/registry.js
|
|
16
16
|
var INTEGRATION_REGISTRY = [
|
|
@@ -3386,32 +3386,43 @@ acknowledge before you start.
|
|
|
3386
3386
|
- **FAST (< 60s):** handle inline. Reply via the channel tool
|
|
3387
3387
|
(slack.reply / telegram.reply / directchat.reply) and end your turn.
|
|
3388
3388
|
|
|
3389
|
-
- **SLOW (\u2265 60s):** acknowledge
|
|
3389
|
+
- **SLOW (\u2265 60s):** acknowledge, dispatch to background, stay responsive.
|
|
3390
3390
|
1. Send a one-line acknowledgement via the channel tool \u2014 short, warm,
|
|
3391
3391
|
and tell the user you'll come back. Example shape (don't copy verbatim,
|
|
3392
3392
|
match your voice): "On it \u2014 this'll take a minute or two, I'll ping
|
|
3393
3393
|
when it's done."
|
|
3394
|
-
2.
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
>
|
|
3414
|
-
>
|
|
3394
|
+
2. Dispatch the work to a background sub-agent: the Agent tool with
|
|
3395
|
+
\`subagent_type: general-purpose\` AND \`run_in_background: true\`.
|
|
3396
|
+
Put EVERYTHING the worker needs in the dispatch prompt \u2014 the user's
|
|
3397
|
+
full request, relevant thread context, which integrations/tools to
|
|
3398
|
+
use, and the exact shape of result you want back. The worker inherits
|
|
3399
|
+
your full MCP tool surface but NOT your conversation context.
|
|
3400
|
+
3. End your turn after dispatching. This is the point: you stay free to
|
|
3401
|
+
answer other messages while the worker grinds. Do NOT wait, poll, or
|
|
3402
|
+
dispatch the same work synchronously \u2014 a synchronous dispatch blocks
|
|
3403
|
+
your turn and defeats the purpose.
|
|
3404
|
+
4. When the worker's completion notification arrives (it lands
|
|
3405
|
+
automatically as a system message), read its result and reply via the
|
|
3406
|
+
channel tool (\`slack.reply\` / \`telegram.reply\` / \`directchat.reply\`)
|
|
3407
|
+
to the same thread / chat / conversation you acknowledged in step 1.
|
|
3408
|
+
**You post the substantive reply \u2014 the worker has no channel tools.**
|
|
3409
|
+
5. If the completion notification reports a failure or an unusable
|
|
3410
|
+
result, tell the user what happened and either re-dispatch with a
|
|
3411
|
+
better prompt or handle it inline \u2014 never go silent.
|
|
3412
|
+
|
|
3413
|
+
> **Why background dispatch (and why \`general-purpose\`):** validated
|
|
3414
|
+
> 2026-06-10 on Claude Code 2.1.170 (ENG-6274 spike,
|
|
3415
|
+
> \`docs/spikes/ENG-6274-run-in-background-dispatch.md\`): background
|
|
3416
|
+
> dispatch returns immediately, your turn ends, inbound messages get
|
|
3417
|
+
> answered in seconds while the worker runs, and the completion arrives
|
|
3418
|
+
> as a notification you handle like any other turn. Use
|
|
3419
|
+
> \`subagent_type: general-purpose\` (inherit-all tools) \u2014 NOT
|
|
3420
|
+
> \`channel-message-handler\` or \`augmented-worker\` \u2014 until ENG-6273
|
|
3421
|
+
> re-verifies on this host that the upstream allowlist bug
|
|
3422
|
+
> ([anthropics/claude-code#64909](https://github.com/anthropics/claude-code/issues/64909),
|
|
3423
|
+
> empirically 0/6 MCP tools in named sub-agents on 2026-06-03) is fixed
|
|
3424
|
+
> at the fleet's pinned Claude Code version. \`general-purpose\` escapes
|
|
3425
|
+
> that bug by construction either way.
|
|
3415
3426
|
|
|
3416
3427
|
**Why this triage decision still matters more than any other instruction
|
|
3417
3428
|
below:** if you skip the acknowledgement and just dive into slow work
|
|
@@ -3433,25 +3444,29 @@ For background tool work that **isn't** a channel reply \u2014 multi-step data
|
|
|
3433
3444
|
pulls, CRM enrichments, research workflows, cross-MCP orchestration \u2014 use
|
|
3434
3445
|
\`subagent_type: general-purpose\` (Anthropic's built-in). It inherits the
|
|
3435
3446
|
full MCP tool surface from this session and reliably binds every
|
|
3436
|
-
\`mcp__*\` server you have available.
|
|
3447
|
+
\`mcp__*\` server you have available. For anything expected to take more
|
|
3448
|
+
than a minute, add \`run_in_background: true\` so your turn ends and you
|
|
3449
|
+
stay responsive; the completion notification brings you the result.
|
|
3450
|
+
Don't background-dispatch trivial work \u2014 each dispatch is a fresh
|
|
3451
|
+
context and costs real tokens.
|
|
3437
3452
|
|
|
3438
3453
|
**Why not \`augmented-worker\` for now:** there is an upstream Claude Code
|
|
3439
3454
|
bug ([anthropics/claude-code#64909](https://github.com/anthropics/claude-code/issues/64909))
|
|
3440
3455
|
where sub-agents with an explicit \`tools:\` allowlist get an empty MCP
|
|
3441
3456
|
tool registry \u2014 every \`mcp__*\` call returns "No such tool available."
|
|
3442
3457
|
\`general-purpose\` uses \`tools: *\` (inherit-all) and escapes the bug.
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3458
|
+
The fix appears to have shipped upstream (verified locally on Claude Code
|
|
3459
|
+
2.1.170, 2026-06-10 \u2014 ENG-6269 spike); once ENG-6273 re-verifies it on
|
|
3460
|
+
this host's pinned version, \`augmented-worker\` becomes preferred again
|
|
3461
|
+
(restricted tool surface for safety + working MCP binding) and
|
|
3462
|
+
\`channel-message-handler\` returns as a dispatch target. Until then,
|
|
3463
|
+
\`general-purpose\` only.
|
|
3446
3464
|
|
|
3447
3465
|
For slow **channel** replies, see \xA7 FIRST ACTION above \u2014 those are
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
\`augmented-worker\` result). When Anthropic ships the upstream fix, both
|
|
3453
|
-
named sub-agents will work again and the FIRST ACTION triage will switch
|
|
3454
|
-
back to dispatch.
|
|
3466
|
+
dispatched as background \`general-purpose\` workers and **you** post the
|
|
3467
|
+
result back to the channel when the completion notification arrives
|
|
3468
|
+
(\`channel-message-handler\` is not yet the dispatch target for the same
|
|
3469
|
+
ENG-6273-pending reason).
|
|
3455
3470
|
|
|
3456
3471
|
${activeTasksSection}${personalitySection}## Identity
|
|
3457
3472
|
|
|
@@ -4463,7 +4478,13 @@ function provisionStopHook(codeName) {
|
|
|
4463
4478
|
"# tag (slack-channel.ts:1247 / telegram-channel.ts:776 emit content +",
|
|
4464
4479
|
"# meta which Claude Code wraps in a <channel ...> preamble). Searching",
|
|
4465
4480
|
"# the raw text gives us the exact pending conversation key.",
|
|
4466
|
-
|
|
4481
|
+
"# User-event content is frequently a PLAIN STRING (channel notifications",
|
|
4482
|
+
"# land that way), not a content-block array \u2014 map() over a string is a",
|
|
4483
|
+
"# jq error, which the 2>/dev/null swallowed, so the tag came back empty",
|
|
4484
|
+
"# and recovery silently no-oped on every Slack ghost reply (confirmed",
|
|
4485
|
+
"# live on sherlock/agt-aws-1 2026-06-10). Normalize string \u2192 one text",
|
|
4486
|
+
"# block before mapping.",
|
|
4487
|
+
`CHANNEL_TAG=$(tail -400 "$TRANSCRIPT_PATH" | jq -r '(.message.content // .content // []) | if type == "string" then [{type: "text", text: .}] else . end | map(select(.type == "text") | .text) | join(" ")' 2>/dev/null | grep -oE '<channel [^>]+>' | tail -1 || true)`,
|
|
4467
4488
|
'TAG_SOURCE=""',
|
|
4468
4489
|
`if [ -n "$CHANNEL_TAG" ]; then TAG_SOURCE=$(echo "$CHANNEL_TAG" | grep -oE 'source="[^"]+"' | head -1 | sed 's/source="\\(.*\\)"/\\1/' || true); fi`,
|
|
4469
4490
|
'extract_attr() { echo "$1" | grep -oE "$2=\\"[^\\"]+\\"" | head -1 | sed -E "s/$2=\\"(.*)\\"/\\\\1/"; }',
|
|
@@ -4881,111 +4902,6 @@ function provisionOrientHook(codeName) {
|
|
|
4881
4902
|
settings["hooks"] = hooks;
|
|
4882
4903
|
writeFileSync5(settingsPath, JSON.stringify(settings, null, 2));
|
|
4883
4904
|
}
|
|
4884
|
-
function provisionSessionStateHook(codeName) {
|
|
4885
|
-
const projectDir = getProjectDir(codeName);
|
|
4886
|
-
const claudeDir = join4(projectDir, ".claude");
|
|
4887
|
-
mkdirSync4(claudeDir, { recursive: true });
|
|
4888
|
-
const homeDir = getHomeDir3();
|
|
4889
|
-
const agentDir = join4(homeDir, ".augmented", codeName);
|
|
4890
|
-
const hookScriptPath = join4(claudeDir, "agt-session-state-hook.sh");
|
|
4891
|
-
const hookScript = `#!/usr/bin/env bash
|
|
4892
|
-
# Auto-generated by Augmented (ENG-6233 / ENG-6268) \u2014 SessionStart session-state
|
|
4893
|
-
# recorder. Writes the model + session origin (which only the agent's own
|
|
4894
|
-
# Claude Code session knows) to session-state.json, which the channel servers
|
|
4895
|
-
# read back for the /status command. Best-effort, silent; every path exits 0 so
|
|
4896
|
-
# it can NEVER block or fail session start.
|
|
4897
|
-
# Canonical source: packages/claudecode-plugin-augmented/hooks/session-state.sh
|
|
4898
|
-
|
|
4899
|
-
# Best-effort: any unexpected error just exits clean.
|
|
4900
|
-
trap 'exit 0' ERR
|
|
4901
|
-
|
|
4902
|
-
# Hook input (stdin canonical; CLAUDE_HOOK_INPUT kept as a fallback).
|
|
4903
|
-
INPUT="$(cat 2>/dev/null || true)"
|
|
4904
|
-
[ -n "$INPUT" ] || INPUT="\${CLAUDE_HOOK_INPUT:-}"
|
|
4905
|
-
[ -n "$INPUT" ] || exit 0
|
|
4906
|
-
command -v jq >/dev/null 2>&1 || exit 0
|
|
4907
|
-
|
|
4908
|
-
# Identity / state dir are baked at provision time.
|
|
4909
|
-
CODE_NAME="${codeName}"
|
|
4910
|
-
STATE_DIR="${agentDir}"
|
|
4911
|
-
mkdir -p "$STATE_DIR" 2>/dev/null || exit 0
|
|
4912
|
-
|
|
4913
|
-
# Pull the fields we surface from the SessionStart payload.
|
|
4914
|
-
SESSION_ID="$(printf '%s' "$INPUT" | jq -r '.session_id // empty' 2>/dev/null || true)"
|
|
4915
|
-
SOURCE="$(printf '%s' "$INPUT" | jq -r '.source // empty' 2>/dev/null || true)"
|
|
4916
|
-
MODEL="$(printf '%s' "$INPUT" | jq -r '.model // empty' 2>/dev/null || true)"
|
|
4917
|
-
CWD="$(printf '%s' "$INPUT" | jq -r '.cwd // empty' 2>/dev/null || true)"
|
|
4918
|
-
[ -n "$CWD" ] || CWD="\${CLAUDE_PROJECT_DIR:-$PWD}"
|
|
4919
|
-
|
|
4920
|
-
# Channels: the channel MCP servers wired in the project .mcp.json. The adapter
|
|
4921
|
-
# writes each channel as a bare server id \u2014 slack / telegram / msteams (the
|
|
4922
|
-
# DEV_CHANNEL_SERVER_IDS set) plus direct-chat \u2014 NOT a "<name>-channel" key, so
|
|
4923
|
-
# match that allowlist and exclude the non-channel servers (augmented,
|
|
4924
|
-
# cloud-broker, composio_*). The "-channel" suffix only names the bundled .js
|
|
4925
|
-
# asset, never the .mcp.json key (verified against a live host, ENG-6268).
|
|
4926
|
-
CHANNELS_JSON='[]'
|
|
4927
|
-
if [ -f "$CWD/.mcp.json" ]; then
|
|
4928
|
-
CHANNELS_JSON="$(jq -c '
|
|
4929
|
-
["slack","telegram","msteams","direct-chat"] as $ch
|
|
4930
|
-
| [ (.mcpServers // {} | keys[]) | select(. as $k | $ch | index($k)) ]
|
|
4931
|
-
' "$CWD/.mcp.json" 2>/dev/null || echo '[]')"
|
|
4932
|
-
[ -n "$CHANNELS_JSON" ] || CHANNELS_JSON='[]'
|
|
4933
|
-
fi
|
|
4934
|
-
|
|
4935
|
-
# Environment: best-effort from the agent's CLAUDE.md frontmatter (CHARTER.md
|
|
4936
|
-
# maps to CLAUDE.md for the Claude Code adapter; the frontmatter carries
|
|
4937
|
-
# environment: dev|stage|prod). Missing / unreadable -> omitted.
|
|
4938
|
-
ENVIRONMENT=""
|
|
4939
|
-
if [ -f "$CWD/CLAUDE.md" ]; then
|
|
4940
|
-
ENVIRONMENT="$(grep -m1 -E '^environment:[[:space:]]*' "$CWD/CLAUDE.md" 2>/dev/null | sed -E 's/^environment:[[:space:]]*//; s/[[:space:]]*$//' || true)"
|
|
4941
|
-
fi
|
|
4942
|
-
|
|
4943
|
-
# Seconds->millis keeps this portable across GNU (Linux hosts) and BSD (macOS
|
|
4944
|
-
# dev) date; second granularity is plenty for "started 12m ago".
|
|
4945
|
-
RECORDED_AT="$(date +%s)000"
|
|
4946
|
-
|
|
4947
|
-
# Write atomically (temp + rename) so a concurrent reader never sees a
|
|
4948
|
-
# half-written file.
|
|
4949
|
-
OUT="$STATE_DIR/session-state.json"
|
|
4950
|
-
TMP="$OUT.$$.tmp"
|
|
4951
|
-
if jq -nc --arg session_id "$SESSION_ID" --arg source "$SOURCE" --arg model "$MODEL" --arg cwd "$CWD" --arg environment "$ENVIRONMENT" --argjson channels "$CHANNELS_JSON" --argjson recorded_at "$RECORDED_AT" '{
|
|
4952
|
-
session_id: $session_id,
|
|
4953
|
-
source: $source,
|
|
4954
|
-
model: $model,
|
|
4955
|
-
cwd: $cwd,
|
|
4956
|
-
channels: $channels,
|
|
4957
|
-
recorded_at: $recorded_at
|
|
4958
|
-
}
|
|
4959
|
-
| if $environment == "" then . else . + { environment: $environment } end' > "$TMP" 2>/dev/null; then
|
|
4960
|
-
mv -f "$TMP" "$OUT" 2>/dev/null || rm -f "$TMP" 2>/dev/null || true
|
|
4961
|
-
else
|
|
4962
|
-
rm -f "$TMP" 2>/dev/null || true
|
|
4963
|
-
fi
|
|
4964
|
-
|
|
4965
|
-
exit 0
|
|
4966
|
-
`;
|
|
4967
|
-
writeFileSync5(hookScriptPath, hookScript, { mode: 493 });
|
|
4968
|
-
const settingsPath = join4(claudeDir, "settings.local.json");
|
|
4969
|
-
let settings = {};
|
|
4970
|
-
try {
|
|
4971
|
-
settings = JSON.parse(readFileSync5(settingsPath, "utf-8"));
|
|
4972
|
-
} catch {
|
|
4973
|
-
}
|
|
4974
|
-
const hooks = settings["hooks"] ?? {};
|
|
4975
|
-
const existingSessionStart = Array.isArray(hooks["SessionStart"]) ? [...hooks["SessionStart"]] : [];
|
|
4976
|
-
const alreadyRegistered = existingSessionStart.some((entry) => {
|
|
4977
|
-
const entryHooks = entry.hooks;
|
|
4978
|
-
return Array.isArray(entryHooks) && entryHooks.some((h) => typeof h === "object" && h !== null && h.type === "command" && h.command === hookScriptPath);
|
|
4979
|
-
});
|
|
4980
|
-
if (!alreadyRegistered) {
|
|
4981
|
-
existingSessionStart.push({
|
|
4982
|
-
hooks: [{ type: "command", command: hookScriptPath }]
|
|
4983
|
-
});
|
|
4984
|
-
}
|
|
4985
|
-
hooks["SessionStart"] = existingSessionStart;
|
|
4986
|
-
settings["hooks"] = hooks;
|
|
4987
|
-
writeFileSync5(settingsPath, JSON.stringify(settings, null, 2));
|
|
4988
|
-
}
|
|
4989
4905
|
function modifyJsonConfig(filePath, fn) {
|
|
4990
4906
|
let originalContent;
|
|
4991
4907
|
let config;
|
|
@@ -7941,7 +7857,6 @@ export {
|
|
|
7941
7857
|
provisionIsolationHook,
|
|
7942
7858
|
provisionAutoKanbanProgressHook,
|
|
7943
7859
|
provisionOrientHook,
|
|
7944
|
-
provisionSessionStateHook,
|
|
7945
7860
|
setJsonMode,
|
|
7946
7861
|
isJsonMode,
|
|
7947
7862
|
jsonOutput,
|
|
@@ -7972,4 +7887,4 @@ export {
|
|
|
7972
7887
|
managerInstallSystemUnitCommand,
|
|
7973
7888
|
managerUninstallSystemUnitCommand
|
|
7974
7889
|
};
|
|
7975
|
-
//# sourceMappingURL=chunk-
|
|
7890
|
+
//# sourceMappingURL=chunk-QHEAAPEG.js.map
|