@integrity-labs/agt-cli 0.28.78 → 0.28.80
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/{chunk-XHKMS4UY.js → chunk-3KLQA3SC.js} +8 -1
- package/dist/chunk-3KLQA3SC.js.map +1 -0
- package/dist/{chunk-J4H4BRPQ.js → chunk-JIJ5BGO5.js} +128 -8
- package/dist/chunk-JIJ5BGO5.js.map +1 -0
- package/dist/{chunk-PEVDRQJA.js → chunk-XDZFMTY5.js} +2 -2
- package/dist/{claude-pair-runtime-IGVIKCHS.js → claude-pair-runtime-6XYMSC6B.js} +2 -2
- package/dist/lib/manager-worker.js +20 -11
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/slack-channel.js +298 -46
- package/dist/mcp/telegram-channel.js +1 -0
- package/dist/{persistent-session-Z3RHQRVC.js → persistent-session-U6P5I6TT.js} +3 -3
- package/dist/{responsiveness-probe-QWO75M34.js → responsiveness-probe-VKIJY4IC.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-J4H4BRPQ.js.map +0 -1
- package/dist/chunk-XHKMS4UY.js.map +0 -1
- /package/dist/{chunk-PEVDRQJA.js.map → chunk-XDZFMTY5.js.map} +0 -0
- /package/dist/{claude-pair-runtime-IGVIKCHS.js.map → claude-pair-runtime-6XYMSC6B.js.map} +0 -0
- /package/dist/{persistent-session-Z3RHQRVC.js.map → persistent-session-U6P5I6TT.js.map} +0 -0
- /package/dist/{responsiveness-probe-QWO75M34.js.map → responsiveness-probe-VKIJY4IC.js.map} +0 -0
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveConnectivityProbe,
|
|
23
23
|
worseConnectivityOutcome,
|
|
24
24
|
wrapScheduledTaskPrompt
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-3KLQA3SC.js";
|
|
26
26
|
|
|
27
27
|
// ../../packages/core/dist/integrations/registry.js
|
|
28
28
|
var INTEGRATION_REGISTRY = [
|
|
@@ -4493,6 +4493,20 @@ function provisionStopHook(codeName) {
|
|
|
4493
4493
|
`CODE_NAME=$(echo "$CWD" | sed -nE 's|.*/\\.augmented/([^/]+)/project/?$|\\1|p')`,
|
|
4494
4494
|
'if [ -z "$CODE_NAME" ]; then exit 0; fi',
|
|
4495
4495
|
'AGENT_DIR="$(dirname "$CWD")"',
|
|
4496
|
+
"# ENG-6567: observability. The recover_* gates used to return SILENTLY, so a",
|
|
4497
|
+
"# missed reply was undiagnosable in production \u2014 you could not tell",
|
|
4498
|
+
'# "fired-but-failed correlation" from "never-fired". log_ghost appends one',
|
|
4499
|
+
"# bounded line per decision to ${AGENT_DIR}/ghost-reply-hook.log (greppable",
|
|
4500
|
+
"# via the aws-host-agent-diagnostics SSM sweep). Bounded: trimmed to the last",
|
|
4501
|
+
"# 200 lines once it passes ~512KB, so a long-lived session cannot grow it",
|
|
4502
|
+
"# unboundedly. IDs are logged in their sanitized marker-filename form (already",
|
|
4503
|
+
"# present as cleartext marker filenames on disk), so this leaks nothing new.",
|
|
4504
|
+
'GHOST_LOG="${AGENT_DIR}/ghost-reply-hook.log"',
|
|
4505
|
+
"log_ghost() {",
|
|
4506
|
+
' echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) $*" >> "$GHOST_LOG" 2>/dev/null || true',
|
|
4507
|
+
' local sz; sz=$(wc -c < "$GHOST_LOG" 2>/dev/null || echo 0)',
|
|
4508
|
+
' if [ "${sz:-0}" -gt 524288 ]; then tail -n 200 "$GHOST_LOG" > "${GHOST_LOG}.tmp" 2>/dev/null && mv -f "${GHOST_LOG}.tmp" "$GHOST_LOG" 2>/dev/null || true; fi',
|
|
4509
|
+
"}",
|
|
4496
4510
|
'TG_MARKER_DIR="${AGENT_DIR}/telegram-pending-inbound"',
|
|
4497
4511
|
'SL_MARKER_DIR="${AGENT_DIR}/slack-pending-inbound"',
|
|
4498
4512
|
'MS_MARKER_DIR="${AGENT_DIR}/msteams-pending-inbound/.markers"',
|
|
@@ -4535,6 +4549,15 @@ function provisionStopHook(codeName) {
|
|
|
4535
4549
|
`CHANNEL_TAG=$(tail -400 "$TRANSCRIPT_PATH" | jq -r '${jqNormalizeContent} | map(select(type == "object" and .type == "text") | .text) | join(" ")' 2>/dev/null | grep -oE '<channel [^>]+>' | tail -1 || true)`,
|
|
4536
4550
|
'TAG_SOURCE=""',
|
|
4537
4551
|
`if [ -n "$CHANNEL_TAG" ]; then TAG_SOURCE=$(echo "$CHANNEL_TAG" | grep -oE 'source="[^"]+"' | head -1 | sed 's/source="\\(.*\\)"/\\1/' || true); fi`,
|
|
4552
|
+
"# ENG-6567: one context line per Stop that reached here (non-empty assistant",
|
|
4553
|
+
"# text + at least one pending marker). This is the load-bearing diagnostic:",
|
|
4554
|
+
"# it records the inbound source, pending-marker counts, whether the agent",
|
|
4555
|
+
"# called a reply tool in the final turn, and the text length \u2014 enough to",
|
|
4556
|
+
"# classify a miss without guessing. A missing TAG_SOURCE here explains the",
|
|
4557
|
+
"# 'marker present but never recovered' mystery (no <channel> tag correlated).",
|
|
4558
|
+
"REPLY_IN_LAST=no",
|
|
4559
|
+
`if echo "$TOOL_NAMES" | grep -qE '(^|__)(slack|telegram|teams)[._](reply|send_message)$'; then REPLY_IN_LAST=yes; fi`,
|
|
4560
|
+
'log_ghost "stop source=${TAG_SOURCE:-none} pending(tg=$TG_PENDING sl=$SL_PENDING ms=$MS_PENDING) text_len=${#TEXT} reply_tool_in_final_turn=$REPLY_IN_LAST"',
|
|
4538
4561
|
'extract_attr() { echo "$1" | grep -oE "$2=\\"[^\\"]+\\"" | head -1 | sed -E "s/$2=\\"(.*)\\"/\\\\1/"; }',
|
|
4539
4562
|
"# Atomic write helper: jq \u2192 tmp file in same dir, then rename. The",
|
|
4540
4563
|
"# channel-side fs.watch only fires on rename, so the file is never",
|
|
@@ -4570,13 +4593,14 @@ function provisionStopHook(codeName) {
|
|
|
4570
4593
|
" local marker_name",
|
|
4571
4594
|
' marker_name="$(safe_id "$chat_id")__$(safe_id "$msg_id").json"',
|
|
4572
4595
|
' local marker_path="${TG_MARKER_DIR}/${marker_name}"',
|
|
4573
|
-
' if [ ! -f "$marker_path" ]; then return; fi',
|
|
4596
|
+
' if [ ! -f "$marker_path" ]; then log_ghost "telegram skip=no_pending_marker chat=$(safe_id "$chat_id")"; return; fi',
|
|
4574
4597
|
" local TS",
|
|
4575
4598
|
" TS=$(date -u +%Y%m%dT%H%M%S%N)",
|
|
4576
4599
|
' atomic_write_payload "${AGENT_DIR}/telegram-recovery-outbox" "${TS}.json" \\',
|
|
4577
4600
|
` '{chat_id:$c, message_id:$m, text:$t, source:"ghost-reply-recovery"}' \\`,
|
|
4578
4601
|
' --arg c "$chat_id" --arg m "$msg_id" --arg t "$TEXT"',
|
|
4579
4602
|
' rm -f "$marker_path" 2>/dev/null || true',
|
|
4603
|
+
' log_ghost "telegram RECOVERED chat=$(safe_id "$chat_id") msg=$(safe_id "$msg_id") text_len=${#TEXT}"',
|
|
4580
4604
|
"}",
|
|
4581
4605
|
"recover_slack_for() {",
|
|
4582
4606
|
' local channel="$1" thread_ts="$2"',
|
|
@@ -4587,7 +4611,7 @@ function provisionStopHook(codeName) {
|
|
|
4587
4611
|
" # `mcp__slack__slack_reply`). The bare `^slack\\.reply$` never matched a",
|
|
4588
4612
|
" # real transcript, so this same-turn guard was dead in prod and only",
|
|
4589
4613
|
" # masked by the MCP-side marker clear.",
|
|
4590
|
-
` if echo "$TOOL_NAMES" | grep -qE '(^|__)slack[._]reply$'; then return; fi`,
|
|
4614
|
+
` if echo "$TOOL_NAMES" | grep -qE '(^|__)slack[._]reply$'; then log_ghost "slack skip=replied_this_turn thread=$(safe_id "$thread_ts")"; return; fi`,
|
|
4591
4615
|
" # ENG-6387 \u2014 correlation + fail-silent. The single-turn check above is",
|
|
4592
4616
|
" # not enough: a reply and trailing narration can straddle turns. If the",
|
|
4593
4617
|
" # agent has slack.replied to a DIFFERENT thread than THIS marker anywhere",
|
|
@@ -4598,7 +4622,7 @@ function provisionStopHook(codeName) {
|
|
|
4598
4622
|
" # silent gap the operator re-pings beats wrong content that poisons trust.",
|
|
4599
4623
|
" local replied_other",
|
|
4600
4624
|
` replied_other=$(tail -400 "$TRANSCRIPT_PATH" 2>/dev/null | jq -s --arg th "$thread_ts" '[ .[] | select((.type // .role)=="assistant") | (.message.content // .content // []) | (if type=="array" then . else [] end) | .[] | select((.type=="tool_use") and ((.name|tostring)|test("slack[._]reply$")) and (((.input.thread_ts // .input.message_ts // "")) as $t | ($t != $th and $t != ""))) ] | length' 2>/dev/null || true)`,
|
|
4601
|
-
' if [ "${replied_other:-0}" -gt 0 ] 2>/dev/null; then return; fi',
|
|
4625
|
+
' if [ "${replied_other:-0}" -gt 0 ] 2>/dev/null; then log_ghost "slack skip=replied_other_thread thread=$(safe_id "$thread_ts")"; return; fi',
|
|
4602
4626
|
" # Find any marker for this channel+thread (in busy threads multiple",
|
|
4603
4627
|
" # message_ts entries can be pending \u2014 recover the oldest, that's the",
|
|
4604
4628
|
" # one closest to firing the timeout).",
|
|
@@ -4608,13 +4632,14 @@ function provisionStopHook(codeName) {
|
|
|
4608
4632
|
' for f in "$SL_MARKER_DIR"/${prefix}*.json; do',
|
|
4609
4633
|
' if [ -z "$marker_path" ]; then marker_path="$f"; fi',
|
|
4610
4634
|
" done",
|
|
4611
|
-
' if [ -z "$marker_path" ]; then return; fi',
|
|
4635
|
+
' if [ -z "$marker_path" ]; then log_ghost "slack skip=no_pending_marker channel=$(safe_id "$channel") thread=$(safe_id "$thread_ts")"; return; fi',
|
|
4612
4636
|
" local TS",
|
|
4613
4637
|
" TS=$(date -u +%Y%m%dT%H%M%S%N)",
|
|
4614
4638
|
' atomic_write_payload "${AGENT_DIR}/slack-recovery-outbox" "${TS}.json" \\',
|
|
4615
4639
|
` '{channel:$c, thread_ts:$th, text:$t, source:"ghost-reply-recovery"}' \\`,
|
|
4616
4640
|
' --arg c "$channel" --arg th "$thread_ts" --arg t "$TEXT"',
|
|
4617
4641
|
' rm -f "$marker_path" 2>/dev/null || true',
|
|
4642
|
+
' log_ghost "slack RECOVERED channel=$(safe_id "$channel") thread=$(safe_id "$thread_ts") marker=$(basename "$marker_path") text_len=${#TEXT}"',
|
|
4618
4643
|
"}",
|
|
4619
4644
|
"recover_teams_for() {",
|
|
4620
4645
|
' local conversation_id="$1" reply_to_id="$2" service_url="$3"',
|
|
@@ -4644,13 +4669,14 @@ function provisionStopHook(codeName) {
|
|
|
4644
4669
|
' for f in "$MS_MARKER_DIR"/${hex_conv}*.json; do',
|
|
4645
4670
|
' if [ -z "$marker_path" ]; then marker_path="$f"; fi',
|
|
4646
4671
|
" done",
|
|
4647
|
-
' if [ -z "$marker_path" ]; then return; fi',
|
|
4672
|
+
' if [ -z "$marker_path" ]; then log_ghost "teams skip=no_pending_marker conv=$(safe_id "$conversation_id")"; return; fi',
|
|
4648
4673
|
" local TS",
|
|
4649
4674
|
" TS=$(date -u +%Y%m%dT%H%M%S%N)",
|
|
4650
4675
|
' atomic_write_payload "${AGENT_DIR}/msteams-recovery-outbox" "${TS}.json" \\',
|
|
4651
4676
|
` '{conversation_id:$c, reply_to_id:$r, service_url:$s, text:$t, source:"ghost-reply-recovery"}' \\`,
|
|
4652
4677
|
' --arg c "$conversation_id" --arg r "$reply_to_id" --arg s "$service_url" --arg t "$TEXT"',
|
|
4653
4678
|
' rm -f "$marker_path" 2>/dev/null || true',
|
|
4679
|
+
' log_ghost "teams RECOVERED conv=$(safe_id "$conversation_id") text_len=${#TEXT}"',
|
|
4654
4680
|
"}",
|
|
4655
4681
|
'# ENG-6467 / ADR-0024 Slice 2.5 \u2014 block-turn-end (the D1 "composed-but-unsent"',
|
|
4656
4682
|
"# fix), gated dark behind AGT_CHANNEL_BLOCK_TURN_END_ENABLED (registry flag",
|
|
@@ -4977,6 +5003,99 @@ exit 0
|
|
|
4977
5003
|
settings["hooks"] = hooks;
|
|
4978
5004
|
writeFileSync5(settingsPath, JSON.stringify(settings, null, 2));
|
|
4979
5005
|
}
|
|
5006
|
+
function provisionChannelProgressHook(codeName) {
|
|
5007
|
+
const projectDir = getProjectDir(codeName);
|
|
5008
|
+
const claudeDir = join4(projectDir, ".claude");
|
|
5009
|
+
mkdirSync4(claudeDir, { recursive: true });
|
|
5010
|
+
const hookScriptPath = join4(claudeDir, "agt-channel-progress-hook.sh");
|
|
5011
|
+
const hookScript = `#!/usr/bin/env bash
|
|
5012
|
+
# Auto-generated by Augmented (ENG-6567 Phase 2) \u2014 PostToolUse channel-progress
|
|
5013
|
+
# heartbeat. Writes a throttled local {step, updated_at_ms} the channel MCP reads
|
|
5014
|
+
# to drive a live in-thread progress indicator. Best-effort, silent, local-only.
|
|
5015
|
+
trap 'exit 0' ERR
|
|
5016
|
+
INPUT="$(cat 2>/dev/null || true)"
|
|
5017
|
+
[ -n "$INPUT" ] || INPUT="\${CLAUDE_HOOK_INPUT:-}"
|
|
5018
|
+
[ -n "$INPUT" ] || exit 0
|
|
5019
|
+
command -v jq >/dev/null 2>&1 || exit 0
|
|
5020
|
+
|
|
5021
|
+
TOOL="$(printf '%s' "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null || true)"
|
|
5022
|
+
[ -n "$TOOL" ] || exit 0
|
|
5023
|
+
# Skip tools that aren't narratable work (same set as auto-kanban-progress).
|
|
5024
|
+
case "$TOOL" in
|
|
5025
|
+
*kanban*|*reply*|*ask_user*|*send_message*|*direct_chat*|status_*|TodoWrite|ExitPlanMode) exit 0 ;;
|
|
5026
|
+
esac
|
|
5027
|
+
|
|
5028
|
+
# AGENT_DIR = ~/.augmented/<codeName> (parent of the project dir).
|
|
5029
|
+
PROJECT_DIR="\${CLAUDE_PROJECT_DIR:-$PWD}"
|
|
5030
|
+
AGENT_DIR="$(dirname "$PROJECT_DIR")"
|
|
5031
|
+
[ -d "$AGENT_DIR" ] || exit 0
|
|
5032
|
+
|
|
5033
|
+
# Throttle: at most one heartbeat per ~10s (the renderer polls slower).
|
|
5034
|
+
STAMP="$AGENT_DIR/.channel-progress-last"
|
|
5035
|
+
NOW="$(date +%s)"
|
|
5036
|
+
if [ -f "$STAMP" ]; then
|
|
5037
|
+
LAST="$(cat "$STAMP" 2>/dev/null || echo 0)"
|
|
5038
|
+
case "$LAST" in ''|*[!0-9]*) LAST=0 ;; esac
|
|
5039
|
+
[ $(( NOW - LAST )) -ge 10 ] || exit 0
|
|
5040
|
+
fi
|
|
5041
|
+
|
|
5042
|
+
# Derive the one-line "what I'm doing right now" step (mirrors auto-kanban-progress).
|
|
5043
|
+
STEP="$(printf '%s' "$INPUT" | jq -r '
|
|
5044
|
+
def base(p): (p | tostring | ltrimstr("./") | split("/") | last);
|
|
5045
|
+
.tool_name as $t | (.tool_input // {}) as $i |
|
|
5046
|
+
if $t == "Bash" then ($i.description // ("Running: " + (($i.command // "") | tostring | .[0:80])))
|
|
5047
|
+
elif $t == "Edit" then ("Editing " + base($i.file_path // $i.filePath // "a file"))
|
|
5048
|
+
elif $t == "MultiEdit" then ("Editing " + base($i.file_path // $i.filePath // "a file"))
|
|
5049
|
+
elif $t == "Write" then ("Writing " + base($i.file_path // $i.filePath // "a file"))
|
|
5050
|
+
elif $t == "Read" then ("Reading " + base($i.file_path // $i.filePath // "a file"))
|
|
5051
|
+
elif $t == "Grep" then ("Searching for " + (($i.pattern // "") | tostring | .[0:60]))
|
|
5052
|
+
elif $t == "Glob" then ("Finding files: " + (($i.pattern // "") | tostring | .[0:60]))
|
|
5053
|
+
elif $t == "WebSearch" then ("Searching the web: " + (($i.query // "") | tostring | .[0:60]))
|
|
5054
|
+
elif $t == "WebFetch" then ("Fetching " + (($i.url // "") | tostring | .[0:80]))
|
|
5055
|
+
elif ($t == "Task" or $t == "Agent") then ("Working on: " + (($i.description // "a subtask") | tostring | .[0:80]))
|
|
5056
|
+
elif ($t | startswith("mcp__")) then ("Using " + ($t | sub("^mcp__"; "") | gsub("__"; " / ")))
|
|
5057
|
+
else ("Working (" + $t + ")")
|
|
5058
|
+
end
|
|
5059
|
+
' 2>/dev/null || true)"
|
|
5060
|
+
STEP="$(printf '%s' "$STEP" | tr '\\n\\t' ' ' | sed 's/ */ /g' | cut -c1-160)"
|
|
5061
|
+
[ -n "$STEP" ] || exit 0
|
|
5062
|
+
|
|
5063
|
+
printf '%s' "$NOW" > "$STAMP" 2>/dev/null || true
|
|
5064
|
+
# Atomic write: per-process tmp + rename so the renderer never reads a
|
|
5065
|
+
# half-written file AND overlapping PostToolUse hook processes can't clobber
|
|
5066
|
+
# each other's tmp (CodeRabbit, ENG-6567). $$ + $RANDOM keeps the temp unique;
|
|
5067
|
+
# clean it up if the rename never happens.
|
|
5068
|
+
HB="$AGENT_DIR/channel-progress-heartbeat.json"
|
|
5069
|
+
TMP="$AGENT_DIR/.channel-progress-heartbeat.$$.\${RANDOM}.tmp"
|
|
5070
|
+
if jq -nc --arg s "$STEP" --argjson t "$(( NOW * 1000 ))" '{step:$s, updated_at_ms:$t}' > "$TMP" 2>/dev/null; then
|
|
5071
|
+
mv -f "$TMP" "$HB" 2>/dev/null || rm -f "$TMP" 2>/dev/null || true
|
|
5072
|
+
else
|
|
5073
|
+
rm -f "$TMP" 2>/dev/null || true
|
|
5074
|
+
fi
|
|
5075
|
+
exit 0
|
|
5076
|
+
`;
|
|
5077
|
+
writeFileSync5(hookScriptPath, hookScript, { mode: 493 });
|
|
5078
|
+
const settingsPath = join4(claudeDir, "settings.local.json");
|
|
5079
|
+
let settings = {};
|
|
5080
|
+
try {
|
|
5081
|
+
settings = JSON.parse(readFileSync5(settingsPath, "utf-8"));
|
|
5082
|
+
} catch {
|
|
5083
|
+
}
|
|
5084
|
+
const hooks = settings["hooks"] ?? {};
|
|
5085
|
+
const groups = Array.isArray(hooks["PostToolUse"]) ? hooks["PostToolUse"] : [];
|
|
5086
|
+
const cmd = { type: "command", command: hookScriptPath };
|
|
5087
|
+
const already = groups.some((g) => (g.hooks ?? []).some((h) => h.command === hookScriptPath));
|
|
5088
|
+
if (!already) {
|
|
5089
|
+
if (groups.length > 0) {
|
|
5090
|
+
groups[0].hooks = [...groups[0].hooks ?? [], cmd];
|
|
5091
|
+
} else {
|
|
5092
|
+
groups.push({ hooks: [cmd] });
|
|
5093
|
+
}
|
|
5094
|
+
}
|
|
5095
|
+
hooks["PostToolUse"] = groups;
|
|
5096
|
+
settings["hooks"] = hooks;
|
|
5097
|
+
writeFileSync5(settingsPath, JSON.stringify(settings, null, 2));
|
|
5098
|
+
}
|
|
4980
5099
|
function provisionOrientHook(codeName) {
|
|
4981
5100
|
const projectDir = getProjectDir(codeName);
|
|
4982
5101
|
const claudeDir = join4(projectDir, ".claude");
|
|
@@ -7397,7 +7516,7 @@ function requireHost() {
|
|
|
7397
7516
|
}
|
|
7398
7517
|
|
|
7399
7518
|
// src/lib/api-client.ts
|
|
7400
|
-
var agtCliVersion = true ? "0.28.
|
|
7519
|
+
var agtCliVersion = true ? "0.28.80" : "dev";
|
|
7401
7520
|
var lastConfigHash = null;
|
|
7402
7521
|
function setConfigHash(hash) {
|
|
7403
7522
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -8649,6 +8768,7 @@ export {
|
|
|
8649
8768
|
provisionStopHook,
|
|
8650
8769
|
provisionIsolationHook,
|
|
8651
8770
|
provisionAutoKanbanProgressHook,
|
|
8771
|
+
provisionChannelProgressHook,
|
|
8652
8772
|
provisionOrientHook,
|
|
8653
8773
|
provisionSessionStateHook,
|
|
8654
8774
|
setJsonMode,
|
|
@@ -8693,4 +8813,4 @@ export {
|
|
|
8693
8813
|
managerInstallSystemUnitCommand,
|
|
8694
8814
|
managerUninstallSystemUnitCommand
|
|
8695
8815
|
};
|
|
8696
|
-
//# sourceMappingURL=chunk-
|
|
8816
|
+
//# sourceMappingURL=chunk-JIJ5BGO5.js.map
|