stitchkit 0.113.2 → 0.114.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 (83) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/contract/errors.d.ts +1 -0
  3. package/dist/contract/errors.d.ts.map +1 -1
  4. package/dist/entrypoints/agent-runtime/browser.js +2 -2
  5. package/dist/entrypoints/agent-runtime/coding-tools.js +4 -4
  6. package/dist/entrypoints/agent-runtime/harness.js +5 -5
  7. package/dist/entrypoints/agent-runtime/realtime.js +2 -2
  8. package/dist/entrypoints/agent-runtime/sandbox.js +4 -4
  9. package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
  10. package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
  11. package/dist/entrypoints/agent-runtime/testing.js +6 -6
  12. package/dist/entrypoints/agent-runtime.js +11 -11
  13. package/dist/entrypoints/application/grammy.js +1 -1
  14. package/dist/entrypoints/application.js +2 -2
  15. package/dist/entrypoints/cli.js +8 -8
  16. package/dist/entrypoints/contract.js +2 -2
  17. package/dist/entrypoints/files.js +1 -1
  18. package/dist/entrypoints/index.js +5 -5
  19. package/dist/entrypoints/node.js +7 -7
  20. package/dist/entrypoints/observability.js +1 -1
  21. package/dist/entrypoints/realtime.js +3 -3
  22. package/dist/entrypoints/remote.js +1 -1
  23. package/dist/entrypoints/server.js +8 -8
  24. package/dist/entrypoints/telegram/screens.js +1 -1
  25. package/dist/entrypoints/telegram.d.ts +1 -0
  26. package/dist/entrypoints/telegram.d.ts.map +1 -1
  27. package/dist/entrypoints/telegram.js +241 -1
  28. package/dist/entrypoints/testing.js +3 -3
  29. package/dist/entrypoints/tools/connections.js +5 -5
  30. package/dist/entrypoints/tools/invoker.js +5 -5
  31. package/dist/entrypoints/tools/mcp.js +7 -7
  32. package/dist/entrypoints/tools.js +13 -13
  33. package/dist/{index-cn7xenet.js → index-095ya5hm.js} +5 -5
  34. package/dist/{index-6ez1r4j2.js → index-1csp1hwm.js} +4 -4
  35. package/dist/{index-sps9s3aj.js → index-2bqf0a74.js} +1 -1
  36. package/dist/{index-grn4brx1.js → index-3za04re9.js} +1 -1
  37. package/dist/{index-09dyy94r.js → index-523tq7y4.js} +1 -1
  38. package/dist/{index-8swt2h9y.js → index-7fc0c2np.js} +1 -1
  39. package/dist/{index-2s7wv547.js → index-86nbfysb.js} +3 -3
  40. package/dist/{index-5gmrx6sc.js → index-98hv3sba.js} +1 -1
  41. package/dist/{index-4e36ts8b.js → index-9dyd8xzf.js} +1 -1
  42. package/dist/{index-zbs0g0v2.js → index-aykhzcnf.js} +1 -1
  43. package/dist/{index-0pfk3c1p.js → index-bjcjqj46.js} +1 -1
  44. package/dist/{index-vgtzdykw.js → index-cqmqyjax.js} +1 -1
  45. package/dist/{index-bv51s0f4.js → index-ega3yz4c.js} +1 -1
  46. package/dist/{index-awbed0mk.js → index-fy4av0hq.js} +1 -1
  47. package/dist/{index-xvj9h8yh.js → index-hs35ss3p.js} +11 -3
  48. package/dist/{index-0gbn42hr.js → index-htxh46ej.js} +3 -3
  49. package/dist/{index-shg5xc9t.js → index-jk29rwkr.js} +1 -1
  50. package/dist/{index-e40rzw1m.js → index-k42ckyzx.js} +1 -1
  51. package/dist/{index-xtc8k5n9.js → index-k7z3j3hr.js} +47 -16
  52. package/dist/{index-pd578538.js → index-qcn84byh.js} +1 -0
  53. package/dist/{index-vf9c59t3.js → index-rhzkndr5.js} +2 -2
  54. package/dist/{index-z8fnfj42.js → index-tpwbct8j.js} +1 -1
  55. package/dist/{index-7ysby53h.js → index-v1tswj0z.js} +1 -1
  56. package/dist/{index-a31p9ekx.js → index-v6vb5qx8.js} +4 -4
  57. package/dist/{index-5zxe0f3h.js → index-vtann8bz.js} +3 -3
  58. package/dist/{index-kvga921h.js → index-vwhrnp67.js} +4 -4
  59. package/dist/{index-ptjx84pr.js → index-zktz242w.js} +2 -2
  60. package/dist/telegram/outbound-budget.d.ts +99 -0
  61. package/dist/telegram/outbound-budget.d.ts.map +1 -0
  62. package/dist/telegram/send-failure.d.ts +6 -1
  63. package/dist/telegram/send-failure.d.ts.map +1 -1
  64. package/dist/tools/cli/command.d.ts +2 -1
  65. package/dist/tools/cli/command.d.ts.map +1 -1
  66. package/dist/tools/cli/format.d.ts +5 -1
  67. package/dist/tools/cli/format.d.ts.map +1 -1
  68. package/dist/tools/cli/run-native.d.ts.map +1 -1
  69. package/llms/cli.2.txt +281 -0
  70. package/llms/cli.txt +18 -285
  71. package/llms/server.4.txt +6 -1
  72. package/llms/stitchkit.txt +4 -4
  73. package/llms/telegram.txt +64 -2
  74. package/llms/{upgrading-0.103.13-0.113.0.txt → upgrading-0.104.0-0.114.0.txt} +45 -84
  75. package/llms/upgrading-0.37.0-0.44.0.txt +444 -0
  76. package/llms/{upgrading-0.44.0-0.60.0.txt → upgrading-0.44.0-0.61.0.txt} +140 -271
  77. package/llms/{upgrading-0.61.0-0.74.0.txt → upgrading-0.62.0-0.78.0.txt} +137 -140
  78. package/llms/{upgrading-0.75.0-0.103.0.txt → upgrading-0.79.0-0.103.13.txt} +84 -137
  79. package/llms/upgrading.txt +5 -5
  80. package/llms-full.txt +134 -11
  81. package/llms.txt +9 -9
  82. package/package.json +1 -1
  83. package/llms/upgrading-0.37.0.txt +0 -176
