stitchkit 0.111.2 → 0.111.3
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 +11 -0
- package/dist/application/diagnostic-journal-contract.d.ts +1 -1
- package/dist/application/diagnostic-journal-contract.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness.js +6 -6
- package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +5 -5
- package/dist/entrypoints/agent-runtime/sqlite/node.js +5 -5
- package/dist/entrypoints/agent-runtime/testing.js +5 -5
- package/dist/entrypoints/agent-runtime.js +12 -12
- package/dist/entrypoints/application/diagnostic-journal.js +1 -1
- package/dist/entrypoints/application/directory-inbox.js +3 -3
- package/dist/entrypoints/cli/publish.js +2 -2
- package/dist/entrypoints/cli.js +8 -8
- package/dist/entrypoints/files.js +2 -2
- package/dist/entrypoints/server.js +3 -3
- package/dist/entrypoints/telegram.js +1 -1
- package/dist/entrypoints/testing.js +1 -1
- package/dist/entrypoints/tools/connections.js +6 -4
- package/dist/entrypoints/tools/contract.js +2 -2
- package/dist/entrypoints/tools/invoker.js +6 -6
- package/dist/entrypoints/tools/mcp.js +8 -8
- package/dist/entrypoints/tools.js +11 -11
- package/dist/{index-mha6b4vk.js → index-02h0dfpr.js} +12 -5
- package/dist/{index-0z3kfphz.js → index-38gvr73z.js} +1 -1
- package/dist/{index-8jv0trhg.js → index-5as18gs2.js} +1 -1
- package/dist/{index-t2bsd0hm.js → index-5v5a9k2n.js} +92 -43
- package/dist/{index-c5374vpt.js → index-651xsm48.js} +4 -4
- package/dist/{index-w9mqgnz9.js → index-6b3pcq5z.js} +1 -1
- package/dist/{index-7c046kxr.js → index-c7h371gr.js} +4 -4
- package/dist/{index-mnk5vgdr.js → index-d4cnhfdn.js} +1 -1
- package/dist/{index-t5sjh517.js → index-epmnrnth.js} +18 -1
- package/dist/{index-636mggad.js → index-ff3agzaf.js} +1 -1
- package/dist/{index-7c957abz.js → index-fh2ht88b.js} +1 -1
- package/dist/{index-q6crhe1n.js → index-h7accrrv.js} +19 -6
- package/dist/{index-0d8m0kee.js → index-hvg9hctd.js} +3 -3
- package/dist/{index-nx49x0tw.js → index-hy802jnr.js} +1 -1
- package/dist/{index-dd1z5kxb.js → index-jfk93gja.js} +3 -3
- package/dist/{index-v2eyj2ws.js → index-jprxv2an.js} +6 -6
- package/dist/{index-cykxpxz5.js → index-jy9wq8tp.js} +1 -1
- package/dist/{index-ey15wx6j.js → index-n0adphfg.js} +1 -1
- package/dist/{index-ghwntn9n.js → index-vqdjym30.js} +2 -2
- package/dist/internal/exclusive-lock-owner.d.ts +53 -0
- package/dist/internal/exclusive-lock-owner.d.ts.map +1 -0
- package/dist/internal/exclusive-lock.d.ts +1 -28
- package/dist/internal/exclusive-lock.d.ts.map +1 -1
- package/dist/internal/open-descriptors.d.ts +18 -0
- package/dist/internal/open-descriptors.d.ts.map +1 -0
- package/dist/internal/with-exclusive-lock.d.ts +2 -12
- package/dist/internal/with-exclusive-lock.d.ts.map +1 -1
- package/dist/tools/connections/runtime.d.ts +1 -1
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/execute-args.d.ts.map +1 -1
- package/dist/tools/schema/flatten-join.d.ts.map +1 -1
- package/dist/tools/schema/json-schema-origin.d.ts +17 -0
- package/dist/tools/schema/json-schema-origin.d.ts.map +1 -1
- package/llms/cli.2.txt +10 -0
- package/llms/files.txt +1 -1
- package/llms/process.txt +10 -0
- package/llms/tools-connections.txt +1 -1
- package/llms/tools.txt +8 -3
- package/llms-full.txt +30 -5
- package/llms.txt +5 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-exclusive-lock.d.ts","sourceRoot":"","sources":["../../src/internal/with-exclusive-lock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"with-exclusive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CAAC,EAAE,OAAO,CAAA;KAAE,EAG9B;CACF;AA2BD;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EACvC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC5C,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,CAAC,CAAC,CA2FZ"}
|
|
@@ -21,7 +21,7 @@ export declare function withConnectionToken<T>(params: {
|
|
|
21
21
|
* Turn a discovered JSON Schema into a `ZodObject`, falling back to a permissive
|
|
22
22
|
* object when the external schema is absent or not an object. This is the typed
|
|
23
23
|
* boundary: the schema crosses from an untrusted foreign document into Zod here
|
|
24
|
-
* and nowhere else.
|
|
24
|
+
* and nowhere else. Its unions are left to the remote that owns the schema.
|
|
25
25
|
*/
|
|
26
26
|
export declare function zodObjectFromJsonSchema(schema: Record<string, unknown> | undefined): ZodObject;
|
|
27
27
|
/** Normalise a tool name into the characters every provider accepts. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAK,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAK,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAO7D,oEAAoE;AACpE,MAAM,MAAM,uBAAuB,GAAG,CACpC,O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,GACpC,qBAAqB,EAAE,CAczB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-args.d.ts","sourceRoot":"","sources":["../../src/tools/execute-args.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"execute-args.d.ts","sourceRoot":"","sources":["../../src/tools/execute-args.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAMrE,qEAAqE;AACrE,MAAM,MAAM,uBAAuB,GAC/B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC7C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAErD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,EACE,UAAkB,EAClB,WAAmB,GACpB,GAAE,IAAI,CAAC,oBAAoB,EAAE,YAAY,GAAG,aAAa,CAAM,GAC/D,uBAAuB,CAuEzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten-join.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/flatten-join.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAsED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,EAAE,GAAG,IAAI,CAK5E;
|
|
1
|
+
{"version":3,"file":"flatten-join.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/flatten-join.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAsED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,EAAE,GAAG,IAAI,CAK5E;AAyLD,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,eAAe,EAAE,EAC7B,aAAa,EAAE,MAAM,GACpB,sBAAsB,CAuCxB"}
|
|
@@ -5,6 +5,23 @@ import { z } from 'zod';
|
|
|
5
5
|
* provenance and never guesses from a transform's public shape or metadata.
|
|
6
6
|
*/
|
|
7
7
|
export declare function markJsonSchemaObjectGuards(schema: z.core.$ZodType): void;
|
|
8
|
+
/**
|
|
9
|
+
* Record that a schema restored from a foreign document leaves its unions to the remote.
|
|
10
|
+
*
|
|
11
|
+
* A foreign tool schema is the remote's presentation, and a presentation may join a
|
|
12
|
+
* discriminated union into one object whose shared field is an unlabelled `anyOf` (a stitchkit
|
|
13
|
+
* server with `flattenUnionInput` does, ADR 0205). Every value the remote accepts still passes
|
|
14
|
+
* such a union; which branch a value was meant for does not survive. Judged here, a wrong value
|
|
15
|
+
* can only be refused with every branch listed, while the remote, which holds the original
|
|
16
|
+
* schema, names the one field that is wrong.
|
|
17
|
+
*/
|
|
18
|
+
export declare function markRemoteUnionVerdict(schema: z.ZodObject): void;
|
|
19
|
+
/**
|
|
20
|
+
* What a local parse refuses of a value the remote judges: everything but its unions. `null` when
|
|
21
|
+
* every refusal was a union's — the value goes to the remote, whose refusal is the answer.
|
|
22
|
+
* A schema that is not a restored foreign one keeps its own verdict whole.
|
|
23
|
+
*/
|
|
24
|
+
export declare function localVerdict(schema: z.core.$ZodType, error: z.ZodError): z.ZodError | null;
|
|
8
25
|
/**
|
|
9
26
|
* Schemas that can guide coercion at a proven foreign object boundary.
|
|
10
27
|
* Intersections need both branches: one carries the key guard, while another
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-origin.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/json-schema-origin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAiExE;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GACtB,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,SAAS,CAsBxC"}
|
|
1
|
+
{"version":3,"file":"json-schema-origin.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/json-schema-origin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAiExE;AAID;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAOhE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,GAAG,IAAI,CAK1F;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GACtB,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,SAAS,CAsBxC"}
|
package/llms/cli.2.txt
CHANGED
|
@@ -149,6 +149,16 @@ One unconvertible schema does not take the connection down. The tool
|
|
|
149
149
|
is skipped and **named** (`onSkippedTool`, or a stderr line by default), so a
|
|
150
150
|
surface of two hundred tools is not lost to one.
|
|
151
151
|
|
|
152
|
+
**A discovered schema is checked locally, except for its unions.** The arguments are
|
|
153
|
+
coerced and parsed against the schema the server advertised, so a missing field or a
|
|
154
|
+
wrong scalar is refused before anything is sent. A union in that schema is not judged
|
|
155
|
+
here: a server's presentation may join a discriminated union into one object whose
|
|
156
|
+
shared field is an unlabelled `anyOf` (a stitchkit server with `flattenUnionInput`
|
|
157
|
+
does), and judged against that, a wrong value could only be refused with every branch
|
|
158
|
+
listed. The value goes to the server, which holds the original schema, and its refusal
|
|
159
|
+
names the one wrong field — `blocks.0.data.artifactId: expected string` rather than
|
|
160
|
+
`No union branch matched — branch 1 … and 6 more branches`.
|
|
161
|
+
|
|
152
162
|
MCP connection limits follow the operation phase. `initialize`, the initialized
|
|
153
163
|
notification, `tools/list` and legacy endpoint discovery use `limits.discovery`;
|
|
154
164
|
`tools/call` uses `limits.call`. A mounted call's handshake still uses discovery
|
package/llms/files.txt
CHANGED
|
@@ -32,7 +32,7 @@ available from `stitchkit/contract`.
|
|
|
32
32
|
| `writeFileAtomic` / `writeFileAtomicSync` / `WriteFileAtomicOptions` | function / _type_ | replace a file atomically: a random staging name created exclusively (never through a planted link), the mode set on the descriptor before the file is visible (default `0o600`, not masked by the umask), `fsync`, rename; a failure leaves the target and no staging file. The asynchronous form keeps the event loop running. A process killed before publication leaves its staging file; sweeping it is the caller's job |
|
|
33
33
|
| `isAtomicStagingName` | function | true for a staging file name of an atomic write of this library (`.stitchkit-<24 lowercase hex>.tmp`, also used by the managed writer and the chunk spool); the form is a stable contract, and changing it is a breaking change ([ADR 0242](../decisions/0242-atomic-staging-name-is-a-public-contract.md)) |
|
|
34
34
|
| `sweepAtomicStaging` / `SweepAtomicStagingOptions` | function / _type_ | remove abandoned staging files from one `directory`: only regular files matching `isAtomicStagingName` and older than the required `olderThanMs`, never following a symlink or entering a subdirectory; stops on `signal`; returns the removed names, `[]` for a `directory` that does not exist |
|
|
35
|
-
| `withExclusiveLock` / `ExclusiveLockOptions` / `ExclusiveLock` / `ExclusiveLockOwner` | function / _type_ | run work under an exclusive lock between processes — a file recording its owner (pid, host, machine identity, time and nullable kernel process identity); waits up to `timeoutMs` (default 10 s) and stops on `signal`; a dead owner on this machine is taken over, a live, slow or foreign one never is; the lock is published with its owner already recorded (temporary file plus hard link), so a stalled holder is never displaced; a legacy empty lock file is taken by age only when `ownerlessGraceMs` is a number (default `null`: never; an abandoned empty reclaim guard is taken after 5 000 ms unless a value is set); exact `mode` is independent of umask; shared readers need a common group and traversable directories |
|
|
35
|
+
| `withExclusiveLock` / `ExclusiveLockOptions` / `ExclusiveLock` / `ExclusiveLockOwner` | function / _type_ | run work under an exclusive lock between processes — a file recording its owner (pid, host, machine identity, time and nullable kernel process identity); waits up to `timeoutMs` (default 10 s) and stops on `signal`; a dead owner on this machine is taken over, a live, slow or foreign one never is; a lock recorded by this very process is held only while one of its descriptors is open on it, so the lock an earlier image of the same PID left (`bun --watch` restarts in place) is taken over at once; the lock is published with its owner already recorded (temporary file plus hard link), so a stalled holder is never displaced; a legacy empty lock file is taken by age only when `ownerlessGraceMs` is a number (default `null`: never; an abandoned empty reclaim guard is taken after 5 000 ms unless a value is set); exact `mode` is independent of umask; shared readers need a common group and traversable directories |
|
|
36
36
|
| `ExclusiveLockError` | class | `LOCK_TIMEOUT` naming the resource and its holder, or `LOCK_ABORTED` with the signal's reason |
|
|
37
37
|
| `createChunkSpool` | function | the server half of a chunked upload: parts on disk under `owner` + client-minted `uploadId`, each with a size+sha256 receipt; idempotent `open` and `put`, the first writer of a part wins across processes, `assemble` in order once every part is in, `sweep` of untouched uploads — [guide](../guide/client.md#chunked-uploads) |
|
|
38
38
|
| `ChunkSpool` / `ChunkSpoolConfig` / `ChunkSpoolKey` / `ChunkSpoolOpen` / `ChunkSpoolPart` / `ChunkSpoolAssembly` | _type_ | the spool, its directory, part size, file limit, meta schema and age; an upload's key; its declaration; one part; the assembled parts with a concatenating `stream()` |
|
package/llms/process.txt
CHANGED
|
@@ -480,6 +480,16 @@ unlink. Recovery depth is capped at 16; a deeper stale chain refuses recovery wi
|
|
|
480
480
|
the bounded `LOCK_TIMEOUT`. Live owners, unknown process-lifetime evidence and unsafe records are never
|
|
481
481
|
reclaimed. Concurrent writers cannot bypass a guard while a prior unlink is paused.
|
|
482
482
|
|
|
483
|
+
A record that names this very process is held only while a descriptor of this process is open
|
|
484
|
+
on the lock: the holder keeps the one it created the lock with until it releases. A process image
|
|
485
|
+
replaced in place — `execve`, which is how `bun --watch` restarts — keeps its PID and kernel start
|
|
486
|
+
time, so its record still matches, but not that descriptor, and the new image takes the lock over
|
|
487
|
+
at once instead of waiting for the PID to change. Worker threads and a second copy of the package
|
|
488
|
+
in the same process share the descriptor table, so a hold any of them takes is never displaced.
|
|
489
|
+
The check counts only when `/dev/fd` lists the descriptor it opens itself; a listing it cannot
|
|
490
|
+
prove complete means "unknown", which never reclaims. A replaced image of another process is
|
|
491
|
+
still judged alive.
|
|
492
|
+
|
|
483
493
|
## Libraries with a Zod-only runtime
|
|
484
494
|
|
|
485
495
|
Public leaves keep optional peers out of their import closure. Installing `stitchkit` still
|
|
@@ -27,7 +27,7 @@ and approval path.
|
|
|
27
27
|
| `ConnectionPhase` / `ConnectionOperation` / `ConnectionFailureContext` | _type_ | closed operation/phase vocabulary and measured read context for existing typed connection errors |
|
|
28
28
|
| `ConnectionTimeoutError` / `ConnectionResponseTooLargeError` | class | bounded operation refusal, with phase, operation and finite observed bytes; safe tool projection retains the raw cause locally |
|
|
29
29
|
| `defineOpenApiConnection` | function | declare one OpenAPI document (object, JSON text or JSON URL) as a tool surface |
|
|
30
|
-
| `mountConnections` | function | discover every connection and return readonly `RuntimeToolDefinition`s for `mountAgent
|
|
30
|
+
| `mountConnections` | function | discover every connection and return readonly `RuntimeToolDefinition`s for `mountAgent`; a call's arguments are parsed against the discovered schema before sending, except its unions, which the server judges (ADR 0266) |
|
|
31
31
|
| `ConnectionAuthorizationRequiredError` | class | typed reauthorization signal raised on `401` with credentials resolved again on the next call |
|
|
32
32
|
| `ConnectionBudgetExceededError` | class | the mount would expose more foreign tools than its declared budget |
|
|
33
33
|
| `ConnectionRequestError` | class | any non-`2xx` connection response other than the reauthorization signal |
|
package/llms/tools.txt
CHANGED
|
@@ -770,12 +770,17 @@ A field that is a number in every variant is advertised as a number, not as a
|
|
|
770
770
|
bare description. Scalar collisions keep every provable kind in a deterministic
|
|
771
771
|
JSON Schema type array. If any alternative is an object or array, the property
|
|
772
772
|
retains distinct structural alternatives in `anyOf`: object properties, typed
|
|
773
|
-
array items, bounds and nullable values remain available to the model.
|
|
773
|
+
array items, bounds and nullable values remain available to the model. Each
|
|
774
|
+
alternative is described by the discriminator values that select it
|
|
775
|
+
(`When type = image.`, or `When type = photo | video.` for a shape two values share),
|
|
776
|
+
so the model can pair a shape with its value; the order of the alternatives is
|
|
777
|
+
canonical, not the order of the variants. The
|
|
774
778
|
containing discriminated union still becomes one object; flat mode does not
|
|
775
779
|
promise to remove every nested union keyword. Only a branch whose kind is
|
|
776
780
|
actually unknowable, such as a free-form schema or unresolved reference, leaves
|
|
777
|
-
the collision unconstrained. → ADRs [0044](../decisions/0044-a-collided-field-keeps-its-type.md)
|
|
778
|
-
|
|
781
|
+
the collision unconstrained. → ADRs [0044](../decisions/0044-a-collided-field-keeps-its-type.md),
|
|
782
|
+
[0205](../decisions/0205-flat-tool-collisions-retain-structural-alternatives.md)
|
|
783
|
+
and [0267](../decisions/0267-a-flat-alternative-names-the-values-that-select-it.md).
|
|
779
784
|
|
|
780
785
|
It is **deep** because the projection walks the generated JSON Schema document,
|
|
781
786
|
including objects, arrays, tuples and schema-definition nodes. Structurally
|
package/llms-full.txt
CHANGED
|
@@ -4428,12 +4428,17 @@ A field that is a number in every variant is advertised as a number, not as a
|
|
|
4428
4428
|
bare description. Scalar collisions keep every provable kind in a deterministic
|
|
4429
4429
|
JSON Schema type array. If any alternative is an object or array, the property
|
|
4430
4430
|
retains distinct structural alternatives in `anyOf`: object properties, typed
|
|
4431
|
-
array items, bounds and nullable values remain available to the model.
|
|
4431
|
+
array items, bounds and nullable values remain available to the model. Each
|
|
4432
|
+
alternative is described by the discriminator values that select it
|
|
4433
|
+
(`When type = image.`, or `When type = photo | video.` for a shape two values share),
|
|
4434
|
+
so the model can pair a shape with its value; the order of the alternatives is
|
|
4435
|
+
canonical, not the order of the variants. The
|
|
4432
4436
|
containing discriminated union still becomes one object; flat mode does not
|
|
4433
4437
|
promise to remove every nested union keyword. Only a branch whose kind is
|
|
4434
4438
|
actually unknowable, such as a free-form schema or unresolved reference, leaves
|
|
4435
|
-
the collision unconstrained. → ADRs [0044](../decisions/0044-a-collided-field-keeps-its-type.md)
|
|
4436
|
-
|
|
4439
|
+
the collision unconstrained. → ADRs [0044](../decisions/0044-a-collided-field-keeps-its-type.md),
|
|
4440
|
+
[0205](../decisions/0205-flat-tool-collisions-retain-structural-alternatives.md)
|
|
4441
|
+
and [0267](../decisions/0267-a-flat-alternative-names-the-values-that-select-it.md).
|
|
4437
4442
|
|
|
4438
4443
|
It is **deep** because the projection walks the generated JSON Schema document,
|
|
4439
4444
|
including objects, arrays, tuples and schema-definition nodes. Structurally
|
|
@@ -8916,6 +8921,16 @@ unlink. Recovery depth is capped at 16; a deeper stale chain refuses recovery wi
|
|
|
8916
8921
|
the bounded `LOCK_TIMEOUT`. Live owners, unknown process-lifetime evidence and unsafe records are never
|
|
8917
8922
|
reclaimed. Concurrent writers cannot bypass a guard while a prior unlink is paused.
|
|
8918
8923
|
|
|
8924
|
+
A record that names this very process is held only while a descriptor of this process is open
|
|
8925
|
+
on the lock: the holder keeps the one it created the lock with until it releases. A process image
|
|
8926
|
+
replaced in place — `execve`, which is how `bun --watch` restarts — keeps its PID and kernel start
|
|
8927
|
+
time, so its record still matches, but not that descriptor, and the new image takes the lock over
|
|
8928
|
+
at once instead of waiting for the PID to change. Worker threads and a second copy of the package
|
|
8929
|
+
in the same process share the descriptor table, so a hold any of them takes is never displaced.
|
|
8930
|
+
The check counts only when `/dev/fd` lists the descriptor it opens itself; a listing it cannot
|
|
8931
|
+
prove complete means "unknown", which never reclaims. A replaced image of another process is
|
|
8932
|
+
still judged alive.
|
|
8933
|
+
|
|
8919
8934
|
## Libraries with a Zod-only runtime
|
|
8920
8935
|
|
|
8921
8936
|
Public leaves keep optional peers out of their import closure. Installing `stitchkit` still
|
|
@@ -10771,6 +10786,16 @@ One unconvertible schema does not take the connection down. The tool
|
|
|
10771
10786
|
is skipped and **named** (`onSkippedTool`, or a stderr line by default), so a
|
|
10772
10787
|
surface of two hundred tools is not lost to one.
|
|
10773
10788
|
|
|
10789
|
+
**A discovered schema is checked locally, except for its unions.** The arguments are
|
|
10790
|
+
coerced and parsed against the schema the server advertised, so a missing field or a
|
|
10791
|
+
wrong scalar is refused before anything is sent. A union in that schema is not judged
|
|
10792
|
+
here: a server's presentation may join a discriminated union into one object whose
|
|
10793
|
+
shared field is an unlabelled `anyOf` (a stitchkit server with `flattenUnionInput`
|
|
10794
|
+
does), and judged against that, a wrong value could only be refused with every branch
|
|
10795
|
+
listed. The value goes to the server, which holds the original schema, and its refusal
|
|
10796
|
+
names the one wrong field — `blocks.0.data.artifactId: expected string` rather than
|
|
10797
|
+
`No union branch matched — branch 1 … and 6 more branches`.
|
|
10798
|
+
|
|
10774
10799
|
MCP connection limits follow the operation phase. `initialize`, the initialized
|
|
10775
10800
|
notification, `tools/list` and legacy endpoint discovery use `limits.discovery`;
|
|
10776
10801
|
`tools/call` uses `limits.call`. A mounted call's handshake still uses discovery
|
|
@@ -22904,7 +22929,7 @@ and approval path.
|
|
|
22904
22929
|
| `ConnectionPhase` / `ConnectionOperation` / `ConnectionFailureContext` | _type_ | closed operation/phase vocabulary and measured read context for existing typed connection errors |
|
|
22905
22930
|
| `ConnectionTimeoutError` / `ConnectionResponseTooLargeError` | class | bounded operation refusal, with phase, operation and finite observed bytes; safe tool projection retains the raw cause locally |
|
|
22906
22931
|
| `defineOpenApiConnection` | function | declare one OpenAPI document (object, JSON text or JSON URL) as a tool surface |
|
|
22907
|
-
| `mountConnections` | function | discover every connection and return readonly `RuntimeToolDefinition`s for `mountAgent
|
|
22932
|
+
| `mountConnections` | function | discover every connection and return readonly `RuntimeToolDefinition`s for `mountAgent`; a call's arguments are parsed against the discovered schema before sending, except its unions, which the server judges (ADR 0266) |
|
|
22908
22933
|
| `ConnectionAuthorizationRequiredError` | class | typed reauthorization signal raised on `401` with credentials resolved again on the next call |
|
|
22909
22934
|
| `ConnectionBudgetExceededError` | class | the mount would expose more foreign tools than its declared budget |
|
|
22910
22935
|
| `ConnectionRequestError` | class | any non-`2xx` connection response other than the reauthorization signal |
|
|
@@ -23013,7 +23038,7 @@ available from `stitchkit/contract`.
|
|
|
23013
23038
|
| `writeFileAtomic` / `writeFileAtomicSync` / `WriteFileAtomicOptions` | function / _type_ | replace a file atomically: a random staging name created exclusively (never through a planted link), the mode set on the descriptor before the file is visible (default `0o600`, not masked by the umask), `fsync`, rename; a failure leaves the target and no staging file. The asynchronous form keeps the event loop running. A process killed before publication leaves its staging file; sweeping it is the caller's job |
|
|
23014
23039
|
| `isAtomicStagingName` | function | true for a staging file name of an atomic write of this library (`.stitchkit-<24 lowercase hex>.tmp`, also used by the managed writer and the chunk spool); the form is a stable contract, and changing it is a breaking change ([ADR 0242](../decisions/0242-atomic-staging-name-is-a-public-contract.md)) |
|
|
23015
23040
|
| `sweepAtomicStaging` / `SweepAtomicStagingOptions` | function / _type_ | remove abandoned staging files from one `directory`: only regular files matching `isAtomicStagingName` and older than the required `olderThanMs`, never following a symlink or entering a subdirectory; stops on `signal`; returns the removed names, `[]` for a `directory` that does not exist |
|
|
23016
|
-
| `withExclusiveLock` / `ExclusiveLockOptions` / `ExclusiveLock` / `ExclusiveLockOwner` | function / _type_ | run work under an exclusive lock between processes — a file recording its owner (pid, host, machine identity, time and nullable kernel process identity); waits up to `timeoutMs` (default 10 s) and stops on `signal`; a dead owner on this machine is taken over, a live, slow or foreign one never is; the lock is published with its owner already recorded (temporary file plus hard link), so a stalled holder is never displaced; a legacy empty lock file is taken by age only when `ownerlessGraceMs` is a number (default `null`: never; an abandoned empty reclaim guard is taken after 5 000 ms unless a value is set); exact `mode` is independent of umask; shared readers need a common group and traversable directories |
|
|
23041
|
+
| `withExclusiveLock` / `ExclusiveLockOptions` / `ExclusiveLock` / `ExclusiveLockOwner` | function / _type_ | run work under an exclusive lock between processes — a file recording its owner (pid, host, machine identity, time and nullable kernel process identity); waits up to `timeoutMs` (default 10 s) and stops on `signal`; a dead owner on this machine is taken over, a live, slow or foreign one never is; a lock recorded by this very process is held only while one of its descriptors is open on it, so the lock an earlier image of the same PID left (`bun --watch` restarts in place) is taken over at once; the lock is published with its owner already recorded (temporary file plus hard link), so a stalled holder is never displaced; a legacy empty lock file is taken by age only when `ownerlessGraceMs` is a number (default `null`: never; an abandoned empty reclaim guard is taken after 5 000 ms unless a value is set); exact `mode` is independent of umask; shared readers need a common group and traversable directories |
|
|
23017
23042
|
| `ExclusiveLockError` | class | `LOCK_TIMEOUT` naming the resource and its holder, or `LOCK_ABORTED` with the signal's reason |
|
|
23018
23043
|
| `createChunkSpool` | function | the server half of a chunked upload: parts on disk under `owner` + client-minted `uploadId`, each with a size+sha256 receipt; idempotent `open` and `put`, the first writer of a part wins across processes, `assemble` in order once every part is in, `sweep` of untouched uploads — [guide](../guide/client.md#chunked-uploads) |
|
|
23019
23044
|
| `ChunkSpool` / `ChunkSpoolConfig` / `ChunkSpoolKey` / `ChunkSpoolOpen` / `ChunkSpoolPart` / `ChunkSpoolAssembly` | _type_ | the spool, its directory, part size, file limit, meta schema and age; an upload's key; its declaration; one part; the assembled parts with a concatenating `stream()` |
|
package/llms.txt
CHANGED
|
@@ -13,12 +13,12 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
|
|
|
13
13
|
- **stitchkit/live**: [llms/live.txt](llms/live.txt) 21.2 KB
|
|
14
14
|
- **stitchkit/react**: [llms/react.txt](llms/react.txt) 8.6 KB
|
|
15
15
|
- **stitchkit/react/keyboard**: [llms/react-keyboard.txt](llms/react-keyboard.txt) 9.2 KB
|
|
16
|
-
- **stitchkit/tools**: [llms/tools.txt](llms/tools.txt) 46.
|
|
16
|
+
- **stitchkit/tools**: [llms/tools.txt](llms/tools.txt) 46.7 KB → [llms/tools.2.txt](llms/tools.2.txt) 30.4 KB → [llms/tools.3.txt](llms/tools.3.txt) 26.3 KB
|
|
17
17
|
- **stitchkit/tools/mcp**: [llms/tools-mcp.txt](llms/tools-mcp.txt) 1.8 KB
|
|
18
18
|
- **stitchkit/tools/contract**: [llms/tools-contract.txt](llms/tools-contract.txt) 0.2 KB
|
|
19
19
|
- **stitchkit/tools/invoker**: [llms/tools-invoker.txt](llms/tools-invoker.txt) 0.2 KB
|
|
20
|
-
- **stitchkit/tools/connections**: [llms/tools-connections.txt](llms/tools-connections.txt) 3.
|
|
21
|
-
- **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 44.6 KB → [llms/cli.2.txt](llms/cli.2.txt)
|
|
20
|
+
- **stitchkit/tools/connections**: [llms/tools-connections.txt](llms/tools-connections.txt) 3.8 KB
|
|
21
|
+
- **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 44.6 KB → [llms/cli.2.txt](llms/cli.2.txt) 21.3 KB
|
|
22
22
|
- **stitchkit/cli/publish**: [llms/cli-publish.txt](llms/cli-publish.txt) 1.5 KB
|
|
23
23
|
- **stitchkit/remote**: [llms/remote.txt](llms/remote.txt) 1.0 KB
|
|
24
24
|
- **stitchkit/contract**: [llms/contract.txt](llms/contract.txt) 31.9 KB
|
|
@@ -41,7 +41,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
|
|
|
41
41
|
- **stitchkit/application/schemas**: [llms/application-schemas.txt](llms/application-schemas.txt) 1.8 KB
|
|
42
42
|
- **stitchkit/testing**: [llms/testing.txt](llms/testing.txt) 33.6 KB
|
|
43
43
|
- **stitchkit/agent-runtime/sandbox**: [llms/agent-runtime-sandbox.txt](llms/agent-runtime-sandbox.txt) 8.3 KB
|
|
44
|
-
- **stitchkit/files**: [llms/files.txt](llms/files.txt) 5.
|
|
44
|
+
- **stitchkit/files**: [llms/files.txt](llms/files.txt) 5.7 KB
|
|
45
45
|
- **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 36.6 KB
|
|
46
46
|
- **stitchkit/telegram/html**: [llms/telegram-html.txt](llms/telegram-html.txt) 2.7 KB
|
|
47
47
|
- **stitchkit/telegram/screens**: [llms/telegram-screens.txt](llms/telegram-screens.txt) 21.2 KB
|
|
@@ -56,7 +56,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
|
|
|
56
56
|
- **stitchkit/node**: [llms/node.txt](llms/node.txt) 3.1 KB
|
|
57
57
|
- **stitchkit/agent-runtime/react**: [llms/agent-runtime-react.txt](llms/agent-runtime-react.txt) 1.0 KB
|
|
58
58
|
- **stitchkit/agent-runtime/realtime**: [llms/agent-runtime-realtime.txt](llms/agent-runtime-realtime.txt) 2.6 KB
|
|
59
|
-
- **stitchkit/process**: [llms/process.txt](llms/process.txt)
|
|
59
|
+
- **stitchkit/process**: [llms/process.txt](llms/process.txt) 44.4 KB → [llms/process.2.txt](llms/process.2.txt) 4.3 KB
|
|
60
60
|
- **stitchkit/process/owner-loss**: [llms/process-owner-loss.txt](llms/process-owner-loss.txt) 0.9 KB
|
|
61
61
|
- **stitchkit/files/packaging**: [llms/files-packaging.txt](llms/files-packaging.txt) 3.5 KB
|
|
62
62
|
- **stitchkit/http**: [llms/http.txt](llms/http.txt) 0.9 KB
|
package/package.json
CHANGED