stitchkit 0.123.5 → 0.123.7

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 (66) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/entrypoints/application/diagnostic-journal.js +1 -1
  3. package/dist/entrypoints/application/directory-inbox.js +3 -3
  4. package/dist/entrypoints/cli/publish.js +2 -2
  5. package/dist/entrypoints/cli.js +2 -1
  6. package/dist/entrypoints/files.js +2 -2
  7. package/dist/entrypoints/node.js +2 -2
  8. package/dist/entrypoints/server.js +5 -5
  9. package/dist/entrypoints/telegram/grammy.d.ts +1 -0
  10. package/dist/entrypoints/telegram/grammy.d.ts.map +1 -1
  11. package/dist/entrypoints/telegram/grammy.js +81 -3
  12. package/dist/entrypoints/telegram/screens.js +1 -1
  13. package/dist/entrypoints/telegram.d.ts +1 -0
  14. package/dist/entrypoints/telegram.d.ts.map +1 -1
  15. package/dist/entrypoints/telegram.js +18 -6
  16. package/dist/entrypoints/tools/contract.js +4 -2
  17. package/dist/entrypoints/tools/toolkit.js +2 -1
  18. package/dist/entrypoints/tools.js +33 -27
  19. package/dist/{index-xjb131sc.js → index-1a741dpf.js} +188 -51
  20. package/dist/{index-yfpt7sxr.js → index-6qrspvxp.js} +5 -3
  21. package/dist/index-81t0bf0f.js +18 -0
  22. package/dist/{index-d9cg0gen.js → index-8yky60kq.js} +1 -1
  23. package/dist/{index-bph35vpy.js → index-9cxxfkhb.js} +21 -1
  24. package/dist/index-bgj9hbm3.js +93 -0
  25. package/dist/index-bknzva6n.js +39 -0
  26. package/dist/{index-73dappvg.js → index-ezwvsqx9.js} +1 -1
  27. package/dist/{index-303qne11.js → index-f56ct5gb.js} +27 -4
  28. package/dist/{index-chz7c830.js → index-mqttte96.js} +39 -6
  29. package/dist/{index-eabx6qjh.js → index-tnnmekgb.js} +1 -6
  30. package/dist/index-zs8cze4j.js +6 -0
  31. package/dist/internal/exclusive-lock.d.ts.map +1 -1
  32. package/dist/internal/media-extension.d.ts +3 -0
  33. package/dist/internal/media-extension.d.ts.map +1 -0
  34. package/dist/telegram/send-failure.d.ts +2 -2
  35. package/dist/telegram/send-failure.d.ts.map +1 -1
  36. package/dist/telegram/widget-api.d.ts +106 -0
  37. package/dist/telegram/widget-api.d.ts.map +1 -0
  38. package/dist/telegram/widget.d.ts +121 -0
  39. package/dist/telegram/widget.d.ts.map +1 -0
  40. package/dist/tools/cli/args.d.ts +1 -1
  41. package/dist/tools/cli/args.d.ts.map +1 -1
  42. package/dist/tools/cli/command.d.ts +7 -1
  43. package/dist/tools/cli/command.d.ts.map +1 -1
  44. package/dist/tools/cli/config.d.ts +5 -2
  45. package/dist/tools/cli/config.d.ts.map +1 -1
  46. package/dist/tools/cli/download.d.ts +25 -4
  47. package/dist/tools/cli/download.d.ts.map +1 -1
  48. package/dist/tools/cli/inline-files.d.ts +70 -0
  49. package/dist/tools/cli/inline-files.d.ts.map +1 -0
  50. package/dist/tools/cli/session.d.ts.map +1 -1
  51. package/dist/tools/transfer/download-core.d.ts +2 -0
  52. package/dist/tools/transfer/download-core.d.ts.map +1 -1
  53. package/dist/tools/transfer/view-file-contract.d.ts +34 -4
  54. package/dist/tools/transfer/view-file-contract.d.ts.map +1 -1
  55. package/dist/tools/transfer/view-file.d.ts.map +1 -1
  56. package/llms/cli.txt +63 -3
  57. package/llms/stitchkit.txt +2 -2
  58. package/llms/telegram-grammy.txt +10 -3
  59. package/llms/telegram.2.txt +5 -0
  60. package/llms/telegram.txt +70 -0
  61. package/llms/tools.2.txt +5 -0
  62. package/llms-full.txt +152 -8
  63. package/llms.txt +6 -6
  64. package/package.json +1 -1
  65. package/dist/index-6j725ez5.js +0 -25
  66. package/dist/index-sba3e6m4.js +0 -52