@@ -32,6 +32,10 @@ var BY_DESCRIPTION = [
32
32
  [/user is deactivated|account is deactivated/i, "user-deactivated"],
33
33
  [/can'?t initiate conversation|need to start a conversation/i, "not-started"],
34
34
  [/chat not found|peer_id_invalid|user not found/i, "chat-not-found"],
35
+ [
36
+ /bot_to_bot_disabled|bot-to-bot messaging is disabled|bot to bot.*disabled/i,
37
+ "bot-to-bot-disabled"
38
+ ],
35
39
  [/too many requests|retry later|flood/i, "rate-limited"],
36
40
  [
37
41
  /message is too long|can'?t parse entities|message text is empty|wrong file identifier|button_url_invalid/i,
@@ -43,6 +47,7 @@ var TRAITS = {
43
47
  "user-deactivated": { retryable: false, recipientUnreachable: true },
44
48
  "chat-not-found": { retryable: false, recipientUnreachable: true },
45
49
  "not-started": { retryable: false, recipientUnreachable: true },
50
+ "bot-to-bot-disabled": { retryable: false, recipientUnreachable: false },
46
51
  "rate-limited": { retryable: true, recipientUnreachable: false },
47
52
  "message-invalid": { retryable: false, recipientUnreachable: false },
48
53
  "server-error": { retryable: true, recipientUnreachable: false },
@@ -82,13 +87,16 @@ function retryAfterOf(value, depth = 0) {
82
87
  return nested === value ? undefined : retryAfterOf(nested, depth + 1);
83
88
  }
84
89
  function descriptionOf(value, depth = 0) {
90
+ if (depth > 4)
91
+ return "";
85
92
  if (typeof value === "string")
86
93
  return value;
87
94
  if (value instanceof Error) {
88
- const nested = isRecord(value) ? descriptionOf(value.cause, depth + 1) : "";
89
- return `${value.message} ${nested}`.trim();
95
+ const own = isRecord(value) && typeof value.description === "string" ? value.description : "";
96
+ const nested = descriptionOf(value.cause, depth + 1);
97
+ return [own, value.message, nested].filter(Boolean).join(" ");
90
98
  }
91
- if (!isRecord(value) || depth > 4)
99
+ if (!isRecord(value))
92
100
  return "";
93
101
  const own = typeof value.description === "string" ? value.description : "";
94
102
  const message = typeof value.message === "string" ? value.message : "";
@@ -3,14 +3,14 @@ import {
3
3
  mergeSchemas,
4
4
  assertToolExtensionCompatible,
5
5
  projectToolSurface
6
- } from "./index-vf9c59t3.js";
6
+ } from "./index-rhzkndr5.js";
7
7
  import {
8
8
  toolErrorFromResult,
9
9
  executeToolMethod
10
- } from "./index-a31p9ekx.js";
10
+ } from "./index-v6vb5qx8.js";
11
11
  import {
12
12
  isRetryableStatus2
13
- } from "./index-pd578538.js";
13
+ } from "./index-qcn84byh.js";
14
14
 
15
15
  // src/tools/mount.ts
16
16
  import { z } from "zod";
@@ -2,7 +2,7 @@ import {
2
2
  parseRealtimeRequestArguments,
3
3
  parseRealtimeRequestAcknowledgement,
4
4
  createValidatedRealtimeSocket
5
- } from "./index-grn4brx1.js";
5
+ } from "./index-3za04re9.js";
6
6
  import {
7
7
  randomHex
8
8
  } from "./index-c9d05kvt.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-1eeqpadm.js";
5
5
  import {
6
6
  AppError2
7
- } from "./index-pd578538.js";
7
+ } from "./index-qcn84byh.js";
8
8
  import {
9
9
  isRecord
10
10
  } from "./index-9jfdm5tg.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  validateDeclaredOutput
