@integrity-labs/agt-cli 0.28.462 → 0.28.464
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 +3 -3
- package/dist/{chunk-UNDFX52P.js → chunk-Q5GHZOXL.js} +2 -2
- package/dist/lib/manager-worker.js +8 -3
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +14 -6
- package/dist/mcp/slack-channel.js +37 -2
- package/package.json +1 -1
- /package/dist/{chunk-UNDFX52P.js.map → chunk-Q5GHZOXL.js.map} +0 -0
|
@@ -36543,7 +36543,10 @@ async function maybeSendDirectChatAccountWarn(sessionId) {
|
|
|
36543
36543
|
agent_id: AGT_AGENT_ID,
|
|
36544
36544
|
session_id: sessionId,
|
|
36545
36545
|
content: buildAccountIssueReplyText(),
|
|
36546
|
-
message_ids: []
|
|
36546
|
+
message_ids: [],
|
|
36547
|
+
// ENG-8274: kind:'notice' — an account-auth nag is the system speaking, not
|
|
36548
|
+
// the agent, and owes no reply.
|
|
36549
|
+
kind: "notice"
|
|
36547
36550
|
});
|
|
36548
36551
|
const data = await res.json().catch(() => ({}));
|
|
36549
36552
|
if (!res.ok || data.error) {
|
|
@@ -36850,7 +36853,8 @@ async function postDirectChatNoticeMessage(sessionId, content) {
|
|
|
36850
36853
|
agent_id: AGT_AGENT_ID,
|
|
36851
36854
|
session_id: sessionId,
|
|
36852
36855
|
content,
|
|
36853
|
-
liveness_stamp: false
|
|
36856
|
+
liveness_stamp: false,
|
|
36857
|
+
kind: "notice"
|
|
36854
36858
|
});
|
|
36855
36859
|
if (!res.ok) return false;
|
|
36856
36860
|
const data = await res.json().catch(() => ({}));
|
|
@@ -37024,7 +37028,11 @@ function armUsageLimitWatch(args) {
|
|
|
37024
37028
|
agent_id: AGT_AGENT_ID,
|
|
37025
37029
|
session_id: args.sessionId,
|
|
37026
37030
|
content: buildUsageLimitReplyText(refusal.resetsAt),
|
|
37027
|
-
message_ids: [args.messageId]
|
|
37031
|
+
message_ids: [args.messageId],
|
|
37032
|
+
// ENG-8274: a cap refusal is the SYSTEM speaking, not the agent.
|
|
37033
|
+
// Orthogonal to message_ids — consuming the cursor is about delivery,
|
|
37034
|
+
// `kind` is about who authored this and whether a reply is owed.
|
|
37035
|
+
kind: "notice"
|
|
37028
37036
|
} : { agent_id: AGT_AGENT_ID, session_id: args.sessionId, message_ids: [args.messageId] };
|
|
37029
37037
|
const res = await apiPost(route, body);
|
|
37030
37038
|
const data = await res.json().catch(() => ({}));
|
|
@@ -37095,7 +37103,7 @@ async function pollForMessages(sinceMs) {
|
|
|
37095
37103
|
now: Date.now()
|
|
37096
37104
|
});
|
|
37097
37105
|
const route = throttle.reply ? "/host/direct-chat/reply" : "/host/direct-chat/consume";
|
|
37098
|
-
const body = throttle.reply ? { agent_id: AGT_AGENT_ID, session_id: msg.session_id, content: MAINTENANCE_OFFLINE_MESSAGE, message_ids: [msg.id] } : { agent_id: AGT_AGENT_ID, session_id: msg.session_id, message_ids: [msg.id] };
|
|
37106
|
+
const body = throttle.reply ? { agent_id: AGT_AGENT_ID, session_id: msg.session_id, content: MAINTENANCE_OFFLINE_MESSAGE, message_ids: [msg.id], kind: "notice" } : { agent_id: AGT_AGENT_ID, session_id: msg.session_id, message_ids: [msg.id] };
|
|
37099
37107
|
try {
|
|
37100
37108
|
const res2 = await apiPost(route, body);
|
|
37101
37109
|
const data2 = await res2.json().catch(() => ({}));
|
|
@@ -37126,7 +37134,7 @@ async function pollForMessages(sinceMs) {
|
|
|
37126
37134
|
now: Date.now()
|
|
37127
37135
|
});
|
|
37128
37136
|
const route = throttle.reply ? "/host/direct-chat/reply" : "/host/direct-chat/consume";
|
|
37129
|
-
const body = throttle.reply ? { agent_id: AGT_AGENT_ID, session_id: msg.session_id, content: buildAccountIssueReplyText(), message_ids: [msg.id] } : { agent_id: AGT_AGENT_ID, session_id: msg.session_id, message_ids: [msg.id] };
|
|
37137
|
+
const body = throttle.reply ? { agent_id: AGT_AGENT_ID, session_id: msg.session_id, content: buildAccountIssueReplyText(), message_ids: [msg.id], kind: "notice" } : { agent_id: AGT_AGENT_ID, session_id: msg.session_id, message_ids: [msg.id] };
|
|
37130
37138
|
try {
|
|
37131
37139
|
const res2 = await apiPost(route, body);
|
|
37132
37140
|
const data2 = await res2.json().catch(() => ({}));
|
|
@@ -37157,7 +37165,7 @@ async function pollForMessages(sinceMs) {
|
|
|
37157
37165
|
now: Date.now()
|
|
37158
37166
|
});
|
|
37159
37167
|
const route = throttle.reply ? "/host/direct-chat/reply" : "/host/direct-chat/consume";
|
|
37160
|
-
const body = throttle.reply ? { agent_id: AGT_AGENT_ID, session_id: msg.session_id, content: buildUsageLimitReplyText(usageLimitUntil), message_ids: [msg.id] } : { agent_id: AGT_AGENT_ID, session_id: msg.session_id, message_ids: [msg.id] };
|
|
37168
|
+
const body = throttle.reply ? { agent_id: AGT_AGENT_ID, session_id: msg.session_id, content: buildUsageLimitReplyText(usageLimitUntil), message_ids: [msg.id], kind: "notice" } : { agent_id: AGT_AGENT_ID, session_id: msg.session_id, message_ids: [msg.id] };
|
|
37161
37169
|
try {
|
|
37162
37170
|
const res2 = await apiPost(route, body);
|
|
37163
37171
|
const data2 = await res2.json().catch(() => ({}));
|
|
@@ -37291,6 +37291,37 @@ function emitTransientApiErrorTelemetry(channel, match, original) {
|
|
|
37291
37291
|
}
|
|
37292
37292
|
}
|
|
37293
37293
|
|
|
37294
|
+
// src/strip-url-wrapping-asterisks.ts
|
|
37295
|
+
var URL_WITH_ASTERISKS = /(\*+)?(?<!<)(https?:\/\/[^\s*]+)(\*+)?/gi;
|
|
37296
|
+
function stripUrlWrappingAsterisks(text) {
|
|
37297
|
+
if (!text || !text.includes("*") || !/https?:\/\//i.test(text)) {
|
|
37298
|
+
return { text, stripped: false, count: 0 };
|
|
37299
|
+
}
|
|
37300
|
+
let count = 0;
|
|
37301
|
+
const out = text.replace(URL_WITH_ASTERISKS, (match, lead, url, trail) => {
|
|
37302
|
+
if (!lead && !trail) return match;
|
|
37303
|
+
const keepLead = lead && !trail ? lead : "";
|
|
37304
|
+
const rebuilt = keepLead + url;
|
|
37305
|
+
if (rebuilt !== match) count++;
|
|
37306
|
+
return rebuilt;
|
|
37307
|
+
});
|
|
37308
|
+
return { text: out, stripped: count > 0, count };
|
|
37309
|
+
}
|
|
37310
|
+
function emitUrlAsteriskStripTelemetry(channel, count = 0) {
|
|
37311
|
+
const agentCode = process.env.AGT_AGENT_CODE_NAME ?? "unknown";
|
|
37312
|
+
try {
|
|
37313
|
+
process.stderr.write(
|
|
37314
|
+
`agt.egress.url_wrapping_asterisks_stripped ${JSON.stringify({
|
|
37315
|
+
channel,
|
|
37316
|
+
agent_code: agentCode,
|
|
37317
|
+
count
|
|
37318
|
+
})}
|
|
37319
|
+
`
|
|
37320
|
+
);
|
|
37321
|
+
} catch {
|
|
37322
|
+
}
|
|
37323
|
+
}
|
|
37324
|
+
|
|
37294
37325
|
// src/slack-pending-inbound-cleanup.ts
|
|
37295
37326
|
import { existsSync as existsSync4, readdirSync as readdirSync4, statSync as statSync3, unlinkSync } from "fs";
|
|
37296
37327
|
import { join as join10 } from "path";
|
|
@@ -40670,7 +40701,9 @@ async function processSlackRecoveryOutboxFile(filename) {
|
|
|
40670
40701
|
if (recoveredGuarded.redacted) emitToolCallMarkupRedactionTelemetry("slack");
|
|
40671
40702
|
const apiErr = rewriteTransientApiError(recoveredGuarded.text);
|
|
40672
40703
|
if (apiErr.rewritten) emitTransientApiErrorTelemetry("slack", apiErr.match, apiErr.original);
|
|
40673
|
-
const
|
|
40704
|
+
const urlFixed = stripUrlWrappingAsterisks(apiErr.text);
|
|
40705
|
+
if (urlFixed.stripped) emitUrlAsteriskStripTelemetry("slack", urlFixed.count);
|
|
40706
|
+
const text = urlFixed.text;
|
|
40674
40707
|
const ghostReplyMode = resolveGhostReplyMode();
|
|
40675
40708
|
if (ghostReplyMode !== "off") {
|
|
40676
40709
|
const decision = await decideRecovery(text, ghostReplyMode);
|
|
@@ -43170,6 +43203,8 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
43170
43203
|
if (sanitizedGuarded.redacted) emitToolCallMarkupRedactionTelemetry("slack");
|
|
43171
43204
|
const apiErr = rewriteTransientApiError(sanitizedGuarded.text);
|
|
43172
43205
|
if (apiErr.rewritten) emitTransientApiErrorTelemetry("slack", apiErr.match, apiErr.original);
|
|
43206
|
+
const urlFixed = stripUrlWrappingAsterisks(apiErr.text);
|
|
43207
|
+
if (urlFixed.stripped) emitUrlAsteriskStripTelemetry("slack", urlFixed.count);
|
|
43173
43208
|
try {
|
|
43174
43209
|
const res = await fetch("https://slack.com/api/chat.postMessage", {
|
|
43175
43210
|
method: "POST",
|
|
@@ -43179,7 +43214,7 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
43179
43214
|
},
|
|
43180
43215
|
body: JSON.stringify({
|
|
43181
43216
|
channel: effectiveChannel,
|
|
43182
|
-
text:
|
|
43217
|
+
text: urlFixed.text,
|
|
43183
43218
|
...effectiveThreadTs ? { thread_ts: effectiveThreadTs } : {},
|
|
43184
43219
|
...buildAugmentedSlackMetadata() ? { metadata: buildAugmentedSlackMetadata() } : {}
|
|
43185
43220
|
// ↑ Labels this message as Augmented-agent-originated so peer agents
|
package/package.json
CHANGED
|
File without changes
|