@openrouter/agent 0.9.0 → 0.11.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 +267 -2
- package/THIRD_PARTY_NOTICES.md +25 -0
- package/esm/index.d.ts +4 -3
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/inner-loop/call-model.d.ts.map +1 -1
- package/esm/inner-loop/call-model.js +26 -7
- package/esm/inner-loop/call-model.js.map +1 -1
- package/esm/lib/agent-tool.d.ts +1 -1
- package/esm/lib/agent-tool.d.ts.map +1 -1
- package/esm/lib/agent-tool.js.map +1 -1
- package/esm/lib/async-params.d.ts +23 -1
- package/esm/lib/async-params.d.ts.map +1 -1
- package/esm/lib/async-params.js +26 -1
- package/esm/lib/async-params.js.map +1 -1
- package/esm/lib/conversation-state.d.ts +1 -1
- package/esm/lib/conversation-state.d.ts.map +1 -1
- package/esm/lib/conversation-state.js +48 -13
- package/esm/lib/conversation-state.js.map +1 -1
- package/esm/lib/hooks-schemas.d.ts +3 -7
- package/esm/lib/hooks-schemas.d.ts.map +1 -1
- package/esm/lib/hooks-schemas.js.map +1 -1
- package/esm/lib/model-result.d.ts +32 -4
- package/esm/lib/model-result.d.ts.map +1 -1
- package/esm/lib/model-result.js +444 -128
- package/esm/lib/model-result.js.map +1 -1
- package/esm/lib/next-turn-params.d.ts.map +1 -1
- package/esm/lib/next-turn-params.js +3 -1
- package/esm/lib/next-turn-params.js.map +1 -1
- package/esm/lib/next-turn-params.test.js +72 -0
- package/esm/lib/next-turn-params.test.js.map +1 -1
- package/esm/lib/reusable-stream.d.ts +30 -3
- package/esm/lib/reusable-stream.d.ts.map +1 -1
- package/esm/lib/reusable-stream.js +127 -32
- package/esm/lib/reusable-stream.js.map +1 -1
- package/esm/lib/stream-transformers.d.ts +1 -1
- package/esm/lib/stream-transformers.d.ts.map +1 -1
- package/esm/lib/stream-transformers.js.map +1 -1
- package/esm/lib/tool-event-broadcaster.d.ts +18 -5
- package/esm/lib/tool-event-broadcaster.d.ts.map +1 -1
- package/esm/lib/tool-event-broadcaster.js +90 -19
- package/esm/lib/tool-event-broadcaster.js.map +1 -1
- package/esm/lib/tool-set-types.d.ts +298 -0
- package/esm/lib/tool-set-types.d.ts.map +1 -0
- package/esm/lib/tool-set-types.js +2 -0
- package/esm/lib/tool-set-types.js.map +1 -0
- package/esm/lib/tool-set.d.ts +157 -0
- package/esm/lib/tool-set.d.ts.map +1 -0
- package/esm/lib/tool-set.js +473 -0
- package/esm/lib/tool-set.js.map +1 -0
- package/esm/lib/tool-types.d.ts +203 -29
- package/esm/lib/tool-types.d.ts.map +1 -1
- package/esm/lib/tool-types.js.map +1 -1
- package/esm/lib/tool.d.ts +47 -21
- package/esm/lib/tool.d.ts.map +1 -1
- package/esm/lib/tool.js +13 -3
- package/esm/lib/tool.js.map +1 -1
- package/esm/lib/turn-context.d.ts +1 -1
- package/esm/lib/turn-context.d.ts.map +1 -1
- package/esm/lib/turn-context.js +1 -2
- package/esm/lib/turn-context.js.map +1 -1
- package/esm/mcp/auth/auth-resolver.d.ts +14 -0
- package/esm/mcp/auth/auth-resolver.d.ts.map +1 -0
- package/esm/mcp/auth/auth-resolver.js +27 -0
- package/esm/mcp/auth/auth-resolver.js.map +1 -0
- package/esm/mcp/auth/auth-types.d.ts +33 -0
- package/esm/mcp/auth/auth-types.d.ts.map +1 -0
- package/esm/mcp/auth/auth-types.js +4 -0
- package/esm/mcp/auth/auth-types.js.map +1 -0
- package/esm/mcp/build-tools.d.ts +29 -0
- package/esm/mcp/build-tools.d.ts.map +1 -0
- package/esm/mcp/build-tools.js +80 -0
- package/esm/mcp/build-tools.js.map +1 -0
- package/esm/mcp/cache/cache-store.d.ts +24 -0
- package/esm/mcp/cache/cache-store.d.ts.map +1 -0
- package/esm/mcp/cache/cache-store.js +20 -0
- package/esm/mcp/cache/cache-store.js.map +1 -0
- package/esm/mcp/cache/cache-types.d.ts +71 -0
- package/esm/mcp/cache/cache-types.d.ts.map +1 -0
- package/esm/mcp/cache/cache-types.js +49 -0
- package/esm/mcp/cache/cache-types.js.map +1 -0
- package/esm/mcp/cache/serialize.d.ts +25 -0
- package/esm/mcp/cache/serialize.d.ts.map +1 -0
- package/esm/mcp/cache/serialize.js +96 -0
- package/esm/mcp/cache/serialize.js.map +1 -0
- package/esm/mcp/close-quietly.d.ts +24 -0
- package/esm/mcp/close-quietly.d.ts.map +1 -0
- package/esm/mcp/close-quietly.js +30 -0
- package/esm/mcp/close-quietly.js.map +1 -0
- package/esm/mcp/create-mcp-tools.d.ts +13 -0
- package/esm/mcp/create-mcp-tools.d.ts.map +1 -0
- package/esm/mcp/create-mcp-tools.js +87 -0
- package/esm/mcp/create-mcp-tools.js.map +1 -0
- package/esm/mcp/elicitation.d.ts +11 -0
- package/esm/mcp/elicitation.d.ts.map +1 -0
- package/esm/mcp/elicitation.js +51 -0
- package/esm/mcp/elicitation.js.map +1 -0
- package/esm/mcp/errors.d.ts +91 -0
- package/esm/mcp/errors.d.ts.map +1 -0
- package/esm/mcp/errors.js +91 -0
- package/esm/mcp/errors.js.map +1 -0
- package/esm/mcp/handle.d.ts +66 -0
- package/esm/mcp/handle.d.ts.map +1 -0
- package/esm/mcp/handle.js +323 -0
- package/esm/mcp/handle.js.map +1 -0
- package/esm/mcp/index.d.ts +13 -0
- package/esm/mcp/index.d.ts.map +1 -0
- package/esm/mcp/index.js +11 -0
- package/esm/mcp/index.js.map +1 -0
- package/esm/mcp/mcp-connection.d.ts +150 -0
- package/esm/mcp/mcp-connection.d.ts.map +1 -0
- package/esm/mcp/mcp-connection.js +478 -0
- package/esm/mcp/mcp-connection.js.map +1 -0
- package/esm/mcp/mcp-sdk.d.ts +10 -0
- package/esm/mcp/mcp-sdk.d.ts.map +1 -0
- package/esm/mcp/mcp-sdk.js +37 -0
- package/esm/mcp/mcp-sdk.js.map +1 -0
- package/esm/mcp/rehydrate.d.ts +76 -0
- package/esm/mcp/rehydrate.d.ts.map +1 -0
- package/esm/mcp/rehydrate.js +505 -0
- package/esm/mcp/rehydrate.js.map +1 -0
- package/esm/mcp/resource-tools.d.ts +17 -0
- package/esm/mcp/resource-tools.d.ts.map +1 -0
- package/esm/mcp/resource-tools.js +155 -0
- package/esm/mcp/resource-tools.js.map +1 -0
- package/esm/mcp/result-mapper.d.ts +19 -0
- package/esm/mcp/result-mapper.d.ts.map +1 -0
- package/esm/mcp/result-mapper.js +40 -0
- package/esm/mcp/result-mapper.js.map +1 -0
- package/esm/mcp/schema/json-schema-guards.d.ts +14 -0
- package/esm/mcp/schema/json-schema-guards.d.ts.map +1 -0
- package/esm/mcp/schema/json-schema-guards.js +19 -0
- package/esm/mcp/schema/json-schema-guards.js.map +1 -0
- package/esm/mcp/schema/json-schema-to-zod.d.ts +20 -0
- package/esm/mcp/schema/json-schema-to-zod.d.ts.map +1 -0
- package/esm/mcp/schema/json-schema-to-zod.js +72 -0
- package/esm/mcp/schema/json-schema-to-zod.js.map +1 -0
- package/esm/mcp/tool-wrapper.d.ts +41 -0
- package/esm/mcp/tool-wrapper.d.ts.map +1 -0
- package/esm/mcp/tool-wrapper.js +131 -0
- package/esm/mcp/tool-wrapper.js.map +1 -0
- package/esm/mcp/transport-types.d.ts +45 -0
- package/esm/mcp/transport-types.d.ts.map +1 -0
- package/esm/mcp/transport-types.js +2 -0
- package/esm/mcp/transport-types.js.map +1 -0
- package/esm/mcp/types.d.ts +119 -0
- package/esm/mcp/types.d.ts.map +1 -0
- package/esm/mcp/types.js +2 -0
- package/esm/mcp/types.js.map +1 -0
- package/esm/mcp/version.d.ts +3 -0
- package/esm/mcp/version.d.ts.map +1 -0
- package/esm/mcp/version.js +5 -0
- package/esm/mcp/version.js.map +1 -0
- package/package.json +48 -7
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { TOOL_SET_SNAPSHOT } from './async-params.js';
|
|
2
|
+
import type { ClientTool, ConversationState, CorrelatedToolEventUnion, ServerToolBase, Tool } from './tool-types.js';
|
|
3
|
+
/** Client tool: `function.name` literal. */
|
|
4
|
+
export type ClientToolName<T> = T extends {
|
|
5
|
+
function: {
|
|
6
|
+
name: infer N extends string;
|
|
7
|
+
};
|
|
8
|
+
} ? N : never;
|
|
9
|
+
/**
|
|
10
|
+
* Server-tool stable ID.
|
|
11
|
+
* Prefixed so it can never collide with a client function name.
|
|
12
|
+
* Prefers an explicit `id` on the tool; falls back to `server:${config.type}`.
|
|
13
|
+
*
|
|
14
|
+
* When `T`'s `id` has been widened to plain `string` (e.g. a custom-ID
|
|
15
|
+
* `ServerTool<T, TId>` value erased to the exported `ServerToolBase`
|
|
16
|
+
* interface), the concrete literal is no longer visible at the type level.
|
|
17
|
+
* Synthesizing `` `server:${config.type}` `` in that case would be unsound:
|
|
18
|
+
* the runtime `id` could be anything, and the synthesized literal would
|
|
19
|
+
* both reject the real id and falsely claim a default that may not hold.
|
|
20
|
+
* Widening to `string` here is the sound choice — it accepts any runtime id.
|
|
21
|
+
* Only tools with no structural `id` at all fall back to the synthesized
|
|
22
|
+
* default, and concrete `ServerTool<T, TId>` values keep their literal `TId`.
|
|
23
|
+
*/
|
|
24
|
+
export type ServerToolIdOf<T> = 'id' extends keyof T ? T extends {
|
|
25
|
+
readonly id?: infer Id;
|
|
26
|
+
} ? Extract<Id, string> extends infer StringId extends string ? string extends StringId ? string : StringId : never : never : T extends {
|
|
27
|
+
readonly config: {
|
|
28
|
+
type: infer K extends string;
|
|
29
|
+
};
|
|
30
|
+
} ? `server:${K}` : never;
|
|
31
|
+
/** Union of every addressable id for one tool. */
|
|
32
|
+
export type ToolIdOf<T extends Tool> = T extends ServerToolBase ? ServerToolIdOf<T> : ClientToolName<T>;
|
|
33
|
+
export type ToolIdsOfTuple<T extends readonly Tool[]> = ToolIdOf<T[number]>;
|
|
34
|
+
export type ClientToolNamesOfTuple<T extends readonly Tool[]> = ClientToolName<Extract<T[number], ClientTool>>;
|
|
35
|
+
export type ServerToolIdsOfTuple<T extends readonly Tool[]> = ServerToolIdOf<Extract<T[number], ServerToolBase>>;
|
|
36
|
+
/** Lookup tool by id inside a tuple (preserves concrete member type). */
|
|
37
|
+
export type ToolById<T extends readonly Tool[], Id extends string> = Extract<{
|
|
38
|
+
[I in keyof T]: T[I] extends Tool ? (ToolIdOf<T[I]> extends Id ? T[I] : never) : never;
|
|
39
|
+
}[number], Tool>;
|
|
40
|
+
/**
|
|
41
|
+
* Distributive per-element filter used for the wide (non-tuple) case below.
|
|
42
|
+
* A "naked" type parameter (`El`) is required for the conditional to
|
|
43
|
+
* distribute over the `T[number]` union; wrapping it in an indexed access
|
|
44
|
+
* (e.g. checking `T[number]` directly inside the conditional) would collapse
|
|
45
|
+
* to a single non-distributive check instead.
|
|
46
|
+
*/
|
|
47
|
+
type KeepIfActive<El, Active extends string> = El extends Tool ? string extends ToolIdOf<El> ? El : ToolIdOf<El> extends Active ? El : never : never;
|
|
48
|
+
/**
|
|
49
|
+
* Keep tuple order; drop members whose id is not in Active.
|
|
50
|
+
*
|
|
51
|
+
* A genuine fixed-length tuple (`T['length']` is a literal number) is
|
|
52
|
+
* filtered by exact head/tail recursion, preserving order and concrete
|
|
53
|
+
* per-element types. A dynamic `readonly Tool[]` (e.g. an `@openrouter/agent/mcp`
|
|
54
|
+
* tool array not typed as a literal tuple) has `number extends T['length']`,
|
|
55
|
+
* so it falls back to a distributive per-element filter instead of
|
|
56
|
+
* recursing — the tuple pattern never matches a general array, and without
|
|
57
|
+
* this branch the recursion always bottoms out at `readonly []`.
|
|
58
|
+
*/
|
|
59
|
+
export type FilterToolsByIds<T extends readonly Tool[], Active extends string> = number extends T['length'] ? readonly KeepIfActive<T[number], Active>[] : T extends readonly [
|
|
60
|
+
infer H extends Tool,
|
|
61
|
+
...infer R extends readonly Tool[]
|
|
62
|
+
] ? ToolIdOf<H> extends Active ? readonly [
|
|
63
|
+
H,
|
|
64
|
+
...FilterToolsByIds<R, Active>
|
|
65
|
+
] : FilterToolsByIds<R, Active> : readonly [];
|
|
66
|
+
/** IDs that are statically enabled or selected from the conditional partition. */
|
|
67
|
+
type ResolvedActiveIds<P extends Partition, TActive extends string> = P['enabled'] | Extract<TActive, P['conditional']>;
|
|
68
|
+
/**
|
|
69
|
+
* Exact tuple for static partitions; possible active members for partitions
|
|
70
|
+
* whose runtime predicates can change tuple membership.
|
|
71
|
+
*/
|
|
72
|
+
export type ResolvedTools<TTools extends readonly Tool[], P extends Partition, TActive extends P['conditional'] = P['conditional']> = [
|
|
73
|
+
P['conditional']
|
|
74
|
+
] extends [
|
|
75
|
+
never
|
|
76
|
+
] ? FilterToolsByIds<TTools, P['enabled'] & ToolIdsOfTuple<TTools>> : readonly FilterToolsByIds<TTools, ResolvedActiveIds<P, TActive> & ToolIdsOfTuple<TTools>>[number][];
|
|
77
|
+
/**
|
|
78
|
+
* Enabled = statically on (default, or .activate / situation.enabled)
|
|
79
|
+
* Disabled = statically off (.deactivate / situation.disabled)
|
|
80
|
+
* Conditional = runtime predicate (.activateWhen / .deactivateWhen / situation rules)
|
|
81
|
+
*
|
|
82
|
+
* Invariants (enforced by mutators via Exclude):
|
|
83
|
+
* Enabled ∩ Disabled = ∅
|
|
84
|
+
* Enabled ∩ Conditional = ∅
|
|
85
|
+
* Disabled ∩ Conditional = ∅
|
|
86
|
+
* Enabled ∪ Disabled ∪ Conditional = all known IDs
|
|
87
|
+
*/
|
|
88
|
+
export type Partition = {
|
|
89
|
+
enabled: string;
|
|
90
|
+
disabled: string;
|
|
91
|
+
conditional: string;
|
|
92
|
+
};
|
|
93
|
+
export type EmptyPartition = {
|
|
94
|
+
enabled: never;
|
|
95
|
+
disabled: never;
|
|
96
|
+
conditional: never;
|
|
97
|
+
};
|
|
98
|
+
/** Default construction: every tool ID enabled. */
|
|
99
|
+
export type InitialPartition<T extends readonly Tool[]> = {
|
|
100
|
+
enabled: ToolIdsOfTuple<T>;
|
|
101
|
+
disabled: never;
|
|
102
|
+
conditional: never;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Deliberately imprecise partition for mutable `ToolSet` instances.
|
|
106
|
+
*
|
|
107
|
+
* A mutable `ToolSet` mutates one shared runtime object in place, and any
|
|
108
|
+
* number of aliases can reference that same object. If mutators refined the
|
|
109
|
+
* partition type the way the immutable path does, two aliases of the same
|
|
110
|
+
* live object could statically claim different, contradictory exact
|
|
111
|
+
* partitions the instant one of them mutated — an unsound state (e.g. one
|
|
112
|
+
* alias's type promising `disabled: never` while the object it points to
|
|
113
|
+
* has, in fact, just been deactivated through another alias).
|
|
114
|
+
*
|
|
115
|
+
* Mutable instances therefore use this single widened partition,
|
|
116
|
+
* unconditionally and unchanging, for their entire lifetime: nothing is
|
|
117
|
+
* ever statically guaranteed enabled or disabled, and every id is treated
|
|
118
|
+
* as `conditional` (only knowable by calling `resolve()`). Every alias of a
|
|
119
|
+
* mutable instance carries the exact same (already maximally conservative)
|
|
120
|
+
* type, so no alias can ever make a compile-time claim the runtime object
|
|
121
|
+
* could contradict.
|
|
122
|
+
*/
|
|
123
|
+
export type WidenedPartition<T extends readonly Tool[]> = {
|
|
124
|
+
enabled: never;
|
|
125
|
+
disabled: never;
|
|
126
|
+
conditional: ToolIdsOfTuple<T>;
|
|
127
|
+
};
|
|
128
|
+
export type ActivatePartition<P extends Partition, Name extends string> = {
|
|
129
|
+
enabled: P['enabled'] | Name;
|
|
130
|
+
disabled: Exclude<P['disabled'], Name>;
|
|
131
|
+
conditional: Exclude<P['conditional'], Name>;
|
|
132
|
+
};
|
|
133
|
+
export type DeactivatePartition<P extends Partition, Name extends string> = {
|
|
134
|
+
enabled: Exclude<P['enabled'], Name>;
|
|
135
|
+
disabled: P['disabled'] | Name;
|
|
136
|
+
conditional: Exclude<P['conditional'], Name>;
|
|
137
|
+
};
|
|
138
|
+
export type ConditionalPartition<P extends Partition, Name extends string> = {
|
|
139
|
+
enabled: Exclude<P['enabled'], Name>;
|
|
140
|
+
disabled: Exclude<P['disabled'], Name>;
|
|
141
|
+
conditional: P['conditional'] | Name;
|
|
142
|
+
};
|
|
143
|
+
export type ActivationInput<TShared extends Record<string, unknown> = Record<string, unknown>> = {
|
|
144
|
+
state?: ConversationState;
|
|
145
|
+
context?: TShared;
|
|
146
|
+
};
|
|
147
|
+
export type ActivationPredicate<TShared extends Record<string, unknown> = Record<string, unknown>> = (input: ActivationInput<TShared>) => boolean;
|
|
148
|
+
export type SituationConditionalRule<TShared extends Record<string, unknown> = Record<string, unknown>> = ActivationPredicate<TShared> | {
|
|
149
|
+
mode?: 'activateWhen' | 'deactivateWhen';
|
|
150
|
+
predicate: ActivationPredicate<TShared>;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Declarative fixed partition overlay for one named situation.
|
|
154
|
+
* Keys not listed keep the base ToolSet partition after the overlay.
|
|
155
|
+
*/
|
|
156
|
+
export type SituationConfig<TIds extends string = string, TShared extends Record<string, unknown> = Record<string, unknown>> = {
|
|
157
|
+
/** Statically on in this situation. */
|
|
158
|
+
enabled?: readonly TIds[];
|
|
159
|
+
/** Statically off in this situation. */
|
|
160
|
+
disabled?: readonly TIds[];
|
|
161
|
+
/**
|
|
162
|
+
* Conditional tools for this situation.
|
|
163
|
+
* Default mode is activateWhen (inactive until predicate is true).
|
|
164
|
+
* Use `{ mode: 'deactivateWhen', predicate }` for the reverse default.
|
|
165
|
+
*/
|
|
166
|
+
conditional?: {
|
|
167
|
+
readonly [K in TIds]?: SituationConditionalRule<TShared>;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
/** Situations registry accumulated on the ToolSet type. */
|
|
171
|
+
export type SituationMap = Record<string, {
|
|
172
|
+
enabled: string;
|
|
173
|
+
disabled: string;
|
|
174
|
+
conditional: string;
|
|
175
|
+
}>;
|
|
176
|
+
export type EmptySituations = Record<never, never>;
|
|
177
|
+
/**
|
|
178
|
+
* Deliberately imprecise situation registry for mutable `ToolSet` instances.
|
|
179
|
+
*
|
|
180
|
+
* Mirrors {@link WidenedPartition}: since `defineSituations` on a mutable
|
|
181
|
+
* instance mutates the shared runtime situation registry in place, its type
|
|
182
|
+
* cannot statically promise a specific set of situation names without
|
|
183
|
+
* risking the same cross-alias contradiction. `string` keeps every
|
|
184
|
+
* situation name assignable while still requiring a real string key.
|
|
185
|
+
*/
|
|
186
|
+
export type WidenedSituationMap = Record<string, Partition>;
|
|
187
|
+
export type SituationNames<S extends SituationMap> = keyof S & string;
|
|
188
|
+
/**
|
|
189
|
+
* Infer the static partition contribution of a situation config object.
|
|
190
|
+
* Missing fields contribute `never`.
|
|
191
|
+
*/
|
|
192
|
+
export type InferSituationEntry<C> = {
|
|
193
|
+
enabled: C extends {
|
|
194
|
+
enabled: readonly (infer E extends string)[];
|
|
195
|
+
} ? E : never;
|
|
196
|
+
disabled: C extends {
|
|
197
|
+
disabled: readonly (infer D extends string)[];
|
|
198
|
+
} ? D : never;
|
|
199
|
+
conditional: C extends {
|
|
200
|
+
conditional: infer Cond;
|
|
201
|
+
} ? keyof Cond & string : never;
|
|
202
|
+
};
|
|
203
|
+
export type InferSituationMap<M> = {
|
|
204
|
+
[K in keyof M]: InferSituationEntry<M[K]>;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Apply a situation overlay onto a base partition.
|
|
208
|
+
* Situation wins for every id it mentions; others stay from base.
|
|
209
|
+
*/
|
|
210
|
+
export type ApplySituationPartition<Base extends Partition, Sit extends {
|
|
211
|
+
enabled: string;
|
|
212
|
+
disabled: string;
|
|
213
|
+
conditional: string;
|
|
214
|
+
}> = {
|
|
215
|
+
enabled: Exclude<Base['enabled'], Sit['enabled'] | Sit['disabled'] | Sit['conditional']> | Sit['enabled'];
|
|
216
|
+
disabled: Exclude<Base['disabled'], Sit['enabled'] | Sit['disabled'] | Sit['conditional']> | Sit['disabled'];
|
|
217
|
+
conditional: Exclude<Base['conditional'], Sit['enabled'] | Sit['disabled'] | Sit['conditional']> | Sit['conditional'];
|
|
218
|
+
};
|
|
219
|
+
export type StatusReason = 'default' | 'activate' | 'deactivate' | 'activateWhen' | 'deactivateWhen' | 'situation';
|
|
220
|
+
export type ToolStatusEntry = {
|
|
221
|
+
readonly enabled: boolean;
|
|
222
|
+
readonly reason: StatusReason;
|
|
223
|
+
/**
|
|
224
|
+
* The last applicable directive for this tool before predicates ran, if any.
|
|
225
|
+
* Absent when the tool is still at its construction default.
|
|
226
|
+
*/
|
|
227
|
+
readonly directive?: 'activate' | 'deactivate' | 'activateWhen' | 'deactivateWhen';
|
|
228
|
+
/** True when the final state depended on evaluating a runtime predicate. */
|
|
229
|
+
readonly predicate?: boolean;
|
|
230
|
+
};
|
|
231
|
+
export type StatusByToolMap<TIds extends string> = {
|
|
232
|
+
readonly [K in TIds]: ToolStatusEntry;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* What resolve() / resolveSituation() returns.
|
|
236
|
+
*
|
|
237
|
+
* For static-only partitions (`conditional = never`), the snapshot is fully
|
|
238
|
+
* known at compile time. When conditional ≠ never, TActive selects possible
|
|
239
|
+
* members from `P['conditional']`; `P['enabled']` is always included. Tools
|
|
240
|
+
* become a readonly array of that possible member union because predicates
|
|
241
|
+
* can change length and positions at runtime. Runtime arrays/status are exact.
|
|
242
|
+
*
|
|
243
|
+
* `disabled` is declared as the complement of the *definitely-enabled* set
|
|
244
|
+
* (`P['enabled']`), not of `TActive`. A conditional id's predicate can
|
|
245
|
+
* resolve to either outcome at runtime — `#resolveWithActivation` pushes it
|
|
246
|
+
* into `disabled` whenever the predicate says off — so conditional ids must
|
|
247
|
+
* remain in both the `enabled` and `disabled` upper bounds for the declared
|
|
248
|
+
* types to stay sound. (Subtracting `TActive`, which already includes
|
|
249
|
+
* `P['conditional']`, would wrongly exclude conditional ids from `disabled`.)
|
|
250
|
+
*/
|
|
251
|
+
export type ResolvedToolSnapshot<TTools extends readonly Tool[], P extends Partition, TActive extends P['conditional'] = P['conditional']> = {
|
|
252
|
+
/** Active tools only, construction order preserved, concrete member types kept. */
|
|
253
|
+
readonly tools: ResolvedTools<TTools, P, TActive>;
|
|
254
|
+
/** Active client names only (`callModel.activeTools` wire format). Server ids omitted. */
|
|
255
|
+
readonly activeTools: readonly Extract<ResolvedActiveIds<P, TActive>, ClientToolNamesOfTuple<TTools>>[];
|
|
256
|
+
/** Spread-safe input for `callModel`; snapshot metadata is intentionally excluded. */
|
|
257
|
+
readonly callModel: {
|
|
258
|
+
readonly tools: ResolvedTools<TTools, P, TActive>;
|
|
259
|
+
readonly activeTools: readonly Extract<ResolvedActiveIds<P, TActive>, ClientToolNamesOfTuple<TTools>>[];
|
|
260
|
+
};
|
|
261
|
+
/** IDs that resolved active (client + server). */
|
|
262
|
+
readonly enabled: readonly (ResolvedActiveIds<P, TActive> & ToolIdsOfTuple<TTools>)[];
|
|
263
|
+
/**
|
|
264
|
+
* IDs that resolved inactive (client + server). Sound upper bound: the
|
|
265
|
+
* complement of the definitely-enabled set, so conditional ids whose
|
|
266
|
+
* predicate resolves `false` are included here too.
|
|
267
|
+
*/
|
|
268
|
+
readonly disabled: readonly Exclude<ToolIdsOfTuple<TTools>, P['enabled']>[];
|
|
269
|
+
/** Exhaustive id → status entry. Every ToolIdsOfTuple key present. */
|
|
270
|
+
readonly statusByTool: StatusByToolMap<ToolIdsOfTuple<TTools>>;
|
|
271
|
+
/** Internal marker allowing `callModel` to recognize a snapshot spread. */
|
|
272
|
+
readonly [TOOL_SET_SNAPSHOT]: true;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Structural shape for extracting partition/situation generics from either
|
|
276
|
+
* mutable or immutable `ToolSet` instances.
|
|
277
|
+
*/
|
|
278
|
+
export type ToolSetLike<TTools extends readonly Tool[] = readonly Tool[], TShared extends Record<string, unknown> = Record<string, unknown>, P extends Partition = Partition, Sit extends SituationMap = SituationMap> = {
|
|
279
|
+
readonly tools: TTools;
|
|
280
|
+
readonly _partition?: P;
|
|
281
|
+
readonly _situations?: Sit;
|
|
282
|
+
readonly _shared?: TShared;
|
|
283
|
+
};
|
|
284
|
+
/** Every known tool-set ID. */
|
|
285
|
+
export type InferAllIds<TS> = TS extends ToolSetLike<infer T, any, any, any> ? ToolIdsOfTuple<T> : never;
|
|
286
|
+
/** Definitely-enabled IDs (static). */
|
|
287
|
+
export type InferEnabledIds<TS> = TS extends ToolSetLike<any, any, infer P, any> ? P['enabled'] : never;
|
|
288
|
+
/** Definitely-disabled IDs (static). */
|
|
289
|
+
export type InferDisabledIds<TS> = TS extends ToolSetLike<any, any, infer P, any> ? P['disabled'] : never;
|
|
290
|
+
/** Conditionally-activated IDs (runtime predicate). */
|
|
291
|
+
export type InferConditionalIds<TS> = TS extends ToolSetLike<any, any, infer P, any> ? P['conditional'] : never;
|
|
292
|
+
/**
|
|
293
|
+
* Name-correlated streaming events for a tools tuple.
|
|
294
|
+
* Delegates to the agent's core {@link CorrelatedToolEventUnion}.
|
|
295
|
+
*/
|
|
296
|
+
export type InferToolSet<T extends readonly Tool[]> = CorrelatedToolEventUnion<T>;
|
|
297
|
+
export {};
|
|
298
|
+
//# sourceMappingURL=tool-set-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-set-types.d.ts","sourceRoot":"","sources":["../../src/lib/tool-set-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,cAAc,EACd,IAAI,EACL,MAAM,iBAAiB,CAAC;AAIzB,4CAA4C;AAC5C,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS;IACxC,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC,SAAS,MAAM,CAAC;KAC9B,CAAC;CACH,GACG,CAAC,GACD,KAAK,CAAC;AAEV;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,IAAI,SAAS,MAAM,CAAC,GAChD,CAAC,SAAS;IACR,QAAQ,CAAC,EAAE,CAAC,E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B,EAAE,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;AAEzE,uDAAuD;AACvD,MAAM,MAAM,mBAAmB,CAAC,EAAE,IAChC,EAAE,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;AAE5E;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,SAAS,IAAI,EAAE,IAAI,wBAAwB,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-set-types.js","sourceRoot":"","sources":["../../src/lib/tool-set-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { TOOL_SET_SNAPSHOT } from './async-params.js';
|
|
2
|
+
import type { ActivatePartition, ActivationInput, ActivationPredicate, ApplySituationPartition, ConditionalPartition, DeactivatePartition, EmptySituations, InferSituationMap, InitialPartition, Partition, ResolvedToolSnapshot, SituationConfig, SituationMap, SituationNames, StatusByToolMap, ToolIdsOfTuple, WidenedPartition, WidenedSituationMap } from './tool-set-types.js';
|
|
3
|
+
import type { Tool } from './tool-types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Selects the return type of a mutator call.
|
|
6
|
+
*
|
|
7
|
+
* A mutable `ToolSet` mutates one shared runtime object in place, and any
|
|
8
|
+
* number of aliases can reference that object. If a mutator refined `P`/`Sit`
|
|
9
|
+
* on a mutable instance the way the immutable path does, two aliases of the
|
|
10
|
+
* *same* live object could statically claim different, contradictory exact
|
|
11
|
+
* types the instant either one mutated — unsound, since both aliases still
|
|
12
|
+
* point at the one object whose actual state matches only the latest call.
|
|
13
|
+
*
|
|
14
|
+
* When `TMutable extends true`, mutators therefore return the receiver's own
|
|
15
|
+
* unchanged type (`ToolSet<TTools, TShared, P, Sit, true>`) instead of a
|
|
16
|
+
* refined `NextP`/`NextSit` — every alias of a mutable instance keeps the
|
|
17
|
+
* exact same (already maximally conservative) static type for its whole
|
|
18
|
+
* lifetime, so no alias can ever contradict another. Immutable instances
|
|
19
|
+
* (`TMutable extends false`) are unaffected: each mutation still returns a
|
|
20
|
+
* brand-new object with the precisely refined `NextP`/`NextSit`, exactly as
|
|
21
|
+
* before.
|
|
22
|
+
*/
|
|
23
|
+
type Mutated<TTools extends readonly Tool[], TShared extends Record<string, unknown>, P extends Partition, Sit extends SituationMap, TMutable extends boolean, NextP extends Partition, NextSit extends SituationMap = Sit> = TMutable extends true ? ToolSet<TTools, TShared, P, Sit, true> : ToolSet<TTools, TShared, NextP, NextSit, false>;
|
|
24
|
+
/**
|
|
25
|
+
* Immutable-by-default stateful set of tools with a three-way static
|
|
26
|
+
* partition (enabled / disabled / conditional) and optional named situations.
|
|
27
|
+
*
|
|
28
|
+
* @typeParam TTools - Concrete ordered tools tuple
|
|
29
|
+
* @typeParam TShared - Shared context shape for predicates
|
|
30
|
+
* @typeParam P - Compile-time partition of tool-set IDs
|
|
31
|
+
* @typeParam Sit - Named situation registry
|
|
32
|
+
* @typeParam TMutable - Whether this instance mutates in place. Mutable
|
|
33
|
+
* instances deliberately carry a single widened `P`/`Sit` for their entire
|
|
34
|
+
* lifetime (see {@link Mutated}) so that every alias stays sound; immutable
|
|
35
|
+
* instances keep the exact, precisely-refined `P`/`Sit` per instance.
|
|
36
|
+
*/
|
|
37
|
+
export declare class ToolSet<TTools extends readonly Tool[] = readonly Tool[], TShared extends Record<string, unknown> = Record<string, unknown>, P extends Partition = InitialPartition<TTools>, Sit extends SituationMap = EmptySituations, TMutable extends boolean = false> {
|
|
38
|
+
#private;
|
|
39
|
+
/**
|
|
40
|
+
* Phantom carriers so inference utilities can recover partition/situation
|
|
41
|
+
* generics from a concrete instance type.
|
|
42
|
+
*/
|
|
43
|
+
readonly _partition?: P;
|
|
44
|
+
readonly _situations?: Sit;
|
|
45
|
+
readonly _shared?: TShared;
|
|
46
|
+
private constructor();
|
|
47
|
+
/** Internal factory. Prefer `createToolSet` for the public API. */
|
|
48
|
+
static create<T extends readonly Tool[], S extends Record<string, unknown> = Record<string, unknown>>(opts: {
|
|
49
|
+
tools: T;
|
|
50
|
+
mutable: true;
|
|
51
|
+
}): ToolSet<T, S, WidenedPartition<T>, WidenedSituationMap, true>;
|
|
52
|
+
static create<T extends readonly Tool[], S extends Record<string, unknown> = Record<string, unknown>>(opts: {
|
|
53
|
+
tools: T;
|
|
54
|
+
mutable?: false;
|
|
55
|
+
}): ToolSet<T, S, InitialPartition<T>, EmptySituations, false>;
|
|
56
|
+
/** All tools in construction order, regardless of activation state. */
|
|
57
|
+
get tools(): TTools;
|
|
58
|
+
activate<const N extends ToolIdsOfTuple<TTools>>(names: N | readonly N[]): Mutated<TTools, TShared, P, Sit, TMutable, ActivatePartition<P, N>>;
|
|
59
|
+
deactivate<const N extends ToolIdsOfTuple<TTools>>(names: N | readonly N[]): Mutated<TTools, TShared, P, Sit, TMutable, DeactivatePartition<P, N>>;
|
|
60
|
+
activateWhen<const N extends ToolIdsOfTuple<TTools>>(name: N, predicate: ActivationPredicate<TShared>): Mutated<TTools, TShared, P, Sit, TMutable, ConditionalPartition<P, N>>;
|
|
61
|
+
activateWhen<const N extends ToolIdsOfTuple<TTools>>(map: {
|
|
62
|
+
readonly [K in N]?: ActivationPredicate<TShared>;
|
|
63
|
+
}): Mutated<TTools, TShared, P, Sit, TMutable, ConditionalPartition<P, N>>;
|
|
64
|
+
deactivateWhen<const N extends ToolIdsOfTuple<TTools>>(name: N, predicate: ActivationPredicate<TShared>): Mutated<TTools, TShared, P, Sit, TMutable, ConditionalPartition<P, N>>;
|
|
65
|
+
deactivateWhen<const N extends ToolIdsOfTuple<TTools>>(map: {
|
|
66
|
+
readonly [K in N]?: ActivationPredicate<TShared>;
|
|
67
|
+
}): Mutated<TTools, TShared, P, Sit, TMutable, ConditionalPartition<P, N>>;
|
|
68
|
+
/**
|
|
69
|
+
* Register named declarative situations. Each situation overlays the base
|
|
70
|
+
* partition — ids it does not mention keep whatever the base set declares.
|
|
71
|
+
*
|
|
72
|
+
* Replaces any previously defined situations (last-call-wins at the registry level).
|
|
73
|
+
*/
|
|
74
|
+
defineSituations<const M extends {
|
|
75
|
+
readonly [K in string]: SituationConfig<ToolIdsOfTuple<TTools>, TShared>;
|
|
76
|
+
}>(situations: M): Mutated<TTools, TShared, P, Sit, TMutable, P, InferSituationMap<M>>;
|
|
77
|
+
/**
|
|
78
|
+
* Resolve against the base partition (no situation overlay).
|
|
79
|
+
* When the partition is purely static, the active tool tuple is exact at
|
|
80
|
+
* compile time. Conditional ids expand the compile-time upper bound.
|
|
81
|
+
*/
|
|
82
|
+
resolve(input?: ActivationInput<TShared>): ResolvedToolSnapshot<TTools, P, P['conditional']>;
|
|
83
|
+
/**
|
|
84
|
+
* Back-compat alias for {@link resolve}. Prefer `resolve` for new code.
|
|
85
|
+
*
|
|
86
|
+
* Returns the full snapshot, including metadata (`enabled`, `disabled`,
|
|
87
|
+
* `statusByTool`) that is not a valid `callModel` input. Only `tools` and
|
|
88
|
+
* `activeTools` are meant to reach `callModel` — spread those two fields
|
|
89
|
+
* (or use `resolve(...).callModel`, which contains exactly them),
|
|
90
|
+
* not the whole return value of this method:
|
|
91
|
+
*
|
|
92
|
+
* ```ts
|
|
93
|
+
* const { tools, activeTools } = toolSet.inferTools();
|
|
94
|
+
* callModel(client, { model, input, tools, activeTools });
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* This result carries an internal marker so `callModel` can strip its
|
|
98
|
+
* metadata when the whole object is spread. Identically named request fields
|
|
99
|
+
* on ordinary, unmarked inputs are preserved.
|
|
100
|
+
*/
|
|
101
|
+
inferTools(input?: ActivationInput<TShared>): {
|
|
102
|
+
tools: Tool[];
|
|
103
|
+
activeTools: string[];
|
|
104
|
+
enabled: readonly string[];
|
|
105
|
+
disabled: readonly string[];
|
|
106
|
+
statusByTool: StatusByToolMap<string>;
|
|
107
|
+
[TOOL_SET_SNAPSHOT]: true;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Resolve a previously-defined named situation. Static situations return
|
|
111
|
+
* exact filtered tool / name tuples at compile time; situations with
|
|
112
|
+
* conditional rules return the sound upper bound, while runtime arrays and
|
|
113
|
+
* `statusByTool` remain exact.
|
|
114
|
+
*/
|
|
115
|
+
resolveSituation<Name extends SituationNames<Sit>>(name: Name, input?: ActivationInput<TShared>): ResolvedToolSnapshot<TTools, ApplySituationPartition<P, Sit[Name]>, ApplySituationPartition<P, Sit[Name]>['conditional']>;
|
|
116
|
+
/**
|
|
117
|
+
* Copy state into a fresh, independent instance.
|
|
118
|
+
*
|
|
119
|
+
* Flipping to `mutable: true` starts a *new* mutation lifetime, so — like
|
|
120
|
+
* `ToolSet.create({ mutable: true })` — the clone's partition/situations
|
|
121
|
+
* widen to {@link WidenedPartition}/{@link WidenedSituationMap} rather than
|
|
122
|
+
* inheriting the source's exact `P`/`Sit`: an exact type could otherwise be
|
|
123
|
+
* invalidated the moment the clone is mutated, while other clones or the
|
|
124
|
+
* original remain unaffected. Cloning without flipping mode (mode
|
|
125
|
+
* inherited, including an already-mutable source) or flipping to `false`
|
|
126
|
+
* keeps the source's `P`/`Sit` unchanged.
|
|
127
|
+
*/
|
|
128
|
+
clone(opts?: {
|
|
129
|
+
mutable?: undefined;
|
|
130
|
+
}): ToolSet<TTools, TShared, P, Sit, TMutable>;
|
|
131
|
+
clone(opts: {
|
|
132
|
+
mutable: true;
|
|
133
|
+
}): ToolSet<TTools, TShared, WidenedPartition<TTools>, WidenedSituationMap, true>;
|
|
134
|
+
clone(opts: {
|
|
135
|
+
mutable: false;
|
|
136
|
+
}): ToolSet<TTools, TShared, P, Sit, false>;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Construct a {@link ToolSet}.
|
|
140
|
+
*
|
|
141
|
+
* `mutable: true` deliberately returns a widened partition/situations type
|
|
142
|
+
* (`WidenedPartition`/`WidenedSituationMap`) rather than the exact
|
|
143
|
+
* `InitialPartition`/`EmptySituations` used by the default immutable mode —
|
|
144
|
+
* see {@link Mutated} for why mutable instances need this from construction
|
|
145
|
+
* onward. Omitting `mutable` (or passing `false`) keeps today's exact,
|
|
146
|
+
* precisely-refined immutable partition tracking unchanged.
|
|
147
|
+
*/
|
|
148
|
+
export declare function createToolSet<const T extends readonly Tool[], TShared extends Record<string, unknown> = Record<string, unknown>>(opts: {
|
|
149
|
+
tools: T;
|
|
150
|
+
mutable: true;
|
|
151
|
+
}): ToolSet<T, TShared, WidenedPartition<T>, WidenedSituationMap, true>;
|
|
152
|
+
export declare function createToolSet<const T extends readonly Tool[], TShared extends Record<string, unknown> = Record<string, unknown>>(opts: {
|
|
153
|
+
tools: T;
|
|
154
|
+
mutable?: false;
|
|
155
|
+
}): ToolSet<T, TShared, InitialPartition<T>, EmptySituations, false>;
|
|
156
|
+
export type { ActivatePartition, ActivationInput, ActivationPredicate, ApplySituationPartition, ClientToolName, ClientToolNamesOfTuple, ConditionalPartition, DeactivatePartition, EmptyPartition, EmptySituations, FilterToolsByIds, InferAllIds, InferConditionalIds, InferDisabledIds, InferEnabledIds, InferSituationEntry, InferSituationMap, InferToolSet, InitialPartition, Partition, ResolvedToolSnapshot, ResolvedTools, ServerToolIdOf, ServerToolIdsOfTuple, SituationConditionalRule, SituationConfig, SituationMap, SituationNames, StatusByToolMap, StatusReason, ToolById, ToolIdOf, ToolIdsOfTuple, ToolSetLike, ToolStatusEntry, WidenedPartition, WidenedSituationMap, } from './tool-set-types.js';
|
|
157
|
+
//# sourceMappingURL=tool-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-set.d.ts","sourceRoot":"","sources":["../../src/lib/tool-set.ts"],"names":[],"mappings":"AAAA,OAA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