@namzu/sdk 40.0.0 → 41.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 +177 -0
- package/dist/bridge/a2a/mapper.d.ts.map +1 -1
- package/dist/bridge/a2a/mapper.js +8 -0
- package/dist/bridge/a2a/mapper.js.map +1 -1
- package/dist/bridge/sse/mapper.d.ts.map +1 -1
- package/dist/bridge/sse/mapper.js +11 -0
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/connector/index.d.ts +2 -2
- package/dist/connector/index.d.ts.map +1 -1
- package/dist/connector/index.js +1 -1
- package/dist/connector/index.js.map +1 -1
- package/dist/connector/mcp/adapter.d.ts.map +1 -1
- package/dist/connector/mcp/adapter.js +92 -4
- package/dist/connector/mcp/adapter.js.map +1 -1
- package/dist/connector/mcp/audio-admission.d.ts +17 -0
- package/dist/connector/mcp/audio-admission.d.ts.map +1 -0
- package/dist/connector/mcp/audio-admission.js +171 -0
- package/dist/connector/mcp/audio-admission.js.map +1 -0
- package/dist/connector/mcp/client.d.ts +252 -1
- package/dist/connector/mcp/client.d.ts.map +1 -1
- package/dist/connector/mcp/client.js +611 -39
- package/dist/connector/mcp/client.js.map +1 -1
- package/dist/connector/mcp/envelope.d.ts +91 -0
- package/dist/connector/mcp/envelope.d.ts.map +1 -0
- package/dist/connector/mcp/envelope.js +173 -0
- package/dist/connector/mcp/envelope.js.map +1 -0
- package/dist/connector/mcp/era.d.ts +130 -0
- package/dist/connector/mcp/era.d.ts.map +1 -0
- package/dist/connector/mcp/era.js +304 -0
- package/dist/connector/mcp/era.js.map +1 -0
- package/dist/connector/mcp/errors.d.ts +106 -0
- package/dist/connector/mcp/errors.d.ts.map +1 -0
- package/dist/connector/mcp/errors.js +154 -0
- package/dist/connector/mcp/errors.js.map +1 -0
- package/dist/connector/mcp/http-sse.d.ts +11 -0
- package/dist/connector/mcp/http-sse.d.ts.map +1 -1
- package/dist/connector/mcp/http-sse.js +21 -6
- package/dist/connector/mcp/http-sse.js.map +1 -1
- package/dist/connector/mcp/index.d.ts +7 -0
- package/dist/connector/mcp/index.d.ts.map +1 -1
- package/dist/connector/mcp/index.js +10 -0
- package/dist/connector/mcp/index.js.map +1 -1
- package/dist/connector/mcp/streamable-http.d.ts +83 -0
- package/dist/connector/mcp/streamable-http.d.ts.map +1 -1
- package/dist/connector/mcp/streamable-http.js +177 -11
- package/dist/connector/mcp/streamable-http.js.map +1 -1
- package/dist/connector/mcp/x-mcp-header.d.ts +56 -0
- package/dist/connector/mcp/x-mcp-header.d.ts.map +1 -0
- package/dist/connector/mcp/x-mcp-header.js +254 -0
- package/dist/connector/mcp/x-mcp-header.js.map +1 -0
- package/dist/constants/mcp/index.d.ts +123 -15
- package/dist/constants/mcp/index.d.ts.map +1 -1
- package/dist/constants/mcp/index.js +135 -16
- package/dist/constants/mcp/index.js.map +1 -1
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +23 -0
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +20 -0
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +19 -3
- package/dist/prompt/coding-agent-doctrine.js.map +1 -1
- package/dist/prompt/index.d.ts +1 -1
- package/dist/prompt/index.d.ts.map +1 -1
- package/dist/prompt/index.js +1 -1
- package/dist/prompt/index.js.map +1 -1
- package/dist/public-runtime.d.ts +3 -3
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +3 -3
- package/dist/public-runtime.js.map +1 -1
- package/dist/sandbox/provider/local.d.ts.map +1 -1
- package/dist/sandbox/provider/local.js +46 -3
- package/dist/sandbox/provider/local.js.map +1 -1
- package/dist/scheduler/local.d.ts.map +1 -1
- package/dist/scheduler/local.js +8 -0
- package/dist/scheduler/local.js.map +1 -1
- package/dist/store/run/disk.d.ts +35 -1
- package/dist/store/run/disk.d.ts.map +1 -1
- package/dist/store/run/disk.js +100 -0
- package/dist/store/run/disk.js.map +1 -1
- package/dist/types/agent/scheduler.d.ts +20 -0
- package/dist/types/agent/scheduler.d.ts.map +1 -1
- package/dist/types/agent/task.d.ts +20 -0
- package/dist/types/agent/task.d.ts.map +1 -1
- package/dist/types/connector/mcp.d.ts +205 -0
- package/dist/types/connector/mcp.d.ts.map +1 -1
- package/dist/types/run/events.d.ts +56 -0
- package/dist/types/run/events.d.ts.map +1 -1
- package/dist/types/run/events.js.map +1 -1
- package/dist/types/run/store.d.ts +41 -0
- package/dist/types/run/store.d.ts.map +1 -1
- package/dist/types/sandbox/index.d.ts +68 -1
- package/dist/types/sandbox/index.d.ts.map +1 -1
- package/dist/types/sandbox/index.js.map +1 -1
- package/package.json +1 -1
- package/src/bridge/a2a/mapper.ts +8 -0
- package/src/bridge/sse/mapper.ts +11 -0
- package/src/connector/index.ts +27 -0
- package/src/connector/mcp/adapter.ts +103 -4
- package/src/connector/mcp/audio-admission.ts +173 -0
- package/src/connector/mcp/client.ts +694 -45
- package/src/connector/mcp/envelope.ts +235 -0
- package/src/connector/mcp/era.ts +400 -0
- package/src/connector/mcp/errors.ts +171 -0
- package/src/connector/mcp/http-sse.ts +23 -6
- package/src/connector/mcp/index.ts +37 -0
- package/src/connector/mcp/streamable-http.ts +199 -11
- package/src/connector/mcp/x-mcp-header.ts +322 -0
- package/src/constants/mcp/index.ts +145 -16
- package/src/manager/agent/lifecycle.ts +29 -0
- package/src/prompt/coding-agent-doctrine.ts +31 -4
- package/src/prompt/index.ts +1 -0
- package/src/public-runtime.ts +28 -0
- package/src/sandbox/provider/local.ts +45 -2
- package/src/scheduler/local.ts +8 -0
- package/src/store/run/disk.ts +108 -0
- package/src/types/agent/scheduler.ts +21 -0
- package/src/types/agent/task.ts +21 -0
- package/src/types/connector/mcp.ts +205 -1
- package/src/types/run/events.ts +56 -0
- package/src/types/run/store.ts +42 -0
- package/src/types/sandbox/index.ts +69 -1
|
@@ -261,6 +261,35 @@ export interface SandboxTcpConnectOptions {
|
|
|
261
261
|
readonly host?: '127.0.0.1' | '::1'
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
/**
|
|
265
|
+
* What to read, and how to stop reading it. Every field is optional, so
|
|
266
|
+
* `readFile(path)` and `readFile(path, {})` mean the same thing: the whole
|
|
267
|
+
* file.
|
|
268
|
+
*/
|
|
269
|
+
export interface SandboxReadFileOptions {
|
|
270
|
+
/** First byte to read. Defaults to 0. */
|
|
271
|
+
readonly offset?: number
|
|
272
|
+
/**
|
|
273
|
+
* How many bytes to read. Defaults to the rest of the file. A range
|
|
274
|
+
* that runs past the end returns the bytes that exist, not an error —
|
|
275
|
+
* a caller resuming from a remembered offset must be able to ask
|
|
276
|
+
* without knowing the answer first.
|
|
277
|
+
*
|
|
278
|
+
* **A backend may cap how large a single range it will serve**, and
|
|
279
|
+
* one past that cap is REFUSED rather than shortened — a caller that
|
|
280
|
+
* asked for 4 MiB, got 1 MiB and was told nothing would read the short
|
|
281
|
+
* answer as the end of its range. The agent-backed backends cap it at
|
|
282
|
+
* `NAMZU_AGENT_READ_FILE_RANGE_BYTES` (1 MiB by default), because one
|
|
283
|
+
* range is one wire frame there; a provider reading from local disk has
|
|
284
|
+
* no such ceiling. A caller that wants more than a frame's worth in one
|
|
285
|
+
* call iterates {@link Sandbox.readFileStream} instead, which is not
|
|
286
|
+
* capped.
|
|
287
|
+
*/
|
|
288
|
+
readonly length?: number
|
|
289
|
+
/** Aborts the read. */
|
|
290
|
+
readonly signal?: AbortSignal
|
|
291
|
+
}
|
|
292
|
+
|
|
264
293
|
export interface Sandbox {
|
|
265
294
|
readonly id: SandboxId
|
|
266
295
|
readonly status: SandboxStatus
|
|
@@ -323,7 +352,46 @@ export interface Sandbox {
|
|
|
323
352
|
*/
|
|
324
353
|
openTcpConnection?(options: SandboxTcpConnectOptions): Promise<SandboxTcpConnection>
|
|
325
354
|
writeFile(path: string, content: string | Buffer): Promise<void>
|
|
326
|
-
|
|
355
|
+
/**
|
|
356
|
+
* Read a file out of the sandbox.
|
|
357
|
+
*
|
|
358
|
+
* `options` is optional in both directions, which is what keeps this
|
|
359
|
+
* source-compatible: a caller may go on writing `readFile(path)`, and a
|
|
360
|
+
* backend may go on declaring the one-parameter form and still satisfy
|
|
361
|
+
* this signature. A backend that accepts the parameter and IGNORES
|
|
362
|
+
* `offset`/`length` does not — returning the whole file where a slice
|
|
363
|
+
* was asked for is a wrong answer, not a degraded one, so such a
|
|
364
|
+
* backend must reject instead.
|
|
365
|
+
*
|
|
366
|
+
* @param options.offset First byte to read. Defaults to 0.
|
|
367
|
+
* @param options.length How many bytes to read. Defaults to the rest of
|
|
368
|
+
* the file. A range that runs past the end returns the bytes that
|
|
369
|
+
* exist rather than failing.
|
|
370
|
+
* @param options.signal Aborts the read.
|
|
371
|
+
*/
|
|
372
|
+
readFile(path: string, options?: SandboxReadFileOptions): Promise<Buffer>
|
|
373
|
+
/**
|
|
374
|
+
* Read a file as a stream of chunks, so neither the sandbox nor this
|
|
375
|
+
* process ever holds the whole of it.
|
|
376
|
+
*
|
|
377
|
+
* Optional, in the same way {@link Sandbox.openTerminal} is: a backend
|
|
378
|
+
* that cannot read a file incrementally must OMIT this rather than
|
|
379
|
+
* implement it by reading the file whole and chopping the result up,
|
|
380
|
+
* which would give a caller the bounded-memory behaviour it asked for in
|
|
381
|
+
* name only. A caller that needs the bound therefore refuses an absent
|
|
382
|
+
* method rather than falling back to {@link Sandbox.readFile}.
|
|
383
|
+
*
|
|
384
|
+
* Chunk boundaries are not part of the contract — only the order and
|
|
385
|
+
* the concatenation are. Aborting `options.signal`, or leaving the loop
|
|
386
|
+
* early, must stop the transfer and release whatever the sandbox opened
|
|
387
|
+
* for it.
|
|
388
|
+
*
|
|
389
|
+
* Hosts that drain agent-produced output files before {@link destroy}
|
|
390
|
+
* (see {@link listFiles}) are the reason this exists: those files are
|
|
391
|
+
* routinely tens to hundreds of megabytes, and a whole-file read of one
|
|
392
|
+
* of them costs several times its size in the sandbox.
|
|
393
|
+
*/
|
|
394
|
+
readFileStream?(path: string, options?: SandboxReadFileOptions): AsyncIterable<Buffer>
|
|
327
395
|
/**
|
|
328
396
|
* Recursively enumerate regular files under `rootPath`. Directories,
|
|
329
397
|
* symlinks, sockets, and other non-regular entries are skipped.
|