@anchrd/colab-sdk 0.1.44 → 0.1.46

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.
@@ -17,11 +17,13 @@ import { OperatorProvider, UserId } from "../users/users.js";
17
17
  // is called `key`, `secret`, `token` or `password` (`/mcp` would strike it, `redactSecrets`). The
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
- // 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
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).
20
+ // Unified API (`/compat`) takes it; Claude and GPT go by their own paths, without the prefix (E252,
21
+ // E253). `context` in tokens; `price` in US dollars per million tokens (input, input read from the
22
+ // cache, output, and a cache write where the catalog names its own): the amount of a run where the
23
+ // token cannot read the gateway's logs. Since #1059 every price and context is the one of the model's
24
+ // page in Cloudflare's catalog (developers.cloudflare.com/ai/models/, read 2026-11-05; Claude Fable
25
+ // 5.2, GPT-6.1 Sol and Gemini 3.8 Flash read 2026-11-12; for Claude Haiku 5.5 and GPT the
26
+ // short-context price, for Grok 4.7 the one under 200k).
25
27
  // Where a page names no price for cached input, `cacheRead` is the input's.
26
28
  // ⚠️ The names are `/compat`'s, not the catalog page's: Claude 5.x goes with hyphens
27
29
  // (`anthropic/claude-opus-5-5`); the page's `claude-opus-5.5` answers 404 "Did you mean
@@ -29,14 +31,21 @@ import { OperatorProvider, UserId } from "../users/users.js";
29
31
  // Each model of the catalog finished one test card under `bun run dev` on 2026-11-05 (#1059): read
30
32
  // the card, one sentence in its chat, the card to Done. Left out after that test: Gemini 4 Argon and
31
33
  // 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
34
+ // until #1166 (its streamed tool call carried `thought_signature`, which the AI SDK refused before
35
+ // `@ai-sdk/openai-compatible`, #1139; through `/compat` it thinks without returning a text), Granite 4.0 Micro
33
36
  // and gpt-oss-120b (Workers AI answers "Bad Request" to the run's tools), Alibaba, MiniMax and Meta's
34
37
  // 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