package/llms.txt CHANGED
@@ -9,19 +9,19 @@ 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) 45.1 KB → [llms/stitchkit.2.txt](llms/stitchkit.2.txt) 30.9 KB → [llms/stitchkit.3.txt](llms/stitchkit.3.txt) 19.1 KB
12
+ - **stitchkit**: [llms/stitchkit.txt](llms/stitchkit.txt) 45.2 KB → [llms/stitchkit.2.txt](llms/stitchkit.2.txt) 30.9 KB → [llms/stitchkit.3.txt](llms/stitchkit.3.txt) 19.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
16
16
  - **stitchkit/react/keyboard/testing**: [llms/react-keyboard-testing.txt](llms/react-keyboard-testing.txt) 1.9 KB
17
- - **stitchkit/tools**: [llms/tools.txt](llms/tools.txt) 43.2 KB → [llms/tools.2.txt](llms/tools.2.txt) 35.7 KB → [llms/tools.3.txt](llms/tools.3.txt) 21.0 KB
17
+ - **stitchkit/tools**: [llms/tools.txt](llms/tools.txt) 43.2 KB → [llms/tools.2.txt](llms/tools.2.txt) 36.0 KB → [llms/tools.3.txt](llms/tools.3.txt) 21.0 KB
18
18
  - **stitchkit/tools/mcp**: [llms/tools-mcp.txt](llms/tools-mcp.txt) 6.6 KB
19
19
  - **stitchkit/tools/agent**: [llms/tools-agent.txt](llms/tools-agent.txt) 1.1 KB
20
20
  - **stitchkit/tools/toolkit**: [llms/tools-toolkit.txt](llms/tools-toolkit.txt) 0.9 KB
21
21
  - **stitchkit/tools/contract**: [llms/tools-contract.txt](llms/tools-contract.txt) 0.2 KB
22
22
  - **stitchkit/tools/invoker**: [llms/tools-invoker.txt](llms/tools-invoker.txt) 0.2 KB
23
23
  - **stitchkit/tools/connections**: [llms/tools-connections.txt](llms/tools-connections.txt) 3.9 KB
24
- - **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 40.9 KB → [llms/cli.2.txt](llms/cli.2.txt) 39.0 KB
24
+ - **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 44.0 KB → [llms/cli.2.txt](llms/cli.2.txt) 39.0 KB
25
25
  - **stitchkit/cli/publish**: [llms/cli-publish.txt](llms/cli-publish.txt) 1.5 KB
26
26
  - **stitchkit/remote**: [llms/remote.txt](llms/remote.txt) 1.0 KB
27
27
  - **stitchkit/contract**: [llms/contract.txt](llms/contract.txt) 34.1 KB
@@ -45,8 +45,8 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
45
45
  - **stitchkit/testing**: [llms/testing.txt](llms/testing.txt) 33.7 KB
46
46
  - **stitchkit/agent-runtime/sandbox**: [llms/agent-runtime-sandbox.txt](llms/agent-runtime-sandbox.txt) 8.3 KB
47
47
  - **stitchkit/files**: [llms/files.txt](llms/files.txt) 6.2 KB
48
- - **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 34.7 KB → [llms/telegram.2.txt](llms/telegram.2.txt) 13.8 KB
49
- - **stitchkit/telegram/grammy**: [llms/telegram-grammy.txt](llms/telegram-grammy.txt) 1.2 KB
48
+ - **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 39.3 KB → [llms/telegram.2.txt](llms/telegram.2.txt) 15.2 KB
49
+ - **stitchkit/telegram/grammy**: [llms/telegram-grammy.txt](llms/telegram-grammy.txt) 2.3 KB
50
50
  - **stitchkit/telegram/html**: [llms/telegram-html.txt](llms/telegram-html.txt) 2.7 KB
51
51
  - **stitchkit/telegram/voice**: [llms/telegram-voice.txt](llms/telegram-voice.txt) 1.9 KB
52
52
  - **stitchkit/telegram/screens**: [llms/telegram-screens.txt](llms/telegram-screens.txt) 21.2 KB
