@integrity-labs/agt-cli 0.28.1248 → 0.28.1250
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 +6 -6
- package/dist/{chunk-VGL726BP.js → chunk-5ALBA7KT.js} +73 -18
- package/dist/chunk-5ALBA7KT.js.map +1 -0
- package/dist/{chunk-73NMB6QK.js → chunk-DFJ5E5EW.js} +19 -1
- package/dist/{chunk-73NMB6QK.js.map → chunk-DFJ5E5EW.js.map} +1 -1
- package/dist/{chunk-RSFDRIIC.js → chunk-IUMFAYZO.js} +26 -3
- package/dist/{chunk-RSFDRIIC.js.map → chunk-IUMFAYZO.js.map} +1 -1
- package/dist/{chunk-EKFRF2GR.js → chunk-JOBL3ZF4.js} +2 -2
- package/dist/{chunk-OYLLSEI5.js → chunk-SMD577FW.js} +2 -2
- package/dist/{claude-code-updater-G4Y3CMTI.js → claude-code-updater-5MPOBIWN.js} +3 -3
- package/dist/{claude-pair-runtime-ZGYYBH3G.js → claude-pair-runtime-SNU3CU3K.js} +3 -3
- package/dist/lib/manager-worker.js +331 -104
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +18 -0
- package/dist/mcp/index.js +18 -0
- package/dist/mcp/origami.js +18 -0
- package/dist/mcp/slack-channel.js +18 -0
- package/dist/mcp/telegram-channel.js +205 -1
- package/dist/{persistent-session-R2RY5NJ3.js → persistent-session-SYCA6MW2.js} +4 -4
- package/dist/{responsiveness-probe-MU5WMZSZ.js → responsiveness-probe-BUXWVOSA.js} +4 -4
- package/dist/{session-auth-dead-B6JRV3QH.js → session-auth-dead-G5NHWSRP.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-VGL726BP.js.map +0 -1
- /package/dist/{chunk-EKFRF2GR.js.map → chunk-JOBL3ZF4.js.map} +0 -0
- /package/dist/{chunk-OYLLSEI5.js.map → chunk-SMD577FW.js.map} +0 -0
- /package/dist/{claude-code-updater-G4Y3CMTI.js.map → claude-code-updater-5MPOBIWN.js.map} +0 -0
- /package/dist/{claude-pair-runtime-ZGYYBH3G.js.map → claude-pair-runtime-SNU3CU3K.js.map} +0 -0
- /package/dist/{persistent-session-R2RY5NJ3.js.map → persistent-session-SYCA6MW2.js.map} +0 -0
- /package/dist/{responsiveness-probe-MU5WMZSZ.js.map → responsiveness-probe-BUXWVOSA.js.map} +0 -0
- /package/dist/{session-auth-dead-B6JRV3QH.js.map → session-auth-dead-G5NHWSRP.js.map} +0 -0
|
@@ -46471,6 +46471,24 @@ var FLAG_REGISTRY = [
|
|
|
46471
46471
|
// everywhere it matters.
|
|
46472
46472
|
envVar: "AUGMENTED_CONNECTIVITY_RECONCILE_STATUS"
|
|
46473
46473
|
},
|
|
46474
|
+
{
|
|
46475
|
+
key: "direct-chat-malware-scan",
|
|
46476
|
+
// CodeRabbit on #7501: read stage-wide only (empty scope), so a scoped
|
|
46477
|
+
// override would look armed and do nothing. Turning it off disarms the
|
|
46478
|
+
// upload and download scan, so a change needs explicit confirmation.
|
|
46479
|
+
stageWideOnly: true,
|
|
46480
|
+
sensitive: true,
|
|
46481
|
+
description: "Gate Direct Chat uploads on the GuardDuty Malware Protection for S3 verdict (ENG-11967). When on, verifyDirectChatUploads waits for the GuardDutyMalwareScanStatus tag on each uploaded object and FAILS CLOSED: only NO_THREATS_FOUND is linked to a message; THREATS_FOUND is deleted (it marks every row sharing the object) and raises an upload_malware_detected alert; UNSUPPORTED, ACCESS_DENIED and FAILED are refused but KEPT, because the content-addressed object may back messages already delivered and two of those are our faults, not the file; no tag within the wait budget is refused and kept, so a re-send can pass once the scan lands. ARMING ALSO GATES EVERY DOWNLOAD: the browser mint and the agent poll serve an object only if its GuardDutyMalwareScanStatus tag is NO_THREATS_FOUND, so an attachment stored before the plan existed is refused until a one-off rescan (triggered on first access) tags it clean. In the browser it becomes downloadable once that lands; the agent poll delivers each attachment once, so one untagged at that poll is NEVER delivered to the agent (only a warn line records it). ARM ONLY AFTER the DirectChatUploadsMalwareProtection plan is deployed (GUARDDUTY_MALWARE_SCAN=true): with the flag on and no plan, no object is ever tagged and every upload is refused. ALSO CONFIRM FIRST, on the test stage, that the legacy rescan works: self-copy one untagged object and check it gains a GuardDutyMalwareScanStatus tag within a minute. If it does not, do NOT arm: every attachment stored before the plan stays refused while armed and the rescan cannot restore it. GLOBAL ONLY: evaluated with an empty context, so scoped overrides have no effect.",
|
|
46482
|
+
flagType: "boolean",
|
|
46483
|
+
// Off is the pre-ENG-11967 behaviour: no scan wait, no tag read.
|
|
46484
|
+
// UNLIKE most flags here, a flag-store READ ERROR counts as ON on the SEND
|
|
46485
|
+
// path (see malwareScanArmed in api lib/direct-chat-uploads.ts): the send
|
|
46486
|
+
// is the gate, and an outage must not silently stop scanning. The read
|
|
46487
|
+
// paths (agent poll, download mint) treat a read error as OFF, so a blip
|
|
46488
|
+
// cannot strip a claimed, single-shot message of its files (Obi Wan
|
|
46489
|
+
// edec921a519f); THREATS_FOUND rows stay hidden either way.
|
|
46490
|
+
defaultValue: false
|
|
46491
|
+
},
|
|
46474
46492
|
{
|
|
46475
46493
|
key: "platform-held-key-central-probe",
|
|
46476
46494
|
description: "Arm the scheduled CENTRAL connectivity probe lane for platform-held-key integrations (ENG-10086). These store no customer credential (auth_type none), so the host cannot probe them and reports unverified forever. When on, the hourly PlatformHeldKeyProbe cron runs each central probe that exists (today only ninjafy-notes: org entitlement + broker routing, never note contents) and writes the result through the monitor observation path, so consecutive_connectivity_failures / _ok_cycles move and integration_down alerts can open and close on it. Definitions with no central probe are skipped, never written as a failure. When off the cron reads nothing and writes nothing. Boolean gate; ships dark because a new writer of the escalation counters is a paging change. GLOBAL ONLY: the cron and the host connectivity route both evaluate this flag with an empty context, so an org-, team- or agent-scoped override is stored but has NO effect. Arm it by its global value, not as a staged per-org rollout (Obi Wan 63053d02035e).",
|
package/dist/mcp/index.js
CHANGED
|
@@ -32153,6 +32153,24 @@ var FLAG_REGISTRY = [
|
|
|
32153
32153
|
// everywhere it matters.
|
|
32154
32154
|
envVar: "AUGMENTED_CONNECTIVITY_RECONCILE_STATUS"
|
|
32155
32155
|
},
|
|
32156
|
+
{
|
|
32157
|
+
key: "direct-chat-malware-scan",
|
|
32158
|
+
// CodeRabbit on #7501: read stage-wide only (empty scope), so a scoped
|
|
32159
|
+
// override would look armed and do nothing. Turning it off disarms the
|
|
32160
|
+
// upload and download scan, so a change needs explicit confirmation.
|
|
32161
|
+
stageWideOnly: true,
|
|
32162
|
+
sensitive: true,
|
|
32163
|
+
description: "Gate Direct Chat uploads on the GuardDuty Malware Protection for S3 verdict (ENG-11967). When on, verifyDirectChatUploads waits for the GuardDutyMalwareScanStatus tag on each uploaded object and FAILS CLOSED: only NO_THREATS_FOUND is linked to a message; THREATS_FOUND is deleted (it marks every row sharing the object) and raises an upload_malware_detected alert; UNSUPPORTED, ACCESS_DENIED and FAILED are refused but KEPT, because the content-addressed object may back messages already delivered and two of those are our faults, not the file; no tag within the wait budget is refused and kept, so a re-send can pass once the scan lands. ARMING ALSO GATES EVERY DOWNLOAD: the browser mint and the agent poll serve an object only if its GuardDutyMalwareScanStatus tag is NO_THREATS_FOUND, so an attachment stored before the plan existed is refused until a one-off rescan (triggered on first access) tags it clean. In the browser it becomes downloadable once that lands; the agent poll delivers each attachment once, so one untagged at that poll is NEVER delivered to the agent (only a warn line records it). ARM ONLY AFTER the DirectChatUploadsMalwareProtection plan is deployed (GUARDDUTY_MALWARE_SCAN=true): with the flag on and no plan, no object is ever tagged and every upload is refused. ALSO CONFIRM FIRST, on the test stage, that the legacy rescan works: self-copy one untagged object and check it gains a GuardDutyMalwareScanStatus tag within a minute. If it does not, do NOT arm: every attachment stored before the plan stays refused while armed and the rescan cannot restore it. GLOBAL ONLY: evaluated with an empty context, so scoped overrides have no effect.",
|
|
32164
|
+
flagType: "boolean",
|
|
32165
|
+
// Off is the pre-ENG-11967 behaviour: no scan wait, no tag read.
|
|
32166
|
+
// UNLIKE most flags here, a flag-store READ ERROR counts as ON on the SEND
|
|
32167
|
+
// path (see malwareScanArmed in api lib/direct-chat-uploads.ts): the send
|
|
32168
|
+
// is the gate, and an outage must not silently stop scanning. The read
|
|
32169
|
+
// paths (agent poll, download mint) treat a read error as OFF, so a blip
|
|
32170
|
+
// cannot strip a claimed, single-shot message of its files (Obi Wan
|
|
32171
|
+
// edec921a519f); THREATS_FOUND rows stay hidden either way.
|
|
32172
|
+
defaultValue: false
|
|
32173
|
+
},
|
|
32156
32174
|
{
|
|
32157
32175
|
key: "platform-held-key-central-probe",
|
|
32158
32176
|
description: "Arm the scheduled CENTRAL connectivity probe lane for platform-held-key integrations (ENG-10086). These store no customer credential (auth_type none), so the host cannot probe them and reports unverified forever. When on, the hourly PlatformHeldKeyProbe cron runs each central probe that exists (today only ninjafy-notes: org entitlement + broker routing, never note contents) and writes the result through the monitor observation path, so consecutive_connectivity_failures / _ok_cycles move and integration_down alerts can open and close on it. Definitions with no central probe are skipped, never written as a failure. When off the cron reads nothing and writes nothing. Boolean gate; ships dark because a new writer of the escalation counters is a paging change. GLOBAL ONLY: the cron and the host connectivity route both evaluate this flag with an empty context, so an org-, team- or agent-scoped override is stored but has NO effect. Arm it by its global value, not as a staged per-org rollout (Obi Wan 63053d02035e).",
|
package/dist/mcp/origami.js
CHANGED
|
@@ -45955,6 +45955,24 @@ var FLAG_REGISTRY = [
|
|
|
45955
45955
|
// everywhere it matters.
|
|
45956
45956
|
envVar: "AUGMENTED_CONNECTIVITY_RECONCILE_STATUS"
|
|
45957
45957
|
},
|
|
45958
|
+
{
|
|
45959
|
+
key: "direct-chat-malware-scan",
|
|
45960
|
+
// CodeRabbit on #7501: read stage-wide only (empty scope), so a scoped
|
|
45961
|
+
// override would look armed and do nothing. Turning it off disarms the
|
|
45962
|
+
// upload and download scan, so a change needs explicit confirmation.
|
|
45963
|
+
stageWideOnly: true,
|
|
45964
|
+
sensitive: true,
|
|
45965
|
+
description: "Gate Direct Chat uploads on the GuardDuty Malware Protection for S3 verdict (ENG-11967). When on, verifyDirectChatUploads waits for the GuardDutyMalwareScanStatus tag on each uploaded object and FAILS CLOSED: only NO_THREATS_FOUND is linked to a message; THREATS_FOUND is deleted (it marks every row sharing the object) and raises an upload_malware_detected alert; UNSUPPORTED, ACCESS_DENIED and FAILED are refused but KEPT, because the content-addressed object may back messages already delivered and two of those are our faults, not the file; no tag within the wait budget is refused and kept, so a re-send can pass once the scan lands. ARMING ALSO GATES EVERY DOWNLOAD: the browser mint and the agent poll serve an object only if its GuardDutyMalwareScanStatus tag is NO_THREATS_FOUND, so an attachment stored before the plan existed is refused until a one-off rescan (triggered on first access) tags it clean. In the browser it becomes downloadable once that lands; the agent poll delivers each attachment once, so one untagged at that poll is NEVER delivered to the agent (only a warn line records it). ARM ONLY AFTER the DirectChatUploadsMalwareProtection plan is deployed (GUARDDUTY_MALWARE_SCAN=true): with the flag on and no plan, no object is ever tagged and every upload is refused. ALSO CONFIRM FIRST, on the test stage, that the legacy rescan works: self-copy one untagged object and check it gains a GuardDutyMalwareScanStatus tag within a minute. If it does not, do NOT arm: every attachment stored before the plan stays refused while armed and the rescan cannot restore it. GLOBAL ONLY: evaluated with an empty context, so scoped overrides have no effect.",
|
|
45966
|
+
flagType: "boolean",
|
|
45967
|
+
// Off is the pre-ENG-11967 behaviour: no scan wait, no tag read.
|
|
45968
|
+
// UNLIKE most flags here, a flag-store READ ERROR counts as ON on the SEND
|
|
45969
|
+
// path (see malwareScanArmed in api lib/direct-chat-uploads.ts): the send
|
|
45970
|
+
// is the gate, and an outage must not silently stop scanning. The read
|
|
45971
|
+
// paths (agent poll, download mint) treat a read error as OFF, so a blip
|
|
45972
|
+
// cannot strip a claimed, single-shot message of its files (Obi Wan
|
|
45973
|
+
// edec921a519f); THREATS_FOUND rows stay hidden either way.
|
|
45974
|
+
defaultValue: false
|
|
45975
|
+
},
|
|
45958
45976
|
{
|
|
45959
45977
|
key: "platform-held-key-central-probe",
|
|
45960
45978
|
description: "Arm the scheduled CENTRAL connectivity probe lane for platform-held-key integrations (ENG-10086). These store no customer credential (auth_type none), so the host cannot probe them and reports unverified forever. When on, the hourly PlatformHeldKeyProbe cron runs each central probe that exists (today only ninjafy-notes: org entitlement + broker routing, never note contents) and writes the result through the monitor observation path, so consecutive_connectivity_failures / _ok_cycles move and integration_down alerts can open and close on it. Definitions with no central probe are skipped, never written as a failure. When off the cron reads nothing and writes nothing. Boolean gate; ships dark because a new writer of the escalation counters is a paging change. GLOBAL ONLY: the cron and the host connectivity route both evaluate this flag with an empty context, so an org-, team- or agent-scoped override is stored but has NO effect. Arm it by its global value, not as a staged per-org rollout (Obi Wan 63053d02035e).",
|
|
@@ -40810,6 +40810,24 @@ var FLAG_REGISTRY = [
|
|
|
40810
40810
|
// everywhere it matters.
|
|
40811
40811
|
envVar: "AUGMENTED_CONNECTIVITY_RECONCILE_STATUS"
|
|
40812
40812
|
},
|
|
40813
|
+
{
|
|
40814
|
+
key: "direct-chat-malware-scan",
|
|
40815
|
+
// CodeRabbit on #7501: read stage-wide only (empty scope), so a scoped
|
|
40816
|
+
// override would look armed and do nothing. Turning it off disarms the
|
|
40817
|
+
// upload and download scan, so a change needs explicit confirmation.
|
|
40818
|
+
stageWideOnly: true,
|
|
40819
|
+
sensitive: true,
|
|
40820
|
+
description: "Gate Direct Chat uploads on the GuardDuty Malware Protection for S3 verdict (ENG-11967). When on, verifyDirectChatUploads waits for the GuardDutyMalwareScanStatus tag on each uploaded object and FAILS CLOSED: only NO_THREATS_FOUND is linked to a message; THREATS_FOUND is deleted (it marks every row sharing the object) and raises an upload_malware_detected alert; UNSUPPORTED, ACCESS_DENIED and FAILED are refused but KEPT, because the content-addressed object may back messages already delivered and two of those are our faults, not the file; no tag within the wait budget is refused and kept, so a re-send can pass once the scan lands. ARMING ALSO GATES EVERY DOWNLOAD: the browser mint and the agent poll serve an object only if its GuardDutyMalwareScanStatus tag is NO_THREATS_FOUND, so an attachment stored before the plan existed is refused until a one-off rescan (triggered on first access) tags it clean. In the browser it becomes downloadable once that lands; the agent poll delivers each attachment once, so one untagged at that poll is NEVER delivered to the agent (only a warn line records it). ARM ONLY AFTER the DirectChatUploadsMalwareProtection plan is deployed (GUARDDUTY_MALWARE_SCAN=true): with the flag on and no plan, no object is ever tagged and every upload is refused. ALSO CONFIRM FIRST, on the test stage, that the legacy rescan works: self-copy one untagged object and check it gains a GuardDutyMalwareScanStatus tag within a minute. If it does not, do NOT arm: every attachment stored before the plan stays refused while armed and the rescan cannot restore it. GLOBAL ONLY: evaluated with an empty context, so scoped overrides have no effect.",
|
|
40821
|
+
flagType: "boolean",
|
|
40822
|
+
// Off is the pre-ENG-11967 behaviour: no scan wait, no tag read.
|
|
40823
|
+
// UNLIKE most flags here, a flag-store READ ERROR counts as ON on the SEND
|
|
40824
|
+
// path (see malwareScanArmed in api lib/direct-chat-uploads.ts): the send
|
|
40825
|
+
// is the gate, and an outage must not silently stop scanning. The read
|
|
40826
|
+
// paths (agent poll, download mint) treat a read error as OFF, so a blip
|
|
40827
|
+
// cannot strip a claimed, single-shot message of its files (Obi Wan
|
|
40828
|
+
// edec921a519f); THREATS_FOUND rows stay hidden either way.
|
|
40829
|
+
defaultValue: false
|
|
40830
|
+
},
|
|
40813
40831
|
{
|
|
40814
40832
|
key: "platform-held-key-central-probe",
|
|
40815
40833
|
description: "Arm the scheduled CENTRAL connectivity probe lane for platform-held-key integrations (ENG-10086). These store no customer credential (auth_type none), so the host cannot probe them and reports unverified forever. When on, the hourly PlatformHeldKeyProbe cron runs each central probe that exists (today only ninjafy-notes: org entitlement + broker routing, never note contents) and writes the result through the monitor observation path, so consecutive_connectivity_failures / _ok_cycles move and integration_down alerts can open and close on it. Definitions with no central probe are skipped, never written as a failure. When off the cron reads nothing and writes nothing. Boolean gate; ships dark because a new writer of the escalation counters is a paging change. GLOBAL ONLY: the cron and the host connectivity route both evaluate this flag with an empty context, so an org-, team- or agent-scoped override is stored but has NO effect. Arm it by its global value, not as a staged per-org rollout (Obi Wan 63053d02035e).",
|
|
@@ -31013,6 +31013,99 @@ async function claimTelegramLinkCode(post, input, timeoutMs = LINK_CLAIM_TIMEOUT
|
|
|
31013
31013
|
}
|
|
31014
31014
|
var LINK_CLAIMED_REPLY = "Got it - go back to the setup screen to finish linking this Telegram account.";
|
|
31015
31015
|
|
|
31016
|
+
// ../core/dist/channels/telegram-group-link.js
|
|
31017
|
+
var GROUP_START_WITH_CODE_RE = /^\/start(?:@[A-Za-z0-9_]{1,64})?\s+(gk_[A-Za-z0-9_-]{22})$/;
|
|
31018
|
+
function isTelegramGroupChatType(chatType) {
|
|
31019
|
+
return chatType === "group" || chatType === "supergroup";
|
|
31020
|
+
}
|
|
31021
|
+
function parseTelegramGroupLinkStart(input) {
|
|
31022
|
+
if (!isTelegramGroupChatType(input.chatType))
|
|
31023
|
+
return null;
|
|
31024
|
+
if (input.isBot === true)
|
|
31025
|
+
return null;
|
|
31026
|
+
if (typeof input.text !== "string")
|
|
31027
|
+
return null;
|
|
31028
|
+
const match = GROUP_START_WITH_CODE_RE.exec(input.text.trim());
|
|
31029
|
+
return match ? match[1] : null;
|
|
31030
|
+
}
|
|
31031
|
+
function classifyTelegramBotGroupStatus(status) {
|
|
31032
|
+
switch (status) {
|
|
31033
|
+
case "creator":
|
|
31034
|
+
case "administrator":
|
|
31035
|
+
return "admin";
|
|
31036
|
+
case "member":
|
|
31037
|
+
return "member";
|
|
31038
|
+
case "restricted":
|
|
31039
|
+
return "restricted";
|
|
31040
|
+
case "left":
|
|
31041
|
+
case "kicked":
|
|
31042
|
+
return "gone";
|
|
31043
|
+
default:
|
|
31044
|
+
return "unknown";
|
|
31045
|
+
}
|
|
31046
|
+
}
|
|
31047
|
+
|
|
31048
|
+
// src/telegram-group-link.ts
|
|
31049
|
+
var GROUP_LINK_TIMEOUT_MS = 5e3;
|
|
31050
|
+
async function postWithTimeout(post, path, body, timeoutMs) {
|
|
31051
|
+
let timer;
|
|
31052
|
+
const timeout = new Promise((resolve3) => {
|
|
31053
|
+
timer = setTimeout(() => resolve3(null), timeoutMs);
|
|
31054
|
+
});
|
|
31055
|
+
try {
|
|
31056
|
+
return await Promise.race([post(path, body), timeout]);
|
|
31057
|
+
} catch {
|
|
31058
|
+
return null;
|
|
31059
|
+
} finally {
|
|
31060
|
+
if (timer) clearTimeout(timer);
|
|
31061
|
+
}
|
|
31062
|
+
}
|
|
31063
|
+
async function claimTelegramGroupLinkCode(post, input, timeoutMs = GROUP_LINK_TIMEOUT_MS) {
|
|
31064
|
+
const res = await postWithTimeout(
|
|
31065
|
+
post,
|
|
31066
|
+
"/host/telegram-link/group-claim",
|
|
31067
|
+
{
|
|
31068
|
+
agent_id: input.agentId,
|
|
31069
|
+
code: input.code,
|
|
31070
|
+
chat_id: input.chatId,
|
|
31071
|
+
chat_type: input.chatType,
|
|
31072
|
+
...input.chatTitle ? { chat_title: input.chatTitle } : {},
|
|
31073
|
+
...input.fromId ? { from_id: input.fromId } : {},
|
|
31074
|
+
...input.firstName ? { first_name: input.firstName } : {},
|
|
31075
|
+
...input.lastName ? { last_name: input.lastName } : {}
|
|
31076
|
+
},
|
|
31077
|
+
timeoutMs
|
|
31078
|
+
);
|
|
31079
|
+
if (!res || res.status < 200 || res.status >= 300) return false;
|
|
31080
|
+
return res.json?.ok === true;
|
|
31081
|
+
}
|
|
31082
|
+
async function reportTelegramGroupMigration(post, input, timeoutMs = GROUP_LINK_TIMEOUT_MS) {
|
|
31083
|
+
const res = await postWithTimeout(
|
|
31084
|
+
post,
|
|
31085
|
+
"/host/telegram-link/group-migrate",
|
|
31086
|
+
{ agent_id: input.agentId, from_chat_id: input.fromChatId, to_chat_id: input.toChatId },
|
|
31087
|
+
timeoutMs
|
|
31088
|
+
);
|
|
31089
|
+
if (!res || res.status < 200 || res.status >= 300) return false;
|
|
31090
|
+
return res.json?.ok === true;
|
|
31091
|
+
}
|
|
31092
|
+
var GROUP_CLAIMED_REPLY = "Thanks for adding me. Go back to the setup screen to finish: I will answer here once it is confirmed.";
|
|
31093
|
+
function observedChatFromMembership(update) {
|
|
31094
|
+
if (!isTelegramGroupChatType(update.chat?.type)) return null;
|
|
31095
|
+
const access = classifyTelegramBotGroupStatus(update.new_chat_member?.status);
|
|
31096
|
+
if (access !== "admin" && access !== "member" && access !== "restricted") return null;
|
|
31097
|
+
return {
|
|
31098
|
+
chat_id: String(update.chat.id),
|
|
31099
|
+
chat_title: typeof update.chat.title === "string" ? update.chat.title : null,
|
|
31100
|
+
chat_type: update.chat.type
|
|
31101
|
+
};
|
|
31102
|
+
}
|
|
31103
|
+
function applyMigrationToAllowlist(allowed, fromChatId, toChatId) {
|
|
31104
|
+
if (!allowed.has(fromChatId) || allowed.has(toChatId)) return false;
|
|
31105
|
+
allowed.add(toChatId);
|
|
31106
|
+
return true;
|
|
31107
|
+
}
|
|
31108
|
+
|
|
31016
31109
|
// ../core/dist/channels/governance/telegram-chat-type.js
|
|
31017
31110
|
function isTelegramPrivateChat(chatType) {
|
|
31018
31111
|
return chatType === "private";
|
|
@@ -41001,6 +41094,24 @@ var FLAG_REGISTRY = [
|
|
|
41001
41094
|
// everywhere it matters.
|
|
41002
41095
|
envVar: "AUGMENTED_CONNECTIVITY_RECONCILE_STATUS"
|
|
41003
41096
|
},
|
|
41097
|
+
{
|
|
41098
|
+
key: "direct-chat-malware-scan",
|
|
41099
|
+
// CodeRabbit on #7501: read stage-wide only (empty scope), so a scoped
|
|
41100
|
+
// override would look armed and do nothing. Turning it off disarms the
|
|
41101
|
+
// upload and download scan, so a change needs explicit confirmation.
|
|
41102
|
+
stageWideOnly: true,
|
|
41103
|
+
sensitive: true,
|
|
41104
|
+
description: "Gate Direct Chat uploads on the GuardDuty Malware Protection for S3 verdict (ENG-11967). When on, verifyDirectChatUploads waits for the GuardDutyMalwareScanStatus tag on each uploaded object and FAILS CLOSED: only NO_THREATS_FOUND is linked to a message; THREATS_FOUND is deleted (it marks every row sharing the object) and raises an upload_malware_detected alert; UNSUPPORTED, ACCESS_DENIED and FAILED are refused but KEPT, because the content-addressed object may back messages already delivered and two of those are our faults, not the file; no tag within the wait budget is refused and kept, so a re-send can pass once the scan lands. ARMING ALSO GATES EVERY DOWNLOAD: the browser mint and the agent poll serve an object only if its GuardDutyMalwareScanStatus tag is NO_THREATS_FOUND, so an attachment stored before the plan existed is refused until a one-off rescan (triggered on first access) tags it clean. In the browser it becomes downloadable once that lands; the agent poll delivers each attachment once, so one untagged at that poll is NEVER delivered to the agent (only a warn line records it). ARM ONLY AFTER the DirectChatUploadsMalwareProtection plan is deployed (GUARDDUTY_MALWARE_SCAN=true): with the flag on and no plan, no object is ever tagged and every upload is refused. ALSO CONFIRM FIRST, on the test stage, that the legacy rescan works: self-copy one untagged object and check it gains a GuardDutyMalwareScanStatus tag within a minute. If it does not, do NOT arm: every attachment stored before the plan stays refused while armed and the rescan cannot restore it. GLOBAL ONLY: evaluated with an empty context, so scoped overrides have no effect.",
|
|
41105
|
+
flagType: "boolean",
|
|
41106
|
+
// Off is the pre-ENG-11967 behaviour: no scan wait, no tag read.
|
|
41107
|
+
// UNLIKE most flags here, a flag-store READ ERROR counts as ON on the SEND
|
|
41108
|
+
// path (see malwareScanArmed in api lib/direct-chat-uploads.ts): the send
|
|
41109
|
+
// is the gate, and an outage must not silently stop scanning. The read
|
|
41110
|
+
// paths (agent poll, download mint) treat a read error as OFF, so a blip
|
|
41111
|
+
// cannot strip a claimed, single-shot message of its files (Obi Wan
|
|
41112
|
+
// edec921a519f); THREATS_FOUND rows stay hidden either way.
|
|
41113
|
+
defaultValue: false
|
|
41114
|
+
},
|
|
41004
41115
|
{
|
|
41005
41116
|
key: "platform-held-key-central-probe",
|
|
41006
41117
|
description: "Arm the scheduled CENTRAL connectivity probe lane for platform-held-key integrations (ENG-10086). These store no customer credential (auth_type none), so the host cannot probe them and reports unverified forever. When on, the hourly PlatformHeldKeyProbe cron runs each central probe that exists (today only ninjafy-notes: org entitlement + broker routing, never note contents) and writes the result through the monitor observation path, so consecutive_connectivity_failures / _ok_cycles move and integration_down alerts can open and close on it. Definitions with no central probe are skipped, never written as a failure. When off the cron reads nothing and writes nothing. Boolean gate; ships dark because a new writer of the escalation counters is a paging change. GLOBAL ONLY: the cron and the host connectivity route both evaluate this flag with an empty context, so an org-, team- or agent-scoped override is stored but has NO effect. Arm it by its global value, not as a staged per-org rollout (Obi Wan 63053d02035e).",
|
|
@@ -48937,6 +49048,47 @@ async function claimLinkCodeViaApi(code2, chatId, from) {
|
|
|
48937
49048
|
}
|
|
48938
49049
|
);
|
|
48939
49050
|
}
|
|
49051
|
+
async function claimGroupLinkCodeViaApi(code2, chat, from) {
|
|
49052
|
+
if (!channelRequestInputAvailable()) return false;
|
|
49053
|
+
const apiCallRuntime = await Promise.resolve().then(() => (init_ask_user_runtime(), ask_user_runtime_exports));
|
|
49054
|
+
const cfg = {
|
|
49055
|
+
apiHost: AGT_HOST,
|
|
49056
|
+
apiKey: AGT_API_KEY,
|
|
49057
|
+
agentId: AGT_AGENT_ID
|
|
49058
|
+
};
|
|
49059
|
+
return claimTelegramGroupLinkCode(
|
|
49060
|
+
async (path, body) => {
|
|
49061
|
+
const res = await apiCallRuntime.apiCall(cfg, "POST", path, body);
|
|
49062
|
+
return { status: res.status, json: await res.json().catch(() => null) };
|
|
49063
|
+
},
|
|
49064
|
+
{
|
|
49065
|
+
agentId: cfg.agentId,
|
|
49066
|
+
code: code2,
|
|
49067
|
+
chatId: String(chat.id),
|
|
49068
|
+
chatType: chat.type,
|
|
49069
|
+
chatTitle: chat.title,
|
|
49070
|
+
fromId: from ? String(from.id) : void 0,
|
|
49071
|
+
firstName: from?.first_name,
|
|
49072
|
+
lastName: from?.last_name
|
|
49073
|
+
}
|
|
49074
|
+
);
|
|
49075
|
+
}
|
|
49076
|
+
async function reportGroupMigrationViaApi(fromChatId, toChatId) {
|
|
49077
|
+
if (!channelRequestInputAvailable()) return false;
|
|
49078
|
+
const apiCallRuntime = await Promise.resolve().then(() => (init_ask_user_runtime(), ask_user_runtime_exports));
|
|
49079
|
+
const cfg = {
|
|
49080
|
+
apiHost: AGT_HOST,
|
|
49081
|
+
apiKey: AGT_API_KEY,
|
|
49082
|
+
agentId: AGT_AGENT_ID
|
|
49083
|
+
};
|
|
49084
|
+
return reportTelegramGroupMigration(
|
|
49085
|
+
async (path, body) => {
|
|
49086
|
+
const res = await apiCallRuntime.apiCall(cfg, "POST", path, body);
|
|
49087
|
+
return { status: res.status, json: await res.json().catch(() => null) };
|
|
49088
|
+
},
|
|
49089
|
+
{ agentId: cfg.agentId, fromChatId, toChatId }
|
|
49090
|
+
);
|
|
49091
|
+
}
|
|
48940
49092
|
async function postPerfReviewResolve(reviewId, token, respondedByUser, comment) {
|
|
48941
49093
|
if (!channelRequestInputAvailable()) return false;
|
|
48942
49094
|
const apiCallRuntime = await Promise.resolve().then(() => (init_ask_user_runtime(), ask_user_runtime_exports));
|
|
@@ -49214,7 +49366,10 @@ async function pollLoop() {
|
|
|
49214
49366
|
// `channel_request_input`. Without it the buttons render fine
|
|
49215
49367
|
// but Telegram silently drops the tap and the agent's polling
|
|
49216
49368
|
// loop times out as if no-one ever pressed anything.
|
|
49217
|
-
|
|
49369
|
+
//
|
|
49370
|
+
// ENG-11923: `my_chat_member` tells us the bot was added to a group,
|
|
49371
|
+
// so the console can offer that group even while it is barred.
|
|
49372
|
+
allowed_updates: ["message", "callback_query", "my_chat_member"]
|
|
49218
49373
|
},
|
|
49219
49374
|
POLL_HTTP_TIMEOUT_MS
|
|
49220
49375
|
);
|
|
@@ -49239,8 +49394,30 @@ async function pollLoop() {
|
|
|
49239
49394
|
});
|
|
49240
49395
|
continue;
|
|
49241
49396
|
}
|
|
49397
|
+
if (update.my_chat_member) {
|
|
49398
|
+
const observed = observedChatFromMembership(update.my_chat_member);
|
|
49399
|
+
if (observed) {
|
|
49400
|
+
observedChatClient?.observe(observed);
|
|
49401
|
+
process.stderr.write(
|
|
49402
|
+
`telegram-channel(${AGENT_CODE_NAME}): bot membership chat=${redactId(observed.chat_id)} status=${update.my_chat_member.new_chat_member?.status ?? "unknown"}
|
|
49403
|
+
`
|
|
49404
|
+
);
|
|
49405
|
+
}
|
|
49406
|
+
continue;
|
|
49407
|
+
}
|
|
49242
49408
|
const msg = update.message;
|
|
49243
49409
|
if (!msg) continue;
|
|
49410
|
+
if (typeof msg.migrate_to_chat_id === "number") {
|
|
49411
|
+
const fromChatId = String(msg.chat.id);
|
|
49412
|
+
const toChatId = String(msg.migrate_to_chat_id);
|
|
49413
|
+
const admittedNow = applyMigrationToAllowlist(ALLOWED_CHATS, fromChatId, toChatId);
|
|
49414
|
+
const reported = await reportGroupMigrationViaApi(fromChatId, toChatId);
|
|
49415
|
+
process.stderr.write(
|
|
49416
|
+
`telegram-channel(${AGENT_CODE_NAME}): group migrated ${redactId(fromChatId)} -> ${redactId(toChatId)} admitted_now=${admittedNow} reported=${reported}
|
|
49417
|
+
`
|
|
49418
|
+
);
|
|
49419
|
+
continue;
|
|
49420
|
+
}
|
|
49244
49421
|
const classifiedAttachments = classifyTelegramAttachments(msg);
|
|
49245
49422
|
const content = typeof msg.text === "string" && msg.text.length > 0 ? msg.text : typeof msg.caption === "string" && msg.caption.length > 0 ? msg.caption : "";
|
|
49246
49423
|
if (content.length === 0 && classifiedAttachments.length === 0) continue;
|
|
@@ -49253,6 +49430,33 @@ async function pollLoop() {
|
|
|
49253
49430
|
continue;
|
|
49254
49431
|
}
|
|
49255
49432
|
const chatId = String(msg.chat.id);
|
|
49433
|
+
const groupCode = parseTelegramGroupLinkStart({ chatType: msg.chat.type, isBot: msg.from?.is_bot, text: msg.text });
|
|
49434
|
+
if (groupCode) {
|
|
49435
|
+
if (await claimGroupLinkCodeViaApi(groupCode, msg.chat, msg.from)) {
|
|
49436
|
+
process.stderr.write(
|
|
49437
|
+
`telegram-channel(${AGENT_CODE_NAME}): group-link claimed chat=${redactId(chatId)}
|
|
49438
|
+
`
|
|
49439
|
+
);
|
|
49440
|
+
telegramApiCall("sendMessage", { chat_id: msg.chat.id, text: GROUP_CLAIMED_REPLY }, 1e4).then((resp2) => {
|
|
49441
|
+
if (resp2.ok !== true) {
|
|
49442
|
+
process.stderr.write(
|
|
49443
|
+
`telegram-channel(${AGENT_CODE_NAME}): group-link reply failed chat=${redactId(chatId)}: ${resp2.description ?? "unknown"}
|
|
49444
|
+
`
|
|
49445
|
+
);
|
|
49446
|
+
}
|
|
49447
|
+
}).catch((err) => {
|
|
49448
|
+
process.stderr.write(
|
|
49449
|
+
`telegram-channel(${AGENT_CODE_NAME}): group-link reply threw chat=${redactId(chatId)}: ${err.message}
|
|
49450
|
+
`
|
|
49451
|
+
);
|
|
49452
|
+
});
|
|
49453
|
+
continue;
|
|
49454
|
+
}
|
|
49455
|
+
process.stderr.write(
|
|
49456
|
+
`telegram-channel(${AGENT_CODE_NAME}): group-link not claimed chat=${redactId(chatId)}, falling through
|
|
49457
|
+
`
|
|
49458
|
+
);
|
|
49459
|
+
}
|
|
49256
49460
|
const linkCode = parseTelegramLinkStart({ chatType: msg.chat.type, isBot: msg.from?.is_bot, text: msg.text });
|
|
49257
49461
|
if (linkCode) {
|
|
49258
49462
|
if (await claimLinkCodeViaApi(linkCode, chatId, msg.from)) {
|
|
@@ -68,12 +68,12 @@ import {
|
|
|
68
68
|
writeDirectChatSessionState,
|
|
69
69
|
writeEgressAllowlist,
|
|
70
70
|
writePersistentClaudeWrapper
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import "./chunk-
|
|
71
|
+
} from "./chunk-IUMFAYZO.js";
|
|
72
|
+
import "./chunk-SMD577FW.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-DFJ5E5EW.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-SYCA6MW2.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paneLogPath
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-IUMFAYZO.js";
|
|
4
|
+
import "./chunk-SMD577FW.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-DFJ5E5EW.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-BUXWVOSA.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionTranscriptDir
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-SMD577FW.js";
|
|
4
|
+
import "./chunk-DFJ5E5EW.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-G5NHWSRP.js.map
|