@integrity-labs/agt-cli 0.28.327 → 0.28.328
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-BSTFCC62.js → chunk-GAWNDPGM.js} +13 -2
- package/dist/{chunk-BSTFCC62.js.map → chunk-GAWNDPGM.js.map} +1 -1
- package/dist/{chunk-EQMRT6OT.js → chunk-XRO2EOEM.js} +48 -8
- package/dist/chunk-XRO2EOEM.js.map +1 -0
- package/dist/{claude-pair-runtime-BOFTEAQC.js → claude-pair-runtime-LTZRJHKO.js} +2 -2
- package/dist/lib/manager-worker.js +10 -10
- package/dist/mcp/direct-chat-channel.js +109 -37
- package/dist/mcp/origami.js +12 -1
- package/dist/{persistent-session-BICDYHOC.js → persistent-session-5IV24YKT.js} +2 -2
- package/dist/{responsiveness-probe-FEAFPNUF.js → responsiveness-probe-TTGD44MW.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-EQMRT6OT.js.map +0 -1
- /package/dist/{claude-pair-runtime-BOFTEAQC.js.map → claude-pair-runtime-LTZRJHKO.js.map} +0 -0
- /package/dist/{persistent-session-BICDYHOC.js.map → persistent-session-5IV24YKT.js.map} +0 -0
- /package/dist/{responsiveness-probe-FEAFPNUF.js.map → responsiveness-probe-TTGD44MW.js.map} +0 -0
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveConnectivityProbe,
|
|
20
20
|
worseConnectivityOutcome,
|
|
21
21
|
wrapScheduledTaskPrompt
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-GAWNDPGM.js";
|
|
23
23
|
import {
|
|
24
24
|
parsePsRows
|
|
25
25
|
} from "./chunk-XWVM4KPK.js";
|
|
@@ -2616,6 +2616,13 @@ function provisionStopHook(codeName) {
|
|
|
2616
2616
|
'TG_MARKER_DIR="${AGENT_DIR}/telegram-pending-inbound"',
|
|
2617
2617
|
'SL_MARKER_DIR="${AGENT_DIR}/slack-pending-inbound"',
|
|
2618
2618
|
'MS_MARKER_DIR="${AGENT_DIR}/msteams-pending-inbound/.markers"',
|
|
2619
|
+
"# ENG-7808 (ENG-6722 fm4): direct-chat markers (written by the direct-chat MCP",
|
|
2620
|
+
"# into the CODE-NAME dir, at parity with the others). direct-chat has no",
|
|
2621
|
+
"# recovery-outbox yet (that's ENG-7814/E), so it participates only in the",
|
|
2622
|
+
"# block-turn-end paths, never in recover_*_for. Its markers carry neither",
|
|
2623
|
+
"# discretionary nor undeliverable, so the owed-reply predicate always treats",
|
|
2624
|
+
"# them as owed.",
|
|
2625
|
+
'DC_MARKER_DIR="${AGENT_DIR}/direct-chat-pending-inbound"',
|
|
2619
2626
|
"# CodeRabbit ENG-4569 round-3: latest-marker correlation could leak chat",
|
|
2620
2627
|
"# A's composed reply into chat B if B arrived later. Now correlate by",
|
|
2621
2628
|
"# scanning the transcript for the LAST channel-source <channel ...> tag",
|
|
@@ -2632,7 +2639,8 @@ function provisionStopHook(codeName) {
|
|
|
2632
2639
|
'TG_PENDING=$(pending_markers_count "$TG_MARKER_DIR")',
|
|
2633
2640
|
'SL_PENDING=$(pending_markers_count "$SL_MARKER_DIR")',
|
|
2634
2641
|
'MS_PENDING=$(pending_markers_count "$MS_MARKER_DIR")',
|
|
2635
|
-
'
|
|
2642
|
+
'DC_PENDING=$(pending_markers_count "$DC_MARKER_DIR")',
|
|
2643
|
+
'if [ "$TG_PENDING" = "0" ] && [ "$SL_PENDING" = "0" ] && [ "$MS_PENDING" = "0" ] && [ "$DC_PENDING" = "0" ]; then exit 0; fi',
|
|
2636
2644
|
"# ENG-6727 (failure mode 3 \u2014 hook slowness): read the transcript tail ONCE",
|
|
2637
2645
|
"# into a temp file and reuse it for every jq pass below (last-assistant text,",
|
|
2638
2646
|
"# channel-tag scan, and the per-source recency check). The old hook re-ran",
|
|
@@ -2697,7 +2705,7 @@ function provisionStopHook(codeName) {
|
|
|
2697
2705
|
"# 'marker present but never recovered' mystery (no <channel> tag correlated).",
|
|
2698
2706
|
"REPLY_IN_LAST=no",
|
|
2699
2707
|
`if echo "$TOOL_NAMES" | grep -qE '(^|__)(slack|telegram|teams)[._](reply|send_message)$'; then REPLY_IN_LAST=yes; fi`,
|
|
2700
|
-
'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"',
|
|
2708
|
+
'log_ghost "stop source=${TAG_SOURCE:-none} pending(tg=$TG_PENDING sl=$SL_PENDING ms=$MS_PENDING dc=$DC_PENDING) text_len=${#TEXT} reply_tool_in_final_turn=$REPLY_IN_LAST"',
|
|
2701
2709
|
'extract_attr() { echo "$1" | grep -oE "$2=\\"[^\\"]+\\"" | head -1 | sed -E "s/$2=\\"(.*)\\"/\\\\1/"; }',
|
|
2702
2710
|
"# Atomic write helper: jq \u2192 tmp file in same dir, then rename. The",
|
|
2703
2711
|
"# channel-side fs.watch only fires on rename, so the file is never",
|
|
@@ -2735,6 +2743,16 @@ function provisionStopHook(codeName) {
|
|
|
2735
2743
|
` hit=$(printf '%s' "$LAST_ASSISTANT" | jq -r --arg cid "$conversation_id" '(.message.content // .content // []) | (if type=="array" then . else [] end) | (if any(.[]; (type=="object") and (.type=="tool_use") and ((.name|tostring)|test("(^|__)teams[._]reply$")) and (((.input.conversation_id // "")|tostring)==$cid)) then "yes" else "no" end)' 2>/dev/null || echo no)`,
|
|
2736
2744
|
' [ "$hit" = "yes" ]',
|
|
2737
2745
|
"}",
|
|
2746
|
+
'# ENG-7808 (ENG-6722 fm4): "did the agent reply to THIS direct-chat session in',
|
|
2747
|
+
'# the final turn?" A direct_chat.reply OR direct_chat.consume settles the',
|
|
2748
|
+
"# obligation (consume is the explicit handled-without-reply ack, the same",
|
|
2749
|
+
"# session-scoped drain the MCP applies), so either counts as answered. session_id",
|
|
2750
|
+
"# is unambiguous (one session per marker), so there is no cross-thread class here.",
|
|
2751
|
+
"replied_this_conv_directchat() {",
|
|
2752
|
+
' local session_id="$1" hit',
|
|
2753
|
+
` hit=$(printf '%s' "$LAST_ASSISTANT" | jq -r --arg sid "$session_id" '(.message.content // .content // []) | (if type=="array" then . else [] end) | (if any(.[]; (type=="object") and (.type=="tool_use") and ((.name|tostring)|test("(^|__)direct_chat[._](reply|consume)$")) and (((.input.session_id // "")|tostring)==$sid)) then "yes" else "no" end)' 2>/dev/null || echo no)`,
|
|
2754
|
+
' [ "$hit" = "yes" ]',
|
|
2755
|
+
"}",
|
|
2738
2756
|
"recover_telegram_for() {",
|
|
2739
2757
|
' local chat_id="$1" msg_id="$2"',
|
|
2740
2758
|
' if [ -z "$chat_id" ] || [ -z "$msg_id" ]; then return; fi',
|
|
@@ -2972,8 +2990,8 @@ function provisionStopHook(codeName) {
|
|
|
2972
2990
|
' if [ "$BLOCK_TURN_END_ON" != "1" ] || [ "$BLOCK_ALL_MARKERS_ON" != "1" ]; then return 1; fi',
|
|
2973
2991
|
' if [ "$STOP_ACTIVE" = "true" ]; then return 1; fi',
|
|
2974
2992
|
" local -a owed_paths=()",
|
|
2975
|
-
' local owed_lines="" owed_count=0 any_capped=0 entry src dir m d u replied ch th cid conv iid key led_name',
|
|
2976
|
-
' for entry in "slack:$SL_MARKER_DIR" "telegram:$TG_MARKER_DIR" "msteams:$MS_MARKER_DIR"; do',
|
|
2993
|
+
' local owed_lines="" owed_count=0 any_capped=0 entry src dir m d u replied ch th cid conv sess iid key led_name',
|
|
2994
|
+
' for entry in "slack:$SL_MARKER_DIR" "telegram:$TG_MARKER_DIR" "msteams:$MS_MARKER_DIR" "direct-chat:$DC_MARKER_DIR"; do',
|
|
2977
2995
|
' src="${entry%%:*}"; dir="${entry#*:}"',
|
|
2978
2996
|
' if [ ! -d "$dir" ]; then continue; fi',
|
|
2979
2997
|
" shopt -s nullglob",
|
|
@@ -2982,11 +3000,12 @@ function provisionStopHook(codeName) {
|
|
|
2982
3000
|
` d=$(jq -r '.discretionary // false' "$m" 2>/dev/null || echo true)`,
|
|
2983
3001
|
` u=$(jq -r '.undeliverable // false' "$m" 2>/dev/null || echo true)`,
|
|
2984
3002
|
' if [ "$d" = "true" ] || [ "$u" = "true" ]; then continue; fi',
|
|
2985
|
-
' replied=no; ch=""; th=""; cid=""; conv=""',
|
|
3003
|
+
' replied=no; ch=""; th=""; cid=""; conv=""; sess=""',
|
|
2986
3004
|
' case "$src" in',
|
|
2987
3005
|
` slack) ch=$(jq -r '.channel // ""' "$m" 2>/dev/null || echo ""); th=$(jq -r '.thread_ts // ""' "$m" 2>/dev/null || echo ""); if replied_this_conv_slack "$ch" "$th"; then replied=yes; fi ;;`,
|
|
2988
3006
|
` telegram) cid=$(jq -r '.chat_id // ""' "$m" 2>/dev/null || echo ""); if replied_this_conv_telegram "$cid"; then replied=yes; fi ;;`,
|
|
2989
3007
|
` msteams) conv=$(jq -r '.conversation_id // ""' "$m" 2>/dev/null || echo ""); if replied_this_conv_teams "$conv"; then replied=yes; fi ;;`,
|
|
3008
|
+
` direct-chat) sess=$(jq -r '.session_id // ""' "$m" 2>/dev/null || echo ""); if replied_this_conv_directchat "$sess"; then replied=yes; fi ;;`,
|
|
2990
3009
|
" esac",
|
|
2991
3010
|
' if [ "$replied" = "yes" ]; then continue; fi',
|
|
2992
3011
|
' led_name="$(basename "$m")"',
|
|
@@ -2996,6 +3015,7 @@ function provisionStopHook(codeName) {
|
|
|
2996
3015
|
' slack) key="thread=$(safe_id "$th")" ;;',
|
|
2997
3016
|
' telegram) key="chat=$(safe_id "$cid")" ;;',
|
|
2998
3017
|
' msteams) key="conv=$(safe_id "$conv")" ;;',
|
|
3018
|
+
' direct-chat) key="session=$(safe_id "$sess")" ;;',
|
|
2999
3019
|
' *) key="" ;;',
|
|
3000
3020
|
" esac",
|
|
3001
3021
|
" owed_count=$((owed_count + 1))",
|
|
@@ -3061,6 +3081,26 @@ function provisionStopHook(codeName) {
|
|
|
3061
3081
|
` if emit_block_if_obligated "$MS_REPLIED" "$MS_CAND" 'teams.reply'; then exit 0; fi`,
|
|
3062
3082
|
" fi",
|
|
3063
3083
|
' recover_teams_for "$CONVERSATION_ID" "$REPLY_TO_ID" "$SERVICE_URL"',
|
|
3084
|
+
'elif [ "$TAG_SOURCE" = "direct-chat" ]; then',
|
|
3085
|
+
" # ENG-7808 (ENG-6722 fm4): direct-chat backstop. BLOCK-TURN-END ONLY - there",
|
|
3086
|
+
" # is no direct-chat recovery-outbox yet (that is ENG-7814 / slice E), so when",
|
|
3087
|
+
" # block-turn-end is off (or already fired once for this inbound) we log the",
|
|
3088
|
+
" # miss and stand down rather than synthesize a recovery. session_id is",
|
|
3089
|
+
" # unambiguous (one session per marker), so there is no cross-thread class and",
|
|
3090
|
+
" # no recency guard is needed. Previously direct-chat fell through every branch",
|
|
3091
|
+
" # to a silent no-op (fenced out by design); it now at least blocks the turn",
|
|
3092
|
+
" # end so the model re-sends direct_chat.reply itself when the flag is armed.",
|
|
3093
|
+
' SESSION_ID=$(extract_attr "$CHANNEL_TAG" "session_id")',
|
|
3094
|
+
' if [ -n "$SESSION_ID" ]; then',
|
|
3095
|
+
" shopt -s nullglob",
|
|
3096
|
+
" # Marker filenames hex-encode the session (injective; matches the MCP",
|
|
3097
|
+
" # writer + the msteams pattern). Reproduce that hex here for the glob.",
|
|
3098
|
+
' HEX_SESSION=$(printf %s "$SESSION_ID" | od -An -tx1 | tr -d " \\n")',
|
|
3099
|
+
" DC_CAND=$(printf '%s\\n' \"${DC_MARKER_DIR}/${HEX_SESSION}__\"*.json)",
|
|
3100
|
+
' DC_REPLIED=no; if replied_this_conv_directchat "$SESSION_ID"; then DC_REPLIED=yes; fi',
|
|
3101
|
+
` if emit_block_if_obligated "$DC_REPLIED" "$DC_CAND" 'direct_chat.reply'; then exit 0; fi`,
|
|
3102
|
+
' if [ "$DC_REPLIED" = "no" ]; then log_ghost "direct-chat skip=no_recovery_path session=$(safe_id "$SESSION_ID") (block-turn-end off/capped; recovery is ENG-7814)"; fi',
|
|
3103
|
+
" fi",
|
|
3064
3104
|
'elif [ -z "$TAG_SOURCE" ]; then',
|
|
3065
3105
|
" # ENG-6467: TAG_SOURCE=none fallback (AC1). Guarded on an EMPTY source, not",
|
|
3066
3106
|
" # a catch-all else: a parsed-but-unsupported source (e.g. direct-chat, which",
|
|
@@ -6705,7 +6745,7 @@ function requireHost() {
|
|
|
6705
6745
|
}
|
|
6706
6746
|
|
|
6707
6747
|
// src/lib/api-client.ts
|
|
6708
|
-
var agtCliVersion = true ? "0.28.
|
|
6748
|
+
var agtCliVersion = true ? "0.28.328" : "dev";
|
|
6709
6749
|
var lastConfigHash = null;
|
|
6710
6750
|
function setConfigHash(hash) {
|
|
6711
6751
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -9102,4 +9142,4 @@ export {
|
|
|
9102
9142
|
managerInstallSystemUnitCommand,
|
|
9103
9143
|
managerUninstallSystemUnitCommand
|
|
9104
9144
|
};
|
|
9105
|
-
//# sourceMappingURL=chunk-
|
|
9145
|
+
//# sourceMappingURL=chunk-XRO2EOEM.js.map
|