@symerian/symi 2.4.4 → 2.5.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/{agents-D0WIqYlR.js → agents-Cf7lxbx4.js} +4 -4
- package/dist/{agents.config-BJhlUUzn.js → agents.config-CsltNAhl.js} +1 -1
- package/dist/{agents.config-DijsN6pE.js → agents.config-aAHTt-cM.js} +1 -1
- package/dist/{audio-preflight-C40mKAp7.js → audio-preflight-CPBOQV4I.js} +4 -4
- package/dist/{audio-preflight-O3ASWbaG.js → audio-preflight-D02HwB-I.js} +4 -4
- package/dist/{auth-choice-CzrXJoq0.js → auth-choice-Cy78Q2jy.js} +1 -1
- package/dist/{auth-choice-CBrZeM8N.js → auth-choice-wU5fEl73.js} +1 -1
- package/dist/{banner-DBCyc2l3.js → banner-BRzyFiIY.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +6 -6
- package/dist/bundled/session-memory/handler.js +6 -6
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-CcNcqLfp.js → channel-options-BcCKOiwh.js} +1 -1
- package/dist/{channel-options-D4b4yiR3.js → channel-options-up8R2ST5.js} +1 -1
- package/dist/{channel-web-BxgOSVS3.js → channel-web-CrH0yvww.js} +1 -1
- package/dist/{channels-cli-DahG1tUQ.js → channels-cli-BiHu6J16.js} +4 -4
- package/dist/{channels-cli-CH8FgCHM.js → channels-cli-DG3sTlC7.js} +4 -4
- package/dist/{chrome-CDJYxX5a.js → chrome-D2SKJnR7.js} +7 -7
- package/dist/{chrome-BFekevcE.js → chrome-EyvdASWt.js} +7 -7
- package/dist/{cli-xjbQGnY4.js → cli-BUkGaPzi.js} +1 -1
- package/dist/{cli-BG5jr57F.js → cli-YBkGYxfg.js} +1 -1
- package/dist/{command-registry-jAjzb3Ub.js → command-registry-YX9EbrJh.js} +9 -9
- package/dist/{completion-cli-zIGxgk1g.js → completion-cli-Cm8iWdRA.js} +2 -2
- package/dist/{completion-cli-C5YhoKGC.js → completion-cli-DZf03KrT.js} +1 -1
- package/dist/{config-cli-CPhmjH-O.js → config-cli-1PDMhq8v.js} +1 -1
- package/dist/{config-cli-3hyKITmM.js → config-cli-Dx3mtUwm.js} +1 -1
- package/dist/{configure-S9KIFkj-.js → configure-DKN7f4VI.js} +3 -3
- package/dist/{configure-C39-I7AH.js → configure-DZn4tz03.js} +3 -3
- package/dist/control-ui/js/render.js +4 -32
- package/dist/{deliver-BH0l3UKW.js → deliver-C-37cZUe.js} +1 -1
- package/dist/{deliver-CvCK5Mm9.js → deliver-D1ZN6-fl.js} +1 -1
- package/dist/{doctor-completion-DMcB-j3Q.js → doctor-completion--aLGEAgK.js} +1 -1
- package/dist/{doctor-completion-DjNFcAWO.js → doctor-completion-D4SLAoAE.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +6 -6
- package/dist/{gateway-cli-CptbhYJ1.js → gateway-cli-CMVvut5c.js} +11 -45
- package/dist/{gateway-cli-Bwd_To8f.js → gateway-cli-ZbqwB66o.js} +11 -45
- package/dist/{glass-ui-ws-B8ap5D2v.js → glass-ui-ws-Bg6ek2Vs.js} +7 -7
- package/dist/{glass-ui-ws-B4jT1ok5.js → glass-ui-ws-Cykb9Xv4.js} +7 -7
- package/dist/{health-DhqSQMPI.js → health-BMKu3MJz.js} +1 -1
- package/dist/{health-DCb7BG-3.js → health-CGoPVhko.js} +1 -1
- package/dist/{hooks-cli-DK2j2rIy.js → hooks-cli-CFtgfZBU.js} +2 -2
- package/dist/{hooks-cli-D5W9ERxc.js → hooks-cli-CQUjUbF8.js} +2 -2
- package/dist/{image-B0wGflxA.js → image-Cp3JDEBB.js} +1 -1
- package/dist/{image-CHzdaNJ4.js → image-DcpMiprB.js} +1 -1
- package/dist/index.js +6 -6
- package/dist/llm-slug-generator.js +6 -6
- package/dist/{models-Bh86hVEJ.js → models-BPJ5Z5tU.js} +2 -2
- package/dist/{models-cli-DNLCTKv1.js → models-cli-D9miPqtu.js} +2 -2
- package/dist/{models-cli-DLEKxIbC.js → models-cli-I7FIJUNa.js} +3 -3
- package/dist/{onboard-CYMyc_UX.js → onboard-BU6-iBln.js} +2 -2
- package/dist/{onboard-ey37IWby.js → onboard-CCZ5n-rI.js} +2 -2
- package/dist/{onboard-channels-BmoLkeU6.js → onboard-channels-B188R3F1.js} +1 -1
- package/dist/{onboard-channels-Dj_lMj0q.js → onboard-channels-CaRYhl9J.js} +1 -1
- package/dist/{onboarding-Dm9fej7n.js → onboarding-CNgU4kg8.js} +3 -3
- package/dist/{onboarding-DLyAGYc6.js → onboarding-Gsj-iMyY.js} +3 -3
- package/dist/{onboarding.finalize-csPp9wn_.js → onboarding.finalize-BvPgcu7R.js} +5 -5
- package/dist/{onboarding.finalize-CEBQJBqF.js → onboarding.finalize-C64KHESC.js} +6 -6
- package/dist/{pi-embedded-Lrmi4POJ.js → pi-embedded-DXSWVPEZ.js} +317 -115
- package/dist/{pi-embedded-BUYWm5p1.js → pi-embedded-RoXbo73e.js} +317 -115
- package/dist/{pi-embedded-helpers-lgx_U5KS.js → pi-embedded-helpers-B8kqLWns.js} +4 -4
- package/dist/{pi-embedded-helpers-DLFjnVBb.js → pi-embedded-helpers-ag2bosuj.js} +4 -4
- package/dist/{plugin-registry-D1vzxXON.js → plugin-registry-ByLEBcK_.js} +1 -1
- package/dist/{plugin-registry-ChH5CJIw.js → plugin-registry-dNrBrnR0.js} +1 -1
- package/dist/plugin-sdk/agents/output-normalizer.d.ts +69 -0
- package/dist/plugin-sdk/{channel-web-DOZ-G9xX.js → channel-web-Dn3ufSyq.js} +1 -1
- package/dist/plugin-sdk/index.js +2 -2
- package/dist/plugin-sdk/{reply-BIMkrLWh.js → reply-DqjPcp_q.js} +303 -101
- package/dist/plugin-sdk/{web-BsZ7_Dy0.js → web-GvAx9MMo.js} +2 -2
- package/dist/{plugins-cli-0PARfFDh.js → plugins-cli-BJRG_tkQ.js} +2 -2
- package/dist/{plugins-cli-CCMRc0SH.js → plugins-cli-DPaKpbZ0.js} +2 -2
- package/dist/{program-CTvCt90X.js → program-DCyh129g.js} +7 -7
- package/dist/{program-context-LQmFqAP2.js → program-context-27mCl36z.js} +17 -17
- package/dist/{prompt-select-styled-Dk4KU3bk.js → prompt-select-styled-JUdZMeZI.js} +4 -4
- package/dist/{prompt-select-styled-M1mZT6zR.js → prompt-select-styled-kpNeUDud.js} +4 -4
- package/dist/{provider-auth-helpers-CXq_C8eC.js → provider-auth-helpers-C9GRYN-o.js} +1 -1
- package/dist/{provider-auth-helpers-DM1hfi20.js → provider-auth-helpers-DyW_7UGQ.js} +1 -1
- package/dist/{push-apns-7t_aUx_g.js → push-apns-CZw1UMXk.js} +1 -1
- package/dist/{push-apns-D-D1fcAb.js → push-apns-DSpV-UMg.js} +1 -1
- package/dist/{pw-ai-De-KR9_s.js → pw-ai-1htA-NnS.js} +1 -1
- package/dist/{pw-ai-BnAKvSuw.js → pw-ai-Ch7liUOW.js} +1 -1
- package/dist/{register.agent-CWwXTRwB.js → register.agent-B7jOO00w.js} +5 -5
- package/dist/{register.agent-nABNjBav.js → register.agent-Dt-fGSRM.js} +6 -6
- package/dist/{register.configure-FljQTqAv.js → register.configure-B4ssKdGP.js} +6 -6
- package/dist/{register.configure-CV6utD3b.js → register.configure-BB1NVcZv.js} +6 -6
- package/dist/{register.maintenance-BxRP1viU.js → register.maintenance-B6JGjudV.js} +7 -7
- package/dist/{register.maintenance-CAACXueD.js → register.maintenance-ICQUl02l.js} +8 -8
- package/dist/{register.message-uz5SnsUO.js → register.message-B-hq0-gd.js} +2 -2
- package/dist/{register.message-D_Cc5Hcu.js → register.message-BEP0P-gF.js} +2 -2
- package/dist/{register.onboard-C8C1xEuj.js → register.onboard-CrgzRM5X.js} +4 -4
- package/dist/{register.onboard-BGsi8HVc.js → register.onboard-Dgsu5_C8.js} +4 -4
- package/dist/{register.setup-CyxXsD-4.js → register.setup-B3pPkZ-g.js} +4 -4
- package/dist/{register.setup-CbPytgHL.js → register.setup-C8xPuOMY.js} +4 -4
- package/dist/{register.status-health-sessions-B_BYvadL.js → register.status-health-sessions-DzM7DkCi.js} +3 -3
- package/dist/{register.status-health-sessions-DW422lcn.js → register.status-health-sessions-RqNzd4Pm.js} +3 -3
- package/dist/{register.subclis-DAEtHKAL.js → register.subclis-DcJgaLOK.js} +9 -9
- package/dist/{reply-BWno_mxL.js → reply-DiFKjgpz.js} +304 -102
- package/dist/{run-main-GCA3ZWtS.js → run-main-Ck0iMwKh.js} +14 -14
- package/dist/{runner-DUBExAb5.js → runner-BcQ0sF9T.js} +1 -1
- package/dist/{runner-odEv83vv.js → runner-D0QUGA_X.js} +1 -1
- package/dist/{server-methods-BgZzcT_t.js → server-methods-CBQha8Aw.js} +7 -7
- package/dist/{server-methods-C0qS1GBg.js → server-methods-pP1Q9SDn.js} +7 -7
- package/dist/{server-node-events-CCfQHLwH.js → server-node-events-CfY2QTYr.js} +2 -2
- package/dist/{server-node-events-BqTGMdx6.js → server-node-events-aW9AFIXA.js} +2 -2
- package/dist/{status-uaQ9lnOb.js → status-BKc593Qu.js} +1 -1
- package/dist/{status-C0ghzWRG.js → status-BNOqNwMY.js} +1 -1
- package/dist/{status-C_eTc_yp.js → status-DYp8kqmj.js} +2 -2
- package/dist/{status-BzeN5Od7.js → status-iwhTBXbZ.js} +2 -2
- package/dist/{subagent-registry-CtKDHowr.js → subagent-registry-yBrXpTO-.js} +304 -102
- package/dist/{update-cli-CYjjpmcv.js → update-cli-B8lS5-Z5.js} +8 -8
- package/dist/{update-cli-B2AkRDy-.js → update-cli-Cma87YH0.js} +7 -7
- package/dist/{update-runner-C71_pwI8.js → update-runner-Cx6XjioC.js} +1 -1
- package/dist/{update-runner-Co1TMSnd.js → update-runner-DZmjPgW-.js} +1 -1
- package/dist/{web-DOlZ2V8e.js → web-B9ciy43q.js} +6 -6
- package/dist/{web-YnBBOOGf.js → web-BWuN3c4n.js} +6 -6
- package/dist/{web-x4zdMRTu.js → web-C5liFFox.js} +1 -1
- package/dist/{web-DyULVUaV.js → web-CycbZoQb.js} +2 -2
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import { t as parseBooleanValue$1 } from "./boolean-B8-BqKGQ.js";
|
|
|
13
13
|
import { n as resolveCliName, r as isTruthyEnvValue, t as formatCliCommand } from "./command-format-BaxDnULz.js";
|
|
14
14
|
import { a as resolveSlackWebClientOptions, c as buildSlackBlocksFallbackText, i as createSlackWebClient, l as parseSlackTarget, o as parseSlackBlocksInput, s as validateSlackBlocksArray, t as sendMessageSlack, u as resolveSlackChannelId } from "./send-DeFniOjh.js";
|
|
15
15
|
import { $ as fetchChannelPermissionsDiscord, A as unpinMessageDiscord, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveTimestampMs, D as pinMessageDiscord, Dt as normalizeChannelSlug, E as listThreadsDiscord, Et as buildChannelKeyCandidates, F as fetchMemberInfoDiscord, G as uploadStickerDiscord, H as timeoutMemberDiscord, I as fetchRoleInfoDiscord, J as editChannelDiscord, K as createChannelDiscord, L as fetchVoiceStatusDiscord, M as banMemberDiscord, N as createScheduledEventDiscord, O as readMessagesDiscord, Ot as resolveChannelEntryMatchWithFallback, P as fetchChannelInfoDiscord, Q as stripUndefinedFields, R as kickMemberDiscord, S as deleteMessageDiscord, St as resolveDiscordSystemLocation, T as listPinsDiscord, Tt as applyChannelMatchMeta, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendPollDiscord, _t as resolveDiscordShouldRequireMention, a as removeReactionDiscord, at as resolveDiscordChannelId, b as sendWebhookMessageDiscord, bt as formatDiscordReactionEmoji, c as formatDiscordComponentEventText, ct as allowListMatches$1, d as parseDiscordModalCustomId, dt as normalizeDiscordSlug, et as hasAnyGuildPermissionDiscord, f as parseDiscordModalCustomIdForCarbon, ft as resolveDiscordAllowListMatch, g as sendMessageDiscord, gt as resolveDiscordOwnerAllowFrom, h as resolveDiscordModalEntry, ht as resolveDiscordMemberAccessState, i as removeOwnReactionsDiscord, it as parseDiscordTarget, j as addRoleDiscord, k as searchMessagesDiscord, l as parseDiscordComponentCustomId, lt as isDiscordGroupAllowedByPolicy, m as resolveDiscordComponentEntry, mt as resolveDiscordGuildEntry, n as fetchReactionsDiscord, nt as createDiscordClient, o as sendDiscordComponentMessage, ot as listDiscordDirectoryGroupsLive, p as readDiscordComponentSpec, pt as resolveDiscordChannelConfigWithFallback, q as deleteChannelDiscord, r as reactMessageDiscord, rt as createDiscordRestClient, s as createDiscordFormModal, st as listDiscordDirectoryPeersLive, tt as chunkDiscordTextWithMode, u as parseDiscordComponentCustomIdForCarbon, ut as normalizeDiscordAllowList, v as sendStickerDiscord, vt as resolveGroupDmAllow, w as fetchMessageDiscord, wt as fetchDiscord, x as createThreadDiscord, xt as formatDiscordUserTag, y as sendVoiceMessageDiscord, yt as shouldEmitDiscordReactionNotification, z as listGuildChannelsDiscord } from "./send-CiTGOvEc.js";
|
|
16
|
-
import { C as getGlobalHookRunner, S as parseInlineDirectives$1, _ as normalizeTargetForProvider, a as normalizeOutboundPayloadsForJson, b as MEDIA_TOKEN_RE, c as applyReplyThreading, d as isRenderablePayload, f as shouldSuppressMessagingToolReplies, g as normalizeChannelTargetInput, h as buildTargetResolverSignature, i as normalizeOutboundPayloads, l as filterMessagingToolDuplicates, m as resolveReplyToMode, o as normalizeReplyPayloadsForDelivery, p as createReplyToModeFilterForChannel, r as formatOutboundPayloadLog, s as applyReplyTagsToPayload, t as deliverOutboundPayloads, u as filterMessagingToolMediaDuplicates, v as throwIfAborted, w as initializeGlobalHookRunner, x as splitMediaFromOutput, y as parseReplyDirectives } from "./deliver-
|
|
16
|
+
import { C as getGlobalHookRunner, S as parseInlineDirectives$1, _ as normalizeTargetForProvider, a as normalizeOutboundPayloadsForJson, b as MEDIA_TOKEN_RE, c as applyReplyThreading, d as isRenderablePayload, f as shouldSuppressMessagingToolReplies, g as normalizeChannelTargetInput, h as buildTargetResolverSignature, i as normalizeOutboundPayloads, l as filterMessagingToolDuplicates, m as resolveReplyToMode, o as normalizeReplyPayloadsForDelivery, p as createReplyToModeFilterForChannel, r as formatOutboundPayloadLog, s as applyReplyTagsToPayload, t as deliverOutboundPayloads, u as filterMessagingToolMediaDuplicates, v as throwIfAborted, w as initializeGlobalHookRunner, x as splitMediaFromOutput, y as parseReplyDirectives } from "./deliver-D1ZN6-fl.js";
|
|
17
17
|
import { a as logMessageProcessed, c as logWebhookError, d as startDiagnosticHeartbeat, f as stopDiagnosticHeartbeat, i as logLaneEnqueue, l as logWebhookProcessed, m as isDiagnosticsEnabled, o as logMessageQueued, p as emitDiagnosticEvent, r as logLaneDequeue, s as logSessionStateChange, t as diag, u as logWebhookReceived } from "./diagnostic-CI0kRQkt.js";
|
|
18
18
|
import { r as getDiagnosticSessionState } from "./diagnostic-session-state-Bxo4UHOL.js";
|
|
19
19
|
import { n as resolveSignalAccount, t as listEnabledSignalAccounts } from "./accounts-CWktKM8a.js";
|
|
@@ -23,10 +23,10 @@ import { A as normalizeProviderId, C as buildAllowedModelSet, D as isCliProvider
|
|
|
23
23
|
import { a as saveJsonFile, i as loadJsonFile } from "./github-copilot-token-C_qUP7p5.js";
|
|
24
24
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-DaNAekda.js";
|
|
25
25
|
import { a as isMarkdownCapableMessageChannel, c as resolveGatewayMessageChannel, d as GATEWAY_CLIENT_MODES, f as GATEWAY_CLIENT_NAMES, i as isInternalMessageChannel, l as resolveMessageChannel, n as isDeliverableMessageChannel, o as listDeliverableMessageChannels, r as isGatewayMessageChannel, s as normalizeMessageChannel, t as INTERNAL_MESSAGE_CHANNEL, u as GATEWAY_CLIENT_IDS } from "./message-channel-Dz5lr5b0.js";
|
|
26
|
-
import { $ as normalizeDeliveryContext, A as isTransientHttpError, At as DEFAULT_UPLOAD_DIR, Bt as expandToolGroups, C as isContextOverflowError, Ct as resolveGroupSessionKey, D as isRateLimitAssistantError, Dt as registerBrowserRoutes, E as isLikelyContextOverflowError, Et as createBrowserRouteContext, F as resolveSandboxContext, Ft as resolveSandboxConfigForAgent, G as updateLastRoute, Gt as compileGlobPatterns, H as loadSessionStore, Ht as normalizeToolName, I as resolveSandboxRuntimeStatus, It as applyOwnerOnlyToolPolicy, J as isCacheEnabled, Jt as ensureSessionHeader, K as updateSessionStore, Kt as matchesAnyGlobPattern, L as extractDeliveryInfo, Lt as buildPluginToolGroups, M as parseImageSizeError, Mt as getBridgeAuthForPort, N as sanitizeUserFacingText, Nt as ensureBrowserControlAuth, O as isRawApiErrorPayload, Ot as resolveBrowserConfig, P as ensureSandboxWorkspaceForSession, Pt as resolveBrowserControlAuth, Q as mergeDeliveryContext, R as parseSessionThreadInfo, Rt as collectExplicitAllowlist, S as isCompactionFailureError, St as deriveSessionMetaPatch, T as isFailoverErrorMessage, Tt as resolveSessionLockMaxHoldFromTimeout, U as readSessionUpdatedAt, Ut as resolveToolProfilePolicy, V as resolveAndPersistSessionFile, Vt as mergeAlsoAllowPolicy, W as recordSessionMetaFromInbound, Wt as stripPluginOnlyAllowlist, X as deliveryContextFromSession, Xt as resolveBootstrapTotalMaxChars, Y as resolveCacheTtlMs$1, Yt as resolveBootstrapMaxChars, Z as deliveryContextKey, Zt as sanitizeGoogleTurnOrdering, _ as formatRawAssistantErrorForUi, _t as resolveFreshSessionTotalTokens, a as isMessagingToolDuplicateNormalized, at as extractToolCallNames, b as isBillingAssistantError, bt as resolveExplicitAgentSessionKey, c as extractToolCallsFromAssistant, ct as hasInterSessionUserProvenance, d as isAntigravityClaude, dt as evaluateSessionFreshness, et as normalizeSessionDeliveryFields, f as isGoogleModelApi, ft as resolveChannelResetConfig, g as formatBillingErrorMessage, gt as DEFAULT_RESET_TRIGGERS, h as formatAssistantErrorText, ht as resolveThreadFlag, it as countToolResults, j as parseImageDimensionError, jt as resolveExistingPathsWithinRoot, k as isTimeoutErrorMessage, kt as resolveProfile, l as extractToolResultId, lt as normalizeInputProvenance, m as classifyFailoverReason, mt as resolveSessionResetType, n as validateGeminiTurns, nt as archiveSessionTranscripts, o as normalizeTextForComparison, ot as INPUT_PROVENANCE_KIND_VALUES, p as BILLING_ERROR_USER_MESSAGE, pt as resolveSessionResetPolicy, q as updateSessionStoreEntry, qt as buildBootstrapContextFiles, r as pickFallbackThinkingLevel, rt as capArrayByJsonBytes, s as sanitizeSessionMessagesImages, st as applyInputProvenanceToUserMessage, t as validateAnthropicTurns, tt as normalizeAccountId$3, u as downgradeOpenAIReasoningBlocks, ut as resolveSessionKey, v as getApiErrorPayloadFingerprint, vt as canonicalizeMainSessionAlias, w as isFailoverAssistantError, wt as acquireSessionWriteLock, x as isCloudCodeAssistFormatError, xt as resolveMainSessionKey, y as isAuthAssistantError, z as appendAssistantMessageToSessionTranscript, zt as expandPolicyWithPluginGroups } from "./pi-embedded-helpers-
|
|
26
|
+
import { $ as normalizeDeliveryContext, A as isTransientHttpError, At as DEFAULT_UPLOAD_DIR, Bt as expandToolGroups, C as isContextOverflowError, Ct as resolveGroupSessionKey, D as isRateLimitAssistantError, Dt as registerBrowserRoutes, E as isLikelyContextOverflowError, Et as createBrowserRouteContext, F as resolveSandboxContext, Ft as resolveSandboxConfigForAgent, G as updateLastRoute, Gt as compileGlobPatterns, H as loadSessionStore, Ht as normalizeToolName, I as resolveSandboxRuntimeStatus, It as applyOwnerOnlyToolPolicy, J as isCacheEnabled, Jt as ensureSessionHeader, K as updateSessionStore, Kt as matchesAnyGlobPattern, L as extractDeliveryInfo, Lt as buildPluginToolGroups, M as parseImageSizeError, Mt as getBridgeAuthForPort, N as sanitizeUserFacingText, Nt as ensureBrowserControlAuth, O as isRawApiErrorPayload, Ot as resolveBrowserConfig, P as ensureSandboxWorkspaceForSession, Pt as resolveBrowserControlAuth, Q as mergeDeliveryContext, R as parseSessionThreadInfo, Rt as collectExplicitAllowlist, S as isCompactionFailureError, St as deriveSessionMetaPatch, T as isFailoverErrorMessage, Tt as resolveSessionLockMaxHoldFromTimeout, U as readSessionUpdatedAt, Ut as resolveToolProfilePolicy, V as resolveAndPersistSessionFile, Vt as mergeAlsoAllowPolicy, W as recordSessionMetaFromInbound, Wt as stripPluginOnlyAllowlist, X as deliveryContextFromSession, Xt as resolveBootstrapTotalMaxChars, Y as resolveCacheTtlMs$1, Yt as resolveBootstrapMaxChars, Z as deliveryContextKey, Zt as sanitizeGoogleTurnOrdering, _ as formatRawAssistantErrorForUi, _t as resolveFreshSessionTotalTokens, a as isMessagingToolDuplicateNormalized, at as extractToolCallNames, b as isBillingAssistantError, bt as resolveExplicitAgentSessionKey, c as extractToolCallsFromAssistant, ct as hasInterSessionUserProvenance, d as isAntigravityClaude, dt as evaluateSessionFreshness, et as normalizeSessionDeliveryFields, f as isGoogleModelApi, ft as resolveChannelResetConfig, g as formatBillingErrorMessage, gt as DEFAULT_RESET_TRIGGERS, h as formatAssistantErrorText, ht as resolveThreadFlag, it as countToolResults, j as parseImageDimensionError, jt as resolveExistingPathsWithinRoot, k as isTimeoutErrorMessage, kt as resolveProfile, l as extractToolResultId, lt as normalizeInputProvenance, m as classifyFailoverReason, mt as resolveSessionResetType, n as validateGeminiTurns, nt as archiveSessionTranscripts, o as normalizeTextForComparison, ot as INPUT_PROVENANCE_KIND_VALUES, p as BILLING_ERROR_USER_MESSAGE, pt as resolveSessionResetPolicy, q as updateSessionStoreEntry, qt as buildBootstrapContextFiles, r as pickFallbackThinkingLevel, rt as capArrayByJsonBytes, s as sanitizeSessionMessagesImages, st as applyInputProvenanceToUserMessage, t as validateAnthropicTurns, tt as normalizeAccountId$3, u as downgradeOpenAIReasoningBlocks, ut as resolveSessionKey, v as getApiErrorPayloadFingerprint, vt as canonicalizeMainSessionAlias, w as isFailoverAssistantError, wt as acquireSessionWriteLock, x as isCloudCodeAssistFormatError, xt as resolveMainSessionKey, y as isAuthAssistantError, z as appendAssistantMessageToSessionTranscript, zt as expandPolicyWithPluginGroups } from "./pi-embedded-helpers-ag2bosuj.js";
|
|
27
27
|
import { A as VERSION, C as getConfigValueAtPath, D as isSafeExecutableValue, E as unsetConfigValueAtPath, O as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, S as unsetConfigOverride, T as setConfigValueAtPath, _ as parseDurationMs, a as writeConfigFile, b as resetConfigOverrides, c as TELEGRAM_COMMAND_NAME_PATTERN, f as isInboundPathAllowed, g as normalizeScpRemoteHost, h as resolveIMessageRemoteAttachmentRoots, i as resolveConfigSnapshotHash, k as resolveAgentMaxConcurrent, l as normalizeTelegramCommandName, m as resolveIMessageAttachmentRoots, n as loadConfig, o as validateConfigObjectWithPlugins, r as readConfigFileSnapshot, u as resolveTelegramCustomCommands, v as validateJsonSchemaValue, w as parseConfigPath, x as setConfigOverride, y as getConfigOverrides } from "./config-DRbjHIwD.js";
|
|
28
28
|
import { a as applyTestPluginDefaults, c as resolveMemorySlotDecision, d as isDangerousHostEnvVarName, i as safeStatSync, n as discoverSymiPlugins, o as normalizePluginsConfig, r as isPathInside, s as resolveEnableState, t as loadPluginManifestRegistry, u as isPathInsideWithRealpath } from "./manifest-registry-D0IQ3WuX.js";
|
|
29
|
-
import { C as rawDataToString, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, T as isSecureWebSocketUrl, x as ensureChromeExtensionRelayServer } from "./chrome-
|
|
29
|
+
import { C as rawDataToString, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, T as isSecureWebSocketUrl, x as ensureChromeExtensionRelayServer } from "./chrome-EyvdASWt.js";
|
|
30
30
|
import { c as assertSandboxPath, d as resolveSandboxedMediaSource, f as applySkillEnvOverrides, i as resolveSkillsPromptForRun, l as resolveSandboxInputPath, n as buildWorkspaceSkillSnapshot, p as applySkillEnvOverridesFromSnapshot, r as loadWorkspaceSkillEntries, s as assertMediaNotDataUrl } from "./skills-BFekKL7i.js";
|
|
31
31
|
import { n as formatErrorMessage, r as formatUncaughtError } from "./errors-BoQgnc8X.js";
|
|
32
32
|
import { i as isBlockedHostnameOrIp, o as normalizeHostname, t as SsrFBlockedError } from "./ssrf-BTMDZjHT.js";
|
|
@@ -37,7 +37,7 @@ import { t as resolveIMessageAccount } from "./accounts-qtxJ-6em.js";
|
|
|
37
37
|
import { i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath, t as resolveDefaultSessionStorePath } from "./paths-DLyHUt31.js";
|
|
38
38
|
import { t as emitSessionTranscriptUpdate } from "./transcript-events-DDYvbmRV.js";
|
|
39
39
|
import { i as resolveImageSanitizationLimits, n as sanitizeImageBlocks, r as sanitizeToolResultImages } from "./tool-images-DXB7tqWi.js";
|
|
40
|
-
import { S as ensureSymiModelsJson, _ as stripMinimaxToolCallXml, a as decodeDataUrl, b as stripReasoningTagsFromText, c as extractAssistantText$1, d as extractThinkingFromTaggedText, f as formatReasoningMessage, g as stripDowngradedToolCallText, h as promoteThinkingTagsToBlocks, i as coerceImageModelConfig, l as extractAssistantThinking, m as isAssistantMessage, o as resolveProviderVisionModelFromConfig, p as inferToolMetaFromArgs, r as coerceImageAssistantText, s as minimaxUnderstandImage, u as extractThinkingFromTaggedStream, v as stripThinkingTagsFromText, x as extractTextFromChatContent, y as resolveToolDisplay } from "./image-
|
|
40
|
+
import { S as ensureSymiModelsJson, _ as stripMinimaxToolCallXml, a as decodeDataUrl, b as stripReasoningTagsFromText, c as extractAssistantText$1, d as extractThinkingFromTaggedText, f as formatReasoningMessage, g as stripDowngradedToolCallText, h as promoteThinkingTagsToBlocks, i as coerceImageModelConfig, l as extractAssistantThinking, m as isAssistantMessage, o as resolveProviderVisionModelFromConfig, p as inferToolMetaFromArgs, r as coerceImageAssistantText, s as minimaxUnderstandImage, u as extractThinkingFromTaggedStream, v as stripThinkingTagsFromText, x as extractTextFromChatContent, y as resolveToolDisplay } from "./image-Cp3JDEBB.js";
|
|
41
41
|
import { a as resolveAgentIdentity, i as resolveAckReaction, o as resolveEffectiveMessagesConfig, r as resolveResponsePrefixTemplate, s as resolveHumanDelayConfig, t as createReplyPrefixOptions } from "./reply-prefix-XlyuyChD.js";
|
|
42
42
|
import { i as resolveMemorySearchConfig, n as probeOllamaEmbeddingModels, r as resolveOllamaBaseUrl } from "./manager-D_LwXbc6.js";
|
|
43
43
|
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths, g as runTasksWithConcurrency } from "./sqlite-DRbx2dhW.js";
|
|
@@ -51,7 +51,7 @@ import { a as loadWebMedia, i as getDefaultLocalRoots } from "./ir-DccrnjsE.js";
|
|
|
51
51
|
import { _ as resolveNativeCommandsEnabled, a as listChatCommandsForConfig, c as normalizeCommandBody, d as resolveCommandArgMenu, f as serializeCommandArgs, g as isRestartEnabled, h as isNativeCommandsExplicitlyDisabled, i as listChatCommands, l as parseCommandArgs, m as isCommandFlagEnabled, o as listNativeCommandSpecs, p as shouldHandleTextCommands, r as findCommandByNativeName, s as listNativeCommandSpecsForConfig, t as buildCommandTextFromArgs, u as resolveCommandArgChoices, v as resolveNativeSkillsEnabled } from "./commands-registry-D7CTCQPm.js";
|
|
52
52
|
import { c as getSkillsSnapshotVersion, d as createAsyncLock, f as readJsonFile, i as resolveSkillCommandInvocation, l as pruneExpiredPending, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, p as writeJsonAtomic, r as listSkillCommandsForWorkspace, s as ensureSkillsWatcher, t as listReservedChatSlashCommandNames, u as resolvePairingPaths } from "./skill-commands-BJMb_psG.js";
|
|
53
53
|
import { r as normalizeInboundTextNewlines, t as finalizeInboundContext } from "./inbound-context-BlHX0H3E.js";
|
|
54
|
-
import { _ as resolveMediaUnderstandingScope, a as resolveMediaAttachmentLocalRoots, c as loadModelCatalog, d as resolveAttachmentKind, f as buildRandomTempFilePath, g as normalizeMediaUnderstandingChatType, h as resolveTimeoutMs$1, i as resolveAutoImageModel, l as modelSupportsVision, m as resolveConcurrency, n as createMediaAttachmentCache, o as runCapability, p as registerUnhandledRejectionHandler, r as normalizeMediaAttachments, s as findModelInCatalog, t as buildProviderRegistry, v as CLI_OUTPUT_MAX_BUFFER, y as applyTemplate } from "./runner-
|
|
54
|
+
import { _ as resolveMediaUnderstandingScope, a as resolveMediaAttachmentLocalRoots, c as loadModelCatalog, d as resolveAttachmentKind, f as buildRandomTempFilePath, g as normalizeMediaUnderstandingChatType, h as resolveTimeoutMs$1, i as resolveAutoImageModel, l as modelSupportsVision, m as resolveConcurrency, n as createMediaAttachmentCache, o as runCapability, p as registerUnhandledRejectionHandler, r as normalizeMediaAttachments, s as findModelInCatalog, t as buildProviderRegistry, v as CLI_OUTPUT_MAX_BUFFER, y as applyTemplate } from "./runner-D0QUGA_X.js";
|
|
55
55
|
import { n as wrapFetchWithAbortSignal, t as resolveFetch } from "./fetch-Bso4i15F.js";
|
|
56
56
|
import { n as recordCommandPoll, r as resetCommandPollCount } from "./command-poll-backoff-Bup9wS1y.js";
|
|
57
57
|
import { n as recordChannelActivity, r as createDiscordRetryRunner, t as getChannelActivity } from "./channel-activity-CsM_hJ_s.js";
|
|
@@ -76,12 +76,12 @@ import { inspect, promisify } from "node:util";
|
|
|
76
76
|
import { fileURLToPath } from "node:url";
|
|
77
77
|
import { CURRENT_SESSION_VERSION, DefaultResourceLoader, SessionManager, SettingsManager, codingTools, createAgentSession, createEditTool, createReadTool, createWriteTool, estimateTokens, generateSummary, readTool } from "@mariozechner/pi-coding-agent";
|
|
78
78
|
import crypto, { X509Certificate, createHash, createHmac, randomBytes, randomUUID } from "node:crypto";
|
|
79
|
-
import { complete, completeSimple, streamSimple } from "@mariozechner/pi-ai";
|
|
79
|
+
import { complete, completeSimple, createAssistantMessageEventStream, streamSimple } from "@mariozechner/pi-ai";
|
|
80
80
|
import { EdgeTTS } from "node-edge-tts";
|
|
81
81
|
import AjvPkg from "ajv";
|
|
82
82
|
import { createServer } from "node:http";
|
|
83
83
|
import { ProxyAgent, fetch as fetch$1 } from "undici";
|
|
84
|
-
import WebSocket
|
|
84
|
+
import WebSocket, { WebSocket as WebSocket$1 } from "ws";
|
|
85
85
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
86
86
|
import { createJiti } from "jiti";
|
|
87
87
|
import { Type } from "@sinclair/typebox";
|
|
@@ -5716,7 +5716,7 @@ var GatewayClient = class {
|
|
|
5716
5716
|
if (fingerprint !== expected) return /* @__PURE__ */ new Error("gateway tls fingerprint mismatch");
|
|
5717
5717
|
});
|
|
5718
5718
|
}
|
|
5719
|
-
this.ws = new WebSocket(url, wsOptions);
|
|
5719
|
+
this.ws = new WebSocket$1(url, wsOptions);
|
|
5720
5720
|
this.ws.on("open", () => {
|
|
5721
5721
|
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
5722
5722
|
const tlsError = this.validateTlsFingerprint();
|
|
@@ -5935,7 +5935,7 @@ var GatewayClient = class {
|
|
|
5935
5935
|
return null;
|
|
5936
5936
|
}
|
|
5937
5937
|
async request(method, params, opts) {
|
|
5938
|
-
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("gateway not connected");
|
|
5938
|
+
if (!this.ws || this.ws.readyState !== WebSocket$1.OPEN) throw new Error("gateway not connected");
|
|
5939
5939
|
const id = randomUUID();
|
|
5940
5940
|
const frame = {
|
|
5941
5941
|
type: "req",
|
|
@@ -7201,7 +7201,7 @@ async function routeReply(params) {
|
|
|
7201
7201
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
7202
7202
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
7203
7203
|
try {
|
|
7204
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
7204
|
+
const { deliverOutboundPayloads } = await import("./deliver-D1ZN6-fl.js").then((n) => n.n);
|
|
7205
7205
|
return {
|
|
7206
7206
|
ok: true,
|
|
7207
7207
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -41675,7 +41675,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
41675
41675
|
return;
|
|
41676
41676
|
}
|
|
41677
41677
|
try {
|
|
41678
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
41678
|
+
const { deliverOutboundPayloads } = await import("./deliver-D1ZN6-fl.js").then((n) => n.n);
|
|
41679
41679
|
await deliverOutboundPayloads({
|
|
41680
41680
|
cfg: params.cfg,
|
|
41681
41681
|
channel,
|
|
@@ -45121,7 +45121,7 @@ async function describeStickerImage(params) {
|
|
|
45121
45121
|
logVerbose(`telegram: describing sticker with ${provider}/${model}`);
|
|
45122
45122
|
try {
|
|
45123
45123
|
const buffer = await fs.readFile(imagePath);
|
|
45124
|
-
const { describeImageWithModel } = await import("./image-
|
|
45124
|
+
const { describeImageWithModel } = await import("./image-Cp3JDEBB.js").then((n) => n.n);
|
|
45125
45125
|
return (await describeImageWithModel({
|
|
45126
45126
|
buffer,
|
|
45127
45127
|
fileName: "sticker.webp",
|
|
@@ -47783,7 +47783,7 @@ async function preflightDiscordMessage(params) {
|
|
|
47783
47783
|
let preflightTranscript;
|
|
47784
47784
|
const hasAudioAttachment = message.attachments?.some((att) => att.contentType?.startsWith("audio/"));
|
|
47785
47785
|
if (!isDirectMessage && shouldRequireMention && hasAudioAttachment && !baseText && mentionRegexes.length > 0) try {
|
|
47786
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
47786
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-D02HwB-I.js");
|
|
47787
47787
|
const audioPaths = message.attachments?.filter((att) => att.contentType?.startsWith("audio/")).map((att) => att.url) ?? [];
|
|
47788
47788
|
if (audioPaths.length > 0) preflightTranscript = await transcribeFirstAudio({
|
|
47789
47789
|
ctx: {
|
|
@@ -52277,6 +52277,199 @@ function createCacheTrace(params) {
|
|
|
52277
52277
|
};
|
|
52278
52278
|
}
|
|
52279
52279
|
|
|
52280
|
+
//#endregion
|
|
52281
|
+
//#region src/agents/model-token-filter.ts
|
|
52282
|
+
/**
|
|
52283
|
+
* Strips model-specific control tokens from streamed text.
|
|
52284
|
+
*
|
|
52285
|
+
* Used both server-side (in the streaming pipeline) and by the Glass UI
|
|
52286
|
+
* (as a defense-in-depth fallback). The patterns here cover tokens known
|
|
52287
|
+
* to leak from Gemma 4 / vLLM; Claude output is left untouched.
|
|
52288
|
+
*/
|
|
52289
|
+
const GEMMA_TOKEN_PATTERNS = [
|
|
52290
|
+
/<\|channel>\w*/g,
|
|
52291
|
+
/<channel\|>/g,
|
|
52292
|
+
/<start_of_turn>(?:model|user)?/g,
|
|
52293
|
+
/<end_of_turn>/g,
|
|
52294
|
+
/<\|(?:fim_prefix|fim_suffix|fim_middle)\|>/g,
|
|
52295
|
+
/^\s*<bos>\s*/gm,
|
|
52296
|
+
/<\|[^|>]{0,30}\|>/g,
|
|
52297
|
+
/<\|[^>]{0,30}>/g
|
|
52298
|
+
];
|
|
52299
|
+
/**
|
|
52300
|
+
* Aggressively strip all fragments of model control token corruption from
|
|
52301
|
+
* tool arguments. This catches cases where the model produces raw garbage
|
|
52302
|
+
* like `<|<|"|<|<|\'` that doesn't match any known token template.
|
|
52303
|
+
*/
|
|
52304
|
+
const AGGRESSIVE_TOKEN_FRAGMENTS = [/<\|/g, /\|>/g];
|
|
52305
|
+
const GEMMA_MODEL_HINTS$1 = ["gemma", "redsand/"];
|
|
52306
|
+
function isGemmaModel$1(modelId) {
|
|
52307
|
+
const lower = modelId.toLowerCase();
|
|
52308
|
+
return GEMMA_MODEL_HINTS$1.some((hint) => lower.includes(hint));
|
|
52309
|
+
}
|
|
52310
|
+
/**
|
|
52311
|
+
* Strip known control tokens from text. Only applies to Gemma-family models;
|
|
52312
|
+
* other models pass through unchanged.
|
|
52313
|
+
*/
|
|
52314
|
+
/**
|
|
52315
|
+
* Strip known control tokens from text. Only applies to Gemma-family models;
|
|
52316
|
+
* other models pass through unchanged. Used for streamed text output.
|
|
52317
|
+
*/
|
|
52318
|
+
function stripModelTokens(text, modelId) {
|
|
52319
|
+
if (!text || !isGemmaModel$1(modelId)) return text;
|
|
52320
|
+
let result = text;
|
|
52321
|
+
for (const re of GEMMA_TOKEN_PATTERNS) {
|
|
52322
|
+
re.lastIndex = 0;
|
|
52323
|
+
result = result.replace(re, "");
|
|
52324
|
+
}
|
|
52325
|
+
return result;
|
|
52326
|
+
}
|
|
52327
|
+
/**
|
|
52328
|
+
* Aggressively strip ALL token-like fragments from a string. Used for tool
|
|
52329
|
+
* call arguments where any `<|` corruption causes downstream failures.
|
|
52330
|
+
* More aggressive than `stripModelTokens` — removes bare `<|` and `|>` fragments
|
|
52331
|
+
* that don't match any known token template.
|
|
52332
|
+
*/
|
|
52333
|
+
function stripModelTokensAggressive(text, modelId) {
|
|
52334
|
+
if (!text || !isGemmaModel$1(modelId)) return text;
|
|
52335
|
+
let result = stripModelTokens(text, modelId);
|
|
52336
|
+
for (const re of AGGRESSIVE_TOKEN_FRAGMENTS) {
|
|
52337
|
+
re.lastIndex = 0;
|
|
52338
|
+
result = result.replace(re, "");
|
|
52339
|
+
}
|
|
52340
|
+
return result;
|
|
52341
|
+
}
|
|
52342
|
+
|
|
52343
|
+
//#endregion
|
|
52344
|
+
//#region src/agents/output-normalizer.ts
|
|
52345
|
+
const MONOLOGUE_REGEX_PATTERNS = [
|
|
52346
|
+
/\n*I have addressed the request fully\.?\s*(?:\n[\s\S]*)?$/,
|
|
52347
|
+
/\n*I[''\u2019]ve reviewed my response[\s\S]*$/,
|
|
52348
|
+
/\n*\*?\*?Verification:?\*?\*?\s*\n[\s\S]*?(?:Everything is correct|All requirements met)\.?\s*\u2705?\s*$/,
|
|
52349
|
+
/\n*\d+\.\s*\*?\*?Requirements:?\*?\*?[\s\S]*?\d+\.\s*\*?\*?Verification:?\*?\*?[\s\S]*$/
|
|
52350
|
+
];
|
|
52351
|
+
const SELF_REF_OPENERS = [
|
|
52352
|
+
"i have addressed",
|
|
52353
|
+
"i've reviewed",
|
|
52354
|
+
"i‘ve reviewed",
|
|
52355
|
+
"i’ve reviewed",
|
|
52356
|
+
"status check",
|
|
52357
|
+
"address requirements",
|
|
52358
|
+
"verification:",
|
|
52359
|
+
"requirements:"
|
|
52360
|
+
];
|
|
52361
|
+
const ASSESSMENT_KEYWORDS = [
|
|
52362
|
+
"requirements",
|
|
52363
|
+
"verification",
|
|
52364
|
+
"correct",
|
|
52365
|
+
"addressed",
|
|
52366
|
+
"fulfilled",
|
|
52367
|
+
"confirmed",
|
|
52368
|
+
"passed"
|
|
52369
|
+
];
|
|
52370
|
+
/**
|
|
52371
|
+
* Layer 2: Structural monologue detection.
|
|
52372
|
+
* Detects a trailing block that:
|
|
52373
|
+
* 1. Starts after a double newline
|
|
52374
|
+
* 2. Opens with a self-referential phrase
|
|
52375
|
+
* 3. Contains a numbered list with assessment keywords
|
|
52376
|
+
* 4. Sits at the end of the text
|
|
52377
|
+
*/
|
|
52378
|
+
function detectMonologueStructural(text) {
|
|
52379
|
+
let searchFrom = Math.floor(text.length * .15);
|
|
52380
|
+
while (searchFrom < text.length) {
|
|
52381
|
+
const breakPos = text.indexOf("\n\n", searchFrom);
|
|
52382
|
+
if (breakPos < 0) return null;
|
|
52383
|
+
const trailingBlock = text.slice(breakPos).toLowerCase();
|
|
52384
|
+
if (!SELF_REF_OPENERS.some((opener) => trailingBlock.includes(opener))) {
|
|
52385
|
+
searchFrom = breakPos + 2;
|
|
52386
|
+
continue;
|
|
52387
|
+
}
|
|
52388
|
+
const hasNumberedList = /\d+\.\s/.test(trailingBlock);
|
|
52389
|
+
const hasBoldHeaders = /\*\*\w/.test(trailingBlock);
|
|
52390
|
+
if (!hasNumberedList && !hasBoldHeaders) {
|
|
52391
|
+
searchFrom = breakPos + 2;
|
|
52392
|
+
continue;
|
|
52393
|
+
}
|
|
52394
|
+
if (ASSESSMENT_KEYWORDS.filter((kw) => trailingBlock.includes(kw)).length < 2) {
|
|
52395
|
+
searchFrom = breakPos + 2;
|
|
52396
|
+
continue;
|
|
52397
|
+
}
|
|
52398
|
+
return breakPos;
|
|
52399
|
+
}
|
|
52400
|
+
return null;
|
|
52401
|
+
}
|
|
52402
|
+
/**
|
|
52403
|
+
* Strip monologue from final text using the hierarchy:
|
|
52404
|
+
* Layer 2 (structural) first, Layer 3 (regex) as fallback.
|
|
52405
|
+
* Layer 1 (prompt tuning) happens before the model produces output.
|
|
52406
|
+
*/
|
|
52407
|
+
function stripMonologue(text) {
|
|
52408
|
+
const structuralCut = detectMonologueStructural(text);
|
|
52409
|
+
if (structuralCut !== null) {
|
|
52410
|
+
const cleaned = text.slice(0, structuralCut).trim();
|
|
52411
|
+
if (cleaned) return cleaned;
|
|
52412
|
+
}
|
|
52413
|
+
for (const pattern of MONOLOGUE_REGEX_PATTERNS) {
|
|
52414
|
+
const result = text.replace(pattern, "");
|
|
52415
|
+
if (result !== text && result.trim()) return result.trim();
|
|
52416
|
+
}
|
|
52417
|
+
return text;
|
|
52418
|
+
}
|
|
52419
|
+
const DEFAULT_REPETITION_MIN_BLOCK = 150;
|
|
52420
|
+
function detectRepetition(text, minBlock) {
|
|
52421
|
+
if (text.length < minBlock * 2.5) return false;
|
|
52422
|
+
const sampleStart = Math.floor(text.length * .25);
|
|
52423
|
+
const sample = text.slice(sampleStart, sampleStart + minBlock);
|
|
52424
|
+
const searchStart = sampleStart + minBlock;
|
|
52425
|
+
return text.indexOf(sample, searchStart) >= 0;
|
|
52426
|
+
}
|
|
52427
|
+
function sanitizeArgs(args, modelId) {
|
|
52428
|
+
const result = {};
|
|
52429
|
+
for (const [key, value] of Object.entries(args)) if (typeof value === "string") result[key] = stripModelTokensAggressive(value, modelId);
|
|
52430
|
+
else if (Array.isArray(value)) result[key] = value.map((item) => typeof item === "string" ? stripModelTokensAggressive(item, modelId) : item && typeof item === "object" ? sanitizeArgs(item, modelId) : item);
|
|
52431
|
+
else if (value && typeof value === "object") result[key] = sanitizeArgs(value, modelId);
|
|
52432
|
+
else result[key] = value;
|
|
52433
|
+
return result;
|
|
52434
|
+
}
|
|
52435
|
+
/**
|
|
52436
|
+
* Create an output normalizer configured for the given model profile.
|
|
52437
|
+
*
|
|
52438
|
+
* For Claude: passthrough (no stripping, no monologue, no aggressive cleaning).
|
|
52439
|
+
* For Gemma/vLLM: full normalization pipeline.
|
|
52440
|
+
* For unknown: conservative defaults.
|
|
52441
|
+
*/
|
|
52442
|
+
function createOutputNormalizer(profile, modelId) {
|
|
52443
|
+
const isGemma = isGemmaModel$1(modelId);
|
|
52444
|
+
const shouldStrip = isGemma || profile.filters.stripPatterns.length > 0;
|
|
52445
|
+
const shouldSuppressMonologue = profile.filters.suppressMonologue;
|
|
52446
|
+
let accumulated = "";
|
|
52447
|
+
return {
|
|
52448
|
+
normalizeTextDelta(delta) {
|
|
52449
|
+
const text = shouldStrip ? stripModelTokens(delta, modelId) : delta;
|
|
52450
|
+
accumulated += text;
|
|
52451
|
+
if (detectRepetition(accumulated, DEFAULT_REPETITION_MIN_BLOCK)) return {
|
|
52452
|
+
text,
|
|
52453
|
+
abort: { reason: "repetition-detected" }
|
|
52454
|
+
};
|
|
52455
|
+
return { text };
|
|
52456
|
+
},
|
|
52457
|
+
normalizeToolArgs(args) {
|
|
52458
|
+
if (!isGemma) return args;
|
|
52459
|
+
return sanitizeArgs(args, modelId);
|
|
52460
|
+
},
|
|
52461
|
+
normalizeFinalText(text) {
|
|
52462
|
+
let result = text;
|
|
52463
|
+
if (shouldStrip) result = stripModelTokens(result, modelId);
|
|
52464
|
+
if (shouldSuppressMonologue) result = stripMonologue(result);
|
|
52465
|
+
return result.trim();
|
|
52466
|
+
},
|
|
52467
|
+
reset() {
|
|
52468
|
+
accumulated = "";
|
|
52469
|
+
}
|
|
52470
|
+
};
|
|
52471
|
+
}
|
|
52472
|
+
|
|
52280
52473
|
//#endregion
|
|
52281
52474
|
//#region src/agents/model-aware-stream.ts
|
|
52282
52475
|
/**
|
|
@@ -52288,6 +52481,7 @@ function createCacheTrace(params) {
|
|
|
52288
52481
|
*/
|
|
52289
52482
|
function createModelAwareStreamFn(opts) {
|
|
52290
52483
|
const underlying = opts.baseStreamFn ?? streamSimple;
|
|
52484
|
+
const fullModelId = opts.provider ? `${opts.provider}/${opts.modelId}` : opts.modelId;
|
|
52291
52485
|
const mergedParams = {
|
|
52292
52486
|
...opts.profile.params,
|
|
52293
52487
|
...opts.configExtraParams,
|
|
@@ -52324,9 +52518,11 @@ function createModelAwareStreamFn(opts) {
|
|
|
52324
52518
|
}
|
|
52325
52519
|
callerOnPayload?.(payload);
|
|
52326
52520
|
};
|
|
52521
|
+
const normalizer = createOutputNormalizer(opts.profile, fullModelId);
|
|
52327
52522
|
return (model, context, options) => {
|
|
52328
52523
|
const callerOnPayload = options?.onPayload;
|
|
52329
|
-
|
|
52524
|
+
normalizer.reset();
|
|
52525
|
+
const streamOrPromise = underlying(model, context, {
|
|
52330
52526
|
...nativeOpts,
|
|
52331
52527
|
...options,
|
|
52332
52528
|
onPayload: (payload) => onPayloadHook(payload, callerOnPayload),
|
|
@@ -52335,8 +52531,106 @@ function createModelAwareStreamFn(opts) {
|
|
|
52335
52531
|
...options?.headers
|
|
52336
52532
|
} } : {}
|
|
52337
52533
|
});
|
|
52534
|
+
if (streamOrPromise instanceof Promise) return streamOrPromise.then((s) => wrapStreamWithNormalizer(s, normalizer));
|
|
52535
|
+
return wrapStreamWithNormalizer(streamOrPromise, normalizer);
|
|
52338
52536
|
};
|
|
52339
52537
|
}
|
|
52538
|
+
/**
|
|
52539
|
+
* Wrap an AssistantMessageEventStream to intercept and normalize events:
|
|
52540
|
+
* - text_delta: strip tokens, detect repetition
|
|
52541
|
+
* - toolcall_end: sanitize tool call arguments
|
|
52542
|
+
* - done: normalize final message text
|
|
52543
|
+
*/
|
|
52544
|
+
function wrapStreamWithNormalizer(rawStream, normalizer) {
|
|
52545
|
+
const normalized = createAssistantMessageEventStream();
|
|
52546
|
+
(async () => {
|
|
52547
|
+
try {
|
|
52548
|
+
for await (const event of rawStream) {
|
|
52549
|
+
const processed = normalizeEvent(event, normalizer);
|
|
52550
|
+
if (processed.abort) {
|
|
52551
|
+
normalized.push({
|
|
52552
|
+
type: "error",
|
|
52553
|
+
reason: "aborted",
|
|
52554
|
+
errorMessage: `output-normalizer: ${processed.abort.reason}`,
|
|
52555
|
+
usage: {
|
|
52556
|
+
input: 0,
|
|
52557
|
+
output: 0
|
|
52558
|
+
}
|
|
52559
|
+
});
|
|
52560
|
+
break;
|
|
52561
|
+
}
|
|
52562
|
+
normalized.push(processed.event);
|
|
52563
|
+
}
|
|
52564
|
+
} catch (err) {
|
|
52565
|
+
normalized.push({
|
|
52566
|
+
type: "error",
|
|
52567
|
+
reason: "error",
|
|
52568
|
+
errorMessage: err instanceof Error ? err.message : String(err),
|
|
52569
|
+
usage: {
|
|
52570
|
+
input: 0,
|
|
52571
|
+
output: 0
|
|
52572
|
+
}
|
|
52573
|
+
});
|
|
52574
|
+
}
|
|
52575
|
+
})();
|
|
52576
|
+
return normalized;
|
|
52577
|
+
}
|
|
52578
|
+
function normalizeEvent(event, normalizer) {
|
|
52579
|
+
if (event.type === "text_delta") {
|
|
52580
|
+
const result = normalizer.normalizeTextDelta(event.delta);
|
|
52581
|
+
if (result.abort) return {
|
|
52582
|
+
event,
|
|
52583
|
+
abort: result.abort
|
|
52584
|
+
};
|
|
52585
|
+
if (result.text !== event.delta) return { event: {
|
|
52586
|
+
...event,
|
|
52587
|
+
delta: result.text
|
|
52588
|
+
} };
|
|
52589
|
+
return { event };
|
|
52590
|
+
}
|
|
52591
|
+
if (event.type === "toolcall_end" && event.toolCall) {
|
|
52592
|
+
const tc = event.toolCall;
|
|
52593
|
+
if (tc.arguments && typeof tc.arguments === "object") {
|
|
52594
|
+
const cleanedArgs = normalizer.normalizeToolArgs(tc.arguments);
|
|
52595
|
+
return { event: {
|
|
52596
|
+
...event,
|
|
52597
|
+
toolCall: {
|
|
52598
|
+
...tc,
|
|
52599
|
+
arguments: cleanedArgs
|
|
52600
|
+
}
|
|
52601
|
+
} };
|
|
52602
|
+
}
|
|
52603
|
+
return { event };
|
|
52604
|
+
}
|
|
52605
|
+
if (event.type === "done" && event.message) {
|
|
52606
|
+
const msg = event.message;
|
|
52607
|
+
if (Array.isArray(msg.content)) {
|
|
52608
|
+
let changed = false;
|
|
52609
|
+
const normalizedContent = msg.content.map((block) => {
|
|
52610
|
+
if (block.type === "text" && "text" in block) {
|
|
52611
|
+
const cleaned = normalizer.normalizeFinalText(block.text);
|
|
52612
|
+
if (cleaned !== block.text) {
|
|
52613
|
+
changed = true;
|
|
52614
|
+
return {
|
|
52615
|
+
...block,
|
|
52616
|
+
text: cleaned
|
|
52617
|
+
};
|
|
52618
|
+
}
|
|
52619
|
+
}
|
|
52620
|
+
return block;
|
|
52621
|
+
});
|
|
52622
|
+
if (changed) return { event: {
|
|
52623
|
+
...event,
|
|
52624
|
+
message: {
|
|
52625
|
+
...msg,
|
|
52626
|
+
content: normalizedContent
|
|
52627
|
+
}
|
|
52628
|
+
} };
|
|
52629
|
+
}
|
|
52630
|
+
return { event };
|
|
52631
|
+
}
|
|
52632
|
+
return { event };
|
|
52633
|
+
}
|
|
52340
52634
|
/** Detect vLLM/Gemma providers by model hints or baseUrl patterns. */
|
|
52341
52635
|
function isVllmProvider(provider, modelId, config) {
|
|
52342
52636
|
const lower = `${provider}/${modelId}`.toLowerCase();
|
|
@@ -55398,7 +55692,7 @@ function resolveSymipulseMs(opts) {
|
|
|
55398
55692
|
|
|
55399
55693
|
//#endregion
|
|
55400
55694
|
//#region src/agents/transcript-policy.ts
|
|
55401
|
-
const GEMMA_MODEL_HINTS
|
|
55695
|
+
const GEMMA_MODEL_HINTS = ["gemma", "redsand/"];
|
|
55402
55696
|
const MISTRAL_MODEL_HINTS = [
|
|
55403
55697
|
"mistral",
|
|
55404
55698
|
"mixtral",
|
|
@@ -55427,11 +55721,11 @@ function isAnthropicApi(modelApi, provider) {
|
|
|
55427
55721
|
if (modelApi === "anthropic-messages") return true;
|
|
55428
55722
|
return normalizeProviderId(provider ?? "") === "anthropic";
|
|
55429
55723
|
}
|
|
55430
|
-
function isGemmaModel
|
|
55724
|
+
function isGemmaModel(params) {
|
|
55431
55725
|
if (normalizeProviderId(params.provider ?? "") === "redsand") return true;
|
|
55432
55726
|
const modelId = (params.modelId ?? "").toLowerCase();
|
|
55433
55727
|
if (!modelId) return false;
|
|
55434
|
-
return GEMMA_MODEL_HINTS
|
|
55728
|
+
return GEMMA_MODEL_HINTS.some((hint) => modelId.includes(hint));
|
|
55435
55729
|
}
|
|
55436
55730
|
function isMistralModel(params) {
|
|
55437
55731
|
if (normalizeProviderId(params.provider ?? "") === "mistral") return true;
|
|
@@ -55449,7 +55743,7 @@ function resolveTranscriptPolicy(params) {
|
|
|
55449
55743
|
provider,
|
|
55450
55744
|
modelId
|
|
55451
55745
|
});
|
|
55452
|
-
const isGemma = isGemmaModel
|
|
55746
|
+
const isGemma = isGemmaModel({
|
|
55453
55747
|
provider,
|
|
55454
55748
|
modelId
|
|
55455
55749
|
});
|
|
@@ -59907,7 +60201,7 @@ async function runAgentTurn(params) {
|
|
|
59907
60201
|
function createDefaultDeps() {
|
|
59908
60202
|
return {
|
|
59909
60203
|
sendMessageWhatsApp: async (...args) => {
|
|
59910
|
-
const { sendMessageWhatsApp } = await import("./web-
|
|
60204
|
+
const { sendMessageWhatsApp } = await import("./web-BWuN3c4n.js");
|
|
59911
60205
|
return await sendMessageWhatsApp(...args);
|
|
59912
60206
|
},
|
|
59913
60207
|
sendMessageTelegram: async (...args) => {
|
|
@@ -62812,7 +63106,7 @@ function createDiscordGatewayPlugin(params) {
|
|
|
62812
63106
|
super(options);
|
|
62813
63107
|
}
|
|
62814
63108
|
createWebSocket(url) {
|
|
62815
|
-
return new WebSocket
|
|
63109
|
+
return new WebSocket(url, { agent });
|
|
62816
63110
|
}
|
|
62817
63111
|
}
|
|
62818
63112
|
return new ProxyGatewayPlugin();
|
|
@@ -73030,7 +73324,7 @@ const buildTelegramMessageContext = async ({ primaryCtx, allMedia, storeAllowFro
|
|
|
73030
73324
|
const hasAudio = allMedia.some((media) => media.contentType?.startsWith("audio/"));
|
|
73031
73325
|
let preflightTranscript;
|
|
73032
73326
|
if (isGroup && requireMention && hasAudio && !hasUserText && mentionRegexes.length > 0) try {
|
|
73033
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
73327
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-D02HwB-I.js");
|
|
73034
73328
|
preflightTranscript = await transcribeFirstAudio({
|
|
73035
73329
|
ctx: {
|
|
73036
73330
|
MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
|
|
@@ -75187,7 +75481,7 @@ function loadWebLoginQr() {
|
|
|
75187
75481
|
return webLoginQrPromise;
|
|
75188
75482
|
}
|
|
75189
75483
|
function loadWebChannel() {
|
|
75190
|
-
webChannelPromise ??= import("./web-
|
|
75484
|
+
webChannelPromise ??= import("./web-BWuN3c4n.js");
|
|
75191
75485
|
return webChannelPromise;
|
|
75192
75486
|
}
|
|
75193
75487
|
function loadWhatsAppActions() {
|
|
@@ -76405,69 +76699,6 @@ function parseUpdateFileChunk(lines, lineNumber, allowMissingContext) {
|
|
|
76405
76699
|
};
|
|
76406
76700
|
}
|
|
76407
76701
|
|
|
76408
|
-
//#endregion
|
|
76409
|
-
//#region src/agents/model-token-filter.ts
|
|
76410
|
-
/**
|
|
76411
|
-
* Strips model-specific control tokens from streamed text.
|
|
76412
|
-
*
|
|
76413
|
-
* Used both server-side (in the streaming pipeline) and by the Glass UI
|
|
76414
|
-
* (as a defense-in-depth fallback). The patterns here cover tokens known
|
|
76415
|
-
* to leak from Gemma 4 / vLLM; Claude output is left untouched.
|
|
76416
|
-
*/
|
|
76417
|
-
const GEMMA_TOKEN_PATTERNS = [
|
|
76418
|
-
/<\|channel>\w*/g,
|
|
76419
|
-
/<channel\|>/g,
|
|
76420
|
-
/<start_of_turn>(?:model|user)?/g,
|
|
76421
|
-
/<end_of_turn>/g,
|
|
76422
|
-
/<\|(?:fim_prefix|fim_suffix|fim_middle)\|>/g,
|
|
76423
|
-
/^\s*<bos>\s*/gm,
|
|
76424
|
-
/<\|[^|>]{0,30}\|>/g,
|
|
76425
|
-
/<\|[^>]{0,30}>/g
|
|
76426
|
-
];
|
|
76427
|
-
/**
|
|
76428
|
-
* Aggressively strip all fragments of model control token corruption from
|
|
76429
|
-
* tool arguments. This catches cases where the model produces raw garbage
|
|
76430
|
-
* like `<|<|"|<|<|\'` that doesn't match any known token template.
|
|
76431
|
-
*/
|
|
76432
|
-
const AGGRESSIVE_TOKEN_FRAGMENTS = [/<\|/g, /\|>/g];
|
|
76433
|
-
const GEMMA_MODEL_HINTS = ["gemma", "redsand/"];
|
|
76434
|
-
function isGemmaModel(modelId) {
|
|
76435
|
-
const lower = modelId.toLowerCase();
|
|
76436
|
-
return GEMMA_MODEL_HINTS.some((hint) => lower.includes(hint));
|
|
76437
|
-
}
|
|
76438
|
-
/**
|
|
76439
|
-
* Strip known control tokens from text. Only applies to Gemma-family models;
|
|
76440
|
-
* other models pass through unchanged.
|
|
76441
|
-
*/
|
|
76442
|
-
/**
|
|
76443
|
-
* Strip known control tokens from text. Only applies to Gemma-family models;
|
|
76444
|
-
* other models pass through unchanged. Used for streamed text output.
|
|
76445
|
-
*/
|
|
76446
|
-
function stripModelTokens(text, modelId) {
|
|
76447
|
-
if (!text || !isGemmaModel(modelId)) return text;
|
|
76448
|
-
let result = text;
|
|
76449
|
-
for (const re of GEMMA_TOKEN_PATTERNS) {
|
|
76450
|
-
re.lastIndex = 0;
|
|
76451
|
-
result = result.replace(re, "");
|
|
76452
|
-
}
|
|
76453
|
-
return result;
|
|
76454
|
-
}
|
|
76455
|
-
/**
|
|
76456
|
-
* Aggressively strip ALL token-like fragments from a string. Used for tool
|
|
76457
|
-
* call arguments where any `<|` corruption causes downstream failures.
|
|
76458
|
-
* More aggressive than `stripModelTokens` — removes bare `<|` and `|>` fragments
|
|
76459
|
-
* that don't match any known token template.
|
|
76460
|
-
*/
|
|
76461
|
-
function stripModelTokensAggressive(text, modelId) {
|
|
76462
|
-
if (!text || !isGemmaModel(modelId)) return text;
|
|
76463
|
-
let result = stripModelTokens(text, modelId);
|
|
76464
|
-
for (const re of AGGRESSIVE_TOKEN_FRAGMENTS) {
|
|
76465
|
-
re.lastIndex = 0;
|
|
76466
|
-
result = result.replace(re, "");
|
|
76467
|
-
}
|
|
76468
|
-
return result;
|
|
76469
|
-
}
|
|
76470
|
-
|
|
76471
76702
|
//#endregion
|
|
76472
76703
|
//#region src/agents/pi-tools.abort.ts
|
|
76473
76704
|
function throwAbortError() {
|
|
@@ -77271,31 +77502,6 @@ function resolveToolLoopDetectionConfig(params) {
|
|
|
77271
77502
|
}
|
|
77272
77503
|
};
|
|
77273
77504
|
}
|
|
77274
|
-
/**
|
|
77275
|
-
* Wrap a tool to strip model-specific control tokens from string arguments
|
|
77276
|
-
* before execution. Gemma 4 via vLLM sometimes injects tokens like `<|`
|
|
77277
|
-
* into tool call arguments (e.g. `exec("<|node -v")`). This wrapper
|
|
77278
|
-
* sanitizes all string values in the argument object.
|
|
77279
|
-
*/
|
|
77280
|
-
function wrapToolWithArgSanitization(tool, modelId) {
|
|
77281
|
-
const execute = tool.execute;
|
|
77282
|
-
if (!execute) return tool;
|
|
77283
|
-
return {
|
|
77284
|
-
...tool,
|
|
77285
|
-
execute: async (toolCallId, params, signal, onUpdate) => {
|
|
77286
|
-
return execute(toolCallId, sanitizeToolArgs(params, modelId), signal, onUpdate);
|
|
77287
|
-
}
|
|
77288
|
-
};
|
|
77289
|
-
}
|
|
77290
|
-
function sanitizeToolArgs(params, modelId) {
|
|
77291
|
-
if (!params || typeof params !== "object") return typeof params === "string" ? stripModelTokensAggressive(params, modelId) : params;
|
|
77292
|
-
if (Array.isArray(params)) return params.map((item) => sanitizeToolArgs(item, modelId));
|
|
77293
|
-
const result = {};
|
|
77294
|
-
for (const [key, value] of Object.entries(params)) if (typeof value === "string") result[key] = stripModelTokensAggressive(value, modelId);
|
|
77295
|
-
else if (value && typeof value === "object") result[key] = sanitizeToolArgs(value, modelId);
|
|
77296
|
-
else result[key] = value;
|
|
77297
|
-
return result;
|
|
77298
|
-
}
|
|
77299
77505
|
function createSymiCodingTools(options) {
|
|
77300
77506
|
const execToolName = "exec";
|
|
77301
77507
|
const sandbox = options?.sandbox?.enabled ? options.sandbox : void 0;
|
|
@@ -77519,11 +77725,7 @@ function createSymiCodingTools(options) {
|
|
|
77519
77725
|
agentId
|
|
77520
77726
|
})
|
|
77521
77727
|
}));
|
|
77522
|
-
|
|
77523
|
-
const modelId = options?.modelId ?? "";
|
|
77524
|
-
const modelProvider = options?.modelProvider ?? "";
|
|
77525
|
-
const fullModelId = modelProvider ? `${modelProvider}/${modelId}` : modelId;
|
|
77526
|
-
return fullModelId ? withAbort.map((tool) => wrapToolWithArgSanitization(tool, fullModelId)) : withAbort;
|
|
77728
|
+
return options?.abortSignal ? withHooks.map((tool) => wrapToolWithAbortSignal(tool, options.abortSignal)) : withHooks;
|
|
77527
77729
|
}
|
|
77528
77730
|
|
|
77529
77731
|
//#endregion
|