36
- // `max_tokens` (`outputLimit` names the field that caps a step's output) and call tools only with
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).
38
+ // Fireworks (`/compat` asks for the provider's key). OpenAI's GPT models (#1018) refused `max_tokens`
39
+ // and called tools only with `reasoning_effort: "none"` through `/compat`, and GPT-6.1 Sol called them
40
+ // only through `/responses` (Spike #979): since #1162 GPT goes through the Responses API (E253).
41
+ // GPT-6.1 Terra stays (#1059 keeps it) although it left its test card open twice (#1066).
42
+ // `reasoning` (E249, #1139): how strongly the model thinks unasked (`level`, `off` not at all), and
43
+ // whether its path takes a stage while it calls tools (`adjustable`). Adjustable is DeepSeek: its
44
+ // runs think at `high` and not at `off` (#1139). Claude did not think through `/compat` at any stage
45
+ // (#1139); since #1161 it goes through `/anthropic` (E252), where every Claude takes the stage, and
46
+ // Opus 5.5 and Fable 5.2 think unasked (probes of 2026-11-12). GPT goes through Responses since #1162
47
+ // (E253), takes the stage there and thinks unasked at `medium` (probes of 2026-11-12). Grok, Kimi,
48
+ // GLM, Qwen and Nemotron think by themselves, but no stage of theirs is proven.
40
49
  export const gatewayCatalog = [
41
50
  {
42
51
  gateway: "cloudflare",
@@ -47,118 +56,154 @@ export const gatewayCatalog = [
47
56
  name: "DeepSeek V4 Pro",
48
57
  context: 1_000_000,
49
58
  price: { input: 1.32, cacheRead: 0.044, output: 3.96 },
59
+ reasoning: { level: "medium", adjustable: true },
50
60
  },
51
61
  {
52
62
  model: "workers-ai/@cf/deepseek-ai/deepseek-v4.1-flash-1017",
53
63
  name: "DeepSeek V4.1 Flash",
54
64
  context: 1_048_576,
55
65
  price: { input: 0.3, cacheRead: 0.006, output: 1.2 },
66
+ reasoning: { level: "medium", adjustable: true },
56
67
  },
57
68
  {
58
69
  model: "anthropic/claude-haiku-5-5",
59
70
  name: "Claude Haiku 5.5",
60
71
  context: 1_000_000,
61
72
  price: { input: 0.1, cacheRead: 0.01, cacheWrite: 0.125, output: 0.5 },
73
+ reasoning: { level: "off", adjustable: true },
62
74
  },
63
75
  {
64
76
  model: "anthropic/claude-sonnet-5-5",
65
77
  name: "Claude Sonnet 5.5",
66
78
  context: 1_000_000,
67
79
  price: { input: 2, cacheRead: 0.1, cacheWrite: 2.5, output: 10 },
80
+ reasoning: { level: "off", adjustable: true },
68
81
  },
69
82
  {
70
83
  model: "anthropic/claude-opus-5-5",
71
84
  name: "Claude Opus 5.5",
72
85
  context: 1_000_000,
73
86
  price: { input: 4, cacheRead: 0.2, cacheWrite: 5, output: 20 },
87
+ reasoning: { level: "medium", adjustable: true },
74
88
  },
75
89
  {
76
90
  model: "anthropic/claude-fable-5-1",
77
91
  name: "Claude Fable 5.1",
78
92
  context: 1_000_000,
79
93
  price: { input: 10, cacheRead: 0.25, cacheWrite: 12.5, output: 50 },
94
+ reasoning: { level: "off", adjustable: true },
95
+ },
96
+ {
97
+ model: "anthropic/claude-fable-5-2",
98
+ name: "Claude Fable 5.2",
99
+ context: 1_000_000,
100
+ price: { input: 8, cacheRead: 0.2, cacheWrite: 10, output: 40 },
101
+ reasoning: { level: "medium", adjustable: true },
80
102
  },
81
103
  {
82
104
  model: "xai/grok-4.7",
83
105
  name: "Grok 4.7",
84
106
  context: 500_000,
85
107
  price: { input: 2, cacheRead: 0.5, output: 6 },
108
+ reasoning: { level: "medium", adjustable: false },
86
109
  },
87
110
  {
88
111
  model: "moonshotai/kimi-k3",
89
112
  name: "Kimi K3",
90
113
  context: 1_048_576,
91
114
  price: { input: 3, cacheRead: 0.3, output: 15 },
115
+ reasoning: { level: "medium", adjustable: false },
92
116
  },
93
117
  {
94
118
  model: "workers-ai/@cf/moonshotai/kimi-k2.7-code",
95
119
  name: "Kimi K2.7 Code",
96
120
  context: 262_144,
97
121
  price: { input: 0.95, cacheRead: 0.19, output: 4 },
122
+ reasoning: { level: "medium", adjustable: false },
98
123
  },
99
124
  {
100
125
  model: "workers-ai/@cf/moonshotai/kimi-k2.6",
101
126
  name: "Kimi K2.6",
102
127
  context: 262_144,
103
128
  price: { input: 0.95, cacheRead: 0.16, output: 4 },
129
+ reasoning: { level: "medium", adjustable: false },
104
130
  },
105
131
  {
106
132
  model: "workers-ai/@cf/zai-org/glm-5.3",
107
133
  name: "GLM 5.3",
108
134
  context: 1_048_576,
109
135
  price: { input: 1.4, cacheRead: 0.26, output: 4.4 },
136
+ reasoning: { level: "medium", adjustable: false },
110
137
  },
111
138
  {
112
139
  model: "workers-ai/@cf/zai-org/glm-5.3-flash",
113
140
  name: "GLM 5.3 Flash",
114
141
  context: 1_048_576,
115
142
  price: { input: 0.15, cacheRead: 0.03, output: 0.5 },
143
+ reasoning: { level: "medium", adjustable: false },
116
144
  },
117
145
  {
118
146
  model: "workers-ai/@cf/qwen/qwen3.8-27b",
119
147
  name: "Qwen3.8 27B",
120
148
  context: 262_144,
121
149
  price: { input: 0.45, cacheRead: 0.05, output: 3.2 },
150
+ reasoning: { level: "medium", adjustable: false },
122
151
  },
123
152
  {
124
153
  model: "workers-ai/@cf/google/gemma-4-26b-a4b-it",
125
154
  name: "Gemma 4 26B",
126
155
  context: 256_000,
127
156
  price: { input: 0.1, cacheRead: 0.1, output: 0.3 },
157
+ reasoning: { level: "off", adjustable: false },
128
158
  },
129
159
  {
130
160
  model: "workers-ai/@cf/nvidia/nemotron-3-120b-a12b",
131
161
  name: "Nemotron 3 120B",
132
162
  context: 256_000,
133
163
  price: { input: 0.5, cacheRead: 0.5, output: 1.5 },
164
+ reasoning: { level: "medium", adjustable: false },
134
165
  },
135
166
  {
136
167
  model: "workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct",
137
168
  name: "Llama 4 Scout",
138
169
  context: 131_000,
139
170
  price: { input: 0.27, cacheRead: 0.27, output: 0.85 },
171
+ reasoning: { level: "off", adjustable: false },
140
172
  },
141
173
  {
142
174
  model: "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct",
143
175
  name: "Mistral Small 3.1",
144
176
  context: 128_000,
145
177
  price: { input: 0.351, cacheRead: 0.351, output: 0.555 },
178
+ reasoning: { level: "off", adjustable: false },
179
+ },
180
+ {
181
+ model: "google-ai-studio/gemini-3.8-flash",
182
+ name: "Gemini 3.8 Flash",
183
+ context: 1_048_576,
184
+ price: { input: 0.75, cacheRead: 0.075, output: 3.75 },
185
+ reasoning: { level: "medium", adjustable: false },
146
186
  },
147
187
  {
148
188
  model: "openai/gpt-6.1-terra",
149
189
  name: "GPT-6.1 Terra",
150
190
  context: 1_050_000,
151
191
  price: { input: 1, cacheRead: 0.05, cacheWrite: 1.25, output: 5 },
152
- outputLimit: "max_completion_tokens",
153
- reasoningEffort: "none",
192
+ reasoning: { level: "medium", adjustable: true },
193
+ },
194
+ {
195
+ model: "openai/gpt-6.1-sol",
196
+ name: "GPT-6.1 Sol",
197
+ context: 1_050_000,
198
+ price: { input: 2, cacheRead: 0.1, cacheWrite: 2.5, output: 10 },
199
+ reasoning: { level: "medium", adjustable: true },
154
200
  },
155
201
  {
156
202
  model: "openai/gpt-6-luna",
157
203
  name: "GPT-6 Luna",
158
204
  context: 1_050_000,
159
205
  price: { input: 0.1, cacheRead: 0.01, cacheWrite: 0.125, output: 0.5 },
160
- outputLimit: "max_completion_tokens",
161
- reasoningEffort: "none",
206
+ reasoning: { level: "medium", adjustable: true },
162
207
  },
163
208
  ],
164
209
  },
