stitchkit 0.116.0 → 0.118.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 (130) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/agent-runtime/run-acquisition.d.ts +9 -2
  3. package/dist/agent-runtime/run-acquisition.d.ts.map +1 -1
  4. package/dist/agent-runtime/run-execution.d.ts +3 -0
  5. package/dist/agent-runtime/run-execution.d.ts.map +1 -1
  6. package/dist/agent-runtime/run-failure.d.ts +4 -1
  7. package/dist/agent-runtime/run-failure.d.ts.map +1 -1
  8. package/dist/agent-runtime/run-store-retry.d.ts +8 -0
  9. package/dist/agent-runtime/run-store-retry.d.ts.map +1 -0
  10. package/dist/agent-runtime/run-terminal.d.ts.map +1 -1
  11. package/dist/agent-runtime/run-unacquired.d.ts +19 -0
  12. package/dist/agent-runtime/run-unacquired.d.ts.map +1 -0
  13. package/dist/agent-runtime/store-conformance.d.ts +8 -0
  14. package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
  15. package/dist/agent-runtime/store-driver-contract.d.ts +5 -0
  16. package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
  17. package/dist/agent-runtime/terminal-commit.d.ts +34 -4
  18. package/dist/agent-runtime/terminal-commit.d.ts.map +1 -1
  19. package/dist/entrypoints/agent-runtime/harness.js +2 -2
  20. package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
  21. package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
  22. package/dist/entrypoints/agent-runtime/testing.js +22 -4
  23. package/dist/entrypoints/agent-runtime.d.ts +1 -1
  24. package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
  25. package/dist/entrypoints/agent-runtime.js +13 -11
  26. package/dist/entrypoints/application/diagnostic-journal.js +1 -1
  27. package/dist/entrypoints/application/directory-inbox.js +3 -3
  28. package/dist/entrypoints/cli/publish.js +2 -2
  29. package/dist/entrypoints/files.js +2 -2
  30. package/dist/entrypoints/primitives.js +51 -154
  31. package/dist/entrypoints/server.js +6 -6
  32. package/dist/entrypoints/telegram.d.ts +1 -1
  33. package/dist/entrypoints/telegram.d.ts.map +1 -1
  34. package/dist/entrypoints/telegram.js +352 -137
  35. package/dist/entrypoints/tracking/contract.d.ts +11 -0
  36. package/dist/entrypoints/tracking/contract.d.ts.map +1 -0
  37. package/dist/entrypoints/tracking/contract.js +162 -0
  38. package/dist/entrypoints/tracking/performance.d.ts +8 -0
  39. package/dist/entrypoints/tracking/performance.d.ts.map +1 -0
  40. package/dist/entrypoints/tracking/performance.js +181 -0
  41. package/dist/entrypoints/tracking/server.d.ts +1 -0
  42. package/dist/entrypoints/tracking/server.d.ts.map +1 -1
  43. package/dist/entrypoints/tracking/server.js +40 -12
  44. package/dist/entrypoints/tracking.d.ts +4 -3
  45. package/dist/entrypoints/tracking.d.ts.map +1 -1
  46. package/dist/entrypoints/tracking.js +43 -143
  47. package/dist/entrypoints/xlsx.d.ts +4 -0
  48. package/dist/entrypoints/xlsx.d.ts.map +1 -0
  49. package/dist/entrypoints/xlsx.js +406 -0
  50. package/dist/{index-fa435yq2.js → index-073nw9qr.js} +8 -8
  51. package/dist/index-1f40z584.js +7 -0
  52. package/dist/{index-fdk4r4r6.js → index-75ns2ybj.js} +1 -1
  53. package/dist/{index-jq2ky8fw.js → index-cycp3r3e.js} +124 -181
  54. package/dist/{index-4g6qmgdx.js → index-ghtpfz4z.js} +9 -9
  55. package/dist/{index-n3v695sb.js → index-hdjmdwsj.js} +277 -96
  56. package/dist/{index-zqkz4af9.js → index-nqxrm176.js} +1 -1
  57. package/dist/index-qezhmp51.js +242 -0
  58. package/dist/index-vv1sch8a.js +94 -0
  59. package/dist/{index-fggxgbrk.js → index-xx1j310k.js} +165 -102
  60. package/dist/internal/exclusive-lock.d.ts.map +1 -1
  61. package/dist/primitives/decimal.d.ts +10 -0
  62. package/dist/primitives/decimal.d.ts.map +1 -1
  63. package/dist/primitives/index.d.ts +3 -1
  64. package/dist/primitives/index.d.ts.map +1 -1
  65. package/dist/primitives/money.d.ts +20 -0
  66. package/dist/primitives/money.d.ts.map +1 -1
  67. package/dist/primitives/quantity.d.ts.map +1 -1
  68. package/dist/primitives/rounding.d.ts +40 -0
  69. package/dist/primitives/rounding.d.ts.map +1 -0
  70. package/dist/telegram/budget-transformer.d.ts +2 -2
  71. package/dist/telegram/not-dispatched.d.ts +2 -2
  72. package/dist/telegram/not-dispatched.d.ts.map +1 -1
  73. package/dist/telegram/outbound-budget.d.ts +53 -16
  74. package/dist/telegram/outbound-budget.d.ts.map +1 -1
  75. package/dist/telegram/outbound-cost.d.ts +5 -0
  76. package/dist/telegram/outbound-cost.d.ts.map +1 -0
  77. package/dist/telegram/outbound-pauses.d.ts +17 -0
  78. package/dist/telegram/outbound-pauses.d.ts.map +1 -0
  79. package/dist/telegram/outbound-queue.d.ts +17 -0
  80. package/dist/telegram/outbound-queue.d.ts.map +1 -0
  81. package/dist/telegram/update-intake-work.d.ts +20 -1
  82. package/dist/telegram/update-intake-work.d.ts.map +1 -1
  83. package/dist/telegram/update-intake.d.ts +12 -3
  84. package/dist/telegram/update-intake.d.ts.map +1 -1
  85. package/dist/telegram/update-store-check.d.ts +1 -1
  86. package/dist/telegram/update-store-check.d.ts.map +1 -1
  87. package/dist/telegram/update-store-postgres.d.ts.map +1 -1
  88. package/dist/telegram/update-store-sqlite.d.ts.map +1 -1
  89. package/dist/telegram/update-store.d.ts +5 -1
  90. package/dist/telegram/update-store.d.ts.map +1 -1
  91. package/dist/tracking/attribution.d.ts +1 -1
  92. package/dist/tracking/attribution.d.ts.map +1 -1
  93. package/dist/tracking/client-visit.d.ts +3 -1
  94. package/dist/tracking/client-visit.d.ts.map +1 -1
  95. package/dist/tracking/client.d.ts.map +1 -1
  96. package/dist/tracking/performance/collector.d.ts +61 -0
  97. package/dist/tracking/performance/collector.d.ts.map +1 -0
  98. package/dist/tracking/performance/schema.d.ts +45 -0
  99. package/dist/tracking/performance/schema.d.ts.map +1 -0
  100. package/dist/tracking/performance/summary.d.ts +12 -0
  101. package/dist/tracking/performance/summary.d.ts.map +1 -0
  102. package/dist/tracking/privacy.d.ts +5 -0
  103. package/dist/tracking/privacy.d.ts.map +1 -0
  104. package/dist/tracking/server/telemetry-health.d.ts +31 -0
  105. package/dist/tracking/server/telemetry-health.d.ts.map +1 -0
  106. package/dist/xlsx/cells.d.ts +17 -0
  107. package/dist/xlsx/cells.d.ts.map +1 -0
  108. package/dist/xlsx/render.d.ts +11 -0
  109. package/dist/xlsx/render.d.ts.map +1 -0
  110. package/dist/xlsx/schema.d.ts +119 -0
  111. package/dist/xlsx/schema.d.ts.map +1 -0
  112. package/dist/xlsx/zip.d.ts +13 -0
  113. package/dist/xlsx/zip.d.ts.map +1 -0
  114. package/llms/agent-runtime.2.txt +40 -16
  115. package/llms/agent-runtime.3.txt +17 -0
  116. package/llms/agent-runtime.txt +4 -1
  117. package/llms/primitives.txt +21 -0
  118. package/llms/stitchkit.txt +9 -6
  119. package/llms/telegram.txt +46 -15
  120. package/llms/tracking-contract.txt +32 -0
  121. package/llms/tracking-performance.txt +21 -0
  122. package/llms/tracking-server.txt +1 -0
  123. package/llms/tracking.txt +75 -12
  124. package/llms/{upgrading-0.105.0-0.116.0.txt → upgrading-0.105.0-0.118.0.txt} +73 -3
  125. package/llms/upgrading.txt +1 -1
  126. package/llms/xlsx.txt +107 -0
  127. package/llms-full.txt +392 -34
  128. package/llms.txt +11 -7
  129. package/package.json +27 -9
  130. package/dist/{index-z3d6smer.js → index-tdpmfks8.js} +5 -5
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) 43.2 KB → [llms/stitchkit.2.txt](llms/stitchkit.2.txt) 43.1 KB
12
+ - **stitchkit**: [llms/stitchkit.txt](llms/stitchkit.txt) 43.7 KB → [llms/stitchkit.2.txt](llms/stitchkit.2.txt) 43.1 KB
13
13
  - **stitchkit/live**: [llms/live.txt](llms/live.txt) 21.2 KB
