@tidegap/core 0.19.0 → 0.21.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 (171) hide show
  1. package/README.md +1 -1
  2. package/dist/agent-snippet.d.ts +30 -0
  3. package/dist/agent-snippet.js +120 -0
  4. package/dist/channels/commands.d.ts +137 -0
  5. package/dist/channels/commands.js +377 -0
  6. package/dist/channels/delivery-codes.d.ts +9 -0
  7. package/dist/channels/delivery-codes.js +53 -0
  8. package/dist/channels/digest.d.ts +102 -0
  9. package/dist/channels/digest.js +146 -0
  10. package/dist/channels/format.d.ts +138 -0
  11. package/dist/channels/format.js +425 -0
  12. package/dist/channels/index.d.ts +15 -0
  13. package/dist/channels/index.js +15 -0
  14. package/dist/channels/kinds/command.d.ts +13 -0
  15. package/dist/channels/kinds/command.js +65 -0
  16. package/dist/channels/kinds/discord.d.ts +16 -0
  17. package/dist/channels/kinds/discord.js +67 -0
  18. package/dist/channels/kinds/email.d.ts +20 -0
  19. package/dist/channels/kinds/email.js +162 -0
  20. package/dist/channels/kinds/index.d.ts +8 -0
  21. package/dist/channels/kinds/index.js +17 -0
  22. package/dist/channels/kinds/ntfy.d.ts +25 -0
  23. package/dist/channels/kinds/ntfy.js +163 -0
  24. package/dist/channels/kinds/pushover.d.ts +11 -0
  25. package/dist/channels/kinds/pushover.js +77 -0
  26. package/dist/channels/kinds/shared.d.ts +25 -0
  27. package/dist/channels/kinds/shared.js +39 -0
  28. package/dist/channels/kinds/shortcuts.d.ts +9 -0
  29. package/dist/channels/kinds/shortcuts.js +45 -0
  30. package/dist/channels/kinds/slack.d.ts +8 -0
  31. package/dist/channels/kinds/slack.js +57 -0
  32. package/dist/channels/kinds/telegram.d.ts +4 -0
  33. package/dist/channels/kinds/telegram.js +26 -0
  34. package/dist/channels/kinds/webhook.d.ts +30 -0
  35. package/dist/channels/kinds/webhook.js +177 -0
  36. package/dist/channels/payload.d.ts +36 -0
  37. package/dist/channels/payload.js +61 -0
  38. package/dist/channels/plan.d.ts +24 -0
  39. package/dist/channels/plan.js +66 -0
  40. package/dist/channels/registry.d.ts +191 -0
  41. package/dist/channels/registry.js +125 -0
  42. package/dist/channels/telegram.d.ts +110 -0
  43. package/dist/channels/telegram.js +168 -0
  44. package/dist/channels/types.d.ts +107 -0
  45. package/dist/channels/types.js +26 -0
  46. package/dist/claude-tools.d.ts +29 -0
  47. package/dist/claude-tools.js +49 -0
  48. package/dist/data/tables.generated.d.ts +6 -0
  49. package/dist/data/tables.generated.js +37 -0
  50. package/dist/energy.d.ts +84 -0
  51. package/dist/energy.js +138 -0
  52. package/dist/grid.d.ts +17 -2
  53. package/dist/grid.js +43 -4
  54. package/dist/handoff.d.ts +171 -0
  55. package/dist/handoff.js +482 -0
  56. package/dist/history.d.ts +17 -0
  57. package/dist/history.js +14 -1
  58. package/dist/index.d.ts +49 -15
  59. package/dist/index.js +36 -8
  60. package/dist/job-cadence.d.ts +76 -0
  61. package/dist/job-cadence.js +240 -0
  62. package/dist/jobs.d.ts +183 -0
  63. package/dist/jobs.js +917 -0
  64. package/dist/notify.d.ts +11 -0
  65. package/dist/notify.js +19 -4
  66. package/dist/postpone.d.ts +113 -0
  67. package/dist/postpone.js +185 -0
  68. package/dist/providers/anthropic.js +14 -8
  69. package/dist/providers/base.d.ts +145 -2
  70. package/dist/providers/base.js +41 -1
  71. package/dist/providers/budget.d.ts +25 -0
  72. package/dist/providers/budget.js +57 -0
  73. package/dist/providers/defaults.js +4 -0
  74. package/dist/providers/defer.d.ts +16 -0
  75. package/dist/providers/defer.js +31 -0
  76. package/dist/providers/gemini.d.ts +4 -0
  77. package/dist/providers/gemini.js +34 -24
  78. package/dist/providers/http.d.ts +40 -0
  79. package/dist/providers/http.js +82 -0
  80. package/dist/providers/index.d.ts +2 -2
  81. package/dist/providers/index.js +1 -1
  82. package/dist/providers/ollama.d.ts +4 -0
  83. package/dist/providers/ollama.js +32 -25
  84. package/dist/providers/openai.js +11 -9
  85. package/dist/providers/timeout.d.ts +36 -0
  86. package/dist/providers/timeout.js +71 -0
  87. package/dist/quota.d.ts +7 -2
  88. package/dist/quota.js +12 -27
  89. package/dist/readiness.d.ts +205 -0
  90. package/dist/readiness.js +326 -0
  91. package/dist/redact.d.ts +42 -0
  92. package/dist/redact.js +110 -0
  93. package/dist/region-host.d.ts +30 -0
  94. package/dist/region-host.js +69 -0
  95. package/dist/region.d.ts +102 -20
  96. package/dist/region.js +175 -23
  97. package/dist/run-limits.d.ts +268 -0
  98. package/dist/run-limits.js +572 -0
  99. package/dist/run-session.d.ts +36 -0
  100. package/dist/run-session.js +72 -0
  101. package/dist/schedule-job.d.ts +118 -0
  102. package/dist/schedule-job.js +243 -0
  103. package/dist/scheduler.d.ts +391 -18
  104. package/dist/scheduler.js +1341 -177
  105. package/dist/sign.d.ts +8 -1
  106. package/dist/sign.js +49 -3
  107. package/dist/storage/sqlite.d.ts +183 -5
  108. package/dist/storage/sqlite.js +720 -19
  109. package/dist/task-events.d.ts +117 -0
  110. package/dist/task-events.js +345 -0
  111. package/dist/tool-surface.d.ts +31 -2
  112. package/dist/tool-surface.js +390 -65
  113. package/dist/types.d.ts +267 -3
  114. package/dist/types.js +6 -1
  115. package/dist/zone-time.d.ts +22 -0
  116. package/dist/zone-time.js +76 -0
  117. package/package.json +13 -5
  118. package/dist/aggregator.d.ts.map +0 -1
  119. package/dist/aggregator.js.map +0 -1
  120. package/dist/budget.d.ts.map +0 -1
  121. package/dist/budget.js.map +0 -1
  122. package/dist/data/tables.generated.d.ts.map +0 -1
  123. package/dist/data/tables.generated.js.map +0 -1
  124. package/dist/energy.d.ts.map +0 -1
  125. package/dist/energy.js.map +0 -1
  126. package/dist/grid.d.ts.map +0 -1
  127. package/dist/grid.js.map +0 -1
  128. package/dist/history.d.ts.map +0 -1
  129. package/dist/history.js.map +0 -1
  130. package/dist/index.d.ts.map +0 -1
  131. package/dist/index.js.map +0 -1
  132. package/dist/notify.d.ts.map +0 -1
  133. package/dist/notify.js.map +0 -1
  134. package/dist/paths.d.ts.map +0 -1
  135. package/dist/paths.js.map +0 -1
  136. package/dist/providers/anthropic.d.ts.map +0 -1
  137. package/dist/providers/anthropic.js.map +0 -1
  138. package/dist/providers/base.d.ts.map +0 -1
  139. package/dist/providers/base.js.map +0 -1
  140. package/dist/providers/defaults.d.ts.map +0 -1
  141. package/dist/providers/defaults.js.map +0 -1
  142. package/dist/providers/gemini.d.ts.map +0 -1
  143. package/dist/providers/gemini.js.map +0 -1
  144. package/dist/providers/index.d.ts.map +0 -1
  145. package/dist/providers/index.js.map +0 -1
  146. package/dist/providers/ollama.d.ts.map +0 -1
  147. package/dist/providers/ollama.js.map +0 -1
  148. package/dist/providers/openai.d.ts.map +0 -1
  149. package/dist/providers/openai.js.map +0 -1
  150. package/dist/quota.d.ts.map +0 -1
  151. package/dist/quota.js.map +0 -1
  152. package/dist/recommend.d.ts.map +0 -1
  153. package/dist/recommend.js.map +0 -1
  154. package/dist/redact.d.ts.map +0 -1
  155. package/dist/redact.js.map +0 -1
  156. package/dist/region.d.ts.map +0 -1
  157. package/dist/region.js.map +0 -1
  158. package/dist/routing.d.ts.map +0 -1
  159. package/dist/routing.js.map +0 -1
  160. package/dist/scheduler.d.ts.map +0 -1
  161. package/dist/scheduler.js.map +0 -1
  162. package/dist/select-window.d.ts.map +0 -1
  163. package/dist/select-window.js.map +0 -1
  164. package/dist/sign.d.ts.map +0 -1
  165. package/dist/sign.js.map +0 -1
  166. package/dist/storage/sqlite.d.ts.map +0 -1
  167. package/dist/storage/sqlite.js.map +0 -1
  168. package/dist/tool-surface.d.ts.map +0 -1
  169. package/dist/tool-surface.js.map +0 -1
  170. package/dist/types.d.ts.map +0 -1
  171. package/dist/types.js.map +0 -1
