@integrity-labs/agt-cli 0.28.1261 → 0.28.1262
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/{api-client-2YLFNHFZ.js → api-client-DQ7YV5IG.js} +3 -3
- package/dist/bin/agt.js +7 -7
- package/dist/{chunk-335HKIDZ.js → chunk-5BXIXSSH.js} +2 -2
- package/dist/{chunk-6NHFZYUP.js → chunk-6YWVKLHF.js} +3 -3
- package/dist/{chunk-I2NQQOMD.js → chunk-CEJNJ6NF.js} +3 -3
- package/dist/{chunk-JYSPPCHG.js → chunk-HJWOXFJM.js} +2 -2
- package/dist/{chunk-QFLR5EFT.js → chunk-KJ5OCCSJ.js} +2 -2
- package/dist/{chunk-QFLR5EFT.js.map → chunk-KJ5OCCSJ.js.map} +1 -1
- package/dist/{chunk-ZEJUBTXJ.js → chunk-PIKXAEVA.js} +89 -5
- package/dist/chunk-PIKXAEVA.js.map +1 -0
- package/dist/{claude-code-updater-B2BWPRFE.js → claude-code-updater-JQLNRK25.js} +3 -3
- package/dist/{claude-pair-runtime-FNDHAPXR.js → claude-pair-runtime-BJ3EAWEJ.js} +3 -3
- package/dist/lib/manager-worker.js +21 -21
- package/dist/mcp/direct-chat-channel.js +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/origami.js +1 -1
- package/dist/mcp/slack-channel.js +1 -1
- package/dist/mcp/teams-channel.js +218 -82
- package/dist/mcp/telegram-channel.js +159 -1
- package/dist/{persistent-session-LHQLLU4U.js → persistent-session-YNHYNCNA.js} +4 -4
- package/dist/{responsiveness-probe-KDSNPKUY.js → responsiveness-probe-57RV3U2H.js} +4 -4
- package/dist/{session-auth-dead-3IHR4M2B.js → session-auth-dead-A3TO2N63.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-ZEJUBTXJ.js.map +0 -1
- /package/dist/{api-client-2YLFNHFZ.js.map → api-client-DQ7YV5IG.js.map} +0 -0
- /package/dist/{chunk-335HKIDZ.js.map → chunk-5BXIXSSH.js.map} +0 -0
- /package/dist/{chunk-6NHFZYUP.js.map → chunk-6YWVKLHF.js.map} +0 -0
- /package/dist/{chunk-I2NQQOMD.js.map → chunk-CEJNJ6NF.js.map} +0 -0
- /package/dist/{chunk-JYSPPCHG.js.map → chunk-HJWOXFJM.js.map} +0 -0
- /package/dist/{claude-code-updater-B2BWPRFE.js.map → claude-code-updater-JQLNRK25.js.map} +0 -0
- /package/dist/{claude-pair-runtime-FNDHAPXR.js.map → claude-pair-runtime-BJ3EAWEJ.js.map} +0 -0
- /package/dist/{persistent-session-LHQLLU4U.js.map → persistent-session-YNHYNCNA.js.map} +0 -0
- /package/dist/{responsiveness-probe-KDSNPKUY.js.map → responsiveness-probe-57RV3U2H.js.map} +0 -0
- /package/dist/{session-auth-dead-3IHR4M2B.js.map → session-auth-dead-A3TO2N63.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
exchangeApiKey,
|
|
3
3
|
getApiKey,
|
|
4
4
|
getHost
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6YWVKLHF.js";
|
|
6
6
|
import {
|
|
7
7
|
LATE_BOUND_VARS,
|
|
8
8
|
PLATFORM_DENY_PERMISSIONS,
|
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
shellQuote,
|
|
26
26
|
withheldRemoteMcpMessage,
|
|
27
27
|
withheldRemoteMcpReasonFor
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-CEJNJ6NF.js";
|
|
29
29
|
import {
|
|
30
30
|
readDailySessionPin,
|
|
31
31
|
sessionTranscriptDir
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-HJWOXFJM.js";
|
|
33
33
|
import {
|
|
34
34
|
classifyUnanswerablePane,
|
|
35
35
|
isConsumerTermsDialogVisible,
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
scanConfigForLiteralSecrets,
|
|
102
102
|
worseConnectivityOutcome,
|
|
103
103
|
wrapScheduledTaskPrompt
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-KJ5OCCSJ.js";
|
|
105
105
|
import {
|
|
106
106
|
claudeJsonPathFor,
|
|
107
107
|
effectiveClaudeJsonPath,
|
|
@@ -3508,6 +3508,85 @@ function provisionStopHook(codeName) {
|
|
|
3508
3508
|
"# A stale tag must not correlate anything: drop it so the per-source dispatch",
|
|
3509
3509
|
"# and the sole-pending-marker fallback both see no target.",
|
|
3510
3510
|
'if [ "$SYS_WAKE_LAST" = "1" ]; then CHANNEL_TAG=""; fi',
|
|
3511
|
+
"# ENG-11890: publish end-of-turn text ONLY from a turn the pending inbound",
|
|
3512
|
+
"# actually triggered. Live repro (Scout, 16 Nov): an unanswered Telegram",
|
|
3513
|
+
"# question left its marker open; the next turn was a SCHEDULED CARD, and its",
|
|
3514
|
+
'# plain-text notes ("Quiet hourly check, so I suppressed delivery...") were',
|
|
3515
|
+
"# posted to the person as the reply. The newest-tag correlation above cannot",
|
|
3516
|
+
"# tell those apart: a replayed or mid-turn inbound can be the newest <channel>",
|
|
3517
|
+
"# tag in a turn something else started.",
|
|
3518
|
+
"#",
|
|
3519
|
+
"# So classify the turn by its FIRST inbound record after the previous",
|
|
3520
|
+
"# end_turn, by its OPENING envelope only (CodeRabbit, #7599): the record must",
|
|
3521
|
+
"# START with a <channel ...> tag, and only that tag's own attributes decide,",
|
|
3522
|
+
'# so a [Task: ...] that quotes "<channel " stays `task`, and a body quoting',
|
|
3523
|
+
'# requires_reply="false" cannot turn a real inbound into a notice. The tag is read',
|
|
3524
|
+
'# attribute by attribute (name="value", scanned left to right), so text INSIDE',
|
|
3525
|
+
"# a value such as thread_context is never taken for an attribute. A real tag is",
|
|
3526
|
+
'# `channel`; a DIRECT-CHAT tag with requires_reply="false" (the notice rail',
|
|
3527
|
+
"# scheduled cards and /loop ticks arrive on) is `notice`. NOT expects_reply",
|
|
3528
|
+
"# alone (Obi Wan f7fd49ffb8f8): Slack auto-followed (discretionary) inbounds",
|
|
3529
|
+
'# carry expects_reply="false" too, and their markers cannot replay, so',
|
|
3530
|
+
"# skipping them would lose the ENG-6319 recovery for good. A",
|
|
3531
|
+
"# `[Task: ...]` inject is `task`; any other text (a plain system inject) is",
|
|
3532
|
+
"# `other`. Only `channel` may recover. The previous end_turn is the last one",
|
|
3533
|
+
"# from a DIFFERENT message that a real inbound follows (Obi Wan b979d45eae20,",
|
|
3534
|
+
"# 3fe445e51a0c): a multi-block final message writes several end_turn records,",
|
|
3535
|
+
"# and a block-turn-end continuation is followed only by hook feedback, so",
|
|
3536
|
+
"# neither may be taken as the boundary. The boundary end_turn must be one whose",
|
|
3537
|
+
"# FIRST following user text record (compact summaries skipped) is a real inbound: a blocked end_turn is",
|
|
3538
|
+
"# followed first by the block feedback, so a replay that lands after that",
|
|
3539
|
+
"# feedback cannot re-open the turn (CodeRabbit, #7599). Synthetic records are skipped BY",
|
|
3540
|
+
"# CONTENT, never by isMeta (Obi Wan 20407ffa542a): Claude Code writes the real",
|
|
3541
|
+
"# <channel> inbound records with isMeta:true (measured on a live agent",
|
|
3542
|
+
"# transcript, 31/31). Skipped: the compact summary (isCompactSummary,",
|
|
3543
|
+
"# isVisibleInTranscriptOnly), this hook's own two block reasons and Claude",
|
|
3544
|
+
`# Code's "Stop hook feedback" wrapper, slash-command echoes, and the`,
|
|
3545
|
+
"# interrupt marker. Fails OPEN to today's behaviour as",
|
|
3546
|
+
"# `unknown` when the previous end_turn is not in the tail, so this can only",
|
|
3547
|
+
"# remove a post, never add one. It skips only a marker the replay scanner will",
|
|
3548
|
+
"# re-push (turn_gate_skips), so the inbound is re-delivered and answered.",
|
|
3549
|
+
`TURN_TRIGGER=$(jq -rs 'def ctext: (.message.content // .content // []) | if type=="string" then . elif type=="array" then (map(select(type=="object" and .type=="text") | .text) | join(" ")) else "" end; def isasst: ((.type // "") == "assistant") or ((.role // "") == "assistant"); def synthetic: test("^\\\\s*(Stop hook feedback|You composed a reply but did not send it|You have [0-9]+ conversation\\\\(s\\\\) you did not answer|<command-name>|<local-command-|\\\\[Request interrupted)"); def inbound($r): (($r.type // "") == "user") and (($r.isCompactSummary // false) != true) and (($r.isVisibleInTranscriptOnly // false) != true) and (($r | ctext) as $x | ($x | length) > 0 and (($x | synthetic) | not)); . as $all | [range(0; $all|length) | select($all[.] | isasst)] as $ai | if ($ai|length) == 0 then "unknown" else ($ai | last) as $f | ($all[$f].message.id // null) as $fid | ([ $ai[] | select(. < $f) | select(($all[.].message.stop_reason // "") == "end_turn") | select(($fid == null) or (($all[.].message.id // null) != $fid)) | . as $e | ([ range($e + 1; $f) | select((($all[.].type // "") == "user") and (($all[.].isCompactSummary // false) != true) and (($all[.].isVisibleInTranscriptOnly // false) != true) and (($all[.] | ctext | length) > 0)) ] | first) as $u | select($u != null and inbound($all[$u])) ] | last) as $p | if $p == null then "unknown" else ([ range($p + 1; $f) | select(inbound($all[.])) | ($all[.] | ctext | gsub("[\\\\n\\\\r]+"; " ")) ] | first) as $t | if $t == null then "unknown" elif ($t | test("^\\\\s*<channel [^>]*>")) then ((($t | capture("^\\\\s*(?<h><channel [^>]*>)") | .h) | [scan("([A-Za-z_][A-Za-z0-9_]*)=\\\\x22([^\\\\x22]*)\\\\x22")]) as $a | if ($a | any(.[0] == "source" and .[1] == "direct-chat")) and ($a | any(.[0] == "requires_reply" and .[1] == "false")) then "notice" else "channel" end) elif ($t | test("^\\\\s*\\\\[Task: [A-Za-z0-9_-]+\\\\]")) then "task" else "other" end end end' "$RECENT_FILE" 2>/dev/null || echo unknown)`,
|
|
3550
|
+
"TURN_NOT_INBOUND=0",
|
|
3551
|
+
'case "${TURN_TRIGGER:-unknown}" in notice|task|other) TURN_NOT_INBOUND=1 ;; esac',
|
|
3552
|
+
"# The gate may only skip a marker that WILL be re-delivered (Obi Wan",
|
|
3553
|
+
"# b76cf6f36491 and the Slack discretionary observation on #7599): a skipped reply",
|
|
3554
|
+
"# is safe only if replay re-asks it. So it applies only to a marker the replay",
|
|
3555
|
+
"# scanner would re-push (markerReplayable in ack-reaction.ts: replay on, a push",
|
|
3556
|
+
"# payload, not discretionary). Teams and direct-chat have no replay scanner and",
|
|
3557
|
+
"# are never gated. channel-replay is resolved like the orient hook (env > the",
|
|
3558
|
+
"# manager flags cache > compiled default true).",
|
|
3559
|
+
"TURN_GATE_MAX_REPLAYS=3",
|
|
3560
|
+
"GATE_REPLAY_ON=true",
|
|
3561
|
+
'# CodeRabbit (#7599): trim and lowercase first, as the MCP envBoolean does, so " FALSE " means off.',
|
|
3562
|
+
`case "$(printf '%s' "\${AGT_CHANNEL_REPLAY_ENABLED:-}" | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')" in`,
|
|
3563
|
+
" true|1|yes|on) GATE_REPLAY_ON=true ;;",
|
|
3564
|
+
" false|0|no|off) GATE_REPLAY_ON=false ;;",
|
|
3565
|
+
" *)",
|
|
3566
|
+
" # Obi Wan (#7599 observation, 45597e9d6898): the channel MCP picks ONE cache",
|
|
3567
|
+
" # (flags-cache-read.ts defaultFlagsCachePath: the per-agent mirror at",
|
|
3568
|
+
" # ~/.augmented/<AGT_AGENT_ID>/ unless the host-wide file is fresher or the",
|
|
3569
|
+
" # mirror has no flags map). Rather than re-implement that choice in bash,",
|
|
3570
|
+
" # be STRICTER: skipping a recovery is the risky act, so replay counts as off",
|
|
3571
|
+
" # if ANY readable candidate says channel-replay is false. Whichever file the",
|
|
3572
|
+
" # MCP chose, the hook can then never think replay is on while the MCP thinks",
|
|
3573
|
+
" # it is off. No readable value anywhere means the compiled default (true).",
|
|
3574
|
+
' for _gate_fc in ${AGT_AGENT_ID:+"$(dirname "$AGENT_DIR")/$AGT_AGENT_ID/flags-cache.json"} "$AGENT_DIR/flags-cache.json" "$(dirname "$AGENT_DIR")/flags-cache.json"; do',
|
|
3575
|
+
` if [ -f "$_gate_fc" ] && [ "$(jq -r '.flags["channel-replay"] | tostring' "$_gate_fc" 2>/dev/null || echo null)" = "false" ]; then GATE_REPLAY_ON=false; fi`,
|
|
3576
|
+
" done",
|
|
3577
|
+
" ;;",
|
|
3578
|
+
"esac",
|
|
3579
|
+
"turn_gate_skips() {",
|
|
3580
|
+
" # $1 = the marker this recovery would answer. True (0) = skip the post.",
|
|
3581
|
+
' [ "$TURN_NOT_INBOUND" = "1" ] || return 1',
|
|
3582
|
+
' [ "$GATE_REPLAY_ON" = "true" ] || return 1',
|
|
3583
|
+
' [ -n "$1" ] && [ -f "$1" ] || return 1',
|
|
3584
|
+
" # Obi Wan 3438965dd00b: a marker whose replays are used up will never be",
|
|
3585
|
+
" # re-pushed (shouldReplayMarker refuses replay_count >= MAX_MARKER_REPLAYS), so",
|
|
3586
|
+
" # it is not gated either. TURN_GATE_MAX_REPLAYS must equal MAX_MARKER_REPLAYS in",
|
|
3587
|
+
" # packages/mcp/src/ack-reaction.ts; a test pins the two together.",
|
|
3588
|
+
` [ "$(jq -r --argjson max "$TURN_GATE_MAX_REPLAYS" 'if (.payload != null) and ((.discretionary // false) != true) and ((.replay_count // 0) < $max) then "yes" else "no" end' "$1" 2>/dev/null || echo no)" = "yes" ]`,
|
|
3589
|
+
"}",
|
|
3511
3590
|
'TAG_SOURCE=""',
|
|
3512
3591
|
`if [ -n "$CHANNEL_TAG" ]; then TAG_SOURCE=$(echo "$CHANNEL_TAG" | grep -oE 'source="[^"]+"' | head -1 | sed 's/source="\\(.*\\)"/\\1/' || true); fi`,
|
|
3513
3592
|
"# ENG-6567: one context line per Stop that reached here (non-empty assistant",
|
|
@@ -3626,6 +3705,7 @@ function provisionStopHook(codeName) {
|
|
|
3626
3705
|
' marker_name="$(safe_id "$chat_id")__$(safe_id "$msg_id").json"',
|
|
3627
3706
|
' local marker_path="${TG_MARKER_DIR}/${marker_name}"',
|
|
3628
3707
|
' if [ ! -f "$marker_path" ]; then log_ghost "telegram skip=no_pending_marker chat=$(safe_id "$chat_id")"; return; fi',
|
|
3708
|
+
' if turn_gate_skips "$marker_path"; then log_ghost "skip=turn_not_triggered_by_inbound trigger=${TURN_TRIGGER} fn=${FUNCNAME[0]}"; return; fi',
|
|
3629
3709
|
" # ENG-7805 (fm2): confirm-before-clear. Cap re-fire with a per-marker ledger and",
|
|
3630
3710
|
" # LEAVE the marker for the consumer to clear on confirmed send. Ledger-first",
|
|
3631
3711
|
" # fail-safe (same as recover_directchat_for / block-turn-end): if the ledger",
|
|
@@ -3691,6 +3771,7 @@ function provisionStopHook(codeName) {
|
|
|
3691
3771
|
" shopt -s nullglob",
|
|
3692
3772
|
' for f in "$SL_MARKER_DIR"/${prefix}*.json; do if [ -z "$marker_path" ]; then marker_path="$f"; fi; done',
|
|
3693
3773
|
' if [ -z "$marker_path" ]; then log_ghost "slack skip=no_pending_marker channel=$(safe_id "$channel") thread=$(safe_id "$thread_ts")"; return; fi',
|
|
3774
|
+
' if turn_gate_skips "$marker_path"; then log_ghost "skip=turn_not_triggered_by_inbound trigger=${TURN_TRIGGER} fn=${FUNCNAME[0]}"; return; fi',
|
|
3694
3775
|
' local _sl_iid="" _sl_recv=""',
|
|
3695
3776
|
` _sl_iid=$(jq -r '.inbound_id // ""' "$marker_path" 2>/dev/null || echo ""); _sl_recv=$(jq -r '.received_at // ""' "$marker_path" 2>/dev/null || echo "")`,
|
|
3696
3777
|
' case "$(delivery_ledger_verdict "$_sl_iid" "$thread_ts" "$_sl_recv")" in',
|
|
@@ -3777,6 +3858,9 @@ function provisionStopHook(codeName) {
|
|
|
3777
3858
|
" # internal wake \u2014 the tag that selected this target belongs to an older",
|
|
3778
3859
|
" # conversation, and the text is board housekeeping, not a reply to anyone.",
|
|
3779
3860
|
' if [ "$SYS_WAKE_LAST" = "1" ]; then log_ghost "skip=system_wake_last_no_recovery fn=${FUNCNAME[0]}"; return; fi',
|
|
3861
|
+
" # ENG-11890 (Obi Wan 431c6ddee844): NOT gated on TURN_NOT_INBOUND. Teams has no",
|
|
3862
|
+
" # re-delivery, so a reply skipped here could never be re-asked; it keeps",
|
|
3863
|
+
" # today's behaviour (and its consumer-side narration guard).",
|
|
3780
3864
|
' local conversation_id="$1" reply_to_id="$2" service_url="$3"',
|
|
3781
3865
|
' if [ -z "$conversation_id" ] || [ -z "$service_url" ]; then return; fi',
|
|
3782
3866
|
" # ENG-6727 (mode 1): scoped same-turn guard. Suppress only if the agent",
|
|
@@ -13724,4 +13808,4 @@ export {
|
|
|
13724
13808
|
managerInstallSystemUnitCommand,
|
|
13725
13809
|
managerUninstallSystemUnitCommand
|
|
13726
13810
|
};
|
|
13727
|
-
//# sourceMappingURL=chunk-
|
|
13811
|
+
//# sourceMappingURL=chunk-PIKXAEVA.js.map
|