@integrity-labs/agt-cli 0.28.1260 → 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-PXVHBJBB.js → api-client-DQ7YV5IG.js} +3 -3
- package/dist/bin/agt.js +7 -7
- package/dist/{chunk-UKZ3NXB7.js → chunk-5BXIXSSH.js} +2 -2
- package/dist/{chunk-7EEU3X3T.js → chunk-6YWVKLHF.js} +3 -3
- package/dist/{chunk-E7DKUEXC.js → chunk-CEJNJ6NF.js} +3 -3
- package/dist/{chunk-LLVL6LIB.js → chunk-HJWOXFJM.js} +2 -2
- package/dist/{chunk-UQLSI3C7.js → chunk-KJ5OCCSJ.js} +98 -6
- package/dist/chunk-KJ5OCCSJ.js.map +1 -0
- package/dist/{chunk-NABJJPLW.js → chunk-PIKXAEVA.js} +525 -254
- package/dist/chunk-PIKXAEVA.js.map +1 -0
- package/dist/{claude-code-updater-OXTQF5E5.js → claude-code-updater-JQLNRK25.js} +3 -3
- package/dist/{claude-pair-runtime-BBOAF76W.js → claude-pair-runtime-BJ3EAWEJ.js} +3 -3
- package/dist/lib/manager-worker.js +580 -427
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +94 -2
- package/dist/mcp/index.js +94 -2
- package/dist/mcp/origami.js +94 -2
- package/dist/mcp/slack-channel.js +94 -2
- package/dist/mcp/teams-channel.js +218 -82
- package/dist/mcp/telegram-channel.js +252 -2
- package/dist/{persistent-session-XPDKIBEM.js → persistent-session-YNHYNCNA.js} +4 -4
- package/dist/{responsiveness-probe-4B6Y2446.js → responsiveness-probe-57RV3U2H.js} +4 -4
- package/dist/{session-auth-dead-4C7AK3A6.js → session-auth-dead-A3TO2N63.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-NABJJPLW.js.map +0 -1
- package/dist/chunk-UQLSI3C7.js.map +0 -1
- /package/dist/{api-client-PXVHBJBB.js.map → api-client-DQ7YV5IG.js.map} +0 -0
- /package/dist/{chunk-UKZ3NXB7.js.map → chunk-5BXIXSSH.js.map} +0 -0
- /package/dist/{chunk-7EEU3X3T.js.map → chunk-6YWVKLHF.js.map} +0 -0
- /package/dist/{chunk-E7DKUEXC.js.map → chunk-CEJNJ6NF.js.map} +0 -0
- /package/dist/{chunk-LLVL6LIB.js.map → chunk-HJWOXFJM.js.map} +0 -0
- /package/dist/{claude-code-updater-OXTQF5E5.js.map → claude-code-updater-JQLNRK25.js.map} +0 -0
- /package/dist/{claude-pair-runtime-BBOAF76W.js.map → claude-pair-runtime-BJ3EAWEJ.js.map} +0 -0
- /package/dist/{persistent-session-XPDKIBEM.js.map → persistent-session-YNHYNCNA.js.map} +0 -0
- /package/dist/{responsiveness-probe-4B6Y2446.js.map → responsiveness-probe-57RV3U2H.js.map} +0 -0
- /package/dist/{session-auth-dead-4C7AK3A6.js.map → session-auth-dead-A3TO2N63.js.map} +0 -0
|
@@ -31383,6 +31383,26 @@ function resolveGhostReplyMode(opts) {
|
|
|
31383
31383
|
if (cached2 !== void 0) return cached2;
|
|
31384
31384
|
return "off";
|
|
31385
31385
|
}
|
|
31386
|
+
var GHOST_REPLY_NARRATION_GUARD_FLAG_KEY = "ghost-reply-narration-guard";
|
|
31387
|
+
function resolveGhostReplyNarrationGuardMode(opts) {
|
|
31388
|
+
const env2 = opts?.env ?? process.env;
|
|
31389
|
+
const parse3 = (raw) => {
|
|
31390
|
+
const v = typeof raw === "string" ? raw.trim().toLowerCase() : "";
|
|
31391
|
+
return v === "off" || v === "shadow" || v === "enforce" ? v : void 0;
|
|
31392
|
+
};
|
|
31393
|
+
const override = parse3(env2["AGT_GHOST_REPLY_NARRATION_GUARD_MODE"]);
|
|
31394
|
+
if (override) return override;
|
|
31395
|
+
try {
|
|
31396
|
+
const path = opts?.cachePath ?? defaultFlagsCachePath(env2);
|
|
31397
|
+
if (existsSync3(path)) {
|
|
31398
|
+
const parsed = JSON.parse(readFileSync4(path, "utf8"));
|
|
31399
|
+
const cached2 = parse3(parsed?.flags?.[GHOST_REPLY_NARRATION_GUARD_FLAG_KEY]);
|
|
31400
|
+
if (cached2) return cached2;
|
|
31401
|
+
}
|
|
31402
|
+
} catch {
|
|
31403
|
+
}
|
|
31404
|
+
return "shadow";
|
|
31405
|
+
}
|
|
31386
31406
|
var MAINTENANCE_FLAG_KEY = "platform-maintenance-mode";
|
|
31387
31407
|
function parseMaintenanceMode(raw) {
|
|
31388
31408
|
if (raw === void 0) return void 0;
|
|
@@ -39242,7 +39262,10 @@ var GITHUB_EVENT_RULES = {
|
|
|
39242
39262
|
pull_request_review: { actions: ["submitted"] },
|
|
39243
39263
|
check_suite: { actions: ["completed"] },
|
|
39244
39264
|
issues: { actions: ["opened", "closed"] },
|
|
39245
|
-
issue_comment: { actions: ["created"] }
|
|
39265
|
+
issue_comment: { actions: ["created"] },
|
|
39266
|
+
// ENG-12123 (CS-2564): a deployment's status changed. GitHub sends one
|
|
39267
|
+
// deployment_status event per state change, always with action `created`.
|
|
39268
|
+
deployment_status: { actions: ["created"] }
|
|
39246
39269
|
};
|
|
39247
39270
|
var GITHUB_WEBHOOK_EVENTS = Object.keys(GITHUB_EVENT_RULES);
|
|
39248
39271
|
var REPO_FULL_NAME = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}$/;
|
|
@@ -39265,6 +39288,28 @@ var CHECK_CONCLUSIONS = /* @__PURE__ */ new Set([
|
|
|
39265
39288
|
"startup_failure"
|
|
39266
39289
|
]);
|
|
39267
39290
|
var ISSUE_STATE_REASONS = /* @__PURE__ */ new Set(["completed", "not_planned", "reopened", "duplicate"]);
|
|
39291
|
+
var DEPLOYMENT_STATES = /* @__PURE__ */ new Set(["success", "failure", "error", "pending", "in_progress", "queued", "inactive"]);
|
|
39292
|
+
var ENVIRONMENT_TOKEN = /^[A-Za-z0-9][A-Za-z0-9._/:-]{0,63}$/;
|
|
39293
|
+
var ACTIONS_RUN_PATH = /^\/([^/]+)\/([^/]+)\/actions\/runs\/([1-9][0-9]{0,18})(?:\/job\/([1-9][0-9]{0,18}))?\/?$/;
|
|
39294
|
+
function githubActionsRunUrl(v, repo) {
|
|
39295
|
+
const s = str(v);
|
|
39296
|
+
if (s === null || s.length > 500)
|
|
39297
|
+
return null;
|
|
39298
|
+
let u;
|
|
39299
|
+
try {
|
|
39300
|
+
u = new URL(s);
|
|
39301
|
+
} catch {
|
|
39302
|
+
return null;
|
|
39303
|
+
}
|
|
39304
|
+
if (u.protocol !== "https:" || u.username || u.password || u.port || u.hostname !== "github.com")
|
|
39305
|
+
return null;
|
|
39306
|
+
const m = ACTIONS_RUN_PATH.exec(u.pathname);
|
|
39307
|
+
if (!m)
|
|
39308
|
+
return null;
|
|
39309
|
+
if (`${m[1]}/${m[2]}`.toLowerCase() !== repo.toLowerCase())
|
|
39310
|
+
return null;
|
|
39311
|
+
return `https://github.com/${repo}/actions/runs/${m[3]}${m[4] ? `/job/${m[4]}` : ""}`;
|
|
39312
|
+
}
|
|
39268
39313
|
function asDict(v) {
|
|
39269
39314
|
return v !== null && typeof v === "object" && !Array.isArray(v) ? v : null;
|
|
39270
39315
|
}
|
|
@@ -39410,6 +39455,36 @@ function extractGithubFacts(event, payload) {
|
|
|
39410
39455
|
summary: `Issue #${n2} ${action} in ${repo}`
|
|
39411
39456
|
};
|
|
39412
39457
|
}
|
|
39458
|
+
if (event === "deployment_status") {
|
|
39459
|
+
const status = asDict(root["deployment_status"]);
|
|
39460
|
+
const deployment = asDict(root["deployment"]);
|
|
39461
|
+
if (!status || !deployment)
|
|
39462
|
+
return null;
|
|
39463
|
+
const state = inSet(status["state"], DEPLOYMENT_STATES);
|
|
39464
|
+
const environment = shaped(status["environment"], ENVIRONMENT_TOKEN) ?? shaped(deployment["environment"], ENVIRONMENT_TOKEN);
|
|
39465
|
+
details.push(["Environment", environment ?? "(name withheld: not a plain token)"]);
|
|
39466
|
+
details.push(["State", state ?? "unknown"]);
|
|
39467
|
+
const deploymentId = posInt(deployment["id"]);
|
|
39468
|
+
if (deploymentId !== null)
|
|
39469
|
+
details.push(["Deployment id", String(deploymentId)]);
|
|
39470
|
+
const sha = shaped(str(deployment["sha"])?.toLowerCase(), SHA);
|
|
39471
|
+
if (sha)
|
|
39472
|
+
details.push(["Commit", sha]);
|
|
39473
|
+
const creator = shaped(asDict(status["creator"])?.["login"], LOGIN);
|
|
39474
|
+
if (creator)
|
|
39475
|
+
details.push(["Status set by", creator]);
|
|
39476
|
+
const link = githubActionsRunUrl(status["log_url"], repo) ?? githubActionsRunUrl(status["target_url"], repo);
|
|
39477
|
+
return {
|
|
39478
|
+
event,
|
|
39479
|
+
action,
|
|
39480
|
+
repo,
|
|
39481
|
+
subject: null,
|
|
39482
|
+
url: link ?? `${base}/deployments`,
|
|
39483
|
+
sender,
|
|
39484
|
+
details,
|
|
39485
|
+
summary: `Deployment to ${environment ?? "an environment"} ${state ?? "updated"} in ${repo}`
|
|
39486
|
+
};
|
|
39487
|
+
}
|
|
39413
39488
|
const issue2 = asDict(root["issue"]);
|
|
39414
39489
|
const n = issue2 ? posInt(issue2["number"]) : null;
|
|
39415
39490
|
if (!issue2 || n === null)
|
|
@@ -39586,6 +39661,43 @@ var FLAG_REGISTRY = [
|
|
|
39586
39661
|
flagType: "boolean",
|
|
39587
39662
|
defaultValue: false
|
|
39588
39663
|
},
|
|
39664
|
+
{
|
|
39665
|
+
key: "scratch-sweep-held",
|
|
39666
|
+
description: "ENG-11877: stops ALL scratch sweeping for an agent, including the existing tree rule, for files someone has asked to keep. Resolved per agent by the manager. Sticky on the host: once seen it is written to a marker outside scratch, which keeps the agent held until heartbeats that evaluated it find the flag off for 10 minutes, so a restart or a failed flag read cannot let a sweep through. A host only honours it once its CLI has the reader: check reach before relying on it. Off is the safe default for everyone else.",
|
|
39667
|
+
sensitive: true,
|
|
39668
|
+
flagType: "boolean",
|
|
39669
|
+
defaultValue: false,
|
|
39670
|
+
// No published agt-cli has this reader yet, and a guessed floor would report reach
|
|
39671
|
+
// on hosts that can't act on it. So this reads as "no host yet" on purpose, the
|
|
39672
|
+
// safe direction. ENG-11877 re-pins it from the published dist after merge.
|
|
39673
|
+
since: "0.28.999999"
|
|
39674
|
+
},
|
|
39675
|
+
{
|
|
39676
|
+
key: "scratch-sweep-per-file",
|
|
39677
|
+
description: "ENG-11877: also expire old files inside scratch folders still in use, instead of keeping a whole folder while anything in it is fresh. IRREVERSIBLE on its first pass: every file unchanged for 7 days goes, customer documents included, so arm it per agent and read scratch-sweep-dry-run first. Off = the tree rule only.",
|
|
39678
|
+
sensitive: true,
|
|
39679
|
+
// CodeRabbit on #7378: `sensitive` only forces a confirmation; it does not say
|
|
39680
|
+
// WHO. Its first pass irreversibly deletes old customer files, and arming it is
|
|
39681
|
+
// Brad's rollout decision (ENG-11877), so an org owner/admin must not be able to
|
|
39682
|
+
// switch it on for their own agents. Only the cross-org admin route can write it.
|
|
39683
|
+
platformAdminOnly: true,
|
|
39684
|
+
flagType: "boolean",
|
|
39685
|
+
defaultValue: false,
|
|
39686
|
+
// No published agt-cli has this reader yet, and a guessed floor would report reach
|
|
39687
|
+
// on hosts that can't act on it. So this reads as "no host yet" on purpose, the
|
|
39688
|
+
// safe direction. ENG-11877 re-pins it from the published dist after merge.
|
|
39689
|
+
since: "0.28.999999"
|
|
39690
|
+
},
|
|
39691
|
+
{
|
|
39692
|
+
key: "scratch-sweep-dry-run",
|
|
39693
|
+
description: "ENG-11877: count what scratch-sweep-per-file would remove and log it to manager.log every 6 hours ([scratch] [sweep-dry-run]). Metadata only: never opens a file, never logs a name, removes nothing extra.",
|
|
39694
|
+
flagType: "boolean",
|
|
39695
|
+
defaultValue: false,
|
|
39696
|
+
// No published agt-cli has this reader yet, and a guessed floor would report reach
|
|
39697
|
+
// on hosts that can't act on it. So this reads as "no host yet" on purpose, the
|
|
39698
|
+
// safe direction. ENG-11877 re-pins it from the published dist after merge.
|
|
39699
|
+
since: "0.28.999999"
|
|
39700
|
+
},
|
|
39589
39701
|
{
|
|
39590
39702
|
key: "broker-read-jobs",
|
|
39591
39703
|
description: `Slow broker READ tools finish in a background job (ENG-11476, ADR-0129). When on for an org, an opted-in read tool (Pronto Xi first) that misses an 18s grace window answers "still running, call again with the same arguments" and finishes in the broker-read-job worker instead of timing out. Off = today's synchronous call, so false is the safe value. Evaluated in the API per org, team and agent.`,
|
|
@@ -39970,7 +40082,7 @@ var FLAG_REGISTRY = [
|
|
|
39970
40082
|
},
|
|
39971
40083
|
{
|
|
39972
40084
|
key: "ghost-reply-narration-guard",
|
|
39973
|
-
description: "Model-free guard on the
|
|
40085
|
+
description: "Model-free guard on the ghost-reply RECOVERY path of Slack, Telegram and Teams (CS-1821, CS-1429, ENG-7780, ENG-11890). Teams has no re-delivery, so there it only closes stand-down wording. Recovered end-of-turn text with no second person, question, link or mention, that uses stand-down wording or names the person being answered in the third person, is not published. enforce = keep the marker so the inbound is re-delivered and the agent can answer properly. When re-deliveries run out, stand-down wording closes unposted and a name-only match publishes; with no reply owed, either closes. shadow = log only. off = never runs. A false match usually costs a re-ask; a real reply using stand-down wording every time is lost.",
|
|
39974
40086
|
flagType: "enum",
|
|
39975
40087
|
allowedValues: ["off", "shadow", "enforce"],
|
|
39976
40088
|
// Ships in SHADOW: a free local log line, like every enum flag here, enforce is a
|
|
@@ -44690,6 +44802,73 @@ function shouldDeliverWithoutClassifying(text) {
|
|
|
44690
44802
|
if (/<[@#][A-Z0-9]/.test(t)) return true;
|
|
44691
44803
|
return false;
|
|
44692
44804
|
}
|
|
44805
|
+
var STAND_DOWN_NARRATION = [
|
|
44806
|
+
/\bstanding by\b/i,
|
|
44807
|
+
/\bstaying (silent|quiet|out)\b/i,
|
|
44808
|
+
/\bstand(ing)? down\b/i,
|
|
44809
|
+
/\bnot (addressed to|for|directed at) me\b/i,
|
|
44810
|
+
/\bno (reply|response) (is )?(needed|required|owed)\b/i,
|
|
44811
|
+
/\bnot replying\b/i,
|
|
44812
|
+
/\breacted,? nothing else\b/i,
|
|
44813
|
+
/\bcard (is )?parked\b/i,
|
|
44814
|
+
/\bparked (in|on) (todo|waiting|backlog)\b/i
|
|
44815
|
+
];
|
|
44816
|
+
function withoutAddress(text, name) {
|
|
44817
|
+
const escaped = name.replace(/[.*+?^\${}()|[\]\\]/g, "\\$&");
|
|
44818
|
+
return text.replace(
|
|
44819
|
+
new RegExp(`^\\s*(?:(?:hi|hey|hello|thanks|thank you|ok|okay|sure|yes|no),?\\s+)?${escaped}\\s*[,:!.\\-]`, "i"),
|
|
44820
|
+
""
|
|
44821
|
+
).replace(new RegExp(`(?:thanks|thank you|cheers),?\\s+${escaped}\\s*[.!]*\\s*$`, "i"), "").replace(new RegExp(`,\\s*${escaped}\\s*[.!]*\\s*$`, "i"), "");
|
|
44822
|
+
}
|
|
44823
|
+
function detectInternalNarration(text, addresseeName) {
|
|
44824
|
+
const t = String(text ?? "");
|
|
44825
|
+
if (!t.trim() || shouldDeliverWithoutClassifying(t)) return null;
|
|
44826
|
+
if (STAND_DOWN_NARRATION.some((re) => re.test(t))) return "stand_down";
|
|
44827
|
+
const raw = String(addresseeName ?? "").trim().split(/\s+/)[0] ?? "";
|
|
44828
|
+
const first = raw.charAt(0).toUpperCase() + raw.slice(1);
|
|
44829
|
+
if (first.length >= 3) {
|
|
44830
|
+
const escaped = first.replace(/[.*+?^\${}()|[\]\\]/g, "\\$&");
|
|
44831
|
+
if (new RegExp(`\\b${escaped}\\b`).test(withoutAddress(t, first))) {
|
|
44832
|
+
return "third_person_addressee";
|
|
44833
|
+
}
|
|
44834
|
+
}
|
|
44835
|
+
return null;
|
|
44836
|
+
}
|
|
44837
|
+
function summariseRecoveryMarkers(markers) {
|
|
44838
|
+
const owed = markers.filter((m) => !m.owesNoReply);
|
|
44839
|
+
const newest = (list) => [...list].sort((a, b) => Number(b.messageTs) - Number(a.messageTs))[0];
|
|
44840
|
+
if (owed.length === 0) {
|
|
44841
|
+
return {
|
|
44842
|
+
owesNoReply: true,
|
|
44843
|
+
hasPayload: markers.every((m) => m.hasPayload),
|
|
44844
|
+
replayCount: Math.max(...markers.map((m) => m.replayCount)),
|
|
44845
|
+
addresseeName: newest(markers)?.addresseeName
|
|
44846
|
+
};
|
|
44847
|
+
}
|
|
44848
|
+
return {
|
|
44849
|
+
owesNoReply: false,
|
|
44850
|
+
hasPayload: owed.every((m) => m.hasPayload),
|
|
44851
|
+
replayCount: Math.min(...owed.map((m) => m.replayCount)),
|
|
44852
|
+
maxReplayCount: Math.max(...owed.map((m) => m.replayCount)),
|
|
44853
|
+
addresseeName: newest(owed)?.addresseeName
|
|
44854
|
+
};
|
|
44855
|
+
}
|
|
44856
|
+
var UNREADABLE_RECOVERY_MARKER = {
|
|
44857
|
+
owesNoReply: false,
|
|
44858
|
+
hasPayload: false,
|
|
44859
|
+
replayCount: 0,
|
|
44860
|
+
messageTs: ""
|
|
44861
|
+
};
|
|
44862
|
+
function decideNarrationGuard(opts) {
|
|
44863
|
+
if (!opts.match || opts.mode !== "enforce") return "publish";
|
|
44864
|
+
if (!opts.marker) return "publish";
|
|
44865
|
+
if (opts.marker.owesNoReply) return "close";
|
|
44866
|
+
if (!opts.marker.hasPayload || !opts.replayEnabled) return "publish";
|
|
44867
|
+
const mostReplays = opts.marker.maxReplayCount ?? opts.marker.replayCount;
|
|
44868
|
+
if (opts.match === "third_person_addressee" && mostReplays >= opts.maxReplays) return "publish";
|
|
44869
|
+
if (opts.marker.replayCount < opts.maxReplays) return "redeliver";
|
|
44870
|
+
return opts.match === "stand_down" ? "close" : "publish";
|
|
44871
|
+
}
|
|
44693
44872
|
async function decideRecovery(text, mode, env2 = process.env, classify = classifyRecoveredReply) {
|
|
44694
44873
|
if (shouldDeliverWithoutClassifying(text)) {
|
|
44695
44874
|
return { action: "deliver", mode, verdict: "pre-gate-deliver", wouldSuppress: false };
|
|
@@ -47588,6 +47767,42 @@ function nextRetryName(filename) {
|
|
|
47588
47767
|
}
|
|
47589
47768
|
return { next: `${base}.retry-${attempt}.json`, attempt };
|
|
47590
47769
|
}
|
|
47770
|
+
function readTelegramRecoveryMarkerState(markerName) {
|
|
47771
|
+
if (!PENDING_INBOUND_DIR || !markerName) return null;
|
|
47772
|
+
const chatPrefix = basename(markerName).split("__")[0];
|
|
47773
|
+
if (!chatPrefix) return null;
|
|
47774
|
+
let names;
|
|
47775
|
+
try {
|
|
47776
|
+
names = readdirSync6(PENDING_INBOUND_DIR).filter((f) => f.startsWith(`${chatPrefix}__`) && f.endsWith(".json"));
|
|
47777
|
+
} catch {
|
|
47778
|
+
return null;
|
|
47779
|
+
}
|
|
47780
|
+
const markers = [];
|
|
47781
|
+
for (const name of names) {
|
|
47782
|
+
let raw;
|
|
47783
|
+
try {
|
|
47784
|
+
raw = readFileSync16(join18(PENDING_INBOUND_DIR, name), "utf-8");
|
|
47785
|
+
} catch (err) {
|
|
47786
|
+
if (err.code !== "ENOENT") markers.push(UNREADABLE_RECOVERY_MARKER);
|
|
47787
|
+
continue;
|
|
47788
|
+
}
|
|
47789
|
+
try {
|
|
47790
|
+
const m = JSON.parse(raw);
|
|
47791
|
+
const msgPart = name.slice(chatPrefix.length + 2, -".json".length);
|
|
47792
|
+
markers.push({
|
|
47793
|
+
hasPayload: Boolean(m.payload),
|
|
47794
|
+
owesNoReply: false,
|
|
47795
|
+
replayCount: m.replay_count ?? 0,
|
|
47796
|
+
messageTs: String(m.message_id ?? msgPart),
|
|
47797
|
+
addresseeName: m.payload?.meta?.["user_name"]
|
|
47798
|
+
});
|
|
47799
|
+
} catch {
|
|
47800
|
+
markers.push(UNREADABLE_RECOVERY_MARKER);
|
|
47801
|
+
}
|
|
47802
|
+
}
|
|
47803
|
+
if (markers.length === 0) return null;
|
|
47804
|
+
return summariseRecoveryMarkers(markers);
|
|
47805
|
+
}
|
|
47591
47806
|
async function processRecoveryOutboxFile(filename) {
|
|
47592
47807
|
if (!RECOVERY_OUTBOX_DIR) return;
|
|
47593
47808
|
if (filename.endsWith(".poison.json") || filename.endsWith(".tmp")) return;
|
|
@@ -47627,6 +47842,41 @@ async function processRecoveryOutboxFile(filename) {
|
|
|
47627
47842
|
if (apiErr.rewritten) emitTransientApiErrorTelemetry("telegram", apiErr.match, apiErr.original);
|
|
47628
47843
|
const text = apiErr.text;
|
|
47629
47844
|
const recoveryDrainCutoffMs = Date.now();
|
|
47845
|
+
const narrationGuardMode = resolveGhostReplyNarrationGuardMode();
|
|
47846
|
+
if (narrationGuardMode !== "off") {
|
|
47847
|
+
const marker = readTelegramRecoveryMarkerState(payload.marker_name);
|
|
47848
|
+
const narration = detectInternalNarration(text, marker?.addresseeName);
|
|
47849
|
+
const decide = (mode) => decideNarrationGuard({
|
|
47850
|
+
match: narration,
|
|
47851
|
+
mode,
|
|
47852
|
+
marker,
|
|
47853
|
+
maxReplays: MAX_MARKER_REPLAYS,
|
|
47854
|
+
replayEnabled: channelReplayEnabled()
|
|
47855
|
+
});
|
|
47856
|
+
const narrationAction = decide(narrationGuardMode);
|
|
47857
|
+
if (narration) {
|
|
47858
|
+
process.stderr.write(
|
|
47859
|
+
`telegram-channel(${AGENT_CODE_NAME}): ghost-reply narration match=${narration} mode=${narrationGuardMode} action=${narrationAction} enforce_action=${decide("enforce")} chat=${redactId(payload.chat_id)} text_len=${text.length}
|
|
47860
|
+
`
|
|
47861
|
+
);
|
|
47862
|
+
}
|
|
47863
|
+
if (narrationAction !== "publish") {
|
|
47864
|
+
if (narrationAction === "close") {
|
|
47865
|
+
process.stderr.write(
|
|
47866
|
+
`telegram-channel(${AGENT_CODE_NAME}): ghost-reply narration lost_owed_reply=1 match=${narration} replays=${marker?.replayCount ?? 0} chat=${redactId(payload.chat_id)} text_len=${text.length}
|
|
47867
|
+
`
|
|
47868
|
+
);
|
|
47869
|
+
noteMarkerAnsweredByRecovery(payload.marker_name);
|
|
47870
|
+
clearPendingMessage(payload.chat_id, recoveryDrainCutoffMs);
|
|
47871
|
+
}
|
|
47872
|
+
removeRecoveryLedgerEntry(RECOVERY_LEDGER_DIR, payload.marker_name);
|
|
47873
|
+
try {
|
|
47874
|
+
unlinkSync9(fullPath);
|
|
47875
|
+
} catch {
|
|
47876
|
+
}
|
|
47877
|
+
return;
|
|
47878
|
+
}
|
|
47879
|
+
}
|
|
47630
47880
|
const ghostReplyMode = resolveGhostReplyMode();
|
|
47631
47881
|
if (ghostReplyMode !== "off") {
|
|
47632
47882
|
const decision = await decideRecovery(text, ghostReplyMode);
|
|
@@ -68,12 +68,12 @@ import {
|
|
|
68
68
|
writeDirectChatSessionState,
|
|
69
69
|
writeEgressAllowlist,
|
|
70
70
|
writePersistentClaudeWrapper
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import "./chunk-
|
|
71
|
+
} from "./chunk-CEJNJ6NF.js";
|
|
72
|
+
import "./chunk-HJWOXFJM.js";
|
|
73
73
|
import "./chunk-HYQ7VOC3.js";
|
|
74
74
|
import "./chunk-6HBXEJHO.js";
|
|
75
75
|
import "./chunk-XWVM4KPK.js";
|
|
76
|
-
import "./chunk-
|
|
76
|
+
import "./chunk-KJ5OCCSJ.js";
|
|
77
77
|
import "./chunk-AIUIMEUS.js";
|
|
78
78
|
import "./chunk-DGUM43GV.js";
|
|
79
79
|
export {
|
|
@@ -147,4 +147,4 @@ export {
|
|
|
147
147
|
writeEgressAllowlist,
|
|
148
148
|
writePersistentClaudeWrapper
|
|
149
149
|
};
|
|
150
|
-
//# sourceMappingURL=persistent-session-
|
|
150
|
+
//# sourceMappingURL=persistent-session-YNHYNCNA.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paneLogPath
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CEJNJ6NF.js";
|
|
4
|
+
import "./chunk-HJWOXFJM.js";
|
|
5
5
|
import "./chunk-HYQ7VOC3.js";
|
|
6
6
|
import "./chunk-6HBXEJHO.js";
|
|
7
7
|
import "./chunk-XWVM4KPK.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-KJ5OCCSJ.js";
|
|
9
9
|
import "./chunk-AIUIMEUS.js";
|
|
10
10
|
import "./chunk-DGUM43GV.js";
|
|
11
11
|
|
|
@@ -804,4 +804,4 @@ export {
|
|
|
804
804
|
readAndResetSlackReplyBindingClassifications,
|
|
805
805
|
readAndResetSlackReplyTargetClassifications
|
|
806
806
|
};
|
|
807
|
-
//# sourceMappingURL=responsiveness-probe-
|
|
807
|
+
//# sourceMappingURL=responsiveness-probe-57RV3U2H.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionTranscriptDir
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-HJWOXFJM.js";
|
|
4
|
+
import "./chunk-KJ5OCCSJ.js";
|
|
5
5
|
import "./chunk-DGUM43GV.js";
|
|
6
6
|
|
|
7
7
|
// src/lib/session-auth-dead.ts
|
|
@@ -205,4 +205,4 @@ export {
|
|
|
205
205
|
decideSessionAuthState,
|
|
206
206
|
probeSessionAuth
|
|
207
207
|
};
|
|
208
|
-
//# sourceMappingURL=session-auth-dead-
|
|
208
|
+
//# sourceMappingURL=session-auth-dead-A3TO2N63.js.map
|