stitchkit 0.97.0 → 0.98.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 CHANGED
@@ -15,6 +15,34 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.98.0] — 2026-09-26
19
+
20
+ ### ⚠️ Breaking changes
21
+
22
+ - `stitchkit/cli` — automatic stdin routing waits only 250 ms for its first byte.
23
+ A producer that starts later now reaches required-field validation instead of
24
+ waiting indefinitely. Before: `slow-producer | myapp generate`. After:
25
+ `myapp generate --prompt "$(slow-producer)"`, or supply an explicit
26
+ `CliConfig.stdin` reader. Once input starts, it is still read fully to EOF.
27
+ → ADR 0203
28
+
29
+ **Who must act:** CLI consumers whose piped producer may take more than 250 ms
30
+ before writing its first byte. See the 0.98.0 migration in `docs/guide/upgrading.md`.
31
+
32
+ ### Fixed
33
+
34
+ - `stitchkit/cli` — a missing required argument on an empty, open stdin pipe
35
+ reaches validation after a 250 ms first-byte probe instead of hanging for EOF.
36
+ Once data starts, the full stream is read to EOF without truncating delayed
37
+ chunks. TTYs, explicit arguments, custom stdin readers and streaming commands
38
+ retain their separate input behavior; see the CLI guide for delayed producers.
39
+
40
+ ### Changed
41
+
42
+ - Release validation no longer limits stable-breaking releases by calendar cadence.
43
+ Named entrypoints, stable ADR citations, minor versioning, dated changelogs,
44
+ migrations and exact-SHA CI remain mandatory. See ADR 0204.
45
+
18
46
  ## [0.97.0] — 2026-09-26
19
47
 
20
48
  ### ⚠️ Breaking changes
@@ -18,7 +18,7 @@ import {
18
18
  readCapped,
19
19
  renderCliView,
20
20
  routeCliArgv
21
- } from "../index-t9rhjr9f.js";
21
+ } from "../index-f1nb70ae.js";
22
22
  import"../index-sbdmyz75.js";
23
23
  import"../index-hmp4800j.js";
24
24
  import {
@@ -60,7 +60,7 @@ import {
60
60
  fetchPinnedDocument,
61
61
  readCapped,
62
62
  runWaitOperation
63
- } from "../index-t9rhjr9f.js";
63
+ } from "../index-f1nb70ae.js";
64
64
  import"../index-sbdmyz75.js";
