remoteclaw 0.2.0 → 0.2.1
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/{accounts-Qulj3jS8.js → accounts-B0V43QEN.js} +1 -1
- package/dist/{accounts-PoAEsvXo.js → accounts-DObM4hAF.js} +2 -2
- package/dist/{accounts-C_7Xc5wa.js → accounts-DZ4c6f7x.js} +1 -1
- package/dist/{active-listener-nMUQ-dVt.js → active-listener-DVLYzYd3.js} +1 -1
- package/dist/{agent-O04J-JEw.js → agent-B2leLOo0.js} +377 -355
- package/dist/{agent-scope-wbu0VZoq.js → agent-scope-CYJrXxD6.js} +1 -1
- package/dist/{agents-BbQIzW1N.js → agents-Eg0_nSnn.js} +1 -1
- package/dist/{banner-DONy2WbW.js → banner-B52X-rEb.js} +1 -1
- package/dist/{bindings-0dx8vqz9.js → bindings-AUVd82yI.js} +2 -2
- package/dist/boot/handler.js +46 -46
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-activity-D47P56pj.js → channel-activity-Bydtz0cv.js} +2 -2
- package/dist/{channel-options-DWOSBsjN.js → channel-options-CD6ZBbON.js} +1 -1
- package/dist/{channel-options-JoYluwGr.js → channel-options-h1pCAx0w.js} +1 -1
- package/dist/{channel-web-YLHk99fU.js → channel-web-DbNWyl5A.js} +2 -2
- package/dist/{channel-web-Cvf5FKyf.js → channel-web-FA7MGFJO.js} +2 -2
- package/dist/{channels-cli-Be0_n1L2.js → channels-cli-BIArqz2T.js} +9 -9
- package/dist/{channels-cli-BoDA0aQ1.js → channels-cli-BZ5sRWaP.js} +9 -9
- package/dist/{chunk-C5Oai9vm.js → chunk-0ZB8yVlw.js} +1 -1
- package/dist/{cli-BEOzFl_6.js → cli-C8XFOFxS.js} +5 -5
- package/dist/{cli-D1ORFJ6n.js → cli-ifZiERUK.js} +5 -5
- package/dist/command-logger/handler.js +1 -1
- package/dist/{command-registry-D6LIEhaY.js → command-registry-kxjFHjjE.js} +9 -9
- package/dist/{commands-registry-CB3qR3Ui.js → commands-registry-BQrQnwzJ.js} +3 -3
- package/dist/{completion-cli-ohSjYC4v.js → completion-cli-eH6YXa0H.js} +1 -1
- package/dist/{completion-cli-D93-g9B7.js → completion-cli-wYa36YaL.js} +2 -2
- package/dist/{config-Ca5Dfk8O.js → config-BIrnJuXL.js} +8 -8
- package/dist/{config-cli-CJ1S3_VC.js → config-cli-BfJacpda.js} +1 -1
- package/dist/{config-cli-uJUr7Pe-.js → config-cli-CkJFUL61.js} +1 -1
- package/dist/{configure-CXjIsq-V.js → configure-C9cTz03s.js} +2 -2
- package/dist/{configure-BAlORoYU.js → configure-Dh-yP8hn.js} +2 -2
- package/dist/{deliver-BGpFaGMz.js → deliver-B5eZoNwr.js} +2 -2
- package/dist/{deliver-D3lJfcWr.js → deliver-Cu2kD7-u.js} +2 -2
- package/dist/{deliver-BTjGqSGN.js → deliver-z04wZfnQ.js} +8 -8
- package/dist/{dock-C0qWBS5h.js → dock-BQ3iSblF.js} +5 -5
- package/dist/{doctor-completion-CKGabXFn.js → doctor-completion-Cz3-0qwJ.js} +1 -1
- package/dist/{doctor-completion-Bo9yo8-v.js → doctor-completion-D6DqtWrm.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/{env-Bs-DOhs6.js → env-D3fELH5B.js} +1 -1
- package/dist/{errors-bgTXk4n7.js → errors-Bg7BK273.js} +1 -1
- package/dist/extensionAPI.js +23 -1
- package/dist/{fetch-C-q-x9xS.js → fetch--eFpeNac.js} +3 -3
- package/dist/{fetch-B_D1a6ac.js → fetch-C3R1kkzO.js} +1 -1
- package/dist/{gateway-cli-DC1V6Fdf.js → gateway-cli-DuMZZmMm.js} +23 -14
- package/dist/{gateway-cli-CUPV9YIf.js → gateway-cli-ZPbldBb7.js} +23 -14
- package/dist/{health-D5YyZkng.js → health-6NZ23ZCc.js} +5 -5
- package/dist/{health-uTVcqwOx.js → health-D6T18gwU.js} +5 -5
- package/dist/{heartbeat-visibility-Z_3IqRgn.js → heartbeat-visibility-CXLlnSbK.js} +1 -1
- package/dist/{heartbeat-visibility-GeWWsF3e.js → heartbeat-visibility-CksK28e2.js} +1 -1
- package/dist/{hook-runner-global-D8bMcDPD.js → hook-runner-global-DPdZsDAH.js} +1 -1
- package/dist/{hooks-cli-DToXVDBQ.js → hooks-cli-CQAdRG0h.js} +6 -6
- package/dist/{hooks-cli-CpWC6lUu.js → hooks-cli-c8IB_ozo.js} +6 -6
- package/dist/{image-ops-CAVojpnw.js → image-ops-CD4YRYFY.js} +2 -2
- package/dist/index.js +10 -10
- package/dist/{ir-CDjoXuIW.js → ir-BK7K3Bbu.js} +6 -6
- package/dist/{logger-Bp0X6yHd.js → logger-BKFID___.js} +1 -1
- package/dist/{login-DWKSrC5K.js → login-BYHOjw55.js} +6 -6
- package/dist/{login-qr-C7zaGKxz.js → login-qr-ZRBRz2BA.js} +8 -8
- package/dist/{markdown-tables-Bm7xJUcn.js → markdown-tables-CfM1ner1.js} +1 -1
- package/dist/{message-action-names-y0-o46BN.js → message-action-names-AEii-fdA.js} +5 -5
- package/dist/{message-action-names-PbKqmcBa.js → message-action-names-CPJVqkJL.js} +5 -5
- package/dist/{message-channel-BuWy8hEk.js → message-channel-tSSi5C96.js} +1 -1
- package/dist/{npm-resolution-BLL-hroo.js → npm-resolution-C6jVPSqS.js} +1 -1
- package/dist/{npm-resolution-o9lE9iRL.js → npm-resolution-CdEbWlwy.js} +1 -1
- package/dist/{onboard-BohVFYna.js → onboard-CVpITzvB.js} +2 -2
- package/dist/{onboard-channels-DMgpmtQu.js → onboard-channels-D664lpQl.js} +1 -1
- package/dist/{onboard-channels-DzuidyBQ.js → onboard-channels-DReWe-Pi.js} +1 -1
- package/dist/{onboard-BKfLjwEp.js → onboard-zh78fAIB.js} +2 -2
- package/dist/{onboarding-sWcrQljf.js → onboarding-BnS6FhcE.js} +3 -3
- package/dist/{onboarding-BLgEs3xo.js → onboarding-CCahs79c.js} +3 -3
- package/dist/{onboarding.finalize-D5VLM268.js → onboarding.finalize-CmYoFs6n.js} +9 -9
- package/dist/{onboarding.finalize-CLmpb0fB.js → onboarding.finalize-uTFFUZ8O.js} +10 -10
- package/dist/{onboarding.gateway-config-DsTEqzPz.js → onboarding.gateway-config-DQX6SBU8.js} +1 -1
- package/dist/{onboarding.gateway-config-D-ZMefuj.js → onboarding.gateway-config-DYjDeKEw.js} +1 -1
- package/dist/{outbound-CCvRhb_6.js → outbound-BCY7cG5r.js} +6 -6
- package/dist/{outbound-attachment-BXwueqll.js → outbound-attachment-6NNNORlp.js} +3 -3
- package/dist/{plugin-registry-C-OlCiRd.js → plugin-registry-BC1RH6cl.js} +1 -1
- package/dist/{plugin-registry-LBCvRwK8.js → plugin-registry-TC2kC2iG.js} +1 -1
- package/dist/plugin-sdk/agents/session-run-registry.d.ts +36 -0
- package/dist/plugin-sdk/{channel-web-CM3jOFIe.js → channel-web-DSYJDq30.js} +4 -4
- package/dist/plugin-sdk/{deliver-DOBaX9a2.js → deliver-BzPIWEw5.js} +1 -1
- package/dist/plugin-sdk/index.js +5 -5
- package/dist/plugin-sdk/{reply-sVftK2Ge.js → reply-Dzts0EiK.js} +22 -8
- package/dist/plugin-sdk/{reply-payloads-DybMtW8a.js → reply-payloads-DwsjAWzB.js} +7 -1
- package/dist/plugin-sdk/{subagent-registry-BfxxwQv4.js → subagent-registry-DrBYYinw.js} +221 -5
- package/dist/plugin-sdk/web-afnwTWMq.js +7 -0
- package/dist/{plugins-cli-DCkrm_Bp.js → plugins-cli-CModgvwT.js} +6 -6
- package/dist/{plugins-cli-ChGSPhWr.js → plugins-cli-CpdkQdKD.js} +6 -6
- package/dist/{plugins-ODda1fNU.js → plugins-sjrWIkqk.js} +4 -4
- package/dist/{preflight-B9B3VBaW.js → preflight-a80t-iPi.js} +63 -63
- package/dist/{program-DYx2DvMr.js → program-BlZGbNe5.js} +11 -11
- package/dist/{program-context-B_oA8k9e.js → program-context-BVx30291.js} +16 -16
- package/dist/{prompt-select-styled-tATNv5wG.js → prompt-select-styled-Bqov4T-S.js} +4 -4
- package/dist/{prompt-select-styled-CHuBVQoF.js → prompt-select-styled-CtPeDmXo.js} +4 -4
- package/dist/{provider-dispatcher-CaVZ8Nhx.js → provider-dispatcher-BD5K64cR.js} +44 -22
- package/dist/{redact-DUvSdQvv.js → redact-D2_cayCv.js} +1 -1
- package/dist/{register.agent-mJGdqH4r.js → register.agent-B89Ymzwt.js} +8 -8
- package/dist/{register.agent-CAkJcVgr.js → register.agent-CuhMDT3t.js} +7 -7
- package/dist/{register.configure-BhkIDDW5.js → register.configure-C8WcdyT6.js} +9 -9
- package/dist/{register.configure-DvwKyrwL.js → register.configure-b8Ic06Uw.js} +9 -9
- package/dist/{register.maintenance-CKwKHDhS.js → register.maintenance-BlMuoELU.js} +11 -11
- package/dist/{register.maintenance-vpQOTI6u.js → register.maintenance-D5RP4wO6.js} +10 -10
- package/dist/{register.message-h_ydGqf0.js → register.message-CSeNrxdd.js} +7 -7
- package/dist/{register.message-NSrj_UY0.js → register.message-D7jdDTte.js} +7 -7
- package/dist/{register.onboard-C08IBU41.js → register.onboard-CRiXHw0n.js} +3 -3
- package/dist/{register.onboard-CcOONokP.js → register.onboard-Dj8wICC1.js} +3 -3
- package/dist/{register.setup-BHbQcv1_.js → register.setup-8gos4jqr.js} +3 -3
- package/dist/{register.setup-JYGpPbA2.js → register.setup-C_-8vfKv.js} +3 -3
- package/dist/{register.status-health-sessions-CAVFepVm.js → register.status-health-sessions-CrCsnTEq.js} +9 -9
- package/dist/{register.status-health-sessions-CV4R4Fe2.js → register.status-health-sessions-Df9SxgpH.js} +8 -8
- package/dist/{register.subclis-pRE159Cu.js → register.subclis-CxT7d8Bs.js} +8 -8
- package/dist/{replies-Cu8SG6CK.js → replies-Dsu1hdd7.js} +3 -3
- package/dist/{reply-DqJBHDn_.js → reply-Ccq9RRYF.js} +44 -22
- package/dist/{reply-payloads-DbQW7c5s.js → reply-payloads-DwEnDy7C.js} +4 -4
- package/dist/{reply-payloads-C4mbcSP-.js → reply-payloads-KYLwM629.js} +1 -1
- package/dist/{reply-prefix-DwJ8gxoz.js → reply-prefix-DtQ_7Eac.js} +1 -1
- package/dist/{resolve-route-BBztqaX0.js → resolve-route-DFUMTbRD.js} +4 -4
- package/dist/{response-prefix-template-BgDMziqu.js → response-prefix-template-DDQsoC2g.js} +1 -1
- package/dist/{run-main-D4CHxIUS.js → run-main-3RfLQTiu.js} +17 -17
- package/dist/{send-D3Uuw_MA.js → send-4gX7wep2.js} +8 -8
- package/dist/{send-CeBdN3Dp.js → send-CgAV9I1-.js} +15 -15
- package/dist/{send-DgVCmydL.js → send-CkPRLaz-.js} +8 -8
- package/dist/{send-C2J41ICD.js → send-DBeVQI-J.js} +7 -7
- package/dist/{send-Cibl-r-E.js → send-fdOUhBcN.js} +10 -10
- package/dist/{server-node-events-B60wtfXc.js → server-node-events-CRRE92S3.js} +6 -6
- package/dist/{server-node-events-DdwEsXLN.js → server-node-events-wpvPI-kw.js} +6 -6
- package/dist/{session-Bj8e8O8R.js → session-IUmTrU6A.js} +4 -4
- package/dist/{session-utils-CpgeP4rB.js → session-utils-ChEnoQCt.js} +1 -1
- package/dist/{session-utils-BUNcG-B2.js → session-utils-Dq5uiNDE.js} +1 -1
- package/dist/{sessions-3ACDrmHu.js → sessions-C6O5qrbx.js} +7 -1
- package/dist/{sessions-BePPqEtN.js → sessions-D5CiijxL.js} +12 -6
- package/dist/{sessions-n_z2PE4-.js → sessions-DPke45uf.js} +2 -2
- package/dist/{shell-env-DPAvieDD.js → shell-env-CKQ7fvtT.js} +1 -1
- package/dist/{status-BLKhFWFc.js → status-BeGUnsBd.js} +4 -4
- package/dist/{status-Ccfq5H-G.js → status-uyg2yOTM.js} +4 -4
- package/dist/{store-BS8fRU9w.js → store-BfW5-y9S.js} +7 -1
- package/dist/{subagent-registry-DIReZNw1.js → subagent-registry-BTv48FFX.js} +239 -6
- package/dist/{subagent-registry-DvnyYXMs.js → subagent-registry-D2yHvOBr.js} +238 -22
- package/dist/{subagent-registry-DMTgcI99.js → subagent-registry-DljM1oxO.js} +239 -6
- package/dist/{subsystem-DLQY6iY4.js → subsystem-9R2eOxp2.js} +2 -2
- package/dist/{tables-Bk8AXTIS.js → tables-CDsRjvfB.js} +2 -2
- package/dist/{tokens-CgIfCmK3.js → tokens-CFajuiSx.js} +1 -1
- package/dist/{tool-images-BMnWMHwL.js → tool-images-Cmsx31Bo.js} +1 -1
- package/dist/{update-cli-DCK9HF3t.js → update-cli-ChJoLU8L.js} +11 -11
- package/dist/{update-cli-1qesJ1_a.js → update-cli-DaW75dJC.js} +10 -10
- package/dist/{web-DG3SWzn_.js → web-BS0azDPB.js} +6 -6
- package/dist/{web-CCw02lmy.js → web-C_Alo-mS.js} +6 -6
- package/dist/{web-CKces-ap.js → web-DHXIgMOC.js} +50 -50
- package/dist/{whatsapp-actions-BzyFEHw4.js → whatsapp-actions-sR-u0T6U.js} +21 -21
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/dist/plugin-sdk/web-C24fSRzu.js +0 -7
- /package/dist/{fetch-timeout-DTIN7CGM.js → fetch-timeout-jOIu9Xud.js} +0 -0
- /package/dist/{file-lock-BftAtpBn.js → file-lock-CEhZlbAi.js} +0 -0
- /package/dist/{ip-B27WD9wk.js → ip-N_XHHVsM.js} +0 -0
- /package/dist/{json-file-CRyYLqpu.js → json-file-DYQIVLc1.js} +0 -0
- /package/dist/{render-DSLzcBxk.js → render-TpKSK5RV.js} +0 -0
- /package/dist/{target-errors-owiG6LWY.js → target-errors-D7fLx8zG.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { An as
|
|
2
|
+
import { An as isDeliverableMessageChannel, Ca as normalizeAccountId, Ci as ensureDir$1, D as deliveryContextKey, Da as getSubagentDepth, E as deliveryContextFromSession, F as INPUT_PROVENANCE_KIND_VALUES, Fi as shortenHomeInString, Fn as GATEWAY_CLIENT_MODES, Ft as SILENT_REPLY_TOKEN, In as GATEWAY_CLIENT_NAMES, J as resolveStorePath, Jn as isLoopbackIpAddress, Lt as isSilentReplyText, Ni as resolveUserPath, Nn as normalizeMessageChannel, O as mergeDeliveryContext, Oa as parseAgentSessionKey, Or as parseDurationMs, Pn as GATEWAY_CLIENT_IDS, Pt as HEARTBEAT_TOKEN, Qn as logError, Qr as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, Rr as resolveDefaultAgentId, Ut as normalizeChannelId, Vt as getChannelPlugin, Y as resolveMainSessionKey, Yi as resolveNodeRequireFromMeta, Zn as logDebug, ai as createSubsystemLogger, b as loadSessionStore, ca as resolveGatewayPort, h as getGlobalHookRunner, jn as isInternalMessageChannel, jr as resolveAgentConfig, k as normalizeDeliveryContext, kn as INTERNAL_MESSAGE_CHANNEL, m as sanitizeUserFacingText, s as shouldSuppressReasoningPayload, sa as resolveConfigPath, si as defaultRuntime, tr as loadConfig, ua as resolveStateDir, va as normalizeMainKey, wi as escapeRegExp, xi as CONFIG_DIR, ya as resolveAgentIdFromSessionKey, zr as resolveSessionAgentId } from "./reply-payloads-DwsjAWzB.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import os from "node:os";
|
|
@@ -4113,6 +4113,134 @@ function hasCrossChannelItems(items, resolveKey) {
|
|
|
4113
4113
|
return keys.size > 1;
|
|
4114
4114
|
}
|
|
4115
4115
|
|
|
4116
|
+
//#endregion
|
|
4117
|
+
//#region src/agents/subagent-announce-queue.ts
|
|
4118
|
+
const ANNOUNCE_QUEUES = /* @__PURE__ */ new Map();
|
|
4119
|
+
function getAnnounceQueue(key, settings, send) {
|
|
4120
|
+
const existing = ANNOUNCE_QUEUES.get(key);
|
|
4121
|
+
if (existing) {
|
|
4122
|
+
applyQueueRuntimeSettings({
|
|
4123
|
+
target: existing,
|
|
4124
|
+
settings
|
|
4125
|
+
});
|
|
4126
|
+
existing.send = send;
|
|
4127
|
+
return existing;
|
|
4128
|
+
}
|
|
4129
|
+
const created = {
|
|
4130
|
+
items: [],
|
|
4131
|
+
draining: false,
|
|
4132
|
+
lastEnqueuedAt: 0,
|
|
4133
|
+
mode: settings.mode,
|
|
4134
|
+
debounceMs: typeof settings.debounceMs === "number" ? Math.max(0, settings.debounceMs) : 1e3,
|
|
4135
|
+
cap: typeof settings.cap === "number" && settings.cap > 0 ? Math.floor(settings.cap) : 20,
|
|
4136
|
+
dropPolicy: settings.dropPolicy ?? "summarize",
|
|
4137
|
+
droppedCount: 0,
|
|
4138
|
+
summaryLines: [],
|
|
4139
|
+
send,
|
|
4140
|
+
consecutiveFailures: 0
|
|
4141
|
+
};
|
|
4142
|
+
applyQueueRuntimeSettings({
|
|
4143
|
+
target: created,
|
|
4144
|
+
settings
|
|
4145
|
+
});
|
|
4146
|
+
ANNOUNCE_QUEUES.set(key, created);
|
|
4147
|
+
return created;
|
|
4148
|
+
}
|
|
4149
|
+
function hasAnnounceCrossChannelItems(items) {
|
|
4150
|
+
return hasCrossChannelItems(items, (item) => {
|
|
4151
|
+
if (!item.origin) return {};
|
|
4152
|
+
if (!item.originKey) return { cross: true };
|
|
4153
|
+
return { key: item.originKey };
|
|
4154
|
+
});
|
|
4155
|
+
}
|
|
4156
|
+
function scheduleAnnounceDrain(key) {
|
|
4157
|
+
const queue = beginQueueDrain(ANNOUNCE_QUEUES, key);
|
|
4158
|
+
if (!queue) return;
|
|
4159
|
+
(async () => {
|
|
4160
|
+
try {
|
|
4161
|
+
const collectState = { forceIndividualCollect: false };
|
|
4162
|
+
for (;;) {
|
|
4163
|
+
if (queue.items.length === 0 && queue.droppedCount === 0) break;
|
|
4164
|
+
await waitForQueueDebounce(queue);
|
|
4165
|
+
if (queue.mode === "collect") {
|
|
4166
|
+
const collectDrainResult = await drainCollectQueueStep({
|
|
4167
|
+
collectState,
|
|
4168
|
+
isCrossChannel: hasAnnounceCrossChannelItems(queue.items),
|
|
4169
|
+
items: queue.items,
|
|
4170
|
+
run: async (item) => await queue.send(item)
|
|
4171
|
+
});
|
|
4172
|
+
if (collectDrainResult === "empty") break;
|
|
4173
|
+
if (collectDrainResult === "drained") continue;
|
|
4174
|
+
const items = queue.items.slice();
|
|
4175
|
+
const summary = previewQueueSummaryPrompt({
|
|
4176
|
+
state: queue,
|
|
4177
|
+
noun: "announce"
|
|
4178
|
+
});
|
|
4179
|
+
const prompt = buildCollectPrompt({
|
|
4180
|
+
title: "[Queued announce messages while agent was busy]",
|
|
4181
|
+
items,
|
|
4182
|
+
summary,
|
|
4183
|
+
renderItem: (item, idx) => `---\nQueued #${idx + 1}\n${item.prompt}`.trim()
|
|
4184
|
+
});
|
|
4185
|
+
const last = items.at(-1);
|
|
4186
|
+
if (!last) break;
|
|
4187
|
+
await queue.send({
|
|
4188
|
+
...last,
|
|
4189
|
+
prompt
|
|
4190
|
+
});
|
|
4191
|
+
queue.items.splice(0, items.length);
|
|
4192
|
+
if (summary) clearQueueSummaryState(queue);
|
|
4193
|
+
continue;
|
|
4194
|
+
}
|
|
4195
|
+
const summaryPrompt = previewQueueSummaryPrompt({
|
|
4196
|
+
state: queue,
|
|
4197
|
+
noun: "announce"
|
|
4198
|
+
});
|
|
4199
|
+
if (summaryPrompt) {
|
|
4200
|
+
if (!await drainNextQueueItem(queue.items, async (item) => await queue.send({
|
|
4201
|
+
...item,
|
|
4202
|
+
prompt: summaryPrompt
|
|
4203
|
+
}))) break;
|
|
4204
|
+
clearQueueSummaryState(queue);
|
|
4205
|
+
continue;
|
|
4206
|
+
}
|
|
4207
|
+
if (!await drainNextQueueItem(queue.items, async (item) => await queue.send(item))) break;
|
|
4208
|
+
}
|
|
4209
|
+
queue.consecutiveFailures = 0;
|
|
4210
|
+
} catch (err) {
|
|
4211
|
+
queue.consecutiveFailures++;
|
|
4212
|
+
const errorBackoffMs = Math.min(1e3 * Math.pow(2, queue.consecutiveFailures), 6e4);
|
|
4213
|
+
const retryDelayMs = Math.max(errorBackoffMs, queue.debounceMs);
|
|
4214
|
+
queue.lastEnqueuedAt = Date.now() + retryDelayMs - queue.debounceMs;
|
|
4215
|
+
defaultRuntime.error?.(`announce queue drain failed for ${key} (attempt ${queue.consecutiveFailures}, retry in ${Math.round(retryDelayMs / 1e3)}s): ${String(err)}`);
|
|
4216
|
+
} finally {
|
|
4217
|
+
queue.draining = false;
|
|
4218
|
+
if (queue.items.length === 0 && queue.droppedCount === 0) ANNOUNCE_QUEUES.delete(key);
|
|
4219
|
+
else scheduleAnnounceDrain(key);
|
|
4220
|
+
}
|
|
4221
|
+
})();
|
|
4222
|
+
}
|
|
4223
|
+
function enqueueAnnounce(params) {
|
|
4224
|
+
const queue = getAnnounceQueue(params.key, params.settings, params.send);
|
|
4225
|
+
queue.lastEnqueuedAt = Math.max(queue.lastEnqueuedAt, Date.now());
|
|
4226
|
+
if (!applyQueueDropPolicy({
|
|
4227
|
+
queue,
|
|
4228
|
+
summarize: (item) => item.summaryLine?.trim() || item.prompt.trim()
|
|
4229
|
+
})) {
|
|
4230
|
+
if (queue.dropPolicy === "new") scheduleAnnounceDrain(params.key);
|
|
4231
|
+
return false;
|
|
4232
|
+
}
|
|
4233
|
+
const origin = normalizeDeliveryContext(params.item.origin);
|
|
4234
|
+
const originKey = deliveryContextKey(origin);
|
|
4235
|
+
queue.items.push({
|
|
4236
|
+
...params.item,
|
|
4237
|
+
origin,
|
|
4238
|
+
originKey
|
|
4239
|
+
});
|
|
4240
|
+
scheduleAnnounceDrain(params.key);
|
|
4241
|
+
return true;
|
|
4242
|
+
}
|
|
4243
|
+
|
|
4116
4244
|
//#endregion
|
|
4117
4245
|
//#region src/auto-reply/reply/directive-parsing.ts
|
|
4118
4246
|
function skipDirectiveArgPrefix(raw) {
|
|
@@ -4905,7 +5033,7 @@ async function routeReply(params) {
|
|
|
4905
5033
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
4906
5034
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
4907
5035
|
try {
|
|
4908
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
5036
|
+
const { deliverOutboundPayloads } = await import("./deliver-BzPIWEw5.js").then((n) => n.t);
|
|
4909
5037
|
const outboundSession = buildOutboundSessionContext({
|
|
4910
5038
|
cfg,
|
|
4911
5039
|
agentId: resolvedAgentId,
|
|
@@ -5209,6 +5337,46 @@ function buildAnnounceIdFromChildRun(params) {
|
|
|
5209
5337
|
function buildAnnounceIdempotencyKey(announceId) {
|
|
5210
5338
|
return `announce:${announceId}`;
|
|
5211
5339
|
}
|
|
5340
|
+
function resolveQueueAnnounceId(params) {
|
|
5341
|
+
const announceId = params.announceId?.trim();
|
|
5342
|
+
if (announceId) return announceId;
|
|
5343
|
+
return `legacy:${params.sessionKey}:${params.enqueuedAt}`;
|
|
5344
|
+
}
|
|
5345
|
+
|
|
5346
|
+
//#endregion
|
|
5347
|
+
//#region src/agents/session-run-registry.ts
|
|
5348
|
+
const ACTIVE_SESSION_RUNS = /* @__PURE__ */ new Map();
|
|
5349
|
+
/** Check whether a session currently has an active CLI agent turn. */
|
|
5350
|
+
function isSessionRunActive(sessionKey) {
|
|
5351
|
+
return ACTIVE_SESSION_RUNS.has(sessionKey);
|
|
5352
|
+
}
|
|
5353
|
+
/** Register an active session run. */
|
|
5354
|
+
function registerSessionRun(sessionKey, handle) {
|
|
5355
|
+
ACTIVE_SESSION_RUNS.set(sessionKey, handle);
|
|
5356
|
+
}
|
|
5357
|
+
/** Unregister a session run (on turn completion or crash). */
|
|
5358
|
+
function unregisterSessionRun(sessionKey) {
|
|
5359
|
+
ACTIVE_SESSION_RUNS.delete(sessionKey);
|
|
5360
|
+
}
|
|
5361
|
+
/**
|
|
5362
|
+
* Kill an active session run by aborting its controller or sending SIGTERM to its PID.
|
|
5363
|
+
* Returns `true` if a kill signal was dispatched.
|
|
5364
|
+
*/
|
|
5365
|
+
function killSessionRun(sessionKey) {
|
|
5366
|
+
const handle = ACTIVE_SESSION_RUNS.get(sessionKey);
|
|
5367
|
+
if (!handle) return false;
|
|
5368
|
+
if (handle.abortController && !handle.abortController.signal.aborted) {
|
|
5369
|
+
handle.abortController.abort();
|
|
5370
|
+
return true;
|
|
5371
|
+
}
|
|
5372
|
+
if (typeof handle.pid === "number") try {
|
|
5373
|
+
process.kill(handle.pid, "SIGTERM");
|
|
5374
|
+
return true;
|
|
5375
|
+
} catch {
|
|
5376
|
+
return false;
|
|
5377
|
+
}
|
|
5378
|
+
return false;
|
|
5379
|
+
}
|
|
5212
5380
|
|
|
5213
5381
|
//#endregion
|
|
5214
5382
|
//#region src/agents/subagent-depth.ts
|
|
@@ -6518,6 +6686,31 @@ async function resolveSubagentCompletionOrigin(params) {
|
|
|
6518
6686
|
};
|
|
6519
6687
|
}
|
|
6520
6688
|
}
|
|
6689
|
+
async function sendAnnounce(item) {
|
|
6690
|
+
const announceTimeoutMs = resolveSubagentAnnounceTimeoutMs(loadConfig());
|
|
6691
|
+
const requesterIsSubagent = getSubagentDepthFromSessionStore(item.sessionKey) >= 1;
|
|
6692
|
+
const origin = item.origin;
|
|
6693
|
+
const threadId = origin?.threadId != null && origin.threadId !== "" ? String(origin.threadId) : void 0;
|
|
6694
|
+
const idempotencyKey = buildAnnounceIdempotencyKey(resolveQueueAnnounceId({
|
|
6695
|
+
announceId: item.announceId,
|
|
6696
|
+
sessionKey: item.sessionKey,
|
|
6697
|
+
enqueuedAt: item.enqueuedAt
|
|
6698
|
+
}));
|
|
6699
|
+
await callGateway({
|
|
6700
|
+
method: "agent",
|
|
6701
|
+
params: {
|
|
6702
|
+
sessionKey: item.sessionKey,
|
|
6703
|
+
message: item.prompt,
|
|
6704
|
+
channel: requesterIsSubagent ? void 0 : origin?.channel,
|
|
6705
|
+
accountId: requesterIsSubagent ? void 0 : origin?.accountId,
|
|
6706
|
+
to: requesterIsSubagent ? void 0 : origin?.to,
|
|
6707
|
+
threadId: requesterIsSubagent ? void 0 : threadId,
|
|
6708
|
+
deliver: !requesterIsSubagent,
|
|
6709
|
+
idempotencyKey
|
|
6710
|
+
},
|
|
6711
|
+
timeoutMs: announceTimeoutMs
|
|
6712
|
+
});
|
|
6713
|
+
}
|
|
6521
6714
|
function resolveRequesterStoreKey(cfg, requesterSessionKey) {
|
|
6522
6715
|
const raw = (requesterSessionKey ?? "").trim();
|
|
6523
6716
|
if (!raw) return raw;
|
|
@@ -6537,17 +6730,40 @@ function loadRequesterSessionEntry(requesterSessionKey) {
|
|
|
6537
6730
|
canonicalKey
|
|
6538
6731
|
};
|
|
6539
6732
|
}
|
|
6733
|
+
function buildAnnounceQueueKey(sessionKey, origin) {
|
|
6734
|
+
const accountId = normalizeAccountId(origin?.accountId);
|
|
6735
|
+
if (!accountId) return sessionKey;
|
|
6736
|
+
return `${sessionKey}:acct:${accountId}`;
|
|
6737
|
+
}
|
|
6540
6738
|
async function maybeQueueSubagentAnnounce(params) {
|
|
6541
6739
|
if (params.signal?.aborted) return "none";
|
|
6542
6740
|
const { cfg, entry } = loadRequesterSessionEntry(params.requesterSessionKey);
|
|
6543
|
-
resolveRequesterStoreKey(cfg, params.requesterSessionKey);
|
|
6741
|
+
const canonicalKey = resolveRequesterStoreKey(cfg, params.requesterSessionKey);
|
|
6544
6742
|
if (!entry?.sessionId) return "none";
|
|
6545
6743
|
const queueSettings = resolveQueueSettings({
|
|
6546
6744
|
cfg,
|
|
6547
6745
|
channel: entry?.channel ?? entry?.lastChannel,
|
|
6548
6746
|
sessionEntry: entry
|
|
6549
6747
|
});
|
|
6550
|
-
|
|
6748
|
+
const isActive = isSessionRunActive(canonicalKey);
|
|
6749
|
+
const shouldFollowup = queueSettings.mode === "followup" || queueSettings.mode === "collect" || queueSettings.mode === "steer-backlog" || queueSettings.mode === "interrupt";
|
|
6750
|
+
if (isActive && (shouldFollowup || queueSettings.mode === "steer")) {
|
|
6751
|
+
const origin = resolveAnnounceOrigin(entry, params.requesterOrigin);
|
|
6752
|
+
enqueueAnnounce({
|
|
6753
|
+
key: buildAnnounceQueueKey(canonicalKey, origin),
|
|
6754
|
+
item: {
|
|
6755
|
+
announceId: params.announceId,
|
|
6756
|
+
prompt: params.triggerMessage,
|
|
6757
|
+
summaryLine: params.summaryLine,
|
|
6758
|
+
enqueuedAt: Date.now(),
|
|
6759
|
+
sessionKey: canonicalKey,
|
|
6760
|
+
origin
|
|
6761
|
+
},
|
|
6762
|
+
settings: queueSettings,
|
|
6763
|
+
send: sendAnnounce
|
|
6764
|
+
});
|
|
6765
|
+
return "queued";
|
|
6766
|
+
}
|
|
6551
6767
|
return "none";
|
|
6552
6768
|
}
|
|
6553
6769
|
function queueOutcomeToDeliveryResult(outcome) {
|
|
@@ -7870,4 +8086,4 @@ function countActiveDescendantRuns(rootSessionKey) {
|
|
|
7870
8086
|
}
|
|
7871
8087
|
|
|
7872
8088
|
//#endregion
|
|
7873
|
-
export {
|
|
8089
|
+
export { resolveAckReaction as $, buildOutboundSessionContext as A, createReceiptCard as B, resolveQueueSettings as C, isRoutableChannel as D, scheduleFollowupDrain as E, logMessageQueued as F, emitDiagnosticEvent as G, resolveAgentTimeoutMs as H, logSessionStateChange as I, extractShortModelName as J, isDiagnosticsEnabled as K, extractQueueDirective as L, clearCommandLane as M, getQueueSize as N, routeReply as O, logMessageProcessed as P, rejectDevicePairing as Q, emitAgentEvent as R, extractTextFromChatContent as S, getFollowupQueueDepth as T, callGateway as U, attachFooterText as V, resolveGatewayCredentialsFromConfig as W, approveDevicePairing as X, rawDataToString as Y, listDevicePairing as Z, getSubagentDepthFromSessionStore as _, markSubagentRunTerminated as a, loadJsonFile as at, registerSessionRun as b, subagent_registry_exports as c, sanitizeTextContent as d, resolveEffectiveMessagesConfig as et, stripToolMessages as f, AGENT_LANE_SUBAGENT as g, resolveMainSessionAlias as h, markSubagentRunForSteerRestart as i, redactSensitiveText as it, clearSessionQueues as j, normalizeReplyPayload as k, buildSubagentSystemPrompt as l, resolveInternalSessionKey as m, countActiveRunsForSession as n, resolveIdentityNamePrefix as nt, registerSubagentRun as o, saveJsonFile as ot, resolveDisplaySessionKey as p, onDiagnosticEvent as q, listSubagentRunsForRequester as r, resolveMessagePrefix as rt, replaceSubagentRunAfterSteer as s, clearSubagentRunSteerRestart as t, resolveIdentityName as tt, extractAssistantText as u, isSessionRunActive as v, enqueueFollowupRun as w, unregisterSessionRun as x, killSessionRun as y, registerAgentRunContext as z };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { _n as webAuthExists, cn as logWebSelfId, dn as pickWebChannel, on as WA_WEB_AUTH_DIR } from "./reply-payloads-DwsjAWzB.js";
|
|
2
|
+
import "./reply-Dzts0EiK.js";
|
|
3
|
+
import "./subagent-registry-DrBYYinw.js";
|
|
4
|
+
import "./deliver-BzPIWEw5.js";
|
|
5
|
+
import { a as waitForWaConnection, i as createWaSocket, n as monitorWebChannel, o as sendMessageWhatsApp, r as monitorWebInbox, t as loginWeb } from "./channel-web-DSYJDq30.js";
|
|
6
|
+
|
|
7
|
+
export { WA_WEB_AUTH_DIR, createWaSocket, logWebSelfId, loginWeb, monitorWebChannel, monitorWebInbox, pickWebChannel, sendMessageWhatsApp, waitForWaConnection, webAuthExists };
|
|
@@ -8,7 +8,7 @@ import "./agent-scope-CXVIfJFJ.js";
|
|
|
8
8
|
import "./zod-schema-Bh8NOhFH.js";
|
|
9
9
|
import "./dock-DO9Vw5CE.js";
|
|
10
10
|
import "./message-channel-tuc9CdEw.js";
|
|
11
|
-
import "./sessions-
|
|
11
|
+
import "./sessions-C6O5qrbx.js";
|
|
12
12
|
import "./accounts-BVh3N1Fk.js";
|
|
13
13
|
import "./accounts-9jdDby1S.js";
|
|
14
14
|
import "./plugins-xybjDXd6.js";
|
|
@@ -18,7 +18,7 @@ import "./bindings-Dz4Bh_zw.js";
|
|
|
18
18
|
import "./logging-DRwtiLIS.js";
|
|
19
19
|
import "./send-QGiloXFZ.js";
|
|
20
20
|
import "./send-BvObbKlY.js";
|
|
21
|
-
import "./provider-dispatcher-
|
|
21
|
+
import "./provider-dispatcher-BD5K64cR.js";
|
|
22
22
|
import "./chat-envelope-CT-Ocz9D.js";
|
|
23
23
|
import "./strip-inbound-meta-zmUXypSS.js";
|
|
24
24
|
import "./client-_mml4Fa6.js";
|
|
@@ -27,14 +27,14 @@ import "./net-eJa3DljN.js";
|
|
|
27
27
|
import "./logger-Bg_B5M43.js";
|
|
28
28
|
import "./ip-DK-vcRii.js";
|
|
29
29
|
import "./tailnet-kbXXH7kK.js";
|
|
30
|
-
import "./subagent-registry-
|
|
30
|
+
import "./subagent-registry-BTv48FFX.js";
|
|
31
31
|
import "./response-prefix-template-DKzvekX_.js";
|
|
32
32
|
import "./agent-helpers-Bzz_tiPK.js";
|
|
33
33
|
import "./tool-images-CX2LXum2.js";
|
|
34
34
|
import "./exec-D1tuG1om.js";
|
|
35
35
|
import "./image-ops-BT4VediG.js";
|
|
36
36
|
import "./tokens-D1JVsjbg.js";
|
|
37
|
-
import "./hook-runner-global-
|
|
37
|
+
import "./hook-runner-global-DPdZsDAH.js";
|
|
38
38
|
import "./redact-CuM_QcqM.js";
|
|
39
39
|
import "./tool-display-FTmiDILs.js";
|
|
40
40
|
import "./markdown-tables-BKzJxBq0.js";
|
|
@@ -60,7 +60,7 @@ import "./channel-activity-DgNn51YG.js";
|
|
|
60
60
|
import "./session-cost-usage-B7CLLXW3.js";
|
|
61
61
|
import "./errors-BO7MWwih.js";
|
|
62
62
|
import "./ports-lsof-CwRCSLwc.js";
|
|
63
|
-
import "./deliver-
|
|
63
|
+
import "./deliver-B5eZoNwr.js";
|
|
64
64
|
import "./plugin-auto-enable-CExwFUHo.js";
|
|
65
65
|
import "./dm-policy-shared-Bla9d1QG.js";
|
|
66
66
|
import "./send-D8F6oiAI.js";
|
|
@@ -81,7 +81,7 @@ import { n as setPluginEnabledInConfig, t as enablePluginInConfig } from "./enab
|
|
|
81
81
|
import { g as resolveArchiveKind } from "./npm-registry-spec-C2TAexSi.js";
|
|
82
82
|
import { a as resolvePluginInstallDir, i as installPluginFromPath, n as recordPluginInstall, r as installPluginFromNpmSpec } from "./installs-CiAw6p1s.js";
|
|
83
83
|
import { t as renderTable } from "./table-GQ3pJQ0O.js";
|
|
84
|
-
import { n as resolvePinnedNpmInstallRecordForCli, r as buildPluginStatusReport } from "./npm-resolution-
|
|
84
|
+
import { n as resolvePinnedNpmInstallRecordForCli, r as buildPluginStatusReport } from "./npm-resolution-C6jVPSqS.js";
|
|
85
85
|
import { n as updateNpmInstalledPlugins, r as findBundledPluginByNpmSpec } from "./update-DQDEa4Ww.js";
|
|
86
86
|
import os from "node:os";
|
|
87
87
|
import path from "node:path";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { m as resolveStateDir } from "./paths-DHuXVC00.js";
|
|
2
2
|
import { L as theme, _ as resolveUserPath, b as shortenHomePath, m as resolveConfigDir, y as shortenHomeInString } from "./utils-__cbkDgx.js";
|
|
3
|
-
import "./reply-
|
|
3
|
+
import "./reply-Ccq9RRYF.js";
|
|
4
4
|
import "./subsystem-YtLxC9Jh.js";
|
|
5
5
|
import { i as defaultRuntime } from "./ansi-DtaiOnt1.js";
|
|
6
6
|
import "./agent-scope-CqLq7cFg.js";
|
|
7
|
-
import "./subagent-registry-
|
|
7
|
+
import "./subagent-registry-DljM1oxO.js";
|
|
8
8
|
import "./onboard-helpers-D2nzz93W.js";
|
|
9
9
|
import "./message-channel-Byxx9SGy.js";
|
|
10
10
|
import "./send-CoDb77BF.js";
|
|
@@ -24,7 +24,7 @@ import "./accounts-BmUEiryJ.js";
|
|
|
24
24
|
import "./bindings-DeKYuXJO.js";
|
|
25
25
|
import "./logging-fywhKCmE.js";
|
|
26
26
|
import "./tokens-DJrhANSO.js";
|
|
27
|
-
import "./reply-payloads-
|
|
27
|
+
import "./reply-payloads-KYLwM629.js";
|
|
28
28
|
import "./send-Bj1TUsUZ.js";
|
|
29
29
|
import "./commands-YI4OIEz0.js";
|
|
30
30
|
import "./commands-registry-BKzejEC3.js";
|
|
@@ -33,7 +33,7 @@ import "./fetch-CfIaWynF.js";
|
|
|
33
33
|
import "./channel-activity-0siRvnUT.js";
|
|
34
34
|
import "./file-lock-CCBpdPM_.js";
|
|
35
35
|
import "./chat-envelope-DPKIEKwe.js";
|
|
36
|
-
import "./store-
|
|
36
|
+
import "./store-BfW5-y9S.js";
|
|
37
37
|
import "./strip-inbound-meta-aD15EKsc.js";
|
|
38
38
|
import "./session-cost-usage-BEJ7hSxb.js";
|
|
39
39
|
import "./auth-8CQIOfEF.js";
|
|
@@ -63,7 +63,7 @@ import "./markdown-tables-BsunnBTT.js";
|
|
|
63
63
|
import "./render-CIF_SgbA.js";
|
|
64
64
|
import "./tables-C6OJbUw4.js";
|
|
65
65
|
import "./ports-lsof-BmOgvEU5.js";
|
|
66
|
-
import "./deliver-
|
|
66
|
+
import "./deliver-Cu2kD7-u.js";
|
|
67
67
|
import "./plugin-auto-enable-onDiMat_.js";
|
|
68
68
|
import "./target-errors-B_VJlqx6.js";
|
|
69
69
|
import "./dm-policy-shared-AsIdue8Y.js";
|
|
@@ -85,7 +85,7 @@ import { n as setPluginEnabledInConfig, t as enablePluginInConfig } from "./enab
|
|
|
85
85
|
import { g as resolveArchiveKind } from "./npm-registry-spec-BTEIplcj.js";
|
|
86
86
|
import { a as resolvePluginInstallDir, i as installPluginFromPath, n as recordPluginInstall, r as installPluginFromNpmSpec } from "./installs-CGo0VgQU.js";
|
|
87
87
|
import { t as renderTable } from "./table-D-dtKj8e.js";
|
|
88
|
-
import { n as resolvePinnedNpmInstallRecordForCli, r as buildPluginStatusReport } from "./npm-resolution-
|
|
88
|
+
import { n as resolvePinnedNpmInstallRecordForCli, r as buildPluginStatusReport } from "./npm-resolution-CdEbWlwy.js";
|
|
89
89
|
import { n as updateNpmInstalledPlugins, r as findBundledPluginByNpmSpec } from "./update-DRQzgjby.js";
|
|
90
90
|
import fs from "node:fs";
|
|
91
91
|
import os from "node:os";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as CHAT_CHANNEL_ORDER, c as normalizeAnyChannelId, k as normalizeE164, p as requireActivePluginRegistry, t as createSubsystemLogger } from "./subsystem-
|
|
1
|
+
import { a as CHAT_CHANNEL_ORDER, c as normalizeAnyChannelId, k as normalizeE164, p as requireActivePluginRegistry, t as createSubsystemLogger } from "./subsystem-9R2eOxp2.js";
|
|
2
2
|
import { d as DEFAULT_ACCOUNT_ID, f as normalizeAccountId } from "./session-key-X7pmdLBX.js";
|
|
3
|
-
import { t as isTruthyEnvValue } from "./env-
|
|
4
|
-
import { r as createAccountListHelpers } from "./accounts-
|
|
3
|
+
import { t as isTruthyEnvValue } from "./env-D3fELH5B.js";
|
|
4
|
+
import { r as createAccountListHelpers } from "./accounts-DObM4hAF.js";
|
|
5
5
|
import { t as resolveAccountEntry } from "./account-lookup-BU0Ibuj-.js";
|
|
6
6
|
import { t as normalizeChatType } from "./chat-type-Coeec2xt.js";
|
|
7
|
-
import { n as listBoundAccountIds, r as resolveDefaultAgentBoundAccountId } from "./bindings-
|
|
7
|
+
import { n as listBoundAccountIds, r as resolveDefaultAgentBoundAccountId } from "./bindings-AUVd82yI.js";
|
|
8
8
|
import fs from "node:fs";
|
|
9
9
|
import util from "node:util";
|
|
10
10
|
|
|
@@ -1,33 +1,45 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { U as shouldLogVerbose, V as logVerbose, st as resolveStateDir, t as createSubsystemLogger } from "./subsystem-
|
|
3
|
-
import { n as formatCliCommand } from "./env-
|
|
4
|
-
import { d as normalizeGoogleModelId, p as normalizeProviderId, t as getShellEnvAppliedKeys } from "./shell-env-
|
|
5
|
-
import {
|
|
6
|
-
import { n as saveJsonFile, t as loadJsonFile } from "./json-file-
|
|
7
|
-
import {
|
|
8
|
-
import { n as formatErrorMessage } from "./errors-
|
|
2
|
+
import { U as shouldLogVerbose, V as logVerbose, st as resolveStateDir, t as createSubsystemLogger } from "./subsystem-9R2eOxp2.js";
|
|
3
|
+
import { n as formatCliCommand } from "./env-D3fELH5B.js";
|
|
4
|
+
import { d as normalizeGoogleModelId, p as normalizeProviderId, t as getShellEnvAppliedKeys } from "./shell-env-CKQ7fvtT.js";
|
|
5
|
+
import { t as withFileLock } from "./file-lock-CEhZlbAi.js";
|
|
6
|
+
import { n as saveJsonFile, t as loadJsonFile } from "./json-file-DYQIVLc1.js";
|
|
7
|
+
import { d as fetchWithSsrFGuard, n as fetchRemoteMedia, o as isAudioFileName } from "./fetch--eFpeNac.js";
|
|
8
|
+
import { n as formatErrorMessage } from "./errors-Bg7BK273.js";
|
|
9
9
|
import path, { join } from "node:path";
|
|
10
10
|
import fs, { existsSync } from "node:fs";
|
|
11
11
|
import { homedir } from "node:os";
|
|
12
12
|
import fs$1 from "node:fs/promises";
|
|
13
13
|
|
|
14
|
-
//#region src/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* We strip line breaks anywhere, then trim whitespace at the ends.
|
|
20
|
-
*
|
|
21
|
-
* Intentionally does NOT remove ordinary spaces inside the string to avoid
|
|
22
|
-
* silently altering "Bearer <token>" style values.
|
|
23
|
-
*/
|
|
24
|
-
function normalizeSecretInput(value) {
|
|
25
|
-
if (typeof value !== "string") return "";
|
|
26
|
-
return value.replace(/[\r\n\u2028\u2029]+/g, "").trim();
|
|
14
|
+
//#region src/auth/oauth.ts
|
|
15
|
+
function isProfileConfigCompatible(params) {
|
|
16
|
+
const profileConfig = params.cfg?.auth?.profiles?.[params.profileId];
|
|
17
|
+
if (profileConfig && profileConfig.provider !== params.provider) return false;
|
|
18
|
+
return true;
|
|
27
19
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
function buildApiKeyProfileResult(params) {
|
|
21
|
+
return {
|
|
22
|
+
apiKey: params.apiKey,
|
|
23
|
+
provider: params.provider,
|
|
24
|
+
email: params.email
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
async function resolveApiKeyForProfile(params) {
|
|
28
|
+
const { cfg, store, profileId } = params;
|
|
29
|
+
const cred = store.profiles[profileId];
|
|
30
|
+
if (!cred) return null;
|
|
31
|
+
if (!isProfileConfigCompatible({
|
|
32
|
+
cfg,
|
|
33
|
+
profileId,
|
|
34
|
+
provider: cred.provider
|
|
35
|
+
})) return null;
|
|
36
|
+
const key = (cred.type === "token" ? cred.token : cred.key)?.trim();
|
|
37
|
+
if (!key) return null;
|
|
38
|
+
return buildApiKeyProfileResult({
|
|
39
|
+
apiKey: key,
|
|
40
|
+
provider: cred.provider,
|
|
41
|
+
email: cred.email
|
|
42
|
+
});
|
|
31
43
|
}
|
|
32
44
|
|
|
33
45
|
//#endregion
|
|
@@ -131,45 +143,6 @@ function saveAuthProfileStore(store) {
|
|
|
131
143
|
});
|
|
132
144
|
}
|
|
133
145
|
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/auth/profiles.ts
|
|
136
|
-
function listProfilesForProvider(store, provider) {
|
|
137
|
-
const providerKey = normalizeProviderId(provider);
|
|
138
|
-
return Object.entries(store.profiles).filter(([, cred]) => normalizeProviderId(cred.provider) === providerKey).map(([id]) => id);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
//#endregion
|
|
142
|
-
//#region src/auth/oauth.ts
|
|
143
|
-
function isProfileConfigCompatible(params) {
|
|
144
|
-
const profileConfig = params.cfg?.auth?.profiles?.[params.profileId];
|
|
145
|
-
if (profileConfig && profileConfig.provider !== params.provider) return false;
|
|
146
|
-
return true;
|
|
147
|
-
}
|
|
148
|
-
function buildApiKeyProfileResult(params) {
|
|
149
|
-
return {
|
|
150
|
-
apiKey: params.apiKey,
|
|
151
|
-
provider: params.provider,
|
|
152
|
-
email: params.email
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
async function resolveApiKeyForProfile(params) {
|
|
156
|
-
const { cfg, store, profileId } = params;
|
|
157
|
-
const cred = store.profiles[profileId];
|
|
158
|
-
if (!cred) return null;
|
|
159
|
-
if (!isProfileConfigCompatible({
|
|
160
|
-
cfg,
|
|
161
|
-
profileId,
|
|
162
|
-
provider: cred.provider
|
|
163
|
-
})) return null;
|
|
164
|
-
const key = (cred.type === "token" ? cred.token : cred.key)?.trim();
|
|
165
|
-
if (!key) return null;
|
|
166
|
-
return buildApiKeyProfileResult({
|
|
167
|
-
apiKey: key,
|
|
168
|
-
provider: cred.provider,
|
|
169
|
-
email: cred.email
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
146
|
//#endregion
|
|
174
147
|
//#region src/auth/usage.ts
|
|
175
148
|
const FAILURE_REASON_PRIORITY = [
|
|
@@ -287,6 +260,33 @@ async function markAuthProfileUsed(params) {
|
|
|
287
260
|
saveAuthProfileStore(store);
|
|
288
261
|
}
|
|
289
262
|
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/utils/normalize-secret-input.ts
|
|
265
|
+
/**
|
|
266
|
+
* Secret normalization for copy/pasted credentials.
|
|
267
|
+
*
|
|
268
|
+
* Common footgun: line breaks (especially `\r`) embedded in API keys/tokens.
|
|
269
|
+
* We strip line breaks anywhere, then trim whitespace at the ends.
|
|
270
|
+
*
|
|
271
|
+
* Intentionally does NOT remove ordinary spaces inside the string to avoid
|
|
272
|
+
* silently altering "Bearer <token>" style values.
|
|
273
|
+
*/
|
|
274
|
+
function normalizeSecretInput(value) {
|
|
275
|
+
if (typeof value !== "string") return "";
|
|
276
|
+
return value.replace(/[\r\n\u2028\u2029]+/g, "").trim();
|
|
277
|
+
}
|
|
278
|
+
function normalizeOptionalSecretInput(value) {
|
|
279
|
+
const normalized = normalizeSecretInput(value);
|
|
280
|
+
return normalized ? normalized : void 0;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region src/auth/profiles.ts
|
|
285
|
+
function listProfilesForProvider(store, provider) {
|
|
286
|
+
const providerKey = normalizeProviderId(provider);
|
|
287
|
+
return Object.entries(store.profiles).filter(([, cred]) => normalizeProviderId(cred.provider) === providerKey).map(([id]) => id);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
290
|
//#endregion
|
|
291
291
|
//#region src/auth/provider-auth.ts
|
|
292
292
|
/**
|
|
@@ -1122,4 +1122,4 @@ async function resolveAudioEntry(params) {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
|
|
1124
1124
|
//#endregion
|
|
1125
|
-
export {
|
|
1125
|
+
export { listProfilesForProvider as a, isProfileInCooldown as c, ensureAuthProfileStore as d, resolveApiKeyForProfile as f, resolveModelAuthMode as i, markAuthProfileUsed as l, transcribeFirstAudio as n, normalizeSecretInput as o, resolveApiKeyForProvider as r, clearExpiredCooldowns as s, preflight_exports as t, resolveProfileUnusableUntil as u };
|
|
@@ -8,7 +8,7 @@ import "./agent-scope-CXVIfJFJ.js";
|
|
|
8
8
|
import "./zod-schema-Bh8NOhFH.js";
|
|
9
9
|
import "./dock-DO9Vw5CE.js";
|
|
10
10
|
import "./message-channel-tuc9CdEw.js";
|
|
11
|
-
import "./sessions-
|
|
11
|
+
import "./sessions-C6O5qrbx.js";
|
|
12
12
|
import "./accounts-BVh3N1Fk.js";
|
|
13
13
|
import "./accounts-9jdDby1S.js";
|
|
14
14
|
import "./plugins-xybjDXd6.js";
|
|
@@ -19,7 +19,7 @@ import { n as resolveCliName, t as replaceCliName } from "./cli-name-CRe5Ow_t.js
|
|
|
19
19
|
import "./logging-DRwtiLIS.js";
|
|
20
20
|
import "./send-QGiloXFZ.js";
|
|
21
21
|
import "./send-BvObbKlY.js";
|
|
22
|
-
import "./provider-dispatcher-
|
|
22
|
+
import "./provider-dispatcher-BD5K64cR.js";
|
|
23
23
|
import "./chat-envelope-CT-Ocz9D.js";
|
|
24
24
|
import "./strip-inbound-meta-zmUXypSS.js";
|
|
25
25
|
import "./client-_mml4Fa6.js";
|
|
@@ -28,14 +28,14 @@ import "./net-eJa3DljN.js";
|
|
|
28
28
|
import "./logger-Bg_B5M43.js";
|
|
29
29
|
import "./ip-DK-vcRii.js";
|
|
30
30
|
import "./tailnet-kbXXH7kK.js";
|
|
31
|
-
import "./subagent-registry-
|
|
31
|
+
import "./subagent-registry-BTv48FFX.js";
|
|
32
32
|
import "./response-prefix-template-DKzvekX_.js";
|
|
33
33
|
import "./agent-helpers-Bzz_tiPK.js";
|
|
34
34
|
import "./tool-images-CX2LXum2.js";
|
|
35
35
|
import "./exec-D1tuG1om.js";
|
|
36
36
|
import "./image-ops-BT4VediG.js";
|
|
37
37
|
import "./tokens-D1JVsjbg.js";
|
|
38
|
-
import "./hook-runner-global-
|
|
38
|
+
import "./hook-runner-global-DPdZsDAH.js";
|
|
39
39
|
import "./redact-CuM_QcqM.js";
|
|
40
40
|
import "./tool-display-FTmiDILs.js";
|
|
41
41
|
import "./markdown-tables-BKzJxBq0.js";
|
|
@@ -61,7 +61,7 @@ import "./channel-activity-DgNn51YG.js";
|
|
|
61
61
|
import "./session-cost-usage-B7CLLXW3.js";
|
|
62
62
|
import "./errors-BO7MWwih.js";
|
|
63
63
|
import "./ports-lsof-CwRCSLwc.js";
|
|
64
|
-
import "./deliver-
|
|
64
|
+
import "./deliver-B5eZoNwr.js";
|
|
65
65
|
import "./plugin-auto-enable-CExwFUHo.js";
|
|
66
66
|
import "./dm-policy-shared-Bla9d1QG.js";
|
|
67
67
|
import "./send-D8F6oiAI.js";
|
|
@@ -77,13 +77,13 @@ import "./send-CRLJdqoo.js";
|
|
|
77
77
|
import "./prompt-style-BIUEnMtC.js";
|
|
78
78
|
import "./pairing-labels-B7_jbF5v.js";
|
|
79
79
|
import { t as formatDocsLink } from "./links-CbtTPpO-.js";
|
|
80
|
-
import "./plugin-registry-
|
|
81
|
-
import { n as resolveCliChannelOptions } from "./channel-options-
|
|
82
|
-
import { t as getSubCliCommandsWithSubcommands } from "./register.subclis-
|
|
83
|
-
import { a as registerProgramCommands, r as getCoreCliCommandsWithSubcommands } from "./command-registry-
|
|
80
|
+
import "./plugin-registry-BC1RH6cl.js";
|
|
81
|
+
import { n as resolveCliChannelOptions } from "./channel-options-CD6ZBbON.js";
|
|
82
|
+
import { t as getSubCliCommandsWithSubcommands } from "./register.subclis-CxT7d8Bs.js";
|
|
83
|
+
import { a as registerProgramCommands, r as getCoreCliCommandsWithSubcommands } from "./command-registry-kxjFHjjE.js";
|
|
84
84
|
import { r as setProgramContext } from "./program-context-Dh6CCtTY.js";
|
|
85
85
|
import { t as forceFreePort } from "./ports-BTO6BF3U.js";
|
|
86
|
-
import { n as formatCliBannerLine, r as hasEmittedCliBanner, t as emitCliBanner } from "./banner-
|
|
86
|
+
import { n as formatCliBannerLine, r as hasEmittedCliBanner, t as emitCliBanner } from "./banner-B52X-rEb.js";
|
|
87
87
|
import { Command, InvalidArgumentError } from "commander";
|
|
88
88
|
|
|
89
89
|
//#region src/cli/program/context.ts
|
|
@@ -222,7 +222,7 @@ function registerPreActionHooks(program, programVersion) {
|
|
|
222
222
|
commandPath
|
|
223
223
|
});
|
|
224
224
|
if (PLUGIN_REQUIRED_COMMANDS.has(commandPath[0])) {
|
|
225
|
-
const { ensurePluginRegistryLoaded } = await import("./plugin-registry-
|
|
225
|
+
const { ensurePluginRegistryLoaded } = await import("./plugin-registry-BC1RH6cl.js").then((n) => n.n);
|
|
226
226
|
ensurePluginRegistryLoaded();
|
|
227
227
|
}
|
|
228
228
|
});
|