@integrity-labs/agt-cli 0.28.171 → 0.28.173
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-CPB4L4TB.js → chunk-M4G5DGVD.js} +21 -13
- package/dist/chunk-M4G5DGVD.js.map +1 -0
- package/dist/{chunk-XJIHUCCF.js → chunk-N25WAF7G.js} +2 -2
- package/dist/{chunk-76XB2I4P.js → chunk-OMC7BHRP.js} +9 -1
- package/dist/chunk-OMC7BHRP.js.map +1 -0
- package/dist/{claude-pair-runtime-37H4BVQC.js → claude-pair-runtime-XIVBNVSR.js} +2 -2
- package/dist/lib/manager-worker.js +8 -8
- package/dist/mcp/direct-chat-channel.js +40 -1
- package/dist/mcp/index.js +6 -0
- package/dist/mcp/slack-channel.js +43 -2
- package/dist/mcp/teams-channel.js +43 -2
- package/dist/mcp/telegram-channel.js +43 -2
- package/dist/{persistent-session-DUKYMEOQ.js → persistent-session-4HC7YFSU.js} +3 -3
- package/dist/{responsiveness-probe-G5VMYV73.js → responsiveness-probe-W4PCY6HC.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-76XB2I4P.js.map +0 -1
- package/dist/chunk-CPB4L4TB.js.map +0 -1
- /package/dist/{chunk-XJIHUCCF.js.map → chunk-N25WAF7G.js.map} +0 -0
- /package/dist/{claude-pair-runtime-37H4BVQC.js.map → claude-pair-runtime-XIVBNVSR.js.map} +0 -0
- /package/dist/{persistent-session-DUKYMEOQ.js.map → persistent-session-4HC7YFSU.js.map} +0 -0
- /package/dist/{responsiveness-probe-G5VMYV73.js.map → responsiveness-probe-W4PCY6HC.js.map} +0 -0
|
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
|
|
|
100
100
|
return { ok: true };
|
|
101
101
|
} catch {
|
|
102
102
|
}
|
|
103
|
-
const { resolveClaudeBinary } = await import("./persistent-session-
|
|
103
|
+
const { resolveClaudeBinary } = await import("./persistent-session-4HC7YFSU.js");
|
|
104
104
|
const claudeBin = resolveClaudeBinary();
|
|
105
105
|
const pairEnv = {
|
|
106
106
|
...process.env,
|
|
@@ -373,4 +373,4 @@ export {
|
|
|
373
373
|
startClaudePair,
|
|
374
374
|
submitClaudePairCode
|
|
375
375
|
};
|
|
376
|
-
//# sourceMappingURL=claude-pair-runtime-
|
|
376
|
+
//# sourceMappingURL=claude-pair-runtime-XIVBNVSR.js.map
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
requireHost,
|
|
29
29
|
safeWriteJsonAtomic,
|
|
30
30
|
setConfigHash
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-M4G5DGVD.js";
|
|
32
32
|
import {
|
|
33
33
|
getProjectDir as getProjectDir2,
|
|
34
34
|
getReadyTasks,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
takeZombieDetection,
|
|
71
71
|
transcriptActivityAgeSeconds,
|
|
72
72
|
writeEgressAllowlist
|
|
73
|
-
} from "../chunk-
|
|
73
|
+
} from "../chunk-N25WAF7G.js";
|
|
74
74
|
import {
|
|
75
75
|
CONVERSATION_FAILURE_CATEGORIES,
|
|
76
76
|
DEFAULT_FRAMEWORK,
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
resolveChannels,
|
|
112
112
|
resolveDmTarget,
|
|
113
113
|
sumTranscriptUsageInWindow
|
|
114
|
-
} from "../chunk-
|
|
114
|
+
} from "../chunk-OMC7BHRP.js";
|
|
115
115
|
import {
|
|
116
116
|
parsePsRows,
|
|
117
117
|
reapOrphanChannelMcps
|
|
@@ -6590,7 +6590,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
6590
6590
|
var lastVersionCheckAt = 0;
|
|
6591
6591
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
6592
6592
|
var lastResponsivenessProbeAt = 0;
|
|
6593
|
-
var agtCliVersion = true ? "0.28.
|
|
6593
|
+
var agtCliVersion = true ? "0.28.173" : "dev";
|
|
6594
6594
|
function resolveBrewPath(execFileSync4) {
|
|
6595
6595
|
try {
|
|
6596
6596
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -7483,7 +7483,7 @@ async function pollCycle() {
|
|
|
7483
7483
|
}
|
|
7484
7484
|
try {
|
|
7485
7485
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
7486
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
7486
|
+
const { collectDiagnostics } = await import("../persistent-session-4HC7YFSU.js");
|
|
7487
7487
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
7488
7488
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
|
|
7489
7489
|
let tailscaleHostname;
|
|
@@ -7631,7 +7631,7 @@ async function pollCycle() {
|
|
|
7631
7631
|
const {
|
|
7632
7632
|
collectResponsivenessProbes,
|
|
7633
7633
|
getResponsivenessIntervalMs
|
|
7634
|
-
} = await import("../responsiveness-probe-
|
|
7634
|
+
} = await import("../responsiveness-probe-W4PCY6HC.js");
|
|
7635
7635
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
7636
7636
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
7637
7637
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -7663,7 +7663,7 @@ async function pollCycle() {
|
|
|
7663
7663
|
collectResponsivenessProbes,
|
|
7664
7664
|
livePendingInboundOldestAgeSeconds,
|
|
7665
7665
|
parkPendingInbound
|
|
7666
|
-
} = await import("../responsiveness-probe-
|
|
7666
|
+
} = await import("../responsiveness-probe-W4PCY6HC.js");
|
|
7667
7667
|
const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
|
|
7668
7668
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
7669
7669
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -10638,7 +10638,7 @@ async function processClaudePairSessions(agents) {
|
|
|
10638
10638
|
killPairSession,
|
|
10639
10639
|
pairTmuxSession,
|
|
10640
10640
|
finalizeClaudePairOnboarding
|
|
10641
|
-
} = await import("../claude-pair-runtime-
|
|
10641
|
+
} = await import("../claude-pair-runtime-XIVBNVSR.js");
|
|
10642
10642
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
10643
10643
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
10644
10644
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
|
@@ -14035,6 +14035,43 @@ function emitPreambleStripTelemetry(channel, shape) {
|
|
|
14035
14035
|
}
|
|
14036
14036
|
}
|
|
14037
14037
|
|
|
14038
|
+
// src/redact-tool-call-markup.ts
|
|
14039
|
+
var SAFE_FALLBACK = "Sorry \u2014 I hit a problem completing that action and couldn't finish my reply. Could you try again, or rephrase?";
|
|
14040
|
+
var TOOLCALL_TAG = /<\s*\/?\s*(?:antml:)?(?:function_calls|invoke|parameter)\b/i;
|
|
14041
|
+
var BLOCK_PATTERNS = [
|
|
14042
|
+
/<\s*(?:antml:)?function_calls\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?function_calls\s*>/gi,
|
|
14043
|
+
/<\s*(?:antml:)?invoke\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?invoke\s*>/gi,
|
|
14044
|
+
/<\s*(?:antml:)?parameter\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?parameter\s*>/gi
|
|
14045
|
+
];
|
|
14046
|
+
var DANGLING_OPEN = /<\s*(?:antml:)?(?:function_calls|invoke|parameter)\b/i;
|
|
14047
|
+
var ORPHAN_CLOSE = /<\s*\/\s*(?:antml:)?(?:function_calls|invoke|parameter)\s*>/gi;
|
|
14048
|
+
var DANGLING_CLOSE = /<\s*\/\s*(?:antml:)?(?:function_calls|invoke|parameter)\b[^>]*$/i;
|
|
14049
|
+
function redactToolCallMarkup(text) {
|
|
14050
|
+
if (!text || !TOOLCALL_TAG.test(text)) return { text, redacted: false };
|
|
14051
|
+
let out = text;
|
|
14052
|
+
for (const re of BLOCK_PATTERNS) out = out.replace(re, "");
|
|
14053
|
+
const openIdx = out.search(DANGLING_OPEN);
|
|
14054
|
+
if (openIdx !== -1) out = out.slice(0, openIdx);
|
|
14055
|
+
out = out.replace(ORPHAN_CLOSE, "");
|
|
14056
|
+
out = out.replace(DANGLING_CLOSE, "");
|
|
14057
|
+
out = out.replace(/[ \t]+$/gm, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
14058
|
+
if (out === "") out = SAFE_FALLBACK;
|
|
14059
|
+
return { text: out, redacted: true };
|
|
14060
|
+
}
|
|
14061
|
+
function emitToolCallMarkupRedactionTelemetry(channel) {
|
|
14062
|
+
const agentCode = process.env.AGT_AGENT_CODE_NAME ?? "unknown";
|
|
14063
|
+
try {
|
|
14064
|
+
process.stderr.write(
|
|
14065
|
+
`agt.egress.tool_call_markup_redacted ${JSON.stringify({
|
|
14066
|
+
channel,
|
|
14067
|
+
agent_code: agentCode
|
|
14068
|
+
})}
|
|
14069
|
+
`
|
|
14070
|
+
);
|
|
14071
|
+
} catch {
|
|
14072
|
+
}
|
|
14073
|
+
}
|
|
14074
|
+
|
|
14038
14075
|
// src/transient-api-error.ts
|
|
14039
14076
|
var CODE_KIND = {
|
|
14040
14077
|
"429": "rate_limit",
|
|
@@ -14576,7 +14613,9 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
14576
14613
|
const { session_id, content: rawContent } = args;
|
|
14577
14614
|
const sanitizedReply = stripRepostPreambleWithMeta(rawContent);
|
|
14578
14615
|
if (sanitizedReply.stripped) emitPreambleStripTelemetry("direct_chat", sanitizedReply.shape);
|
|
14579
|
-
const
|
|
14616
|
+
const sanitizedReplyGuarded = redactToolCallMarkup(sanitizedReply.text);
|
|
14617
|
+
if (sanitizedReplyGuarded.redacted) emitToolCallMarkupRedactionTelemetry("direct_chat");
|
|
14618
|
+
const apiErr = rewriteTransientApiError(sanitizedReplyGuarded.text);
|
|
14580
14619
|
if (apiErr.rewritten) emitTransientApiErrorTelemetry("direct_chat", apiErr.match, apiErr.original);
|
|
14581
14620
|
const content = apiErr.text;
|
|
14582
14621
|
const message_ids = claimTracker.peek(session_id);
|
package/dist/mcp/index.js
CHANGED
|
@@ -21919,6 +21919,9 @@ server.tool(
|
|
|
21919
21919
|
title: external_exports.string().describe("Task title (max 200 chars)"),
|
|
21920
21920
|
description: external_exports.string().optional().describe("Detailed description of what needs doing"),
|
|
21921
21921
|
priority: external_exports.number().int().min(1).max(3).optional().describe("Priority: 1=high, 2=medium (default), 3=low"),
|
|
21922
|
+
status: external_exports.enum(["backlog", "todo", "in_progress"]).optional().describe(
|
|
21923
|
+
"Which column the card lands in on the recipient's board (default: todo). Use 'backlog' to stage it as not-yet-actionable work the teammate will pull later, 'todo' for ready-to-work, 'in_progress' if they should start immediately."
|
|
21924
|
+
),
|
|
21922
21925
|
deliverable: external_exports.string().optional().describe("Expected output/deliverable from the target")
|
|
21923
21926
|
},
|
|
21924
21927
|
async (params) => {
|
|
@@ -21934,6 +21937,9 @@ server.tool(
|
|
|
21934
21937
|
title: params.title,
|
|
21935
21938
|
description: params.description,
|
|
21936
21939
|
priority: params.priority ?? 2,
|
|
21940
|
+
// ENG-6967: only send status when set, so the route applies its default
|
|
21941
|
+
// ('todo') and the same-team handoff path stays byte-for-byte unchanged.
|
|
21942
|
+
...params.status !== void 0 ? { status: params.status } : {},
|
|
21937
21943
|
deliverable: params.deliverable
|
|
21938
21944
|
});
|
|
21939
21945
|
const where = data.cross_team ? ` on team ${data.target_team ?? params.target_team}` : "";
|
|
@@ -15662,6 +15662,43 @@ function emitPreambleStripTelemetry(channel, shape) {
|
|
|
15662
15662
|
}
|
|
15663
15663
|
}
|
|
15664
15664
|
|
|
15665
|
+
// src/redact-tool-call-markup.ts
|
|
15666
|
+
var SAFE_FALLBACK = "Sorry \u2014 I hit a problem completing that action and couldn't finish my reply. Could you try again, or rephrase?";
|
|
15667
|
+
var TOOLCALL_TAG = /<\s*\/?\s*(?:antml:)?(?:function_calls|invoke|parameter)\b/i;
|
|
15668
|
+
var BLOCK_PATTERNS = [
|
|
15669
|
+
/<\s*(?:antml:)?function_calls\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?function_calls\s*>/gi,
|
|
15670
|
+
/<\s*(?:antml:)?invoke\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?invoke\s*>/gi,
|
|
15671
|
+
/<\s*(?:antml:)?parameter\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?parameter\s*>/gi
|
|
15672
|
+
];
|
|
15673
|
+
var DANGLING_OPEN = /<\s*(?:antml:)?(?:function_calls|invoke|parameter)\b/i;
|
|
15674
|
+
var ORPHAN_CLOSE = /<\s*\/\s*(?:antml:)?(?:function_calls|invoke|parameter)\s*>/gi;
|
|
15675
|
+
var DANGLING_CLOSE = /<\s*\/\s*(?:antml:)?(?:function_calls|invoke|parameter)\b[^>]*$/i;
|
|
15676
|
+
function redactToolCallMarkup(text) {
|
|
15677
|
+
if (!text || !TOOLCALL_TAG.test(text)) return { text, redacted: false };
|
|
15678
|
+
let out = text;
|
|
15679
|
+
for (const re of BLOCK_PATTERNS) out = out.replace(re, "");
|
|
15680
|
+
const openIdx = out.search(DANGLING_OPEN);
|
|
15681
|
+
if (openIdx !== -1) out = out.slice(0, openIdx);
|
|
15682
|
+
out = out.replace(ORPHAN_CLOSE, "");
|
|
15683
|
+
out = out.replace(DANGLING_CLOSE, "");
|
|
15684
|
+
out = out.replace(/[ \t]+$/gm, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
15685
|
+
if (out === "") out = SAFE_FALLBACK;
|
|
15686
|
+
return { text: out, redacted: true };
|
|
15687
|
+
}
|
|
15688
|
+
function emitToolCallMarkupRedactionTelemetry(channel) {
|
|
15689
|
+
const agentCode = process.env.AGT_AGENT_CODE_NAME ?? "unknown";
|
|
15690
|
+
try {
|
|
15691
|
+
process.stderr.write(
|
|
15692
|
+
`agt.egress.tool_call_markup_redacted ${JSON.stringify({
|
|
15693
|
+
channel,
|
|
15694
|
+
agent_code: agentCode
|
|
15695
|
+
})}
|
|
15696
|
+
`
|
|
15697
|
+
);
|
|
15698
|
+
} catch {
|
|
15699
|
+
}
|
|
15700
|
+
}
|
|
15701
|
+
|
|
15665
15702
|
// src/transient-api-error.ts
|
|
15666
15703
|
var CODE_KIND = {
|
|
15667
15704
|
"429": "rate_limit",
|
|
@@ -17788,7 +17825,9 @@ async function processSlackRecoveryOutboxFile(filename) {
|
|
|
17788
17825
|
}
|
|
17789
17826
|
const recovered = stripRepostPreambleWithMeta(payload.text);
|
|
17790
17827
|
if (recovered.stripped) emitPreambleStripTelemetry("slack", recovered.shape);
|
|
17791
|
-
const
|
|
17828
|
+
const recoveredGuarded = redactToolCallMarkup(recovered.text);
|
|
17829
|
+
if (recoveredGuarded.redacted) emitToolCallMarkupRedactionTelemetry("slack");
|
|
17830
|
+
const apiErr = rewriteTransientApiError(recoveredGuarded.text);
|
|
17792
17831
|
if (apiErr.rewritten) emitTransientApiErrorTelemetry("slack", apiErr.match, apiErr.original);
|
|
17793
17832
|
const text = apiErr.text;
|
|
17794
17833
|
let sendSucceeded = false;
|
|
@@ -19739,7 +19778,9 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
19739
19778
|
};
|
|
19740
19779
|
const sanitized = stripRepostPreambleWithMeta(text);
|
|
19741
19780
|
if (sanitized.stripped) emitPreambleStripTelemetry("slack", sanitized.shape);
|
|
19742
|
-
const
|
|
19781
|
+
const sanitizedGuarded = redactToolCallMarkup(sanitized.text);
|
|
19782
|
+
if (sanitizedGuarded.redacted) emitToolCallMarkupRedactionTelemetry("slack");
|
|
19783
|
+
const apiErr = rewriteTransientApiError(sanitizedGuarded.text);
|
|
19743
19784
|
if (apiErr.rewritten) emitTransientApiErrorTelemetry("slack", apiErr.match, apiErr.original);
|
|
19744
19785
|
try {
|
|
19745
19786
|
const res = await fetch("https://slack.com/api/chat.postMessage", {
|
|
@@ -14094,6 +14094,43 @@ function emitPreambleStripTelemetry(channel, shape) {
|
|
|
14094
14094
|
}
|
|
14095
14095
|
}
|
|
14096
14096
|
|
|
14097
|
+
// src/redact-tool-call-markup.ts
|
|
14098
|
+
var SAFE_FALLBACK = "Sorry \u2014 I hit a problem completing that action and couldn't finish my reply. Could you try again, or rephrase?";
|
|
14099
|
+
var TOOLCALL_TAG = /<\s*\/?\s*(?:antml:)?(?:function_calls|invoke|parameter)\b/i;
|
|
14100
|
+
var BLOCK_PATTERNS = [
|
|
14101
|
+
/<\s*(?:antml:)?function_calls\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?function_calls\s*>/gi,
|
|
14102
|
+
/<\s*(?:antml:)?invoke\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?invoke\s*>/gi,
|
|
14103
|
+
/<\s*(?:antml:)?parameter\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?parameter\s*>/gi
|
|
14104
|
+
];
|
|
14105
|
+
var DANGLING_OPEN = /<\s*(?:antml:)?(?:function_calls|invoke|parameter)\b/i;
|
|
14106
|
+
var ORPHAN_CLOSE = /<\s*\/\s*(?:antml:)?(?:function_calls|invoke|parameter)\s*>/gi;
|
|
14107
|
+
var DANGLING_CLOSE = /<\s*\/\s*(?:antml:)?(?:function_calls|invoke|parameter)\b[^>]*$/i;
|
|
14108
|
+
function redactToolCallMarkup(text) {
|
|
14109
|
+
if (!text || !TOOLCALL_TAG.test(text)) return { text, redacted: false };
|
|
14110
|
+
let out = text;
|
|
14111
|
+
for (const re of BLOCK_PATTERNS) out = out.replace(re, "");
|
|
14112
|
+
const openIdx = out.search(DANGLING_OPEN);
|
|
14113
|
+
if (openIdx !== -1) out = out.slice(0, openIdx);
|
|
14114
|
+
out = out.replace(ORPHAN_CLOSE, "");
|
|
14115
|
+
out = out.replace(DANGLING_CLOSE, "");
|
|
14116
|
+
out = out.replace(/[ \t]+$/gm, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
14117
|
+
if (out === "") out = SAFE_FALLBACK;
|
|
14118
|
+
return { text: out, redacted: true };
|
|
14119
|
+
}
|
|
14120
|
+
function emitToolCallMarkupRedactionTelemetry(channel) {
|
|
14121
|
+
const agentCode = process.env.AGT_AGENT_CODE_NAME ?? "unknown";
|
|
14122
|
+
try {
|
|
14123
|
+
process.stderr.write(
|
|
14124
|
+
`agt.egress.tool_call_markup_redacted ${JSON.stringify({
|
|
14125
|
+
channel,
|
|
14126
|
+
agent_code: agentCode
|
|
14127
|
+
})}
|
|
14128
|
+
`
|
|
14129
|
+
);
|
|
14130
|
+
} catch {
|
|
14131
|
+
}
|
|
14132
|
+
}
|
|
14133
|
+
|
|
14097
14134
|
// src/transient-api-error.ts
|
|
14098
14135
|
var CODE_KIND = {
|
|
14099
14136
|
"429": "rate_limit",
|
|
@@ -15513,7 +15550,9 @@ async function handleReply(args) {
|
|
|
15513
15550
|
}
|
|
15514
15551
|
const sanitized = stripRepostPreambleWithMeta(text);
|
|
15515
15552
|
if (sanitized.stripped) emitPreambleStripTelemetry("teams", sanitized.shape);
|
|
15516
|
-
const
|
|
15553
|
+
const sanitizedGuarded = redactToolCallMarkup(sanitized.text);
|
|
15554
|
+
if (sanitizedGuarded.redacted) emitToolCallMarkupRedactionTelemetry("teams");
|
|
15555
|
+
const apiErr = rewriteTransientApiError(sanitizedGuarded.text);
|
|
15517
15556
|
if (apiErr.rewritten) emitTransientApiErrorTelemetry("teams", apiErr.match, apiErr.original);
|
|
15518
15557
|
try {
|
|
15519
15558
|
const result = await sendActivity(serviceUrl, conversationId, {
|
|
@@ -16076,7 +16115,9 @@ async function processRecoveryFile(filename) {
|
|
|
16076
16115
|
}
|
|
16077
16116
|
const recovered = stripRepostPreambleWithMeta(payload.text);
|
|
16078
16117
|
if (recovered.stripped) emitPreambleStripTelemetry("teams", recovered.shape);
|
|
16079
|
-
const
|
|
16118
|
+
const recoveredGuarded = redactToolCallMarkup(recovered.text);
|
|
16119
|
+
if (recoveredGuarded.redacted) emitToolCallMarkupRedactionTelemetry("teams");
|
|
16120
|
+
const apiErr = rewriteTransientApiError(recoveredGuarded.text);
|
|
16080
16121
|
if (apiErr.rewritten) emitTransientApiErrorTelemetry("teams", apiErr.match, apiErr.original);
|
|
16081
16122
|
try {
|
|
16082
16123
|
await sendActivity(payload.service_url, payload.conversation_id, {
|
|
@@ -16533,6 +16533,43 @@ function emitPreambleStripTelemetry(channel, shape) {
|
|
|
16533
16533
|
}
|
|
16534
16534
|
}
|
|
16535
16535
|
|
|
16536
|
+
// src/redact-tool-call-markup.ts
|
|
16537
|
+
var SAFE_FALLBACK = "Sorry \u2014 I hit a problem completing that action and couldn't finish my reply. Could you try again, or rephrase?";
|
|
16538
|
+
var TOOLCALL_TAG = /<\s*\/?\s*(?:antml:)?(?:function_calls|invoke|parameter)\b/i;
|
|
16539
|
+
var BLOCK_PATTERNS = [
|
|
16540
|
+
/<\s*(?:antml:)?function_calls\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?function_calls\s*>/gi,
|
|
16541
|
+
/<\s*(?:antml:)?invoke\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?invoke\s*>/gi,
|
|
16542
|
+
/<\s*(?:antml:)?parameter\b[^>]*>[\s\S]*?<\/\s*(?:antml:)?parameter\s*>/gi
|
|
16543
|
+
];
|
|
16544
|
+
var DANGLING_OPEN = /<\s*(?:antml:)?(?:function_calls|invoke|parameter)\b/i;
|
|
16545
|
+
var ORPHAN_CLOSE = /<\s*\/\s*(?:antml:)?(?:function_calls|invoke|parameter)\s*>/gi;
|
|
16546
|
+
var DANGLING_CLOSE = /<\s*\/\s*(?:antml:)?(?:function_calls|invoke|parameter)\b[^>]*$/i;
|
|
16547
|
+
function redactToolCallMarkup(text) {
|
|
16548
|
+
if (!text || !TOOLCALL_TAG.test(text)) return { text, redacted: false };
|
|
16549
|
+
let out = text;
|
|
16550
|
+
for (const re of BLOCK_PATTERNS) out = out.replace(re, "");
|
|
16551
|
+
const openIdx = out.search(DANGLING_OPEN);
|
|
16552
|
+
if (openIdx !== -1) out = out.slice(0, openIdx);
|
|
16553
|
+
out = out.replace(ORPHAN_CLOSE, "");
|
|
16554
|
+
out = out.replace(DANGLING_CLOSE, "");
|
|
16555
|
+
out = out.replace(/[ \t]+$/gm, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
16556
|
+
if (out === "") out = SAFE_FALLBACK;
|
|
16557
|
+
return { text: out, redacted: true };
|
|
16558
|
+
}
|
|
16559
|
+
function emitToolCallMarkupRedactionTelemetry(channel) {
|
|
16560
|
+
const agentCode = process.env.AGT_AGENT_CODE_NAME ?? "unknown";
|
|
16561
|
+
try {
|
|
16562
|
+
process.stderr.write(
|
|
16563
|
+
`agt.egress.tool_call_markup_redacted ${JSON.stringify({
|
|
16564
|
+
channel,
|
|
16565
|
+
agent_code: agentCode
|
|
16566
|
+
})}
|
|
16567
|
+
`
|
|
16568
|
+
);
|
|
16569
|
+
} catch {
|
|
16570
|
+
}
|
|
16571
|
+
}
|
|
16572
|
+
|
|
16536
16573
|
// src/transient-api-error.ts
|
|
16537
16574
|
var CODE_KIND = {
|
|
16538
16575
|
"429": "rate_limit",
|
|
@@ -18396,7 +18433,9 @@ async function processRecoveryOutboxFile(filename) {
|
|
|
18396
18433
|
}
|
|
18397
18434
|
const recovered = stripRepostPreambleWithMeta(payload.text);
|
|
18398
18435
|
if (recovered.stripped) emitPreambleStripTelemetry("telegram", recovered.shape);
|
|
18399
|
-
const
|
|
18436
|
+
const recoveredGuarded = redactToolCallMarkup(recovered.text);
|
|
18437
|
+
if (recoveredGuarded.redacted) emitToolCallMarkupRedactionTelemetry("telegram");
|
|
18438
|
+
const apiErr = rewriteTransientApiError(recoveredGuarded.text);
|
|
18400
18439
|
if (apiErr.rewritten) emitTransientApiErrorTelemetry("telegram", apiErr.match, apiErr.original);
|
|
18401
18440
|
const text = apiErr.text;
|
|
18402
18441
|
const body = {
|
|
@@ -19096,7 +19135,9 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
19096
19135
|
}
|
|
19097
19136
|
const tgSanitized = stripRepostPreambleWithMeta(text);
|
|
19098
19137
|
if (tgSanitized.stripped) emitPreambleStripTelemetry("telegram", tgSanitized.shape);
|
|
19099
|
-
const
|
|
19138
|
+
const tgSanitizedGuarded = redactToolCallMarkup(tgSanitized.text);
|
|
19139
|
+
if (tgSanitizedGuarded.redacted) emitToolCallMarkupRedactionTelemetry("telegram");
|
|
19140
|
+
const tgApiErr = rewriteTransientApiError(tgSanitizedGuarded.text);
|
|
19100
19141
|
if (tgApiErr.rewritten) emitTransientApiErrorTelemetry("telegram", tgApiErr.match, tgApiErr.original);
|
|
19101
19142
|
const isPrivateChat = !chat_id.startsWith("-");
|
|
19102
19143
|
const tgThrottleCfg = isPrivateChat ? relaxedThrottleConfig(configFromEnv()) : configFromEnv();
|
|
@@ -34,8 +34,8 @@ import {
|
|
|
34
34
|
writeDirectChatSessionState,
|
|
35
35
|
writeEgressAllowlist,
|
|
36
36
|
writePersistentClaudeWrapper
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-N25WAF7G.js";
|
|
38
|
+
import "./chunk-OMC7BHRP.js";
|
|
39
39
|
import "./chunk-XWVM4KPK.js";
|
|
40
40
|
export {
|
|
41
41
|
EGRESS_BASELINE_DOMAINS,
|
|
@@ -74,4 +74,4 @@ export {
|
|
|
74
74
|
writeEgressAllowlist,
|
|
75
75
|
writePersistentClaudeWrapper
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=persistent-session-
|
|
77
|
+
//# sourceMappingURL=persistent-session-4HC7YFSU.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paneLogPath
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-N25WAF7G.js";
|
|
4
|
+
import "./chunk-OMC7BHRP.js";
|
|
5
5
|
import "./chunk-XWVM4KPK.js";
|
|
6
6
|
|
|
7
7
|
// src/lib/responsiveness-probe.ts
|
|
@@ -304,4 +304,4 @@ export {
|
|
|
304
304
|
readAndResetChannelDeflections,
|
|
305
305
|
readAndResetChannelLaneClassifications
|
|
306
306
|
};
|
|
307
|
-
//# sourceMappingURL=responsiveness-probe-
|
|
307
|
+
//# sourceMappingURL=responsiveness-probe-W4PCY6HC.js.map
|