stitchkit 0.122.2 → 0.123.1

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 (202) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/dist/browser/client.d.ts.map +1 -1
  3. package/dist/browser/contract-identity.d.ts +21 -0
  4. package/dist/browser/contract-identity.d.ts.map +1 -0
  5. package/dist/browser/unknown-operation.d.ts +3 -0
  6. package/dist/browser/unknown-operation.d.ts.map +1 -0
  7. package/dist/contract/define.d.ts +6 -2
  8. package/dist/contract/define.d.ts.map +1 -1
  9. package/dist/contract/endpoint-capabilities.d.ts.map +1 -1
  10. package/dist/contract/errors.d.ts +4 -0
  11. package/dist/contract/errors.d.ts.map +1 -1
  12. package/dist/contract/fingerprint.d.ts +51 -0
  13. package/dist/contract/fingerprint.d.ts.map +1 -0
  14. package/dist/contract/identity.d.ts +21 -0
  15. package/dist/contract/identity.d.ts.map +1 -0
  16. package/dist/contract/stream.d.ts +32 -0
  17. package/dist/contract/stream.d.ts.map +1 -1
  18. package/dist/entrypoints/agent-runtime/browser.js +2 -2
  19. package/dist/entrypoints/agent-runtime/coding-tools.js +11 -11
  20. package/dist/entrypoints/agent-runtime/harness.js +12 -12
  21. package/dist/entrypoints/agent-runtime/openrouter.js +1 -1
  22. package/dist/entrypoints/agent-runtime/realtime.js +2 -2
  23. package/dist/entrypoints/agent-runtime/sandbox.js +11 -11
  24. package/dist/entrypoints/agent-runtime/sqlite/bun.js +15 -15
  25. package/dist/entrypoints/agent-runtime/sqlite/node.js +15 -15
  26. package/dist/entrypoints/agent-runtime/testing.js +15 -15
  27. package/dist/entrypoints/agent-runtime.js +22 -22
  28. package/dist/entrypoints/application/diagnostic-journal.js +5 -5
  29. package/dist/entrypoints/application/directory-inbox.js +5 -5
  30. package/dist/entrypoints/application/grammy.js +1 -1
  31. package/dist/entrypoints/application.js +7 -7
  32. package/dist/entrypoints/cli/publish.js +5 -5
  33. package/dist/entrypoints/cli.d.ts +1 -1
  34. package/dist/entrypoints/cli.d.ts.map +1 -1
  35. package/dist/entrypoints/cli.js +20 -17
  36. package/dist/entrypoints/contract.d.ts +2 -0
  37. package/dist/entrypoints/contract.d.ts.map +1 -1
  38. package/dist/entrypoints/contract.js +11 -5
  39. package/dist/entrypoints/files/packaging.d.ts +1 -0
  40. package/dist/entrypoints/files/packaging.d.ts.map +1 -1
  41. package/dist/entrypoints/files/packaging.js +230 -61
  42. package/dist/entrypoints/files.js +5 -5
  43. package/dist/entrypoints/geo.js +3 -3
  44. package/dist/entrypoints/http.js +3 -3
  45. package/dist/entrypoints/index.d.ts +1 -0
  46. package/dist/entrypoints/index.d.ts.map +1 -1
  47. package/dist/entrypoints/index.js +45 -24
  48. package/dist/entrypoints/live.js +2 -2
  49. package/dist/entrypoints/node.js +11 -11
  50. package/dist/entrypoints/observability.js +4 -4
  51. package/dist/entrypoints/primitives.js +1 -1
  52. package/dist/entrypoints/process/owner-loss.js +2 -2
  53. package/dist/entrypoints/process.d.ts +6 -1
  54. package/dist/entrypoints/process.d.ts.map +1 -1
  55. package/dist/entrypoints/process.js +370 -9
  56. package/dist/entrypoints/react.js +2 -2
  57. package/dist/entrypoints/realtime.js +3 -3
  58. package/dist/entrypoints/remote.js +20 -10
  59. package/dist/entrypoints/server.d.ts +1 -0
  60. package/dist/entrypoints/server.d.ts.map +1 -1
  61. package/dist/entrypoints/server.js +56 -20
  62. package/dist/entrypoints/telegram/screens.js +4 -4
  63. package/dist/entrypoints/telegram.js +6 -6
  64. package/dist/entrypoints/testing.js +10 -10
  65. package/dist/entrypoints/tools/agent.js +9 -9
  66. package/dist/entrypoints/tools/connections.js +7 -7
  67. package/dist/entrypoints/tools/contract.js +1 -1
  68. package/dist/entrypoints/tools/invoker.js +7 -7
  69. package/dist/entrypoints/tools/mcp.js +9 -9
  70. package/dist/entrypoints/tools/toolkit.js +15 -14
  71. package/dist/entrypoints/tools.js +17 -17
  72. package/dist/entrypoints/tracking/contract.js +2 -2
  73. package/dist/entrypoints/tracking.js +1 -1
  74. package/dist/files/client-artifact.d.ts +75 -0
  75. package/dist/files/client-artifact.d.ts.map +1 -0
  76. package/dist/{index-am1h8c9v.js → index-0d3sm0m9.js} +5 -5
  77. package/dist/{index-72xtvcvr.js → index-0ndz5r8z.js} +1 -1
  78. package/dist/index-0v9xb8pz.js +66 -0
  79. package/dist/{index-qcn84byh.js → index-0w0hxp7n.js} +4 -0
  80. package/dist/{index-3za04re9.js → index-1c945ten.js} +1 -1
  81. package/dist/{index-r6v4mc67.js → index-1d7s7da0.js} +1 -1
  82. package/dist/{index-zsvzhjtk.js → index-20hn8pbh.js} +1 -1
  83. package/dist/{index-f6pw75e1.js → index-2x2ch0bt.js} +2 -2
  84. package/dist/{index-61hve0ez.js → index-303qne11.js} +1 -1
  85. package/dist/{index-g149e9pk.js → index-3bzk2645.js} +1 -1
  86. package/dist/index-45dyex0j.js +119 -0
  87. package/dist/{index-aqwg2dm5.js → index-6k47xdtt.js} +2 -2
  88. package/dist/{index-nwm3ww60.js → index-73dappvg.js} +1 -1
  89. package/dist/index-7q05ag0z.js +10 -0
  90. package/dist/{index-kz9734jc.js → index-96yjwwgf.js} +6 -5
  91. package/dist/{index-ff39f9dr.js → index-993vtv1w.js} +3 -3
  92. package/dist/{index-4jpykzvw.js → index-99nnsz39.js} +2 -2
  93. package/dist/{index-pfvde2fz.js → index-9ypczvpj.js} +1 -1
  94. package/dist/{index-qch1vcaa.js → index-a7ebd769.js} +2 -2
  95. package/dist/{index-98hv3sba.js → index-aw6kx2e6.js} +1 -1
  96. package/dist/{index-gq3fnq3f.js → index-bqzgaj57.js} +103 -16
  97. package/dist/{index-yj6saztf.js → index-bz9cmnqq.js} +96 -14
  98. package/dist/{index-gtx3eknx.js → index-chz7c830.js} +13 -9
  99. package/dist/{index-mtwh9hyp.js → index-cjzaj7ev.js} +1 -1
  100. package/dist/{index-6j15ktag.js → index-d9cg0gen.js} +1 -1
  101. package/dist/{index-sa99p98w.js → index-eabx6qjh.js} +3 -3
  102. package/dist/{index-8yxgcyt6.js → index-egg0yp2j.js} +1 -1
  103. package/dist/{index-h1j71dr1.js → index-enkc9pem.js} +1 -1
  104. package/dist/{index-aqmadanx.js → index-fa53vygr.js} +2 -2
  105. package/dist/{index-e6c2spsd.js → index-fpwbskp2.js} +1 -1
  106. package/dist/{index-m8a44e64.js → index-ftk3838x.js} +1 -1
  107. package/dist/{index-j95jp7ee.js → index-gdqawggb.js} +1 -1
  108. package/dist/{index-9dyd8xzf.js → index-hkw233vx.js} +2 -2
  109. package/dist/{index-9jfdm5tg.js → index-hkxgennw.js} +7 -1
  110. package/dist/{index-qaqxdbxf.js → index-j8rda9n6.js} +7 -7
  111. package/dist/{index-4tyt1qya.js → index-jc5xgkpk.js} +2 -2
  112. package/dist/{index-s9a0fjh3.js → index-kffm4r8w.js} +1 -1
  113. package/dist/{index-5w6t91ze.js → index-m8ddk770.js} +1 -1
  114. package/dist/{index-2fc1k9k2.js → index-mdyhr36s.js} +32 -122
  115. package/dist/{index-r7a7r7ha.js → index-mfntvj58.js} +6 -3
  116. package/dist/{index-k42ckyzx.js → index-ndjzbt2v.js} +2 -2
  117. package/dist/{index-ycqhyars.js → index-qc7tq0za.js} +3 -3
  118. package/dist/{index-9frf01t9.js → index-r0xr7y4m.js} +1 -1
  119. package/dist/{index-s3yxw6kt.js → index-s512scra.js} +9 -7
  120. package/dist/{index-1h2zv8rx.js → index-sqc6ezrb.js} +41 -1
  121. package/dist/{index-2bqf0a74.js → index-sqkttz7z.js} +1 -1
  122. package/dist/{index-rbzq0q16.js → index-t8jz0e20.js} +1 -1
  123. package/dist/{index-8ryydawp.js → index-tt3ej8r3.js} +1 -1
  124. package/dist/{index-x4p3kw1p.js → index-tynna0n4.js} +6 -6
  125. package/dist/{index-72r9k0av.js → index-v62cpkx3.js} +1 -1
  126. package/dist/{index-10rg78vf.js → index-v8xm2s9v.js} +2 -2
  127. package/dist/{index-y6ye582c.js → index-w0wy05gr.js} +10 -10
  128. package/dist/{index-kw1ws0cs.js → index-w3nv6kr8.js} +1 -1
  129. package/dist/{index-eeahxwvg.js → index-ww3gss55.js} +1 -1
  130. package/dist/{index-aswegq1r.js → index-xjb131sc.js} +367 -131
  131. package/dist/{index-1fyea34p.js → index-yebkpytc.js} +5 -5
  132. package/dist/{index-bgcwxhxh.js → index-yfpt7sxr.js} +24 -46
  133. package/dist/{index-69t14s4a.js → index-yt1gg11x.js} +3 -2
  134. package/dist/{index-jk29rwkr.js → index-zfncctjp.js} +1 -1
  135. package/dist/internal/bun-command.d.ts +14 -0
  136. package/dist/internal/bun-command.d.ts.map +1 -0
  137. package/dist/internal/exclusive-lock-owner.d.ts +1 -1
  138. package/dist/internal/exclusive-lock-owner.d.ts.map +1 -1
  139. package/dist/internal/exclusive-lock.d.ts +1 -1
  140. package/dist/internal/exclusive-lock.d.ts.map +1 -1
  141. package/dist/internal/process-identity.d.ts +24 -5
  142. package/dist/internal/process-identity.d.ts.map +1 -1
  143. package/dist/internal/stable-digest.d.ts +5 -0
  144. package/dist/internal/stable-digest.d.ts.map +1 -1
  145. package/dist/internal/typed.d.ts +2 -0
  146. package/dist/internal/typed.d.ts.map +1 -1
  147. package/dist/process/operation-child.d.ts +38 -0
  148. package/dist/process/operation-child.d.ts.map +1 -0
  149. package/dist/process/operation-wire.d.ts +68 -0
  150. package/dist/process/operation-wire.d.ts.map +1 -0
  151. package/dist/process/operation.d.ts +74 -0
  152. package/dist/process/operation.d.ts.map +1 -0
  153. package/dist/server/contract-identity.d.ts +10 -0
  154. package/dist/server/contract-identity.d.ts.map +1 -0
  155. package/dist/server/contract-stream.d.ts.map +1 -1
  156. package/dist/server/endpoint-response.d.ts.map +1 -1
  157. package/dist/server/error-hook.d.ts +1 -0
  158. package/dist/server/error-hook.d.ts.map +1 -1
  159. package/dist/tools/cli/args-route.d.ts.map +1 -1
  160. package/dist/tools/cli/args-tokens.d.ts.map +1 -1
  161. package/dist/tools/cli/command.d.ts +39 -18
  162. package/dist/tools/cli/command.d.ts.map +1 -1
  163. package/dist/tools/cli/format.d.ts.map +1 -1
  164. package/dist/tools/cli/help.d.ts.map +1 -1
  165. package/dist/tools/cli/invoke.d.ts +3 -1
  166. package/dist/tools/cli/invoke.d.ts.map +1 -1
  167. package/dist/tools/cli/io.d.ts +6 -0
  168. package/dist/tools/cli/io.d.ts.map +1 -1
  169. package/dist/tools/cli/managed-surface.d.ts +2 -0
  170. package/dist/tools/cli/managed-surface.d.ts.map +1 -1
  171. package/dist/tools/cli/policy.d.ts +14 -0
  172. package/dist/tools/cli/policy.d.ts.map +1 -1
  173. package/dist/tools/cli/run-managed.d.ts.map +1 -1
  174. package/dist/tools/cli/run-native.d.ts.map +1 -1
  175. package/dist/tools/cli/run-stream.d.ts +23 -0
  176. package/dist/tools/cli/run-stream.d.ts.map +1 -0
  177. package/dist/tools/cli/session.d.ts +8 -0
  178. package/dist/tools/cli/session.d.ts.map +1 -1
  179. package/dist/tools/cli/stream-surface.d.ts +17 -0
  180. package/dist/tools/cli/stream-surface.d.ts.map +1 -0
  181. package/dist/tools/execute.d.ts +7 -1
  182. package/dist/tools/execute.d.ts.map +1 -1
  183. package/dist/tools/invoker.d.ts.map +1 -1
  184. package/dist/tools/remote.d.ts.map +1 -1
  185. package/llms/cli.2.txt +56 -1
  186. package/llms/cli.txt +68 -1
  187. package/llms/contract.txt +4 -1
  188. package/llms/files-packaging.txt +10 -0
  189. package/llms/process.2.txt +75 -1
  190. package/llms/process.txt +59 -25
  191. package/llms/server.4.txt +8 -4
  192. package/llms/server.5.txt +1 -0
  193. package/llms/stitchkit.2.txt +74 -0
  194. package/llms/stitchkit.txt +5 -5
  195. package/llms/tools.txt +1 -1
  196. package/llms/{upgrading-0.106.0-0.122.0.txt → upgrading-0.106.0-0.123.0.txt} +50 -3
  197. package/llms/upgrading.txt +1 -1
  198. package/llms-full.txt +379 -13
  199. package/llms.txt +7 -7
  200. package/package.json +1 -1
  201. package/dist/index-h2fhjqy7.js +0 -19
  202. package/dist/index-m5m9rmvt.js +0 -44
