@code-yeongyu/senpi 2026.9.29-2 → 2026.9.29-3
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/CHANGELOG.md +14 -0
- package/dist/bundle/chunks/{anthropic-messages-OMTQOHSI.js → anthropic-messages-7WTVWELD.js} +1 -1
- package/dist/bundle/chunks/{app-server-command-ZC6A4C3L.js → app-server-command-5DSRGKFG.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-Z4FAFKPJ.js → azure-openai-responses-XVZ3FMH2.js} +1 -1
- package/dist/bundle/chunks/{chunk-U2SAEU63.js → chunk-27C3ZSZG.js} +1 -1
- package/dist/bundle/chunks/{chunk-YJUO37UX.js → chunk-2POUJCWM.js} +1 -1
- package/dist/bundle/chunks/{chunk-4LVZQRDG.js → chunk-4VWWEMCJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-36ACNYQR.js → chunk-7RVWDN5Z.js} +1 -1
- package/dist/bundle/chunks/{chunk-YS72TY6S.js → chunk-CZNE6LIO.js} +1 -1
- package/dist/bundle/chunks/{chunk-ILELKDDB.js → chunk-DWNYCJ43.js} +1 -1
- package/dist/bundle/chunks/{chunk-OMLHHPMZ.js → chunk-EB3GDOU4.js} +1 -1
- package/dist/bundle/chunks/{chunk-2HWLCW54.js → chunk-EQBN6TVJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-E5F5SVZF.js → chunk-FUGMDU6B.js} +1 -1
- package/dist/bundle/chunks/{chunk-RSPHQOSG.js → chunk-GE32OHDE.js} +7 -7
- package/dist/bundle/chunks/chunk-GKR74EKE.js +3 -0
- package/dist/bundle/chunks/{chunk-UYV2UM6E.js → chunk-ILQTW6KB.js} +1 -1
- package/dist/bundle/chunks/{chunk-TH4XD7AJ.js → chunk-JEWB5XTL.js} +1 -1
- package/dist/bundle/chunks/{chunk-FAV4DX74.js → chunk-K2SHQNAA.js} +1 -1
- package/dist/bundle/chunks/{chunk-NVJUCNHP.js → chunk-K7B7NFOK.js} +1 -1
- package/dist/bundle/chunks/{chunk-TZMNXKL2.js → chunk-KO6GO5ZY.js} +1 -1
- package/dist/bundle/chunks/{chunk-5CGFVKUK.js → chunk-LB2B2Q4P.js} +1 -1
- package/dist/bundle/chunks/{chunk-77OBRAUG.js → chunk-M4AHRI5L.js} +1 -1
- package/dist/bundle/chunks/{chunk-SW4U2HHU.js → chunk-OVDACFW2.js} +1 -1
- package/dist/bundle/chunks/{chunk-BTRONX2A.js → chunk-RUOJQL6B.js} +1 -1
- package/dist/bundle/chunks/{chunk-ASAQQ6VM.js → chunk-SH6VUPE4.js} +1 -1
- package/dist/bundle/chunks/{chunk-TFW6SS3P.js → chunk-SNDTJL2H.js} +1 -1
- package/dist/bundle/chunks/{chunk-Y5A6TKBN.js → chunk-T3HGPHPP.js} +1 -1
- package/dist/bundle/chunks/{chunk-BPZ5KIOS.js → chunk-UK5TE7WR.js} +1 -1
- package/dist/bundle/chunks/{chunk-NDNZU2X7.js → chunk-UNTVGMGW.js} +3 -3
- package/dist/bundle/chunks/{chunk-BQGFWWDC.js → chunk-VLTMFAWQ.js} +1 -1
- package/dist/bundle/chunks/{chunk-XDZ5RSMX.js → chunk-W4AG5TN4.js} +1 -1
- package/dist/bundle/chunks/chunk-WCAKUCN3.js +14 -0
- package/dist/bundle/chunks/{chunk-UEWSEALS.js → chunk-WRPX2M5D.js} +1 -1
- package/dist/bundle/chunks/{chunk-DA4W77J7.js → chunk-XBGO2JZD.js} +1 -1
- package/dist/bundle/chunks/chunk-XVX4M3DZ.js +2 -0
- package/dist/bundle/chunks/chunk-YD32NXKZ.js +8 -0
- package/dist/bundle/chunks/chunk-YOPVJDSU.js +2 -0
- package/dist/bundle/chunks/cli-main-V3T5WOV6.js +3 -0
- package/dist/bundle/chunks/{google-generative-ai-NFSRK6V5.js → google-generative-ai-XO6BUQVD.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-6YEVHEPI.js → google-vertex-SGNV6ZMK.js} +1 -1
- package/dist/bundle/chunks/{help-fast-path-RYMO5ODA.js → help-fast-path-AYPE26W2.js} +1 -1
- package/dist/bundle/chunks/{host-command-BU6XSX4H.js → host-command-ZTMADQIT.js} +1 -1
- package/dist/bundle/chunks/{host-lifecycle-22DRSTVI.js → host-lifecycle-FTH7WAQN.js} +1 -1
- package/dist/bundle/chunks/{interactive-host-runtime-P3FYZWSY.js → interactive-host-runtime-XDRXCEJ3.js} +1 -1
- package/dist/bundle/chunks/{interactive-mode-VCIOGSIZ.js → interactive-mode-6VFVZKKW.js} +1 -1
- package/dist/bundle/chunks/{list-tips-XXZ5PLE3.js → list-tips-ASETMEFS.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-R5PTP4P3.js → mistral-conversations-TVJBIL35.js} +1 -1
- package/dist/bundle/chunks/{multi-session-host-PRY7CJLK.js → multi-session-host-5VFMTPY7.js} +1 -1
- package/dist/bundle/chunks/{native-loader-SU5SGTSW.js → native-loader-WM7NDPEO.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-6B2ZLWTN.js → openai-codex-responses-RUT66DHS.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-5NTZZNVJ.js → openai-completions-THHRTH7B.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-V4JEBGEX.js → openai-responses-ITED6XXB.js} +1 -1
- package/dist/bundle/chunks/{package-manager-cli-RQ2NJAJ3.js → package-manager-cli-RAQRCH5L.js} +3 -3
- package/dist/bundle/chunks/{rg-engine-XHGOVGVG.js → rg-engine-G2YTYL2T.js} +1 -1
- package/dist/bundle/chunks/{rotation-stream-YQLGLRCX.js → rotation-stream-4FQW6IX5.js} +1 -1
- package/dist/bundle/chunks/{rpc-mode-U2EQRVC3.js → rpc-mode-W5P5QMF7.js} +1 -1
- package/dist/bundle/chunks/{schedule-command-DXC3ECXT.js → schedule-command-EFQUSPN4.js} +1 -1
- package/dist/bundle/chunks/{session-picker-KTXLU6MQ.js → session-picker-FF2J4OQA.js} +1 -1
- package/dist/bundle/chunks/session-worker.js +188 -188
- package/dist/bundle/chunks/{state-store-5A2TZ4SG.js → state-store-IIQL55GC.js} +1 -1
- package/dist/bundle/cli.js +2 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/bundle/runtime-manifest.json +1 -0
- package/dist/cli.js +24 -4
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -6
- package/dist/config.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/package-manager-cli.js +3 -3
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/runtime-snapshot/enter.d.ts +17 -0
- package/dist/runtime-snapshot/enter.d.ts.map +1 -0
- package/dist/runtime-snapshot/enter.js +72 -0
- package/dist/runtime-snapshot/enter.js.map +1 -0
- package/dist/runtime-snapshot/layout.d.ts +15 -0
- package/dist/runtime-snapshot/layout.d.ts.map +1 -0
- package/dist/runtime-snapshot/layout.js +126 -0
- package/dist/runtime-snapshot/layout.js.map +1 -0
- package/dist/runtime-snapshot/marker.d.ts +13 -0
- package/dist/runtime-snapshot/marker.d.ts.map +1 -0
- package/dist/runtime-snapshot/marker.js +40 -0
- package/dist/runtime-snapshot/marker.js.map +1 -0
- package/dist/runtime-snapshot/registry.d.ts +14 -0
- package/dist/runtime-snapshot/registry.d.ts.map +1 -0
- package/dist/runtime-snapshot/registry.js +124 -0
- package/dist/runtime-snapshot/registry.js.map +1 -0
- package/dist/senpi +24 -4
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +12 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.d.ts +7 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.js +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
- package/dist/bundle/chunks/chunk-DXU53IPJ.js +0 -8
- package/dist/bundle/chunks/chunk-FILEUW2D.js +0 -3
- package/dist/bundle/chunks/chunk-PBWQK23Z.js +0 -14
- package/dist/bundle/chunks/chunk-TJV2LFKM.js +0 -2
- package/dist/bundle/chunks/chunk-UIOI2SK3.js +0 -2
- package/dist/bundle/chunks/cli-main-RPQFXRJ7.js +0 -3
|
@@ -16,4 +16,11 @@ export declare function stripTurnRetrySuppressionPrefix(message: string): string
|
|
|
16
16
|
* the caller can fall back to the (marker-stripped) raw text.
|
|
17
17
|
*/
|
|
18
18
|
export declare function describeProviderFailureForUser(errorMessage: string | undefined, options?: ProviderStallDescriptionOptions): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* The turn-ending message for a provider module that can no longer be imported because the
|
|
21
|
+
* installed package was replaced under the running process (#2358), or undefined for any other
|
|
22
|
+
* failure. It carries the no-turn-retry marker: every model in a fallback chain needs a module from
|
|
23
|
+
* the same install, so a retry or fallback would only repeat the failure.
|
|
24
|
+
*/
|
|
25
|
+
export declare function describeReplacedInstall(error: unknown): string | undefined;
|
|
19
26
|
//# sourceMappingURL=provider-failure-description.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-failure-description.d.ts","sourceRoot":"","sources":["../../src/utils/provider-failure-description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAErH;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,yBAAyB,CAAC;AAEpE,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvE;AA4BD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC7C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,OAAO,GAAE,+BAAoC,GAC3C,MAAM,GAAG,SAAS,CAkBpB"}
|
|
1
|
+
{"version":3,"file":"provider-failure-description.d.ts","sourceRoot":"","sources":["../../src/utils/provider-failure-description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAErH;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,yBAAyB,CAAC;AAEpE,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvE;AA4BD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC7C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,OAAO,GAAE,+BAAoC,GAC3C,MAAM,GAAG,SAAS,CAkBpB;AAOD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAS1E"}
|
|
@@ -60,4 +60,25 @@ export function describeProviderFailureForUser(errorMessage, options = {}) {
|
|
|
60
60
|
sentences.push(RECOVERY_SENTENCE[options.recovery]);
|
|
61
61
|
return sentences.join(" ");
|
|
62
62
|
}
|
|
63
|
+
// Node: "Cannot find module '/…/chunks/x-HASH.js' imported from …"; Bun: the same with a relative
|
|
64
|
+
// specifier, or "ENOENT reading \"/…/chunks/x-HASH.js\"" when the file vanished after resolution.
|
|
65
|
+
const MISSING_MODULE_PATTERNS = [/^Cannot find module ['"]([^'"]+)['"]/, /^ENOENT reading ['"]([^'"]+)['"]/];
|
|
66
|
+
const SHIPPED_MODULE = /^(?:\.{1,2}[\\/]|[\\/]|[A-Za-z]:[\\/]|file:).*\.m?js$/;
|
|
67
|
+
/**
|
|
68
|
+
* The turn-ending message for a provider module that can no longer be imported because the
|
|
69
|
+
* installed package was replaced under the running process (#2358), or undefined for any other
|
|
70
|
+
* failure. It carries the no-turn-retry marker: every model in a fallback chain needs a module from
|
|
71
|
+
* the same install, so a retry or fallback would only repeat the failure.
|
|
72
|
+
*/
|
|
73
|
+
export function describeReplacedInstall(error) {
|
|
74
|
+
if (!(error instanceof Error))
|
|
75
|
+
return undefined;
|
|
76
|
+
for (const pattern of MISSING_MODULE_PATTERNS) {
|
|
77
|
+
const missing = pattern.exec(error.message)?.[1];
|
|
78
|
+
if (missing !== undefined && SHIPPED_MODULE.test(missing)) {
|
|
79
|
+
return `${TURN_RETRY_SUPPRESSION_PREFIX}The installed package changed while this session was running, so ${missing.split(/[\\/]/).at(-1)} can no longer be loaded. Restart and resume this session to continue.`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
63
84
|
//# sourceMappingURL=provider-failure-description.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-failure-description.js","sourceRoot":"","sources":["../../src/utils/provider-failure-description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAwC,MAAM,YAAY,CAAC;AAErH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,sBAAsB,CAAC;AAEpE,MAAM,UAAU,+BAA+B,CAAC,OAAe;IAC9D,OAAO,OAAO,CAAC,UAAU,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AACxD,MAAM,uBAAuB,GAAG,oBAAoB,CAA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AO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;IACrF,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAE5C,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IACvC,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QAClB,SAAS,CAAC,IAAI,CAAC,WAAW,QAAQ,QAAQ,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,0CAA0C,CAAC,CAAC;IAChH,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ;QAAE,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1E,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import { describeProviderStallForUser, formatStallDuration, type ProviderStallDescriptionOptions } from \"./retry.ts\";\n\n/**\n * Session-internal replay-suppression signal, read off the error text by the\n * retry predicates. A failover lane stamps it when replaying the turn could\n * duplicate side effects that already happened mid-stream. It must stay on the\n * message those predicates inspect and must never reach anything a person\n * reads; byte-identical across every lane that stamps or checks it.\n */\nexport const TURN_RETRY_SUPPRESSION_PREFIX = \"senpi:no-turn-retry:\";\n\nexport function stripTurnRetrySuppressionPrefix(message: string): string {\n\treturn message.replaceAll(TURN_RETRY_SUPPRESSION_PREFIX, \"\");\n}\n\nconst WEBSOCKET_CLOSED_PATTERN = /^WebSocket closed\\b/i;\nconst WEBSOCKET_ERROR_PATTERN = /^WebSocket error$/i;\nconst WEBSOCKET_CONNECT_TIMEOUT_PATTERN = /^WebSocket connect timeout after (\\d+)ms/i;\n\nconst RECOVERY_SENTENCE: Record<NonNullable<ProviderStallDescriptionOptions[\"recovery\"]>, string> = {\n\t\"no-fallback-configured\":\n\t\t\"No fallback model is configured for it, so nothing could take the turn over: run /fallback to add one, or send the message again to continue from the partial reply.\",\n\t\"chain-exhausted\":\n\t\t\"Every model in its fallback chain was tried as well: run /fallback to review the chain, or send the message again to continue from the partial reply.\",\n};\n\nfunction transportSymptom(errorMessage: string, subject: string): string | undefined {\n\tif (WEBSOCKET_CLOSED_PATTERN.test(errorMessage)) {\n\t\treturn `The connection to ${subject} dropped before the reply finished (${errorMessage}).`;\n\t}\n\tif (WEBSOCKET_ERROR_PATTERN.test(errorMessage)) {\n\t\treturn `The connection to ${subject} reported an error before the reply finished (${errorMessage}).`;\n\t}\n\tconst connectTimeout = WEBSOCKET_CONNECT_TIMEOUT_PATTERN.exec(errorMessage);\n\tif (connectTimeout) {\n\t\tconst provider = subject.replace(/^the provider/, \"The provider\");\n\t\treturn `${provider} did not accept the connection within ${formatStallDuration(Number(connectTimeout[1]))}.`;\n\t}\n\treturn undefined;\n}\n\n/**\n * Plain-language replacement for a provider failure's own `Error.message`,\n * with the internal replay marker removed. Covers the stream-stall watchdogs\n * (delegated to {@link describeProviderStallForUser}) and WebSocket transport\n * interruptions; returns undefined for failures that have no wording here so\n * the caller can fall back to the (marker-stripped) raw text.\n */\nexport function describeProviderFailureForUser(\n\terrorMessage: string | undefined,\n\toptions: ProviderStallDescriptionOptions = {},\n): string | undefined {\n\tif (!errorMessage) return undefined;\n\tconst message = stripTurnRetrySuppressionPrefix(errorMessage).trim();\n\tif (!message) return undefined;\n\tconst stall = describeProviderStallForUser(message, options);\n\tif (stall !== undefined) return stall;\n\n\tconst subject = options.model ? `the provider for ${options.model}` : \"the provider\";\n\tconst symptom = transportSymptom(message, subject);\n\tif (symptom === undefined) return undefined;\n\n\tconst sentences = [symptom];\n\tconst attempts = options.attempts ?? 0;\n\tif (attempts > 0) {\n\t\tsentences.push(`Retried ${attempts} time${attempts === 1 ? \"\" : \"s\"} on the same model with the same result.`);\n\t}\n\tif (options.recovery) sentences.push(RECOVERY_SENTENCE[options.recovery]);\n\treturn sentences.join(\" \");\n}\n"]}
|
|
1
|
+
{"version":3,"file":"provider-failure-description.js","sourceRoot":"","sources":["../../src/utils/provider-failure-description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAwC,MAAM,YAAY,CAAC;AAErH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,sBAAsB,CAAC;AAEpE,MAAM,UAAU,+BAA+B,CAAC,OAAe;IAC9D,OAAO,OAAO,CAAC,UAAU,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AACxD,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AACrD,MAAM,iCAAiC,GAAG,2CAA2C,CAAC;AAEtF,MAAM,iBAAiB,GAA6E;IACnG,wBAAwB,EACvB,sKAAsK;IACvK,iBAAiB,EAChB,uJAAuJ;CACxJ,CAAC;AAEF,SAAS,gBAAgB,CAAC,YAAoB,EAAE,OAAe;IAC9D,IAAI,wBAAwB,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACjD,OAAO,qBAAqB,OAAO,uCAAuC,YAAY,IAAI,CAAC;IAC5F,CAAC;IACD,IAAI,uBAAuB,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAChD,OAAO,qBAAqB,OAAO,iDAAiD,YAAY,IAAI,CAAC;IACtG,CAAC;IACD,MAAM,cAAc,GAAG,iCAAiC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5E,IAAI,cAAc,EAAE,CAAC;QACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;QAClE,OAAO,GAAG,QAAQ,yCAAyC,mBAAmB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,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sC,EAAE,kCAAkC,CAAC,CAAC;AAC7G,MAAM,cAAc,GAAG,uDAAuD,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACrD,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAChD,KAAK,MAAM,OAAO,IAAI,uBAAuB,EAAE,CAAC;QAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACjD,IAAI,OAAO,KAAK,SAAS,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3D,OAAO,GAAG,6BAA6B,oEAAoE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,wEAAwE,CAAC;QAClN,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["import { describeProviderStallForUser, formatStallDuration, type ProviderStallDescriptionOptions } from \"./retry.ts\";\n\n/**\n * Session-internal replay-suppression signal, read off the error text by the\n * retry predicates. A failover lane stamps it when replaying the turn could\n * duplicate side effects that already happened mid-stream. It must stay on the\n * message those predicates inspect and must never reach anything a person\n * reads; byte-identical across every lane that stamps or checks it.\n */\nexport const TURN_RETRY_SUPPRESSION_PREFIX = \"senpi:no-turn-retry:\";\n\nexport function stripTurnRetrySuppressionPrefix(message: string): string {\n\treturn message.replaceAll(TURN_RETRY_SUPPRESSION_PREFIX, \"\");\n}\n\nconst WEBSOCKET_CLOSED_PATTERN = /^WebSocket closed\\b/i;\nconst WEBSOCKET_ERROR_PATTERN = /^WebSocket error$/i;\nconst WEBSOCKET_CONNECT_TIMEOUT_PATTERN = /^WebSocket connect timeout after (\\d+)ms/i;\n\nconst RECOVERY_SENTENCE: Record<NonNullable<ProviderStallDescriptionOptions[\"recovery\"]>, string> = {\n\t\"no-fallback-configured\":\n\t\t\"No fallback model is configured for it, so nothing could take the turn over: run /fallback to add one, or send the message again to continue from the partial reply.\",\n\t\"chain-exhausted\":\n\t\t\"Every model in its fallback chain was tried as well: run /fallback to review the chain, or send the message again to continue from the partial reply.\",\n};\n\nfunction transportSymptom(errorMessage: string, subject: string): string | undefined {\n\tif (WEBSOCKET_CLOSED_PATTERN.test(errorMessage)) {\n\t\treturn `The connection to ${subject} dropped before the reply finished (${errorMessage}).`;\n\t}\n\tif (WEBSOCKET_ERROR_PATTERN.test(errorMessage)) {\n\t\treturn `The connection to ${subject} reported an error before the reply finished (${errorMessage}).`;\n\t}\n\tconst connectTimeout = WEBSOCKET_CONNECT_TIMEOUT_PATTERN.exec(errorMessage);\n\tif (connectTimeout) {\n\t\tconst provider = subject.replace(/^the provider/, \"The provider\");\n\t\treturn `${provider} did not accept the connection within ${formatStallDuration(Number(connectTimeout[1]))}.`;\n\t}\n\treturn undefined;\n}\n\n/**\n * Plain-language replacement for a provider failure's own `Error.message`,\n * with the internal replay marker removed. Covers the stream-stall watchdogs\n * (delegated to {@link describeProviderStallForUser}) and WebSocket transport\n * interruptions; returns undefined for failures that have no wording here so\n * the caller can fall back to the (marker-stripped) raw text.\n */\nexport function describeProviderFailureForUser(\n\terrorMessage: string | undefined,\n\toptions: ProviderStallDescriptionOptions = {},\n): string | undefined {\n\tif (!errorMessage) return undefined;\n\tconst message = stripTurnRetrySuppressionPrefix(errorMessage).trim();\n\tif (!message) return undefined;\n\tconst stall = describeProviderStallForUser(message, options);\n\tif (stall !== undefined) return stall;\n\n\tconst subject = options.model ? `the provider for ${options.model}` : \"the provider\";\n\tconst symptom = transportSymptom(message, subject);\n\tif (symptom === undefined) return undefined;\n\n\tconst sentences = [symptom];\n\tconst attempts = options.attempts ?? 0;\n\tif (attempts > 0) {\n\t\tsentences.push(`Retried ${attempts} time${attempts === 1 ? \"\" : \"s\"} on the same model with the same result.`);\n\t}\n\tif (options.recovery) sentences.push(RECOVERY_SENTENCE[options.recovery]);\n\treturn sentences.join(\" \");\n}\n\n// Node: \"Cannot find module '/…/chunks/x-HASH.js' imported from …\"; Bun: the same with a relative\n// specifier, or \"ENOENT reading \\\"/…/chunks/x-HASH.js\\\"\" when the file vanished after resolution.\nconst MISSING_MODULE_PATTERNS = [/^Cannot find module ['\"]([^'\"]+)['\"]/, /^ENOENT reading ['\"]([^'\"]+)['\"]/];\nconst SHIPPED_MODULE = /^(?:\\.{1,2}[\\\\/]|[\\\\/]|[A-Za-z]:[\\\\/]|file:).*\\.m?js$/;\n\n/**\n * The turn-ending message for a provider module that can no longer be imported because the\n * installed package was replaced under the running process (#2358), or undefined for any other\n * failure. It carries the no-turn-retry marker: every model in a fallback chain needs a module from\n * the same install, so a retry or fallback would only repeat the failure.\n */\nexport function describeReplacedInstall(error: unknown): string | undefined {\n\tif (!(error instanceof Error)) return undefined;\n\tfor (const pattern of MISSING_MODULE_PATTERNS) {\n\t\tconst missing = pattern.exec(error.message)?.[1];\n\t\tif (missing !== undefined && SHIPPED_MODULE.test(missing)) {\n\t\t\treturn `${TURN_RETRY_SUPPRESSION_PREFIX}The installed package changed while this session was running, so ${missing.split(/[\\\\/]/).at(-1)} can no longer be loaded. Restart and resume this session to continue.`;\n\t\t}\n\t}\n\treturn undefined;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-ai",
|
|
3
|
-
"version": "2026.9.29-
|
|
3
|
+
"version": "2026.9.29-3",
|
|
4
4
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@anthropic-ai/sdk": "0.127.0",
|
|
86
86
|
"@aws-sdk/client-bedrock-runtime": "3.1136.0",
|
|
87
|
-
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.9.29-
|
|
87
|
+
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.9.29-3",
|
|
88
88
|
"@google/genai": "2.23.0",
|
|
89
89
|
"@smithy/node-http-handler": "4.12.1",
|
|
90
90
|
"http-proxy-agent": "9.1.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi",
|
|
3
|
-
"version": "2026.9.29-
|
|
3
|
+
"version": "2026.9.29-3",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@earendil-works/chord": "0.85.1",
|
|
59
|
-
"@earendil-works/pi-agent-core": "npm:@code-yeongyu/senpi-agent-core@2026.9.29-
|
|
60
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.29-
|
|
61
|
-
"@earendil-works/pi-tui": "npm:@code-yeongyu/senpi-tui@2026.9.29-
|
|
59
|
+
"@earendil-works/pi-agent-core": "npm:@code-yeongyu/senpi-agent-core@2026.9.29-3",
|
|
60
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.29-3",
|
|
61
|
+
"@earendil-works/pi-tui": "npm:@code-yeongyu/senpi-tui@2026.9.29-3",
|
|
62
62
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
63
63
|
"chalk": "6.0.0",
|
|
64
64
|
"cross-spawn": "7.0.6",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"@anthropic-ai/sdk": "0.127.0",
|
|
81
81
|
"@aws-sdk/client-bedrock-runtime": "3.1136.0",
|
|
82
82
|
"@bufbuild/protobuf": "2.15.0",
|
|
83
|
-
"@code-yeongyu/senpi-codemode": "2026.9.29-
|
|
84
|
-
"@earendil-works/pi-pty": "npm:@code-yeongyu/senpi-pty@2026.9.29-
|
|
83
|
+
"@code-yeongyu/senpi-codemode": "2026.9.29-3",
|
|
84
|
+
"@earendil-works/pi-pty": "npm:@code-yeongyu/senpi-pty@2026.9.29-3",
|
|
85
85
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
86
86
|
"@mozilla/readability": "0.6.0",
|
|
87
87
|
"@opentelemetry/api": "1.9.1",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@aws-sdk/xml-builder": "3.972.40",
|
|
121
121
|
"@aws/lambda-invoke-store": "0.3.0",
|
|
122
122
|
"@babel/runtime": "7.29.2",
|
|
123
|
-
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.9.29-
|
|
123
|
+
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.9.29-3",
|
|
124
124
|
"@google/genai": "2.23.0",
|
|
125
125
|
"@hono/node-server": "2.1.1",
|
|
126
126
|
"@mixmark-io/domino": "2.2.0",
|