@integrity-labs/agt-cli 0.28.47 → 0.28.49
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-ONG7KSRP.js → chunk-MJKGJXKV.js} +25 -1
- package/dist/chunk-MJKGJXKV.js.map +1 -0
- package/dist/{chunk-UVE6VSU3.js → chunk-NCP6GVXS.js} +2 -2
- package/dist/{chunk-FON5YIFK.js → chunk-UVKKX46F.js} +79 -4
- package/dist/chunk-UVKKX46F.js.map +1 -0
- package/dist/{claude-pair-runtime-QXRSXJ4D.js → claude-pair-runtime-SAJMKK2M.js} +2 -2
- package/dist/lib/manager-worker.js +9 -10
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/{persistent-session-Q73X7PPM.js → persistent-session-HL2ANGTL.js} +3 -3
- package/dist/{responsiveness-probe-R7WZXP2Y.js → responsiveness-probe-KSY4M6NR.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-FON5YIFK.js.map +0 -1
- package/dist/chunk-ONG7KSRP.js.map +0 -1
- /package/dist/{chunk-UVE6VSU3.js.map → chunk-NCP6GVXS.js.map} +0 -0
- /package/dist/{claude-pair-runtime-QXRSXJ4D.js.map → claude-pair-runtime-SAJMKK2M.js.map} +0 -0
- /package/dist/{persistent-session-Q73X7PPM.js.map → persistent-session-HL2ANGTL.js.map} +0 -0
- /package/dist/{responsiveness-probe-R7WZXP2Y.js.map → responsiveness-probe-KSY4M6NR.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
formatMissingVar,
|
|
4
4
|
isClaudeFastMode,
|
|
5
5
|
probeMcpEnvSubstitution
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MJKGJXKV.js";
|
|
7
7
|
import {
|
|
8
8
|
reapOrphanChannelMcps
|
|
9
9
|
} from "./chunk-XWVM4KPK.js";
|
|
@@ -1395,4 +1395,4 @@ export {
|
|
|
1395
1395
|
stopAllSessionsAndWait,
|
|
1396
1396
|
getProjectDir
|
|
1397
1397
|
};
|
|
1398
|
-
//# sourceMappingURL=chunk-
|
|
1398
|
+
//# sourceMappingURL=chunk-NCP6GVXS.js.map
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveConnectivityProbe,
|
|
23
23
|
worseConnectivityOutcome,
|
|
24
24
|
wrapScheduledTaskPrompt
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-MJKGJXKV.js";
|
|
26
26
|
|
|
27
27
|
// ../../packages/core/dist/integrations/registry.js
|
|
28
28
|
var INTEGRATION_REGISTRY = [
|
|
@@ -4633,21 +4633,96 @@ function provisionStopHook(codeName) {
|
|
|
4633
4633
|
' --arg c "$conversation_id" --arg r "$reply_to_id" --arg s "$service_url" --arg t "$TEXT"',
|
|
4634
4634
|
' rm -f "$marker_path" 2>/dev/null || true',
|
|
4635
4635
|
"}",
|
|
4636
|
+
'# ENG-6467 / ADR-0024 Slice 2.5 \u2014 block-turn-end (the D1 "composed-but-unsent"',
|
|
4637
|
+
"# fix), gated dark behind AGT_CHANNEL_BLOCK_TURN_END_ENABLED (registry flag",
|
|
4638
|
+
"# channel-block-turn-end; the env var is the operator/canary override the bash",
|
|
4639
|
+
"# hook reads directly). When ON: if the agent owes a reply to the last-tagged",
|
|
4640
|
+
"# inbound (a pending marker that is NOT discretionary and NOT undeliverable) and",
|
|
4641
|
+
'# did NOT call the matching reply tool this turn, return {"decision":"block"} so',
|
|
4642
|
+
"# the MODEL sends the reply itself \u2014 right thread, right content, NO recovery",
|
|
4643
|
+
"# mis-correlation (the D2/koda failure the recover_* paths guard against).",
|
|
4644
|
+
"# Capped to one block per inbound via a per-marker ledger; stop_hook_active is",
|
|
4645
|
+
"# an ADDITIONAL belt suppressor, never the sole cap (it is unverified across the",
|
|
4646
|
+
"# fleet's --resume sessions). After one block we fall through to the existing",
|
|
4647
|
+
"# recovery-outbox. OFF (default / unset) \u21D2 exactly today's behavior.",
|
|
4648
|
+
"BLOCK_TURN_END_ON=0",
|
|
4649
|
+
'case "${AGT_CHANNEL_BLOCK_TURN_END_ENABLED:-}" in true|1|TRUE|True) BLOCK_TURN_END_ON=1;; esac',
|
|
4650
|
+
`STOP_ACTIVE=$(echo "$INPUT" | jq -r '.stop_hook_active // false' 2>/dev/null || echo false)`,
|
|
4651
|
+
'BLOCK_LEDGER_DIR="${AGENT_DIR}/.agt-block-turn-end-ledger"',
|
|
4652
|
+
"# GC stale ledger entries (>1 day) so the per-marker cap dir cannot grow unbounded.",
|
|
4653
|
+
'if [ -d "$BLOCK_LEDGER_DIR" ]; then find "$BLOCK_LEDGER_DIR" -type f -mtime +1 -delete 2>/dev/null || true; fi',
|
|
4654
|
+
"# Returns 0 (after printing the block JSON to stdout) when it blocked; 1 otherwise.",
|
|
4655
|
+
"# $1 = reply-tool name regex (same shape the recover_* same-turn guards use)",
|
|
4656
|
+
"# $2 = newline-separated candidate marker paths for the tagged conversation",
|
|
4657
|
+
"# $3 = reply-tool hint shown to the model in the block reason",
|
|
4658
|
+
"emit_block_if_obligated() {",
|
|
4659
|
+
' local reply_re="$1" candidates="$2" tool_hint="$3"',
|
|
4660
|
+
' if [ "$BLOCK_TURN_END_ON" != "1" ]; then return 1; fi',
|
|
4661
|
+
" # Belt: never block during a continuation Claude Code already flagged.",
|
|
4662
|
+
' if [ "$STOP_ACTIVE" = "true" ]; then return 1; fi',
|
|
4663
|
+
" # Already replied to THIS conversation this turn \u21D2 nothing owed.",
|
|
4664
|
+
' if echo "$TOOL_NAMES" | grep -qE "$reply_re"; then return 1; fi',
|
|
4665
|
+
' local m d u obligated=""',
|
|
4666
|
+
" while IFS= read -r m; do",
|
|
4667
|
+
' if [ -z "$m" ] || [ ! -f "$m" ]; then continue; fi',
|
|
4668
|
+
" # Fail-safe: a parse error defaults to 'true' (treat as discretionary /",
|
|
4669
|
+
" # undeliverable \u21D2 NOT owed \u21D2 do not block) so a partial/corrupt marker can",
|
|
4670
|
+
" # never manufacture a spurious block (the ENG-6288 swallowed-jq-error class).",
|
|
4671
|
+
` d=$(jq -r '.discretionary // false' "$m" 2>/dev/null || echo true)`,
|
|
4672
|
+
` u=$(jq -r '.undeliverable // false' "$m" 2>/dev/null || echo true)`,
|
|
4673
|
+
' if [ "$d" != "true" ] && [ "$u" != "true" ]; then obligated="$m"; break; fi',
|
|
4674
|
+
" done <<MARKERS",
|
|
4675
|
+
"$candidates",
|
|
4676
|
+
"MARKERS",
|
|
4677
|
+
' if [ -z "$obligated" ]; then return 1; fi',
|
|
4678
|
+
' local led_name; led_name="$(basename "$obligated")"',
|
|
4679
|
+
" # Only block when the per-marker cap can be PERSISTED. If the ledger dir or",
|
|
4680
|
+
' # file write fails we cannot record "blocked once", so blocking would risk a',
|
|
4681
|
+
" # re-block loop on the next Stop \u2014 degrade to recovery instead (CodeRabbit).",
|
|
4682
|
+
' if ! mkdir -p "$BLOCK_LEDGER_DIR" 2>/dev/null; then echo "agt-ghost-reply-hook: block-turn-end degraded (ledger dir create failed) \u2014 falling through to recovery" >&2; return 1; fi',
|
|
4683
|
+
' local led="${BLOCK_LEDGER_DIR}/${led_name}"',
|
|
4684
|
+
" # Per-marker cap: block at most once per inbound. Second Stop with the same",
|
|
4685
|
+
" # marker still pending \u21D2 the model ignored the block \u21D2 fall through to recovery.",
|
|
4686
|
+
' if [ -f "$led" ]; then echo "agt-ghost-reply-hook: block-turn-end degraded (already blocked ${led_name}) \u2014 falling through to recovery" >&2; return 1; fi',
|
|
4687
|
+
' if ! : > "$led" 2>/dev/null; then echo "agt-ghost-reply-hook: block-turn-end degraded (ledger write failed ${led_name}) \u2014 falling through to recovery" >&2; return 1; fi',
|
|
4688
|
+
' echo "agt-ghost-reply-hook: block-turn-end FIRED marker=${led_name} tool=$tool_hint" >&2',
|
|
4689
|
+
' local reason="You composed a reply but did not send it. The person is still waiting and will see only silence. Call ${tool_hint} now for the message you were answering: send your answer, or a brief status update if you are still working. Do not just summarize what you intended to say; actually send it via the tool."',
|
|
4690
|
+
` jq -cn --arg r "$reason" '{decision:"block", reason:$r}'`,
|
|
4691
|
+
" return 0",
|
|
4692
|
+
"}",
|
|
4636
4693
|
"# Strict correlation: only recover if the last channel tag in the",
|
|
4637
4694
|
"# transcript points at a channel/key that has an exact-match pending",
|
|
4638
|
-
"# marker. No tag found \u2192 skip; let timeout handle it.",
|
|
4695
|
+
"# marker. No tag found \u2192 skip; let timeout handle it. Block-turn-end (when",
|
|
4696
|
+
"# armed) runs FIRST per source; if it blocks we exit before recovery so the",
|
|
4697
|
+
"# two mechanisms never both fire on one Stop.",
|
|
4639
4698
|
'if [ "$TAG_SOURCE" = "telegram" ]; then',
|
|
4640
4699
|
' CHAT_ID=$(extract_attr "$CHANNEL_TAG" "chat_id")',
|
|
4641
4700
|
' MSG_ID=$(extract_attr "$CHANNEL_TAG" "message_id")',
|
|
4701
|
+
' if [ -n "$CHAT_ID" ] && [ -n "$MSG_ID" ]; then',
|
|
4702
|
+
' TG_CAND="${TG_MARKER_DIR}/$(safe_id "$CHAT_ID")__$(safe_id "$MSG_ID").json"',
|
|
4703
|
+
` if emit_block_if_obligated '(^|__)telegram[._](reply|send_message)$' "$TG_CAND" 'telegram.reply'; then exit 0; fi`,
|
|
4704
|
+
" fi",
|
|
4642
4705
|
' recover_telegram_for "$CHAT_ID" "$MSG_ID"',
|
|
4643
4706
|
'elif [ "$TAG_SOURCE" = "slack" ]; then',
|
|
4644
4707
|
' CHANNEL=$(extract_attr "$CHANNEL_TAG" "channel")',
|
|
4645
4708
|
' THREAD_TS=$(extract_attr "$CHANNEL_TAG" "thread_ts")',
|
|
4709
|
+
' if [ -n "$CHANNEL" ]; then',
|
|
4710
|
+
' SL_PREFIX="${SL_MARKER_DIR}/$(safe_id "$CHANNEL")__$(safe_id "$THREAD_TS")__"',
|
|
4711
|
+
" shopt -s nullglob",
|
|
4712
|
+
` SL_CAND=$(printf '%s\\n' "$SL_PREFIX"*.json)`,
|
|
4713
|
+
` if emit_block_if_obligated '(^|__)slack[._]reply$' "$SL_CAND" 'slack.reply'; then exit 0; fi`,
|
|
4714
|
+
" fi",
|
|
4646
4715
|
' recover_slack_for "$CHANNEL" "$THREAD_TS"',
|
|
4647
4716
|
'elif [ "$TAG_SOURCE" = "msteams" ]; then',
|
|
4648
4717
|
' CONVERSATION_ID=$(extract_attr "$CHANNEL_TAG" "conversation_id")',
|
|
4649
4718
|
' REPLY_TO_ID=$(extract_attr "$CHANNEL_TAG" "reply_to_id")',
|
|
4650
4719
|
' SERVICE_URL=$(extract_attr "$CHANNEL_TAG" "service_url")',
|
|
4720
|
+
' if [ -n "$CONVERSATION_ID" ]; then',
|
|
4721
|
+
' HEX_CONV=$(printf %s "$CONVERSATION_ID" | od -An -tx1 | tr -d " \\n" | cut -c1-64)',
|
|
4722
|
+
" shopt -s nullglob",
|
|
4723
|
+
" MS_CAND=$(printf '%s\\n' \"${MS_MARKER_DIR}/${HEX_CONV}\"*.json)",
|
|
4724
|
+
` if emit_block_if_obligated '(^|__)teams[._]reply$' "$MS_CAND" 'teams.reply'; then exit 0; fi`,
|
|
4725
|
+
" fi",
|
|
4651
4726
|
' recover_teams_for "$CONVERSATION_ID" "$REPLY_TO_ID" "$SERVICE_URL"',
|
|
4652
4727
|
"fi",
|
|
4653
4728
|
"exit 0"
|
|
@@ -7280,7 +7355,7 @@ function requireHost() {
|
|
|
7280
7355
|
}
|
|
7281
7356
|
|
|
7282
7357
|
// src/lib/api-client.ts
|
|
7283
|
-
var agtCliVersion = true ? "0.28.
|
|
7358
|
+
var agtCliVersion = true ? "0.28.49" : "dev";
|
|
7284
7359
|
var lastConfigHash = null;
|
|
7285
7360
|
function setConfigHash(hash) {
|
|
7286
7361
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -8561,4 +8636,4 @@ export {
|
|
|
8561
8636
|
managerInstallSystemUnitCommand,
|
|
8562
8637
|
managerUninstallSystemUnitCommand
|
|
8563
8638
|
};
|
|
8564
|
-
//# sourceMappingURL=chunk-
|
|
8639
|
+
//# sourceMappingURL=chunk-UVKKX46F.js.map
|