14
14
  - **stitchkit/react**: [llms/react.txt](llms/react.txt) 8.7 KB
15
15
  - **stitchkit/react/keyboard**: [llms/react-keyboard.txt](llms/react-keyboard.txt) 22.7 KB
@@ -23,10 +23,10 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
23
23
  - **stitchkit/cli/publish**: [llms/cli-publish.txt](llms/cli-publish.txt) 1.5 KB
24
24
  - **stitchkit/remote**: [llms/remote.txt](llms/remote.txt) 1.0 KB
25
25
  - **stitchkit/contract**: [llms/contract.txt](llms/contract.txt) 31.9 KB
26
- - **stitchkit/primitives**: [llms/primitives.txt](llms/primitives.txt) 11.7 KB
26
+ - **stitchkit/primitives**: [llms/primitives.txt](llms/primitives.txt) 13.2 KB
27
27
  - **stitchkit/server**: [llms/server.txt](llms/server.txt) 44.2 KB → [llms/server.2.txt](llms/server.2.txt) 20.5 KB → [llms/server.3.txt](llms/server.3.txt) 47.0 KB → [llms/server.4.txt](llms/server.4.txt) 38.6 KB → [llms/server.5.txt](llms/server.5.txt) 22.9 KB
28
28
  - **stitchkit/observability**: [llms/observability.txt](llms/observability.txt) 46.9 KB
