@namzu/sdk 4.0.0 → 5.1.0
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 +282 -0
- package/README.md +2 -2
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js +6 -0
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/agents/__tests__/run-agent.test.d.ts +2 -0
- package/dist/agents/__tests__/run-agent.test.d.ts.map +1 -0
- package/dist/agents/__tests__/run-agent.test.js +143 -0
- package/dist/agents/__tests__/run-agent.test.js.map +1 -0
- package/dist/agents/index.d.ts +2 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +1 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/runAgent.d.ts +104 -0
- package/dist/agents/runAgent.d.ts.map +1 -0
- package/dist/agents/runAgent.js +92 -0
- package/dist/agents/runAgent.js.map +1 -0
- package/dist/provider/__tests__/thinking-support.test.d.ts +2 -0
- package/dist/provider/__tests__/thinking-support.test.d.ts.map +1 -0
- package/dist/provider/__tests__/thinking-support.test.js +47 -0
- package/dist/provider/__tests__/thinking-support.test.js.map +1 -0
- package/dist/provider/__tests__/typed-error-classification.test.d.ts +2 -0
- package/dist/provider/__tests__/typed-error-classification.test.d.ts.map +1 -0
- package/dist/provider/__tests__/typed-error-classification.test.js +123 -0
- package/dist/provider/__tests__/typed-error-classification.test.js.map +1 -0
- package/dist/provider/retry.d.ts.map +1 -1
- package/dist/provider/retry.js +23 -7
- package/dist/provider/retry.js.map +1 -1
- package/dist/provider/thinking-support.d.ts +30 -0
- package/dist/provider/thinking-support.d.ts.map +1 -0
- package/dist/provider/thinking-support.js +32 -0
- package/dist/provider/thinking-support.js.map +1 -0
- package/dist/public-runtime.d.ts +4 -1
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +10 -1
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +1 -0
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +4 -0
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +1 -1
- package/dist/public-types.d.ts.map +1 -1
- package/dist/runtime/query/__tests__/steering-reaches-the-model.test.d.ts +2 -0
- package/dist/runtime/query/__tests__/steering-reaches-the-model.test.d.ts.map +1 -0
- package/dist/runtime/query/__tests__/steering-reaches-the-model.test.js +94 -0
- package/dist/runtime/query/__tests__/steering-reaches-the-model.test.js.map +1 -0
- package/dist/runtime/query/__tests__/steering.test.d.ts +2 -0
- package/dist/runtime/query/__tests__/steering.test.d.ts.map +1 -0
- package/dist/runtime/query/__tests__/steering.test.js +92 -0
- package/dist/runtime/query/__tests__/steering.test.js.map +1 -0
- package/dist/runtime/query/__tests__/stream-recovery.test.js +5 -0
- package/dist/runtime/query/__tests__/stream-recovery.test.js.map +1 -1
- package/dist/runtime/query/index.d.ts +10 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +1 -0
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +8 -0
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +7 -1
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/steering.d.ts +81 -0
- package/dist/runtime/query/steering.d.ts.map +1 -0
- package/dist/runtime/query/steering.js +77 -0
- package/dist/runtime/query/steering.js.map +1 -0
- package/dist/types/agent/manager.d.ts +11 -4
- package/dist/types/agent/manager.d.ts.map +1 -1
- package/dist/types/agent/supervisor.d.ts +9 -0
- package/dist/types/agent/supervisor.d.ts.map +1 -1
- package/dist/types/common/index.d.ts +12 -0
- package/dist/types/common/index.d.ts.map +1 -1
- package/dist/types/common/index.js +7 -0
- package/dist/types/common/index.js.map +1 -1
- package/dist/types/provider/chat.d.ts +57 -5
- package/dist/types/provider/chat.d.ts.map +1 -1
- package/dist/types/provider/errors.d.ts +0 -17
- package/dist/types/provider/errors.d.ts.map +1 -1
- package/dist/types/provider/errors.js +60 -0
- package/dist/types/provider/errors.js.map +1 -1
- package/dist/types/provider/index.d.ts +1 -1
- package/dist/types/provider/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/agents/SupervisorAgent.ts +6 -0
- package/src/agents/__tests__/run-agent.test.ts +165 -0
- package/src/agents/index.ts +2 -0
- package/src/agents/runAgent.ts +179 -0
- package/src/provider/__tests__/thinking-support.test.ts +60 -0
- package/src/provider/__tests__/typed-error-classification.test.ts +143 -0
- package/src/provider/retry.ts +23 -7
- package/src/provider/thinking-support.ts +37 -0
- package/src/public-runtime.ts +10 -0
- package/src/public-tools.ts +4 -0
- package/src/public-types.ts +7 -1
- package/src/runtime/query/__tests__/steering-reaches-the-model.test.ts +117 -0
- package/src/runtime/query/__tests__/steering.test.ts +121 -0
- package/src/runtime/query/__tests__/stream-recovery.test.ts +5 -0
- package/src/runtime/query/index.ts +12 -0
- package/src/runtime/query/iteration/phases/context.ts +9 -0
- package/src/runtime/query/iteration/phases/tool-review.ts +7 -1
- package/src/runtime/query/steering.ts +135 -0
- package/src/types/agent/manager.ts +11 -4
- package/src/types/agent/supervisor.ts +10 -0
- package/src/types/common/index.ts +20 -0
- package/src/types/provider/chat.ts +61 -5
- package/src/types/provider/errors.ts +71 -0
- package/src/types/provider/index.ts +1 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { ProjectId, SessionId, TenantId, ThreadId } from '../types/ids/index.js';
|
|
2
|
+
import type { Message } from '../types/message/index.js';
|
|
3
|
+
import type { LLMProvider } from '../types/provider/index.js';
|
|
4
|
+
import type { Run, RunEventListener } from '../types/run/index.js';
|
|
5
|
+
import type { ToolRegistryContract } from '../types/tool/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* The session a run belongs to.
|
|
8
|
+
*
|
|
9
|
+
* Every field is generated when absent, and the generated values come back on
|
|
10
|
+
* the result so a second turn can be handed the same ones. That pairing is the
|
|
11
|
+
* point: auto-generating alone would make each call its own session, which is
|
|
12
|
+
* right for a one-shot and silently wrong for a conversation — the second turn
|
|
13
|
+
* would start with no history and no shared budget, and nothing would say so.
|
|
14
|
+
*/
|
|
15
|
+
export interface AgentIdentity {
|
|
16
|
+
sessionId?: SessionId;
|
|
17
|
+
threadId?: ThreadId;
|
|
18
|
+
projectId?: ProjectId;
|
|
19
|
+
tenantId?: TenantId;
|
|
20
|
+
}
|
|
21
|
+
export interface RunAgentOptions extends AgentIdentity {
|
|
22
|
+
/** The model driver. The one thing with no sensible default. */
|
|
23
|
+
provider: LLMProvider;
|
|
24
|
+
/** What to ask. A string is turned into a single user message. */
|
|
25
|
+
prompt: string | Message[];
|
|
26
|
+
/** The system prompt. */
|
|
27
|
+
instructions?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Model id.
|
|
30
|
+
*
|
|
31
|
+
* Required, and not defaulted from the provider, because `LLMProvider`
|
|
32
|
+
* carries no model — a driver may have been constructed with one, but the
|
|
33
|
+
* interface does not expose it, so anything this function picked would be
|
|
34
|
+
* a guess billed to the caller. Two required options is a shape someone
|
|
35
|
+
* can hold in their head; a wrong model quietly used is not.
|
|
36
|
+
*/
|
|
37
|
+
model: string;
|
|
38
|
+
tools?: ToolRegistryContract;
|
|
39
|
+
/** Defaults to the current working directory. */
|
|
40
|
+
workingDirectory?: string;
|
|
41
|
+
maxIterations?: number;
|
|
42
|
+
tokenBudget?: number;
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
temperature?: number;
|
|
45
|
+
/** Names the agent in traces and events. Defaults to `Agent`. */
|
|
46
|
+
name?: string;
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
listener?: RunEventListener;
|
|
49
|
+
}
|
|
50
|
+
export interface RunAgentResult {
|
|
51
|
+
/** The model's final text, or `undefined` if it produced none. */
|
|
52
|
+
readonly output: string | undefined;
|
|
53
|
+
/** The full run — usage, cost, steps, stop reason, every message. */
|
|
54
|
+
readonly run: Run;
|
|
55
|
+
/**
|
|
56
|
+
* The identity this run used, with anything generated filled in.
|
|
57
|
+
*
|
|
58
|
+
* Pass it straight back into the next call to continue the same session.
|
|
59
|
+
*/
|
|
60
|
+
readonly identity: Required<AgentIdentity>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Run an agent, without assembling a kernel by hand.
|
|
64
|
+
*
|
|
65
|
+
* `drainQuery` is the kernel's real entry point and takes eleven required
|
|
66
|
+
* parameters, four of which are identity fields that throw when missing. That
|
|
67
|
+
* is the correct shape for a kernel — a run with no tenant is a run no auditor
|
|
68
|
+
* can attribute — and it is the wrong shape for the first thing anybody
|
|
69
|
+
* writes. The proof was in this repo: the eval suites, the test files and the
|
|
70
|
+
* CLI each hand-assemble the same block, which is what a missing front door
|
|
71
|
+
* looks like from the inside.
|
|
72
|
+
*
|
|
73
|
+
* So this supplies an environment rather than a new engine. It generates the
|
|
74
|
+
* identity a single-tenant local run has no opinion about, defaults the
|
|
75
|
+
* budgets, points the working directory at the process's own, and hands back
|
|
76
|
+
* both the answer and the identity it used. Everything it fills in is a normal
|
|
77
|
+
* `drainQuery` parameter; there is no second code path, and a caller who
|
|
78
|
+
* outgrows it passes more options until they are calling `drainQuery` in all
|
|
79
|
+
* but name.
|
|
80
|
+
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* const { output } = await runAgent({
|
|
83
|
+
* provider,
|
|
84
|
+
* model: 'claude-sonnet-4-5',
|
|
85
|
+
* prompt: 'What is 2 + 2?',
|
|
86
|
+
* })
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* A second turn in the same session is the identity handed back, and the
|
|
90
|
+
* previous messages carried forward:
|
|
91
|
+
*
|
|
92
|
+
* ```ts
|
|
93
|
+
* const first = await runAgent({ provider, model, prompt: 'My name is Ada.' })
|
|
94
|
+
*
|
|
95
|
+
* const second = await runAgent({
|
|
96
|
+
* provider,
|
|
97
|
+
* model,
|
|
98
|
+
* ...first.identity,
|
|
99
|
+
* prompt: [...first.run.messages, createUserMessage('What is my name?')],
|
|
100
|
+
* })
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare function runAgent(options: RunAgentOptions): Promise<RunAgentResult>;
|
|
104
|
+
//# sourceMappingURL=runAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runAgent.d.ts","sourceRoot":"","sources":["../../src/agents/runAgent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAQlE;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACnB;AAED,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACrD,gEAAgE;IAChE,QAAQ,EAAE,WAAW,CAAA;IAErB,kEAAkE;IAClE,MAAM,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;IAE1B,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;;;;;;OAQG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb,KAAK,CAAC,EAAE,oBAAoB,CAAA;IAE5B,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CAC3B;AAED,MAAM,WAAW,cAAc;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAEnC,qEAAqE;IACrE,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;IAEjB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAA;CAC1C;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAyChF"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ToolRegistry } from '../registry/tool/execute.js';
|
|
2
|
+
import { drainQuery } from '../runtime/query/index.js';
|
|
3
|
+
import { generateProjectId, generateSessionId, generateTenantId, generateThreadId, } from '../utils/id.js';
|
|
4
|
+
/**
|
|
5
|
+
* Defaults chosen to be safe rather than generous.
|
|
6
|
+
*
|
|
7
|
+
* A front door exists so a first run works without a decision, and the cost of
|
|
8
|
+
* that convenience is that nobody reads these numbers before their first
|
|
9
|
+
* runaway loop. So: a budget that ends a stuck run in seconds rather than
|
|
10
|
+
* dollars, and an iteration cap that stops a tool-calling loop well before a
|
|
11
|
+
* context window does. Every one is overridable and named on the option.
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_MAX_ITERATIONS = 16;
|
|
14
|
+
const DEFAULT_TOKEN_BUDGET = 200_000;
|
|
15
|
+
const DEFAULT_TIMEOUT_MS = 300_000;
|
|
16
|
+
/**
|
|
17
|
+
* Run an agent, without assembling a kernel by hand.
|
|
18
|
+
*
|
|
19
|
+
* `drainQuery` is the kernel's real entry point and takes eleven required
|
|
20
|
+
* parameters, four of which are identity fields that throw when missing. That
|
|
21
|
+
* is the correct shape for a kernel — a run with no tenant is a run no auditor
|
|
22
|
+
* can attribute — and it is the wrong shape for the first thing anybody
|
|
23
|
+
* writes. The proof was in this repo: the eval suites, the test files and the
|
|
24
|
+
* CLI each hand-assemble the same block, which is what a missing front door
|
|
25
|
+
* looks like from the inside.
|
|
26
|
+
*
|
|
27
|
+
* So this supplies an environment rather than a new engine. It generates the
|
|
28
|
+
* identity a single-tenant local run has no opinion about, defaults the
|
|
29
|
+
* budgets, points the working directory at the process's own, and hands back
|
|
30
|
+
* both the answer and the identity it used. Everything it fills in is a normal
|
|
31
|
+
* `drainQuery` parameter; there is no second code path, and a caller who
|
|
32
|
+
* outgrows it passes more options until they are calling `drainQuery` in all
|
|
33
|
+
* but name.
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* const { output } = await runAgent({
|
|
37
|
+
* provider,
|
|
38
|
+
* model: 'claude-sonnet-4-5',
|
|
39
|
+
* prompt: 'What is 2 + 2?',
|
|
40
|
+
* })
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* A second turn in the same session is the identity handed back, and the
|
|
44
|
+
* previous messages carried forward:
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* const first = await runAgent({ provider, model, prompt: 'My name is Ada.' })
|
|
48
|
+
*
|
|
49
|
+
* const second = await runAgent({
|
|
50
|
+
* provider,
|
|
51
|
+
* model,
|
|
52
|
+
* ...first.identity,
|
|
53
|
+
* prompt: [...first.run.messages, createUserMessage('What is my name?')],
|
|
54
|
+
* })
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export async function runAgent(options) {
|
|
58
|
+
const identity = {
|
|
59
|
+
sessionId: options.sessionId ?? generateSessionId(),
|
|
60
|
+
threadId: options.threadId ?? generateThreadId(),
|
|
61
|
+
projectId: options.projectId ?? generateProjectId(),
|
|
62
|
+
tenantId: options.tenantId ?? generateTenantId(),
|
|
63
|
+
};
|
|
64
|
+
const messages = typeof options.prompt === 'string'
|
|
65
|
+
? [{ role: 'user', content: options.prompt, timestamp: Date.now() }]
|
|
66
|
+
: options.prompt;
|
|
67
|
+
const run = await drainQuery({
|
|
68
|
+
provider: options.provider,
|
|
69
|
+
tools: options.tools ?? new ToolRegistry(),
|
|
70
|
+
messages,
|
|
71
|
+
workingDirectory: options.workingDirectory ?? process.cwd(),
|
|
72
|
+
runConfig: {
|
|
73
|
+
model: options.model,
|
|
74
|
+
maxIterations: options.maxIterations ?? DEFAULT_MAX_ITERATIONS,
|
|
75
|
+
tokenBudget: options.tokenBudget ?? DEFAULT_TOKEN_BUDGET,
|
|
76
|
+
timeoutMs: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
77
|
+
...(options.temperature !== undefined ? { temperature: options.temperature } : {}),
|
|
78
|
+
},
|
|
79
|
+
// One option covers both. `drainQuery` separates the id from the
|
|
80
|
+
// display name because a fleet needs a stable key and a readable
|
|
81
|
+
// label; a single agent has no such tension, and asking for two
|
|
82
|
+
// strings that will always be the same is the kind of ceremony this
|
|
83
|
+
// function exists to remove.
|
|
84
|
+
agentId: options.name ?? 'agent',
|
|
85
|
+
agentName: options.name ?? 'Agent',
|
|
86
|
+
...(options.instructions ? { systemPrompt: options.instructions } : {}),
|
|
87
|
+
...(options.signal ? { signal: options.signal } : {}),
|
|
88
|
+
...identity,
|
|
89
|
+
}, options.listener);
|
|
90
|
+
return { output: run.result, run, identity };
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=runAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runAgent.js","sourceRoot":"","sources":["../../src/agents/runAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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EAAE,OAAO,CAAC,aAAa,IAAI,sBAAsB;YAC9D,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,oBAAoB;YACxD,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,kBAAkB;YAClD,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClF;QACD,iEAAiE;QACjE,iEAAiE;QACjE,gEAAgE;QAChE,oEAAoE;QACpE,6BAA6B;QAC7B,OAAO,EAAE,OAAO,CAAC,IAAI,IAAI,OAAO;QAChC,SAAS,EAAE,OAAO,CAAC,IAAI,IAAI,OAAO;QAClC,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,GAAG,QAAQ;KACF,EACV,OAAO,CAAC,QAAQ,CAChB,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAA;AAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking-support.test.d.ts","sourceRoot":"","sources":["../../../src/provider/__tests__/thinking-support.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { assertThinkingUnsupported } from '../thinking-support.js';
|
|
3
|
+
/**
|
|
4
|
+
* `thinking` sits on `ChatCompletionParams`, so every driver accepts it. Six
|
|
5
|
+
* of the seven in this repo did not implement it, and five of those six simply
|
|
6
|
+
* dropped the field: the caller got an ordinary completion with an empty
|
|
7
|
+
* `reasoning` array, indistinguishable from a model that chose not to reason.
|
|
8
|
+
*
|
|
9
|
+
* One driver already refused instead, with the reasoning written out. The rule
|
|
10
|
+
* was decided once and applied once — so it moved here, where a new driver
|
|
11
|
+
* inherits it rather than re-deciding it.
|
|
12
|
+
*/
|
|
13
|
+
describe('a driver that cannot think says so', () => {
|
|
14
|
+
it('refuses a manual thinking request', () => {
|
|
15
|
+
expect(() => assertThinkingUnsupported('TestProvider', { thinking: { type: 'enabled' } })).toThrow(/TestProvider does not implement thinking/);
|
|
16
|
+
});
|
|
17
|
+
it('refuses an adaptive one too', () => {
|
|
18
|
+
// Both are a request to think. Refusing one and dropping the other
|
|
19
|
+
// would leave exactly the silence this exists to remove.
|
|
20
|
+
expect(() => assertThinkingUnsupported('TestProvider', { thinking: { type: 'adaptive' } })).toThrow(/does not implement thinking/);
|
|
21
|
+
});
|
|
22
|
+
it('names the driver, not just the problem', () => {
|
|
23
|
+
// In a multi-provider setup this is the difference between a bug
|
|
24
|
+
// report about the model and a one-line config fix.
|
|
25
|
+
expect(() => assertThinkingUnsupported('BedrockProvider', { thinking: { type: 'adaptive' } })).toThrow(/BedrockProvider/);
|
|
26
|
+
});
|
|
27
|
+
it('says what silence would have looked like', () => {
|
|
28
|
+
let message = '';
|
|
29
|
+
try {
|
|
30
|
+
assertThinkingUnsupported('TestProvider', { thinking: { type: 'enabled' } });
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
message = err.message;
|
|
34
|
+
}
|
|
35
|
+
expect(message).toContain('empty reasoning list');
|
|
36
|
+
expect(message).toContain('Drop `thinking`');
|
|
37
|
+
});
|
|
38
|
+
it('honours an explicit disable as a no-op', () => {
|
|
39
|
+
// A config shared across providers that says "do not think" should not
|
|
40
|
+
// fail on the ones that were never going to.
|
|
41
|
+
expect(() => assertThinkingUnsupported('TestProvider', { thinking: { type: 'disabled' } })).not.toThrow();
|
|
42
|
+
});
|
|
43
|
+
it('does nothing when the caller said nothing', () => {
|
|
44
|
+
expect(() => assertThinkingUnsupported('TestProvider', {})).not.toThrow();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=thinking-support.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking-support.test.js","sourceRoot":"","sources":["../../../src/provider/__tests__/thinking-support.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAElE;;;;;;;;;GASG;AACH,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IACnD,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,GAAG,EAAE,CACX,yBAAyB,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAC5E,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAA;IACtD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACtC,mEAAmE;QACnE,yDAAyD;QACzD,MAAM,CAAC,GAAG,EAAE,CACX,yBAAyB,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,CAC7E,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QACjD,iEAAiE;QACjE,oDAAoD;QACpD,MAAM,CAAC,GAAG,EAAE,CACX,yBAAyB,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,CAChF,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QACnD,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,IAAI,CAAC;YACJ,yBAAyB,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAAA;QAC7E,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,OAAO,GAAI,GAAa,CAAC,OAAO,CAAA;QACjC,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAA;QACjD,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAA;IAC7C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QACjD,uEAAuE;QACvE,6CAA6C;QAC7C,MAAM,CAAC,GAAG,EAAE,CACX,yBAAyB,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,CAC7E,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACpD,MAAM,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;IAC1E,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-error-classification.test.d.ts","sourceRoot":"","sources":["../../../src/provider/__tests__/typed-error-classification.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { classifyProviderError } from '../../types/provider/errors.js';
|
|
3
|
+
import { ProviderRequestError } from '../errors.js';
|
|
4
|
+
import { withProviderRetry } from '../retry.js';
|
|
5
|
+
/**
|
|
6
|
+
* A driver that classified its own failure was coming out WORSE than one that
|
|
7
|
+
* did not, in two independent places, and both shipped.
|
|
8
|
+
*
|
|
9
|
+
* `classifyProviderError` never read `kind`. A `ProviderRequestError` fell
|
|
10
|
+
* through to the status heuristics, where a carefully-diagnosed
|
|
11
|
+
* `context_overflow` carrying a 400 became `invalid_request` — so the run
|
|
12
|
+
* loop's overflow branch, which tests for `context_length_exceeded`, could
|
|
13
|
+
* never fire for a first-party driver, and compaction relief was unreachable
|
|
14
|
+
* for exactly the drivers that had diagnosed the problem correctly.
|
|
15
|
+
*
|
|
16
|
+
* And `withProviderRetry` rethrew any such error before the retry loop. Its
|
|
17
|
+
* comment justified preserving the classification, which is right; the code
|
|
18
|
+
* also skipped retrying, which is a different decision that nobody made.
|
|
19
|
+
*/
|
|
20
|
+
function providerThatFails(err) {
|
|
21
|
+
let calls = 0;
|
|
22
|
+
const provider = {
|
|
23
|
+
id: 'test',
|
|
24
|
+
name: 'Test',
|
|
25
|
+
async *chatStream() {
|
|
26
|
+
calls++;
|
|
27
|
+
throw err;
|
|
28
|
+
// biome-ignore lint/correctness/useYield: it fails before producing anything
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
return { provider, calls: () => calls };
|
|
32
|
+
}
|
|
33
|
+
const typed = (kind, status) => new ProviderRequestError({ kind, providerId: 'test', status, message: `a ${kind}` });
|
|
34
|
+
describe('a driver that classified its own failure is believed', () => {
|
|
35
|
+
const cases = [
|
|
36
|
+
['throttle', 429, 'rate_limit', true],
|
|
37
|
+
['server', 500, 'server_error', true],
|
|
38
|
+
['network', 0, 'network', true],
|
|
39
|
+
['auth', 401, 'auth', false],
|
|
40
|
+
['bad_request', 400, 'invalid_request', false],
|
|
41
|
+
// The one that mattered most: a 400 whose kind says the prompt was too
|
|
42
|
+
// long is not a bad request, and the difference decides whether the
|
|
43
|
+
// kernel reaches for compaction.
|
|
44
|
+
['context_overflow', 400, 'context_length_exceeded', false],
|
|
45
|
+
];
|
|
46
|
+
for (const [kind, status, code, retryable] of cases) {
|
|
47
|
+
it(`maps kind "${kind}" to ${code}`, () => {
|
|
48
|
+
const classified = classifyProviderError(typed(kind, status), 'test');
|
|
49
|
+
expect(classified.code).toBe(code);
|
|
50
|
+
expect(classified.retryable).toBe(retryable);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
it('keeps the driver-supplied status and provider id', () => {
|
|
54
|
+
const classified = classifyProviderError(typed('throttle', 429), 'other');
|
|
55
|
+
expect(classified.status).toBe(429);
|
|
56
|
+
expect(classified.providerId).toBe('test');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
describe('a classified failure still goes through the retry loop', () => {
|
|
60
|
+
it('retries a typed throttle', async () => {
|
|
61
|
+
// This is the regression: a first-party driver reporting a 429 as
|
|
62
|
+
// `kind: 'throttle'` used to get exactly one attempt, while the same
|
|
63
|
+
// failure from a driver that classified nothing got the full backoff.
|
|
64
|
+
const { provider, calls } = providerThatFails(typed('throttle', 429));
|
|
65
|
+
const wrapped = withProviderRetry(provider, {
|
|
66
|
+
config: { maxRetries: 2 },
|
|
67
|
+
sleepFn: async () => { },
|
|
68
|
+
random: () => 0,
|
|
69
|
+
});
|
|
70
|
+
await expect(async () => {
|
|
71
|
+
for await (const _ of wrapped.chatStream({})) {
|
|
72
|
+
// drain
|
|
73
|
+
}
|
|
74
|
+
}).rejects.toThrow();
|
|
75
|
+
expect(calls()).toBe(3);
|
|
76
|
+
});
|
|
77
|
+
it('does not retry a typed auth failure', async () => {
|
|
78
|
+
const { provider, calls } = providerThatFails(typed('auth', 401));
|
|
79
|
+
const wrapped = withProviderRetry(provider, {
|
|
80
|
+
config: { maxRetries: 2 },
|
|
81
|
+
sleepFn: async () => { },
|
|
82
|
+
});
|
|
83
|
+
await expect(async () => {
|
|
84
|
+
for await (const _ of wrapped.chatStream({})) {
|
|
85
|
+
// drain
|
|
86
|
+
}
|
|
87
|
+
}).rejects.toThrow();
|
|
88
|
+
expect(calls()).toBe(1);
|
|
89
|
+
});
|
|
90
|
+
it('does not retry a typed context overflow', async () => {
|
|
91
|
+
// Correctly non-retryable — an identical prompt overflows identically.
|
|
92
|
+
// The remedy is compaction, which the run loop reaches for once the
|
|
93
|
+
// code is `context_length_exceeded`.
|
|
94
|
+
const { provider, calls } = providerThatFails(typed('context_overflow', 400));
|
|
95
|
+
const wrapped = withProviderRetry(provider, {
|
|
96
|
+
config: { maxRetries: 2 },
|
|
97
|
+
sleepFn: async () => { },
|
|
98
|
+
});
|
|
99
|
+
await expect(async () => {
|
|
100
|
+
for await (const _ of wrapped.chatStream({})) {
|
|
101
|
+
// drain
|
|
102
|
+
}
|
|
103
|
+
// The ORIGINAL escapes, so the boundary still sees the driver's
|
|
104
|
+
// own kind rather than a wrapper's code.
|
|
105
|
+
}).rejects.toMatchObject({ kind: 'context_overflow', status: 400 });
|
|
106
|
+
expect(calls()).toBe(1);
|
|
107
|
+
});
|
|
108
|
+
it('leaves an abort alone', async () => {
|
|
109
|
+
const abort = Object.assign(new Error('aborted'), { name: 'AbortError' });
|
|
110
|
+
const { provider, calls } = providerThatFails(abort);
|
|
111
|
+
const wrapped = withProviderRetry(provider, {
|
|
112
|
+
config: { maxRetries: 2 },
|
|
113
|
+
sleepFn: async () => { },
|
|
114
|
+
});
|
|
115
|
+
await expect(async () => {
|
|
116
|
+
for await (const _ of wrapped.chatStream({})) {
|
|
117
|
+
// drain
|
|
118
|
+
}
|
|
119
|
+
}).rejects.toThrow(/aborted/);
|
|
120
|
+
expect(calls()).toBe(1);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
//# sourceMappingURL=typed-error-classification.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-error-classification.test.js","sourceRoot":"","sources":["../../../src/provider/__tests__/typed-error-classification.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,O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CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/provider/retry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,WAAW,EAAe,MAAM,4BAA4B,CAAA;AAChG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAGhD,MAAM,WAAW,mBAAmB;IACnC,mEAAmE;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,mDAAmD;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CAChC;AAED,eAAO,MAAM,sBAAsB,EAAE,mBAKpC,CAAA;AAgCD,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAC9C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,oCAAoC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,WAAW,EACrB,OAAO,GAAE,wBAA6B,GACpC,WAAW,
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/provider/retry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,WAAW,EAAe,MAAM,4BAA4B,CAAA;AAChG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAGhD,MAAM,WAAW,mBAAmB;IACnC,mEAAmE;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,mDAAmD;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CAChC;AAED,eAAO,MAAM,sBAAsB,EAAE,mBAKpC,CAAA;AAgCD,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAC9C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,oCAAoC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,WAAW,EACrB,OAAO,GAAE,wBAA6B,GACpC,WAAW,CAkIb"}
|
package/dist/provider/retry.js
CHANGED
|
@@ -79,12 +79,19 @@ export function withProviderRetry(provider, options = {}) {
|
|
|
79
79
|
catch (err) {
|
|
80
80
|
if (isAbortError(err) || params.signal?.aborted)
|
|
81
81
|
throw err;
|
|
82
|
-
// A driver that already classified its own failure
|
|
83
|
-
//
|
|
84
|
-
// first
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
// A driver that already classified its own failure keeps that
|
|
83
|
+
// classification — `classifyProviderError` reads its `kind`
|
|
84
|
+
// first and does not re-guess.
|
|
85
|
+
//
|
|
86
|
+
// This used to rethrow such an error outright. The stated reason
|
|
87
|
+
// was sound and the code did more than it said: preserving a
|
|
88
|
+
// first-hand classification is one thing, and skipping the retry
|
|
89
|
+
// loop is another. A first-party driver that correctly reported
|
|
90
|
+
// a 429 as `kind: 'throttle'` got ZERO attempts, while the same
|
|
91
|
+
// failure from a driver that classified nothing got the full
|
|
92
|
+
// backoff — so diagnosing your own error was punished. Whether
|
|
93
|
+
// to retry is now decided the same way for both, by the
|
|
94
|
+
// classification's own `retryable`.
|
|
88
95
|
const classified = classifyProviderError(err, provider.id);
|
|
89
96
|
const exhausted = attempt >= config.maxRetries;
|
|
90
97
|
if (produced || !classified.retryable || exhausted) {
|
|
@@ -100,7 +107,16 @@ export function withProviderRetry(provider, options = {}) {
|
|
|
100
107
|
? 'retries exhausted'
|
|
101
108
|
: 'not retryable',
|
|
102
109
|
});
|
|
103
|
-
|
|
110
|
+
// The ORIGINAL escapes when the driver classified it. Two
|
|
111
|
+
// different consumers want two different things and both are
|
|
112
|
+
// right: this loop needs a retryable verdict, which the
|
|
113
|
+
// classification supplies, and the run boundary reports
|
|
114
|
+
// `lastProviderError` as the driver's own `{kind, status,
|
|
115
|
+
// retryAfterMs}`, which only survives if the error itself
|
|
116
|
+
// does. Wrapping here would have kept the retry fix and lost
|
|
117
|
+
// the vendor's `kind` at the boundary — the existing
|
|
118
|
+
// stream-recovery test caught exactly that.
|
|
119
|
+
throw isProviderRequestError(err) ? err : classified;
|
|
104
120
|
}
|
|
105
121
|
const serverDirected = classified.retryAfterMs;
|
|
106
122
|
const delay = serverDirected !== undefined && serverDirected <= config.maxRetryAfterMs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/provider/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAGjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAiBpD,MAAM,CAAC,MAAM,sBAAsB,GAAwB;IAC1D,UAAU,EAAE,CAAC;IACb,cAAc,EAAE,GAAG;IACn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AA+D;IAC/D,OAAO;QACN,IAAI,EAAE;YACL,OAAO,QAAQ,CAAC,EAAE,CAAA;QACnB,CAAC;QACD,IAAI,IAAI;YACP,OAAO,QAAQ,CAAC,IAAI,CAAA;QACrB,CAAC;QACD,IAAI,YAAY;YACf,OAAO,QAAQ,CAAC,YAAY,CAAA;QAC7B,CAAC;QACD,UAAU;QACV,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7E,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACjE,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ThinkingConfig } from '../types/provider/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Refuse a thinking request a driver does not implement.
|
|
4
|
+
*
|
|
5
|
+
* The failure this prevents is silence. `thinking` sits on
|
|
6
|
+
* `ChatCompletionParams`, so every driver accepts it; a driver that does not
|
|
7
|
+
* implement it drops the field and returns an ordinary completion with an
|
|
8
|
+
* empty `reasoning` array. The caller cannot tell that apart from a model that
|
|
9
|
+
* simply chose not to reason — the request looks honoured and the answer looks
|
|
10
|
+
* like an answer.
|
|
11
|
+
*
|
|
12
|
+
* Refusing names the driver instead, which is the difference between a bug
|
|
13
|
+
* report about the model and a one-line configuration fix.
|
|
14
|
+
*
|
|
15
|
+
* **Turning thinking OFF is honoured as a no-op**, because that is the state a
|
|
16
|
+
* driver without thinking is already in. A config shared across providers that
|
|
17
|
+
* says `{type: 'disabled'}` should not fail on the ones that were never going
|
|
18
|
+
* to think.
|
|
19
|
+
*
|
|
20
|
+
* This lived as a private copy inside one driver while five others dropped the
|
|
21
|
+
* field silently. It is here so a new driver inherits the rule instead of
|
|
22
|
+
* re-deciding it.
|
|
23
|
+
*
|
|
24
|
+
* @param driverName Named in the error, so the reader knows which provider in
|
|
25
|
+
* a multi-provider setup refused.
|
|
26
|
+
*/
|
|
27
|
+
export declare function assertThinkingUnsupported(driverName: string, params: {
|
|
28
|
+
thinking?: ThinkingConfig;
|
|
29
|
+
}): void;
|
|
30
|
+
//# sourceMappingURL=thinking-support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking-support.d.ts","sourceRoot":"","sources":["../../src/provider/thinking-support.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,yBAAyB,CACxC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,cAAc,CAAA;CAAE,GACnC,IAAI,CAMN"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refuse a thinking request a driver does not implement.
|
|
3
|
+
*
|
|
4
|
+
* The failure this prevents is silence. `thinking` sits on
|
|
5
|
+
* `ChatCompletionParams`, so every driver accepts it; a driver that does not
|
|
6
|
+
* implement it drops the field and returns an ordinary completion with an
|
|
7
|
+
* empty `reasoning` array. The caller cannot tell that apart from a model that
|
|
8
|
+
* simply chose not to reason — the request looks honoured and the answer looks
|
|
9
|
+
* like an answer.
|
|
10
|
+
*
|
|
11
|
+
* Refusing names the driver instead, which is the difference between a bug
|
|
12
|
+
* report about the model and a one-line configuration fix.
|
|
13
|
+
*
|
|
14
|
+
* **Turning thinking OFF is honoured as a no-op**, because that is the state a
|
|
15
|
+
* driver without thinking is already in. A config shared across providers that
|
|
16
|
+
* says `{type: 'disabled'}` should not fail on the ones that were never going
|
|
17
|
+
* to think.
|
|
18
|
+
*
|
|
19
|
+
* This lived as a private copy inside one driver while five others dropped the
|
|
20
|
+
* field silently. It is here so a new driver inherits the rule instead of
|
|
21
|
+
* re-deciding it.
|
|
22
|
+
*
|
|
23
|
+
* @param driverName Named in the error, so the reader knows which provider in
|
|
24
|
+
* a multi-provider setup refused.
|
|
25
|
+
*/
|
|
26
|
+
export function assertThinkingUnsupported(driverName, params) {
|
|
27
|
+
const type = params.thinking?.type;
|
|
28
|
+
if (type !== 'enabled' && type !== 'adaptive')
|
|
29
|
+
return;
|
|
30
|
+
throw new Error(`${driverName} does not implement thinking. Silently ignoring the request would return an ordinary completion with an empty reasoning list, which reads as "the model did not reason" rather than "this driver cannot ask it to". Drop \`thinking\`, or use a driver that implements it.`);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=thinking-support.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking-support.js","sourceRoot":"","sources":["../../src/provider/thinking-support.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,yBAAyB,CACxC,UAAkB,EAClB,MAAqC;IAErC,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAA;IAClC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,UAAU;QAAE,OAAM;IACrD,MAAM,IAAI,KAAK,CACd,GAAG,UAAU,4QAA4Q,CACzR,CAAA;AACF,CAAC"}
|
package/dist/public-runtime.d.ts
CHANGED
|
@@ -13,7 +13,10 @@ export { createChildAbortController } from './utils/abort.js';
|
|
|
13
13
|
export { memoizeAsync } from './utils/memoize.js';
|
|
14
14
|
export { extractFinalResponse } from './utils/conversation.js';
|
|
15
15
|
export { resolveTaskModel } from './router/task-router.js';
|
|
16
|
+
export { assertThinkingUnsupported } from './provider/thinking-support.js';
|
|
16
17
|
export { drainQuery, query } from './runtime/query/index.js';
|
|
18
|
+
export { SteeringBinding, attachSteering, formatSteeringNote } from './runtime/query/steering.js';
|
|
19
|
+
export type { SteeringChannel } from './runtime/query/steering.js';
|
|
17
20
|
export { createMockBidiProvider, startBidiRun } from './runtime/bidi/index.js';
|
|
18
21
|
export { ContextCache } from './runtime/query/context-cache.js';
|
|
19
22
|
export { CheckpointManager, findPendingCheckpoint, isExpiredPark, listExpiredParks, projectEmergencyToCheckpoint, } from './runtime/query/checkpoint.js';
|
|
@@ -32,7 +35,7 @@ export { buildLimitConfig, checkLimitsDetailed, createRunReporter, } from './run
|
|
|
32
35
|
export { assembleSystemPrompt, mergePersonas, withSessionContext, } from './persona/index.js';
|
|
33
36
|
export { discoverSkills, loadSkill, resolveSkillChain, SkillRegistry, } from './skills/index.js';
|
|
34
37
|
export { AdvisorRegistry, AdvisoryContext, AdvisoryExecutor, TriggerEvaluator, } from './advisory/index.js';
|
|
35
|
-
export { AbstractAgent, ConcurrentInvocationError, defineAgent, InvocationLock, PipelineAgent, ReactiveAgent, RouterAgent, SupervisorAgent, } from './agents/index.js';
|
|
38
|
+
export { AbstractAgent, ConcurrentInvocationError, defineAgent, InvocationLock, PipelineAgent, ReactiveAgent, RouterAgent, runAgent, SupervisorAgent, } from './agents/index.js';
|
|
36
39
|
export { ActivityStore, DiskCheckpointStore, DiskMemoryStore, DiskTaskStore, InMemoryMemoryIndex, InMemoryMemoryStore, InMemoryStore, InMemoryTaskStore, RunDiskStore, } from './store/index.js';
|
|
37
40
|
export { AgentRegistry, ManagedRegistry, PluginRegistry, Registry, ToolCatalog, ToolNameCollisionError, ToolRegistry, createToolCatalogFromRegistry, loadingFromAvailability, toolDefinitionToCatalogEntry, } from './registry/index.js';
|
|
38
41
|
export { discoverAllPluginDirs, discoverPlugins, loadPluginManifest, PluginLifecycleManager, PluginResolver, } from './plugin/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-runtime.d.ts","sourceRoot":"","sources":["../src/public-runtime.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACtB,MAAM,qBAAqB,CAAA;AAI5B,cAAc,sBAAsB,CAAA;AAIpC,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,WAAW,EACX,kBAAkB,GAClB,MAAM,wBAAwB,CAAA;AAE/B,cAAc,oBAAoB,CAAA;AAIlC,cAAc,eAAe,CAAA;AAI7B,OAAO,EACN,cAAc,EACd,aAAa,EACb,UAAU,EACV,SAAS,GACT,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EACN,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAI9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"public-runtime.d.ts","sourceRoot":"","sources":["../src/public-runtime.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,g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