@namzu/sdk 23.0.0 → 26.0.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 +208 -0
- package/README.md +1 -1
- package/dist/agents/ReactiveAgent.d.ts.map +1 -1
- package/dist/agents/ReactiveAgent.js +3 -0
- package/dist/agents/ReactiveAgent.js.map +1 -1
- package/dist/connector/mcp/stdio.d.ts +11 -0
- package/dist/connector/mcp/stdio.d.ts.map +1 -1
- package/dist/connector/mcp/stdio.js +106 -1
- package/dist/connector/mcp/stdio.js.map +1 -1
- package/dist/constants/telemetry/index.d.ts +15 -1
- package/dist/constants/telemetry/index.d.ts.map +1 -1
- package/dist/constants/telemetry/index.js +15 -1
- package/dist/constants/telemetry/index.js.map +1 -1
- package/dist/provider/fallback.d.ts.map +1 -1
- package/dist/provider/fallback.js +8 -2
- package/dist/provider/fallback.js.map +1 -1
- package/dist/provider/retry.d.ts +10 -5
- package/dist/provider/retry.d.ts.map +1 -1
- package/dist/provider/retry.js +11 -31
- package/dist/provider/retry.js.map +1 -1
- package/dist/public-runtime.d.ts +1 -0
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js.map +1 -1
- package/dist/registry/tool/execute.d.ts.map +1 -1
- package/dist/registry/tool/execute.js +12 -0
- package/dist/registry/tool/execute.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +34 -0
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +61 -0
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts +31 -13
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +28 -6
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +178 -20
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.d.ts +14 -1
- package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.js +19 -3
- package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
- package/dist/runtime/query/resume-pending.d.ts.map +1 -1
- package/dist/runtime/query/resume-pending.js +10 -1
- package/dist/runtime/query/resume-pending.js.map +1 -1
- package/dist/runtime/query/tool-pause.d.ts +35 -0
- package/dist/runtime/query/tool-pause.d.ts.map +1 -1
- package/dist/runtime/query/tool-pause.js +35 -0
- package/dist/runtime/query/tool-pause.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +2 -0
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +3 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/types/agent/reactive.d.ts +1 -0
- package/dist/types/agent/reactive.d.ts.map +1 -1
- package/dist/types/connector/mcp.d.ts +17 -0
- package/dist/types/connector/mcp.d.ts.map +1 -1
- package/dist/types/provider/interface.d.ts +23 -2
- package/dist/types/provider/interface.d.ts.map +1 -1
- package/dist/types/run/step.d.ts +75 -3
- package/dist/types/run/step.d.ts.map +1 -1
- package/dist/types/run/step.js.map +1 -1
- package/dist/utils/backoff.d.ts +44 -0
- package/dist/utils/backoff.d.ts.map +1 -0
- package/dist/utils/backoff.js +58 -0
- package/dist/utils/backoff.js.map +1 -0
- package/package.json +1 -1
- package/src/agents/ReactiveAgent.ts +3 -0
- package/src/connector/mcp/stdio.ts +106 -1
- package/src/constants/telemetry/index.ts +16 -1
- package/src/provider/fallback.ts +8 -2
- package/src/provider/retry.ts +20 -37
- package/src/public-runtime.ts +5 -0
- package/src/registry/tool/execute.ts +12 -0
- package/src/runtime/query/executor.ts +74 -0
- package/src/runtime/query/index.ts +59 -18
- package/src/runtime/query/iteration/index.ts +199 -22
- package/src/runtime/query/iteration/stream-turn.ts +24 -3
- package/src/runtime/query/resume-pending.ts +10 -1
- package/src/runtime/query/tool-pause.ts +37 -0
- package/src/runtime/query/tooling.ts +5 -0
- package/src/types/agent/reactive.ts +1 -0
- package/src/types/connector/mcp.ts +17 -0
- package/src/types/provider/interface.ts +23 -2
- package/src/types/run/step.ts +76 -3
- package/src/utils/backoff.ts +70 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,213 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 26.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- b902ecb: A stdio server is handed what it was granted, not everything the host holds
|
|
8
|
+
|
|
9
|
+
`StdioTransport` spawned its child with `{ ...process.env, ...config.env }`, so every connected server received every environment variable the host process had. Measured through the real transport: **119 variables on a developer machine, including a secret planted in the parent for the probe.** A server that needs one token was handed all of them, and nothing in its configuration said so — the grant was invisible because it was total.
|
|
10
|
+
|
|
11
|
+
The child now receives process plumbing (`PATH`, `HOME`/`USERPROFILE`, `SystemRoot`, `ComSpec`, `TEMP`, locale, and the rest of that kind), plus whatever the configuration names.
|
|
12
|
+
|
|
13
|
+
**What breaks.** A server that was reading a credential straight out of your environment stops finding it. That is the whole point of the change, and it will look like the server failing to authenticate rather than like a configuration change, so it is worth knowing before the upgrade rather than after.
|
|
14
|
+
|
|
15
|
+
**What to do.** Name what the server may have:
|
|
16
|
+
|
|
17
|
+
```toml
|
|
18
|
+
[mcpServers.issues]
|
|
19
|
+
command = "some-mcp-server"
|
|
20
|
+
inheritEnv = ["GITHUB_TOKEN"]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`inheritEnv` names variables to pass through from your own environment. Prefer it over `env` for anything secret — `env` writes the literal value into the config file, and this leaves the value where it already lives. A named variable the parent does not hold is absent from the child rather than empty, so a server's own `if (!token)` still works; it does not fail the spawn.
|
|
24
|
+
|
|
25
|
+
**Plugin-declared servers get no `inheritEnv`, deliberately.** A plugin that could name the host variables its server receives would be awarding itself a credential grant, which is not a plugin's to award. A plugin-declared server gets plumbing plus the literal `env` in its own manifest; if it needs a host credential, declare that server in `mcpServers` instead, where the operator is the one naming it.
|
|
26
|
+
|
|
27
|
+
The tests assert on the environment the child actually receives, driving a real spawn — not on whether the configuration was accepted. A test of the second kind passes against the version this replaces.
|
|
28
|
+
|
|
29
|
+
- e2506f4: The tool-call id attribute is spelled the way the convention spells it, and something now sets it
|
|
30
|
+
|
|
31
|
+
`GENAI.TOOL_CALL_ID` was `'gen_ai.tool.call_id'` — one underscore where the
|
|
32
|
+
GenAI attribute registry has a dot, and where the two constants beside it in the
|
|
33
|
+
same object (`gen_ai.tool.name`, `gen_ai.tool.type`) already had one. Its value
|
|
34
|
+
is now `'gen_ai.tool.call.id'`.
|
|
35
|
+
|
|
36
|
+
**What breaks.** The exported constant is `as const`, so both its value and its
|
|
37
|
+
literal type change. If you import it and stamp it on your own spans, those
|
|
38
|
+
spans start carrying a different key, and a saved query, dashboard panel or
|
|
39
|
+
alert that groups by `gen_ai.tool.call_id` will match nothing after the upgrade
|
|
40
|
+
— it will read as "no tool calls", not as an error. Anything that pinned the
|
|
41
|
+
old literal as a type (`typeof GENAI.TOOL_CALL_ID`, or a union built from it)
|
|
42
|
+
fails to compile.
|
|
43
|
+
|
|
44
|
+
**What to do.** Repoint anything keyed on `gen_ai.tool.call_id` at
|
|
45
|
+
`gen_ai.tool.call.id`. If you referenced the constant rather than the string,
|
|
46
|
+
there is nothing to change beyond taking the upgrade. Traces already in your
|
|
47
|
+
backend keep the old key; a query that has to span the upgrade needs both for
|
|
48
|
+
as long as the old retention window lasts.
|
|
49
|
+
|
|
50
|
+
There is no deprecation window, and the reason is that no working code needs
|
|
51
|
+
one: nothing in this SDK ever emitted the attribute, under either spelling. The
|
|
52
|
+
constant was exported with no writer at all — `registry/tool/execute.ts` stamped
|
|
53
|
+
the tool name and the tool type onto the span and stopped — so no namzu-produced
|
|
54
|
+
trace has ever carried the old key, and there is nothing to migrate off it.
|
|
55
|
+
|
|
56
|
+
**What is added.** The tool span now stamps the id of the call it is about,
|
|
57
|
+
taken from `ToolContext.toolUseId`, which the run loop already sets per call.
|
|
58
|
+
Before this, a trace showing four tool spans with the same name in one turn
|
|
59
|
+
could not say which span answered which `tool_use` block. The attribute is
|
|
60
|
+
omitted rather than set to `undefined` when there is no call to correlate to —
|
|
61
|
+
a host invoking a tool directly, outside a run.
|
|
62
|
+
|
|
63
|
+
Tool **arguments** and **results** are deliberately still not recorded. They are
|
|
64
|
+
the thing an incident review wants first and they are also where a secret
|
|
65
|
+
travels, so they want a redaction design and a test for it rather than a ride
|
|
66
|
+
along with a spelling fix.
|
|
67
|
+
|
|
68
|
+
### Minor Changes
|
|
69
|
+
|
|
70
|
+
- 1f8aef7: a provider health probe can be told which model to check
|
|
71
|
+
|
|
72
|
+
`LLMProvider.healthCheck` and `LLMProvider.doctorCheck` now take an optional
|
|
73
|
+
`model`. Both were declared no-argument, and that made a model-aware probe
|
|
74
|
+
unreachable: `ProviderRegistry.create()` hands back an `LLMProvider`, not the
|
|
75
|
+
concrete driver, so a driver whose config carries no model had nowhere to get
|
|
76
|
+
one and hardcoded an id instead — which is how one of them came to probe a model
|
|
77
|
+
nobody ran and could not pass at all.
|
|
78
|
+
|
|
79
|
+
**What you do: nothing.** The parameter is optional on an already-optional
|
|
80
|
+
method, so an existing implementation that takes no argument still satisfies the
|
|
81
|
+
interface and an existing call site still compiles. A driver is free to ignore
|
|
82
|
+
the argument — one that probes an endpoint rather than a model has no use for
|
|
83
|
+
it — and passing it is always safe.
|
|
84
|
+
|
|
85
|
+
`doctorCheck` may now return a SUBTYPE of `DoctorCheckResult`, so a driver can
|
|
86
|
+
carry its own machine-readable detail while `runDoctor()` keeps reading
|
|
87
|
+
`status`.
|
|
88
|
+
|
|
89
|
+
`withProviderRetry` and `withProviderFallback` forward the model to the wrapped
|
|
90
|
+
driver. They rebuilt the provider as an object literal and spelled the forwarded
|
|
91
|
+
methods `() => provider.healthCheck?.()`, which would have dropped the argument
|
|
92
|
+
silently: the call still happens, the driver still answers, and the answer is
|
|
93
|
+
"there was nothing to check" — an unusable probe produced by wrapping alone.
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- 2458b78: The README no longer promises reranking the retriever does not implement
|
|
98
|
+
|
|
99
|
+
`README.md` described `rag/retriever.ts` as "the retrieval query path with
|
|
100
|
+
configurable top-k, threshold, and reranking". There is no rerank stage and
|
|
101
|
+
never was: no field on `RetrievalConfig`, no member in
|
|
102
|
+
`DEFAULT_RETRIEVAL_CONFIG`, no method on the `Retriever` interface, and no
|
|
103
|
+
stage in `DefaultRetriever.retrieve`, which runs vector, keyword (BM25) or
|
|
104
|
+
hybrid search and slices to `topK`. `rerank` appeared exactly once in the
|
|
105
|
+
repository, in that sentence.
|
|
106
|
+
|
|
107
|
+
Nothing errors when a reader configures for it, because there is no setting to
|
|
108
|
+
set — you simply receive first-stage results and believe they were reranked.
|
|
109
|
+
The line now describes what the file does and says outright that there is no
|
|
110
|
+
rerank stage. This is a documentation fix; no behaviour changes.
|
|
111
|
+
|
|
112
|
+
The capability is a reasonable thing to want and is deliberately not built
|
|
113
|
+
here. Published results include cases where a reranker scores _below_ the
|
|
114
|
+
first stage, so it wants a retrieval eval beside it rather than an assumption
|
|
115
|
+
that adding one is an improvement.
|
|
116
|
+
|
|
117
|
+
## 25.0.0
|
|
118
|
+
|
|
119
|
+
### Major Changes
|
|
120
|
+
|
|
121
|
+
- 917e4a5: A failed iteration now leaves a step, so the run ledger has no hole where the failure was
|
|
122
|
+
|
|
123
|
+
`recordStep` had two call sites and both were on success paths. An iteration
|
|
124
|
+
that threw recorded a span exception and re-threw with nothing written down, so
|
|
125
|
+
a ledger was complete except on the turns that failed — which reads as "nothing
|
|
126
|
+
went wrong" precisely where something did, and a reader could not tell
|
|
127
|
+
iteration N failing from iteration N never happening.
|
|
128
|
+
|
|
129
|
+
The failing turn now gets a `StepResult` like every other turn, from the same
|
|
130
|
+
writer, so failures and successes sort together. It carries what the iteration
|
|
131
|
+
got as far as knowing: the model asked for, the tokens actually spent, the tool
|
|
132
|
+
calls the model made, and what went wrong.
|
|
133
|
+
|
|
134
|
+
**Three breaking changes to `StepResult`, all on the read side.**
|
|
135
|
+
|
|
136
|
+
- `finishReason` gains `'error'` and `'cancelled'`. If you `switch` on it
|
|
137
|
+
exhaustively, add the two cases. `'error'` means the iteration threw and
|
|
138
|
+
`failure` says why; `'cancelled'` means a Stop tore the turn down.
|
|
139
|
+
- `messageId` is now optional. It is absent only on a step whose iteration
|
|
140
|
+
failed before the model's message was announced — a lifecycle hook that
|
|
141
|
+
threw, a transport error before the first chunk. If you read it
|
|
142
|
+
unconditionally, guard it. It is still present on every turn that reached the
|
|
143
|
+
provider, including a stream that died part-way.
|
|
144
|
+
- `toolResults` may now be shorter than `toolCalls` on a step that failed: only
|
|
145
|
+
outcomes that came back are recorded, because `{output: '', isError: false}`
|
|
146
|
+
for a tool that never ran reads as an empty success. Pair by `toolCallId`
|
|
147
|
+
rather than by index if you handle failed steps.
|
|
148
|
+
|
|
149
|
+
New: `failure?: StepFailure` — `{ message, code, status?, retryable }`,
|
|
150
|
+
classified the same way `run.lastProviderError` is. `code` is `'unknown'` for a
|
|
151
|
+
failure that was not a provider failure at all, which is the honest reading
|
|
152
|
+
rather than a more specific-looking guess.
|
|
153
|
+
|
|
154
|
+
Also: an iteration records at most one step. A failure landing after the step
|
|
155
|
+
was already recorded — in the advisory phase, or a trailing lifecycle hook —
|
|
156
|
+
leaves that step's own verdict alone rather than adding a second entry that
|
|
157
|
+
would double-count the turn against `run.tokenUsage`.
|
|
158
|
+
|
|
159
|
+
- e6818ee: Tool retry now backs off with full jitter instead of re-running immediately
|
|
160
|
+
|
|
161
|
+
The in-loop tool retry had no delay at all: a failed call went straight back
|
|
162
|
+
into execution, as many times as its budget allowed. The failures worth
|
|
163
|
+
retrying are exactly the ones an immediate retry makes worse — a rate limit
|
|
164
|
+
answers the second call faster than it recovers, a contended lock is still
|
|
165
|
+
held — so the loop was most likely to prolong the condition it was retrying
|
|
166
|
+
against.
|
|
167
|
+
|
|
168
|
+
Attempts are now spaced on the same curve the provider path has always used,
|
|
169
|
+
from the same implementation: exponential from `initialDelayMs`, doubling per
|
|
170
|
+
attempt, capped at `maxDelayMs`, each wait drawn uniformly from `[0, curve]`.
|
|
171
|
+
The jitter matters here specifically because a batch of the model's parallel
|
|
172
|
+
calls executes together, so calls that fail together against one endpoint
|
|
173
|
+
would be resynchronised by any fixed wait.
|
|
174
|
+
|
|
175
|
+
**This is a changed default, which is why it is major.** A retryable tool call
|
|
176
|
+
that previously re-ran instantly now waits — 500ms doubling to a 16s ceiling
|
|
177
|
+
before jitter — so any host whose tools declare `maxRetries` sees new latency
|
|
178
|
+
on the retry path. Nothing else waits: a tool that never opted into retrying,
|
|
179
|
+
which is the shipped default of `maxRetries: 0`, never reaches this code.
|
|
180
|
+
|
|
181
|
+
To keep the old timing exactly, set the wait to zero:
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
query({ toolRetryBackoff: { initialDelayMs: 0, maxDelayMs: 0 } });
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
`toolRetryBackoff` is new on `query()` and on `ReactiveAgentConfig`, and takes
|
|
188
|
+
a partial `{ initialDelayMs?, maxDelayMs? }`.
|
|
189
|
+
|
|
190
|
+
A Stop arriving during a wait now ends the retrying and hands the model the
|
|
191
|
+
failure already in hand, rather than leaving that `tool_use` unanswered.
|
|
192
|
+
|
|
193
|
+
## 24.0.0
|
|
194
|
+
|
|
195
|
+
### Major Changes
|
|
196
|
+
|
|
197
|
+
- 50dee5c: A pause raised from a tool through `ToolContext.requestPause` can now be answered after the process that raised it is gone. It could not before, on any surface, and the failure was silent.
|
|
198
|
+
|
|
199
|
+
Three things stood between the pause and its answer, and all three are fixed.
|
|
200
|
+
|
|
201
|
+
**The resume gate could not open.** A pause is identified by `<toolUseId>:<name>` — the name is there so one call can ask "which environment" and then "are you sure" without the second answer landing on the first question. The gate that decides whether a parked answer belongs to this turn compared that whole id against a raw tool-use id, which it can never equal. So every cross-process resume of such a pause was refused, and the run fell through to the repair that strips the parked turn and asks the model to decide again — turning a human's answer into "ask again and hope". The gate now matches the call portion while the full id continues to route the answer.
|
|
202
|
+
|
|
203
|
+
**The pause wrote nothing durable unless you used `SupervisorAgent`.** The recorder and the answer channel arrived only from the `questionParks` and `pendingAnswers` run parameters, and neither type is exported, so no host could supply them. On `ReactiveAgent`, `drainQuery` or `resumeRun` the pause was an in-process `await` that reported itself as durable. A run now supplies its own when the host supplies none.
|
|
204
|
+
|
|
205
|
+
**What changes for you.** If you call `requestPause` on any surface other than `SupervisorAgent` and you have a `checkpointStore` configured, that pause now writes a real checkpoint and emits `user_question_asked` / `user_question_answered`, where it previously wrote and emitted nothing. An approval queue built on `findPendingCheckpoint` or `listDurableRuns` will start listing these runs as parked — which is the point, and is also new rows in a view you may already be rendering.
|
|
206
|
+
|
|
207
|
+
There is no flag to keep the old behaviour, because the old behaviour was the defect: a pause that reports itself durable and is not. If you do not want a durable park, do not call `requestPause`.
|
|
208
|
+
|
|
209
|
+
**If you built your own durability around this,** threading a recorder into a private tool builder to work around the missing seam, remove it. The run records the park itself now, and a host recorder plus the run's own records it twice — two checkpoints for one question, and an approval queue that serves the second after the first is answered.
|
|
210
|
+
|
|
3
211
|
## 23.0.0
|
|
4
212
|
|
|
5
213
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -239,7 +239,7 @@ RAG is a full kernel subsystem, not a bolt-on. The pipeline:
|
|
|
239
239
|
- `rag/ingestion.ts` — end-to-end ingest: document → chunks → embeddings → vector store.
|
|
240
240
|
- `rag/vector-store.ts` — the `VectorStore` interface, tenant-scoped via `TenantId`. Bring your own backend (pgvector, Pinecone, an in-memory impl for tests).
|
|
241
241
|
- `rag/knowledge-base.ts` — a named collection of documents with metadata and config.
|
|
242
|
-
- `rag/retriever.ts` — the retrieval query path with configurable top-k
|
|
242
|
+
- `rag/retriever.ts` — the retrieval query path: vector, keyword (BM25) or hybrid, with configurable top-k and score threshold. Hybrid normalises both rankings before blending them by `hybridAlpha`. **There is no rerank stage.** This line used to promise one; there was no rerank stage behind it and no setting to turn it on, so a reader could configure for it and receive nothing.
|
|
243
243
|
- `rag/context-assembler.ts` — turns retrieval hits into prompt-ready context windows.
|
|
244
244
|
- `rag/rag-tool.ts` — a first-class tool your agent can invoke, not an external integration.
|
|
245
245
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactiveAgent.d.ts","sourceRoot":"","sources":["../../src/agents/ReactiveAgent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,qBAAa,aAAc,SAAQ,aAAa,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IACzF,QAAQ,CAAC,IAAI,EAAG,UAAU,CAAS;gBAEvB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,cAAc,CAAC;IAalE;;;;;;;;OAQG;IACG,GAAG,CACR,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,mBAAmB,CAAC;YAMjB,YAAY;
|
|
1
|
+
{"version":3,"file":"ReactiveAgent.d.ts","sourceRoot":"","sources":["../../src/agents/ReactiveAgent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,qBAAa,aAAc,SAAQ,aAAa,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IACzF,QAAQ,CAAC,IAAI,EAAG,UAAU,CAAS;gBAEvB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,cAAc,CAAC;IAalE;;;;;;;;OAQG;IACG,GAAG,CACR,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,mBAAmB,CAAC;YAMjB,YAAY;IA0HX,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAGtC"}
|
|
@@ -55,6 +55,9 @@ export class ReactiveAgent extends AbstractAgent {
|
|
|
55
55
|
...(config.retry !== undefined ? { retry: config.retry } : {}),
|
|
56
56
|
...(config.emergencySave !== undefined ? { emergencySave: config.emergencySave } : {}),
|
|
57
57
|
...(config.toolTimeoutMs !== undefined ? { toolTimeoutMs: config.toolTimeoutMs } : {}),
|
|
58
|
+
...(config.toolRetryBackoff !== undefined
|
|
59
|
+
? { toolRetryBackoff: config.toolRetryBackoff }
|
|
60
|
+
: {}),
|
|
58
61
|
...(config.maxToolConcurrency !== undefined
|
|
59
62
|
? { maxToolConcurrency: config.maxToolConcurrency }
|
|
60
63
|
: {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactiveAgent.js","sourceRoot":"","sources":["../../src/agents/ReactiveAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAStD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,MAAM,OAAO,aAAc,SAAQ,aAAuD;IAChF,IAAI,GAAG,UAAmB,CAAA;IAEnC,YAAY,QAAsD;QACjE,KAAK,CAAC;YACL,GAAG,QAAQ;YACX,IAAI,EAAE,UAAU;YAChB,YAAY,EAAE;gBACb,aAAa,EAAE,IAAI;gBACnB,iBAAiB,EAAE,IAAI;gBACvB,mBAAmB,EAAE,KAAK;gBAC1B,iBAAiB,EAAE,KAAK;aACxB;SACD,CAAC,CAAA;IACH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gB,EAAE,GAAG,CAAC,gBAAgB;YACtC,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,aAAa;SACb,CAAA;IACF,CAAC;IAEQ,KAAK,CAAC,MAAM;QACpB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAA;IAC7B,CAAC;CACD"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import type { MCPJsonRpcMessage, MCPStdioTransportConfig, MCPTransport } from '../../types/connector/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* What the child is handed: plumbing, then the named inheritances, then the
|
|
4
|
+
* literal values.
|
|
5
|
+
*
|
|
6
|
+
* Later wins, and the order is the precedence an operator would guess: a
|
|
7
|
+
* literal `env` entry overrides an inherited one, and both override the base.
|
|
8
|
+
* Exported for the tests, which assert on the ENV rather than on the spawn —
|
|
9
|
+
* a test that only checked the config was accepted would have passed against
|
|
10
|
+
* the version this replaces.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildChildEnv(config: Pick<MCPStdioTransportConfig, 'env' | 'inheritEnv'>, source?: NodeJS.ProcessEnv): Record<string, string>;
|
|
2
13
|
export declare class StdioTransport implements MCPTransport {
|
|
3
14
|
private readonly config;
|
|
4
15
|
private process;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/connector/mcp/stdio.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/connector/mcp/stdio.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,MAAM,gCAAgC,CAAA;AAqFvC;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC5B,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,KAAK,GAAG,YAAY,CAAC,EAC3D,MAAM,GAAE,MAAM,CAAC,UAAwB,GACrC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexB;AAED,qBAAa,cAAe,YAAW,YAAY;IAWtC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAVnC,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,eAAe,CAAkD;IACzE,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,SAAS,CAAQ;IACzB,6DAA6D;IAC7D,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,GAAG,CAAQ;gBAEU,MAAM,EAAE,uBAAuB;IAItD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAuCxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkD5B;;;;;;;;OAQG;IACH,OAAO,CAAC,aAAa;IAMf,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrD,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI;IAI9D,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI;IAIlC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI;IAI9C,WAAW,IAAI,OAAO;IAItB,OAAO,CAAC,aAAa;CAerB"}
|
|
@@ -6,6 +6,111 @@ import { getRootLogger } from '../../utils/logger.js';
|
|
|
6
6
|
* shutdown does not read as a hang.
|
|
7
7
|
*/
|
|
8
8
|
const TERMINATE_GRACE_MS = 2_000;
|
|
9
|
+
/**
|
|
10
|
+
* The variables a child needs in order to be a working process at all.
|
|
11
|
+
*
|
|
12
|
+
* This spawn used to pass `{ ...process.env, ...config.env }`, so a connected
|
|
13
|
+
* server received every credential the host happened to hold — measured at 119
|
|
14
|
+
* variables on a developer machine, including a planted secret the server had
|
|
15
|
+
* no reason to see. A server that needs one token was handed all of them, and
|
|
16
|
+
* nothing in the config said so.
|
|
17
|
+
*
|
|
18
|
+
* The list below is process plumbing, not secrets: where to find executables,
|
|
19
|
+
* where the home and temp directories are, what the locale is. Dropping any of
|
|
20
|
+
* it does not harden anything and does break servers — a child with no `PATH`
|
|
21
|
+
* cannot resolve its own interpreter.
|
|
22
|
+
*
|
|
23
|
+
* Anything else a server needs is now named: `env` gives it a literal value,
|
|
24
|
+
* and `inheritEnv` names a parent variable to pass through. Naming is the
|
|
25
|
+
* point — a grant that has to be written down is a grant somebody can review.
|
|
26
|
+
*
|
|
27
|
+
* Windows spellings are matched case-insensitively, because its environment is
|
|
28
|
+
* case-insensitive and a lookup for `Path` against a key stored as `PATH` would
|
|
29
|
+
* silently drop it — which would present as "the server does not start on
|
|
30
|
+
* Windows" rather than as anything to do with this list.
|
|
31
|
+
*/
|
|
32
|
+
const BASE_ENV_KEYS = [
|
|
33
|
+
// Everywhere.
|
|
34
|
+
'PATH',
|
|
35
|
+
'LANG',
|
|
36
|
+
'LC_ALL',
|
|
37
|
+
'LC_CTYPE',
|
|
38
|
+
'TZ',
|
|
39
|
+
// POSIX.
|
|
40
|
+
'HOME',
|
|
41
|
+
'SHELL',
|
|
42
|
+
'TMPDIR',
|
|
43
|
+
'USER',
|
|
44
|
+
'LOGNAME',
|
|
45
|
+
// Windows. `SystemRoot` and `ComSpec` are load-bearing: without them a
|
|
46
|
+
// child cannot resolve system DLLs or the command interpreter.
|
|
47
|
+
'PATHEXT',
|
|
48
|
+
'SystemRoot',
|
|
49
|
+
'SystemDrive',
|
|
50
|
+
'ComSpec',
|
|
51
|
+
'WINDIR',
|
|
52
|
+
'TEMP',
|
|
53
|
+
'TMP',
|
|
54
|
+
'USERPROFILE',
|
|
55
|
+
'HOMEDRIVE',
|
|
56
|
+
'HOMEPATH',
|
|
57
|
+
'APPDATA',
|
|
58
|
+
'LOCALAPPDATA',
|
|
59
|
+
'PROGRAMDATA',
|
|
60
|
+
'PROGRAMFILES',
|
|
61
|
+
'NUMBER_OF_PROCESSORS',
|
|
62
|
+
'PROCESSOR_ARCHITECTURE',
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* Read one variable from the parent, honouring the platform's own casing rules.
|
|
66
|
+
*
|
|
67
|
+
* Node exposes `process.env` on Windows through a case-insensitive proxy, so a
|
|
68
|
+
* direct lookup already works there — but the KEY this returns has to be the
|
|
69
|
+
* one the parent actually uses, or a child comparing key names sees a spelling
|
|
70
|
+
* the host never set.
|
|
71
|
+
*/
|
|
72
|
+
function readParentVar(source, name) {
|
|
73
|
+
const direct = source[name];
|
|
74
|
+
if (direct !== undefined)
|
|
75
|
+
return [name, direct];
|
|
76
|
+
if (process.platform !== 'win32')
|
|
77
|
+
return undefined;
|
|
78
|
+
const lowered = name.toLowerCase();
|
|
79
|
+
for (const [key, value] of Object.entries(source)) {
|
|
80
|
+
if (key.toLowerCase() === lowered && value !== undefined)
|
|
81
|
+
return [key, value];
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* What the child is handed: plumbing, then the named inheritances, then the
|
|
87
|
+
* literal values.
|
|
88
|
+
*
|
|
89
|
+
* Later wins, and the order is the precedence an operator would guess: a
|
|
90
|
+
* literal `env` entry overrides an inherited one, and both override the base.
|
|
91
|
+
* Exported for the tests, which assert on the ENV rather than on the spawn —
|
|
92
|
+
* a test that only checked the config was accepted would have passed against
|
|
93
|
+
* the version this replaces.
|
|
94
|
+
*/
|
|
95
|
+
export function buildChildEnv(config, source = process.env) {
|
|
96
|
+
const env = {};
|
|
97
|
+
for (const name of BASE_ENV_KEYS) {
|
|
98
|
+
const found = readParentVar(source, name);
|
|
99
|
+
if (found)
|
|
100
|
+
env[found[0]] = found[1];
|
|
101
|
+
}
|
|
102
|
+
for (const name of config.inheritEnv ?? []) {
|
|
103
|
+
const found = readParentVar(source, name);
|
|
104
|
+
// A named variable the parent does not hold is simply absent. Refusing
|
|
105
|
+
// the spawn would turn an optional credential into a startup failure,
|
|
106
|
+
// and inventing an empty string would tell the server it has one.
|
|
107
|
+
if (found)
|
|
108
|
+
env[found[0]] = found[1];
|
|
109
|
+
}
|
|
110
|
+
for (const [name, value] of Object.entries(config.env ?? {}))
|
|
111
|
+
env[name] = value;
|
|
112
|
+
return env;
|
|
113
|
+
}
|
|
9
114
|
export class StdioTransport {
|
|
10
115
|
config;
|
|
11
116
|
process = null;
|
|
@@ -25,7 +130,7 @@ export class StdioTransport {
|
|
|
25
130
|
if (this.connected)
|
|
26
131
|
return;
|
|
27
132
|
this.process = spawn(this.config.command, this.config.args ?? [], {
|
|
28
|
-
env:
|
|
133
|
+
env: buildChildEnv(this.config),
|
|
29
134
|
cwd: this.config.cwd,
|
|
30
135
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
31
136
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/connector/mcp/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAM7D,OAAO,EAAe,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAElE;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,KAAK,CAAA;AAEhC,MAAM,OAAO,cAAc;IAWG;IAVrB,OAAO,GAAwB,IAAI,CAAA;IACnC,eAAe,GAAgD,EAAE,CAAA;IACjE,aAAa,GAAsB,EAAE,CAAA;IACrC,aAAa,GAAkC,EAAE,CAAA;IACjD,SAAS,GAAG,KAAK,CAAA;IACzB,6DAA6D;IACrD,WAAW,GAAG,KAAK,CAAA;IACnB,MAAM,GAAG,EAAE,CAAA;IACX,GAAG,CAAQ;IAEnB,YAA6B,MAA+B;QAA/B,WAAM,GAAN,MAAM,CAAyB;QAC3D,IAAI,CAAC,GAAG,GAAG,aAAa,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS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gBACR,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6CAA6C,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;YACpF,CAAC;QACF,CAAC;IACF,CAAC;CACD"}
|
|
@@ -18,7 +18,21 @@ export declare const GENAI: {
|
|
|
18
18
|
readonly TOKEN_TYPE: "gen_ai.token.type";
|
|
19
19
|
readonly TOOL_NAME: "gen_ai.tool.name";
|
|
20
20
|
readonly TOOL_TYPE: "gen_ai.tool.type";
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The id of the tool call this span is about.
|
|
23
|
+
*
|
|
24
|
+
* Spelled `call.id`, matching the registry and matching the two
|
|
25
|
+
* neighbours above — this read `gen_ai.tool.call_id`, one underscore
|
|
26
|
+
* where the convention has a dot, so a consumer grouping by the
|
|
27
|
+
* conventional name found nothing under it. Nothing errored, because a
|
|
28
|
+
* span attribute is a free-form key and a wrong one is simply a key
|
|
29
|
+
* nobody asked for.
|
|
30
|
+
*
|
|
31
|
+
* Pinned by `telemetry/__tests__/tool-call-id-attribute.test.ts`, which
|
|
32
|
+
* also drives the emitter: the spelling was only half the defect, and
|
|
33
|
+
* the constant had no writer at all.
|
|
34
|
+
*/
|
|
35
|
+
readonly TOOL_CALL_ID: "gen_ai.tool.call.id";
|
|
22
36
|
readonly AGENT_NAME: "gen_ai.agent.name";
|
|
23
37
|
readonly AGENT_ID: "gen_ai.agent.id";
|
|
24
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/telemetry/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;;;;;;;;IAejB;;;;;OAKG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/telemetry/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;;;;;;;;IAejB;;;;;OAKG;;;;IAMH;;;;;;;;;;;;;OAaG;;;;CAKM,CAAA;AAEV,eAAO,MAAM,KAAK;;;;;;;;;;CAUR,CAAA"}
|
|
@@ -18,7 +18,21 @@ export const GENAI = {
|
|
|
18
18
|
TOKEN_TYPE: 'gen_ai.token.type',
|
|
19
19
|
TOOL_NAME: 'gen_ai.tool.name',
|
|
20
20
|
TOOL_TYPE: 'gen_ai.tool.type',
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The id of the tool call this span is about.
|
|
23
|
+
*
|
|
24
|
+
* Spelled `call.id`, matching the registry and matching the two
|
|
25
|
+
* neighbours above — this read `gen_ai.tool.call_id`, one underscore
|
|
26
|
+
* where the convention has a dot, so a consumer grouping by the
|
|
27
|
+
* conventional name found nothing under it. Nothing errored, because a
|
|
28
|
+
* span attribute is a free-form key and a wrong one is simply a key
|
|
29
|
+
* nobody asked for.
|
|
30
|
+
*
|
|
31
|
+
* Pinned by `telemetry/__tests__/tool-call-id-attribute.test.ts`, which
|
|
32
|
+
* also drives the emitter: the spelling was only half the defect, and
|
|
33
|
+
* the constant had no writer at all.
|
|
34
|
+
*/
|
|
35
|
+
TOOL_CALL_ID: 'gen_ai.tool.call.id',
|
|
22
36
|
AGENT_NAME: 'gen_ai.agent.name',
|
|
23
37
|
AGENT_ID: 'gen_ai.agent.id',
|
|
24
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/telemetry/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;IACpB,cAAc,EAAE,uBAAuB;IACvC,MAAM,EAAE,eAAe;IAEvB,aAAa,EAAE,sBAAsB;IACrC,mBAAmB,EAAE,4BAA4B;IACjD,kBAAkB,EAAE,2BAA2B;IAE/C,cAAc,EAAE,uBAAuB;IACvC,uBAAuB,EAAE,gCAAgC;IACzD,WAAW,EAAE,oBAAoB;IAEjC,kBAAkB,EAAE,2BAA2B;IAC/C,mBAAmB,EAAE,4BAA4B;IAEjD;;;;;OAKG;IACH,UAAU,EAAE,mBAAmB;IAE/B,SAAS,EAAE,kBAAkB;IAC7B,SAAS,EAAE,kBAAkB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/telemetry/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;IACpB,cAAc,EAAE,uBAAuB;IACvC,MAAM,EAAE,eAAe;IAEvB,aAAa,EAAE,sBAAsB;IACrC,mBAAmB,EAAE,4BAA4B;IACjD,kBAAkB,EAAE,2BAA2B;IAE/C,cAAc,EAAE,uBAAuB;IACvC,uBAAuB,EAAE,gCAAgC;IACzD,WAAW,EAAE,oBAAoB;IAEjC,kBAAkB,EAAE,2BAA2B;IAC/C,mBAAmB,EAAE,4BAA4B;IAEjD;;;;;OAKG;IACH,UAAU,EAAE,mBAAmB;IAE/B,SAAS,EAAE,kBAAkB;IAC7B,SAAS,EAAE,kBAAkB;IAE7B;;;;;;;;;;;;;OAaG;IACH,YAAY,EAAE,qBAAqB;IAEnC,UAAU,EAAE,mBAAmB;IAC/B,QAAQ,EAAE,iBAAiB;CAClB,CAAA;AAEV,MAAM,CAAC,MAAM,KAAK,GAAG;IACpB,MAAM,EAAE,cAAc;IACtB,UAAU,EAAE,kBAAkB;IAC9B,SAAS,EAAE,iBAAiB;IAC5B,YAAY,EAAE,oBAAoB;IAClC,UAAU,EAAE,kBAAkB;IAC9B,UAAU,EAAE,kBAAkB;IAC9B,iBAAiB,EAAE,yBAAyB;IAC5C,kBAAkB,EAAE,0BAA0B;IAC9C,cAAc,EAAE,sBAAsB;CAC7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback.d.ts","sourceRoot":"","sources":["../../src/provider/fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAAwB,WAAW,EAAe,MAAM,4BAA4B,CAAA;AAChG,OAAO,KA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QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,wFAAwF;IACxF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,aAAa,KAAK,IAAI,CAAA;CAC7C;AAgGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,SAAS,mBAAmB,EAAE,EACvC,OAAO,GAAE,2BAAgC,GACvC,WAAW,CAqIb"}
|
|
@@ -278,8 +278,14 @@ export function withProviderFallback(members, options = {}) {
|
|
|
278
278
|
},
|
|
279
279
|
chatStream,
|
|
280
280
|
...(first.provider.listModels ? { listModels: () => first.provider.listModels?.() } : {}),
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
// Forwarded for the reason `retry.ts` forwards it: a wrapper that drops
|
|
282
|
+
// the model turns a probe the caller could answer into one it cannot.
|
|
283
|
+
...(first.provider.healthCheck
|
|
284
|
+
? { healthCheck: (model) => first.provider.healthCheck?.(model) }
|
|
285
|
+
: {}),
|
|
286
|
+
...(first.provider.doctorCheck
|
|
287
|
+
? { doctorCheck: (model) => first.provider.doctorCheck?.(model) }
|
|
288
|
+
: {}),
|
|
283
289
|
};
|
|
284
290
|
}
|
|
285
291
|
//# sourceMappingURL=fallback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback.js","sourceRoot":"","sources":["../../src/provider/fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,qBAAqB,EAAE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AC,CAAC,EAAE,CAAC;wBACzE,MAAM,EAAE,UAAU,CAAC,OAAO;qBAC1B;iBACD,CAAA;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED,qEAAqE;IACrE,4EAA4E;IAC5E,kEAAkE;IAClE,OAAO;QACN,IAAI,EAAE;YACL,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAA;QACzB,CAAC;QACD,IAAI,IAAI;YACP,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAA;QAC3B,CAAC;QACD,IAAI,YAAY;YACf,OAAO,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAA;QACnC,CAAC;QACD,UAAU;QACV,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzF,wEAAwE;QACxE,sEAAsE;QACtE,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW;YAC7B,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,EAAE;YAC1E,CAAC,CAAC,EAAE,CAAC;QACN,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW;YAC7B,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,EAAE;YAC1E,CAAC,CAAC,EAAE,CAAC;KACS,CAAA;AACjB,CAAC"}
|
package/dist/provider/retry.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { LLMProvider } from '../types/provider/index.js';
|
|
2
|
+
import { type BackoffPolicy } from '../utils/backoff.js';
|
|
2
3
|
import type { Logger } from '../utils/logger.js';
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* `BackoffPolicy` plus the provider-specific parts: how many attempts, and
|
|
6
|
+
* how long a server-directed wait may be honoured for.
|
|
7
|
+
*
|
|
8
|
+
* The curve itself lives in `utils/backoff.ts` and is shared with the tool
|
|
9
|
+
* executor's in-loop retry — which had no backoff at all while this one was
|
|
10
|
+
* being careful about jitter two directories away.
|
|
11
|
+
*/
|
|
12
|
+
export interface ProviderRetryConfig extends BackoffPolicy {
|
|
4
13
|
/** Retry attempts AFTER the initial try. `0` disables retrying. */
|
|
5
14
|
readonly maxRetries: number;
|
|
6
|
-
/** First backoff, doubled each attempt. */
|
|
7
|
-
readonly initialDelayMs: number;
|
|
8
|
-
/** Ceiling for a single backoff, before jitter. */
|
|
9
|
-
readonly maxDelayMs: number;
|
|
10
15
|
/**
|
|
11
16
|
* Cap on a server-directed `Retry-After`. A provider asking for 15
|
|
12
17
|
* minutes should not silently park an interactive run for 15 minutes;
|
|
@@ -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,
|
|
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,EAAE,KAAK,aAAa,EAA4B,MAAM,qBAAqB,CAAA;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAGhD;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACzD,mEAAmE;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CAChC;AAED,eAAO,MAAM,sBAAsB,EAAE,mBAKpC,CAAA;AAED,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,CAgLb"}
|