@integrity-labs/agt-cli 0.27.155 → 0.27.157
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-3X6V4SVW.js → chunk-5E5B4T7K.js} +28 -1
- package/dist/chunk-5E5B4T7K.js.map +1 -0
- package/dist/{chunk-FR2MNN2P.js → chunk-OXDE5AVS.js} +2 -2
- package/dist/{chunk-MYKK5OHT.js → chunk-R2ILRTGB.js} +59 -14
- package/dist/chunk-R2ILRTGB.js.map +1 -0
- package/dist/{claude-pair-runtime-UQFPB2BE.js → claude-pair-runtime-JOQXPPJL.js} +2 -2
- package/dist/lib/manager-worker.js +19 -13
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/{persistent-session-AIM4U3AL.js → persistent-session-6UCKU43W.js} +3 -3
- package/dist/{responsiveness-probe-6L2XS27G.js → responsiveness-probe-2YT3RAY5.js} +48 -10
- package/dist/responsiveness-probe-2YT3RAY5.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-3X6V4SVW.js.map +0 -1
- package/dist/chunk-MYKK5OHT.js.map +0 -1
- package/dist/responsiveness-probe-6L2XS27G.js.map +0 -1
- /package/dist/{chunk-FR2MNN2P.js.map → chunk-OXDE5AVS.js.map} +0 -0
- /package/dist/{claude-pair-runtime-UQFPB2BE.js.map → claude-pair-runtime-JOQXPPJL.js.map} +0 -0
- /package/dist/{persistent-session-AIM4U3AL.js.map → persistent-session-6UCKU43W.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
claudeModelAlias,
|
|
3
3
|
isClaudeFastMode
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5E5B4T7K.js";
|
|
5
5
|
import {
|
|
6
6
|
reapOrphanChannelMcps
|
|
7
7
|
} from "./chunk-XWVM4KPK.js";
|
|
@@ -1621,4 +1621,4 @@ export {
|
|
|
1621
1621
|
stopAllSessionsAndWait,
|
|
1622
1622
|
getProjectDir
|
|
1623
1623
|
};
|
|
1624
|
-
//# sourceMappingURL=chunk-
|
|
1624
|
+
//# sourceMappingURL=chunk-OXDE5AVS.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
registerFramework,
|
|
11
11
|
resolveAvatarEnvUrl,
|
|
12
12
|
wrapScheduledTaskPrompt
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5E5B4T7K.js";
|
|
14
14
|
|
|
15
15
|
// ../../packages/core/dist/integrations/registry.js
|
|
16
16
|
var INTEGRATION_REGISTRY = [
|
|
@@ -4413,6 +4413,7 @@ function provisionStopHook(codeName) {
|
|
|
4413
4413
|
].join("\n") + "\n";
|
|
4414
4414
|
writeFileSync5(hookScriptPath, hookScript, { mode: 493 });
|
|
4415
4415
|
const ghostHookPath = join4(claudeDir, "agt-ghost-reply-hook.sh");
|
|
4416
|
+
const jqNormalizeContent = '(.message.content // .content // []) | if type == "string" then [{type: "text", text: .}] elif type == "array" then . else [] end';
|
|
4416
4417
|
const ghostHookScript = [
|
|
4417
4418
|
"#!/bin/bash",
|
|
4418
4419
|
"# Auto-generated by Augmented (ENG-4569) \u2014 detects ghost replies and",
|
|
@@ -4453,17 +4454,24 @@ function provisionStopHook(codeName) {
|
|
|
4453
4454
|
'if [ "$TG_PENDING" = "0" ] && [ "$SL_PENDING" = "0" ] && [ "$MS_PENDING" = "0" ]; then exit 0; fi',
|
|
4454
4455
|
`LAST_ASSISTANT=$(tail -200 "$TRANSCRIPT_PATH" | jq -cs '[.[] | select(.type == "assistant" or .role == "assistant")] | last // empty' 2>/dev/null || true)`,
|
|
4455
4456
|
'if [ -z "$LAST_ASSISTANT" ] || [ "$LAST_ASSISTANT" = "null" ]; then exit 0; fi',
|
|
4456
|
-
|
|
4457
|
+
"# Assistant content is array-shaped today; normalize anyway so a shape",
|
|
4458
|
+
"# change can never resurrect the swallowed-jq-error no-op (ENG-6288).",
|
|
4459
|
+
`TEXT=$(echo "$LAST_ASSISTANT" | jq -r '${jqNormalizeContent} | map(select(type == "object" and .type == "text") | .text) | join("\\n\\n")' 2>/dev/null || true)`,
|
|
4457
4460
|
"# Strip whitespace and bail only on truly-empty (vs the previous <4-char",
|
|
4458
4461
|
'# threshold that dropped legit short replies like "ok", "yes", emoji).',
|
|
4459
4462
|
'if [ -z "${TEXT//[[:space:]]/}" ]; then exit 0; fi',
|
|
4460
|
-
`TOOL_NAMES=$(echo "$LAST_ASSISTANT" | jq -r '
|
|
4463
|
+
`TOOL_NAMES=$(echo "$LAST_ASSISTANT" | jq -r '${jqNormalizeContent} | map(select(type == "object" and .type == "tool_use") | .name) | .[]' 2>/dev/null || true)`,
|
|
4461
4464
|
"# Find the LAST <channel ...> tag in user/notification turns. Channel",
|
|
4462
4465
|
"# notifications are forwarded into the session as text containing this",
|
|
4463
4466
|
"# tag (slack-channel.ts:1247 / telegram-channel.ts:776 emit content +",
|
|
4464
4467
|
"# meta which Claude Code wraps in a <channel ...> preamble). Searching",
|
|
4465
4468
|
"# the raw text gives us the exact pending conversation key.",
|
|
4466
|
-
|
|
4469
|
+
"# User-event content is frequently a PLAIN STRING (channel notifications",
|
|
4470
|
+
"# land that way), not a content-block array \u2014 map() over a string is a",
|
|
4471
|
+
"# jq error, which the 2>/dev/null swallowed, so the tag came back empty",
|
|
4472
|
+
"# and recovery silently no-oped on every Slack ghost reply (confirmed",
|
|
4473
|
+
"# live on sherlock/agt-aws-1 2026-06-10). Normalize before mapping.",
|
|
4474
|
+
`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)`,
|
|
4467
4475
|
'TAG_SOURCE=""',
|
|
4468
4476
|
`if [ -n "$CHANNEL_TAG" ]; then TAG_SOURCE=$(echo "$CHANNEL_TAG" | grep -oE 'source="[^"]+"' | head -1 | sed 's/source="\\(.*\\)"/\\1/' || true); fi`,
|
|
4469
4477
|
'extract_attr() { echo "$1" | grep -oE "$2=\\"[^\\"]+\\"" | head -1 | sed -E "s/$2=\\"(.*)\\"/\\\\1/"; }',
|
|
@@ -4821,21 +4829,45 @@ function provisionOrientHook(codeName) {
|
|
|
4821
4829
|
"echo",
|
|
4822
4830
|
'echo "- Current time: ${NOW_LOCAL} (${NOW_ISO})"',
|
|
4823
4831
|
"",
|
|
4824
|
-
"# --- Pending-inbound counts
|
|
4832
|
+
"# --- Pending-inbound counts + details -----------------------------------",
|
|
4825
4833
|
"# Channel MCPs queue inbound messages here while the claude process is",
|
|
4826
|
-
"# starting / down
|
|
4827
|
-
|
|
4834
|
+
"# starting / down \u2014 and ENG-6289 wedge respawns PARK undrained markers",
|
|
4835
|
+
"# here for exactly this hook to surface. A non-empty queue is real user",
|
|
4836
|
+
"# traffic this fresh session must deal with. Markers already flagged",
|
|
4837
|
+
"# undeliverable were \u23F3-noticed at arrival and are excluded.",
|
|
4838
|
+
"# Per-marker details (sender, age, addressing ids, content snippet) give",
|
|
4839
|
+
"# the agent enough to reply via the channel tools when the channel-side",
|
|
4840
|
+
"# replay (AGT_CHANNEL_REPLAY_ENABLED) is off \u2014 without replay, nothing",
|
|
4841
|
+
"# else ever re-delivers a parked message. msteams is count-only: its",
|
|
4842
|
+
"# queue files are raw activities the channel server re-delivers itself",
|
|
4843
|
+
"# on boot. Detail lines cap at 5 per channel to bound context size.",
|
|
4828
4844
|
"echo",
|
|
4829
4845
|
'echo "## Pending inbound"',
|
|
4830
4846
|
"pending_total=0",
|
|
4847
|
+
"shopt -s nullglob",
|
|
4831
4848
|
"for channel in slack telegram direct-chat msteams; do",
|
|
4832
4849
|
' dir="${AGENT_DIR}/${channel}-pending-inbound"',
|
|
4833
|
-
' if [ -d "$dir" ]; then',
|
|
4834
|
-
|
|
4835
|
-
'
|
|
4836
|
-
'
|
|
4837
|
-
"
|
|
4850
|
+
' if [ ! -d "$dir" ]; then continue; fi',
|
|
4851
|
+
" count=0",
|
|
4852
|
+
' details=""',
|
|
4853
|
+
' for marker in "$dir"/*; do',
|
|
4854
|
+
' if [ ! -f "$marker" ]; then continue; fi',
|
|
4855
|
+
' case "$(basename "$marker")" in .*) continue ;; esac',
|
|
4856
|
+
" # One jq per marker: emits the sentinel for undeliverable markers, the",
|
|
4857
|
+
" # detail line otherwise. jq failure (malformed / drained mid-scan / no",
|
|
4858
|
+
" # jq on host) \u2192 empty line \u2192 counted live with no detail, matching the",
|
|
4859
|
+
" # live-scan philosophy (corrupt must never hide a message).",
|
|
4860
|
+
` line=$(jq -r 'def mins: (((now - ((.received_at // "" | sub("\\\\.[0-9]+Z$"; "Z")) | fromdateiso8601? // now)) / 60) | floor | tostring) + "m ago"; if (.undeliverable // false) == true then "__UNDELIVERABLE__" else (. as $m | ([("chat_id","message_id","channel","thread_ts","session_id") | select($m[.] != null) | "\\(.)=\\($m[.])"] | join(" ")) as $addr | (($m.payload.content // "") | gsub("[\\\\n\\\\r\\\\t]+"; " ") | .[0:140]) as $snippet | "from " + ($m.payload.meta.user_name // $m.meta.user_name // "unknown sender") + ", " + mins + (if ($addr | length) > 0 then " [" + $addr + "]" else "" end) + (if ($snippet | length) > 0 then " \u2014 " + $snippet else "" end)) end' "$marker" 2>/dev/null || true)`,
|
|
4861
|
+
' if [ "$line" = "__UNDELIVERABLE__" ]; then continue; fi',
|
|
4862
|
+
" count=$((count + 1))",
|
|
4863
|
+
' if [ "$channel" != "msteams" ] && [ "$count" -le 5 ] && [ -n "$line" ]; then',
|
|
4864
|
+
" details=\"${details} - ${line}\"$'\\n'",
|
|
4838
4865
|
" fi",
|
|
4866
|
+
" done",
|
|
4867
|
+
' if [ "$count" -gt 0 ]; then',
|
|
4868
|
+
' echo "- ${channel}: ${count} queued message(s)"',
|
|
4869
|
+
' if [ -n "$details" ]; then printf "%s" "$details"; fi',
|
|
4870
|
+
" pending_total=$((pending_total + count))",
|
|
4839
4871
|
" fi",
|
|
4840
4872
|
"done",
|
|
4841
4873
|
'if [ "$pending_total" -eq 0 ]; then',
|
|
@@ -4854,7 +4886,20 @@ function provisionOrientHook(codeName) {
|
|
|
4854
4886
|
"echo",
|
|
4855
4887
|
'echo "## Next step"',
|
|
4856
4888
|
"echo",
|
|
4857
|
-
'
|
|
4889
|
+
'# ENG-6289: with queued messages present the old "do not act until a',
|
|
4890
|
+
'# message arrives" instruction guaranteed a parked message was never',
|
|
4891
|
+
"# answered. Replay-enabled hosts get re-delivery (answering from the",
|
|
4892
|
+
"# details too would double-reply); replay-off hosts must act on the",
|
|
4893
|
+
"# details above \u2014 nothing else will ever re-deliver.",
|
|
4894
|
+
'if [ "$pending_total" -gt 0 ]; then',
|
|
4895
|
+
' if [ "${AGT_CHANNEL_REPLAY_ENABLED:-}" = "true" ] || [ "${AGT_CHANNEL_REPLAY_ENABLED:-}" = "1" ]; then',
|
|
4896
|
+
' echo "Respond \\"Ready.\\" once. The queued messages above will be re-delivered to you by the channel server within a few minutes \u2014 answer each as it arrives (acknowledge before tool use). Do not reply from the queue details directly; wait for the re-delivery."',
|
|
4897
|
+
" else",
|
|
4898
|
+
` echo "Respond \\"Ready.\\" once, then immediately work through the queued messages above, oldest first \u2014 they are real user messages from before this session started and will NOT be re-delivered. Use the addressing ids with the matching channel reply tool (slack.reply with channel + thread_ts, telegram.reply with chat_id, etc.). If a queue detail lacks the message content, first try the channel's thread/history tools to read the conversation (Slack threads can be re-read); only if the content is truly unrecoverable, say so honestly in your reply and ask the user to resend."`,
|
|
4899
|
+
" fi",
|
|
4900
|
+
"else",
|
|
4901
|
+
' echo "Respond \\"Ready.\\" once. Do not run any tools or load any data until a real user or channel message arrives. When you do receive a message, acknowledge it before tool use."',
|
|
4902
|
+
"fi",
|
|
4858
4903
|
"exit 0"
|
|
4859
4904
|
].join("\n") + "\n";
|
|
4860
4905
|
writeFileSync5(hookScriptPath, hookScript, { mode: 493 });
|
|
@@ -7972,4 +8017,4 @@ export {
|
|
|
7972
8017
|
managerInstallSystemUnitCommand,
|
|
7973
8018
|
managerUninstallSystemUnitCommand
|
|
7974
8019
|
};
|
|
7975
|
-
//# sourceMappingURL=chunk-
|
|
8020
|
+
//# sourceMappingURL=chunk-R2ILRTGB.js.map
|