29
- - **stitchkit/agent-runtime**: [llms/agent-runtime.txt](llms/agent-runtime.txt) 44.1 KB → [llms/agent-runtime.2.txt](llms/agent-runtime.2.txt) 45.9 KB → [llms/agent-runtime.3.txt](llms/agent-runtime.3.txt) 42.2 KB
29
+ - **stitchkit/agent-runtime**: [llms/agent-runtime.txt](llms/agent-runtime.txt) 44.3 KB → [llms/agent-runtime.2.txt](llms/agent-runtime.2.txt) 46.7 KB → [llms/agent-runtime.3.txt](llms/agent-runtime.3.txt) 43.4 KB
30
30
  - **stitchkit/agent-runtime/testing**: [llms/agent-runtime-testing.txt](llms/agent-runtime-testing.txt) 2.6 KB
31
31
  - **stitchkit/agent-runtime/harness**: [llms/agent-runtime-harness.txt](llms/agent-runtime-harness.txt) 11.0 KB
32
32
  - **stitchkit/agent-runtime/coding-tools**: [llms/agent-runtime-coding-tools.txt](llms/agent-runtime-coding-tools.txt) 5.0 KB
@@ -43,14 +43,17 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
43
43
  - **stitchkit/testing**: [llms/testing.txt](llms/testing.txt) 33.6 KB
44
44
  - **stitchkit/agent-runtime/sandbox**: [llms/agent-runtime-sandbox.txt](llms/agent-runtime-sandbox.txt) 8.3 KB
45
45
  - **stitchkit/files**: [llms/files.txt](llms/files.txt) 5.7 KB
46
- - **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 42.2 KB
46
+ - **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 44.8 KB
47
47
  - **stitchkit/telegram/grammy**: [llms/telegram-grammy.txt](llms/telegram-grammy.txt) 1.2 KB
48
48
  - **stitchkit/telegram/html**: [llms/telegram-html.txt](llms/telegram-html.txt) 2.7 KB
49
49
  - **stitchkit/telegram/screens**: [llms/telegram-screens.txt](llms/telegram-screens.txt) 21.2 KB
50
- - **stitchkit/tracking**: [llms/tracking.txt](llms/tracking.txt) 18.1 KB
50
+ - **stitchkit/tracking**: [llms/tracking.txt](llms/tracking.txt) 20.5 KB
51
51
  - **stitchkit/release**: [llms/release.txt](llms/release.txt) 8.9 KB