3
- } from "./index-e40rzw1m.js";
3
+ } from "./index-k42ckyzx.js";
4
4
  import {
5
5
  jsonSchemaObjectCoercionMembers
6
6
  } from "./index-dsa676h8.js";
@@ -14,15 +14,15 @@ import {
14
14
  objectShapeKeys,
15
15
  assertUniqueToolName,
16
16
  buildToolPresentationSchema
17
- } from "./index-vf9c59t3.js";
17
+ } from "./index-rhzkndr5.js";
18
18
  import {
19
19
  toolResultFromError,
20
20
  toolErrorFromResult
21
- } from "./index-a31p9ekx.js";
21
+ } from "./index-v6vb5qx8.js";
22
22
  import {
23
23
  createToolRunner,
24
24
  formatToolError
25
- } from "./index-0gbn42hr.js";
25
+ } from "./index-htxh46ej.js";
26
26
  import {
27
27
  fetchGuarded,
28
28
  readCapped
@@ -35,7 +35,7 @@ import {
35
35
  } from "./index-eemvahkc.js";
36
36
  import {
37
37
  collectToolSurface
38
- } from "./index-2s7wv547.js";
38
+ } from "./index-86nbfysb.js";
39
39
  import {
40
40
  isUnsafeKey,
41
41
  safeJsonParse
@@ -46,7 +46,7 @@ import {
46
46
  import {
47
47
  AppError2,
48
48
  STITCH_ERROR_STATUS2
49
- } from "./index-pd578538.js";
49
+ } from "./index-qcn84byh.js";
50
50
  import {
51
51
  isRecord
52
52
  } from "./index-9jfdm5tg.js";
@@ -69,17 +69,28 @@ function prepareCliCommandEmission(definition, result, options) {
69
69
  if (!result.ok || definition.output === undefined) {
70
70
  return { result, successExitCode: 0 };
71
71
  }
72
+ let successExitCode;
72
73
  try {
73
- const successExitCode = cliCommandSuccessExitCode(definition, result.data);
74
- const presentation = definition.present?.({ result: result.data, options });
75
- if (presentation !== undefined && typeof presentation !== "string") {
74
+ successExitCode = cliCommandSuccessExitCode(definition, result.data);
75
+ } catch (error) {
76
+ return {
77
+ result: toolResultFromError(new Error("CLI result policy failed", { cause: error })),
78
+ successExitCode: 0
79
+ };
80
+ }
81
+ try {
82
+ if (definition.present === undefined)
83
+ return { result, successExitCode };
84
+ const presentation = definition.present({ result: result.data, options });
85
+ if (typeof presentation !== "string") {
76
86
  throw new Error("CLI result presenter must return a string");
77
87
  }
78
88
  return { result, presentation, successExitCode };
79
89
  } catch (error) {
80
90
  return {
81
- result: toolResultFromError(new Error("CLI result policy failed", { cause: error })),
82
- successExitCode: 0
91
+ result,
92
+ presentationFailure: toolResultFromError(new Error("CLI result presentation failed", { cause: error })),
93
+ successExitCode
83
94
  };
84
95
  }
85
96
  }
@@ -142,6 +153,7 @@ var DEFAULT_EXIT_CODES2 = {
142
153
  UPSTREAM_TOOL_ERROR: 1,
143
154
  WAIT_FAILED: 1,
144
155
  CLI_COMMAND_UNAVAILABLE: 1,
156
+ CLI_PRESENTATION_FAILED: 8,
145
157
  INTERNAL_SERVER_ERROR: 1
146
158
  };
147
159
  function cliExitCode2(result, exitCodes) {
@@ -165,6 +177,21 @@ function emitResult2(result, writers, opts) {
165
177
  `);
166
178
  return cliExitCode2(result, opts.exitCodes);
167
179
  }
180
+ function emitPresentationFailure(result, failure, writers, opts) {
181
+ emitResult2(result, writers, opts);
182
+ return emitResult2({
183
+ ok: false,
184
+ code: "CLI_PRESENTATION_FAILED",
185
+ retryable: false,
186
+ details: {
187
+ message: "The command completed successfully, but its result presentation failed.",
188
+ command: opts.toolName,
189
+ operationSucceeded: true,
190
+ cause: formatToolError(failure)
191
+ },
192
+ hint: "The complete, unformatted result is on stdout. Do not repeat the command to recover its result."
193
+ }, writers, { json: opts.json, toolName: opts.toolName, exitCodes: opts.exitCodes });
194
+ }
168
195
 
169
196
  // src/tools/cli/argument-error.ts
170
197
  class CliArgumentError2 extends Error {
@@ -2257,11 +2284,12 @@ async function emitManagedResult(session, command, initial, options) {
2257
2284
  try {
2258
2285
  viewed = renderCliView2(result.data, options.view);
2259
2286
  } catch (error) {
2260
- if (!(error instanceof CliArgumentError2))
2261
- throw error;
2262
- stderr(`${error.message}
2263
- `);
2264
- return exit(2);
2287
+ const failure = error instanceof CliArgumentError2 ? {
2288
+ ok: false,
2289
+ code: "BAD_REQUEST",
2290
+ details: { message: error.message }
2291
+ } : toolResultFromError(error);
2292
+ return exit(emitPresentationFailure(result, failure, { stdout, stderr }, emitOptionsFor(config, options.json, command)));
2265
2293
  }
2266
2294
  if (viewed.kind === "text") {
2267
2295
  stdout(viewed.text);
@@ -2318,6 +2346,9 @@ async function runNativeCommand2(session, route, command, native) {
2318
2346
  }
2319
2347
  const result = await executeCliCommand(native, toolArgs, options, { stdout, stderr }, config.coerceJsonArgs ?? true, globals);
2320
2348
  const emission = prepareCliCommandEmission(native, result, options);
2349
+ if (emission.result.ok && emission.presentationFailure !== undefined) {
2350
+ return exit(emitPresentationFailure(emission.result, emission.presentationFailure, { stdout, stderr }, emitOptionsFor(config, options.json, command)));
2351
+ }
2321
2352
  let emittedExitCode;
2322
2353
  if (emission.result.ok && emission.presentation !== undefined) {
2323
2354
  stdout(emission.presentation);
@@ -77,6 +77,7 @@ var STITCH_ERROR_STATUS2 = {
77
77
  WAIT_TIMEOUT: 408,
78
78
  WAIT_FAILED: 409,
79
79
  CLI_COMMAND_UNAVAILABLE: 409,
80
+ CLI_PRESENTATION_FAILED: 500,
80
81
  DOWNLOAD_NOT_FOUND: 404,
81
82
  VIEW_HTTP_ERROR: 502,
82
83
  CONNECTION_TIMEOUT: 504,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  validateDeclaredOutput
3
- } from "./index-e40rzw1m.js";
3
+ } from "./index-k42ckyzx.js";
4
4
  import {
5
5
  toJsonSchema
6
6
  } from "./index-ct75c3at.js";
7
7
  import {
8
8
  AppError2
9
- } from "./index-pd578538.js";
9
+ } from "./index-qcn84byh.js";
10
10
  import {
11
11
  serializeCanonicalJson
12
12
  } from "./index-zsvzhjtk.js";
@@ -17,7 +17,7 @@ import {
17
17
  replaceMessage,
18
18
  ArchiveSpillSchema,
19
19
  createAgentRuntimeStore2
20
- } from "./index-09dyy94r.js";
20
+ } from "./index-523tq7y4.js";
21
21
 
22
22
  // src/agent-runtime/store-memory.ts
23
23
  import { z as z2 } from "zod";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./index-50ejfz75.js";
12
12
  import {
13
13
  AppError2
14
- } from "./index-pd578538.js";
14
+ } from "./index-qcn84byh.js";
15
15
 
16
16
  // src/application/kernel-contract.ts
17
17
  import { z } from "zod";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  normalizeError2,
3
3
  validateDeclaredOutput
4
- } from "./index-e40rzw1m.js";
4
+ } from "./index-k42ckyzx.js";
5
5
  import {
6
6
  localVerdict
7
7
  } from "./index-dsa676h8.js";
@@ -12,14 +12,14 @@ import {
12
12
  applyToolViewDefaults,
13
13
  projectToolView,
14
14
  objectShapeKeys
15
- } from "./index-vf9c59t3.js";
15
+ } from "./index-rhzkndr5.js";
16
16
  import {
17
17
  runWithRequestContext2,
18
18
  getRequestContext2
19
19
  } from "./index-r6v4mc67.js";
20
20
  import {
21
21
  projectedToolError
22
- } from "./index-5gmrx6sc.js";
22
+ } from "./index-98hv3sba.js";
23
23
  import {
24
24
  isUnsafeKey
25
25
  } from "./index-zsarb5xp.js";
@@ -31,7 +31,7 @@ import {
31
31
  STITCH_ERROR_STATUS2,
32
32
  isRetryableStatus2,
33
33
  isStitchErrorCode2
34
- } from "./index-pd578538.js";
34
+ } from "./index-qcn84byh.js";
35
35
  import {
36
36
  isRecord
37
37
  } from "./index-9jfdm5tg.js";
@@ -3,7 +3,7 @@ import {
3
3
  recordedErrorMessage,
4
4
  normalizeError2,
5
5
  validateDeclaredOutput
6
- } from "./index-e40rzw1m.js";
6
+ } from "./index-k42ckyzx.js";
7
7
  import {
8
8
  DEFAULT_CONTRACT_STREAM_FRAME_BYTES2
9
9
  } from "./index-h2fhjqy7.js";
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  bindContract,
28
28
  mediaTypeEssence
29
- } from "./index-vgtzdykw.js";
29
+ } from "./index-cqmqyjax.js";
30
30
  import {
31
31
  readBoundedChunks,
32
32
  concatChunks,
@@ -71,7 +71,7 @@ import {
71
71
  AppError2,
72
72
  badRequest2,
73
73
  forbidden2
74
- } from "./index-pd578538.js";
74
+ } from "./index-qcn84byh.js";
75
75
  import {
76
76
  resolveTraceContext2
77
77
  } from "./index-yex7eg1v.js";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  assertUniqueToolName
3
- } from "./index-vf9c59t3.js";
3
+ } from "./index-rhzkndr5.js";
4
4
  import {
5
5
  toolErrorFromResult
6
- } from "./index-a31p9ekx.js";
6
+ } from "./index-v6vb5qx8.js";
7
7
  import {
8
8
  collectTools2,
9
9
  createToolRunner
10
- } from "./index-0gbn42hr.js";
10
+ } from "./index-htxh46ej.js";
11
11
  import {
12
12
  AppError2
13
- } from "./index-pd578538.js";
13
+ } from "./index-qcn84byh.js";
14
14
 
15
15
  // src/tools/invoker.ts
16
16
  function createToolInvoker2(services, config) {
@@ -27,13 +27,13 @@ import {
27
27
  } from "./index-j4zh647a.js";
28
28
  import {
29
29
  defineRuntimeTool2
30
- } from "./index-bv51s0f4.js";
30
+ } from "./index-ega3yz4c.js";
31
31
  import {
32
32
  AppError2,
33
33
  forbidden2,
34
34
  conflict2,
35
35
  STITCH_ERROR_STATUS2
36
- } from "./index-pd578538.js";
36
+ } from "./index-qcn84byh.js";
37
37
 
38
38
  // src/agent-runtime/coding-tool-contract.ts
39
39
  import { z } from "zod";
@@ -0,0 +1,99 @@
1
+ /**
2
+ * One outbound budget for one Telegram bot token.
3
+ *
4
+ * Telegram counts a bot's bulk messages per token, not per subsystem. A bot
5
+ * that sends a marketing campaign, answers a person and posts an operator note
6
+ * through three senders has one limit, and three separate pacemakers cannot
7
+ * keep it: each of them is below the limit on its own and the sum is not.
8
+ *
9
+ * This is the one place that counts. The token names the budget; every alias
10
+ * of the same token in the process gets the same object, and another token is
11
+ * another budget. The unit is a Telegram message: `sendMediaGroup` and
12
+ * `sendPaidMedia` cost their media length, `copyMessages` and
13
+ * `forwardMessages` cost their message ids, and the follow-up call to action
14
+ * after an album is one more message.
15
+ *
16
+ * **It paces; it does not retry.** A 429 pauses every sender of the token for
17
+ * the wait Telegram stated (or a declared fallback when it stated none). A
18
+ * network failure or a 5xx is returned to the caller unchanged: repeating a
19
+ * send whose external outcome is unknown is the caller's decision, and a
20
+ * primitive that retried it would turn one unknown message into two.
21
+ *
22
+ * The schedule is a strict token budget, not a bucket with a full burst: the
23
+ * first call after an idle period is immediate, and every later call occupies
24
+ * its own `cost / messagesPerSecond` interval. A full bucket would release a
25
+ * saved burst at start and again after a 429 pause, which is exactly the
26
+ * stampede a shared budget exists to prevent.
27
+ */
28
+ export interface TelegramOutboundBudgetConfig {
29
+ /** The bot token whose sends share this budget. It is never returned or logged. */
30
+ readonly token: string;
31
+ /** Telegram messages per second. Default 24. */
32
+ readonly messagesPerSecond?: number;
33
+ /**
34
+ * How long a 429 without `retry_after` pauses the token. Default 1000 ms.
35
+ * Telegram's own `retry_after` is always used instead when present.
36
+ */
37
+ readonly retryAfterFallbackMs?: number;
38
+ /**
39
+ * Test seam: the monotonic clock. Default `performance.now`. A wall clock can
40
+ * jump backwards and turn a pause into a burst, so the default is monotonic.
41
+ */
42
+ readonly now?: () => number;
43
+ /**
44
+ * Test seam: how a wait is taken. Default the shared abortable sleep. A
45
+ * custom sleeper must reject with `signal.reason` when the signal aborts.
46
+ */
47
+ readonly sleep?: (milliseconds: number, signal?: AbortSignal) => Promise<void>;
48
+ }
49
+ /** What the budget has done, with no token and no message ids. */
50
+ export interface TelegramOutboundBudgetStats {
51
+ /** Calls admitted by `acquire` or `run`. */
52
+ readonly granted: number;
53
+ /** Weighted messages admitted: an album of three counts as three. */
54
+ readonly messages: number;
55
+ /** Calls waiting for their turn. */
56
+ readonly queued: number;
57
+ readonly messagesPerSecond: number;
58
+ /** How much of the current 429 pause is still ahead, in milliseconds. */
59
+ readonly pausedForMs: number;
60
+ }
61
+ /**
62
+ * A token's outbound budget. `run` is the narrow adapter a client transformer
63
+ * calls around its own send; it gates, pauses on 429 and never retries.
64
+ */
65
+ export interface TelegramOutboundBudget {
66
+ /**
67
+ * Run one Bot API call under the budget. A non-send method passes through
68
+ * without spending a message. A 429 pauses every sender of the token; the
69
+ * original error is rethrown and the call is not repeated.
70
+ */
71
+ run<T>(method: string, payload: unknown, signal: AbortSignal | undefined, send: () => Promise<T>): Promise<T>;
72
+ /**
73
+ * Wait until `cost` messages fit. The wait rejects with `signal.reason`
74
+ * without spending a token; a granted call owns its slots even if its later
75
+ * send is aborted, which the caller must not repeat as a definite failure.
76
+ */
77
+ acquire(cost: number, signal?: AbortSignal): Promise<void>;
78
+ /** Pause every sender of this token for at least `milliseconds`. Never shortens an existing pause. */
79
+ pause(milliseconds: number): void;
80
+ /** Pause the token after a rate-limited refusal; another failure does nothing. */
81
+ pauseAfter(error: unknown): void;
82
+ /**
83
+ * Wait out the current pause without spending a token. For a retry path that
84
+ * is not a send (edit, delete) and does not go through `acquire`.
85
+ */
86
+ waitUntilResumed(signal?: AbortSignal): Promise<void>;
87
+ /** Measured counters. It never contains the token. */
88
+ stats(): TelegramOutboundBudgetStats;
89
+ }
90
+ /**
91
+ * The one budget for `config.token`, created on first use.
92
+ *
93
+ * Two aliases of one token share it; two tokens never do. A second call for a
94
+ * token already in use must agree on the options, otherwise the process has
95
+ * two incompatible policies for one credential and the call is refused. The
96
+ * refusal never contains the token.
97
+ */
98
+ export declare function telegramOutboundBudget(config: TelegramOutboundBudgetConfig): TelegramOutboundBudget;
99
+ //# sourceMappingURL=outbound-budget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outbound-budget.d.ts","sourceRoot":"","sources":["../../src/telegram/outbound-budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;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kF;IAClF,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,sDAAsD;IACtD,KAAK,IAAI,2BAA2B,CAAC;CACtC;AAmMD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,4BAA4B,GACnC,sBAAsB,CAsCxB"}
@@ -30,8 +30,13 @@
30
30
  * user who never pressed Start needs an invitation rather than a retry, and a
31
31
  * chat Telegram does not know is usually a bad identifier on our side — a
32
32
  * defect in our data, not a fact about a person.
33
+ *
34
+ * `bot-to-bot-disabled` is permanent for this send but does not accuse the
35
+ * recipient: Telegram disables bot-to-bot messaging when *either* bot has not
36
+ * enabled its Bot to Bot setting, so the missing setting may be the sender's.
37
+ * It is never retried, and it never marks the recipient unreachable.
33
38
  */
34
- export type TelegramSendFailureReason = 'blocked-by-user' | 'user-deactivated' | 'chat-not-found' | 'not-started' | 'rate-limited' | 'message-invalid' | 'server-error' | 'not-dispatched' | 'unknown';
39
+ export type TelegramSendFailureReason = 'blocked-by-user' | 'user-deactivated' | 'chat-not-found' | 'not-started' | 'bot-to-bot-disabled' | 'rate-limited' | 'message-invalid' | 'server-error' | 'not-dispatched' | 'unknown';
35
40
  export interface TelegramSendFailure {
36
41
  reason: TelegramSendFailureReason;
37
42
  /** Telegram's `error_code`, when the failure carried one. */
@@ -1 +1 @@
1
- {"version":3,"file":"send-failure.d.ts","sourceRoot":"","sources":["../../src/telegram/send-failure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH;;;;;;;;;GASG;AACH,MAAM,MAAM,yBAAyB,GACjC,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,SAAS,CAAC;AAEd,MAAM,WAAW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;;;;;;;OAQG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,EAAE,YAAY,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,MAAM,CAAC;CAC1E;AAoDD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,yBAAyB,EAC7B,CAAC;AA4ClD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,CA4D/E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,cAAc,GACd,gBAAgB,GAChB,eAAe,GACf,OAAO,CAAC;AAeZ,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,CAM/E"}
@@ -1,5 +1,5 @@
1
1
  import type { ZodObject, ZodType, z } from 'zod';
2
- import { type ToolResult } from '../execute-result.js';
2
+ import { type ToolFailure, type ToolResult } from '../execute-result.js';
3
3
  import type { CliRunOptions } from './args.js';
4
4
  import type { CliWriters } from './format.js';
5
5
  export interface CliCommandContext<TInput extends ZodObject> extends CliWriters {
@@ -42,6 +42,7 @@ export declare function defineCliCommand<TInput extends ZodObject>(definition: C
42
42
  export interface PreparedCliCommandEmission {
43
43
  result: ToolResult;
44
44
  presentation?: string;
45
+ presentationFailure?: ToolFailure;
45
46
  successExitCode: number;
46
47
  }
47
48
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGjD,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,mBAAmB,CAAC;AAGzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;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;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,oBAAoB,GAC/B,UAAU,IAAI,8BAA8B,CAAC,SAAS,EAAE,OAAO,CAAC,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,oBAAoB,EAChC,IAAI,EAAE,OAAO,GACZ,MAAM,CAMR;AAED,+EAA+E;AAC/E,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,oBAAoB,EAChC,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,GAC/B,0BAA0B,CA6B5B;AAED,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,oBAAoB,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKzB;AAED,iFAAiF;AACjF,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,oBAAoB,EAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,UAAU,EACnB,UAAU,EAAE,OAAO,EACnB,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM,GAC9C,OAAO,CAAC,UAAU,CAAC,CAoCrB"}
@@ -12,7 +12,7 @@
12
12
  * still parsing a success.
13
13
  */
14
14
  import type { ErrorHintFn } from '../execute-hooks.js';
15
- import type { ToolResult } from '../execute-result.js';
15
+ import type { ToolFailure, ToolResult } from '../execute-result.js';
16
16
  /** Map a `ToolResult.code` to a process exit code. */
17
17
  export type ExitCodeMap = Record<string, number>;
18
18
  /**
@@ -47,4 +47,8 @@ export interface EmitOptions {
47
47
  */
48
48
  export declare function cliExitCode(result: ToolResult, exitCodes?: ExitCodeMap): number;
49
49
  export declare function emitResult(result: ToolResult, writers: CliWriters, opts: EmitOptions): number;
50
+ /** A presentation failure cannot erase a successfully completed operation. */
51
+ export declare function emitPresentationFailure(result: Extract<ToolResult, {
52
+ ok: true;
53
+ }>, failure: ToolFailure, writers: CliWriters, opts: EmitOptions): number;
50
54
  //# sourceMappingURL=format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,sDAAsD;AACtD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAkBhC,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED;;;;GAIG;AACH;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,CAY/E;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,WAAW,GAChB,MAAM,CAeR"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/format.ts"],"names":[],"mappings":"AAAA;;;;;;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AAK,oBAAoB,EAG1B,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAkB,MAAM,WAAW,CAAC;AAE3E;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EACL,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,QAAQ,SAAS,SAAS,EAE1B,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAC9C,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACzB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,IAAI,CAAC,CA+Df"}
1
+ {"version":3,"file":"run-native.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/run-native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAkB,MAAM,WAAW,CAAC;AAE3E;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EACL,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,QAAQ,SAAS,SAAS,EAE1B,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAC9C,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACzB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAyEf"}