@@ -106,7 +106,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
106
106
  - [React Query policy](https://github.com/max-listov/stitchkit/blob/master/docs/guide/react.md): request-local SSR clients, a browser singleton and ApiError retry rules
107
107
  - [Keyboard layers and list zones](https://github.com/max-listov/stitchkit/blob/master/docs/guide/keyboard.md): stitchkit/react/keyboard — which part of a screen gets a key: ordered layers, one Escape per level, list zones that move real focus
108
108
  - [Voice](https://github.com/max-listov/stitchkit/blob/master/docs/guide/voice.md): stitchkit/voice — sentences cut while a reply streams, the text a voice reads, a speech queue that synthesises ahead and stops on interruption
109
- - [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), voice waveforms (stitchkit/telegram/voice); the bot as application resources
109
+ - [Telegram bots](https://github.com/max-listov/stitchkit/blob/master/docs/guide/telegram.md): stitchkit/telegram — the journal, one outbound budget per token and its grammY transformer, widgets (stitchkit/telegram/grammy), the operator channel, resumable broadcasts, local Bot API files, webhook ownership and durable update intake, message markup (stitchkit/telegram/html), voice waveforms (stitchkit/telegram/voice); the bot as application resources
110
110
  - [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
111
111
  - [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
112
112
  - [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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.123.5",
3
+ "version": "0.123.7",
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,25 +0,0 @@
1
- // src/telegram/not-dispatched.ts
2
- class TelegramNotDispatchedError2 extends Error {
3
- stage;
4
- name = "TelegramNotDispatchedError";
5
- code = "TELEGRAM_NOT_DISPATCHED";
6
- constructor(stage, message, options) {
7
- super(message, options);
8
- this.stage = stage;
9
- }
10
- }
11
- function isTelegramNotDispatchedError(error) {
12
- return error instanceof TelegramNotDispatchedError2 || error instanceof Error && error.name === "TelegramNotDispatchedError" && Reflect.get(error, "code") === "TELEGRAM_NOT_DISPATCHED";
13
- }
14
- function isTelegramNotDispatched(error, depth = 0) {
15
- if (error instanceof TelegramNotDispatchedError2)
16
- return true;
17
- if (typeof error !== "object" || error === null || depth > 4)
18
- return false;
19
- if (Reflect.get(error, "code") === "TELEGRAM_NOT_DISPATCHED")
20
- return true;
21
- const nested = Reflect.get(error, "cause") ?? Reflect.get(error, "error");
22
- return nested !== error && isTelegramNotDispatched(nested, depth + 1);
23
- }
24
-
25
- export { TelegramNotDispatchedError2, isTelegramNotDispatchedError, isTelegramNotDispatched };
@@ -1,52 +0,0 @@
1
- // src/tools/operations/async-operation-contract.ts
2
- import { z } from "zod";
3
- var AsyncOperationCancelResultSchema2 = z.discriminatedUnion("outcome", [
4
- z.object({ outcome: z.literal("accepted") }),
5
- z.object({ outcome: z.literal("already_terminal") }),
6
- z.object({ outcome: z.literal("rejected"), reason: z.string().min(1) })
7
- ]);
8
- function createAsyncOperationSnapshotSchema2(config) {
9
- const progress = config.progress ? { progress: config.progress.optional() } : {};
10
- return z.discriminatedUnion("phase", [
11
- z.object({ phase: z.literal("pending"), ...progress }),
12
- z.object({ phase: z.literal("running"), ...progress }),
13
- z.object({ phase: z.literal("succeeded"), ...progress }),
14
- z.object({ phase: z.literal("failed"), failure: config.failure, ...progress }),
15
- z.object({ phase: z.literal("cancelled"), ...progress })
16
- ]);
17
- }
18
-
19
- // src/tools/transfer/view-file-contract.ts
20
- import { z as z2 } from "zod";
21
- var MAX_VIEW_FILES = 20;
22
- var McpAnnotationsSchema2 = z2.object({
23
- audience: z2.array(z2.enum(["user", "assistant"])).optional(),
24
- priority: z2.number().optional()
25
- });
26
- var McpMediaContentSchema2 = z2.discriminatedUnion("type", [
27
- z2.object({ type: z2.literal("text"), text: z2.string() }),
28
- z2.object({
29
- type: z2.literal("image"),
30
- data: z2.string(),
31
- mimeType: z2.string(),
32
- annotations: McpAnnotationsSchema2.optional()
33
- }),
34
- z2.object({
35
- type: z2.literal("audio"),
36
- data: z2.string(),
37
- mimeType: z2.string(),
38
- annotations: McpAnnotationsSchema2.optional()
39
- })
40
- ]);
41
- var ViewFileErrorSchema2 = z2.object({
42
- path: z2.string(),
43
- message: z2.string()
44
- });
45
- var ViewFileOutputSchema2 = z2.object({
46
- content: z2.array(McpMediaContentSchema2),
47
- errors: z2.array(ViewFileErrorSchema2)
48
- });
49
- var ViewFileInputSchema2 = z2.object({
50
- paths: z2.union([z2.string(), z2.array(z2.string()).max(MAX_VIEW_FILES)]).describe("One media URL or file path, or an array of them. Pass the array itself, not JSON written as text.")
51
- });
52
- export { AsyncOperationCancelResultSchema2, createAsyncOperationSnapshotSchema2, McpAnnotationsSchema2, McpMediaContentSchema2, ViewFileErrorSchema2, ViewFileOutputSchema2, ViewFileInputSchema2 };