52
- - **stitchkit/tracking/server**: [llms/tracking-server.txt](llms/tracking-server.txt) 2.5 KB
52
+ - **stitchkit/tracking/contract**: [llms/tracking-contract.txt](llms/tracking-contract.txt) 2.8 KB
53
+ - **stitchkit/tracking/performance**: [llms/tracking-performance.txt](llms/tracking-performance.txt) 1.1 KB
54
+ - **stitchkit/tracking/server**: [llms/tracking-server.txt](llms/tracking-server.txt) 2.7 KB
53
55
  - **stitchkit/geo**: [llms/geo.txt](llms/geo.txt) 4.1 KB
56
+ - **stitchkit/xlsx**: [llms/xlsx.txt](llms/xlsx.txt) 4.5 KB
54
57
  - **stitchkit/voice**: [llms/voice.txt](llms/voice.txt) 5.2 KB
55
58
  - **stitchkit/oauth**: [llms/oauth.txt](llms/oauth.txt) 6.7 KB
56
59
  - **stitchkit/google**: [llms/google.txt](llms/google.txt) 1.4 KB
@@ -66,7 +69,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
66
69
 
67
70
  ## Upgrading slices
68
71
  - **Upgrading — how to move across versions**: [llms/upgrading.txt](llms/upgrading.txt) 12.7 KB
69
- - **Upgrading 0.105.0 → 0.116.0**: [llms/upgrading-0.105.0-0.116.0.txt](llms/upgrading-0.105.0-0.116.0.txt) 40.2 KB
72
+ - **Upgrading 0.105.0 → 0.118.0**: [llms/upgrading-0.105.0-0.118.0.txt](llms/upgrading-0.105.0-0.118.0.txt) 43.0 KB
70
73
  - **Upgrading 0.84.0 → 0.104.0**: [llms/upgrading-0.84.0-0.104.0.txt](llms/upgrading-0.84.0-0.104.0.txt) 46.1 KB
71
74
  - **Upgrading 0.63.0 → 0.83.0**: [llms/upgrading-0.63.0-0.83.0.txt](llms/upgrading-0.63.0-0.83.0.txt) 44.0 KB
72
75
  - **Upgrading 0.44.0 → 0.62.0**: [llms/upgrading-0.44.0-0.62.0.txt](llms/upgrading-0.44.0-0.62.0.txt) 46.5 KB
