@anchrd/colab-sdk 0.1.37 → 0.1.39

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.
@@ -18,16 +18,25 @@ import { OperatorProvider, UserId } from "../users/users.js";
18
18
  // value's field in the inputs is `value`, the kinds are `subscription` and `apikey`.
19
19
  // The models of the kind Gateway (E210, #1011), by the gateway's own name `provider/model` as its
20
20
  // Unified API (`/compat`) takes it. `context` in tokens; `price` in US dollars per million tokens
21
- // (input, input read from the cache, output, and a cache write where the catalog names its own), the providers' list prices of 2026-11-04 and, for
22
- // Workers AI, its catalog: the amount of a run where the token cannot read the gateway's logs.
23
- // Each answered one smallest request through `/compat` on 2026-11-04 (#1011, #1018). OpenAI's GPT
24
- // models (#1018) are priced from Cloudflare's catalog (developers.cloudflare.com/ai/models/openai/,
25
- // the short-context price; they also name a cache write). Through `/compat` they refuse
21
+ // (input, input read from the cache, output, and a cache write where the catalog names its own): the
22
+ // amount of a run where the token cannot read the gateway's logs. Since #1059 every price and context
23
+ // is the one of the model's page in Cloudflare's catalog (developers.cloudflare.com/ai/models/,
24
+ // read 2026-11-05; for Claude Haiku 5.5 the short-context price, for Grok 4.7 the one under 200k).
25
+ // Where a page names no price for cached input, `cacheRead` is the input's.
26
+ // ⚠️ The names are `/compat`'s, not the catalog page's: Claude 5.x goes with hyphens
27
+ // (`anthropic/claude-opus-5-5`); the page's `claude-opus-5.5` answers 404 "Did you mean
28
+ // claude-opus-5-5?". Workers AI's models go with `workers-ai/` before their `@cf/…` name.
29
+ // Each model of the catalog finished one test card under `bun run dev` on 2026-11-05 (#1059): read
30
+ // the card, one sentence in its chat, the card to Done. Left out after that test: Gemini 4 Argon and
31
+ // 3.8 Pro (`/compat` asks for a Google key, Unified Billing does not pay for them), Gemini 3.8 Flash
32
+ // (its streamed tool call carries `thought_signature`, which the AI SDK refuses), Granite 4.0 Micro
33
+ // and gpt-oss-120b (Workers AI answers "Bad Request" to the run's tools), Alibaba, MiniMax and Meta's
34
+ // Muse (`/compat` knows no such provider), Perplexity, Mistral's own API and DeepSeek through
35
+ // Fireworks (`/compat` asks for the provider's key). OpenAI's GPT models (#1018) refuse
26
36
  // `max_tokens` (`outputLimit` names the field that caps a step's output) and call tools only with