@@ -185,14 +230,24 @@ export function gatewayModelOf(model) {
185
230
  }
186
231
  return null;
187
232
  }
188
- export function outputLimitOf(model) {
189
- const entry = gatewayModelOf(model);
190
- return entry && "outputLimit" in entry ? entry.outputLimit : "max_tokens";
233
+ // The stage an Operator of the kind Gateway thinks at (E249, #1139): `default` sends nothing, so the
234
+ // model thinks as the catalog's `level` says; every other stage goes to the model.
235
+ export const ReasoningLevel = z.enum(["off", "low", "medium", "high"]);
236
+ export const ReasoningStage = z.enum(["default", ...ReasoningLevel.options]);
237
+ export const reasoningDefault = "default";
238
+ // A model's thinking in the catalog, or null for a model outside it.
239
+ export function reasoningOfModel(model) {
240
+ return gatewayModelOf(model)?.reasoning ?? null;
241
+ }
242
+ // Whether an Operator on this model may take a stage other than `default`.
243
+ export function reasoningAdjustable(model) {
244
+ return reasoningOfModel(model)?.adjustable ?? false;
191
245
  }
192
- // The reasoning effort a model must be sent to call tools on Chat Completions, or null (#1018).
193
- export function reasoningEffortOf(model) {
246
+ export function reasoningEffortOf(model, stage) {
194
247
  const entry = gatewayModelOf(model);
195
- return entry && "reasoningEffort" in entry ? entry.reasoningEffort : null;
248
+ if (!entry?.reasoning.adjustable || stage === "default")
249
+ return null;
250
+ return stage === "off" ? "none" : stage;
196
251
  }
197
252
  // A cache write at its own price where the catalog names one, else at the input's.
198
253
  export function cacheWritePriceOf(entry) {
@@ -210,8 +265,7 @@ export const GatewayModelEntrySchema = z.object({
210
265
  cacheWrite: z.number().nonnegative().optional(),
211
266
  output: z.number().nonnegative(),
212
267
  }),
213
- outputLimit: z.enum(["max_tokens", "max_completion_tokens"]).optional(),
214
- reasoningEffort: z.literal("none").optional(),
268
+ reasoning: z.object({ level: ReasoningLevel, adjustable: z.boolean() }),
215
269
  });
216
270
  // The catalog (Einstellungen › Operator › Katalog), two kinds (E210):
217
271
  // - `claude`: Claude Code in a container, with the sign-in of a subscription or an API key. Its
@@ -264,8 +318,7 @@ export function inCatalog(provider, model) {
264
318
  // The catalog the UI shows (E230, #1090): the AI vendors, not the kinds a run goes through. An
265
319
  // Operator's vendor follows from its model alone (`vendorOfModel`), so every stored Operator, one on
266
320
  // a retired model or one of Codex and Gemini from before #978 included, stands under exactly one.
267
- // `mark` is the square's letters. `unavailable` names why no credential unlocks a vendor: Gemini's
268
- // current models are not paid by Unified Billing (#1059), so the gateway holds none of them.
321
+ // `mark` is the square's letters.
269
322
  export const OperatorVendor = z.enum([
270
323
  "claude",
271
324
  "gpt",
@@ -283,7 +336,7 @@ export const OperatorVendor = z.enum([
283
336
  export const operatorVendors = [
284
337
  { vendor: "claude", name: "Claude", maker: "Anthropic", mark: "C" },
285
338
  { vendor: "gpt", name: "GPT", maker: "OpenAI", mark: "G" },
286
- { vendor: "gemini", name: "Gemini", maker: "Google", mark: "Ge", unavailable: "gateway" },
339
+ { vendor: "gemini", name: "Gemini", maker: "Google", mark: "Ge" },
287
340
  { vendor: "deepseek", name: "DeepSeek", maker: "DeepSeek", mark: "DS" },
288
341
  { vendor: "kimi", name: "Kimi", maker: "Moonshot", mark: "K" },
289
342
  { vendor: "grok", name: "Grok", maker: "xAI", mark: "Gr" },
@@ -314,6 +367,7 @@ const vendors = {
314
367
  "anthropic/claude-sonnet-5-5": "claude",
315
368
  "anthropic/claude-opus-5-5": "claude",
316
369
  "anthropic/claude-fable-5-1": "claude",
370
+ "anthropic/claude-fable-5-2": "claude",
317
371
  "xai/grok-4.7": "grok",
318
372
  "moonshotai/kimi-k3": "kimi",
319
373
  "workers-ai/@cf/moonshotai/kimi-k2.7-code": "kimi",
@@ -326,12 +380,14 @@ const vendors = {
326
380
  "workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct": "llama",
327
381
  "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct": "mistral",
328
382
  "openai/gpt-6.1-terra": "gpt",
383
+ "openai/gpt-6.1-sol": "gpt",
329
384
  "openai/gpt-6-luna": "gpt",
330
385
  "anthropic/claude-sonnet-4-6": "claude",
331
386
  "anthropic/claude-opus-4-6": "claude",
332
387
  "anthropic/claude-haiku-4-5": "claude",
333
388
  "google-ai-studio/gemini-2.5-pro": "gemini",
334
389
  "google-ai-studio/gemini-2.5-flash": "gemini",
390
+ "google-ai-studio/gemini-3.8-flash": "gemini",
335
391
  };
336
392
  export function vendorOfModel(model) {
337
393
  return vendors[model];
@@ -381,6 +437,7 @@ export const OperatorModel = z.enum([
381
437
  "anthropic/claude-sonnet-5-5",
382
438
  "anthropic/claude-opus-5-5",
383
439
  "anthropic/claude-fable-5-1",
440
+ "anthropic/claude-fable-5-2",
384
441
  "xai/grok-4.7",
385
442
  "moonshotai/kimi-k3",
386
443
  "workers-ai/@cf/moonshotai/kimi-k2.7-code",
@@ -394,6 +451,7 @@ export const OperatorModel = z.enum([
394
451
  "workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct",
395
452
  // OpenAI through the gateway (#1018).
396
453
  "openai/gpt-6.1-terra",
454
+ "openai/gpt-6.1-sol",
397
455
  "openai/gpt-6-luna",
398
456
  // Out of the catalog since #1059 (`retiredGatewayModels`): a stored Operator still reads.
399
457
  "anthropic/claude-sonnet-4-6",
@@ -401,6 +459,7 @@ export const OperatorModel = z.enum([
401
459
  "anthropic/claude-haiku-4-5",
402
460
  "google-ai-studio/gemini-2.5-pro",
403
461
  "google-ai-studio/gemini-2.5-flash",
462
+ "google-ai-studio/gemini-3.8-flash",
404
463
  ]);
405
464
  export const CredentialId = idSchema("credential");
406
465
  const CredentialName = z.string().trim().min(1).max(64);
@@ -655,6 +714,8 @@ export const OperatorMachineUpdateInput = z
655
714
  rev: Rev.describe("The revision of the Operator this change is based on, as the last read returned it. If someone saved it in between, the call answers conflict, changes nothing and names under current what stands now: decide, and send it again with that rev."),
656
715
  credentialId: CredentialId.optional(),
657
716
  model: OperatorModel.optional(),
717
+ // The stage of thinking (E249, #1139); only a model of the kind Gateway whose path takes one.
718
+ reasoning: ReasoningStage.optional(),
658
719
  subagents: Subagents.optional(),
659
720
  trigger: ChangeTrigger.optional(),
660
721
  limits: OperatorLimits.partial().optional(),
@@ -689,6 +750,8 @@ export const Operator = z.object({
689
750
  // company's, whose Actions its page does not count.
690
751
  open: z.int().min(0).nullable(),
691
752
  model: OperatorModel,
753
+ // The stage of thinking (E249, #1139); `default` for every Operator that never set one.
754
+ reasoning: ReasoningStage,
692
755
  subagents: Subagents,
693
756
  trigger: Trigger,
694
757
  limits: OperatorLimits,
@@ -0,0 +1,340 @@
1
+ import { z } from "zod";
2
+ export declare const baseRelationTypes: {
3
+ readonly mentions: {
4
+ readonly from: "node";
5
+ readonly to: "node";
6
+ readonly meaning: "mentions";
7
+ readonly source: "text";
8
+ };
9
+ readonly refers: {
10
+ readonly from: "node";
11
+ readonly to: "node";
12
+ readonly meaning: "refers to";
13
+ readonly source: "field";
14
+ };
15
+ readonly waits: {
16
+ readonly from: "node";
17
+ readonly to: "node";
18
+ readonly meaning: "waits for";
19
+ readonly source: "dependency";
20
+ };
21
+ readonly responsible: {
22
+ readonly from: "actor";
23
+ readonly to: "node";
24
+ readonly meaning: "answers for";
25
+ readonly source: "role";
26
+ };
27
+ readonly assignee: {
28
+ readonly from: "actor";
29
+ readonly to: "node";
30
+ readonly meaning: "works on";
31
+ readonly source: "assignment";
32
+ };
33
+ readonly operator: {
34
+ readonly from: "actor";
35
+ readonly to: "node";
36
+ readonly meaning: "pursues";
37
+ readonly source: "assignment";
38
+ };
39
+ readonly grant: {
40
+ readonly from: "node";
41
+ readonly to: "actor";
42
+ readonly meaning: "shared with";
43
+ readonly source: "grant";
44
+ };
45
+ };
46
+ export type BaseRelationType = keyof typeof baseRelationTypes;
47
+ export declare const BaseRelationType: z.ZodEnum<{
48
+ operator: "operator";
49
+ grant: "grant";
50
+ responsible: "responsible";
51
+ mentions: "mentions";
52
+ assignee: "assignee";
53
+ refers: "refers";
54
+ waits: "waits";
55
+ }>;
56
+ export declare const RelationListInput: z.ZodObject<{
57
+ nodeId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
58
+ section: z.ZodOptional<z.ZodLiteral<"shared">>;
59
+ }, z.core.$strict>;
60
+ export type RelationListInput = z.infer<typeof RelationListInput>;
61
+ export declare const RelationEnd: z.ZodDiscriminatedUnion<[z.ZodObject<{
62
+ kind: z.ZodLiteral<"node">;
63
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
64
+ }, z.core.$strip>, z.ZodObject<{
65
+ kind: z.ZodLiteral<"actor">;
66
+ userId: z.ZodString;
67
+ }, z.core.$strip>, z.ZodObject<{
68
+ kind: z.ZodLiteral<"outside">;
69
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
70
+ }, z.core.$strip>, z.ZodObject<{
71
+ kind: z.ZodLiteral<"type">;
72
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
73
+ }, z.core.$strip>], "kind">;
74
+ export type RelationEnd = z.infer<typeof RelationEnd>;
75
+ export declare const RelationId: z.ZodTemplateLiteral<`relation_${string}`>;
76
+ export type RelationId = z.infer<typeof RelationId>;
77
+ export declare const Relation: z.ZodObject<{
78
+ type: z.ZodUnion<readonly [z.ZodEnum<{
79
+ operator: "operator";
80
+ grant: "grant";
81
+ responsible: "responsible";
82
+ mentions: "mentions";
83
+ assignee: "assignee";
84
+ refers: "refers";
85
+ waits: "waits";
86
+ }>, z.ZodTemplateLiteral<`type_${string}`>]>;
87
+ origin: z.ZodEnum<{
88
+ set: "set";
89
+ computed: "computed";
90
+ }>;
91
+ from: z.ZodDiscriminatedUnion<[z.ZodObject<{
92
+ kind: z.ZodLiteral<"node">;
93
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
94
+ }, z.core.$strip>, z.ZodObject<{
95
+ kind: z.ZodLiteral<"actor">;
96
+ userId: z.ZodString;
97
+ }, z.core.$strip>, z.ZodObject<{
98
+ kind: z.ZodLiteral<"outside">;
99
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
100
+ }, z.core.$strip>, z.ZodObject<{
101
+ kind: z.ZodLiteral<"type">;
102
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
103
+ }, z.core.$strip>], "kind">;
104
+ to: z.ZodDiscriminatedUnion<[z.ZodObject<{
105
+ kind: z.ZodLiteral<"node">;
106
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
107
+ }, z.core.$strip>, z.ZodObject<{
108
+ kind: z.ZodLiteral<"actor">;
109
+ userId: z.ZodString;
110
+ }, z.core.$strip>, z.ZodObject<{
111
+ kind: z.ZodLiteral<"outside">;
112
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
113
+ }, z.core.$strip>, z.ZodObject<{
114
+ kind: z.ZodLiteral<"type">;
115
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
116
+ }, z.core.$strip>], "kind">;
117
+ count: z.ZodNumber;
118
+ relationId: z.ZodNullable<z.ZodTemplateLiteral<`relation_${string}`>>;
119
+ }, z.core.$strip>;
120
+ export type Relation = z.infer<typeof Relation>;
121
+ export declare const RelationActor: z.ZodObject<{
122
+ userId: z.ZodString;
123
+ name: z.ZodString;
124
+ kind: z.ZodEnum<{
125
+ machine: "machine";
126
+ human: "human";
127
+ }>;
128
+ }, z.core.$strip>;
129
+ export type RelationActor = z.infer<typeof RelationActor>;
130
+ export declare const RelationOutside: z.ZodObject<{
131
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
132
+ name: z.ZodString;
133
+ kind: z.ZodCatch<z.ZodEnum<{
134
+ unknown: "unknown";
135
+ file: "file";
136
+ folder: "folder";
137
+ document: "document";
138
+ table: "table";
139
+ board: "board";
140
+ task: "task";
141
+ gadget: "gadget";
142
+ goal: "goal";
143
+ skill: "skill";
144
+ source: "source";
145
+ }>>;
146
+ folderId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
147
+ folderName: z.ZodNullable<z.ZodString>;
148
+ }, z.core.$strip>;
149
+ export type RelationOutside = z.infer<typeof RelationOutside>;
150
+ export declare const RelationType: z.ZodObject<{
151
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
152
+ name: z.ZodString;
153
+ kind: z.ZodEnum<{
154
+ object: "object";
155
+ action: "action";
156
+ relation: "relation";
157
+ actor: "actor";
158
+ }>;
159
+ }, z.core.$strip>;
160
+ export type RelationType = z.infer<typeof RelationType>;
161
+ export declare const RelationAction: z.ZodObject<{
162
+ actionId: z.ZodString;
163
+ name: z.ZodString;
164
+ description: z.ZodString;
165
+ origin: z.ZodEnum<{
166
+ set: "set";
167
+ computed: "computed";
168
+ }>;
169
+ approval: z.ZodBoolean;
170
+ implementedBy: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
171
+ on: z.ZodArray<z.ZodTemplateLiteral<`node_${string}`>>;
172
+ }, z.core.$strip>;
173
+ export type RelationAction = z.infer<typeof RelationAction>;
174
+ export declare const RelationList: z.ZodObject<{
175
+ items: z.ZodArray<z.ZodObject<{
176
+ type: z.ZodUnion<readonly [z.ZodEnum<{
177
+ operator: "operator";
178
+ grant: "grant";
179
+ responsible: "responsible";
180
+ mentions: "mentions";
181
+ assignee: "assignee";
182
+ refers: "refers";
183
+ waits: "waits";
184
+ }>, z.ZodTemplateLiteral<`type_${string}`>]>;
185
+ origin: z.ZodEnum<{
186
+ set: "set";
187
+ computed: "computed";
188
+ }>;
189
+ from: z.ZodDiscriminatedUnion<[z.ZodObject<{
190
+ kind: z.ZodLiteral<"node">;
191
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
192
+ }, z.core.$strip>, z.ZodObject<{
193
+ kind: z.ZodLiteral<"actor">;
194
+ userId: z.ZodString;
195
+ }, z.core.$strip>, z.ZodObject<{
196
+ kind: z.ZodLiteral<"outside">;
197
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
198
+ }, z.core.$strip>, z.ZodObject<{
199
+ kind: z.ZodLiteral<"type">;
200
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
201
+ }, z.core.$strip>], "kind">;
202
+ to: z.ZodDiscriminatedUnion<[z.ZodObject<{
203
+ kind: z.ZodLiteral<"node">;
204
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
205
+ }, z.core.$strip>, z.ZodObject<{
206
+ kind: z.ZodLiteral<"actor">;
207
+ userId: z.ZodString;
208
+ }, z.core.$strip>, z.ZodObject<{
209
+ kind: z.ZodLiteral<"outside">;
210
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
211
+ }, z.core.$strip>, z.ZodObject<{
212
+ kind: z.ZodLiteral<"type">;
213
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
214
+ }, z.core.$strip>], "kind">;
215
+ count: z.ZodNumber;
216
+ relationId: z.ZodNullable<z.ZodTemplateLiteral<`relation_${string}`>>;
217
+ }, z.core.$strip>>;
218
+ actors: z.ZodArray<z.ZodObject<{
219
+ userId: z.ZodString;
220
+ name: z.ZodString;
221
+ kind: z.ZodEnum<{
222
+ machine: "machine";
223
+ human: "human";
224
+ }>;
225
+ }, z.core.$strip>>;
226
+ outside: z.ZodArray<z.ZodObject<{
227
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
228
+ name: z.ZodString;
229
+ kind: z.ZodCatch<z.ZodEnum<{
230
+ unknown: "unknown";
231
+ file: "file";
232
+ folder: "folder";
233
+ document: "document";
234
+ table: "table";
235
+ board: "board";
236
+ task: "task";
237
+ gadget: "gadget";
238
+ goal: "goal";
239
+ skill: "skill";
240
+ source: "source";
241
+ }>>;
242
+ folderId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
243
+ folderName: z.ZodNullable<z.ZodString>;
244
+ }, z.core.$strip>>;
245
+ types: z.ZodArray<z.ZodObject<{
246
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
247
+ name: z.ZodString;
248
+ kind: z.ZodEnum<{
249
+ object: "object";
250
+ action: "action";
251
+ relation: "relation";
252
+ actor: "actor";
253
+ }>;
254
+ }, z.core.$strip>>;
255
+ actions: z.ZodArray<z.ZodObject<{
256
+ actionId: z.ZodString;
257
+ name: z.ZodString;
258
+ description: z.ZodString;
259
+ origin: z.ZodEnum<{
260
+ set: "set";
261
+ computed: "computed";
262
+ }>;
263
+ approval: z.ZodBoolean;
264
+ implementedBy: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
265
+ on: z.ZodArray<z.ZodTemplateLiteral<`node_${string}`>>;
266
+ }, z.core.$strip>>;
267
+ nodeTypes: z.ZodArray<z.ZodObject<{
268
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
269
+ typeIds: z.ZodArray<z.ZodTemplateLiteral<`type_${string}`>>;
270
+ }, z.core.$strip>>;
271
+ nextCursor: z.ZodNull;
272
+ }, z.core.$strip>;
273
+ export type RelationList = z.infer<typeof RelationList>;
274
+ export declare const RelationSetEnd: z.ZodDiscriminatedUnion<[z.ZodObject<{
275
+ kind: z.ZodLiteral<"node">;
276
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
277
+ }, z.core.$strict>, z.ZodObject<{
278
+ kind: z.ZodLiteral<"actor">;
279
+ userId: z.ZodString;
280
+ }, z.core.$strict>, z.ZodObject<{
281
+ kind: z.ZodLiteral<"type">;
282
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
283
+ }, z.core.$strict>], "kind">;
284
+ export type RelationSetEnd = z.infer<typeof RelationSetEnd>;
285
+ export declare const RelationCreateInput: z.ZodObject<{
286
+ type: z.ZodString;
287
+ from: z.ZodDiscriminatedUnion<[z.ZodObject<{
288
+ kind: z.ZodLiteral<"node">;
289
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
290
+ }, z.core.$strict>, z.ZodObject<{
291
+ kind: z.ZodLiteral<"actor">;
292
+ userId: z.ZodString;
293
+ }, z.core.$strict>, z.ZodObject<{
294
+ kind: z.ZodLiteral<"type">;
295
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
296
+ }, z.core.$strict>], "kind">;
297
+ to: z.ZodDiscriminatedUnion<[z.ZodObject<{
298
+ kind: z.ZodLiteral<"node">;
299
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ kind: z.ZodLiteral<"actor">;
302
+ userId: z.ZodString;
303
+ }, z.core.$strict>, z.ZodObject<{
304
+ kind: z.ZodLiteral<"type">;
305
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
306
+ }, z.core.$strict>], "kind">;
307
+ idempotencyKey: z.ZodString;
308
+ }, z.core.$strict>;
309
+ export type RelationCreateInput = z.infer<typeof RelationCreateInput>;
310
+ export declare const SetRelation: z.ZodObject<{
311
+ relationId: z.ZodTemplateLiteral<`relation_${string}`>;
312
+ type: z.ZodString;
313
+ from: z.ZodDiscriminatedUnion<[z.ZodObject<{
314
+ kind: z.ZodLiteral<"node">;
315
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
316
+ }, z.core.$strip>, z.ZodObject<{
317
+ kind: z.ZodLiteral<"actor">;
318
+ userId: z.ZodString;
319
+ }, z.core.$strip>, z.ZodObject<{
320
+ kind: z.ZodLiteral<"type">;
321
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
322
+ }, z.core.$strip>], "kind">;
323
+ to: z.ZodDiscriminatedUnion<[z.ZodObject<{
324
+ kind: z.ZodLiteral<"node">;
325
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
326
+ }, z.core.$strip>, z.ZodObject<{
327
+ kind: z.ZodLiteral<"actor">;
328
+ userId: z.ZodString;
329
+ }, z.core.$strip>, z.ZodObject<{
330
+ kind: z.ZodLiteral<"type">;
331
+ typeId: z.ZodTemplateLiteral<`type_${string}`>;
332
+ }, z.core.$strip>], "kind">;
333
+ createdBy: z.ZodString;
334
+ createdAt: z.ZodISODateTime;
335
+ }, z.core.$strip>;
336
+ export type SetRelation = z.infer<typeof SetRelation>;
337
+ export declare const RelationRemoveInput: z.ZodObject<{
338
+ relationId: z.ZodTemplateLiteral<`relation_${string}`>;
339
+ }, z.core.$strict>;
340
+ export type RelationRemoveInput = z.infer<typeof RelationRemoveInput>;