65
65
  import {
66
66
  collectToolSurface
@@ -1336,16 +1336,52 @@ async function pollUntilDone(params) {
1336
1336
 
1337
1337
  // src/tools/cli/io.ts
1338
1338
  import { writeSync } from "node:fs";
1339
- async function readPipedStdin() {
1340
- if (process.stdin.isTTY)
1341
- return null;
1342
- const chunks = [];
1343
- for await (const chunk of process.stdin) {
1344
- chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
1345
- }
1346
- const text = Buffer.concat(chunks).toString("utf8").trim();
1347
- return text.length > 0 ? text : null;
1339
+
1340
+ // src/tools/cli/stdin.ts
1341
+ function readPipedStdin(input = process.stdin) {
1342
+ if (input.isTTY || input.readableEnded)
1343
+ return Promise.resolve(null);
1344
+ if (input.destroyed)
1345
+ return Promise.reject(new Error("stdin closed before EOF"));
1346
+ return new Promise((resolve, reject) => {
1347
+ const chunks = [];
1348
+ const cleanup = () => {
1349
+ clearTimeout(timer);
1350
+ input.pause();
1351
+ input.off("data", onData);
1352
+ input.off("end", onEnd);
1353
+ input.off("error", onError);
1354
+ input.off("close", onClose);
1355
+ };
1356
+ const onData = (chunk) => {
1357
+ if (chunk.length === 0)
1358
+ return;
1359
+ clearTimeout(timer);
1360
+ chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
1361
+ };
1362
+ const onEnd = () => {
1363
+ cleanup();
1364
+ const text = Buffer.concat(chunks).toString("utf8").trim();
1365
+ resolve(text.length > 0 ? text : null);
1366
+ };
1367
+ const onError = (error) => {
1368
+ cleanup();
1369
+ reject(error);
1370
+ };
1371
+ const onClose = () => onError(new Error("stdin closed before EOF"));
1372
+ const timer = setTimeout(() => {
1373
+ cleanup();
1374
+ resolve(null);
1375
+ }, 250);
1376
+ input.on("end", onEnd);
1377
+ input.on("error", onError);
1378
+ input.on("close", onClose);
1379
+ input.on("data", onData);
1380
+ input.resume();
1381
+ });
1348
1382
  }
1383
+
1384
+ // src/tools/cli/io.ts
1349
1385
  function createCliIo(config) {
1350
1386
  let pendingWrite;
1351
1387
  let writeFailed = false;
@@ -84,7 +84,11 @@ export interface CliConfig<TAuth = unknown, TContext extends Record<string, unkn
84
84
  stderr?: (text: string) => void;
85
85
  /** Exit hook — default `process.exit`; injectable for tests. */
86
86
  exit?: (code: number) => void;
87
- /** Read piped stdin — default reads when not a TTY; injectable for tests. */
87
+ /**
88
+ * Read stdin for the first required unset field. The default skips TTYs,
89
+ * waits up to 250 ms for the first byte, then reads to EOF without a deadline.
90
+ * Override to explicitly wait for a delayed producer; no probe wraps this hook.
91
+ */
88
92
  stdin?: () => Promise<string | null>;
89
93
  }
90
94
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,WAAW,SAAS,CACxB,KAAK,GAAG,OAAO,EACf,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,SAAS,GAAG,SAAS,CACtC,SAAQ,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC;IACnD,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,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,IAAI,CAAC;IAChC,gEAAgE;IAChE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/io.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAa1C,yFAAyF;AACzF,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACzC;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,GAC9D,KAAK,CAqEP"}
1
+ {"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/io.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,yFAAyF;AACzF,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACzC;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,GAC9D,KAAK,CAqEP"}
@@ -0,0 +1,6 @@
1
+ import type { Readable } from 'node:stream';
2
+ /** Probe automatic stdin routing briefly; once data starts, only EOF completes it. */
3
+ export declare function readPipedStdin(input?: Readable & {
4
+ isTTY?: boolean;
5
+ }): Promise<string | null>;
6
+ //# sourceMappingURL=stdin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdin.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/stdin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,sFAAsF;AACtF,wBAAgB,cAAc,CAC5B,KAAK,GAAE,QAAQ,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAkB,GACpD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAwCxB"}
package/llms/cli.txt CHANGED
@@ -205,6 +205,21 @@ fields in declaration order, so `myapp generate "a fox"` is
205
205
  `--prompt "a fox"`. A piped value fills the first required unset field:
206
206
  `echo "a fox" | myapp generate`.
207
207
 
208
+ Automatic stdin routing skips TTYs and waits at most **250 ms for the first byte**.
209
+ An empty open pipe or EOF without data leaves the field unset, so normal schema
210
+ validation reports the missing field instead of waiting indefinitely. Once any
211
+ byte arrives, the reader collects the entire stream until EOF, including chunks
212
+ separated by long pauses; it decodes UTF-8 after collecting all bytes and trims
213
+ surrounding whitespace. Read errors or a close before EOF fail the invocation.
214
+ Explicit arguments and commands without required unset fields never read stdin.
215
+
216
+ A producer that takes longer than 250 ms to start must supply its value as an
217
+ argument (for example, `myapp generate --prompt "$(slow-producer)"`) or the
218
+ application must provide an explicit `CliConfig.stdin` reader that waits for it.
219
+ That hook is not wrapped in the availability timeout. `-` remains literal data,
220
+ not a special stdin marker. JSONL stream/batch commands own their input and wait
221
+ for lines as usual; MCP/serve and long-running handlers have no new deadline.
222
+
208
223
  A token is an option only when it is a long form (`--name`, `--name=value`,
209
224
  `--`) or `-` followed by a letter. Anything else that starts with `-` is data:
210
225
  `myapp note a "- item"` fills a positional, and after an option that expects a
@@ -77,11 +77,11 @@ own, recorded as an ADR.
77
77
  | `stitchkit/geo` | server (Bun or Node) | evolving | managed GeoIP reader generations, last-known-good reload and the optional MaxMind adapter |
78
78
  | `stitchkit/oauth` | browser **and** server | evolving | provider-neutral Authorization Code + PKCE request and one-shot callback transaction mechanics |
79
79
  | `stitchkit/google` | server (Bun or Node) | evolving | optional Google code exchange and verified OIDC identity adapter |
80
- | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 42 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
80
+ | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 43 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
81
81
  | `stitchkit/testing` | tests on Bun or Node | stable | in-process generated clients over a real Fetch handler, plus the managed-resource conformance kit |
82
82
  | `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
83
83
  | `stitchkit/react` | browser + server rendering | stable | `createCursorQuery`, `createCacheBridge`, QueryClient and `ApiError` retry policy |
84
- | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 22 of the 42 minors since 0.56.2, most recently 0.97.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
84
+ | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 22 of the 43 minors since 0.56.2, most recently 0.97.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
85
85
  | `stitchkit/agent-runtime/sandbox` | server | evolving | optional Linux Bubblewrap sessions, durable workspaces and a host HTTP credential gateway; see [sandbox guide](sandbox.md) |
86
86
  | `stitchkit/agent-runtime/testing` | tests on Bun or Node | evolving | credential-free replay, scripted provider faults, deterministic race controls and the agent-store conformance kit |
87
87
  | `stitchkit/agent-runtime/harness` | server | evolving | resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
@@ -91,7 +91,7 @@ own, recorded as an ADR.
91
91
  | `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving | durable built-in SQLite store for the agent runtime |
92
92
  | `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving | durable built-in SQLite store for the agent runtime |
93
93
  | `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
94
- | `stitchkit/application` | browser + server | evolving<br>_redefined in 9 of the 42 minors since 0.56.2, most recently 0.96.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
94
+ | `stitchkit/application` | browser + server | evolving<br>_redefined in 9 of the 43 minors since 0.56.2, most recently 0.96.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
95
95
  | `stitchkit/application/grammy` | server | evolving | a grammY bot as application resources — configuration, then polling with updates admitted by batch — and the webhook adapter |
96
96
  | `stitchkit/application/opentelemetry` | server | evolving | maps application snapshots onto an injected OpenTelemetry `Meter` |
97
97
  | `stitchkit/application/schemas` | browser + server | evolving | the application's snapshot, health and shutdown schemas alone, without the kernel |
@@ -1,14 +1,39 @@
1
- # Upgrading 0.72.0 → 0.97.0 — stitchkit docs slice
1
+ # Upgrading 0.72.0 → 0.98.0 — stitchkit docs slice
2
2
 
3
3
  > Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
4
4
  > `llms.txt` in this package.
5
5
 
6
- Contains: Guide: Upgrading, 0.72.0 → 0.97.0 (docs/guide/upgrading.md)
6
+ Contains: Guide: Upgrading, 0.72.0 → 0.98.0 (docs/guide/upgrading.md)
7
7
 
8
8
  ==============================================================================
9
- # Guide: Upgrading, 0.72.0 → 0.97.0 (docs/guide/upgrading.md)
9
+ # Guide: Upgrading, 0.72.0 → 0.98.0 (docs/guide/upgrading.md)
10
10
  ==============================================================================
11
11
 
12
+ ## Released migration: 0.98.0
13
+
14
+ ### automatic stdin availability
15
+
16
+ **Who must act:** CLI applications or scripts relying on automatic stdin routing
17
+ from a producer that can take more than 250 ms to write its first byte.
18
+
19
+ Automatic routing now probes for the first byte for 250 ms. An empty open pipe
20
+ leaves the required field unset and normal validation reports its name. Once
21
+ data arrives, the entire stream is read until EOF without a total deadline.
22
+
23
+ ```sh
24
+ # before: may now fail if the producer starts late
25
+ slow-producer | myapp generate
26
+ # after: provide the value explicitly after the producer completes
27
+ myapp generate --prompt "$(slow-producer)"
28
+ ```
29
+
30
+ For large input that should stay in a pipe, supply a `CliConfig.stdin` reader
31
+ that waits for the producer and EOF; this existing hook is not wrapped in the
32
+ availability probe. A custom reader owns its limits and error handling.
33
+ `-` remains literal data. TTY and empty EOF produce ordinary validation errors;
34
+ explicit arguments skip stdin. JSONL stream/batch commands, MCP/serve and
35
+ long-running handlers have no new deadline. See ADR 0203.
36
+
12
37
  ## Released migration: 0.97.0
13
38
 
14
39
  ### schedule delivery
@@ -11,7 +11,7 @@ Contains: Guide: Upgrading, general (docs/guide/upgrading.md)
11
11
 
12
12
  Load this slice, then every range slice between your installed version and the target:
13
13
 
14
- - 0.72.0 → 0.97.0: `llms/upgrading-0.72.0-0.97.0.txt`
14
+ - 0.72.0 → 0.98.0: `llms/upgrading-0.72.0-0.98.0.txt`
15
15
  - 0.59.0 → 0.71.0: `llms/upgrading-0.59.0-0.71.0.txt`
16
16
  - 0.37.0 → 0.58.0: `llms/upgrading-0.37.0-0.58.0.txt`
17
17
 
package/llms-full.txt CHANGED
@@ -68,11 +68,11 @@ own, recorded as an ADR.
68
68
  | `stitchkit/geo` | server (Bun or Node) | evolving | managed GeoIP reader generations, last-known-good reload and the optional MaxMind adapter |
69
69
  | `stitchkit/oauth` | browser **and** server | evolving | provider-neutral Authorization Code + PKCE request and one-shot callback transaction mechanics |
70
70
  | `stitchkit/google` | server (Bun or Node) | evolving | optional Google code exchange and verified OIDC identity adapter |
71
- | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 42 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
71
+ | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 43 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
72
72
  | `stitchkit/testing` | tests on Bun or Node | stable | in-process generated clients over a real Fetch handler, plus the managed-resource conformance kit |
73
73
  | `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
74
74
  | `stitchkit/react` | browser + server rendering | stable | `createCursorQuery`, `createCacheBridge`, QueryClient and `ApiError` retry policy |
75
- | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 22 of the 42 minors since 0.56.2, most recently 0.97.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
75
+ | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 22 of the 43 minors since 0.56.2, most recently 0.97.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
76
76
  | `stitchkit/agent-runtime/sandbox` | server | evolving | optional Linux Bubblewrap sessions, durable workspaces and a host HTTP credential gateway; see [sandbox guide](sandbox.md) |
77
77
  | `stitchkit/agent-runtime/testing` | tests on Bun or Node | evolving | credential-free replay, scripted provider faults, deterministic race controls and the agent-store conformance kit |
78
78
  | `stitchkit/agent-runtime/harness` | server | evolving | resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
@@ -82,7 +82,7 @@ own, recorded as an ADR.
82
82
  | `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving | durable built-in SQLite store for the agent runtime |
83
83
  | `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving | durable built-in SQLite store for the agent runtime |
84
84
  | `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
85
- | `stitchkit/application` | browser + server | evolving<br>_redefined in 9 of the 42 minors since 0.56.2, most recently 0.96.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
85
+ | `stitchkit/application` | browser + server | evolving<br>_redefined in 9 of the 43 minors since 0.56.2, most recently 0.96.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
86
86
  | `stitchkit/application/grammy` | server | evolving | a grammY bot as application resources — configuration, then polling with updates admitted by batch — and the webhook adapter |
87
87
  | `stitchkit/application/opentelemetry` | server | evolving | maps application snapshots onto an injected OpenTelemetry `Meter` |
88
88
  | `stitchkit/application/schemas` | browser + server | evolving | the application's snapshot, health and shutdown schemas alone, without the kernel |
@@ -7953,6 +7953,21 @@ fields in declaration order, so `myapp generate "a fox"` is
7953
7953
  `--prompt "a fox"`. A piped value fills the first required unset field:
7954
7954
  `echo "a fox" | myapp generate`.
7955
7955
 
7956
+ Automatic stdin routing skips TTYs and waits at most **250 ms for the first byte**.
7957
+ An empty open pipe or EOF without data leaves the field unset, so normal schema
7958
+ validation reports the missing field instead of waiting indefinitely. Once any
7959
+ byte arrives, the reader collects the entire stream until EOF, including chunks
7960
+ separated by long pauses; it decodes UTF-8 after collecting all bytes and trims
7961
+ surrounding whitespace. Read errors or a close before EOF fail the invocation.
7962
+ Explicit arguments and commands without required unset fields never read stdin.
7963
+
7964
+ A producer that takes longer than 250 ms to start must supply its value as an
7965
+ argument (for example, `myapp generate --prompt "$(slow-producer)"`) or the
7966
+ application must provide an explicit `CliConfig.stdin` reader that waits for it.
7967
+ That hook is not wrapped in the availability timeout. `-` remains literal data,
7968
+ not a special stdin marker. JSONL stream/batch commands own their input and wait
7969
+ for lines as usual; MCP/serve and long-running handlers have no new deadline.
7970
+
7956
7971
  A token is an option only when it is a long form (`--name`, `--name=value`,
7957
7972
  `--`) or `-` followed by a letter. Anything else that starts with `-` is data:
7958
7973
  `myapp note a "- item"` fills a positional, and after an option that expects a
@@ -13019,6 +13034,31 @@ analytics policy belong to the application.
13019
13034
 
13020
13035
  # Upgrading stitchkit
13021
13036
 
13037
+ ## Released migration: 0.98.0
13038
+
13039
+ ### automatic stdin availability
13040
+
13041
+ **Who must act:** CLI applications or scripts relying on automatic stdin routing
13042
+ from a producer that can take more than 250 ms to write its first byte.
13043
+
13044
+ Automatic routing now probes for the first byte for 250 ms. An empty open pipe
13045
+ leaves the required field unset and normal validation reports its name. Once
13046
+ data arrives, the entire stream is read until EOF without a total deadline.
13047
+
13048
+ ```sh
13049
+ # before: may now fail if the producer starts late
13050
+ slow-producer | myapp generate
13051
+ # after: provide the value explicitly after the producer completes
13052
+ myapp generate --prompt "$(slow-producer)"
13053
+ ```
13054
+
13055
+ For large input that should stay in a pipe, supply a `CliConfig.stdin` reader
13056
+ that waits for the producer and EOF; this existing hook is not wrapped in the
13057
+ availability probe. A custom reader owns its limits and error handling.
13058
+ `-` remains literal data. TTY and empty EOF produce ordinary validation errors;
13059
+ explicit arguments skip stdin. JSONL stream/batch commands, MCP/serve and
13060
+ long-running handlers have no new deadline. See ADR 0203.
13061
+
13022
13062
  ## Released migration: 0.97.0
13023
13063
 
13024
13064
  ### schedule delivery
package/llms.txt CHANGED
@@ -16,7 +16,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
16
16
  - **stitchkit/tools/contract**: [llms/tools-contract.txt](llms/tools-contract.txt) 0.2 KB
17
17
  - **stitchkit/tools/invoker**: [llms/tools-invoker.txt](llms/tools-invoker.txt) 0.2 KB
18
18
  - **stitchkit/tools/connections**: [llms/tools-connections.txt](llms/tools-connections.txt) 3.1 KB
19
- - **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 41.3 KB → [llms/cli.2.txt](llms/cli.2.txt) 8.1 KB
19
+ - **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 42.3 KB → [llms/cli.2.txt](llms/cli.2.txt) 8.1 KB
20
20
  - **stitchkit/remote**: [llms/remote.txt](llms/remote.txt) 1.0 KB
21
21
  - **stitchkit/contract**: [llms/contract.txt](llms/contract.txt) 31.9 KB
22
22
  - **stitchkit/primitives**: [llms/primitives.txt](llms/primitives.txt) 9.3 KB
@@ -52,7 +52,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
52
52
 
53
53
  ## Upgrading slices
54
54
  - **Upgrading — how to move across versions**: [llms/upgrading.txt](llms/upgrading.txt) 10.3 KB
55
- - **Upgrading 0.72.0 → 0.97.0**: [llms/upgrading-0.72.0-0.97.0.txt](llms/upgrading-0.72.0-0.97.0.txt) 43.8 KB
55
+ - **Upgrading 0.72.0 → 0.98.0**: [llms/upgrading-0.72.0-0.98.0.txt](llms/upgrading-0.72.0-0.98.0.txt) 44.8 KB
56
56
  - **Upgrading 0.59.0 → 0.71.0**: [llms/upgrading-0.59.0-0.71.0.txt](llms/upgrading-0.59.0-0.71.0.txt) 45.6 KB
57
57
  - **Upgrading 0.37.0 → 0.58.0**: [llms/upgrading-0.37.0-0.58.0.txt](llms/upgrading-0.37.0-0.58.0.txt) 40.0 KB
58
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.97.0",
3
+ "version": "0.98.0",
4
4
  "description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
5
5
  "keywords": [
6
6
  "bun",