27
- // `reasoning_effort: "none"` (`reasoningEffort`). Left out: `openai/gpt-6.1-sol`, which refuses
28
- // both tools with reasoning and "none" on Chat Completions and calls tools only through
29
- // `/responses`, and `deepseek/deepseek-v4-pro`, which Fireworks serves only through the REST API
30
- // with "Workers AI Read" (Spike #979).
37
+ // `reasoning_effort: "none"` (`reasoningEffort`); `openai/gpt-6.1-sol` and `gpt-6-sol` call tools only
38
+ // through `/responses` (Spike #979). GPT-6.1 Terra stays (#1059 keeps it) although it left its test
39
+ // card open twice (#1066).
31
40
  export const gatewayCatalog = [
32
41
  {
33
42
  gateway: "cloudflare",
@@ -40,34 +49,100 @@ export const gatewayCatalog = [
40
49
  price: { input: 1.32, cacheRead: 0.044, output: 3.96 },
41
50
  },
42
51
  {
43
- model: "anthropic/claude-sonnet-4-6",
44
- name: "Claude Sonnet 4.6",
45
- context: 200_000,
46
- price: { input: 3, cacheRead: 0.3, output: 15 },
52
+ model: "workers-ai/@cf/deepseek-ai/deepseek-v4.1-flash-1017",
53
+ name: "DeepSeek V4.1 Flash",
54
+ context: 1_048_576,
55
+ price: { input: 0.3, cacheRead: 0.006, output: 1.2 },
47
56
  },
48
57
  {
49
- model: "anthropic/claude-opus-4-6",
50
- name: "Claude Opus 4.6",
51
- context: 200_000,
52
- price: { input: 5, cacheRead: 0.5, output: 25 },
58
+ model: "anthropic/claude-haiku-5-5",
59
+ name: "Claude Haiku 5.5",
60
+ context: 1_000_000,
61
+ price: { input: 0.1, cacheRead: 0.01, cacheWrite: 0.125, output: 0.5 },
53
62
  },
54
63
  {
55
- model: "anthropic/claude-haiku-4-5",
56
- name: "Claude Haiku 4.5",
57
- context: 200_000,
58
- price: { input: 1, cacheRead: 0.1, output: 5 },
64
+ model: "anthropic/claude-sonnet-5-5",
65
+ name: "Claude Sonnet 5.5",
66
+ context: 1_000_000,
67
+ price: { input: 2, cacheRead: 0.1, cacheWrite: 2.5, output: 10 },
59
68
  },
60
69
  {
61
- model: "google-ai-studio/gemini-2.5-pro",
62
- name: "Gemini 2.5 Pro",
70
+ model: "anthropic/claude-opus-5-5",
71
+ name: "Claude Opus 5.5",
63
72
  context: 1_000_000,
64
- price: { input: 1.25, cacheRead: 0.125, output: 10 },
73
+ price: { input: 4, cacheRead: 0.2, cacheWrite: 5, output: 20 },
65
74
  },
66
75
  {
67
- model: "google-ai-studio/gemini-2.5-flash",
68
- name: "Gemini 2.5 Flash",
76
+ model: "anthropic/claude-fable-5-1",
77
+ name: "Claude Fable 5.1",
69
78
  context: 1_000_000,
70
- price: { input: 0.3, cacheRead: 0.03, output: 2.5 },
79
+ price: { input: 10, cacheRead: 0.25, cacheWrite: 12.5, output: 50 },
80
+ },
81
+ {
82
+ model: "xai/grok-4.7",
83
+ name: "Grok 4.7",
84
+ context: 500_000,
85
+ price: { input: 2, cacheRead: 0.5, output: 6 },
86
+ },
87
+ {
88
+ model: "moonshotai/kimi-k3",
89
+ name: "Kimi K3",
90
+ context: 1_048_576,
91
+ price: { input: 3, cacheRead: 0.3, output: 15 },
92
+ },
93
+ {
94
+ model: "workers-ai/@cf/moonshotai/kimi-k2.7-code",
95
+ name: "Kimi K2.7 Code",
96
+ context: 262_144,
97
+ price: { input: 0.95, cacheRead: 0.19, output: 4 },
98
+ },
99
+ {
100
+ model: "workers-ai/@cf/moonshotai/kimi-k2.6",
101
+ name: "Kimi K2.6",
102
+ context: 262_144,
103
+ price: { input: 0.95, cacheRead: 0.16, output: 4 },
104
+ },
105
+ {
106
+ model: "workers-ai/@cf/zai-org/glm-5.3",
107
+ name: "GLM 5.3",
108
+ context: 1_048_576,
109
+ price: { input: 1.4, cacheRead: 0.26, output: 4.4 },
110
+ },
111
+ {
112
+ model: "workers-ai/@cf/zai-org/glm-5.3-flash",
113
+ name: "GLM 5.3 Flash",
114
+ context: 1_048_576,
115
+ price: { input: 0.15, cacheRead: 0.03, output: 0.5 },
116
+ },
117
+ {
118
+ model: "workers-ai/@cf/qwen/qwen3.8-27b",
119
+ name: "Qwen3.8 27B",
120
+ context: 262_144,
121
+ price: { input: 0.45, cacheRead: 0.05, output: 3.2 },
122
+ },
123
+ {
124
+ model: "workers-ai/@cf/google/gemma-4-26b-a4b-it",
125
+ name: "Gemma 4 26B",
126
+ context: 256_000,
127
+ price: { input: 0.1, cacheRead: 0.1, output: 0.3 },
128
+ },
129
+ {
130
+ model: "workers-ai/@cf/nvidia/nemotron-3-120b-a12b",
131
+ name: "Nemotron 3 120B",
132
+ context: 256_000,
133
+ price: { input: 0.5, cacheRead: 0.5, output: 1.5 },
134
+ },
135
+ {
136
+ model: "workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct",
137
+ name: "Llama 4 Scout",
138
+ context: 131_000,
139
+ price: { input: 0.27, cacheRead: 0.27, output: 0.85 },
140
+ },
141
+ {
142
+ model: "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct",
143
+ name: "Mistral Small 3.1",
144
+ context: 128_000,
145
+ price: { input: 0.351, cacheRead: 0.351, output: 0.555 },
71
146
  },
72
147
  {
73
148
  model: "openai/gpt-6.1-terra",
@@ -91,6 +166,16 @@ export const gatewayCatalog = [
91
166
  function gatewayModelIds() {
92
167
  return gatewayCatalog.flatMap((entry) => entry.models.map((model) => model.model));
93
168
  }
169
+ // The models the catalog held before (#1011) and no longer holds (#1059): Claude 4.x and Gemini 2.5.
170
+ // They stay in `OperatorModel`, so an Operator stored on one still reads; it pauses with the reason
171
+ // `model` ("Modell nicht mehr im Katalog") until it gets a model of the catalog, and no run starts.
172
+ export const retiredGatewayModels = [
173
+ { model: "anthropic/claude-sonnet-4-6", name: "Claude Sonnet 4.6" },
174
+ { model: "anthropic/claude-opus-4-6", name: "Claude Opus 4.6" },
175
+ { model: "anthropic/claude-haiku-4-5", name: "Claude Haiku 4.5" },
176
+ { model: "google-ai-studio/gemini-2.5-pro", name: "Gemini 2.5 Pro" },
177
+ { model: "google-ai-studio/gemini-2.5-flash", name: "Gemini 2.5 Flash" },
178
+ ];
94
179
  // The entry of a model of the kind Gateway, or null for every other model.
95
180
  export function gatewayModelOf(model) {
96
181
  for (const entry of gatewayCatalog) {
@@ -170,6 +255,12 @@ export const operatorProviders = [
170
255
  export function modelsOf(entry, _kind) {
171
256
  return entry;
172
257
  }
258
+ // Whether a provider's catalog still holds this model (#1059). A provider without an entry (Codex and
259
+ // Gemini since #978) answers true: its Operators pause by their credential, not by their model.
260
+ export function inCatalog(provider, model) {
261
+ const entry = operatorProviders.find((item) => item.provider === provider);
262
+ return !entry || entry.models.includes(model);
263
+ }
173
264
  // `subscription`: the sign-in of a subscription, the token of `claude setup-token`; none for Codex
174
265
  // and Gemini since #459, a stored one reads as invalid. `apikey`: an API key (Claude Console,
175
266
  // OpenAI, Gemini API). The same words for every provider, so the Claude credentials stored before #455 keep their kind. Always the
@@ -196,16 +287,33 @@ export const OperatorModel = z.enum([
196
287
  "gemini-2.5-pro",
197
288
  "gemini-2.5-flash",
198
289
  "gemini-2.5-flash-lite",
199
- // The kind Gateway (#1011), `gatewayCatalog`.
290
+ // The kind Gateway (#1011, #1059), `gatewayCatalog`.
200
291
  "workers-ai/@cf/deepseek-ai/deepseek-v4-pro-0813",
292
+ "workers-ai/@cf/deepseek-ai/deepseek-v4.1-flash-1017",
293
+ "anthropic/claude-haiku-5-5",
294
+ "anthropic/claude-sonnet-5-5",
295
+ "anthropic/claude-opus-5-5",
296
+ "anthropic/claude-fable-5-1",
297
+ "xai/grok-4.7",
298
+ "moonshotai/kimi-k3",
299
+ "workers-ai/@cf/moonshotai/kimi-k2.7-code",
300
+ "workers-ai/@cf/moonshotai/kimi-k2.6",
301
+ "workers-ai/@cf/zai-org/glm-5.3",
302
+ "workers-ai/@cf/zai-org/glm-5.3-flash",
303
+ "workers-ai/@cf/qwen/qwen3.8-27b",
304
+ "workers-ai/@cf/google/gemma-4-26b-a4b-it",
305
+ "workers-ai/@cf/nvidia/nemotron-3-120b-a12b",
306
+ "workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct",
307
+ "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct",
308
+ // OpenAI through the gateway (#1018).
309
+ "openai/gpt-6.1-terra",
310
+ "openai/gpt-6-luna",
311
+ // Out of the catalog since #1059 (`retiredGatewayModels`): a stored Operator still reads.
201
312
  "anthropic/claude-sonnet-4-6",
202
313
  "anthropic/claude-opus-4-6",
203
314
  "anthropic/claude-haiku-4-5",
204
315
  "google-ai-studio/gemini-2.5-pro",
205
316
  "google-ai-studio/gemini-2.5-flash",
206
- // OpenAI through the gateway (#1018).
207
- "openai/gpt-6.1-terra",
208
- "openai/gpt-6-luna",
209
317
  ]);
210
318
  export const CredentialId = idSchema("credential");
211
319
  const CredentialName = z.string().trim().min(1).max(64);
@@ -381,7 +489,18 @@ export const OperatorState = z.enum(["no_role", "ready", "paused"]);
381
489
  // `owner`: a personal Operator whose person is locked (E143), derived like `credential`.
382
490
  // `budget`: its person's limit of the month is reached (E143, #804); it ends on the first of the next
383
491
  // month (UTC), or when an admin raises the limit.
384
- export const PauseReason = z.enum(["manual", "limit", "failures", "credential", "owner", "budget"]);
492
+ // `model` (#1059): its model is no longer in its provider's catalog ("Modell nicht mehr im Katalog"),
493
+ // derived like `credential`; it ends once the Operator gets a model of the catalog
494
+ // (`operator_machine_update`).
495
+ export const PauseReason = z.enum([
496
+ "manual",
497
+ "limit",
498
+ "failures",
499
+ "credential",
500
+ "owner",
501
+ "budget",
502
+ "model",
503
+ ]);
385
504
  export const MachineListInput = z.strictObject({
386
505
  personal: Flag.optional().describe("true: the personal Operators (E143), your own, or every person's for an admin in admin mode. Leaving it out lists the company's Operators; without admin rights you read your own personal ones only, whatever you send."),
387
506
  cursor: MachineId.optional(),
package/dist/sdk.d.ts CHANGED
@@ -17,7 +17,7 @@ export { ActorKind, Event, EventId, EventKind, EventList, EventListInput, EventS
17
17
  export { ExcerptCursor, excerptChars, RowsExcerpt, TextExcerpt } from "./excerpt/excerpt.js";
18
18
  export { FileCreateInput, FileDetail, type FileFormat, FileGetInput, FileId, FileTextState, FileUpdateInput, FileUpload, fileFormatExtensions, fileFormatOf, fileTextStates, maxFileBytes, UploadTicket, uploadTicketHeader, uploadTicketLifetimeMs, } from "./files/files.js";
19
19
  export { FunctionRemoved, ServiceInterfaceFunctionCreateInput, ServiceInterfaceFunctionRemoveInput, ServiceInterfaceFunctionUpdateInput, } from "./functions/functions.js";
20
- export { GadgetAccess, GadgetCall, GadgetCallCreateInput, GadgetCallEntry, GadgetCallGetInput, GadgetCallItem, GadgetCallList, GadgetCallListInput, GadgetCallStatus, GadgetChange, GadgetClientLog, GadgetConsoleLine, GadgetCreateInput, GadgetDetail, GadgetDiffFile, GadgetFile, GadgetFilePath, GadgetFunction, GadgetFunctionName, GadgetGetInput, GadgetLevel, GadgetManifest, GadgetPublishInput, GadgetRequires, GadgetSettings, GadgetTestHooks, GadgetTestInput, GadgetTestResult, GadgetTestRun, GadgetToolUse, GadgetUpdateInput, GadgetUseRight, GadgetUses, GadgetVersionRef, gadgetLimits, gadgetLogDays, TestLimits, testLimits, testLimitsText, } from "./gadgets/gadgets.js";
20
+ export { GadgetAccess, GadgetCall, GadgetCallCreateInput, GadgetCallEntry, GadgetCallGetInput, GadgetCallItem, GadgetCallList, GadgetCallListInput, GadgetCallStatus, GadgetChange, GadgetClientLog, GadgetConsoleLine, GadgetCreateInput, GadgetDetail, GadgetDiffFile, GadgetDistAnswer, GadgetFile, GadgetFilePath, GadgetFunction, GadgetFunctionName, GadgetGetInput, GadgetLevel, GadgetManifest, GadgetPublishInput, GadgetRequires, GadgetSettings, GadgetTestHooks, GadgetTestInput, GadgetTestResult, GadgetTestRun, GadgetToolUse, GadgetUpdateInput, GadgetUseRight, GadgetUses, GadgetVersionRef, gadgetLimits, gadgetLogDays, TestLimits, testLimits, testLimitsText, } from "./gadgets/gadgets.js";
21
21
  export { GoalCheck, GoalCreateInput, GoalDetail, GoalFields, GoalFollowUp, GoalGetInput, GoalId, GoalPlanning, GoalPlanStep, GoalProof, GoalReady, GoalReport, GoalRunCancelInput, GoalRunCompleteInput, GoalRunCreateInput, GoalRunDetail, GoalRunGetInput, GoalRunItem, GoalRunList, GoalRunListInput, GoalRunStatus, GoalRunTrigger, GoalRunUpdateInput, GoalSession, GoalUpdateInput, goalPlannings, goalRunStatuses, } from "./goals/goals.js";
22
22
  export { type Action, actions, hasRoute, isAction, isPackage, isWord, type Package, packages, parseConnectorFunction, parseToolName, type Resource, type Route, resources, type ToolName, toolAnnotations, toolEvent, toolPermission, toolRoute, toolSchemaName, verbs, } from "./grammar/grammar.js";
23
23
  export { GrantId, GrantRight, NodeGrant, NodeGrantList, NodeGrantListInput, NodeGrantRevoked, NodeGrantRevokeInput, NodeShared, NodeShareInput, } from "./grants/grants.js";
@@ -30,10 +30,10 @@ export { defaultLinkDays, GadgetLink, GadgetLinkCallInput, GadgetLinkCodeInput,
30
30
  export { Flag, Limit } from "./list-input.js";
31
31
  export { MachineArchiveInput, MachineCreateInput, MachineId, MachineKey, MachinePurged, MachinePurgeInput, MachineRestoreInput, MachineRotateInput, MachineUpdateInput, } from "./machines/machines.js";
32
32
  export { Mcp, McpAuth, McpCall, McpCallAction, McpCallList, McpCallListInput, type McpCatalogEntry, McpCatalogId, McpCreateInput, McpGetInput, McpId, McpList, McpListInput, McpRevokeInput, McpState, McpTestInput, McpTool, McpUpdateInput, mcpCatalog, } from "./mcps/mcps.js";
33
- export { ChatRead, ChatUpdateInput, Message, MessageAuthor, MessageCreateInput, MessageId, MessageList, MessageListInput, messageMaxLength, } from "./messages/messages.js";
33
+ export { ChatRead, ChatTopic, ChatUpdateInput, Message, MessageAuthor, MessageCreateInput, MessageId, MessageList, MessageListInput, messageMaxLength, TopicName, topicMaxLength, topicOf, } from "./messages/messages.js";
34
34
  export { Missing, MissingCall, MissingCode, missingCodes, Reached, } from "./missing/missing.js";
35
35
  export { BoardShownKind, BoardSystem, FolderCreated, FolderCreateInput, IntelligenceUser, IntelligenceUserList, IntelligenceUserListInput, NodeDetail, NodeGetInput, NodeHit, NodeHitFoundIn, NodeHitGroup, NodeId, NodeKind, NodeKindRead, NodeList, NodeListInput, NodeListItem, NodeMoved, NodeMoveInput, NodePath, NodePerson, NodeQuery, NodeReader, NodeSearch, NodeSection, NodeSort, NodeUpdateInput, NodeValidation, nodeKinds, responsibleKinds, SearchIndexState, SecretFields, SecretId, unknownNodeKind, } from "./nodes/nodes.js";
36
- export { ChangeTrigger, Credential, CredentialCreateInput, CredentialGetInput, CredentialId, CredentialKind, CredentialList, CredentialListInput, CredentialRevokeInput, CredentialState, CredentialTested, CredentialTestInput, CredentialTestResult, CredentialUpdateInput, cacheWritePriceOf, compactRunLimit, type GatewayModel, type GatewayModelEntry, GatewayModelEntrySchema, type GatewayOutputLimit, GatewayRight, GatewayRightCheck, GatewayTarget, gatewayCatalog, gatewayModelOf, KeepStepsDays, MachineDisableInput, MachineEnableInput, MachineGetInput, MachineListInput, modelsOf, Operator, OperatorBudget, OperatorLimits, OperatorList, OperatorMachineArchiveInput, OperatorMachineCreateInput, OperatorMachineRestoreInput, OperatorMachineUpdateInput, OperatorModel, type OperatorProviderEntry, OperatorRun, OperatorRunAgents, OperatorRunCostSource, OperatorRunFallbackReason, OperatorRunGetInput, OperatorRunId, OperatorRunInstructions, OperatorRunList, OperatorRunListInput, OperatorRunReason, OperatorRunStatus, OperatorRunStep, OperatorRunStepKind, OperatorRunStepList, OperatorRunTokens, OperatorRunTouched, OperatorRunTrigger, OperatorRunUsage, OperatorRunWoken, OperatorState, OperatorUser, OperatorUserList, OperatorUserListInput, OperatorUserUpdateInput, operatorDefaults, operatorProviders, outputLimitOf, PauseReason, planAnswerOf, RunCancelInput, RunPlanAnswer, RunPlanStep, RunStepListInput, RunUpdateInput, reasoningEffortOf, runPlanMax, runSummaryChars, Subagents, scheduleQuietMinutes, Trigger, validatorTrigger, } from "./operators/operators.js";
36
+ export { ChangeTrigger, Credential, CredentialCreateInput, CredentialGetInput, CredentialId, CredentialKind, CredentialList, CredentialListInput, CredentialRevokeInput, CredentialState, CredentialTested, CredentialTestInput, CredentialTestResult, CredentialUpdateInput, cacheWritePriceOf, compactRunLimit, type GatewayModel, type GatewayModelEntry, GatewayModelEntrySchema, type GatewayOutputLimit, GatewayRight, GatewayRightCheck, GatewayTarget, gatewayCatalog, gatewayModelOf, inCatalog, KeepStepsDays, MachineDisableInput, MachineEnableInput, MachineGetInput, MachineListInput, modelsOf, Operator, OperatorBudget, OperatorLimits, OperatorList, OperatorMachineArchiveInput, OperatorMachineCreateInput, OperatorMachineRestoreInput, OperatorMachineUpdateInput, OperatorModel, type OperatorProviderEntry, OperatorRun, OperatorRunAgents, OperatorRunCostSource, OperatorRunFallbackReason, OperatorRunGetInput, OperatorRunId, OperatorRunInstructions, OperatorRunList, OperatorRunListInput, OperatorRunReason, OperatorRunStatus, OperatorRunStep, OperatorRunStepKind, OperatorRunStepList, OperatorRunTokens, OperatorRunTouched, OperatorRunTrigger, OperatorRunUsage, OperatorRunWoken, OperatorState, OperatorUser, OperatorUserList, OperatorUserListInput, OperatorUserUpdateInput, operatorDefaults, operatorProviders, outputLimitOf, PauseReason, planAnswerOf, type RetiredGatewayModel, RunCancelInput, RunPlanAnswer, RunPlanStep, RunStepListInput, RunUpdateInput, reasoningEffortOf, retiredGatewayModels, runPlanMax, runSummaryChars, Subagents, scheduleQuietMinutes, Trigger, validatorTrigger, } from "./operators/operators.js";
37
37
  export { Currency, CurrencyRate, currencies, Organisation, OrganisationGetInput, OrganisationUpdateInput, } from "./organisation/organisation.js";
38
38
  export { PageDetail, PageGetInput, PageHead, PageHeading, PageId, PageList, PageListInput, PageSummary, } from "./pages/pages.js";
39
39
  export { AgentName, gatewayAgentsMax, IdempotencyKey, PlanSubstep, planEvidenceMax, Rev, } from "./primitives/primitives.js";
@@ -47,7 +47,7 @@ export { NodeSecret, NodeSecretCreateInput, NodeSecretDetail, NodeSecretGetInput
47
47
  export { type Authorized, type AuthorizeResult, createServiceClient, type InterfaceDeclaredResult, type InterfaceRemovedResult, type ServiceClient, type ServiceClientDeps, type ServiceClientFailure, } from "./service-client/service-client.js";
48
48
  export { ConsentResource, FunctionId, InterfaceId, RightWord, Service, ServiceArchiveInput, ServiceCreateInput, ServiceFunction, ServiceId, ServiceInterface, ServiceKeyIssued, ServiceList, ServiceListInput, ServiceName, ServicePurged, ServicePurgeInput, ServiceRestoreInput, ServiceRotateInput, ServiceUpdateInput, } from "./services/services.js";
49
49
  export { SkillCallName, SkillCaseCalls, SkillCaseResult, SkillCreateInput, SkillDetail, SkillFields, SkillFile, SkillFilePath, SkillGetInput, SkillId, SkillOffer, SkillPoint, SkillRunCall, SkillRunDetail, SkillRunGetInput, SkillRunItem, SkillRunList, SkillRunListInput, SkillTestInput, SkillTestReport, SkillToken, SkillTokenCreateInput, SkillTokens, SkillTriggerHit, SkillUpdateInput, SkillWriteName, skillCaseStatuses, skillFilePattern, skillRunKinds, skillRunStatuses, } from "./skills/skills.js";
50
- export { ItemId, QueryId, SourceAccess, SourceCreateInput, SourceDetail, SourceField, SourceFieldType, SourceGetInput, SourceItem, SourceItemList, SourceItemListInput, SourceManifest, SourcePaging, SourceParam, SourcePath, SourceProbe, SourcePublishInput, SourceQuery, SourceQueryArchiveInput, SourceQueryCreateInput, SourceQueryList, SourceQueryListInput, SourceQueryRestoreInput, SourceQueryUpdateInput, SourceRun, SourceRunCounts, SourceRunCreateInput, SourceRunFailure, SourceRunGetInput, SourceRunList, SourceRunListInput, SourceSchedule, SourceSecretsInput, SourceStep, SourceTestInput, SourceUpdateInput, SourceVersionRef, SourceWhere, sourceCleans, sourceCodePath, sourceEvery, sourceFieldTypes, sourceKeepDays, sourceLimits, sourceManifestPath, sourceSchema, } from "./sources/sources.js";
50
+ export { ItemId, QueryId, SourceAccess, SourceCreateInput, SourceDetail, SourceField, SourceFieldType, SourceGetInput, SourceItem, SourceItemList, SourceItemListInput, SourceManifest, SourcePaging, SourceParam, SourcePath, SourceProbe, SourcePublishInput, SourceQuery, SourceQueryArchiveInput, SourceQueryCreateInput, SourceQueryList, SourceQueryListInput, SourceQueryRestoreInput, SourceQueryUpdateInput, SourceRun, SourceRunCounts, SourceRunCreateInput, SourceRunFailure, SourceRunFailureRead, SourceRunGetInput, SourceRunList, SourceRunListInput, SourceSchedule, SourceSecretsInput, SourceStep, SourceTestInput, SourceUpdateInput, SourceVersionRef, SourceWhere, sourceCleans, sourceCodePath, sourceEvery, sourceFieldTypes, sourceFormHeaders, sourceKeepDays, sourceLimits, sourceManifestPath, sourceSchema, } from "./sources/sources.js";
51
51
  export { maxTableColumns, maxTableRows, RowLimit, TableColumn, TableColumnChange, TableColumnType, TableCreateInput, TableDetail, TableExcerpt, TableFilter, TableGetInput, TableId, TableSaved, TableSort, TableUpdateInput, tableColumnTypes, tableFormats, } from "./tables/tables.js";
52
52
  export { type Actor, defineTool, type Permission, type Tool, type ToolAnnotations, type ToolContext, type ToolInput, type ToolSource, } from "./tool.js";
53
53
  export { compareTreeNames, treeKindOrder, treeKindRank, } from "./tree-order/tree-order.js";
package/dist/sdk.js CHANGED
@@ -20,7 +20,7 @@ export { ActorKind, Event, EventId, EventKind, EventList, EventListInput, EventS
20
20
  export { ExcerptCursor, excerptChars, RowsExcerpt, TextExcerpt } from "./excerpt/excerpt.js";
21
21
  export { FileCreateInput, FileDetail, FileGetInput, FileId, FileTextState, FileUpdateInput, FileUpload, fileFormatExtensions, fileFormatOf, fileTextStates, maxFileBytes, UploadTicket, uploadTicketHeader, uploadTicketLifetimeMs, } from "./files/files.js";
22
22
  export { FunctionRemoved, ServiceInterfaceFunctionCreateInput, ServiceInterfaceFunctionRemoveInput, ServiceInterfaceFunctionUpdateInput, } from "./functions/functions.js";
23
- export { GadgetAccess, GadgetCall, GadgetCallCreateInput, GadgetCallEntry, GadgetCallGetInput, GadgetCallItem, GadgetCallList, GadgetCallListInput, GadgetCallStatus, GadgetChange, GadgetClientLog, GadgetConsoleLine, GadgetCreateInput, GadgetDetail, GadgetDiffFile, GadgetFile, GadgetFilePath, GadgetFunction, GadgetFunctionName, GadgetGetInput, GadgetLevel, GadgetManifest, GadgetPublishInput, GadgetRequires, GadgetSettings, GadgetTestHooks, GadgetTestInput, GadgetTestResult, GadgetTestRun, GadgetToolUse, GadgetUpdateInput, GadgetUseRight, GadgetUses, GadgetVersionRef, gadgetLimits, gadgetLogDays, TestLimits, testLimits, testLimitsText, } from "./gadgets/gadgets.js";
23
+ export { GadgetAccess, GadgetCall, GadgetCallCreateInput, GadgetCallEntry, GadgetCallGetInput, GadgetCallItem, GadgetCallList, GadgetCallListInput, GadgetCallStatus, GadgetChange, GadgetClientLog, GadgetConsoleLine, GadgetCreateInput, GadgetDetail, GadgetDiffFile, GadgetDistAnswer, GadgetFile, GadgetFilePath, GadgetFunction, GadgetFunctionName, GadgetGetInput, GadgetLevel, GadgetManifest, GadgetPublishInput, GadgetRequires, GadgetSettings, GadgetTestHooks, GadgetTestInput, GadgetTestResult, GadgetTestRun, GadgetToolUse, GadgetUpdateInput, GadgetUseRight, GadgetUses, GadgetVersionRef, gadgetLimits, gadgetLogDays, TestLimits, testLimits, testLimitsText, } from "./gadgets/gadgets.js";
24
24
  export { GoalCheck, GoalCreateInput, GoalDetail, GoalFields, GoalFollowUp, GoalGetInput, GoalId, GoalPlanning, GoalPlanStep, GoalProof, GoalReady, GoalReport, GoalRunCancelInput, GoalRunCompleteInput, GoalRunCreateInput, GoalRunDetail, GoalRunGetInput, GoalRunItem, GoalRunList, GoalRunListInput, GoalRunStatus, GoalRunTrigger, GoalRunUpdateInput, GoalSession, GoalUpdateInput, goalPlannings, goalRunStatuses, } from "./goals/goals.js";
25
25
  export { actions, hasRoute, isAction, isPackage, isWord, packages, parseConnectorFunction, parseToolName, resources, toolAnnotations, toolEvent, toolPermission, toolRoute, toolSchemaName, verbs, } from "./grammar/grammar.js";
26
26
  export { GrantId, GrantRight, NodeGrant, NodeGrantList, NodeGrantListInput, NodeGrantRevoked, NodeGrantRevokeInput, NodeShared, NodeShareInput, } from "./grants/grants.js";
@@ -33,10 +33,10 @@ export { defaultLinkDays, GadgetLink, GadgetLinkCallInput, GadgetLinkCodeInput,
33
33
  export { Flag, Limit } from "./list-input.js";
34
34
  export { MachineArchiveInput, MachineCreateInput, MachineId, MachineKey, MachinePurged, MachinePurgeInput, MachineRestoreInput, MachineRotateInput, MachineUpdateInput, } from "./machines/machines.js";
35
35
  export { Mcp, McpAuth, McpCall, McpCallAction, McpCallList, McpCallListInput, McpCatalogId, McpCreateInput, McpGetInput, McpId, McpList, McpListInput, McpRevokeInput, McpState, McpTestInput, McpTool, McpUpdateInput, mcpCatalog, } from "./mcps/mcps.js";
36
- export { ChatRead, ChatUpdateInput, Message, MessageAuthor, MessageCreateInput, MessageId, MessageList, MessageListInput, messageMaxLength, } from "./messages/messages.js";
36
+ export { ChatRead, ChatTopic, ChatUpdateInput, Message, MessageAuthor, MessageCreateInput, MessageId, MessageList, MessageListInput, messageMaxLength, TopicName, topicMaxLength, topicOf, } from "./messages/messages.js";
37
37
  export { Missing, MissingCall, MissingCode, missingCodes, Reached, } from "./missing/missing.js";
38
38
  export { BoardShownKind, BoardSystem, FolderCreated, FolderCreateInput, IntelligenceUser, IntelligenceUserList, IntelligenceUserListInput, NodeDetail, NodeGetInput, NodeHit, NodeHitFoundIn, NodeHitGroup, NodeId, NodeKind, NodeKindRead, NodeList, NodeListInput, NodeListItem, NodeMoved, NodeMoveInput, NodePath, NodePerson, NodeQuery, NodeReader, NodeSearch, NodeSection, NodeSort, NodeUpdateInput, NodeValidation, nodeKinds, responsibleKinds, SearchIndexState, SecretFields, SecretId, unknownNodeKind, } from "./nodes/nodes.js";
39
- export { ChangeTrigger, Credential, CredentialCreateInput, CredentialGetInput, CredentialId, CredentialKind, CredentialList, CredentialListInput, CredentialRevokeInput, CredentialState, CredentialTested, CredentialTestInput, CredentialTestResult, CredentialUpdateInput, cacheWritePriceOf, compactRunLimit, GatewayModelEntrySchema, GatewayRight, GatewayRightCheck, GatewayTarget, gatewayCatalog, gatewayModelOf, KeepStepsDays, MachineDisableInput, MachineEnableInput, MachineGetInput, MachineListInput, modelsOf, Operator, OperatorBudget, OperatorLimits, OperatorList, OperatorMachineArchiveInput, OperatorMachineCreateInput, OperatorMachineRestoreInput, OperatorMachineUpdateInput, OperatorModel, OperatorRun, OperatorRunAgents, OperatorRunCostSource, OperatorRunFallbackReason, OperatorRunGetInput, OperatorRunId, OperatorRunInstructions, OperatorRunList, OperatorRunListInput, OperatorRunReason, OperatorRunStatus, OperatorRunStep, OperatorRunStepKind, OperatorRunStepList, OperatorRunTokens, OperatorRunTouched, OperatorRunTrigger, OperatorRunUsage, OperatorRunWoken, OperatorState, OperatorUser, OperatorUserList, OperatorUserListInput, OperatorUserUpdateInput, operatorDefaults, operatorProviders, outputLimitOf, PauseReason, planAnswerOf, RunCancelInput, RunPlanAnswer, RunPlanStep, RunStepListInput, RunUpdateInput, reasoningEffortOf, runPlanMax, runSummaryChars, Subagents, scheduleQuietMinutes, Trigger, validatorTrigger, } from "./operators/operators.js";
39
+ export { ChangeTrigger, Credential, CredentialCreateInput, CredentialGetInput, CredentialId, CredentialKind, CredentialList, CredentialListInput, CredentialRevokeInput, CredentialState, CredentialTested, CredentialTestInput, CredentialTestResult, CredentialUpdateInput, cacheWritePriceOf, compactRunLimit, GatewayModelEntrySchema, GatewayRight, GatewayRightCheck, GatewayTarget, gatewayCatalog, gatewayModelOf, inCatalog, KeepStepsDays, MachineDisableInput, MachineEnableInput, MachineGetInput, MachineListInput, modelsOf, Operator, OperatorBudget, OperatorLimits, OperatorList, OperatorMachineArchiveInput, OperatorMachineCreateInput, OperatorMachineRestoreInput, OperatorMachineUpdateInput, OperatorModel, OperatorRun, OperatorRunAgents, OperatorRunCostSource, OperatorRunFallbackReason, OperatorRunGetInput, OperatorRunId, OperatorRunInstructions, OperatorRunList, OperatorRunListInput, OperatorRunReason, OperatorRunStatus, OperatorRunStep, OperatorRunStepKind, OperatorRunStepList, OperatorRunTokens, OperatorRunTouched, OperatorRunTrigger, OperatorRunUsage, OperatorRunWoken, OperatorState, OperatorUser, OperatorUserList, OperatorUserListInput, OperatorUserUpdateInput, operatorDefaults, operatorProviders, outputLimitOf, PauseReason, planAnswerOf, RunCancelInput, RunPlanAnswer, RunPlanStep, RunStepListInput, RunUpdateInput, reasoningEffortOf, retiredGatewayModels, runPlanMax, runSummaryChars, Subagents, scheduleQuietMinutes, Trigger, validatorTrigger, } from "./operators/operators.js";
40
40
  export { Currency, CurrencyRate, currencies, Organisation, OrganisationGetInput, OrganisationUpdateInput, } from "./organisation/organisation.js";
41
41
  export { PageDetail, PageGetInput, PageHead, PageHeading, PageId, PageList, PageListInput, PageSummary, } from "./pages/pages.js";
42
42
  export { AgentName, gatewayAgentsMax, IdempotencyKey, PlanSubstep, planEvidenceMax, Rev, } from "./primitives/primitives.js";
@@ -50,7 +50,7 @@ export { NodeSecret, NodeSecretCreateInput, NodeSecretDetail, NodeSecretGetInput
50
50
  export { createServiceClient, } from "./service-client/service-client.js";
51
51
  export { ConsentResource, FunctionId, InterfaceId, RightWord, Service, ServiceArchiveInput, ServiceCreateInput, ServiceFunction, ServiceId, ServiceInterface, ServiceKeyIssued, ServiceList, ServiceListInput, ServiceName, ServicePurged, ServicePurgeInput, ServiceRestoreInput, ServiceRotateInput, ServiceUpdateInput, } from "./services/services.js";
52
52
  export { SkillCallName, SkillCaseCalls, SkillCaseResult, SkillCreateInput, SkillDetail, SkillFields, SkillFile, SkillFilePath, SkillGetInput, SkillId, SkillOffer, SkillPoint, SkillRunCall, SkillRunDetail, SkillRunGetInput, SkillRunItem, SkillRunList, SkillRunListInput, SkillTestInput, SkillTestReport, SkillToken, SkillTokenCreateInput, SkillTokens, SkillTriggerHit, SkillUpdateInput, SkillWriteName, skillCaseStatuses, skillFilePattern, skillRunKinds, skillRunStatuses, } from "./skills/skills.js";
53
- export { ItemId, QueryId, SourceAccess, SourceCreateInput, SourceDetail, SourceField, SourceFieldType, SourceGetInput, SourceItem, SourceItemList, SourceItemListInput, SourceManifest, SourcePaging, SourceParam, SourcePath, SourceProbe, SourcePublishInput, SourceQuery, SourceQueryArchiveInput, SourceQueryCreateInput, SourceQueryList, SourceQueryListInput, SourceQueryRestoreInput, SourceQueryUpdateInput, SourceRun, SourceRunCounts, SourceRunCreateInput, SourceRunFailure, SourceRunGetInput, SourceRunList, SourceRunListInput, SourceSchedule, SourceSecretsInput, SourceStep, SourceTestInput, SourceUpdateInput, SourceVersionRef, SourceWhere, sourceCleans, sourceCodePath, sourceEvery, sourceFieldTypes, sourceKeepDays, sourceLimits, sourceManifestPath, sourceSchema, } from "./sources/sources.js";
53
+ export { ItemId, QueryId, SourceAccess, SourceCreateInput, SourceDetail, SourceField, SourceFieldType, SourceGetInput, SourceItem, SourceItemList, SourceItemListInput, SourceManifest, SourcePaging, SourceParam, SourcePath, SourceProbe, SourcePublishInput, SourceQuery, SourceQueryArchiveInput, SourceQueryCreateInput, SourceQueryList, SourceQueryListInput, SourceQueryRestoreInput, SourceQueryUpdateInput, SourceRun, SourceRunCounts, SourceRunCreateInput, SourceRunFailure, SourceRunFailureRead, SourceRunGetInput, SourceRunList, SourceRunListInput, SourceSchedule, SourceSecretsInput, SourceStep, SourceTestInput, SourceUpdateInput, SourceVersionRef, SourceWhere, sourceCleans, sourceCodePath, sourceEvery, sourceFieldTypes, sourceFormHeaders, sourceKeepDays, sourceLimits, sourceManifestPath, sourceSchema, } from "./sources/sources.js";
54
54
  export { maxTableColumns, maxTableRows, RowLimit, TableColumn, TableColumnChange, TableColumnType, TableCreateInput, TableDetail, TableExcerpt, TableFilter, TableGetInput, TableId, TableSaved, TableSort, TableUpdateInput, tableColumnTypes, tableFormats, } from "./tables/tables.js";
55
55
  export { defineTool, } from "./tool.js";
56
56
  export { compareTreeNames, treeKindOrder, treeKindRank, } from "./tree-order/tree-order.js";
@@ -86,6 +86,9 @@ export declare const SourceManifest: z.ZodObject<{
86
86
  }>;
87
87
  base: z.ZodString;
88
88
  hosts: z.ZodArray<z.ZodString>;
89
+ limits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
90
+ perHour: z.ZodNumber;
91
+ }, z.core.$strict>>>;
89
92
  access: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
90
93
  kind: z.ZodLiteral<"bearer">;
91
94
  secret: z.ZodString;
@@ -164,6 +167,7 @@ export declare const sourceLimits: {
164
167
  readonly requests: 50;
165
168
  readonly items: 1000;
166
169
  };
170
+ export declare const sourceFormHeaders: readonly ["accept", "faces-request", "x-requested-with"];
167
171
  export declare const sourceKeepDays: readonly [30, 90, 180];
168
172
  export declare const sourceEvery: readonly ["hour", "day", "week"];
169
173
  export declare const SourceSchedule: z.ZodObject<{
@@ -432,7 +436,16 @@ export declare const SourceRunFailure: z.ZodEnum<{
432
436
  provider: "provider";
433
437
  code: "code";
434
438
  host: "host";
439
+ throttled: "throttled";
435
440
  }>;
441
+ export declare const SourceRunFailureRead: z.ZodCatch<z.ZodEnum<{
442
+ unknown: "unknown";
443
+ access: "access";
444
+ provider: "provider";
445
+ code: "code";
446
+ host: "host";
447
+ throttled: "throttled";
448
+ }>>;
436
449
  export declare const sourceRunTriggers: readonly ["schedule", "play", "probe"];
437
450
  export declare const SourceRunTriggerRead: z.ZodCatch<z.ZodEnum<{
438
451
  unknown: "unknown";
@@ -467,12 +480,14 @@ export declare const SourceRun: z.ZodObject<{
467
480
  succeeded: "succeeded";
468
481
  failed: "failed";
469
482
  }>;
470
- failure: z.ZodNullable<z.ZodEnum<{
483
+ failure: z.ZodNullable<z.ZodCatch<z.ZodEnum<{
484
+ unknown: "unknown";
471
485
  access: "access";
472
486
  provider: "provider";
473
487
  code: "code";
474
488
  host: "host";
475
- }>>;
489
+ throttled: "throttled";
490
+ }>>>;
476
491
  message: z.ZodNullable<z.ZodString>;
477
492
  counts: z.ZodObject<{
478
493
  fetched: z.ZodNumber;
@@ -524,12 +539,14 @@ export declare const SourceRunList: z.ZodObject<{
524
539
  succeeded: "succeeded";
525
540
  failed: "failed";
526
541
  }>;
527
- failure: z.ZodNullable<z.ZodEnum<{
542
+ failure: z.ZodNullable<z.ZodCatch<z.ZodEnum<{
543
+ unknown: "unknown";
528
544
  access: "access";
529
545
  provider: "provider";
530
546
  code: "code";
531
547
  host: "host";
532
- }>>;
548
+ throttled: "throttled";
549
+ }>>>;
533
550
  message: z.ZodNullable<z.ZodString>;
534
551
  counts: z.ZodObject<{
535
552
  fetched: z.ZodNumber;
@@ -690,12 +707,14 @@ export declare const SourceProbe: z.ZodObject<{
690
707
  succeeded: "succeeded";
691
708
  failed: "failed";
692
709
  }>;
693
- failure: z.ZodNullable<z.ZodEnum<{
710
+ failure: z.ZodNullable<z.ZodCatch<z.ZodEnum<{
711
+ unknown: "unknown";
694
712
  access: "access";
695
713
  provider: "provider";
696
714
  code: "code";
697
715
  host: "host";
698
- }>>;
716
+ throttled: "throttled";
717
+ }>>>;
699
718
  message: z.ZodNullable<z.ZodString>;
700
719
  counts: z.ZodObject<{
701
720
  fetched: z.ZodNumber;
@@ -739,6 +758,9 @@ export declare const SourceDetail: z.ZodObject<{
739
758
  }>;
740
759
  base: z.ZodString;
741
760
  hosts: z.ZodArray<z.ZodString>;
761
+ limits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
762
+ perHour: z.ZodNumber;
763
+ }, z.core.$strict>>>;
742
764
  access: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
743
765
  kind: z.ZodLiteral<"bearer">;
744
766
  secret: z.ZodString;
@@ -90,6 +90,11 @@ export const SourceManifest = z.strictObject({
90
90
  base: z.string().min(1).max(500),
91
91
  // The only hosts a request reaches: host names, never an address.
92
92
  hosts: z.array(z.string().min(1).max(253)).min(1).max(10),
93
+ // At most `perHour` requests to a host of `hosts` in any 60 minutes, counted per installation
94
+ // across every run and query (E222), for a provider whose terms set a limit.
95
+ limits: z
96
+ .record(z.string().min(1).max(253), z.strictObject({ perHour: z.number().int().min(1).max(1000) }))
97
+ .optional(),
93
98
  access: SourceAccess.optional(),
94
99
  secrets: z
95
100
  .record(SecretName, z.strictObject({ label: z.string().min(1).max(100), help: z.string().max(500).optional() }))
@@ -114,10 +119,10 @@ export const sourceCodePath = "source.js";
114
119
  // A run's limits (Nodes › Quelle › Grenzen).
115
120
  export const sourceLimits = {
116
121
  timeoutMs: 10_000,
117
- // An answer read whole, by `api.json`, `api.text` and `api.post` of a `source.js`: as much as a
118
- // connector's bridge (`bridgeLimits.bytes`).
122
+ // An answer read whole, by `api.json`, `api.text`, `api.post` and `api.form` of a `source.js`: as
123
+ // much as a connector's bridge (`bridgeLimits.bytes`).
119
124
  bytes: 5 * 1024 * 1024,
120
- // An answer read in the stream, every page of kind json and rss and `api.each` (#936): only a brake
125
+ // An answer read in the stream, every page of kind json and rss, `api.each` and `api.chunks`: a brake
121
126
  // against an answer without end, because a run keeps the entries it needs and never the answer.
122
127
  streamBytes: 50 * 1024 * 1024,
123
128
  pages: 5,
@@ -125,6 +130,9 @@ export const sourceLimits = {
125
130
  requests: 50,
126
131
  items: 1000,
127
132
  };
133
+ // The only headers a `source.js` sets itself, on `api.form` (E222): what a portal's Ajax form asks
134
+ // for. Every other header is refused before anything is sent.
135
+ export const sourceFormHeaders = ["accept", "faces-request", "x-requested-with"];
128
136
  export const sourceKeepDays = [30, 90, 180];
129
137
  const KeepDays = z
130
138
  .union([z.literal(30), z.literal(90), z.literal(180)])
@@ -340,8 +348,14 @@ export const SourceRunCounts = z.object({
340
348
  });
341
349
  // Why a run failed: `host` a request to a host the source does not name (sent nowhere), `access`
342
350
  // the provider refused the key (401, 403), `provider` it failed otherwise, `code` the source's code
343
- // or manifest broke.
344
- export const SourceRunFailure = z.enum(["host", "access", "provider", "code"]);
351
+ // or manifest broke, `throttled` a host's budget of `limits` was used for this hour (E222), sent
352
+ // nowhere and the source not paused.
353
+ export const SourceRunFailure = z.enum(["host", "access", "provider", "code", "throttled"]);
354
+ // ⚠️ Read tolerantly in answers, like `trigger`: a failure an older tab does not know reads as
355
+ // `unknown` instead of failing the whole list on every poll (E222 added `throttled`).
356
+ export const SourceRunFailureRead = z
357
+ .enum([...SourceRunFailure.options, "unknown"])
358
+ .catch("unknown");
345
359
  // How a run started. ⚠️ Read tolerantly (like `NodeKindRead`, #784): a value an older tab does not
346
360
  // know reads as `unknown` instead of failing the whole list on every poll (review of PR #1003).
347
361
  export const sourceRunTriggers = ["schedule", "play", "probe"];
@@ -367,7 +381,7 @@ export const SourceRun = z.object({
367
381
  // How many items a probe found and kept nowhere; null for every other run.
368
382
  items: z.number().int().nullable(),
369
383
  status: z.enum(["running", "succeeded", "failed"]),
370
- failure: SourceRunFailure.nullable(),
384
+ failure: SourceRunFailureRead.nullable(),
371
385
  message: z.string().nullable(),
372
386
  counts: SourceRunCounts,
373
387
  steps: z.array(SourceStep),
@@ -423,7 +437,7 @@ export const SourceItemList = z.object({
423
437
  // The items of a probe or a test, never stored.
424
438
  export const SourceProbe = z.object({
425
439
  status: z.enum(["succeeded", "failed"]),
426
- failure: SourceRunFailure.nullable(),
440
+ failure: SourceRunFailureRead.nullable(),
427
441
  message: z.string().nullable(),
428
442
  counts: SourceRunCounts,
429
443
  items: z.array(z.object({ ref: z.string(), fields: SourceItem.shape.fields })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anchrd/colab-sdk",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "description": "Types, Zod schemas and the service client of Colab, the contract between its UI, backends and outside services.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",