@@ -0,0 +1,268 @@
1
+ import type { ProviderName } from "./types.js";
2
+ /** A time limit in milliseconds, or `none` for no limit. */
3
+ export type DurationValue = number | "none";
4
+ export type RunLimitName = "command_timeout" | "llm_timeout" | "retries" | "retry_delay";
5
+ /** Where an effective limit came from. */
6
+ export type RunLimitSource = "task" | `setting:${ProviderName}` | "setting" | "default";
7
+ export interface RunLimitDefinition {
8
+ name: RunLimitName;
9
+ /**
10
+ * `time_limit`: a duration in ms or `none`; `delay`: a duration in ms,
11
+ * `none` refused; `count`: a whole number from 0 to 10.
12
+ */
13
+ kind: "time_limit" | "delay" | "count";
14
+ /** The all-runners key in `~/.tidegap/config`. */
15
+ key: string;
16
+ /** The CLI flag and setting name. */
17
+ cliName: string;
18
+ /** The key of the row's or job's caps that holds a per-task value. */
19
+ capsKey: "commandTimeoutMs" | "llmTimeoutMs" | "retries" | "retryDelayMs";
20
+ /** Built-in default per runner, in ms (a count for `count`). The runners listed are the ones the setting applies to. */
21
+ defaults: Readonly<Partial<Record<ProviderName, number>>>;
22
+ /** Whether `<KEY>_<RUNNER>` keys are read. */
23
+ perRunner: boolean;
24
+ /**
25
+ * The default every writer stored before caps carried `capsVersion`: on
26
+ * caps without the marker, a stored value equal to it counts as unset.
27
+ * Only the time limits had one.
28
+ */
29
+ legacyDefaultMs?: number;
30
+ }
31
+ /** The caps marker of writers that store only the values a caller set. */
32
+ export declare const CAPS_VERSION = 2;
33
+ /** The most automatic retries a setting or a task can ask for. */
34
+ export declare const MAX_RETRIES = 10;
35
+ export declare const RUN_LIMITS: readonly Readonly<RunLimitDefinition>[];
36
+ /** The registry entry of `name`. */
37
+ export declare function runLimitDefinition(name: RunLimitName): Readonly<RunLimitDefinition>;
38
+ /** A value the duration grammar refuses; the message is a fixed sentence. */
39
+ export declare class DurationError extends Error {
40
+ name: string;
41
+ }
42
+ export declare const DURATION_FORM_ERROR = "Use a duration from 1s to 7d, such as 90s, 30m, 1.5h or 2d, or none for no time limit.";
43
+ export declare const DURATION_ZERO_ERROR = "0 is not a time limit; use none for no time limit.";
44
+ export declare const DURATION_RANGE_ERROR = "A time limit must be from 1s to 7d; use none for no time limit.";
45
+ /**
46
+ * Parse a time limit: a number with an optional unit `s`, `m` (or `min`),
47
+ * `h` or `d`, case-insensitive, a bare number being seconds; from 1 second
48
+ * to 7 days; or `none`. Returns milliseconds or `"none"`; throws a
49
+ * {@link DurationError} with a fixed sentence that names `none`.
50
+ */
51
+ export declare function parseDuration(input: string): DurationValue;
52
+ /** The canonical form of a time limit: the largest whole unit, else seconds; `none` as is. */
53
+ export declare function formatDuration(value: DurationValue): string;
54
+ export declare const RETRIES_ERROR = "Retries must be a whole number from 0 to 10; 0 turns automatic retries off.";
55
+ export declare const RETRY_DELAY_ERROR = "A retry delay must be a duration from 1s to 7d, such as 90s, 30m or 2h; 0 and none are refused.";
56
+ /** Parse a retry count: a whole number from 0 to 10. Throws a {@link DurationError} with {@link RETRIES_ERROR}. */
57
+ export declare function parseRetries(input: string): number;
58
+ /** Parse a retry delay: the duration grammar without `none`. Throws a {@link DurationError} with {@link RETRY_DELAY_ERROR}. */
59
+ export declare function parseRetryDelay(input: string): number;
60
+ /** Parse a value of setting `def` by its kind; throws a {@link DurationError} with the setting's sentence. */
61
+ export declare function parseRunLimitValue(def: Pick<RunLimitDefinition, "kind">, input: string): DurationValue;
62
+ /** A value of setting `def` as a person reads and writes it: `30m`, `none`, `2`. */
63
+ export declare function formatRunLimitValue(def: Pick<RunLimitDefinition, "kind">, value: DurationValue): string;
64
+ /** One `~/.tidegap/config` line the read skipped, and why. */
65
+ export interface IgnoredRunLimitLine {
66
+ key: string;
67
+ value: string;
68
+ reason: string;
69
+ }
70
+ export interface RunLimitSettings {
71
+ /** The valid values by config key, in ms or `"none"`. */
72
+ values: Readonly<Record<string, DurationValue>>;
73
+ /** Lines under a run-limit key that were skipped, in file order. */
74
+ ignored: readonly IgnoredRunLimitLine[];
75
+ }
76
+ /**
77
+ * The run-limit settings out of already-read KEY=VALUE pairs. Keys outside
78
+ * the registry are left alone; an empty value counts as unset; any other
79
+ * line under a run-limit key that cannot be used is listed in `ignored`.
80
+ */
81
+ export declare function runLimitSettingsFromValues(pairs: Readonly<Record<string, string>>): RunLimitSettings;
82
+ export interface LoadRunLimitSettingsOptions {
83
+ /** Override the config file path (tests). Defaults to `~/.tidegap/config`. */
84
+ path?: string;
85
+ }
86
+ /**
87
+ * Read the run-limit settings from `~/.tidegap/config` (or `opts.path`). A
88
+ * missing or unreadable file gives no settings and never throws. Each
89
+ * ignored line is reported on stderr once per process.
90
+ */
91
+ export declare function loadRunLimitSettings(opts?: LoadRunLimitSettingsOptions): RunLimitSettings;
92
+ export interface ResolvedRunLimit {
93
+ value: DurationValue;
94
+ source: RunLimitSource;
95
+ }
96
+ export type ResolvedRunLimits = Partial<Record<RunLimitName, ResolvedRunLimit>>;
97
+ /**
98
+ * Each limit that applies to `runner`, with its value and source. `caps` is
99
+ * the row's spec caps or the job's caps as stored; only the keys the caller
100
+ * set count, and on caps without `capsVersion: 2` a value equal to the old
101
+ * stored default counts as unset.
102
+ */
103
+ export declare function resolveRunLimits(caps: Readonly<Record<string, unknown>> | undefined, settings: RunLimitSettings, runner: ProviderName): ResolvedRunLimits;
104
+ /**
105
+ * The limits of one run: a model call's for its runner; a command's for
106
+ * the `command` runner, plus, when it has a summarize step, that step's LLM
107
+ * limit for the summarize provider. `spec` is the row's body or a job
108
+ * occurrence's.
109
+ */
110
+ export declare function resolveTaskRunLimits(spec: {
111
+ provider: ProviderName;
112
+ caps?: Readonly<Record<string, unknown>>;
113
+ summarize?: {
114
+ provider: ProviderName;
115
+ };
116
+ }, settings: RunLimitSettings): ResolvedRunLimits;
117
+ /** An effective time limit as a person reads it: `30m (default)`, `none (setting:claude-code)`. */
118
+ export declare function describeRunLimit(limit: ResolvedRunLimit): string;
119
+ /**
120
+ * The fixed sentence a writer refuses a stored time limit with, or
121
+ * undefined for a valid one: milliseconds from 1 second to 7 days, or
122
+ * `"none"`.
123
+ */
124
+ export declare function timeLimitError(value: unknown): string | undefined;
125
+ /**
126
+ * True for a caps key that holds a run-limit setting (`commandTimeoutMs`,
127
+ * `llmTimeoutMs`, `retries`, `retryDelayMs`): a writer drops it on `null`,
128
+ * so the setting or the default applies at each run.
129
+ */
130
+ export declare function isRunLimitCap(key: string): boolean;
131
+ /**
132
+ * The fixed sentence a writer refuses a stored run-limit setting with
133
+ * (caps key `commandTimeoutMs`, `llmTimeoutMs`, `retries` or
134
+ * `retryDelayMs`), or undefined for a valid value or another key: a time
135
+ * limit per {@link timeLimitError}, retries a whole number from 0 to 10, a
136
+ * retry delay from 1 second to 7 days.
137
+ */
138
+ export declare function runLimitValueError(key: string, value: unknown): string | undefined;
139
+ /** Why a writer refuses a cap value, or undefined: a run-limit setting per {@link runLimitValueError}, any other cap a positive number. */
140
+ export declare function capValueError(key: string, value: unknown): string | undefined;
141
+ /**
142
+ * Caps as a writer stores them from now on: on caps without `capsVersion`,
143
+ * a time limit equal to the old stored default is dropped (it counted as
144
+ * unset), then `capsVersion: 2` is added, so each time limit left is one a
145
+ * caller set.
146
+ */
147
+ export declare function versionedCaps<T extends object>(caps: T): T & {
148
+ capsVersion: number;
149
+ };
150
+ /** A time limit as event details and HTTP JSON carry it: seconds, or `"none"`. */
151
+ export declare function durationSeconds(value: DurationValue): number | "none";
152
+ /** One setting in event details and HTTP JSON: a duration in seconds (`value_s`, or `"none"`), retries as a count (`value`), and its source. */
153
+ export interface RunLimitDetail {
154
+ value_s?: number | "none";
155
+ value?: number;
156
+ source: RunLimitSource;
157
+ }
158
+ /** The `limits` details of a `dispatched` event: each effective setting and its source. */
159
+ export type RunLimitsDetails = Partial<Record<RunLimitName, RunLimitDetail>>;
160
+ export declare function runLimitsDetails(limits: ResolvedRunLimits): RunLimitsDetails;
161
+ /** The limits a `dispatched` event's details record, or undefined when it records none (a run from before they were recorded). */
162
+ export declare function runLimitsFromDetails(details: unknown): ResolvedRunLimits | undefined;
163
+ /** A task's limits as a view shows them, and whether its newest run recorded them or they apply if it ran now. */
164
+ export interface TaskRunLimitsView {
165
+ limits: RunLimitsDetails;
166
+ from: "dispatch" | "now";
167
+ }
168
+ /**
169
+ * The limits of a task: the ones its newest `dispatched` event recorded,
170
+ * or, before a run recorded them, the ones a run that starts now gets.
171
+ * `events` are the task's events, oldest first.
172
+ */
173
+ export declare function taskRunLimitsView(bodyJson: string | undefined, events: readonly {
174
+ kind: string;
175
+ details?: unknown;
176
+ }[], settings: RunLimitSettings): TaskRunLimitsView;
177
+ /** `command 30m (default), LLM 10m (setting)`: each time limit of a view, or undefined when it has none. */
178
+ export declare function runLimitsText(limits: RunLimitsDetails): string | undefined;
179
+ /** `1 after 30m (default)`: the retry policy of a view, or undefined when it has none. The delay's source is named when it differs. */
180
+ export declare function retryPolicyText(limits: RunLimitsDetails): string | undefined;
181
+ /**
182
+ * Why a run failed, as the retry policy reads it. `timeout`, `exit`,
183
+ * `transient` and `interrupted` may retry; `permanent` (a retry cannot fix
184
+ * it), `after_command` (a job's LLM step failed after its command ran) and
185
+ * `batch_submit_interrupted` (the provider may hold the batch) never do.
186
+ */
187
+ export type FailureClass = "timeout" | "exit" | "transient" | "interrupted" | "permanent" | "after_command" | "batch_submit_interrupted";
188
+ export declare const FAILURE_CLASSES: readonly FailureClass[];
189
+ /** True for a class whose failure may retry. */
190
+ export declare function isRetryableFailure(cls: FailureClass): boolean;
191
+ /** A failure as both cores describe it to {@link classifyFailure}; every key is optional. */
192
+ export interface FailureFacts {
193
+ /** The HTTP status the provider answered with. */
194
+ status?: number;
195
+ /** Set by an adapter or a refusal: a retry cannot fix it (a refusal, missing setup, a rejected request). */
196
+ permanent?: boolean;
197
+ /** The cap that stopped the run: `command_timeout`, `llm_timeout`, `budget`. */
198
+ stopped_by?: string;
199
+ /** The steps of the run (`command`, `prompt`); a failed run with `prompt` failed after its command ran. */
200
+ steps?: readonly string[];
201
+ /** The run's process exited non-zero or was killed (a command or Claude Code run). */
202
+ exit?: boolean;
203
+ /** A tick stopped the run (`run`: a forced stop or a dead tick), or its Batch submit (`batch_submit`). */
204
+ interrupted?: "run" | "batch_submit";
205
+ }
206
+ /**
207
+ * The facts of a thrown error: its HTTP status (`status` or `statusCode`),
208
+ * the adapter's `permanent`, `exit` and `interrupted` marks, and the `steps`
209
+ * and `stopped_by` of its run details.
210
+ */
211
+ export declare function failureFactsOf(err: unknown): FailureFacts;
212
+ /**
213
+ * True for an HTTP status a retry of the task cannot fix: a 4xx other than
214
+ * 408 (the server stopped waiting), 425 (the server asks for the request
215
+ * again) and 429 (rate limit). Every other status may retry.
216
+ */
217
+ export declare function isPermanentStatus(status: number): boolean;
218
+ /** The class of a failure; an unmarked unknown error is `transient`: one more attempt costs less than a lost task. */
219
+ export declare function classifyFailure(facts: FailureFacts): FailureClass;
220
+ /** The retry policy of resolved limits: retries and the first delay in ms (the registry gives every runner both). */
221
+ export declare function retryPolicyOf(limits: ResolvedRunLimits): {
222
+ retries: number;
223
+ delayMs: number;
224
+ };
225
+ /** Why a failure is final when its class allows a retry. */
226
+ export type FinalReason = "no_retries_left" | "no_time_left";
227
+ /** The sentence a final failure's error ends with, for a reason that has one. */
228
+ export declare const NO_TIME_LEFT_TEXT = "no time left before the deadline for a retry";
229
+ /** What {@link planRetry} decides: the next attempt's earliest start, or why there is none. */
230
+ export type RetryPlan = {
231
+ retryAt: number;
232
+ } | {
233
+ final: FinalReason;
234
+ };
235
+ /**
236
+ * The next attempt after attempt `attempt` (1-based) failed at `failedAt`:
237
+ * retry k waits `delayMs × 2^(k−1)`, a later `notBefore` wins, and the start
238
+ * must not pass `deadline`. All times in ms since the epoch; no deadline
239
+ * means no bound.
240
+ */
241
+ export declare function planRetry(input: {
242
+ attempt: number;
243
+ retries: number;
244
+ delayMs: number;
245
+ failedAt: number;
246
+ deadline?: number;
247
+ notBefore?: number;
248
+ }): RetryPlan;
249
+ /**
250
+ * The number of the attempt a run of a task is: one plus the
251
+ * `attempt_failed` events since the newest `created` event or manual retry
252
+ * (a `rescheduled` event with reason `retry`). `events` are oldest first.
253
+ */
254
+ export declare function attemptNumber(events: readonly {
255
+ kind: string;
256
+ details?: unknown;
257
+ }[]): number;
258
+ /** The error a final failure stores: the run's error, then the attempt count when more than one ran, then the no-time reason. */
259
+ export declare function finalFailureError(error: string, attempts: number, reason?: FinalReason): string;
260
+ /**
261
+ * The notice for a task's own LLM time limit that a Batch API run does not
262
+ * apply: the provider owns a Batch run's hour and its 24-hour window, so the
263
+ * limit is kept for a regular call and ignored for a Batch one.
264
+ */
265
+ export declare const BATCH_LLM_TIMEOUT_NOTE = "not applied if the task runs through the provider Batch API (a deadline over 24 h away); a Batch run has no time limit";
266
+ /** True when a task of `provider` with this deadline may go to a provider Batch API, where no LLM time limit applies. */
267
+ export declare function mayRunAsBatch(provider: string, deadlineMs: number, nowMs: number): boolean;
268
+ //# sourceMappingURL=run-limits.d.ts.map