dsh-harness-reflex 0.1.0 → 0.3.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/README.md +20 -6
- package/client.js +3511 -185
- package/dist/attribution.d.ts +266 -0
- package/dist/attribution.js +238 -0
- package/dist/attribution.js.map +1 -0
- package/dist/bridge.d.ts +311 -13
- package/dist/bridge.js +714 -42
- package/dist/bridge.js.map +1 -1
- package/dist/client-bundle.js +4 -1
- package/dist/client-bundle.js.map +1 -1
- package/dist/command.js +10 -0
- package/dist/command.js.map +1 -1
- package/dist/config.d.ts +530 -22
- package/dist/config.js +808 -27
- package/dist/config.js.map +1 -1
- package/dist/delegation-dispatch.d.ts +132 -0
- package/dist/delegation-dispatch.js +186 -0
- package/dist/delegation-dispatch.js.map +1 -0
- package/dist/delegation-health.d.ts +131 -0
- package/dist/delegation-health.js +97 -0
- package/dist/delegation-health.js.map +1 -0
- package/dist/delegation.d.ts +148 -0
- package/dist/delegation.js +186 -0
- package/dist/delegation.js.map +1 -0
- package/dist/effort-delegation.d.ts +144 -0
- package/dist/effort-delegation.js +280 -0
- package/dist/effort-delegation.js.map +1 -0
- package/dist/effort.d.ts +141 -0
- package/dist/effort.js +251 -9
- package/dist/effort.js.map +1 -1
- package/dist/host-patch.d.ts +156 -0
- package/dist/host-patch.js +534 -0
- package/dist/host-patch.js.map +1 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.js +99 -7
- package/dist/index.js.map +1 -1
- package/dist/interventions.d.ts +98 -373
- package/dist/interventions.js +442 -1702
- package/dist/interventions.js.map +1 -1
- package/dist/panel-api.d.ts +328 -4
- package/dist/panel-api.js +322 -15
- package/dist/panel-api.js.map +1 -1
- package/dist/panel-mount.d.ts +81 -22
- package/dist/panel-mount.js +228 -7
- package/dist/panel-mount.js.map +1 -1
- package/dist/routing.d.ts +23 -18
- package/dist/routing.js +471 -153
- package/dist/routing.js.map +1 -1
- package/dist/session-audit.d.ts +70 -0
- package/dist/session-audit.js +73 -0
- package/dist/session-audit.js.map +1 -1
- package/dist/systemone-probe.d.ts +114 -0
- package/dist/systemone-probe.js +383 -0
- package/dist/systemone-probe.js.map +1 -0
- package/dist/testing.d.ts +212 -7
- package/dist/testing.js +333 -27
- package/dist/testing.js.map +1 -1
- package/dist/tools.d.ts +109 -3
- package/dist/tools.js +103 -4
- package/dist/tools.js.map +1 -1
- package/dist/unconfigured-backend.d.ts +72 -0
- package/dist/unconfigured-backend.js +94 -0
- package/dist/unconfigured-backend.js.map +1 -0
- package/dist/vendor/harness-reflex/backend/factory.d.ts +31 -1
- package/dist/vendor/harness-reflex/backend/factory.js +18 -3
- package/dist/vendor/harness-reflex/backend/factory.js.map +1 -1
- package/dist/vendor/harness-reflex/backend/jev.d.ts +20 -0
- package/dist/vendor/harness-reflex/backend/jev.js +11 -4
- package/dist/vendor/harness-reflex/backend/jev.js.map +1 -1
- package/dist/vendor/harness-reflex/backend/simple-jev.d.ts +16 -0
- package/dist/vendor/harness-reflex/backend/simple-jev.js +17 -6
- package/dist/vendor/harness-reflex/backend/simple-jev.js.map +1 -1
- package/dist/vendor/harness-reflex/core/closing.d.ts +90 -0
- package/dist/vendor/harness-reflex/core/closing.js +111 -0
- package/dist/vendor/harness-reflex/core/closing.js.map +1 -0
- package/dist/vendor/harness-reflex/core/evidence.d.ts +119 -0
- package/dist/vendor/harness-reflex/core/evidence.js +209 -0
- package/dist/vendor/harness-reflex/core/evidence.js.map +1 -0
- package/dist/vendor/harness-reflex/core/judge.d.ts +221 -0
- package/dist/vendor/harness-reflex/core/judge.js +251 -0
- package/dist/vendor/harness-reflex/core/judge.js.map +1 -0
- package/dist/vendor/harness-reflex/core/orchestrate-closing.d.ts +237 -0
- package/dist/vendor/harness-reflex/core/orchestrate-closing.js +250 -0
- package/dist/vendor/harness-reflex/core/orchestrate-closing.js.map +1 -0
- package/dist/vendor/harness-reflex/core/orchestrate-correction.d.ts +209 -0
- package/dist/vendor/harness-reflex/core/orchestrate-correction.js +141 -0
- package/dist/vendor/harness-reflex/core/orchestrate-correction.js.map +1 -0
- package/dist/vendor/harness-reflex/core/orchestrate-host.d.ts +225 -0
- package/dist/vendor/harness-reflex/core/orchestrate-host.js +80 -0
- package/dist/vendor/harness-reflex/core/orchestrate-host.js.map +1 -0
- package/dist/vendor/harness-reflex/core/orchestrate-stagnation.d.ts +259 -0
- package/dist/vendor/harness-reflex/core/orchestrate-stagnation.js +270 -0
- package/dist/vendor/harness-reflex/core/orchestrate-stagnation.js.map +1 -0
- package/dist/vendor/harness-reflex/core/orchestrate.d.ts +357 -0
- package/dist/vendor/harness-reflex/core/orchestrate.js +418 -0
- package/dist/vendor/harness-reflex/core/orchestrate.js.map +1 -0
- package/dist/vendor/harness-reflex/core/policy.d.ts +122 -0
- package/dist/vendor/harness-reflex/core/policy.js +102 -0
- package/dist/vendor/harness-reflex/core/policy.js.map +1 -0
- package/dist/vendor/harness-reflex/core/prune-plan.d.ts +141 -0
- package/dist/vendor/harness-reflex/core/prune-plan.js +390 -0
- package/dist/vendor/harness-reflex/core/prune-plan.js.map +1 -0
- package/dist/vendor/harness-reflex/core/text.d.ts +36 -0
- package/dist/vendor/harness-reflex/core/text.js +66 -0
- package/dist/vendor/harness-reflex/core/text.js.map +1 -0
- package/dist/vendor/harness-reflex/ports/audit.d.ts +18 -0
- package/dist/vendor/harness-reflex/ports/audit.js +11 -0
- package/dist/vendor/harness-reflex/ports/audit.js.map +1 -0
- package/dist/vendor/harness-reflex/ports/clock.d.ts +14 -0
- package/dist/vendor/harness-reflex/ports/clock.js +11 -0
- package/dist/vendor/harness-reflex/ports/clock.js.map +1 -0
- package/dist/vendor/harness-reflex/ports/decision.d.ts +75 -0
- package/dist/vendor/harness-reflex/ports/decision.js +2 -0
- package/dist/vendor/harness-reflex/ports/decision.js.map +1 -0
- package/dist/vendor/harness-reflex/ports/index.d.ts +14 -0
- package/dist/vendor/harness-reflex/ports/index.js +2 -0
- package/dist/vendor/harness-reflex/ports/index.js.map +1 -0
- package/dist/vendor/harness-reflex/ports/log.d.ts +22 -0
- package/dist/vendor/harness-reflex/ports/log.js +12 -0
- package/dist/vendor/harness-reflex/ports/log.js.map +1 -0
- package/dist/vendor/harness-reflex/ports/state.d.ts +46 -0
- package/dist/vendor/harness-reflex/ports/state.js +13 -0
- package/dist/vendor/harness-reflex/ports/state.js.map +1 -0
- package/package.json +25 -13
package/dist/testing.d.ts
CHANGED
|
@@ -1,10 +1,66 @@
|
|
|
1
1
|
import { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import { type Agent } from '@deepseek-ai/dsh-agent';
|
|
2
|
+
import { type Agent, type ModelSelection } from '@deepseek-ai/dsh-agent';
|
|
3
3
|
import { LlmAdapter, type GenerateOptions, type LlmCallConfig, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type StreamChunk, type UserMessage } from '@deepseek-ai/dsh-llm';
|
|
4
|
-
import { type ToolExecutionResult } from '@deepseek-ai/dsh-tools';
|
|
4
|
+
import { type ToolDefinition, type ToolExecutionResult } from '@deepseek-ai/dsh-tools';
|
|
5
5
|
import { apply } from './index.js';
|
|
6
6
|
import type { ReflexRuntime } from './bridge.js';
|
|
7
7
|
import type { ReflexConfig } from './config.js';
|
|
8
|
+
/**
|
|
9
|
+
* Call metadata for one synthesized registry call.
|
|
10
|
+
*
|
|
11
|
+
* dsh-tools ≥ 0.2.2 no longer accepts a single call: `tools.execute()` takes a
|
|
12
|
+
* `ToolBatchInput` and settles a `ToolBatchResult`. A call is therefore
|
|
13
|
+
* addressed by `ToolCallBlock.id`, carries its arguments as the raw JSON
|
|
14
|
+
* string the model would have produced, and keeps its own `callId` here only
|
|
15
|
+
* to reach it back out of the batch.
|
|
16
|
+
*/
|
|
17
|
+
export interface TestToolCall {
|
|
18
|
+
/** Model-issued call id this batch entry is addressed by. */
|
|
19
|
+
readonly callId: string;
|
|
20
|
+
/** Registered tool name. */
|
|
21
|
+
readonly name: string;
|
|
22
|
+
/** Model-shaped arguments; serialized into the call block. */
|
|
23
|
+
readonly args?: unknown;
|
|
24
|
+
/** Owning agent, which selects its scoped executor. */
|
|
25
|
+
readonly agent?: Agent;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Run one synthesized call through the real registry pipeline.
|
|
29
|
+
* @param ctx - a context whose `tools` service is live.
|
|
30
|
+
* @param call - the call to dispatch.
|
|
31
|
+
* @returns the batch entry whose id matches {@link TestToolCall.callId}.
|
|
32
|
+
* @throws Error when the batch settled a different call.
|
|
33
|
+
*/
|
|
34
|
+
export declare function executeOne(ctx: Context, call: TestToolCall): Promise<ToolExecutionResult>;
|
|
35
|
+
/**
|
|
36
|
+
* The `modelSelection` an `agent/pre-step` payload now requires.
|
|
37
|
+
*
|
|
38
|
+
* The waterfall payload gained `agent`, `modelSelection`, and (in tests) a
|
|
39
|
+
* `model` it does not read. Requirements beyond the identity the step already
|
|
40
|
+
* carries are supplied from the agent's own composed options, falling back to
|
|
41
|
+
* the reflex route, so a test never invents a selection the loop could not.
|
|
42
|
+
* @param agent - the agent stepping.
|
|
43
|
+
* @returns the selection the loop would carry into the step.
|
|
44
|
+
*/
|
|
45
|
+
export declare function stepSelection(agent: Agent): Readonly<ModelSelection>;
|
|
46
|
+
/**
|
|
47
|
+
* Build the `agent/pre-step` payload the waterfall now declares.
|
|
48
|
+
* @param agent - the agent stepping.
|
|
49
|
+
* @param turn - turn number.
|
|
50
|
+
* @param step - step number.
|
|
51
|
+
* @param messages - messages the step carries.
|
|
52
|
+
* @param signal - cancellation state.
|
|
53
|
+
* @param modelSelection - selection the loop carries into the step; defaults to the agent's own.
|
|
54
|
+
* @returns the payload, spelled out rather than cast.
|
|
55
|
+
*/
|
|
56
|
+
export declare function preStepPayload(agent: Agent, turn: number, step: number, messages: readonly UserMessage[], signal?: AbortSignal, modelSelection?: Readonly<ModelSelection>): {
|
|
57
|
+
agent: Agent;
|
|
58
|
+
messages: UserMessage[];
|
|
59
|
+
turn: number;
|
|
60
|
+
step: number;
|
|
61
|
+
signal: AbortSignal;
|
|
62
|
+
modelSelection: Readonly<ModelSelection>;
|
|
63
|
+
};
|
|
8
64
|
/**
|
|
9
65
|
* Test harness for the reflex Host plugin.
|
|
10
66
|
*
|
|
@@ -16,6 +72,21 @@ import type { ReflexConfig } from './config.js';
|
|
|
16
72
|
*
|
|
17
73
|
* @module dsh-reflex/testing
|
|
18
74
|
*/
|
|
75
|
+
/**
|
|
76
|
+
* Reproduce the loader's own `loader/volatile-update` dispatch.
|
|
77
|
+
*
|
|
78
|
+
* The real loader emits with `Object.create(fiber.ctx)` carrying a
|
|
79
|
+
* `Context.filter` that admits only listeners owned by the committing fiber.
|
|
80
|
+
* Cordis 4.x hands out context-bound *proxies* of a fiber, so a fiber read off
|
|
81
|
+
* one context is never `===` the fiber its own context reports; comparing
|
|
82
|
+
* against `fiber.ctx.fiber` is the identity the event store records.
|
|
83
|
+
*
|
|
84
|
+
* @param entryFiber - the fiber the loader resolved for the entry.
|
|
85
|
+
* @returns the receiver the loader emits with.
|
|
86
|
+
*/
|
|
87
|
+
export declare function loaderEventReceiver(entryFiber: {
|
|
88
|
+
ctx: Context;
|
|
89
|
+
}): Record<symbol, unknown>;
|
|
19
90
|
/** The plugin as Cordis sees it, for `ctx.plugin()`-based lifecycle tests. */
|
|
20
91
|
export declare const reflexPlugin: {
|
|
21
92
|
name: string;
|
|
@@ -23,6 +94,21 @@ export declare const reflexPlugin: {
|
|
|
23
94
|
Config: Schemastery<any, any, "plain">;
|
|
24
95
|
apply: typeof apply;
|
|
25
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* The Host's native executor, shaped as a Cordis plugin spec.
|
|
99
|
+
*
|
|
100
|
+
* dsh-tools >= 0.2.2 moved execution out of the registry: `tools.execute()`
|
|
101
|
+
* throws TOOL_EXECUTOR_UNAVAILABLE until an executor plugin is selected, so a
|
|
102
|
+
* harness that only mounts `ToolRuntime` can no longer dispatch anything. The
|
|
103
|
+
* module's `apply` is a plain function, so `{ ...module }` would lose its
|
|
104
|
+
* context binding, and `ctx.plugin()` reads `inject` only from a spec object,
|
|
105
|
+
* never from a derived function — hence the explicit fields.
|
|
106
|
+
*/
|
|
107
|
+
export declare const nativeExecutorPlugin: {
|
|
108
|
+
name: string;
|
|
109
|
+
inject: string[];
|
|
110
|
+
apply: (scope: Context) => void;
|
|
111
|
+
};
|
|
26
112
|
/** A booted application with the reflex tools registered. */
|
|
27
113
|
export interface ReflexTestHost {
|
|
28
114
|
/** Root context carrying `systemPrompt`, `tools`, `llm`, and `commands`. */
|
|
@@ -36,9 +122,66 @@ export interface ReflexTestHost {
|
|
|
36
122
|
}
|
|
37
123
|
/**
|
|
38
124
|
* Boot Cordis with `systemPrompt`, `tools`, `llm`, and `commands` loaded.
|
|
125
|
+
*
|
|
126
|
+
* The Host's delegation tool is registered as part of the composition, because
|
|
127
|
+
* `reflex_delegate` is a wrapper around it and a harness without it would not
|
|
128
|
+
* reflect a normal deployment. A test that needs the no-delegation case uses
|
|
129
|
+
* {@link createToolContextWithoutDelegation}.
|
|
39
130
|
* @returns the root context, ready for `apply` or `ctx.plugin`.
|
|
40
131
|
*/
|
|
41
|
-
export declare function createToolContext(
|
|
132
|
+
export declare function createToolContext(options?: {
|
|
133
|
+
record?: Array<Record<string, unknown>>;
|
|
134
|
+
}): Promise<Context>;
|
|
135
|
+
/**
|
|
136
|
+
* Mount the Host services every harness needs, including the two the plugin
|
|
137
|
+
* reads a session selection from.
|
|
138
|
+
*
|
|
139
|
+
* The agent runtime injects `sessionProjections` as a *required* service, and it
|
|
140
|
+
* registers `modelSelectionProjectionDefinition` before it drives any step. A
|
|
141
|
+
* harness without either is not a quieter Host, it is a different one:
|
|
142
|
+
* `resolveAdaptiveIntent` would fall back to "no projection", `stateOf` would
|
|
143
|
+
* answer `undefined`, and a selection read that is wrong only in production
|
|
144
|
+
* would look green here. Mounting both keeps the decision path identical.
|
|
145
|
+
*
|
|
146
|
+
* @param ctx - the context to mount onto.
|
|
147
|
+
*/
|
|
148
|
+
export declare function mountHostServices(ctx: Context): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Boot Cordis with every service the plugin depends on, but **no** delegation
|
|
151
|
+
* tool — the one deployment shape in which `reflex_delegate` must not register.
|
|
152
|
+
* @returns the root context.
|
|
153
|
+
*/
|
|
154
|
+
export declare function createToolContextWithoutDelegation(): Promise<Context>;
|
|
155
|
+
/**
|
|
156
|
+
* The Host's delegation tool, shaped as the harness mounts it.
|
|
157
|
+
*
|
|
158
|
+
* `reflex_delegate` is a *wrapper*: it registers only when the Host tool exists
|
|
159
|
+
* and declares `reasoning_effort` (i.e. the deployment set `modelSelection:
|
|
160
|
+
* true`). A harness without that tool therefore reproduces an unusual deployment
|
|
161
|
+
* rather than the normal one, so the default host mounts this stand-in — same
|
|
162
|
+
* name, same parameter list as `@deepseek-ai/dsh-tool-subagent` publishes when
|
|
163
|
+
* model selection is on — and records what the wrapper forwards. Tests that need
|
|
164
|
+
* a Host *without* delegation simply do not seed it (see
|
|
165
|
+
* {@link createReflexHostWithTools}).
|
|
166
|
+
*/
|
|
167
|
+
export interface DelegationStandIn {
|
|
168
|
+
/** Registry name the Host uses by default. */
|
|
169
|
+
readonly name: string;
|
|
170
|
+
/** Every argument object the delegate forwarded, oldest first. */
|
|
171
|
+
readonly calls: Array<Record<string, unknown>>;
|
|
172
|
+
/** The definition to register. */
|
|
173
|
+
readonly definition: ToolDefinition;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Build the Host delegation-tool stand-in.
|
|
177
|
+
* @param options - omit `reasoningEffort` to model a deployment with model selection off.
|
|
178
|
+
* @returns the stand-in, with its recorded dispatches.
|
|
179
|
+
*/
|
|
180
|
+
export declare function delegationStandIn(options?: {
|
|
181
|
+
reasoningEffort?: boolean;
|
|
182
|
+
record?: Array<Record<string, unknown>>;
|
|
183
|
+
refuse?: string;
|
|
184
|
+
}): DelegationStandIn;
|
|
42
185
|
/**
|
|
43
186
|
* Boot a context and register the reflex tools on it with the exported
|
|
44
187
|
* {@link applyReflex}, mirroring a Host that loads the plugin while keeping a
|
|
@@ -55,6 +198,45 @@ export declare function createReflexHost(config?: ReflexConfig): Promise<ReflexT
|
|
|
55
198
|
* @returns the registry result (never throws for tool-level failures).
|
|
56
199
|
*/
|
|
57
200
|
export declare function callTool(ctx: Context, name: string, args?: unknown): Promise<ToolExecutionResult>;
|
|
201
|
+
/**
|
|
202
|
+
* Boot a context, register extra tools on it *before* the plugin mounts, and
|
|
203
|
+
* then apply the plugin — the order the real Host uses.
|
|
204
|
+
*
|
|
205
|
+
* `reflex_delegate` is conditional on the Host's delegation tool, and that
|
|
206
|
+
* condition is resolved when the tool surface is installed. A stand-in
|
|
207
|
+
* registered afterwards would therefore never be wrapped, so tests that need a
|
|
208
|
+
* delegate must seed the registry first, exactly as the Host does.
|
|
209
|
+
* @param config - deployment config.
|
|
210
|
+
* @param seed - registers the pre-existing tools; called before the plugin applies.
|
|
211
|
+
* @param options - `delegation: false` boots a context with no Host delegation tool.
|
|
212
|
+
* @returns the host handle.
|
|
213
|
+
*/
|
|
214
|
+
export declare function createReflexHostWithTools(config: ReflexConfig | undefined, seed: (ctx: Context) => void, options?: {
|
|
215
|
+
delegation?: boolean;
|
|
216
|
+
record?: Array<Record<string, unknown>>;
|
|
217
|
+
}): Promise<ReflexTestHost>;
|
|
218
|
+
/**
|
|
219
|
+
* Boot a context and put the Host delegation tool **inside an agent scope**.
|
|
220
|
+
*
|
|
221
|
+
* This is the shape a real deployment has: `tool-subagent` is attached to the
|
|
222
|
+
* agent preset, so `ctx.tools.get('subagent')` — the global view — does not see
|
|
223
|
+
* it and `ctx.tools.get('subagent', scope)` does. A test that only ever
|
|
224
|
+
* registers globally cannot reproduce g-054, because the global view is exactly
|
|
225
|
+
* the view the bug was reading.
|
|
226
|
+
*
|
|
227
|
+
* The scope is minted the way the Host mints one: under a context that declares
|
|
228
|
+
* `tools`, which the scoped context then inherits.
|
|
229
|
+
* @param options - `reasoningEffort: false` models a host with model selection off.
|
|
230
|
+
* @returns the root context and the scope key its delegation tool lives in.
|
|
231
|
+
*/
|
|
232
|
+
export declare function createScopedDelegationHost(options?: {
|
|
233
|
+
reasoningEffort?: boolean;
|
|
234
|
+
record?: Array<Record<string, unknown>>;
|
|
235
|
+
}): Promise<{
|
|
236
|
+
ctx: Context;
|
|
237
|
+
scope: Agent;
|
|
238
|
+
dispose: () => Promise<void>;
|
|
239
|
+
}>;
|
|
58
240
|
/**
|
|
59
241
|
* Read the text a model would receive from one tool result.
|
|
60
242
|
* @param result - a registry result.
|
|
@@ -152,24 +334,47 @@ export interface FakeAgentSeed {
|
|
|
152
334
|
model?: string;
|
|
153
335
|
}
|
|
154
336
|
/**
|
|
155
|
-
* Build the
|
|
337
|
+
* Build the agent shape the routing listeners read.
|
|
338
|
+
*
|
|
339
|
+
* The session is a real {@link Session}, not a `{ header }` stand-in: the
|
|
340
|
+
* selection projection folds a session's committed events (`snapshotEvents`),
|
|
341
|
+
* and `resolveAdaptiveIntent` reads it. A plain object would make that read
|
|
342
|
+
* throw and silently downgrade every test to "no projection" — i.e. the harness
|
|
343
|
+
* would not reproduce the Host at all.
|
|
344
|
+
*
|
|
156
345
|
* @param seed - identity and lineage facts.
|
|
157
346
|
* @returns an object usable as the `agent` payload field.
|
|
158
347
|
*/
|
|
159
348
|
export declare function fakeAgent(seed: FakeAgentSeed): Agent;
|
|
160
349
|
/**
|
|
161
350
|
* Dispatch one `agent/pre-step` and then one `agent/request` for an agent, the
|
|
162
|
-
* way
|
|
351
|
+
* way `dsh-agent-loop` does, and return the configuration the loop would use.
|
|
352
|
+
*
|
|
353
|
+
* The order is the loop's own (g-056), not a convenience: the step's selection
|
|
354
|
+
* is captured first (`this.model.current()`), passed through the `agent/pre-step`
|
|
355
|
+
* waterfall, and only then compared against what `agent/request` proposes. The
|
|
356
|
+
* two guards are the loop's two guards, message for message, so a decision that
|
|
357
|
+
* wrote the wrong place fails here instead of in a real session.
|
|
358
|
+
*
|
|
163
359
|
* @param ctx - context the plugin was loaded on.
|
|
164
360
|
* @param agent - the requesting agent.
|
|
165
|
-
* @param options - step identity and the
|
|
361
|
+
* @param options - step identity and the selection the loop fixes for the step.
|
|
166
362
|
* @returns the rewritten call configuration.
|
|
363
|
+
* @throws Error when the waterfall proposed a provider, model or effort the step
|
|
364
|
+
* preparation had already fixed — exactly what the Host throws.
|
|
167
365
|
*/
|
|
168
366
|
export declare function dispatchAgentRequest(ctx: Context, agent: Agent, options?: {
|
|
169
367
|
turn?: number;
|
|
170
368
|
step?: number;
|
|
171
369
|
task?: string;
|
|
172
|
-
|
|
370
|
+
/**
|
|
371
|
+
* The selection the loop fixed for this step (`this.model.current()`).
|
|
372
|
+
*
|
|
373
|
+
* Defaults to the agent's own composition, which is what the earlier
|
|
374
|
+
* harness called `config`; the field is named for the *loop's* concept so a
|
|
375
|
+
* test cannot mistake it for the request config, which is derived from it.
|
|
376
|
+
*/
|
|
377
|
+
selection?: Readonly<ModelSelection>;
|
|
173
378
|
/** Cancellation state the loop would carry into the request. */
|
|
174
379
|
signal?: AbortSignal;
|
|
175
380
|
}): Promise<LlmCallConfig>;
|