@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
|
@@ -109,7 +109,7 @@ import fs$1 from "node:fs/promises";
|
|
|
109
109
|
import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
110
110
|
import { inspect } from "node:util";
|
|
111
111
|
import crypto, { createHash, createHmac, randomBytes, randomUUID } from "node:crypto";
|
|
112
|
-
import { complete, completeSimple, streamSimple } from "@mariozechner/pi-ai";
|
|
112
|
+
import { complete, completeSimple, createAssistantMessageEventStream, streamSimple } from "@mariozechner/pi-ai";
|
|
113
113
|
import { CURRENT_SESSION_VERSION, DefaultResourceLoader, SessionManager, SettingsManager, codingTools, createAgentSession, createEditTool, createReadTool, createWriteTool, estimateTokens, generateSummary, readTool } from "@mariozechner/pi-coding-agent";
|
|
114
114
|
import { createServer } from "node:http";
|
|
115
115
|
import { ProxyAgent, fetch as fetch$1 } from "undici";
|
|
@@ -22862,6 +22862,199 @@ function createCacheTrace(params) {
|
|
|
22862
22862
|
};
|
|
22863
22863
|
}
|
|
22864
22864
|
|
|
22865
|
+
//#endregion
|
|
22866
|
+
//#region src/agents/model-token-filter.ts
|
|
22867
|
+
/**
|
|
22868
|
+
* Strips model-specific control tokens from streamed text.
|
|
22869
|
+
*
|
|
22870
|
+
* Used both server-side (in the streaming pipeline) and by the Glass UI
|
|
22871
|
+
* (as a defense-in-depth fallback). The patterns here cover tokens known
|
|
22872
|
+
* to leak from Gemma 4 / vLLM; Claude output is left untouched.
|
|
22873
|
+
*/
|
|
22874
|
+
const GEMMA_TOKEN_PATTERNS = [
|
|
22875
|
+
/<\|channel>\w*/g,
|
|
22876
|
+
/<channel\|>/g,
|
|
22877
|
+
/<start_of_turn>(?:model|user)?/g,
|
|
22878
|
+
/<end_of_turn>/g,
|
|
22879
|
+
/<\|(?:fim_prefix|fim_suffix|fim_middle)\|>/g,
|
|
22880
|
+
/^\s*<bos>\s*/gm,
|
|
22881
|
+
/<\|[^|>]{0,30}\|>/g,
|
|
22882
|
+
/<\|[^>]{0,30}>/g
|
|
22883
|
+
];
|
|
22884
|
+
/**
|
|
22885
|
+
* Aggressively strip all fragments of model control token corruption from
|
|
22886
|
+
* tool arguments. This catches cases where the model produces raw garbage
|
|
22887
|
+
* like `<|<|"|<|<|\'` that doesn't match any known token template.
|
|
22888
|
+
*/
|
|
22889
|
+
const AGGRESSIVE_TOKEN_FRAGMENTS = [/<\|/g, /\|>/g];
|
|
22890
|
+
const GEMMA_MODEL_HINTS$1 = ["gemma", "redsand/"];
|
|
22891
|
+
function isGemmaModel$1(modelId) {
|
|
22892
|
+
const lower = modelId.toLowerCase();
|
|
22893
|
+
return GEMMA_MODEL_HINTS$1.some((hint) => lower.includes(hint));
|
|
22894
|
+
}
|
|
22895
|
+
/**
|
|
22896
|
+
* Strip known control tokens from text. Only applies to Gemma-family models;
|
|
22897
|
+
* other models pass through unchanged.
|
|
22898
|
+
*/
|
|
22899
|
+
/**
|
|
22900
|
+
* Strip known control tokens from text. Only applies to Gemma-family models;
|
|
22901
|
+
* other models pass through unchanged. Used for streamed text output.
|
|
22902
|
+
*/
|
|
22903
|
+
function stripModelTokens(text, modelId) {
|
|
22904
|
+
if (!text || !isGemmaModel$1(modelId)) return text;
|
|
22905
|
+
let result = text;
|
|
22906
|
+
for (const re of GEMMA_TOKEN_PATTERNS) {
|
|
22907
|
+
re.lastIndex = 0;
|
|
22908
|
+
result = result.replace(re, "");
|
|
22909
|
+
}
|
|
22910
|
+
return result;
|
|
22911
|
+
}
|
|
22912
|
+
/**
|
|
22913
|
+
* Aggressively strip ALL token-like fragments from a string. Used for tool
|
|
22914
|
+
* call arguments where any `<|` corruption causes downstream failures.
|
|
22915
|
+
* More aggressive than `stripModelTokens` — removes bare `<|` and `|>` fragments
|
|
22916
|
+
* that don't match any known token template.
|
|
22917
|
+
*/
|
|
22918
|
+
function stripModelTokensAggressive(text, modelId) {
|
|
22919
|
+
if (!text || !isGemmaModel$1(modelId)) return text;
|
|
22920
|
+
let result = stripModelTokens(text, modelId);
|
|
22921
|
+
for (const re of AGGRESSIVE_TOKEN_FRAGMENTS) {
|
|
22922
|
+
re.lastIndex = 0;
|
|
22923
|
+
result = result.replace(re, "");
|
|
22924
|
+
}
|
|
22925
|
+
return result;
|
|
22926
|
+
}
|
|
22927
|
+
|
|
22928
|
+
//#endregion
|
|
22929
|
+
//#region src/agents/output-normalizer.ts
|
|
22930
|
+
const MONOLOGUE_REGEX_PATTERNS = [
|
|
22931
|
+
/\n*I have addressed the request fully\.?\s*(?:\n[\s\S]*)?$/,
|
|
22932
|
+
/\n*I[''\u2019]ve reviewed my response[\s\S]*$/,
|
|
22933
|
+
/\n*\*?\*?Verification:?\*?\*?\s*\n[\s\S]*?(?:Everything is correct|All requirements met)\.?\s*\u2705?\s*$/,
|
|
22934
|
+
/\n*\d+\.\s*\*?\*?Requirements:?\*?\*?[\s\S]*?\d+\.\s*\*?\*?Verification:?\*?\*?[\s\S]*$/
|
|
22935
|
+
];
|
|
22936
|
+
const SELF_REF_OPENERS = [
|
|
22937
|
+
"i have addressed",
|
|
22938
|
+
"i've reviewed",
|
|
22939
|
+
"i‘ve reviewed",
|
|
22940
|
+
"i’ve reviewed",
|
|
22941
|
+
"status check",
|
|
22942
|
+
"address requirements",
|
|
22943
|
+
"verification:",
|
|
22944
|
+
"requirements:"
|
|
22945
|
+
];
|
|
22946
|
+
const ASSESSMENT_KEYWORDS = [
|
|
22947
|
+
"requirements",
|
|
22948
|
+
"verification",
|
|
22949
|
+
"correct",
|
|
22950
|
+
"addressed",
|
|
22951
|
+
"fulfilled",
|
|
22952
|
+
"confirmed",
|
|
22953
|
+
"passed"
|
|
22954
|
+
];
|
|
22955
|
+
/**
|
|
22956
|
+
* Layer 2: Structural monologue detection.
|
|
22957
|
+
* Detects a trailing block that:
|
|
22958
|
+
* 1. Starts after a double newline
|
|
22959
|
+
* 2. Opens with a self-referential phrase
|
|
22960
|
+
* 3. Contains a numbered list with assessment keywords
|
|
22961
|
+
* 4. Sits at the end of the text
|
|
22962
|
+
*/
|
|
22963
|
+
function detectMonologueStructural(text) {
|
|
22964
|
+
let searchFrom = Math.floor(text.length * .15);
|
|
22965
|
+
while (searchFrom < text.length) {
|
|
22966
|
+
const breakPos = text.indexOf("\n\n", searchFrom);
|
|
22967
|
+
if (breakPos < 0) return null;
|
|
22968
|
+
const trailingBlock = text.slice(breakPos).toLowerCase();
|
|
22969
|
+
if (!SELF_REF_OPENERS.some((opener) => trailingBlock.includes(opener))) {
|
|
22970
|
+
searchFrom = breakPos + 2;
|
|
22971
|
+
continue;
|
|
22972
|
+
}
|
|
22973
|
+
const hasNumberedList = /\d+\.\s/.test(trailingBlock);
|
|
22974
|
+
const hasBoldHeaders = /\*\*\w/.test(trailingBlock);
|
|
22975
|
+
if (!hasNumberedList && !hasBoldHeaders) {
|
|
22976
|
+
searchFrom = breakPos + 2;
|
|
22977
|
+
continue;
|
|
22978
|
+
}
|
|
22979
|
+
if (ASSESSMENT_KEYWORDS.filter((kw) => trailingBlock.includes(kw)).length < 2) {
|
|
22980
|
+
searchFrom = breakPos + 2;
|
|
22981
|
+
continue;
|
|
22982
|
+
}
|
|
22983
|
+
return breakPos;
|
|
22984
|
+
}
|
|
22985
|
+
return null;
|
|
22986
|
+
}
|
|
22987
|
+
/**
|
|
22988
|
+
* Strip monologue from final text using the hierarchy:
|
|
22989
|
+
* Layer 2 (structural) first, Layer 3 (regex) as fallback.
|
|
22990
|
+
* Layer 1 (prompt tuning) happens before the model produces output.
|
|
22991
|
+
*/
|
|
22992
|
+
function stripMonologue(text) {
|
|
22993
|
+
const structuralCut = detectMonologueStructural(text);
|
|
22994
|
+
if (structuralCut !== null) {
|
|
22995
|
+
const cleaned = text.slice(0, structuralCut).trim();
|
|
22996
|
+
if (cleaned) return cleaned;
|
|
22997
|
+
}
|
|
22998
|
+
for (const pattern of MONOLOGUE_REGEX_PATTERNS) {
|
|
22999
|
+
const result = text.replace(pattern, "");
|
|
23000
|
+
if (result !== text && result.trim()) return result.trim();
|
|
23001
|
+
}
|
|
23002
|
+
return text;
|
|
23003
|
+
}
|
|
23004
|
+
const DEFAULT_REPETITION_MIN_BLOCK = 150;
|
|
23005
|
+
function detectRepetition(text, minBlock) {
|
|
23006
|
+
if (text.length < minBlock * 2.5) return false;
|
|
23007
|
+
const sampleStart = Math.floor(text.length * .25);
|
|
23008
|
+
const sample = text.slice(sampleStart, sampleStart + minBlock);
|
|
23009
|
+
const searchStart = sampleStart + minBlock;
|
|
23010
|
+
return text.indexOf(sample, searchStart) >= 0;
|
|
23011
|
+
}
|
|
23012
|
+
function sanitizeArgs(args, modelId) {
|
|
23013
|
+
const result = {};
|
|
23014
|
+
for (const [key, value] of Object.entries(args)) if (typeof value === "string") result[key] = stripModelTokensAggressive(value, modelId);
|
|
23015
|
+
else if (Array.isArray(value)) result[key] = value.map((item) => typeof item === "string" ? stripModelTokensAggressive(item, modelId) : item && typeof item === "object" ? sanitizeArgs(item, modelId) : item);
|
|
23016
|
+
else if (value && typeof value === "object") result[key] = sanitizeArgs(value, modelId);
|
|
23017
|
+
else result[key] = value;
|
|
23018
|
+
return result;
|
|
23019
|
+
}
|
|
23020
|
+
/**
|
|
23021
|
+
* Create an output normalizer configured for the given model profile.
|
|
23022
|
+
*
|
|
23023
|
+
* For Claude: passthrough (no stripping, no monologue, no aggressive cleaning).
|
|
23024
|
+
* For Gemma/vLLM: full normalization pipeline.
|
|
23025
|
+
* For unknown: conservative defaults.
|
|
23026
|
+
*/
|
|
23027
|
+
function createOutputNormalizer(profile, modelId) {
|
|
23028
|
+
const isGemma = isGemmaModel$1(modelId);
|
|
23029
|
+
const shouldStrip = isGemma || profile.filters.stripPatterns.length > 0;
|
|
23030
|
+
const shouldSuppressMonologue = profile.filters.suppressMonologue;
|
|
23031
|
+
let accumulated = "";
|
|
23032
|
+
return {
|
|
23033
|
+
normalizeTextDelta(delta) {
|
|
23034
|
+
const text = shouldStrip ? stripModelTokens(delta, modelId) : delta;
|
|
23035
|
+
accumulated += text;
|
|
23036
|
+
if (detectRepetition(accumulated, DEFAULT_REPETITION_MIN_BLOCK)) return {
|
|
23037
|
+
text,
|
|
23038
|
+
abort: { reason: "repetition-detected" }
|
|
23039
|
+
};
|
|
23040
|
+
return { text };
|
|
23041
|
+
},
|
|
23042
|
+
normalizeToolArgs(args) {
|
|
23043
|
+
if (!isGemma) return args;
|
|
23044
|
+
return sanitizeArgs(args, modelId);
|
|
23045
|
+
},
|
|
23046
|
+
normalizeFinalText(text) {
|
|
23047
|
+
let result = text;
|
|
23048
|
+
if (shouldStrip) result = stripModelTokens(result, modelId);
|
|
23049
|
+
if (shouldSuppressMonologue) result = stripMonologue(result);
|
|
23050
|
+
return result.trim();
|
|
23051
|
+
},
|
|
23052
|
+
reset() {
|
|
23053
|
+
accumulated = "";
|
|
23054
|
+
}
|
|
23055
|
+
};
|
|
23056
|
+
}
|
|
23057
|
+
|
|
22865
23058
|
//#endregion
|
|
22866
23059
|
//#region src/agents/model-aware-stream.ts
|
|
22867
23060
|
/**
|
|
@@ -22873,6 +23066,7 @@ function createCacheTrace(params) {
|
|
|
22873
23066
|
*/
|
|
22874
23067
|
function createModelAwareStreamFn(opts) {
|
|
22875
23068
|
const underlying = opts.baseStreamFn ?? streamSimple;
|
|
23069
|
+
const fullModelId = opts.provider ? `${opts.provider}/${opts.modelId}` : opts.modelId;
|
|
22876
23070
|
const mergedParams = {
|
|
22877
23071
|
...opts.profile.params,
|
|
22878
23072
|
...opts.configExtraParams,
|
|
@@ -22909,9 +23103,11 @@ function createModelAwareStreamFn(opts) {
|
|
|
22909
23103
|
}
|
|
22910
23104
|
callerOnPayload?.(payload);
|
|
22911
23105
|
};
|
|
23106
|
+
const normalizer = createOutputNormalizer(opts.profile, fullModelId);
|
|
22912
23107
|
return (model, context, options) => {
|
|
22913
23108
|
const callerOnPayload = options?.onPayload;
|
|
22914
|
-
|
|
23109
|
+
normalizer.reset();
|
|
23110
|
+
const streamOrPromise = underlying(model, context, {
|
|
22915
23111
|
...nativeOpts,
|
|
22916
23112
|
...options,
|
|
22917
23113
|
onPayload: (payload) => onPayloadHook(payload, callerOnPayload),
|
|
@@ -22920,8 +23116,106 @@ function createModelAwareStreamFn(opts) {
|
|
|
22920
23116
|
...options?.headers
|
|
22921
23117
|
} } : {}
|
|
22922
23118
|
});
|
|
23119
|
+
if (streamOrPromise instanceof Promise) return streamOrPromise.then((s) => wrapStreamWithNormalizer(s, normalizer));
|
|
23120
|
+
return wrapStreamWithNormalizer(streamOrPromise, normalizer);
|
|
22923
23121
|
};
|
|
22924
23122
|
}
|
|
23123
|
+
/**
|
|
23124
|
+
* Wrap an AssistantMessageEventStream to intercept and normalize events:
|
|
23125
|
+
* - text_delta: strip tokens, detect repetition
|
|
23126
|
+
* - toolcall_end: sanitize tool call arguments
|
|
23127
|
+
* - done: normalize final message text
|
|
23128
|
+
*/
|
|
23129
|
+
function wrapStreamWithNormalizer(rawStream, normalizer) {
|
|
23130
|
+
const normalized = createAssistantMessageEventStream();
|
|
23131
|
+
(async () => {
|
|
23132
|
+
try {
|
|
23133
|
+
for await (const event of rawStream) {
|
|
23134
|
+
const processed = normalizeEvent(event, normalizer);
|
|
23135
|
+
if (processed.abort) {
|
|
23136
|
+
normalized.push({
|
|
23137
|
+
type: "error",
|
|
23138
|
+
reason: "aborted",
|
|
23139
|
+
errorMessage: `output-normalizer: ${processed.abort.reason}`,
|
|
23140
|
+
usage: {
|
|
23141
|
+
input: 0,
|
|
23142
|
+
output: 0
|
|
23143
|
+
}
|
|
23144
|
+
});
|
|
23145
|
+
break;
|
|
23146
|
+
}
|
|
23147
|
+
normalized.push(processed.event);
|
|
23148
|
+
}
|
|
23149
|
+
} catch (err) {
|
|
23150
|
+
normalized.push({
|
|
23151
|
+
type: "error",
|
|
23152
|
+
reason: "error",
|
|
23153
|
+
errorMessage: err instanceof Error ? err.message : String(err),
|
|
23154
|
+
usage: {
|
|
23155
|
+
input: 0,
|
|
23156
|
+
output: 0
|
|
23157
|
+
}
|
|
23158
|
+
});
|
|
23159
|
+
}
|
|
23160
|
+
})();
|
|
23161
|
+
return normalized;
|
|
23162
|
+
}
|
|
23163
|
+
function normalizeEvent(event, normalizer) {
|
|
23164
|
+
if (event.type === "text_delta") {
|
|
23165
|
+
const result = normalizer.normalizeTextDelta(event.delta);
|
|
23166
|
+
if (result.abort) return {
|
|
23167
|
+
event,
|
|
23168
|
+
abort: result.abort
|
|
23169
|
+
};
|
|
23170
|
+
if (result.text !== event.delta) return { event: {
|
|
23171
|
+
...event,
|
|
23172
|
+
delta: result.text
|
|
23173
|
+
} };
|
|
23174
|
+
return { event };
|
|
23175
|
+
}
|
|
23176
|
+
if (event.type === "toolcall_end" && event.toolCall) {
|
|
23177
|
+
const tc = event.toolCall;
|
|
23178
|
+
if (tc.arguments && typeof tc.arguments === "object") {
|
|
23179
|
+
const cleanedArgs = normalizer.normalizeToolArgs(tc.arguments);
|
|
23180
|
+
return { event: {
|
|
23181
|
+
...event,
|
|
23182
|
+
toolCall: {
|
|
23183
|
+
...tc,
|
|
23184
|
+
arguments: cleanedArgs
|
|
23185
|
+
}
|
|
23186
|
+
} };
|
|
23187
|
+
}
|
|
23188
|
+
return { event };
|
|
23189
|
+
}
|
|
23190
|
+
if (event.type === "done" && event.message) {
|
|
23191
|
+
const msg = event.message;
|
|
23192
|
+
if (Array.isArray(msg.content)) {
|
|
23193
|
+
let changed = false;
|
|
23194
|
+
const normalizedContent = msg.content.map((block) => {
|
|
23195
|
+
if (block.type === "text" && "text" in block) {
|
|
23196
|
+
const cleaned = normalizer.normalizeFinalText(block.text);
|
|
23197
|
+
if (cleaned !== block.text) {
|
|
23198
|
+
changed = true;
|
|
23199
|
+
return {
|
|
23200
|
+
...block,
|
|
23201
|
+
text: cleaned
|
|
23202
|
+
};
|
|
23203
|
+
}
|
|
23204
|
+
}
|
|
23205
|
+
return block;
|
|
23206
|
+
});
|
|
23207
|
+
if (changed) return { event: {
|
|
23208
|
+
...event,
|
|
23209
|
+
message: {
|
|
23210
|
+
...msg,
|
|
23211
|
+
content: normalizedContent
|
|
23212
|
+
}
|
|
23213
|
+
} };
|
|
23214
|
+
}
|
|
23215
|
+
return { event };
|
|
23216
|
+
}
|
|
23217
|
+
return { event };
|
|
23218
|
+
}
|
|
22925
23219
|
/** Detect vLLM/Gemma providers by model hints or baseUrl patterns. */
|
|
22926
23220
|
function isVllmProvider(provider, modelId, config) {
|
|
22927
23221
|
const lower = `${provider}/${modelId}`.toLowerCase();
|
|
@@ -26114,7 +26408,7 @@ function buildSystemPromptReport(params) {
|
|
|
26114
26408
|
|
|
26115
26409
|
//#endregion
|
|
26116
26410
|
//#region src/agents/transcript-policy.ts
|
|
26117
|
-
const GEMMA_MODEL_HINTS
|
|
26411
|
+
const GEMMA_MODEL_HINTS = ["gemma", "redsand/"];
|
|
26118
26412
|
const MISTRAL_MODEL_HINTS = [
|
|
26119
26413
|
"mistral",
|
|
26120
26414
|
"mixtral",
|
|
@@ -26143,11 +26437,11 @@ function isAnthropicApi(modelApi, provider) {
|
|
|
26143
26437
|
if (modelApi === "anthropic-messages") return true;
|
|
26144
26438
|
return normalizeProviderId(provider ?? "") === "anthropic";
|
|
26145
26439
|
}
|
|
26146
|
-
function isGemmaModel
|
|
26440
|
+
function isGemmaModel(params) {
|
|
26147
26441
|
if (normalizeProviderId(params.provider ?? "") === "redsand") return true;
|
|
26148
26442
|
const modelId = (params.modelId ?? "").toLowerCase();
|
|
26149
26443
|
if (!modelId) return false;
|
|
26150
|
-
return GEMMA_MODEL_HINTS
|
|
26444
|
+
return GEMMA_MODEL_HINTS.some((hint) => modelId.includes(hint));
|
|
26151
26445
|
}
|
|
26152
26446
|
function isMistralModel(params) {
|
|
26153
26447
|
if (normalizeProviderId(params.provider ?? "") === "mistral") return true;
|
|
@@ -26165,7 +26459,7 @@ function resolveTranscriptPolicy(params) {
|
|
|
26165
26459
|
provider,
|
|
26166
26460
|
modelId
|
|
26167
26461
|
});
|
|
26168
|
-
const isGemma = isGemmaModel
|
|
26462
|
+
const isGemma = isGemmaModel({
|
|
26169
26463
|
provider,
|
|
26170
26464
|
modelId
|
|
26171
26465
|
});
|
|
@@ -30705,7 +30999,7 @@ async function runAgentTurn(params) {
|
|
|
30705
30999
|
function createDefaultDeps() {
|
|
30706
31000
|
return {
|
|
30707
31001
|
sendMessageWhatsApp: async (...args) => {
|
|
30708
|
-
const { sendMessageWhatsApp } = await import("./web-
|
|
31002
|
+
const { sendMessageWhatsApp } = await import("./web-CycbZoQb.js");
|
|
30709
31003
|
return await sendMessageWhatsApp(...args);
|
|
30710
31004
|
},
|
|
30711
31005
|
sendMessageTelegram: async (...args) => {
|
|
@@ -49136,7 +49430,7 @@ function loadWebLoginQr() {
|
|
|
49136
49430
|
return webLoginQrPromise;
|
|
49137
49431
|
}
|
|
49138
49432
|
function loadWebChannel() {
|
|
49139
|
-
webChannelPromise ??= import("./web-
|
|
49433
|
+
webChannelPromise ??= import("./web-CycbZoQb.js");
|
|
49140
49434
|
return webChannelPromise;
|
|
49141
49435
|
}
|
|
49142
49436
|
function loadWhatsAppActions() {
|
|
@@ -52786,69 +53080,6 @@ function createProcessTool(defaults) {
|
|
|
52786
53080
|
}
|
|
52787
53081
|
const processTool = createProcessTool();
|
|
52788
53082
|
|
|
52789
|
-
//#endregion
|
|
52790
|
-
//#region src/agents/model-token-filter.ts
|
|
52791
|
-
/**
|
|
52792
|
-
* Strips model-specific control tokens from streamed text.
|
|
52793
|
-
*
|
|
52794
|
-
* Used both server-side (in the streaming pipeline) and by the Glass UI
|
|
52795
|
-
* (as a defense-in-depth fallback). The patterns here cover tokens known
|
|
52796
|
-
* to leak from Gemma 4 / vLLM; Claude output is left untouched.
|
|
52797
|
-
*/
|
|
52798
|
-
const GEMMA_TOKEN_PATTERNS = [
|
|
52799
|
-
/<\|channel>\w*/g,
|
|
52800
|
-
/<channel\|>/g,
|
|
52801
|
-
/<start_of_turn>(?:model|user)?/g,
|
|
52802
|
-
/<end_of_turn>/g,
|
|
52803
|
-
/<\|(?:fim_prefix|fim_suffix|fim_middle)\|>/g,
|
|
52804
|
-
/^\s*<bos>\s*/gm,
|
|
52805
|
-
/<\|[^|>]{0,30}\|>/g,
|
|
52806
|
-
/<\|[^>]{0,30}>/g
|
|
52807
|
-
];
|
|
52808
|
-
/**
|
|
52809
|
-
* Aggressively strip all fragments of model control token corruption from
|
|
52810
|
-
* tool arguments. This catches cases where the model produces raw garbage
|
|
52811
|
-
* like `<|<|"|<|<|\'` that doesn't match any known token template.
|
|
52812
|
-
*/
|
|
52813
|
-
const AGGRESSIVE_TOKEN_FRAGMENTS = [/<\|/g, /\|>/g];
|
|
52814
|
-
const GEMMA_MODEL_HINTS = ["gemma", "redsand/"];
|
|
52815
|
-
function isGemmaModel(modelId) {
|
|
52816
|
-
const lower = modelId.toLowerCase();
|
|
52817
|
-
return GEMMA_MODEL_HINTS.some((hint) => lower.includes(hint));
|
|
52818
|
-
}
|
|
52819
|
-
/**
|
|
52820
|
-
* Strip known control tokens from text. Only applies to Gemma-family models;
|
|
52821
|
-
* other models pass through unchanged.
|
|
52822
|
-
*/
|
|
52823
|
-
/**
|
|
52824
|
-
* Strip known control tokens from text. Only applies to Gemma-family models;
|
|
52825
|
-
* other models pass through unchanged. Used for streamed text output.
|
|
52826
|
-
*/
|
|
52827
|
-
function stripModelTokens(text, modelId) {
|
|
52828
|
-
if (!text || !isGemmaModel(modelId)) return text;
|
|
52829
|
-
let result = text;
|
|
52830
|
-
for (const re of GEMMA_TOKEN_PATTERNS) {
|
|
52831
|
-
re.lastIndex = 0;
|
|
52832
|
-
result = result.replace(re, "");
|
|
52833
|
-
}
|
|
52834
|
-
return result;
|
|
52835
|
-
}
|
|
52836
|
-
/**
|
|
52837
|
-
* Aggressively strip ALL token-like fragments from a string. Used for tool
|
|
52838
|
-
* call arguments where any `<|` corruption causes downstream failures.
|
|
52839
|
-
* More aggressive than `stripModelTokens` — removes bare `<|` and `|>` fragments
|
|
52840
|
-
* that don't match any known token template.
|
|
52841
|
-
*/
|
|
52842
|
-
function stripModelTokensAggressive(text, modelId) {
|
|
52843
|
-
if (!text || !isGemmaModel(modelId)) return text;
|
|
52844
|
-
let result = stripModelTokens(text, modelId);
|
|
52845
|
-
for (const re of AGGRESSIVE_TOKEN_FRAGMENTS) {
|
|
52846
|
-
re.lastIndex = 0;
|
|
52847
|
-
result = result.replace(re, "");
|
|
52848
|
-
}
|
|
52849
|
-
return result;
|
|
52850
|
-
}
|
|
52851
|
-
|
|
52852
53083
|
//#endregion
|
|
52853
53084
|
//#region src/agents/pi-tools.abort.ts
|
|
52854
53085
|
function throwAbortError() {
|
|
@@ -63737,31 +63968,6 @@ function resolveToolLoopDetectionConfig(params) {
|
|
|
63737
63968
|
}
|
|
63738
63969
|
};
|
|
63739
63970
|
}
|
|
63740
|
-
/**
|
|
63741
|
-
* Wrap a tool to strip model-specific control tokens from string arguments
|
|
63742
|
-
* before execution. Gemma 4 via vLLM sometimes injects tokens like `<|`
|
|
63743
|
-
* into tool call arguments (e.g. `exec("<|node -v")`). This wrapper
|
|
63744
|
-
* sanitizes all string values in the argument object.
|
|
63745
|
-
*/
|
|
63746
|
-
function wrapToolWithArgSanitization(tool, modelId) {
|
|
63747
|
-
const execute = tool.execute;
|
|
63748
|
-
if (!execute) return tool;
|
|
63749
|
-
return {
|
|
63750
|
-
...tool,
|
|
63751
|
-
execute: async (toolCallId, params, signal, onUpdate) => {
|
|
63752
|
-
return execute(toolCallId, sanitizeToolArgs(params, modelId), signal, onUpdate);
|
|
63753
|
-
}
|
|
63754
|
-
};
|
|
63755
|
-
}
|
|
63756
|
-
function sanitizeToolArgs(params, modelId) {
|
|
63757
|
-
if (!params || typeof params !== "object") return typeof params === "string" ? stripModelTokensAggressive(params, modelId) : params;
|
|
63758
|
-
if (Array.isArray(params)) return params.map((item) => sanitizeToolArgs(item, modelId));
|
|
63759
|
-
const result = {};
|
|
63760
|
-
for (const [key, value] of Object.entries(params)) if (typeof value === "string") result[key] = stripModelTokensAggressive(value, modelId);
|
|
63761
|
-
else if (value && typeof value === "object") result[key] = sanitizeToolArgs(value, modelId);
|
|
63762
|
-
else result[key] = value;
|
|
63763
|
-
return result;
|
|
63764
|
-
}
|
|
63765
63971
|
function createSymiCodingTools(options) {
|
|
63766
63972
|
const execToolName = "exec";
|
|
63767
63973
|
const sandbox = options?.sandbox?.enabled ? options.sandbox : void 0;
|
|
@@ -63985,11 +64191,7 @@ function createSymiCodingTools(options) {
|
|
|
63985
64191
|
agentId
|
|
63986
64192
|
})
|
|
63987
64193
|
}));
|
|
63988
|
-
|
|
63989
|
-
const modelId = options?.modelId ?? "";
|
|
63990
|
-
const modelProvider = options?.modelProvider ?? "";
|
|
63991
|
-
const fullModelId = modelProvider ? `${modelProvider}/${modelId}` : modelId;
|
|
63992
|
-
return fullModelId ? withAbort.map((tool) => wrapToolWithArgSanitization(tool, fullModelId)) : withAbort;
|
|
64194
|
+
return options?.abortSignal ? withHooks.map((tool) => wrapToolWithAbortSignal(tool, options.abortSignal)) : withHooks;
|
|
63993
64195
|
}
|
|
63994
64196
|
|
|
63995
64197
|
//#endregion
|
|
@@ -72785,4 +72987,4 @@ async function getReplyFromConfig(ctx, opts, configOverride) {
|
|
|
72785
72987
|
}
|
|
72786
72988
|
|
|
72787
72989
|
//#endregion
|
|
72788
|
-
export { buildDeliveryFromLegacyPayload as $,
|
|
72990
|
+
export { buildDeliveryFromLegacyPayload as $, OPENAI_TTS_MODELS as $n, parseIdentityMarkdown as $t, emitGatewayRestart as A, initSubagentRegistry as An, extractImageContentFromSource as Ar, resolveHeartbeatDeliveryTarget as At, summarizeRestartSentinel as B, registerAgentRunContext as Bn, abortEmbeddedPiRun as Bt, ensureOutboundSessionEntry as C, shouldComputeCommandAuthorized as Cn, peekSystemEventEntries as Cr, requestBodyErrorToText as Ct, CHANNEL_MESSAGE_ACTION_NAMES as D, normalizeMentionText as Dn, DEFAULT_INPUT_MAX_REDIRECTS as Dr, resolveSessionKeyForRequest as Dt, resetDirectoryCache as E, buildMentionRegexes as En, DEFAULT_INPUT_IMAGE_MIMES as Er, agentCommand as Et, setPreRestartDeferralCheck as F, readLatestAssistantReply as Fn, normalizeSendPolicy as Ft, normalizeCronJobPatch as G, resolveTtsApiKey as Gn, getCliSessionId as Gt, writeRestartSentinel as H, getTtsProvider as Hn, waitForEmbeddedPiRunEnd as Ht, consumeRestartSentinel as I, clearAgentRunContext as In, resolveSendPolicy as It, normalizeOptionalSessionKey as J, resolveTtsPrefsPath as Jn, sha256HexPrefix as Jt, inferLegacyName as K, resolveTtsAutoMode as Kn, setCliSessionId as Kt, formatDoctorNonInteractiveHint as L, emitAgentEvent as Ln, createDefaultDeps as Lt, markGatewaySigusr1RestartHandled as M, listSubagentRunsForRequester as Mn, resolveInputFileLimits as Mr, resolveOutboundTarget as Mt, scheduleGatewaySigusr1Restart as N, subagent_registry_exports as Nn, estimateBase64DecodedBytes as Nr, resolveSessionDeliveryTarget as Nt, consumeGatewaySigusr1RestartAuthorization as O, countActiveDescendantRuns as On, DEFAULT_INPUT_TIMEOUT_MS as Or, resolveAgentDeliveryPlan as Ot, setGatewaySigusr1RestartPolicy as P, runSubagentAnnounceFlow as Pn, resolveAgentTimeoutMs as Pr, createOutboundSendDeps as Pt, migrateLegacyCronPayload as Q, textToSpeech as Qn, loadAgentIdentityFromWorkspace as Qt, formatRestartSentinelMessage as R, getAgentRunContext as Rn, createOutboundSendDeps$1 as Rt, runMessageAction as S, hasControlCommand as Sn, isSystemEventContextChanged as Sr, readJsonBodyWithLimit as St, formatTargetDisplay as T, stopSubagentsForRequester as Tn, DEFAULT_INPUT_IMAGE_MAX_BYTES as Tr, sleepWithAbort as Tt, normalizeHttpWebhookUrl as U, isTtsEnabled as Un, resolveModelProfile as Ut, trimLogTail as V, resolveUserTimezone as Vn, getActiveEmbeddedRunCount as Vt, normalizeCronJobCreate as W, isTtsProviderConfigured as Wn, runWithModelFallback as Wt, normalizePayloadToSystemText as X, setTtsEnabled as Xn, resolveAgentAvatar as Xt, normalizeOptionalText as Y, resolveTtsProviderOrder as Yn, describeFailoverError as Yt, normalizeRequiredName as Z, setTtsProvider as Zn, identityHasValues as Zt, loadCombinedSessionStoreForGateway as _, createInboundDebouncer as _n, formatRemainingShort as _r, formatUsageReportLines as _t, buildChannelSummary as a, buildPairingReply as an, setCommandLaneConcurrency as ar, persistBrowserProxyFiles as at, resolveGatewaySessionStoreTarget as b, resolveEnvelopeFormatOptions as bn, parseVerboseOverride as br, resolveCommitHash as bt, clearSessionQueues as c, buildHistoryContextFromEntries as cn, DEFAULT_HEARTBEAT_ACK_MAX_CHARS as cr, setHeartbeatWakeHandler as ct, createSymiTools as d, dispatchReplyWithBufferedBlockDispatcher as dn, resolveHeartbeatPrompt as dr, createPluginLoaderLogger as dt, buildSafeExternalPrompt as en, OPENAI_TTS_VOICES as er, hasLegacyDeliveryHints as et, resolveAnnounceTargetFromKey as f, provider_dispatcher_exports as fn, stripHeartbeatToken as fr, loadSymiPlugins as ft, listSessionsFromStore as g, createDedupeCache as gn, buildAuthHealthSummary as gr, loadProviderUsageSummary as gt, listAgentsForGateway as h, getTotalPendingReplies as hn, DEFAULT_OAUTH_WARN_MS as hr, parseActivationCommand as ht, resolveCronStyleNow as i, unbindThreadBindingsBySessionKey as in, resetAllLanes as ir, applyBrowserProxyPaths as it, isGatewaySigusr1RestartExternallyAllowed as j, listDescendantRunsForRequester as jn, normalizeMimeList as jr, resolveHeartbeatSenderContext as jt, deferGatewayRestartUntilIdle as k, countActiveRunsForSession as kn, extractFileContentFromSource as kr, resolveAgentOutboundTarget as kt, applyToolPolicyPipeline as l, recordPendingHistoryEntryIfEnabled as ln, DEFAULT_HEARTBEAT_EVERY as lr, resolveHeartbeatReasonKind as lt, classifySessionKey as m, createReplyDispatcher as mn, maskApiKey as mr, normalizeGroupActivation as mt, BARE_SESSION_RESET_PROMPT as n, getHookType as nn, getQueueSize as nr, CHANNEL_TARGETS_DESCRIPTION as nt, buildChannelAccountSnapshot as o, resolveMentionGating as on, waitForActiveTasks as or, sniffMimeFromBase64 as ot, canonicalizeSpawnedByForAgent as p, dispatchInboundMessage as pn, lookupContextTokens as pr, deleteTelegramUpdateOffset as pt, normalizeOptionalAgentId as q, resolveTtsConfig as qn, runCliAgent as qt, appendCronStyleCurrentTimeLine as r, isExternalHookSession as rn, getTotalQueueSize as rr, CHANNEL_TARGET_DESCRIPTION as rt, formatChannelAllowFrom as s, DEFAULT_GROUP_HISTORY_LIMIT as sn, CommandLane as sr, requestHeartbeatNow as st, getReplyFromConfig as t, detectSuspiciousPatterns as tn, getActiveTaskCount as tr, stripLegacyDeliveryFields as tt, buildDefaultToolPolicyPipelineSteps as u, shouldAckReactionForWhatsApp as un, isHeartbeatContentEffectivelyEmpty as ur, getPluginToolMeta as ut, loadSessionEntry as v, resolveInboundDebounceMs as vn, applyModelOverrideToSessionEntry as vr, formatUsageWindowSummary as vt, resolveOutboundSessionRoute as w, isAbortTrigger as wn, peekSystemEvents as wr, computeBackoff as wt, resolveSessionModelRef as x, formatZonedTimestamp as xn, enqueueSystemEvent as xr, handleSlackHttpRequest as xt, pruneLegacyStoreKeys as y, formatInboundEnvelope as yn, applyVerboseOverride as yr, resolveUsageProviderId as yt, readRestartSentinel as z, onAgentEvent as zn, runEmbeddedPiAgent as zt };
|
|
@@ -13,7 +13,7 @@ import "./client-DMBZpU6X.js";
|
|
|
13
13
|
import "./call-BcE47FtD.js";
|
|
14
14
|
import "./message-channel-C9dERklz.js";
|
|
15
15
|
import "./pairing-token-Byh6drgn.js";
|
|
16
|
-
import "./subagent-registry-
|
|
16
|
+
import "./subagent-registry-yBrXpTO-.js";
|
|
17
17
|
import "./sessions-CJXnZVjR.js";
|
|
18
18
|
import "./tokens-Csntmwwn.js";
|
|
19
19
|
import "./plugins-CwSlLxM8.js";
|
|
@@ -101,9 +101,9 @@ import { t as ensureSymiCliOnPath } from "./path-env-Bic_wXs9.js";
|
|
|
101
101
|
import "./catalog-DLQFKucJ.js";
|
|
102
102
|
import "./note-DDecZomM.js";
|
|
103
103
|
import "./plugin-auto-enable-D6ENR3Xg.js";
|
|
104
|
-
import { t as ensurePluginRegistryLoaded } from "./plugin-registry-
|
|
104
|
+
import { t as ensurePluginRegistryLoaded } from "./plugin-registry-ByLEBcK_.js";
|
|
105
105
|
import { t as assertSupportedRuntime } from "./runtime-guard-D7waq_Ho.js";
|
|
106
|
-
import { t as emitCliBanner } from "./banner-
|
|
106
|
+
import { t as emitCliBanner } from "./banner-BRzyFiIY.js";
|
|
107
107
|
import "./doctor-config-flow-CA3eiKhd.js";
|
|
108
108
|
import { n as ensureConfigReady } from "./config-guard-CPHvOzsC.js";
|
|
109
109
|
import process$1 from "node:process";
|
|
@@ -118,7 +118,7 @@ const routeHealth = {
|
|
|
118
118
|
const verbose = getVerboseFlag(argv, { includeDebug: true });
|
|
119
119
|
const timeoutMs = getPositiveIntFlagValue(argv, "--timeout");
|
|
120
120
|
if (timeoutMs === null) return false;
|
|
121
|
-
const { healthCommand } = await import("./health-
|
|
121
|
+
const { healthCommand } = await import("./health-CGoPVhko.js").then((n) => n.i);
|
|
122
122
|
await healthCommand({
|
|
123
123
|
json,
|
|
124
124
|
timeoutMs,
|
|
@@ -138,7 +138,7 @@ const routeStatus = {
|
|
|
138
138
|
const verbose = getVerboseFlag(argv, { includeDebug: true });
|
|
139
139
|
const timeoutMs = getPositiveIntFlagValue(argv, "--timeout");
|
|
140
140
|
if (timeoutMs === null) return false;
|
|
141
|
-
const { statusCommand } = await import("./status-
|
|
141
|
+
const { statusCommand } = await import("./status-iwhTBXbZ.js").then((n) => n.t);
|
|
142
142
|
await statusCommand({
|
|
143
143
|
json,
|
|
144
144
|
deep,
|
|
@@ -172,7 +172,7 @@ const routeAgentsList = {
|
|
|
172
172
|
run: async (argv) => {
|
|
173
173
|
const json = hasFlag(argv, "--json");
|
|
174
174
|
const bindings = hasFlag(argv, "--bindings");
|
|
175
|
-
const { agentsListCommand } = await import("./agents-
|
|
175
|
+
const { agentsListCommand } = await import("./agents-Cf7lxbx4.js").then((n) => n.t);
|
|
176
176
|
await agentsListCommand({
|
|
177
177
|
json,
|
|
178
178
|
bindings
|
|
@@ -243,7 +243,7 @@ const routes = [
|
|
|
243
243
|
const pathArg = getCommandPositionals(argv)[2];
|
|
244
244
|
if (!pathArg) return false;
|
|
245
245
|
const json = hasFlag(argv, "--json");
|
|
246
|
-
const { runConfigGet } = await import("./config-cli-
|
|
246
|
+
const { runConfigGet } = await import("./config-cli-Dx3mtUwm.js");
|
|
247
247
|
await runConfigGet({
|
|
248
248
|
path: pathArg,
|
|
249
249
|
json
|
|
@@ -256,7 +256,7 @@ const routes = [
|
|
|
256
256
|
run: async (argv) => {
|
|
257
257
|
const pathArg = getCommandPositionals(argv)[2];
|
|
258
258
|
if (!pathArg) return false;
|
|
259
|
-
const { runConfigUnset } = await import("./config-cli-
|
|
259
|
+
const { runConfigUnset } = await import("./config-cli-Dx3mtUwm.js");
|
|
260
260
|
await runConfigUnset({ path: pathArg });
|
|
261
261
|
return true;
|
|
262
262
|
}
|
|
@@ -270,7 +270,7 @@ const routes = [
|
|
|
270
270
|
const local = hasFlag(argv, "--local");
|
|
271
271
|
const json = hasFlag(argv, "--json");
|
|
272
272
|
const plain = hasFlag(argv, "--plain");
|
|
273
|
-
const { modelsListCommand } = await import("./models-
|
|
273
|
+
const { modelsListCommand } = await import("./models-BPJ5Z5tU.js").then((n) => n.t);
|
|
274
274
|
await modelsListCommand({
|
|
275
275
|
all,
|
|
276
276
|
local,
|
|
@@ -301,7 +301,7 @@ const routes = [
|
|
|
301
301
|
const plain = hasFlag(argv, "--plain");
|
|
302
302
|
const check = hasFlag(argv, "--check");
|
|
303
303
|
const probe = hasFlag(argv, "--probe");
|
|
304
|
-
const { modelsStatusCommand } = await import("./models-
|
|
304
|
+
const { modelsStatusCommand } = await import("./models-BPJ5Z5tU.js").then((n) => n.t);
|
|
305
305
|
await modelsStatusCommand({
|
|
306
306
|
json,
|
|
307
307
|
plain,
|
|
@@ -379,7 +379,7 @@ async function runCli(argv = process$1.argv) {
|
|
|
379
379
|
assertSupportedRuntime();
|
|
380
380
|
if (await tryRouteCli(normalizedArgv)) return;
|
|
381
381
|
enableConsoleCapture();
|
|
382
|
-
const { buildProgram } = await import("./program-
|
|
382
|
+
const { buildProgram } = await import("./program-DCyh129g.js");
|
|
383
383
|
const program = buildProgram();
|
|
384
384
|
installUnhandledRejectionHandler();
|
|
385
385
|
process$1.on("uncaughtException", (error) => {
|
|
@@ -411,10 +411,10 @@ async function runCli(argv = process$1.argv) {
|
|
|
411
411
|
const { getProgramContext } = await import("./program-context-CqzR_m-7.js").then((n) => n.n);
|
|
412
412
|
const ctx = getProgramContext(program);
|
|
413
413
|
if (ctx) {
|
|
414
|
-
const { registerCoreCliByName } = await import("./command-registry-
|
|
414
|
+
const { registerCoreCliByName } = await import("./command-registry-YX9EbrJh.js").then((n) => n.t);
|
|
415
415
|
await registerCoreCliByName(program, ctx, primary, parseArgv);
|
|
416
416
|
}
|
|
417
|
-
const { registerSubCliByName } = await import("./register.subclis-
|
|
417
|
+
const { registerSubCliByName } = await import("./register.subclis-DcJgaLOK.js").then((n) => n.a);
|
|
418
418
|
await registerSubCliByName(program, primary);
|
|
419
419
|
}
|
|
420
420
|
const hasBuiltinPrimary = primary !== null && program.commands.some((command) => command.name() === primary);
|
|
@@ -423,7 +423,7 @@ async function runCli(argv = process$1.argv) {
|
|
|
423
423
|
primary,
|
|
424
424
|
hasBuiltinPrimary
|
|
425
425
|
})) {
|
|
426
|
-
const { registerPluginCliCommands } = await import("./cli-
|
|
426
|
+
const { registerPluginCliCommands } = await import("./cli-BUkGaPzi.js");
|
|
427
427
|
const { loadConfig } = await import("./config-DHBLS1Hl.js").then((n) => n.t);
|
|
428
428
|
registerPluginCliCommands(program, loadConfig());
|
|
429
429
|
}
|
|
@@ -4,7 +4,7 @@ import { G as resolveSymiAgentDir, T as resolveApiKeyForProvider, c as normalize
|
|
|
4
4
|
import { t as normalizeChatType } from "./chat-type-DFDuk3FY.js";
|
|
5
5
|
import { _ as kindFromMime, d as detectMime, h as isAudioFileName, p as getFileExtension } from "./image-ops-ByaQt43P.js";
|
|
6
6
|
import { d as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, f as isInboundPathAllowed, m as resolveIMessageAttachmentRoots, n as loadConfig, p as mergeInboundPathRoots } from "./config-BmV60pPT.js";
|
|
7
|
-
import { S as ensureSymiModelsJson, t as describeImageWithModel } from "./image-
|
|
7
|
+
import { S as ensureSymiModelsJson, t as describeImageWithModel } from "./image-DcpMiprB.js";
|
|
8
8
|
import { n as collectProviderApiKeysForExecution, r as executeWithApiKeyRotation, t as parseGeminiAuth } from "./gemini-auth-CSlZZ1Pw.js";
|
|
9
9
|
import { n as fetchWithTimeout } from "./fetch-timeout-BheTNyes.js";
|
|
10
10
|
import { i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, r as MediaFetchError } from "./local-roots-CC8jiKDk.js";
|
|
@@ -4,7 +4,7 @@ import { t as normalizeChatType } from "./chat-type-C_KiWNAH.js";
|
|
|
4
4
|
import { _ as kindFromMime, d as detectMime, h as isAudioFileName, p as getFileExtension } from "./image-ops-CvJzsyvE.js";
|
|
5
5
|
import { A as normalizeProviderId, L as normalizeGoogleModelId, i as resolveApiKeyForProvider, r as requireApiKey, y as resolveSymiAgentDir } from "./model-auth-DK43VicI.js";
|
|
6
6
|
import { d as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, f as isInboundPathAllowed, m as resolveIMessageAttachmentRoots, n as loadConfig, p as mergeInboundPathRoots } from "./config-DRbjHIwD.js";
|
|
7
|
-
import { S as ensureSymiModelsJson, t as describeImageWithModel } from "./image-
|
|
7
|
+
import { S as ensureSymiModelsJson, t as describeImageWithModel } from "./image-Cp3JDEBB.js";
|
|
8
8
|
import { n as collectProviderApiKeysForExecution, r as executeWithApiKeyRotation, t as parseGeminiAuth } from "./gemini-auth-CdSPHuLl.js";
|
|
9
9
|
import { n as fetchWithTimeout } from "./fetch-timeout-DL3f_O53.js";
|
|
10
10
|
import { i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, r as MediaFetchError } from "./local-roots-DMwIh5cS.js";
|