@code-yeongyu/senpi 2026.8.4-2 → 2026.8.5
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 +35 -0
- package/dist/core/agent-session.d.ts +0 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +31 -35
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/provider-timeout-retry.d.ts +21 -0
- package/dist/core/provider-timeout-retry.d.ts.map +1 -0
- package/dist/core/provider-timeout-retry.js +41 -0
- package/dist/core/provider-timeout-retry.js.map +1 -0
- 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 +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +4 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.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/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +15 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.js +71 -17
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AgentContinuationOptions } from "@earendil-works/pi-agent-core";
|
|
2
|
+
import type { AssistantMessage } from "@earendil-works/pi-ai/compat";
|
|
3
|
+
export interface ProviderTimeoutRetryPlan {
|
|
4
|
+
options: AgentContinuationOptions;
|
|
5
|
+
watchdogTimeoutMs: number | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface ProviderTimeoutRetryPlanInput {
|
|
8
|
+
message: AssistantMessage;
|
|
9
|
+
streamRetryTimeoutMs: number | undefined;
|
|
10
|
+
timeoutMs: number | undefined;
|
|
11
|
+
streamStartTimeoutMs: number | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface BoundedRetryContinuation {
|
|
14
|
+
continueRun(): Promise<void>;
|
|
15
|
+
getActiveSignal(): AbortSignal | undefined;
|
|
16
|
+
abortActive(): void;
|
|
17
|
+
timeoutMs: number | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare function createProviderTimeoutRetryPlan({ message, streamRetryTimeoutMs, timeoutMs, streamStartTimeoutMs, }: ProviderTimeoutRetryPlanInput): ProviderTimeoutRetryPlan;
|
|
20
|
+
export declare function runBoundedRetryContinuation({ continueRun, getActiveSignal, abortActive, timeoutMs, }: BoundedRetryContinuation): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=provider-timeout-retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-timeout-retry.d.ts","sourceRoot":"","sources":["../../src/core/provider-timeout-retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,MAAM,WAAW,wBAAwB;IACxC,OAAO,EAAE,wBAAwB,CAAC;IAClC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,6BAA6B;IAC7C,OAAO,EAAE,gBAAgB,CAAC;IAC1B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,wBAAwB;IACxC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,eAAe,IAAI,WAAW,GAAG,SAAS,CAAC;IAC3C,WAAW,IAAI,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,wBAAgB,8BAA8B,CAAC,EAC9C,OAAO,EACP,oBAAoB,EACpB,SAAS,EACT,oBAAoB,GACpB,EAAE,6BAA6B,GAAG,wBAAwB,CAoB1D;AAED,wBAAsB,2BAA2B,CAAC,EACjD,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACT,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB1C"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { isProviderTimeoutError } from "@earendil-works/pi-ai/compat";
|
|
2
|
+
export function createProviderTimeoutRetryPlan({ message, streamRetryTimeoutMs, timeoutMs, streamStartTimeoutMs, }) {
|
|
3
|
+
if (!isProviderTimeoutError(message)) {
|
|
4
|
+
return { options: {}, watchdogTimeoutMs: undefined };
|
|
5
|
+
}
|
|
6
|
+
const capEnabledBound = (configuredMs) => {
|
|
7
|
+
if (streamRetryTimeoutMs === undefined || configuredMs === undefined)
|
|
8
|
+
return undefined;
|
|
9
|
+
return Math.min(configuredMs, streamRetryTimeoutMs);
|
|
10
|
+
};
|
|
11
|
+
const boundedTimeoutMs = capEnabledBound(timeoutMs);
|
|
12
|
+
const boundedStreamStartTimeoutMs = capEnabledBound(streamStartTimeoutMs);
|
|
13
|
+
return {
|
|
14
|
+
options: {
|
|
15
|
+
deferQueuedMessages: true,
|
|
16
|
+
...(boundedTimeoutMs === undefined ? {} : { timeoutMs: boundedTimeoutMs }),
|
|
17
|
+
...(boundedStreamStartTimeoutMs === undefined ? {} : { streamStartTimeoutMs: boundedStreamStartTimeoutMs }),
|
|
18
|
+
},
|
|
19
|
+
watchdogTimeoutMs: boundedTimeoutMs === undefined && boundedStreamStartTimeoutMs === undefined ? streamRetryTimeoutMs : undefined,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export async function runBoundedRetryContinuation({ continueRun, getActiveSignal, abortActive, timeoutMs, }) {
|
|
23
|
+
const continuation = continueRun();
|
|
24
|
+
const ownedSignal = getActiveSignal();
|
|
25
|
+
if (timeoutMs === undefined || ownedSignal === undefined) {
|
|
26
|
+
await continuation;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const timer = setTimeout(() => {
|
|
30
|
+
if (getActiveSignal() === ownedSignal) {
|
|
31
|
+
abortActive();
|
|
32
|
+
}
|
|
33
|
+
}, timeoutMs);
|
|
34
|
+
try {
|
|
35
|
+
await continuation;
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
clearTimeout(timer);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=provider-timeout-retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-timeout-retry.js","sourceRoot":"","sources":["../../src/core/provider-timeout-retry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAqBtE,MAAM,UAAU,8BAA8B,CAAC,EAC9C,OAAO,EACP,oBAAoB,EACpB,SAAS,EACT,oBAAoB,GACW;IAC/B,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC;IACtD,CAAC;IAED,MAAM,eAAe,GAAG,CAAC,YAAgC,EAAsB,EAAE;QAChF,IAAI,oBAAoB,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QACvF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["import type { AgentContinuationOptions } from \"@earendil-works/pi-agent-core\";\nimport type { AssistantMessage } from \"@earendil-works/pi-ai/compat\";\nimport { isProviderTimeoutError } from \"@earendil-works/pi-ai/compat\";\n\nexport interface ProviderTimeoutRetryPlan {\n\toptions: AgentContinuationOptions;\n\twatchdogTimeoutMs: number | undefined;\n}\n\nexport interface ProviderTimeoutRetryPlanInput {\n\tmessage: AssistantMessage;\n\tstreamRetryTimeoutMs: number | undefined;\n\ttimeoutMs: number | undefined;\n\tstreamStartTimeoutMs: number | undefined;\n}\n\nexport interface BoundedRetryContinuation {\n\tcontinueRun(): Promise<void>;\n\tgetActiveSignal(): AbortSignal | undefined;\n\tabortActive(): void;\n\ttimeoutMs: number | undefined;\n}\n\nexport function createProviderTimeoutRetryPlan({\n\tmessage,\n\tstreamRetryTimeoutMs,\n\ttimeoutMs,\n\tstreamStartTimeoutMs,\n}: ProviderTimeoutRetryPlanInput): ProviderTimeoutRetryPlan {\n\tif (!isProviderTimeoutError(message)) {\n\t\treturn { options: {}, watchdogTimeoutMs: undefined };\n\t}\n\n\tconst capEnabledBound = (configuredMs: number | undefined): number | undefined => {\n\t\tif (streamRetryTimeoutMs === undefined || configuredMs === undefined) return undefined;\n\t\treturn Math.min(configuredMs, streamRetryTimeoutMs);\n\t};\n\tconst boundedTimeoutMs = capEnabledBound(timeoutMs);\n\tconst boundedStreamStartTimeoutMs = capEnabledBound(streamStartTimeoutMs);\n\treturn {\n\t\toptions: {\n\t\t\tdeferQueuedMessages: true,\n\t\t\t...(boundedTimeoutMs === undefined ? {} : { timeoutMs: boundedTimeoutMs }),\n\t\t\t...(boundedStreamStartTimeoutMs === undefined ? {} : { streamStartTimeoutMs: boundedStreamStartTimeoutMs }),\n\t\t},\n\t\twatchdogTimeoutMs:\n\t\t\tboundedTimeoutMs === undefined && boundedStreamStartTimeoutMs === undefined ? streamRetryTimeoutMs : undefined,\n\t};\n}\n\nexport async function runBoundedRetryContinuation({\n\tcontinueRun,\n\tgetActiveSignal,\n\tabortActive,\n\ttimeoutMs,\n}: BoundedRetryContinuation): Promise<void> {\n\tconst continuation = continueRun();\n\tconst ownedSignal = getActiveSignal();\n\tif (timeoutMs === undefined || ownedSignal === undefined) {\n\t\tawait continuation;\n\t\treturn;\n\t}\n\n\tconst timer = setTimeout(() => {\n\t\tif (getActiveSignal() === ownedSignal) {\n\t\t\tabortActive();\n\t\t}\n\t}, timeoutMs);\n\ttry {\n\t\tawait continuation;\n\t} finally {\n\t\tclearTimeout(timer);\n\t}\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi-codemode",
|
|
3
|
-
"version": "2026.8.
|
|
3
|
+
"version": "2026.8.5",
|
|
4
4
|
"description": "Source-only senpi extension package for codemode evaluation tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/parser": "8.0.4",
|
|
33
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.
|
|
33
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.5",
|
|
34
34
|
"typebox": "1.3.8"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
37
|
+
"@code-yeongyu/senpi": "2026.8.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
40
|
+
"@code-yeongyu/senpi": "2026.8.5"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"senpi",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-agent-core",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "2026.8.
|
|
4
|
+
"version": "2026.8.5",
|
|
5
5
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"prepublishOnly": "npm run build"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.
|
|
33
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.5",
|
|
34
34
|
"diff": "9.0.0",
|
|
35
35
|
"ignore": "7.0.6",
|
|
36
36
|
"typebox": "1.3.8",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-messages.d.ts","sourceRoot":"","sources":["../../src/api/anthropic-messages.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAU1C,OAAO,KAAK,EAWX,mBAAmB,EAEnB,cAAc,EACd,aAAa,EAOb,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"anthropic-messages.d.ts","sourceRoot":"","sources":["../../src/api/anthropic-messages.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAU1C,OAAO,KAAK,EAWX,mBAAmB,EAEnB,cAAc,EACd,aAAa,EAOb,MAAM,aAAa,CAAC;AAkCrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AA6JlE,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1E,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,SAAS,CAAC;AAoEhE,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACtD;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACnB;AA4zBD,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,oBAAoB,EAAE,gBAAgB,CA6ZzE,CAAC;AA0FF,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,oBAAoB,EAAE,mBAAmB,CA2ClF,CAAC"}
|
|
@@ -14,6 +14,7 @@ import { sanitizeSurrogates } from "../utils/sanitize-unicode.js";
|
|
|
14
14
|
import { applyServerFallbackAbort, parseServerFallbackReceipt, parseStickyFallbackReceipt, } from "../utils/server-fallback-receipt.js";
|
|
15
15
|
import { normalizeToolCallId } from "../utils/tool-call-id.js";
|
|
16
16
|
import { isForcedToolChoiceUnsupportedError, omitToolChoiceParam } from "../utils/tool-choice-fallback.js";
|
|
17
|
+
import { resolveRootObjectSchema } from "../utils/tool-schema-compat.js";
|
|
17
18
|
import { demotedToolCallText, demotedToolResultText } from "../utils/unavailable-tool-text.js";
|
|
18
19
|
import { sanitizeAnthropicToolPairs } from "./anthropic-tool-pairs.js";
|
|
19
20
|
import { resolveCloudflareBaseUrl } from "./cloudflare.js";
|
|
@@ -1831,7 +1832,9 @@ function convertTools(tools, isOAuthToken, supportsEagerToolInputStreaming, supp
|
|
|
1831
1832
|
return [];
|
|
1832
1833
|
return tools.map((tool, index) => {
|
|
1833
1834
|
const strict = resolveJsonSchemaStrictSampling(tool, supportsStrictTools);
|
|
1834
|
-
|
|
1835
|
+
// A root union carries no top-level properties, so reading them directly
|
|
1836
|
+
// would advertise the tool to the model as taking no arguments at all.
|
|
1837
|
+
const schema = resolveRootObjectSchema(tool.parameters);
|
|
1835
1838
|
const legacyInputSchema = {
|
|
1836
1839
|
type: "object",
|
|
1837
1840
|
properties: schema.properties ?? {},
|