stitchkit 0.102.0 → 0.103.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/application/diagnostic-journal-contract.d.ts +46 -7
  3. package/dist/application/diagnostic-journal-contract.d.ts.map +1 -1
  4. package/dist/application/diagnostic-journal-frame.d.ts +9 -0
  5. package/dist/application/diagnostic-journal-frame.d.ts.map +1 -0
  6. package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
  7. package/dist/application/diagnostic-journal-read-contract.d.ts +110 -0
  8. package/dist/application/diagnostic-journal-read-contract.d.ts.map +1 -0
  9. package/dist/application/diagnostic-journal-reader.d.ts +13 -0
  10. package/dist/application/diagnostic-journal-reader.d.ts.map +1 -0
  11. package/dist/application/diagnostic-journal-recovery.d.ts +4 -0
  12. package/dist/application/diagnostic-journal-recovery.d.ts.map +1 -0
  13. package/dist/application/diagnostic-journal-storage.d.ts +2 -0
  14. package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
  15. package/dist/entrypoints/application/diagnostic-journal.d.ts +1 -0
  16. package/dist/entrypoints/application/diagnostic-journal.d.ts.map +1 -1
  17. package/dist/entrypoints/application/diagnostic-journal.js +213 -19
  18. package/dist/entrypoints/application.d.ts +1 -0
  19. package/dist/entrypoints/application.d.ts.map +1 -1
  20. package/dist/entrypoints/application.js +10 -2
  21. package/dist/index-z94wht4y.js +156 -0
  22. package/llms/application-diagnostic-journal.txt +2 -0
  23. package/llms/application.2.txt +157 -267
  24. package/llms/application.3.txt +278 -0
  25. package/llms/application.txt +43 -158
  26. package/llms/stitchkit.txt +4 -4
  27. package/llms/{upgrading-0.75.0-0.102.0.txt → upgrading-0.75.0-0.103.0.txt} +32 -3
  28. package/llms/upgrading.txt +1 -1
  29. package/llms-full.txt +80 -8
  30. package/llms.txt +4 -4
  31. package/package.json +1 -1
  32. package/dist/index-h124epcf.js +0 -103
package/llms-full.txt CHANGED
@@ -70,12 +70,12 @@ own, recorded as an ADR.
70
70
  | `stitchkit/geo` | server (Bun or Node) | evolving | managed GeoIP reader generations, last-known-good reload and the optional MaxMind adapter |
71
71
  | `stitchkit/oauth` | browser **and** server | evolving | provider-neutral Authorization Code + PKCE request and one-shot callback transaction mechanics |
72
72
  | `stitchkit/google` | server (Bun or Node) | evolving | optional Google code exchange and verified OIDC identity adapter |
73
- | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 47 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
73
+ | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 48 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
74
74
  | `stitchkit/testing` | tests on Bun or Node | stable | in-process generated clients over a real Fetch handler, plus the managed-resource conformance kit |
75
75
  | `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
76
76
  | `stitchkit/react` | browser + server rendering | stable | `createCursorQuery`, `createCacheBridge`, QueryClient and `ApiError` retry policy |
77
77
  | `stitchkit/react/keyboard` | browser | evolving | which part of a screen gets a key — ordered layers, one Escape per level, list zones with real focus; see [keyboard guide](keyboard.md) |
78
- | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 22 of the 47 minors since 0.56.2, most recently 0.97.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
78
+ | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 22 of the 48 minors since 0.56.2, most recently 0.97.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
79
79
  | `stitchkit/agent-runtime/sandbox` | server | evolving | optional Linux Bubblewrap sessions, durable workspaces and a host HTTP credential gateway; see [sandbox guide](sandbox.md) |
80
80
  | `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 |
81
81
  | `stitchkit/agent-runtime/harness` | server | evolving | resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
@@ -85,11 +85,11 @@ own, recorded as an ADR.
85
85
  | `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving | durable built-in SQLite store for the agent runtime |
86
86
  | `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving | durable built-in SQLite store for the agent runtime |