@@ -102,6 +105,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
102
105
  - [Telegram bots](https://github.com/max-listov/stitchkit/blob/master/docs/guide/telegram.md): stitchkit/telegram — the journal, the operator channel, resumable broadcasts, local Bot API files, webhook ownership and durable update intake, message markup (stitchkit/telegram/html); the bot as application resources
103
106
  - [Telegram screens](https://github.com/max-listov/stitchkit/blob/master/docs/guide/telegram-screens.md): stitchkit/telegram/screens — a bot menu as declared screens: typed paths, actions and input, messages reconciled in place, state in a StorageAdapter, a test chat
104
107
  - [GeoIP](https://github.com/max-listov/stitchkit/blob/master/docs/guide/geo.md): stitchkit/geo — a server-only managed reader, three observable states and last-known-good generation reloads
108
+ - [XLSX](https://github.com/max-listov/stitchkit/blob/master/docs/guide/xlsx.md): stitchkit/xlsx — a workbook from rows and typed columns, with no dependency and no formula in the file
105
109
  - [Upgrading](https://github.com/max-listov/stitchkit/blob/master/docs/guide/upgrading.md): moving a project across stitchkit versions; how breaking changes are marked
106
110
  - [Project declaration](https://github.com/max-listov/stitchkit/blob/master/docs/guide/declaration.md): the optional machine-readable statement a repository makes about itself — identity, roles, build, requirements, release steps and the names of the values a deployment supplies
107
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.116.0",
3
+ "version": "0.118.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",
@@ -217,6 +217,14 @@
217
217
  "types": "./dist/entrypoints/release.d.ts",
218
218
  "import": "./dist/entrypoints/release.js"
219
219
  },
220
+ "./tracking/contract": {
221
+ "types": "./dist/entrypoints/tracking/contract.d.ts",
222
+ "import": "./dist/entrypoints/tracking/contract.js"
223
+ },
224
+ "./tracking/performance": {
225
+ "types": "./dist/entrypoints/tracking/performance.d.ts",
226
+ "import": "./dist/entrypoints/tracking/performance.js"
227
+ },
220
228
  "./tracking/server": {
221
229
  "types": "./dist/entrypoints/tracking/server.d.ts",
222
230
  "import": "./dist/entrypoints/tracking/server.js"
@@ -225,6 +233,10 @@
225
233
  "types": "./dist/entrypoints/geo.d.ts",
226
234
  "import": "./dist/entrypoints/geo.js"
227
235
  },
236
+ "./xlsx": {
237
+ "types": "./dist/entrypoints/xlsx.d.ts",
238
+ "import": "./dist/entrypoints/xlsx.js"
239
+ },
228
240
  "./voice": {
229
241
  "types": "./dist/entrypoints/voice.d.ts",
230
242
  "import": "./dist/entrypoints/voice.js"
@@ -304,30 +316,28 @@
304
316
  "@tanstack/react-query": ">=5",
305
317
  "@types/bun": "^1.4.2",
306
318
  "ai": "^7.0.107",
307
- "grammy": "^1.46.0",
308
319
  "google-auth-library": "^11.1.0",
320
+ "grammy": "^1.46.0",
309
321
  "maxmind": "^5.0.7",
310
322
  "react": ">=18",
311
323
  "react-query-kit": "^3.3.3",
312
324
  "socket.io": "^4.8.3",
313
325
  "socket.io-client": "^4.8.3",
314
326
  "srvx": "^0.12.5 || ^1.0.5",
327
+ "web-vitals": "^6.2.3",
315
328
  "zod": "^4.6.5"
316
329
  },
317
330
  "peerDependenciesMeta": {
318
331
  "@modelcontextprotocol/ext-apps": {
319
332
  "optional": true
320
333
  },
321
- "@types/bun": {
322
- "optional": true
323
- },
324
334
  "@modelcontextprotocol/server": {
325
335
  "optional": true
326
336
  },
327
- "@opentelemetry/api": {
337
+ "@openrouter/ai-sdk-provider": {
328
338
  "optional": true
329
339
  },
330
- "@openrouter/ai-sdk-provider": {
340
+ "@opentelemetry/api": {
331
341
  "optional": true
332
342
  },
333
343
  "@socket.io/bun-engine": {
@@ -339,15 +349,18 @@
339
349
  "@tanstack/react-query": {
340
350
  "optional": true
341
351
  },
342
- "ai": {
352
+ "@types/bun": {
343
353
  "optional": true
344
354
  },
345
- "grammy": {
355
+ "ai": {
346
356
  "optional": true
347
357
  },
348
358
  "google-auth-library": {
349
359
  "optional": true
350
360
  },
361
+ "grammy": {
362
+ "optional": true
363
+ },
351
364
  "maxmind": {
352
365
  "optional": true
353
366
  },
@@ -365,6 +378,9 @@
365
378
  },
366
379
  "srvx": {
367
380
  "optional": true
381
+ },
382
+ "web-vitals": {
383
+ "optional": true
368
384
  }
369
385
  },
370
386
  "dependencies": {
@@ -387,6 +403,7 @@
387
403
  "@typescript/typescript6": "^6.0.2",
388
404
  "ai": "^7.0.111",
389
405
  "ajv": "^8.20.0",
406
+ "exceljs": "^4.4.0",
390
407
  "fake-indexeddb": "^6.2.5",
391
408
  "google-auth-library": "^11.1.0",
392
409
  "grammy": "^1.46.0",
@@ -397,6 +414,7 @@
397
414
  "socket.io-client": "^4.8.3",
398
415
  "srvx": "^1.0.5",
399
416
  "typescript": "^7.0.2",
417
+ "web-vitals": "^6.2.3",
400
418
  "zod": "^4.6.5"
401
419
  }
402
420
  }
@@ -246,13 +246,13 @@ async function createOwned(path, options, reclaimed) {
246
246
  throw error;
247
247
  }
248
248
  } catch (error) {
249
- await handle.close().catch(() => {
250
- return;
251
- });
252
249
  if (published && ino !== undefined && dev !== undefined)
253
250
  await unlinkIfSame(path, ino, dev, 2).catch(() => {
254
251
  return;
255
252
  });
253
+ await handle.close().catch(() => {
254
+ return;
255
+ });
256
256
  await unlink(staged).catch(() => {
257
257
  return;
258
258
  });
@@ -279,9 +279,9 @@ async function createOwned(path, options, reclaimed) {
279
279
  return;
280
280
  released = true;
281
281
  try {
282
- await handle.close();
283
- } finally {
284
282
  await unlinkIfSame(path, ownedInode, ownedDevice);
283
+ } finally {
284
+ await handle.close();
285
285
  }
286
286
  }
287
287
  };