@@ -2,11 +2,11 @@ import {
2
2
  toolResultFromError,
3
3
  toolCauseFromResult,
4
4
  isToolExecutionControlError2
5
- } from "./index-s3yxw6kt.js";
5
+ } from "./index-s512scra.js";
6
6
  import {
7
7
  createToolRunner,
8
8
  formatToolError
9
- } from "./index-ycqhyars.js";
9
+ } from "./index-qc7tq0za.js";
10
10
  import {
11
11
  resolveRuntimeToolCall
12
12
  } from "./index-eh71zr32.js";
@@ -15,13 +15,13 @@ import {
15
15
  } from "./index-1psbyyhj.js";
16
16
  import {
17
17
  collectToolSurface
18
- } from "./index-ff39f9dr.js";
18
+ } from "./index-993vtv1w.js";
19
19
  import {
20
20
  agentPresenterOf
21
- } from "./index-aqwg2dm5.js";
21
+ } from "./index-6k47xdtt.js";
22
22
  import {
23
23
  isRecord
24
- } from "./index-9jfdm5tg.js";
24
+ } from "./index-hkxgennw.js";
25
25
 
26
26
  // src/tools/agent.ts
27
27
  import { jsonSchema, tool } from "ai";
@@ -3,10 +3,12 @@ import {
3
3
  recordedErrorMessage,
4
4
  normalizeError2,
5
5
  validateDeclaredOutput
6
- } from "./index-k42ckyzx.js";
6
+ } from "./index-ndjzbt2v.js";
7
7
  import {
8
- DEFAULT_CONTRACT_STREAM_FRAME_BYTES2
9
- } from "./index-h2fhjqy7.js";
8
+ DEFAULT_CONTRACT_STREAM_FRAME_BYTES2,
9
+ readContractStreamItems,
10
+ contractStreamLifetimeExceeded
11
+ } from "./index-0v9xb8pz.js";
10
12
  import {
11
13
  joinRoutePath,
12
14
  parseTrailingWildcard
@@ -32,7 +34,7 @@ import {
32
34
  import {
33
35
  bindContract,
34
36
  mediaTypeEssence
35
- } from "./index-sa99p98w.js";
37
+ } from "./index-eabx6qjh.js";
36
38
  import {
37
39
  assertCorsConfig,
38
40
  isOriginAllowed,
@@ -45,14 +47,14 @@ import {
45
47
  getRequestContext2,
46
48
  setRequestEndpoint2,
47
49
  setRequestError2
48
- } from "./index-r6v4mc67.js";
50
+ } from "./index-1d7s7da0.js";
49
51
  import {
50
52
  resolveTraceId2,
51
53
  resolveSocketIp2,
52
54
  extractIp2,
53
55
  getClientInfo2,
54
56
  parseQueryParams
55
- } from "./index-kw1ws0cs.js";
57
+ } from "./index-w3nv6kr8.js";
56
58
  import {
57
59
  isUnsafeKey,
58
60
  safeJsonParse
@@ -66,21 +68,21 @@ import {
66
68
  assertPositiveSafeInteger
67
69
  } from "./index-0s4xebbg.js";
68
70
  import {
69
- abortReason,
70
- untilAborted
71
+ abortReason
71
72
  } from "./index-a5qr2rj6.js";
72
73
  import {
73
74
  AppError2,
74
75
  badRequest2,
75
76
  forbidden2
76
- } from "./index-qcn84byh.js";
77
+ } from "./index-0w0hxp7n.js";
77
78
  import {
78
79
  resolveTraceContext2
79
80
  } from "./index-yex7eg1v.js";