87
87
  | `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
88
- | `stitchkit/application` | browser + server | evolving<br>_redefined in 10 of the 47 minors since 0.56.2, most recently 0.100.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
88
+ | `stitchkit/application` | browser + server | evolving<br>_redefined in 11 of the 48 minors since 0.56.2, most recently 0.103.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
89
89
  | `stitchkit/application/grammy` | server | evolving | a grammY bot as application resources — configuration, then polling with updates admitted by batch — and the webhook adapter |
90
90
  | `stitchkit/application/opentelemetry` | server | evolving | maps application snapshots onto an injected OpenTelemetry `Meter` |
91
91
  | `stitchkit/application/schemas` | browser + server | evolving | the application's snapshot, health and shutdown schemas alone, without the kernel |
92
- | `stitchkit/application/diagnostic-journal` | server | evolving | the local diagnostic journal — the one part of the kernel that spawns, locks and writes files |
92
+ | `stitchkit/application/diagnostic-journal` | server | evolving | the local diagnostic journal — an exclusive bounded writer and snapshot reader with explicit anomalies |
93
93
  | `stitchkit/application/directory-inbox` | server | evolving | the directory inbox — entries another program drops into a directory, delivered to the application at least once |
94
94
 
95
95
  Rule of thumb: browser code imports `stitchkit` and `stitchkit/react`; server
@@ -6622,7 +6622,7 @@ description: Compose process-local resources, schedules, readiness, drain and op
6622
6622
  type: architecture
6623
6623
  status: active
6624
6624
  created: 2026-08-23
6625
- updated: 2026-09-04 14:11 +07:00
6625
+ updated: 2026-09-30 17:41 +07:00
6626
6626
  ---
6627
6627
 
6628
6628
  # Managed application kernel
@@ -7269,10 +7269,47 @@ short-lived reclaim guard.
7269
7269
 
7270
7270
  `flush()` means every accepted append through that call's boundary settled. It is not `fsync`, a
7271
7271
  durable receipt, exactly-once execution or remote delivery. Timeout/cancellation bound only the
7272
- waiter; the writer retains physical capacity until settlement. There is no reader or upload API.
7273
- Use a durable application store or deployment-owned log collector when restart recovery, replay or
7272
+ waiter; the writer retains physical capacity until settlement. There is no upload or managed replay API.
7273
+ Use a durable application store or deployment-owned log collector when durable restart recovery, replay or
7274
7274
  aggregation is required. → [ADR 0134](../decisions/0134-diagnostic-journal-is-bounded-local-evidence.md).
7275
7275
 
7276
+ For finite inspection, use the shared reader with an explicit oldest-to-newest list of existing
7277
+ files. Keep anomaly reporting outside the journal being inspected:
7278
+
7279
+ ```ts
7280
+ import { readDiagnosticJournal } from 'stitchkit/application/diagnostic-journal'
7281
+ import { z } from 'zod'
7282
+
7283
+ const eventSchema = z.object({
7284
+ kind: z.enum(['resource_failed', 'recovery_started']),
7285
+ resource: z.string().max(80),
7286
+ }).strict()
7287
+
7288
+ for await (const row of readDiagnosticJournal({
7289
+ paths: ['/var/lib/example/diagnostic.jsonl.1', '/var/lib/example/diagnostic.jsonl'],
7290
+ eventSchema,
7291
+ maxLineBytes: 4 * 1024,
7292
+ })) {
7293
+ if (row.type === 'anomaly') internalLogger.warn(row.anomaly)
7294
+ else inspectEvent(row.frame.event)
7295
+ }
7296
+ ```
7297
+
7298
+ The reader bounds memory by line size plus a fixed chunk, skips oversized/damaged rows with
7299
+ explicit anomalies, and still returns valid rows before and after them. `offset` is zero-based
7300
+ bytes; `line` is one-based. `position` distinguishes the file's tail from interior damage.
7301
+ A valid frame lacking its final LF yields a warning with `skippedBytes: 0` and its frame.
7302
+ Each file's size is captured at open; concurrent appends are excluded. Missing files, permissions,
7303
+ symlinks, non-regular files and mid-read truncation throw rather than masquerading as bad data.
7304
+ The caller owns file selection and coordination with an active rotator.
7305
+
7306
+ Writer startup inspects retained and active files under its lock. On damage,
7307
+ `journal.getStatus().recovery` contains counts and first/last anomaly locations, reconstructed
7308
+ again on restart from the preserved bytes. This describes startup observations, not live
7309
+ continuous inspection. `maxFiles: 1` cannot preserve a torn active file by rotation and throws
7310
+ `DiagnosticJournalRecoveryError` before removing any evidence; configure at least two slots.
7311
+ Normal rotation retains the existing finite eviction policy. → [ADR 0219](../decisions/0219-journal-damage-is-data-and-io-failure-is-failure.md).
7312
+
7276
7313
  Shutdown performs one phase barrier at a time: stop admission everywhere,
7277
7314
  cancel future schedules, drain admitted work, then close in reverse stable
7278
7315
  topological order. Every hook shares the same grace deadline. Forced cleanup
@@ -14238,6 +14275,35 @@ analytics policy belong to the application.
14238
14275
 
14239
14276
  # Upgrading stitchkit
14240
14277
 
14278
+ ## Released migration: 0.103.0
14279
+
14280
+ ### Diagnostic journal startup preserves torn evidence and inspects archives
14281
+
14282
+ **Who must act:** operators using `maxFiles: 1` who can encounter a torn active
14283
+ file, or whose retained files are unreadable by the writer. Clean single-file
14284
+ journals continue to work; successful startup now requires read access to every
14285
+ retained generation.
14286
+
14287
+ ```ts
14288
+ import { createDiagnosticJournal } from 'stitchkit/application/diagnostic-journal'
14289
+
14290
+ // Before: a torn active file could be discarded during startup.
14291
+ await createDiagnosticJournal({ ...config, limits: { ...config.limits, maxFiles: 1 } })
14292
+ // After: retain the torn file while the fresh writer starts in a new active file.
14293
+ await createDiagnosticJournal({ ...config, limits: { ...config.limits, maxFiles: 2 } })
14294
+ ```
14295
+
14296
+ With single-file retention, a torn active file throws `DiagnosticJournalRecoveryError`
14297
+ from `stitchkit/application`, carrying `recovery` observations and releasing its lock
14298
+ without deleting evidence. Inspection I/O errors also fail startup and release the
14299
+ lock; restore filesystem access rather than treating that failure as a bad JSON row.
14300
+ Normal rotation retains the configured finite eviction policy.
14301
+
14302
+ For archive inspection, replace ad hoc line parsing with `readDiagnosticJournal`
14303
+ from the same filesystem leaf. Handle its `frame | anomaly` stream explicitly;
14304
+ missing files, permissions and unsafe paths still throw. See the
14305
+ [journal guide](application-kernel.md#bounded-local-diagnostic-journal).
14306
+
14241
14307
  ## Released migration: 0.102.0
14242
14308
 
14243
14309
  ### `view_file` receives an array, not an array encoded as text
@@ -18916,9 +18982,13 @@ cutovers are covered by the executable
18916
18982
  | `DiagnosticJournalRefusalReasonSchema` / `DiagnosticJournalRefusalReason` | schema / _type_ | `closed \| failed \| invalid \| oversized \| item-capacity \| byte-capacity` |
18917
18983
  | `DiagnosticJournalFailurePhaseSchema` / `DiagnosticJournalFailurePhase` | schema / _type_ | internal `write \| rotation \| close` failure phase exposed only to status and the isolated observer |
18918
18984
  | `DiagnosticJournalWaitOptions` / `DiagnosticJournalFailure` | _type_ | caller wait signal/timeout and isolated internal failure callback record |
18985
+ | `DiagnosticJournalAnomalySchema` / `DiagnosticJournalAnomaly` | schema / _type_ | corrupt-row reason, file, zero-based byte offset, one-based line, tail/interior position and skipped bytes |
18986
+ | `createDiagnosticJournalReadResultSchema` / `DiagnosticJournalReadResult` | function / _type_ | owner-schema frame output or explicit anomaly; retains transformed event output types |
18987
+ | `DiagnosticJournalRecoveryStatusSchema` / `DiagnosticJournalRecoveryStatus` | schema / _type_ | bounded startup inspection counts and first/last anomaly locations |
18988
+ | `DiagnosticJournalRecoveryError` | class | torn single-file startup refusal carrying recovery observations, preserving evidence and releasing its lock |
18919
18989
 
18920
18990
  `accepted` is bounded in-memory admission and `written` is completed append, not `fsync` or durable
18921
- delivery. The journal has no reader/replay/upload API. See the
18991
+ delivery. Its filesystem reader is in the diagnostic-journal leaf; there is no managed replay/upload API. See the
18922
18992
  [guide](../guide/application-kernel.md#bounded-local-diagnostic-journal),
18923
18993
  [architecture](../architecture/diagnostic-journal.md) and [ADR
18924
18994
  0134](../decisions/0134-diagnostic-journal-is-bounded-local-evidence.md).
@@ -19093,6 +19163,8 @@ snapshots; the adapter owns no SDK lifecycle, polling or delta state.
19093
19163
  | Export | Kind | Summary |
19094
19164
  |--------|------|---------|
19095
19165
  | `createDiagnosticJournal` | function | the bounded local journal: a file lock, a spawn to diagnose a stale one, and framed writes |
19166
+ | `readDiagnosticJournal` | function | bounded async stream of validated frames and explicit anomalies from finite snapshots of caller-selected files; I/O failures throw |
19167
+ | `DiagnosticJournalReaderConfig` | _type_ | normalized absolute `paths`, owner `eventSchema`, positive safe-integer `maxLineBytes` and optional cancellation `signal` |
19096
19168
 
19097
19169
  Its own entrypoint because of what it reaches — `node:child_process`,
19098
19170
  `node:fs`, `node:os`, `node:util` — with `promisify(execFile)` evaluated while
package/llms.txt CHANGED
@@ -9,7 +9,7 @@ Build with stitchkit: define a contract once, then `implement` it and serve it (
9
9
  Load the slice for each entrypoint your code imports — `import … from 'stitchkit/server'` → `llms/server.txt`; the root `stitchkit` import → `llms/stitchkit.txt`. A slice holds that entrypoint's API reference section and the guide pages whose home it is; every guide lives in exactly one slice, and a slice that needs another's guide names it under "Also read". Each file is at most 50.0 KB; a longer one continues in numbered parts, each naming the next at its top. Moving across versions: load `llms/upgrading.txt` and the range slices it lists between your version and the target. `llms-full.txt` inlines everything; it is far larger than a context window, so do not read it whole.
10
10
 
11
11
  ## Entrypoint slices
12
- - **stitchkit**: [llms/stitchkit.txt](llms/stitchkit.txt) 16.5 KB → [llms/stitchkit.2.txt](llms/stitchkit.2.txt) 45.2 KB → [llms/stitchkit.3.txt](llms/stitchkit.3.txt) 17.1 KB
12
+ - **stitchkit**: [llms/stitchkit.txt](llms/stitchkit.txt) 16.6 KB → [llms/stitchkit.2.txt](llms/stitchkit.2.txt) 45.2 KB → [llms/stitchkit.3.txt](llms/stitchkit.3.txt) 17.1 KB
13
13
  - **stitchkit/live**: [llms/live.txt](llms/live.txt) 21.6 KB
14
14
  - **stitchkit/react**: [llms/react.txt](llms/react.txt) 9.0 KB
15
15
  - **stitchkit/react/keyboard**: [llms/react-keyboard.txt](llms/react-keyboard.txt) 9.4 KB
@@ -31,11 +31,11 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
31
31
  - **stitchkit/agent-runtime/openrouter**: [llms/agent-runtime-openrouter.txt](llms/agent-runtime-openrouter.txt) 1.1 KB
32
32
  - **stitchkit/agent-runtime/sqlite/bun**: [llms/agent-runtime-sqlite-bun.txt](llms/agent-runtime-sqlite-bun.txt) 1.8 KB
33
33
  - **stitchkit/agent-runtime/sqlite/node**: [llms/agent-runtime-sqlite-node.txt](llms/agent-runtime-sqlite-node.txt) 1.7 KB
34
- - **stitchkit/application**: [llms/application.txt](llms/application.txt) 46.0 KB → [llms/application.2.txt](llms/application.2.txt) 40.0 KB
34
+ - **stitchkit/application**: [llms/application.txt](llms/application.txt) 37.9 KB → [llms/application.2.txt](llms/application.2.txt) 24.1 KB → [llms/application.3.txt](llms/application.3.txt) 27.3 KB
35
35
  - **stitchkit/application/grammy**: [llms/application-grammy.txt](llms/application-grammy.txt) 2.3 KB
36
36
  - **stitchkit/application/opentelemetry**: [llms/application-opentelemetry.txt](llms/application-opentelemetry.txt) 1.6 KB
37
37
  - **stitchkit/application/directory-inbox**: [llms/application-directory-inbox.txt](llms/application-directory-inbox.txt) 0.3 KB
38
- - **stitchkit/application/diagnostic-journal**: [llms/application-diagnostic-journal.txt](llms/application-diagnostic-journal.txt) 1.4 KB
38
+ - **stitchkit/application/diagnostic-journal**: [llms/application-diagnostic-journal.txt](llms/application-diagnostic-journal.txt) 1.8 KB
39
39
  - **stitchkit/application/schemas**: [llms/application-schemas.txt](llms/application-schemas.txt) 1.8 KB
40
40
  - **stitchkit/testing**: [llms/testing.txt](llms/testing.txt) 30.8 KB
41
41
  - **stitchkit/agent-runtime/sandbox**: [llms/agent-runtime-sandbox.txt](llms/agent-runtime-sandbox.txt) 8.1 KB
@@ -55,7 +55,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
55
55
 
56
56
  ## Upgrading slices
57
57
  - **Upgrading — how to move across versions**: [llms/upgrading.txt](llms/upgrading.txt) 10.3 KB
58
- - **Upgrading 0.75.0 → 0.102.0**: [llms/upgrading-0.75.0-0.102.0.txt](llms/upgrading-0.75.0-0.102.0.txt) 44.8 KB
58
+ - **Upgrading 0.75.0 → 0.103.0**: [llms/upgrading-0.75.0-0.103.0.txt](llms/upgrading-0.75.0-0.103.0.txt) 46.3 KB
59
59
  - **Upgrading 0.61.0 → 0.74.0**: [llms/upgrading-0.61.0-0.74.0.txt](llms/upgrading-0.61.0-0.74.0.txt) 43.5 KB
60
60
  - **Upgrading 0.44.0 → 0.60.0**: [llms/upgrading-0.44.0-0.60.0.txt](llms/upgrading-0.44.0-0.60.0.txt) 43.9 KB
61
61
  - **Upgrading 0.37.0 → 0.37.0**: [llms/upgrading-0.37.0.txt](llms/upgrading-0.37.0.txt) 6.2 KB
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.102.0",
3
+ "version": "0.103.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",
@@ -1,103 +0,0 @@
1
- import {
2
- isRecord
3
- } from "./index-9jfdm5tg.js";
4
-
5
- // src/application/diagnostic-journal-contract.ts
6
- import { z } from "zod";
7
- var PositiveSafeIntegerSchema = z.number().int().positive().safe();
8
- var FileModeSchema = z.number().int().min(0).max(511);
9
- var DiagnosticJournalLimitsSchema2 = z.object({
10
- maxEventBytes: PositiveSafeIntegerSchema,
11
- maxPendingItems: PositiveSafeIntegerSchema,
12
- maxPendingBytes: PositiveSafeIntegerSchema,
13
- maxFileBytes: PositiveSafeIntegerSchema,
14
- maxFiles: PositiveSafeIntegerSchema
15
- }).strict().readonly();
16
- var DiagnosticJournalLockPolicySchema2 = z.enum(["refuse", "reclaim-stale"]);
17
- var DiagnosticJournalStateSchema2 = z.enum(["open", "draining", "closed", "failed"]);
18
- var DiagnosticJournalRefusalReasonSchema2 = z.enum([
19
- "closed",
20
- "failed",
21
- "invalid",
22
- "oversized",
23
- "item-capacity",
24
- "byte-capacity"
25
- ]);
26
- var DiagnosticJournalRefusalCountersSchema = z.object({
27
- closed: z.number().int().nonnegative(),
28
- failed: z.number().int().nonnegative(),
29
- invalid: z.number().int().nonnegative(),
30
- oversized: z.number().int().nonnegative(),
31
- "item-capacity": z.number().int().nonnegative(),
32
- "byte-capacity": z.number().int().nonnegative()
33
- }).strict().readonly();
34
- var DiagnosticJournalFailurePhaseSchema2 = z.enum(["write", "rotation", "close"]);
35
- var DiagnosticJournalStatusSchema2 = z.object({
36
- state: DiagnosticJournalStateSchema2,
37
- epoch: z.uuid(),
38
- limits: DiagnosticJournalLimitsSchema2,
39
- lock: z.object({
40
- policy: DiagnosticJournalLockPolicySchema2,
41
- reclaimedStale: z.boolean()
42
- }).strict().readonly(),
43
- received: z.number().int().nonnegative(),
44
- accepted: z.number().int().nonnegative(),
45
- refused: z.number().int().nonnegative(),
46
- refusals: DiagnosticJournalRefusalCountersSchema,
47
- written: z.number().int().nonnegative(),
48
- failedRecords: z.number().int().nonnegative(),
49
- pendingItems: z.number().int().nonnegative(),
50
- pendingBytes: z.number().int().nonnegative(),
51
- inFlight: z.boolean(),
52
- rotations: z.number().int().nonnegative(),
53
- rotationFailures: z.number().int().nonnegative(),
54
- partialTails: z.number().int().nonnegative(),
55
- currentFileBytes: z.number().int().nonnegative(),
56
- retainedFiles: z.number().int().nonnegative(),
57
- lastAcceptedSequence: z.number().int().positive().optional(),
58
- lastWrittenSequence: z.number().int().positive().optional(),
59
- lastSettledSequence: z.number().int().positive().optional(),
60
- lastFailure: z.object({
61
- phase: DiagnosticJournalFailurePhaseSchema2,
62
- sequence: z.number().int().positive().optional()
63
- }).strict().readonly().optional()
64
- }).strict().readonly();
65
- var DiagnosticJournalSubmitResultSchema2 = z.discriminatedUnion("outcome", [
66
- z.object({
67
- outcome: z.literal("accepted"),
68
- epoch: z.uuid(),
69
- sequence: z.number().int().positive()
70
- }).strict().readonly(),
71
- z.object({
72
- outcome: z.literal("refused"),
73
- reason: DiagnosticJournalRefusalReasonSchema2
74
- }).strict().readonly()
75
- ]);
76
- var DiagnosticJournalWaitResultSchema2 = z.object({
77
- outcome: z.enum(["settled", "timed-out", "cancelled"]),
78
- state: DiagnosticJournalStateSchema2,
79
- throughSequence: z.number().int().nonnegative(),
80
- settledSequence: z.number().int().nonnegative()
81
- }).strict().readonly();
82
- var DiagnosticJournalCloseResultSchema2 = z.object({
83
- outcome: z.enum(["closed", "timed-out", "cancelled"]),
84
- state: DiagnosticJournalStateSchema2,
85
- pendingItems: z.number().int().nonnegative()
86
- }).strict().readonly();
87
- var DiagnosticJournalFrameSchema2 = z.object({
88
- schemaVersion: z.literal(1),
89
- epoch: z.uuid(),
90
- sequence: z.number().int().positive(),
91
- event: z.json()
92
- }).strict().readonly();
93
- function parseDiagnosticJournalMode(mode) {
94
- return FileModeSchema.parse(mode ?? 384);
95
- }
96
- function readDiagnosticJournalLockDiagnosis2(error) {
97
- if (!isRecord(error))
98
- return;
99
- const diagnosis = error.journalLock;
100
- return isRecord(diagnosis) ? diagnosis : undefined;
101
- }
102
-
103
- export { DiagnosticJournalLimitsSchema2, DiagnosticJournalLockPolicySchema2, DiagnosticJournalStateSchema2, DiagnosticJournalRefusalReasonSchema2, DiagnosticJournalFailurePhaseSchema2, DiagnosticJournalStatusSchema2, DiagnosticJournalSubmitResultSchema2, DiagnosticJournalWaitResultSchema2, DiagnosticJournalCloseResultSchema2, DiagnosticJournalFrameSchema2, parseDiagnosticJournalMode, readDiagnosticJournalLockDiagnosis2 };