80
81
  import {
81
82
  isRecord,
83
+ isAsyncIterable,
82
84
  transportResult
83
- } from "./index-9jfdm5tg.js";
85
+ } from "./index-hkxgennw.js";
84
86
 
85
87
  // src/server/context-contribution.ts
86
88
  var RUNTIME_CONTEXT_RESERVED_KEYS = new Set([
@@ -1042,25 +1044,11 @@ function contractStreamResponse(request, context, source, descriptor, operationA
1042
1044
  const frames = async function* () {
1043
1045
  if (closing)
1044
1046
  return;
1045
- let terminalSeen = descriptor.terminal === undefined;
1046
1047
  try {
1047
- for (;; ) {
1048
- pendingNext = Promise.resolve(iterator.next());
1049
- const next = await untilAborted(pendingNext, operationAbort.signal);
1050
- if (next.done)
1051
- break;
1052
- const parsed = descriptor.item.safeParse(next.value);
1053
- if (!parsed.success) {
1054
- console.error("[stitchkit] contract stream item failed validation:", parsed.error);
1055
- throw new AppError2("STREAM_ITEM_INVALID", {
1056
- message: "Stream item did not match its contract",
1057
- status: 500
1058
- });
1059
- }
1060
- const item = parsed.data;
1061
- const terminal = descriptor.terminal?.safeParse(item).success ?? false;
1062
- if (terminal)
1063
- terminalSeen = true;
1048
+ const items = readContractStreamItems(iterator, descriptor, operationAbort.signal, (pending) => {
1049
+ pendingNext = pending;
1050
+ });
1051
+ for await (const { item, terminal } of items) {
1064
1052
  const frame = descriptor.framing === "item" ? item : { type: "data", data: item };
1065
1053
  if (encodedBytes(frame, format) > maxFrameBytes) {
1066
1054
  console.error(`[stitchkit] contract stream frame exceeded its ${maxFrameBytes} byte limit`);
@@ -1073,12 +1061,6 @@ function contractStreamResponse(request, context, source, descriptor, operationA
1073
1061
  if (terminal && descriptor.completion === "terminal")
1074
1062
  return;
1075
1063
  }
1076
- if (!terminalSeen) {
1077
- throw new AppError2("STREAM_TERMINAL_MISSING", {
1078
- message: "Stream completed before its declared terminal item",
1079
- status: 500
1080
- });
1081
- }
1082
1064
  if (descriptor.framing !== "item")
1083
1065
  yield { type: "end" };
1084
1066
  } catch (error) {
@@ -1089,10 +1071,7 @@ function contractStreamResponse(request, context, source, descriptor, operationA
1089
1071
  return;
1090
1072
  yield {
1091
1073
  type: "error",
1092
- error: new AppError2("STREAM_LIFETIME_EXCEEDED", {
1093
- message: "Stream exceeded its declared lifetime",
1094
- status: 408
1095
- }).toJSON().error
1074
+ error: contractStreamLifetimeExceeded().toJSON().error
1096
1075
  };
1097
1076
  return;
1098
1077
  }
@@ -1152,12 +1131,6 @@ function applyResponseMetadata(target, metadata, endpointIdentity) {
1152
1131
  }
1153
1132
 
1154
1133
  // src/server/endpoint-response.ts
1155
- function isAsyncIterable(value) {
1156
- if (typeof value !== "object" && typeof value !== "function" || value === null) {
1157
- return false;
1158
- }
1159
- return typeof Reflect.get(value, Symbol.asyncIterator) === "function";
1160
- }
1161
1134
  async function endpointResponse(state, request, outcome) {
1162
1135
  const { method } = outcome.match;
1163
1136
  if (method.rawResponse)
@@ -2127,12 +2100,17 @@ async function dispatch(state, req, url, traceId, server, clientIp, startedAt) {
2127
2100
  if (allow.length > 0) {
2128
2101
  const res = await respondError(new AppError2("METHOD_NOT_ALLOWED", {
2129
2102
  message: `Method ${req.method} not allowed`,
2130
- status: 405
2103
+ status: 405,
2104
+ details: { method: req.method, path: url.pathname, allow }
2131
2105
  }));
2132
2106
  res.headers.set("Allow", allow.join(", "));
2133
2107
  return res;
2134
2108
  }
2135
- return respondError(new AppError2("NOT_FOUND", { message: "Not found", status: 404 }));
2109
+ return respondError(new AppError2("UNKNOWN_OPERATION", {
2110
+ message: `No operation at ${req.method} ${url.pathname}`,
2111
+ status: 404,
2112
+ details: { method: req.method, path: url.pathname }
2113
+ }));
2136
2114
  }
2137
2115
  return dispatchEndpoint(state, request, match);
2138
2116
  }
@@ -29,9 +29,10 @@ function assertEndpointExposure(prefix, key, endpoint) {
29
29
  throw new Error(`${where} expose must be an array of distinct transports: ${ALL_TRANSPORTS2.join(" / ")}`);
30
30
  }
31
31
  if (isHttpOnlyEndpoint(endpoint)) {
32
- const unsupported = exposure.data.filter((transport) => transport !== "HTTP");
32
+ const carriers = "stream" in endpoint && endpoint.stream ? ["HTTP", "CLI"] : ["HTTP"];
33
+ const unsupported = exposure.data.filter((transport) => !carriers.includes(transport));
33
34
  if (unsupported.length > 0) {
34
- throw new Error(`${where} is HTTP-only — remove ${unsupported.join(", ")} from expose`);
35
+ throw new Error(carriers.length > 1 ? `${where} is a stream, carried by ${carriers.join(" and ")} only — remove ${unsupported.join(", ")} from expose` : `${where} is HTTP-only — remove ${unsupported.join(", ")} from expose`);
35
36
  }
36
37
  }
37
38
  }
@@ -2,7 +2,7 @@ import {
2
2
  parseRealtimeRequestArguments,
3
3
  parseRealtimeRequestAcknowledgement,
4
4
  createValidatedRealtimeSocket
5
- } from "./index-3za04re9.js";
5
+ } from "./index-1c945ten.js";
6
6
  import {
7
7
  randomHex
8
8
  } from "./index-c9d05kvt.js";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The one place of this leaf that names the Bun global: a bounded command started through
3
+ * `Bun.spawn` when the host is Bun, and nothing when it is not.
4
+ */
5
+ /** A command that was started: its stdout once it has ended well, and a way to end it. */
6
+ export interface LaunchedCommand {
7
+ readonly stdout: Promise<string>;
8
+ stop(): void;
9
+ }
10
+ /** Starts a command. The tests replace it with a child whose end is never reported. */
11
+ export type CommandLauncher = (file: string, args: readonly string[], maxBuffer: number) => LaunchedCommand;
12
+ /** The Bun launcher, or `undefined` off Bun, where `node:child_process` reports a child's end. */
13
+ export declare const launchWithBun: CommandLauncher | undefined;
14
+ //# sourceMappingURL=bun-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun-command.d.ts","sourceRoot":"","sources":["../../src/internal/bun-command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,IAAI,IAAI,CAAC;CACd;AAED,uFAAuF;AACvF,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,SAAS,EAAE,MAAM,KACd,eAAe,CAAC;AAiCrB,kGAAkG;AAClG,eAAO,MAAM,aAAa,EAAE,eAAe,GAAG,SACS,CAAC"}
@@ -48,6 +48,6 @@ export interface RecordedLock extends FileIdentity {
48
48
  * in place keeps its PID and start time but not that descriptor, so the lock it left is gone —
49
49
  * judged alive, it would stay held until the PID changed.
50
50
  */
51
- export declare function diagnose(lock: RecordedLock | undefined, declaredIdentity: string | undefined): Promise<ExclusiveLockDiagnosis>;
51
+ export declare function diagnose(lock: RecordedLock | undefined, declaredIdentity: string | undefined, signal?: AbortSignal): Promise<ExclusiveLockDiagnosis>;
52
52
  export {};
53
53
  //# sourceMappingURL=exclusive-lock-owner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exclusive-lock-owner.d.ts","sourceRoot":"","sources":["../../src/internal/exclusive-lock-owner.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,oBAAoB,CAAC;AAE5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
27
27
  } | {
28
- /** The `EEXIST` the exclusive create produced. */
28
+ /** The `EEXIST` the exclusive create produced, or what a cancelled attempt stopped on. */
29
29
  readonly error: unknown;
30
30
  /** Present when a reclaim was considered. */
31
31
  readonly diagnosis?: ExclusiveLockDiagnosis;
@@ -1 +1 @@
1
- {"version":3,"file":"exclusive-lock.d.ts","sourceRoot":"","sources":["../../src/internal/exclusive-lock.ts"],"names":[],"mappings":"AA6BA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAC;AAMhC,iCAAiC;AACjC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,kFAAkF;IAClF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,yEAAyE;IACzE,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,uFAAuF;IACvF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GACpC;IACE,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,sBAAsB,CAAC;CAC7C,CAAC;AA4SN;;;;GAIG;A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AS,CAAC,EAAE,sBAAsB,CAAC;CAC7C,CAAC;AAgTN;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,2BAA2B,EACpC,KAAK,SAAI,GACR,OAAO,CAAC,oBAAoB,CAAC,CAkC/B;AAED,gFAAgF;AAChF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAEpC"}
@@ -1,3 +1,9 @@
1
+ import { type CommandLauncher } from './bun-command.js';
2
+ /** @internal What the tests replace in a command: who starts it and how long it may take. */
3
+ export interface CommandSeam {
4
+ readonly launch?: CommandLauncher;
5
+ readonly timeoutMs?: number;
6
+ }
1
7
  /**
2
8
  * `IOPlatformUUID` out of an `ioreg` dump, or `null` when the dump does not carry one.
3
9
  *
@@ -7,11 +13,24 @@
7
13
  */
8
14
  export declare function parsePlatformUuid(dump: string): string | null;
9
15
  /**
10
- * @internal `command` is a seam for the tests. macOS keeps no machine-id file, so the I/O cannot be
11
- * removed — but which executable answers can be, and that makes the branch provable off darwin.
16
+ * @internal `command` and `seam` are for the tests. macOS keeps no machine-id file, so the I/O
17
+ * cannot be removed — but which executable answers can be, and that makes the branch provable off
18
+ * darwin.
12
19
  */
13
- export declare function readDarwinPlatformUuid(command?: string): Promise<string | null>;
14
- export declare function machineIdentity(declared: string | undefined): Promise<string | null>;
20
+ export declare function readDarwinPlatformUuid(command?: string, signal?: AbortSignal, seam?: CommandSeam): Promise<string | null>;
21
+ /**
22
+ * @internal What an undeclared identity is read from. The tests replace `detect` with a read whose
23
+ * command never reports its end, and `forget` drops the memoized answer between cases.
24
+ */
25
+ export declare const identitySource: {
26
+ detect(signal?: AbortSignal): Promise<string | null>;
27
+ forget(): void;
28
+ };
29
+ /**
30
+ * A cancelled detection answers `null` and is not remembered: the caller that cancelled is leaving,
31
+ * and the next one asks the platform again.
32
+ */
33
+ export declare function machineIdentity(declared: string | undefined, signal?: AbortSignal): Promise<string | null>;
15
34
  /**
16
35
  * Whether the recorded owner is provably gone.
17
36
  *
@@ -43,5 +62,5 @@ export declare function probeLiveness(pid: number, reach?: (target: number) => t
43
62
  export declare function isZombieProcess(pid: number, seam?: {
44
63
  procRoot?: string;
45
64
  psCommand?: string;
46
- }): Promise<boolean>;
65
+ } & CommandSeam): Promise<boolean>;
47
66
  //# sourceMappingURL=process-identity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"process-identity.d.ts","sourceRoot":"","sources":["../../src/internal/process-identity.ts"],"names":[],"mappings":"AA6DA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE7D;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,SAAU,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgBtF;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAW1F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,KAAK,YAAY,MAAM,SAA4B,GAClD,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,CAY3B;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACnD,OAAO,CAAC,OAAO,CAAC,CAsBlB"}
1
+ {"version":3,"file":"process-identity.d.ts","sourceRoot":"","sources":["../../src/internal/process-identity.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,eAAe,EAAuC,MAAM,eAAe,CAAC;AAyG1F,6FAA6F;AAC7F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE7D;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,SAAU,EACjB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiBxB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc;IACzB,MAAM,UAAU,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAKpD,MAAM,IAAI,IAAI;CAGf,CAAC;AAEF;;;GAGG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAUxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,KAAK,YAAY,MAAM,SAA4B,GAClD,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,CAY3B;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,WAAgB,GACjE,OAAO,CAAC,OAAO,CAAC,CAuBlB"}
@@ -12,4 +12,9 @@
12
12
  * construction; a caller digesting something else has to say what it means.
13
13
  */
14
14
  export declare function argumentsDigest(args: Record<string, unknown>): string;
15
+ /**
16
+ * The same 128-bit identity over any JSON value — a schema, a set of
17
+ * operations — for callers whose subject is not a call's arguments.
18
+ */
19
+ export declare function canonicalDigest(value: unknown): string;
15
20
  //# sourceMappingURL=stable-digest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stable-digest.d.ts","sourceRoot":"","sources":["../../src/internal/stable-digest.ts"],"names":[],"mappings":"AA6EA;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAGrE"}
1
+ {"version":3,"file":"stable-digest.d.ts","sourceRoot":"","sources":["../../src/internal/stable-digest.ts"],"names":[],"mappings":"AA6EA;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAErE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGtD"}
@@ -3,6 +3,8 @@ export declare function typedEntries<T extends object>(value: T): Array<{
3
3
  }[keyof T]>;
4
4
  /** Narrow an unknown value to a plain object — not `null`, not an array. */
5
5
  export declare function isRecord(value: unknown): value is Record<string, unknown>;
6
+ /** Whether a value can be read with `for await` — an async generator, a stream, any async iterable. */
7
+ export declare function isAsyncIterable(value: unknown): value is AsyncIterable<unknown>;
6
8
  /** Invoke a runtime-discovered handler after a fail-first function check. */
7
9
  export declare function callRuntimeHandler(handler: unknown, context: unknown): unknown;
8
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src/internal/typed.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAC3C,KAAK,EAAE,CAAC,GACP,KAAK,CAAC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAE/C;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AA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B,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAK/E;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAK9E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAEpD;AAED,wBAAgB,SAAS,CACvB,OAAO,SAAS,MAAM,EACtB,OAAO,SAAS;KAAG,CAAC,IAAI,MAAM,OAAO,CAAC,CAAC,EAAE,OAAO;CAAE,EAElD,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,CAAC,CAAC,SAAS,MAAM,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,GACrF,OAAO,CAOT;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,SAAS,MAAM,EACtB,OAAO,SAAS;KAAG,CAAC,IAAI,MAAM,OAAO,CAAC,CAAC,EAAE,OAAO;CAAE,EAElD,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,KAAK,OAAO,GACrE,OAAO,CAKT"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * What `runOperationProcess` reads of a service: `implement(contract, handlers)` fits. Stated
3
+ * structurally because this part stands below the server part and cannot name its `ServiceDef`.
4
+ */
5
+ export interface OperationProcessService {
6
+ methods: Record<string, {
7
+ serviceName: string;
8
+ key: string;
9
+ handler(context: {
10
+ params: unknown;
11
+ input: unknown;
12
+ source: string;
13
+ signal: AbortSignal;
14
+ }): unknown;
15
+ }>;
16
+ }
17
+ /** Where `runOperationProcess` reads its call, writes its answer and learns it must stop. */
18
+ export interface OperationProcessIo {
19
+ /** The call. Default: all of `process.stdin`. */
20
+ readCall?: () => Promise<string>;
21
+ /** Default: `process.stdout`, awaited so a slow reader slows the handler. */
22
+ write?: (text: string) => Promise<void>;
23
+ /** Aborted when the server stops this process. Default: `SIGTERM` and `SIGINT`. */
24
+ signal?: AbortSignal;
25
+ }
26
+ /**
27
+ * The child side: read one call from stdin, run it against `services`, write
28
+ * the answer. Returns the process exit code — `0` whenever an answer was
29
+ * written, a refusal included, because a refusal is an answer.
30
+ *
31
+ * The call arrives already validated: the server parsed `params` and `input`
32
+ * through the operation's schemas before it started this process, and it
33
+ * validates the answer against the output schema after. Both cross the process
34
+ * boundary as JSON, so a schema whose parsed value JSON cannot carry — a
35
+ * `Date`, a `Map`, a `bigint` — cannot be an input or an output here.
36
+ */
37
+ export declare function runOperationProcess(services: readonly OperationProcessService[], io?: OperationProcessIo): Promise<number>;
38
+ //# sourceMappingURL=operation-child.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-child.d.ts","sourceRoot":"","sources":["../../src/process/operation-child.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CACb,MAAM,EACN;QACE,WAAW,EAAE,MAAM,CAAC;QACpB,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,OAAO,EAAE;YACf,MAAM,EAAE,OAAO,CAAC;YAChB,KAAK,EAAE,OAAO,CAAC;YACf,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,EAAE,WAAW,CAAC;SACrB,GAAG,OAAO,CAAC;KACb,CACF,CAAC;CACH;AAED,6FAA6F;AAC7F,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,6EAA6E;IAC7E,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,mFAAmF;IACnF,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAoCD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,SAAS,uBAAuB,EAAE,EAC5C,EAAE,GAAE,kBAAuB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAuDjB"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * What crosses between a server and the process that runs one of its
3
+ * operations: one call on stdin, one answer — or a line per stream frame — on
4
+ * stdout. Both sides parse with these schemas, so neither can drift alone.
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * The most one call may weigh. The server refuses to send more and the child
9
+ * refuses to read more: a call is a request, and the bytes an operation works
10
+ * on belong in a file it is told the path of.
11
+ */
12
+ export declare const MAX_CALL_BYTES: number;
13
+ /** The call one child process receives on stdin. */
14
+ export declare const OperationCallSchema: z.ZodObject<{
15
+ operation: z.ZodString;
16
+ kind: z.ZodEnum<{
17
+ stream: "stream";
18
+ unary: "unary";
19
+ }>;
20
+ params: z.ZodOptional<z.ZodUnknown>;
21
+ input: z.ZodOptional<z.ZodUnknown>;
22
+ }, z.core.$strict>;
23
+ /**
24
+ * A refusal as it crosses the process boundary: the stream error envelope every
25
+ * contract stream already speaks, plus the HTTP status the envelope leaves to
26
+ * the response line — here there is no response line to carry it.
27
+ */
28
+ export declare const OperationErrorSchema: z.ZodObject<{
29
+ code: z.ZodString;
30
+ message: z.ZodOptional<z.ZodString>;
31
+ details: z.ZodOptional<z.ZodUnknown>;
32
+ hint: z.ZodOptional<z.ZodString>;
33
+ retryable: z.ZodOptional<z.ZodBoolean>;
34
+ status: z.ZodOptional<z.ZodNumber>;
35
+ }, z.core.$strict>;
36
+ /** One line of a streamed answer: a contract stream frame whose error keeps its status. */
37
+ export declare const OperationFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
38
+ type: z.ZodLiteral<"data">;
39
+ data: z.ZodUnknown;
40
+ }, z.core.$strict>, z.ZodObject<{
41
+ type: z.ZodLiteral<"error">;
42
+ error: z.ZodObject<{
43
+ code: z.ZodString;
44
+ message: z.ZodOptional<z.ZodString>;
45
+ details: z.ZodOptional<z.ZodUnknown>;
46
+ hint: z.ZodOptional<z.ZodString>;
47
+ retryable: z.ZodOptional<z.ZodBoolean>;
48
+ status: z.ZodOptional<z.ZodNumber>;
49
+ }, z.core.$strict>;
50
+ }, z.core.$strict>, z.ZodObject<{
51
+ type: z.ZodLiteral<"end">;
52
+ }, z.core.$strict>], "type">;
53
+ /** The single answer of a unary operation, one JSON document on stdout. */
54
+ export declare const OperationAnswerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
55
+ ok: z.ZodLiteral<true>;
56
+ data: z.ZodOptional<z.ZodUnknown>;
57
+ }, z.core.$strict>, z.ZodObject<{
58
+ ok: z.ZodLiteral<false>;
59
+ error: z.ZodObject<{
60
+ code: z.ZodString;
61
+ message: z.ZodOptional<z.ZodString>;
62
+ details: z.ZodOptional<z.ZodUnknown>;
63
+ hint: z.ZodOptional<z.ZodString>;
64
+ retryable: z.ZodOptional<z.ZodBoolean>;
65
+ status: z.ZodOptional<z.ZodNumber>;
66
+ }, z.core.$strict>;
67
+ }, z.core.$strict>], "ok">;
68
+ //# sourceMappingURL=operation-wire.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-wire.d.ts","sourceRoot":"","sources":["../../src/process/operation-wire.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAAmB,CAAC;AAE/C,oDAAoD;AACpD,eAAO,MAAM,mBAAmB;;;;;;;;kBAK9B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;kBAE/B,CAAC;AAEH,2FAA2F;AAC3F,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;4BAI/B,CAAC;AAEH,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;0BAGhC,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * A contract operation executed in a process of its own.
3
+ *
4
+ * A handler that reads gigabytes holds the server's event loop for as long as
5
+ * it reads, and every cheap operation on that server waits behind it. Moving
6
+ * the work to a child process keeps the loop free, and the mechanics around the
7
+ * child are the same for every application: hand the validated call over, bound
8
+ * what comes back, end the process when the caller leaves or the deadline
9
+ * passes, and refuse — not queue — a call the machine has no room for.
10
+ *
11
+ * The server side is `createOperationProcesses`: its `unary` and `stream`
12
+ * return ordinary contract handlers, so the operation is implemented, routed,
13
+ * gated and validated exactly like one that runs in process. The child side is
14
+ * `runOperationProcess`, fed the same `implement(contract, handlers)` services.
15
+ */
16
+ import type { z } from 'zod';
17
+ import type { ContractDef, EndpointDef } from '../contract/define.js';
18
+ import { type NativeCommandOptions } from './contract.js';
19
+ /** The child command of `createOperationProcesses` and the three bounds every call runs under. */
20
+ export interface OperationProcessesConfig {
21
+ /**
22
+ * The command that runs `runOperationProcess` — typically this application's
23
+ * own executable with a private argument. One process is started per call.
24
+ */
25
+ command: Pick<NativeCommandOptions, 'executable' | 'args' | 'cwd' | 'env' | 'envPolicy' | 'ownerLoss' | 'stop'>;
26
+ /** Calls running at once. A call beyond it is refused with `OPERATION_BUSY`, never queued. */
27
+ maxConcurrent: number;
28
+ /**
29
+ * Bytes one answer may take: the whole answer of a unary operation, one item
30
+ * of a stream. More is refused with `OPERATION_RESPONSE_TOO_LARGE`.
31
+ */
32
+ maxResponseBytes: number;
33
+ /** Deadline of one unary call, from process start. A stream lives until it ends or is cancelled. */
34
+ timeoutMs: number;
35
+ }
36
+ /** What a handler built by `createOperationProcesses` reads of its call. */
37
+ export interface OperationCallContext {
38
+ params?: unknown;
39
+ input?: unknown;
40
+ signal?: AbortSignal;
41
+ }
42
+ type OperationOutput<E> = E extends {
43
+ output: z.ZodType<infer O>;
44
+ } ? O : undefined;
45
+ type OperationItem<E> = E extends {
46
+ stream: {
47
+ item: z.ZodType<infer I>;
48
+ };
49
+ } ? I : never;
50
+ type StreamOperationKeys<T> = {
51
+ [K in keyof T]: T[K] extends {
52
+ stream: object;
53
+ } ? K : never;
54
+ }[keyof T];
55
+ type UnaryOperationKeys<T> = Exclude<keyof T, StreamOperationKeys<T>>;
56
+ /** The handlers `createOperationProcesses` builds, and how many calls run now. */
57
+ export interface OperationProcesses {
58
+ /** The handler of one unary operation, executed in a process of its own. */
59
+ unary<T extends Record<string, EndpointDef>, K extends UnaryOperationKeys<T> & string>(contract: ContractDef<T, string>, key: K): (context: OperationCallContext) => Promise<OperationOutput<T[K]>>;
60
+ /** The handler of one streaming operation: items arrive as the process produces them. */
61
+ stream<T extends Record<string, EndpointDef>, K extends StreamOperationKeys<T> & string>(contract: ContractDef<T, string>, key: K): (context: OperationCallContext) => AsyncIterable<OperationItem<T[K]>>;
62
+ /** Calls running now. */
63
+ readonly active: number;
64
+ }
65
+ /**
66
+ * A pool of one-call processes for contract operations.
67
+ *
68
+ * It holds no process between calls: a call starts one, and the call's end —
69
+ * its answer, its failure, the caller's abort, the deadline — ends that
70
+ * process and its group. The pool is the count that bounds them.
71
+ */
72
+ export declare function createOperationProcesses(config: OperationProcessesConfig): OperationProcesses;
73
+ export {};
74
+ //# sourceMappingURL=operation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/process/operation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOnE,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAU3E,kGAAkG;AAClG,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,OAAO,EAAE,IAAI,CACX,oBAAoB,EACpB,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,WAA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C,GACL,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,yFAAyF;IACzF,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,SAAS,mBAAmB,CAAC,CAAC,CAAC,GAAG,MAAM,EACrF,QAAQ,EAAE,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EAChC,GAAG,EAAE,CAAC,GACL,CAAC,OAAO,EAAE,oBAAoB,KAAK,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzE,yBAAyB;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AA0ED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,wBAAwB,GAC/B,kBAAkB,CAyJpB"}
@@ -0,0 +1,10 @@
1
+ import type { ServiceDef } from './types.js';
2
+ /**
3
+ * `services` plus the service that answers `contractIdentityContract` with their
4
+ * fingerprint — the same digest `contractFingerprint` gives a client holding
5
+ * the same contracts. It returns the whole list to mount, so the identity
6
+ * cannot describe a different set of services than the server answers. The
7
+ * identity operation is not part of its own answer.
8
+ */
9
+ export declare function withContractIdentity(services: readonly ServiceDef[]): ServiceDef[];
10
+ //# sourceMappingURL=contract-identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-identity.d.ts","sourceRoot":"","sources":["../../src/server/contract-identity.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAqB1C;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG,UAAU,EAAE,CAWlF"}
@@ -1 +1 @@
1
- {"version":3,"file":"contract-stream.d.ts","sourceRoot":"","sources":["../../src/server/contract-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAWnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAS/C,gEAAgE;AAChE,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAC9B,UAAU,EAAE,wBAAwB,EACpC,cAAc,EAAE,eAAe,GAC9B,OAAO,CAAC,QAAQ,CAAC,CA+GnB"}
1
+ {"version":3,"file":"contract-stream.d.ts","sourceRoot":"","sources":["../../src/server/contract-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAcnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAS/C,gEAAgE;AAChE,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAC9B,UAAU,EAAE,wBAAwB,EACpC,cAAc,EAAE,eAAe,GAC9B,OAAO,CAAC,QAAQ,CAAC,CAgGnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"endpoint-response.d.ts","sourceRoot":"","sources":["../../src/server/endpoint-response.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC/C,WAAW,EAAE,eAAe,GAAG,SAAS,CAAC;CAC1C;AASD,wBAAsB,gBAAgB,CAAC,OAAO,EAC5C,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,EAC5B,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,EAC9B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,QAAQ,CAAC,CAgBnB"}
1
+ {"version":3,"file":"endpoint-response.d.ts","sourceRoot":"","sources":["../../src/server/endpoint-response.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC/C,WAAW,EAAE,eAAe,GAAG,SAAS,CAAC;CAC1C;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAC5C,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,EAC5B,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,EAC9B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,QAAQ,CAAC,CAgBnB"}
@@ -23,6 +23,7 @@
23
23
  * BAD_REQUEST: 'bad_request', VALIDATION_ERROR: 'bad_request',
24
24
  * UNAUTHORIZED: 'unauthenticated', FORBIDDEN: 'forbidden',
25
25
  * NOT_FOUND: 'not_found', METHOD_NOT_ALLOWED: 'not_found',
26
+ * UNKNOWN_OPERATION: 'not_found',
26
27
  * CONFLICT: 'conflict', RATE_LIMITED: 'rate_limited',
27
28
  * INTERNAL_SERVER_ERROR: 'internal',
28
29
  * },
@@ -1 +1 @@
1
- {"version":3,"file":"error-hook.d.ts","sourceRoot":"","sources":["../../src/server/error-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzD,uEAAuE;AACvE,MAAM,WAAW,aAAa;IAC5B,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,+FAA+F;IAC/F,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,oCAAoC;AACpC,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,MAAM,EAAE,CACN,IAAI,EAAE,aAAa,EACnB,GAAG,EAAE,cAAc,EACnB,QAAQ,CAAC,EAAE,SAAS,KACjB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,qDAAqD;IACrD,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,aAAa,EACnB,GAAG,EAAE,cAAc,EACnB,QAAQ,CAAC,EAAE,SAAS,KACjB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,MAAM,gBAAgB,CAAC,SAAS,SAAS,MAAM,IACjD;IACE,+EAA+E;IAC/E,UAAU,EAAE;QAAE,QAAQ,C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,EAAE,eAAe,CAAC,SAAS,CAAC,GACjC,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CA8CxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"args-route.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/args-route.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AAGD,eAAO,MAAM,YAAY,aAA6D,CAAC;AAEvF,eAAO,MAAM,oBAAoB,aAA+C,CAAC;AAEjF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAClC;AAED,sFAAsF;AACtF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAcrF;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA+BD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,YAAY,CAuHlF"}
1
+ {"version":3,"file":"args-route.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/args-route.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;;;;GAQG;A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