slatebox-mcp 0.3.3 → 0.3.5

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.
@@ -150,6 +150,98 @@ declare namespace slatebox.agentTasks {
150
150
  }) & { mode: "save" | "preview" }>;
151
151
  }
152
152
 
153
+ declare namespace slatebox.ai.audit {
154
+ /** AI control changes. Lists changes to the AI configuration, newest first: AI control changes, ai.update (connections and feature choices at any level) and persona saves (chatIntentions.save). Each row has who (account and the name of the person, or "a deleted account"; person or agent, token, and via ddp, http or exec), the action, what it changed, the reason, before and after (keys only as fingerprints), and whether it was refused. Filter by action (exact, or a prefix ending in a dot such as ai.control.), kind, id, userId, outcome and time; pass next as before for the next page. Administrators only. @scope ai:admin:read */
155
+ function list(input: {
156
+ /** (1 to 200) */
157
+ limit?: number;
158
+ before?: string;
159
+ since?: string;
160
+ action?: string;
161
+ kind?: string;
162
+ id?: string;
163
+ userId?: string;
164
+ outcome?: "ok" | "refused";
165
+ }): Promise<{
166
+ rows?: Array<Record<string, unknown>>;
167
+ next?: string | null;
168
+ [key: string]: unknown;
169
+ }>;
170
+ }
171
+
172
+ declare namespace slatebox.ai.bindings {
173
+ /** AI bindings. Lists every part of Slatebox that can be bound on this server, with its published binding (model chain, parameters, tools, limits, on/off), its versions newest first with author and note, and why a binding was skipped if it no longer passes its checks. Administrators only. @scope ai:admin:read */
174
+ function list(input: Record<string, unknown>): Promise<{
175
+ generation?: number;
176
+ surfaces?: Array<Record<string, unknown>>;
177
+ [key: string]: unknown;
178
+ }>;
179
+ }
180
+
181
+ declare namespace slatebox.ai.bindings {
182
+ /** Save AI binding draft. Saves a draft binding for one part of Slatebox: its model chain (primary, then fallbacks with the failures each is tried for), parameters, allowed tools, limits and on/off. Changes nothing live: a person publishes it. An agent's draft is marked as a suggestion. Administrators only. @scope ai:admin */
183
+ function saveDraft(input: {
184
+ binding: {
185
+ /** The part of Slatebox, for example agent.slatebox or shape. */
186
+ surface: "default" | "chat" | "chat.route" | "generation" | "presentation" | "vision" | "images" | "shape" | "workshop" | "workshop.draft" | "canvas" | "agent.slatebox" | "library" | "connectors";
187
+ /** Only server in this build. */
188
+ scope?: {
189
+ level: "server";
190
+ };
191
+ /** false turns this part off for everyone; people see disabledMessage. */
192
+ enabled?: boolean;
193
+ /** What people see while it is off. (at most 300 characters) */
194
+ disabledMessage?: string | null;
195
+ /** The primary model, then fallbacks. Each entry names a model from the model list (model) or a connection with its own model (connection: server:<name>, or builtin for the built-in AI). Empty: follow what it follows. (at most 5 items) */
196
+ chain?: Array<{
197
+ /** (at most 260 characters) */
198
+ model?: string;
199
+ /** (at most 60 characters) */
200
+ connection?: string;
201
+ /** A fallback is tried when the previous model failed this way: infra (5xx, 429, timeout), shape (answers it could not use), context (too long), any. */
202
+ on?: Array<"infra" | "shape" | "context" | "any">;
203
+ }>;
204
+ /** When the chain keeps failing on a server: fallback uses the settings file and built-in AI for 10 minutes; report keeps the chain and says so. Unset: fallback only for a chain of two or more that lists the built-in AI. */
205
+ onTrip?: "fallback" | "report" | null;
206
+ /** timeoutMs, maxTokens (only lowers the call site's), infraRetries, shapeRetries, temperature. null or absent: the built-in value. */
207
+ params?: {
208
+ /** (1000 to 600000) */
209
+ timeoutMs?: number | null;
210
+ /** (1 to 1000000) */
211
+ maxTokens?: number | null;
212
+ /** (0 to 10) */
213
+ infraRetries?: number | null;
214
+ /** (1 to 10) */
215
+ shapeRetries?: number | null;
216
+ /** (0 to 2) */
217
+ temperature?: number | null;
218
+ };
219
+ /** slot: prompt id, or id@version to pin one. */
220
+ prompts?: Record<string, string>;
221
+ /** allow: the only tools sent and accepted back; mode forced, auto or none (none only where the part needs no tools). */
222
+ tools?: {
223
+ mode?: "forced" | "auto" | "none" | null;
224
+ /** (at most 30 items) */
225
+ allow?: string[] | null;
226
+ };
227
+ /** Micro-dollars per request; can only lower the built-in values. */
228
+ limits?: {
229
+ /** (at least 1) */
230
+ estimate?: number | null;
231
+ /** (at least 1) */
232
+ ceiling?: number | null;
233
+ };
234
+ };
235
+ /** A short note kept with the version. (at most 200 characters) */
236
+ note?: string;
237
+ }): Promise<({
238
+ bindingId?: string;
239
+ version?: number;
240
+ status?: string;
241
+ [key: string]: unknown;
242
+ }) & { mode: "save" }>;
243
+ }
244
+
153
245
  declare namespace slatebox.ai {
154
246
  /** Test AI. Tests a saved connection (name) or one not yet saved (connection): whether Slatebox can reach it, whether it accepts the key, which models it lists where it lists them, whether the model answers and whether it calls tools (which conversation, drafts and presentations need). Saves nothing. A saved key is only sent to the address it was saved for. A token needs ai:admin as well for level team or server. On a self-hosted server a model on the host is at host.docker.internal, not localhost. @scope ai:settings @openWorld @idempotent */
155
247
  function check(input: {
@@ -159,8 +251,8 @@ declare namespace slatebox.ai {
159
251
  connection?: {
160
252
  /** Your name for it, for example desk-model. */
161
253
  name: string;
162
- /** openai-compatible covers any host or local server (Ollama, llama.cpp, vLLM, LM Studio and others). */
163
- type: "openai-compatible" | "openai" | "anthropic" | "deepinfra";
254
+ /** The provider: openai-compatible (any host or local server: Ollama, llama.cpp, vLLM, LM Studio and others), openai, anthropic, deepinfra, or one an administrator added (ai.control.get lists them). */
255
+ type: string;
164
256
  /** For openai-compatible: the address up to /v1, for example http://host.docker.internal:11434/v1. (at most 500 characters) */
165
257
  baseUrl?: string;
166
258
  /** The model name the endpoint serves. (at most 200 characters) */
@@ -190,10 +282,128 @@ declare namespace slatebox.ai {
190
282
  }) & { mode: "save" }>;
191
283
  }
192
284
 
285
+ declare namespace slatebox.ai.connections {
286
+ /** AI connections. Lists the server's AI connections: the settings file's (read-only) and the ones saved in the app, including the services beside the models (Stability, Google picture search, Noun Project, Deepgram). For each: its provider, address, model, where its key lives (sealed, an environment variable, the settings file or none), which key it is (a fingerprint, never the key), its last test and whether it is turned off. Administrators only. @scope ai:admin:read */
287
+ function list(input: Record<string, unknown>): Promise<{
288
+ connections?: Array<Record<string, unknown>>;
289
+ keysAvailable?: boolean;
290
+ [key: string]: unknown;
291
+ }>;
292
+ }
293
+
294
+ declare namespace slatebox.ai.connections {
295
+ /** Save AI connections. Adds or changes server connections: a provider, address, model and key. A key is sealed with the server's key and never returned; keyRef env reads it from an environment variable named SLATEBOX_AI_KEY_… for each request; rotate {graceHours} keeps the old key working for 1 or 24 hours. status disabled keeps a connection but sends nothing to it. Also connects the services beside the models (stability, google-cse with its search engine ID as model, nounproject as key:secret, deepgram). Only a person sends a key, names an environment variable or changes an address or provider; an agent may save a keyless connection to a provider with a fixed address. Administrators only. @scope ai:admin @destructive @confirm @idempotent */
296
+ function save(input: {
297
+ /** (1–20 items) */
298
+ connections: Array<{
299
+ /** The connection's name, for example gemini-main. */
300
+ name: string;
301
+ /** The provider: openai-compatible, openai, anthropic, deepinfra, one an administrator added, or a service beside the models (stability, google-cse, nounproject, deepgram). */
302
+ type: string;
303
+ /** For a provider without a fixed address: the address up to /v1. (at most 500 characters) */
304
+ baseUrl?: string;
305
+ /** The model it serves. For google-cse, the search engine ID (cx). (at most 200 characters) */
306
+ model?: string;
307
+ /** Stored encrypted with the server's key and never shown again. Leave it out to keep the saved key. For nounproject: key:secret. (at most 400 characters) */
308
+ apiKey?: string;
309
+ /** env: read the key from an environment variable named SLATEBOX_AI_KEY_… (or one the settings file allows) for each request; none: no key. Sending apiKey seals the key instead. */
310
+ keyRef?: {
311
+ kind: "env" | "none";
312
+ name?: string;
313
+ };
314
+ /** With a new apiKey: the old key keeps working for this many hours, in case the provider has not taken the new one yet. */
315
+ rotate?: {
316
+ graceHours: 0 | 1 | 24;
317
+ };
318
+ /** What the model can do, where you know it. Unset means try it; making images needs images: true. */
319
+ capabilities?: {
320
+ tools?: boolean;
321
+ vision?: boolean;
322
+ json?: boolean;
323
+ images?: boolean;
324
+ reasoning?: boolean;
325
+ };
326
+ /** (256 to 200000) */
327
+ maxTokens?: number;
328
+ toolChoice?: "auto" | "named" | "required";
329
+ /** disabled: kept, but nothing is sent to it. */
330
+ status?: "active" | "disabled";
331
+ }>;
332
+ /** Why, for the change history. (1–500 characters) */
333
+ reason?: string;
334
+ }): Promise<({
335
+ connections?: string[];
336
+ fingerprints?: Record<string, unknown>;
337
+ [key: string]: unknown;
338
+ }) & { mode: "save" }>;
339
+ }
340
+
341
+ declare namespace slatebox.ai.control {
342
+ /** Effective AI binding. Shows the binding each surface (or one) resolves to for a person (userId; none = someone not signed in), with the source of each field: a published binding, an AI settings choice, the settings file or the built-in default. usage true adds each surface's calls, failed calls and spend over the last 24 hours. Administrators only. @scope ai:admin:read */
343
+ function effective(input: {
344
+ surface?: string;
345
+ userId?: string;
346
+ plan?: string;
347
+ usage?: boolean;
348
+ }): Promise<{
349
+ generation?: number;
350
+ surfaces?: unknown[];
351
+ usage?: Record<string, unknown>;
352
+ [key: string]: unknown;
353
+ }>;
354
+ }
355
+
356
+ declare namespace slatebox.ai.control {
357
+ /** AI control. Returns the AI control snapshot: every surface and what it follows, providers, server connections (never keys), models, published bindings, agents, prompt heads, the global switch, and health (documents skipped because they failed their checks). Administrators only. @scope ai:admin:read */
358
+ function get(input: Record<string, unknown>): Promise<{
359
+ generation?: number;
360
+ dbLayer?: string;
361
+ surfaces?: unknown[];
362
+ health?: unknown[];
363
+ [key: string]: unknown;
364
+ }>;
365
+ }
366
+
367
+ declare namespace slatebox.ai.control {
368
+ /** AI control health. Lists AI control problems: documents skipped because they failed their checks (that surface falls back to the settings file and built-in defaults), and published prompts that fell back to their built-in text. warnings lists models with no price (charged at the dearest rate) and connections whose last test failed. An empty list means nothing is wrong. Administrators only. @scope ai:admin:read */
369
+ function health(input: Record<string, unknown>): Promise<{
370
+ generation?: number;
371
+ dbLayer?: string;
372
+ health?: unknown[];
373
+ warnings?: unknown[];
374
+ [key: string]: unknown;
375
+ }>;
376
+ }
377
+
378
+ declare namespace slatebox.ai.control {
379
+ /** Reset AI control. Returns AI configuration to the settings file and built-in defaults. target use clears the feature choices an administrator made for the server in the app (keys: only those; connections stay); binding removes one part's published binding (surface), so it follows what it follows again; bindings removes every published binding (their versions stay); prompt returns one prompt (promptId) to its built-in text and drops a binding's pin of a version of it, prompts every prompt (their versions stay); dbLayer switches AI control's own documents off at runtime, so every surface resolves from the AI settings, the settings file and code; all does every one. AI turned off for everyone stays off. From a token, a reset that would switch back on a part an administrator turned off is refused. Needs a reason, which the audit trail keeps. Administrators only. @scope ai:admin @destructive @confirm @idempotent */
380
+ function reset(input: {
381
+ target: "use" | "binding" | "bindings" | "prompt" | "prompts" | "dbLayer" | "all";
382
+ /** For target binding: the part of Slatebox. */
383
+ surface?: "default" | "chat" | "chat.route" | "generation" | "presentation" | "vision" | "images" | "shape" | "workshop" | "workshop.draft" | "canvas" | "agent.slatebox" | "library" | "connectors";
384
+ /** For target prompt: the prompt. */
385
+ promptId?: "shape.system" | "shape.user" | "shape.retry" | "tool.propose_shapes" | "workshop.map.system" | "workshop.lane.system" | "workshop.chat.retry" | "tool.propose_map_edits" | "tool.propose_workshop_edits" | "workshop.draft.system" | "workshop.draft.map" | "workshop.draft.release" | "workshop.draft.rules" | "workshop.draft.retry" | "workshop.draft.repair" | "tool.draft_workshop" | "tool.draft_concept_map" | "tool.draft_release_plan" | "tool.revise_workshop_rules" | "exec.chat.system" | "exec.chat.fix" | "exec.chat.retry" | "agent.request.notes" | "presentation.segments" | "presentation.art" | "presentation.system" | "presentation.system.dynamic" | "presentation.system.slides" | "presentation.system.template" | "presentation.slate" | "presentation.user" | "presentation.brief" | "presentation.refine" | "tool.create-presentation" | "tool.create-presentation.image-query" | "tool.create-presentation.image-prompt" | "tool.create-presentation.image-why" | "library.refine.system" | "library.refine.request" | "library.refine.retry" | "tool.propose_library_refinement" | "connectors.plan.system" | "connectors.plan.next" | "connectors.plan.tool" | "connectors.layout.system" | "connectors.layout.budget" | "connectors.layout.tool" | "connectors.recipe.github" | "connectors.recipe.linear" | "connectors.recipe.huggingface" | "connectors.recipe.deepwiki" | "connectors.recipe.context7" | "connectors.recipe.wolfram" | "connectors.recipe.firecrawl" | "connectors.recipe.exa";
386
+ /** For target use: only these feature choices. (1–15 items) */
387
+ keys?: Array<"default" | "chat" | "chat.route" | "generation" | "generation.notes" | "presentation" | "vision" | "images" | "shape" | "workshop" | "workshop.draft" | "canvas" | "agent.slatebox" | "library" | "connectors">;
388
+ /** (1–500 characters) */
389
+ reason: string;
390
+ }): Promise<({
391
+ target?: string;
392
+ cleared?: string[];
393
+ removed?: string[];
394
+ prompts?: string[];
395
+ unpinned?: string[];
396
+ dbLayer?: string;
397
+ [key: string]: unknown;
398
+ }) & { mode: "save" }>;
399
+ }
400
+
193
401
  declare namespace slatebox.ai {
194
402
  /** AI settings. The AI connections you, your team and this server have (never their keys), which one each feature uses (chat, generation, presentation, vision, images, shape, and the default), and which connection serves each feature for you now (effective), with what it cannot do. ownProviders false means this server uses only the AI its operator set up. @scope ai:settings */
195
403
  function get(input: Record<string, unknown>): Promise<{
196
404
  features: Array<Record<string, unknown>>;
405
+ /** Every feature and part a choice may name, with the one it follows while unset. */
406
+ surfaces?: Array<Record<string, unknown>>;
197
407
  useKeys?: string[];
198
408
  ownProviders: boolean;
199
409
  keysAvailable?: boolean;
@@ -206,6 +416,199 @@ declare namespace slatebox.ai {
206
416
  }>;
207
417
  }
208
418
 
419
+ declare namespace slatebox.ai.models {
420
+ /** Find AI models. Lists the models a server connection reports (GET <address>/models, OpenAI-compatible providers only), to fill in the model registry. Writes nothing; the key goes only to the connection's own address, with no redirects. Administrators only. @scope ai:admin:read @openWorld */
421
+ function discover(input: {
422
+ connection: string;
423
+ }): Promise<{
424
+ connection?: string;
425
+ ok?: boolean;
426
+ models?: Array<Record<string, unknown>>;
427
+ message?: string;
428
+ [key: string]: unknown;
429
+ }>;
430
+ }
431
+
432
+ declare namespace slatebox.ai.models {
433
+ /** Save AI models. Adds or changes models: the connection that serves each (server:<name> or builtin:<provider>), what it can do (tools, vision, json, images, reasoning), its context and output limits, and its prices in dollars per million input and output tokens (or per image). Metering charges these prices from the next call; a model with no price is charged at the dearest known rate and shown as unpriced. status disabled keeps a model out of bindings. Administrators only. @scope ai:admin @confirm @idempotent */
434
+ function save(input: {
435
+ /** (1–50 items) */
436
+ models: Array<{
437
+ /** server:<connection> or builtin:deepinfra|openai|anthropic|stabilityai. */
438
+ connection: string;
439
+ /** (1–200 characters) */
440
+ model: string;
441
+ /** (at most 80 characters) */
442
+ label?: string | null;
443
+ /** What the model can do. A binding refuses a model whose flags miss what its surface needs. */
444
+ capabilities?: {
445
+ tools?: boolean;
446
+ vision?: boolean;
447
+ json?: boolean;
448
+ images?: boolean;
449
+ reasoning?: boolean;
450
+ };
451
+ /** (at least 1) */
452
+ maxContext?: number | null;
453
+ /** (at least 1) */
454
+ maxOutput?: number | null;
455
+ prices?: {
456
+ /** Dollars per million input tokens. (at least 0) */
457
+ inputPerM?: number | null;
458
+ /** Dollars per million output tokens. (at least 0) */
459
+ outputPerM?: number | null;
460
+ /** Dollars per generated image. (at least 0) */
461
+ imageEach?: number | null;
462
+ currency?: "USD";
463
+ } | null;
464
+ status?: "enabled" | "disabled";
465
+ }>;
466
+ /** Why, for the change history. (1–500 characters) */
467
+ reason?: string;
468
+ }): Promise<({
469
+ models?: Array<Record<string, unknown>>;
470
+ generation?: number | null;
471
+ [key: string]: unknown;
472
+ }) & { mode: "save" }>;
473
+ }
474
+
475
+ declare namespace slatebox.ai.prompts {
476
+ /** AI prompt. Returns one prompt: the built-in text (version 0), the text served now and where it comes from, every saved version newest first with its author, note and eval results, the values it may use, and the samples a test run can send. Administrators only. @scope ai:admin:read */
477
+ function get(input: {
478
+ /** The prompt, for example shape.system. */
479
+ id: "shape.system" | "shape.user" | "shape.retry" | "tool.propose_shapes" | "workshop.map.system" | "workshop.lane.system" | "workshop.chat.retry" | "tool.propose_map_edits" | "tool.propose_workshop_edits" | "workshop.draft.system" | "workshop.draft.map" | "workshop.draft.release" | "workshop.draft.rules" | "workshop.draft.retry" | "workshop.draft.repair" | "tool.draft_workshop" | "tool.draft_concept_map" | "tool.draft_release_plan" | "tool.revise_workshop_rules" | "exec.chat.system" | "exec.chat.fix" | "exec.chat.retry" | "agent.request.notes" | "presentation.segments" | "presentation.art" | "presentation.system" | "presentation.system.dynamic" | "presentation.system.slides" | "presentation.system.template" | "presentation.slate" | "presentation.user" | "presentation.brief" | "presentation.refine" | "tool.create-presentation" | "tool.create-presentation.image-query" | "tool.create-presentation.image-prompt" | "tool.create-presentation.image-why" | "library.refine.system" | "library.refine.request" | "library.refine.retry" | "tool.propose_library_refinement" | "connectors.plan.system" | "connectors.plan.next" | "connectors.plan.tool" | "connectors.layout.system" | "connectors.layout.budget" | "connectors.layout.tool" | "connectors.recipe.github" | "connectors.recipe.linear" | "connectors.recipe.huggingface" | "connectors.recipe.deepwiki" | "connectors.recipe.context7" | "connectors.recipe.wolfram" | "connectors.recipe.firecrawl" | "connectors.recipe.exa";
480
+ }): Promise<{
481
+ id?: string;
482
+ code?: Record<string, unknown>;
483
+ live?: Record<string, unknown>;
484
+ versions?: Array<Record<string, unknown>>;
485
+ [key: string]: unknown;
486
+ }>;
487
+ }
488
+
489
+ declare namespace slatebox.ai.prompts {
490
+ /** AI prompts. Lists every prompt Slatebox sends its models, by part of Slatebox: the version served now and where it comes from (built in, published or pinned by a binding), the published and previous versions, and any draft or suggestion. Administrators only. @scope ai:admin:read */
491
+ function list(input: Record<string, unknown>): Promise<{
492
+ surfaces?: Array<Record<string, unknown>>;
493
+ [key: string]: unknown;
494
+ }>;
495
+ }
496
+
497
+ declare namespace slatebox.ai.prompts {
498
+ /** Render AI prompt. Renders a prompt version (or text sent with the call) into the request a built-in sample sends, and reports its lint findings. No model is called and nothing is saved. Administrators only. @scope ai:admin:read @idempotent */
499
+ function render(input: {
500
+ /** The prompt, for example shape.system. */
501
+ id: "shape.system" | "shape.user" | "shape.retry" | "tool.propose_shapes" | "workshop.map.system" | "workshop.lane.system" | "workshop.chat.retry" | "tool.propose_map_edits" | "tool.propose_workshop_edits" | "workshop.draft.system" | "workshop.draft.map" | "workshop.draft.release" | "workshop.draft.rules" | "workshop.draft.retry" | "workshop.draft.repair" | "tool.draft_workshop" | "tool.draft_concept_map" | "tool.draft_release_plan" | "tool.revise_workshop_rules" | "exec.chat.system" | "exec.chat.fix" | "exec.chat.retry" | "agent.request.notes" | "presentation.segments" | "presentation.art" | "presentation.system" | "presentation.system.dynamic" | "presentation.system.slides" | "presentation.system.template" | "presentation.slate" | "presentation.user" | "presentation.brief" | "presentation.refine" | "tool.create-presentation" | "tool.create-presentation.image-query" | "tool.create-presentation.image-prompt" | "tool.create-presentation.image-why" | "library.refine.system" | "library.refine.request" | "library.refine.retry" | "tool.propose_library_refinement" | "connectors.plan.system" | "connectors.plan.next" | "connectors.plan.tool" | "connectors.layout.system" | "connectors.layout.budget" | "connectors.layout.tool" | "connectors.recipe.github" | "connectors.recipe.linear" | "connectors.recipe.huggingface" | "connectors.recipe.deepwiki" | "connectors.recipe.context7" | "connectors.recipe.wolfram" | "connectors.recipe.firecrawl" | "connectors.recipe.exa";
502
+ /** A saved version; 0 is the built-in text. (at least 0) */
503
+ version?: number;
504
+ /** The text. Values go in as {{name}}; {{#flag}}…{{/flag}} keeps text only when the flag is set, {{^flag}}…{{/flag}} only when it is not. (1–32768 characters) */
505
+ body?: string;
506
+ /** Per value: data encloses it in a <data> block so it reads as data, not instructions. */
507
+ wrap?: Record<string, "none" | "data">;
508
+ /** A built-in sample (ai.prompts.get lists them). Default: the first. (at most 40 characters) */
509
+ sample?: string;
510
+ }): Promise<({
511
+ sample?: string | null;
512
+ rendered?: Record<string, unknown> | null;
513
+ lint?: Record<string, unknown>;
514
+ [key: string]: unknown;
515
+ }) & { mode: "save" }>;
516
+ }
517
+
518
+ declare namespace slatebox.ai.prompts {
519
+ /** Save AI prompt draft. Saves a new draft version of a prompt. Changes nothing live: a person publishes it after its checks pass. An agent's draft is marked as a suggestion. Returns the version and its lint findings. Administrators only. @scope ai:admin */
520
+ function saveDraft(input: {
521
+ /** The prompt, for example shape.system. */
522
+ id: "shape.system" | "shape.user" | "shape.retry" | "tool.propose_shapes" | "workshop.map.system" | "workshop.lane.system" | "workshop.chat.retry" | "tool.propose_map_edits" | "tool.propose_workshop_edits" | "workshop.draft.system" | "workshop.draft.map" | "workshop.draft.release" | "workshop.draft.rules" | "workshop.draft.retry" | "workshop.draft.repair" | "tool.draft_workshop" | "tool.draft_concept_map" | "tool.draft_release_plan" | "tool.revise_workshop_rules" | "exec.chat.system" | "exec.chat.fix" | "exec.chat.retry" | "agent.request.notes" | "presentation.segments" | "presentation.art" | "presentation.system" | "presentation.system.dynamic" | "presentation.system.slides" | "presentation.system.template" | "presentation.slate" | "presentation.user" | "presentation.brief" | "presentation.refine" | "tool.create-presentation" | "tool.create-presentation.image-query" | "tool.create-presentation.image-prompt" | "tool.create-presentation.image-why" | "library.refine.system" | "library.refine.request" | "library.refine.retry" | "tool.propose_library_refinement" | "connectors.plan.system" | "connectors.plan.next" | "connectors.plan.tool" | "connectors.layout.system" | "connectors.layout.budget" | "connectors.layout.tool" | "connectors.recipe.github" | "connectors.recipe.linear" | "connectors.recipe.huggingface" | "connectors.recipe.deepwiki" | "connectors.recipe.context7" | "connectors.recipe.wolfram" | "connectors.recipe.firecrawl" | "connectors.recipe.exa";
523
+ /** The text. Values go in as {{name}}; {{#flag}}…{{/flag}} keeps text only when the flag is set, {{^flag}}…{{/flag}} only when it is not. (1–32768 characters) */
524
+ body: string;
525
+ /** Per value: data encloses it in a <data> block so it reads as data, not instructions. */
526
+ wrap?: Record<string, "none" | "data">;
527
+ /** A short note kept with the version. (at most 200 characters) */
528
+ note?: string;
529
+ /** The version the text was edited from (0: the built-in text). A draft edited from a suggestion stays marked as one when it is published. (at least 0) */
530
+ basedOn?: number;
531
+ }): Promise<({
532
+ id?: string;
533
+ version?: number;
534
+ status?: string;
535
+ origin?: string;
536
+ lint?: Record<string, unknown>;
537
+ [key: string]: unknown;
538
+ }) & { mode: "save" }>;
539
+ }
540
+
541
+ declare namespace slatebox.ai.prompts {
542
+ /** Test AI prompt. Sends a prompt version (or text sent with the call) with a built-in sample through a part of Slatebox's binding (default: the prompt's own). Returns the request sent, the raw answer, whether that part could use it, the model, latency and cost. The answer is shown, never applied. Metered to the caller; 30 an hour per administrator. Administrators only. @scope ai:admin */
543
+ function test(input: {
544
+ /** The prompt, for example shape.system. */
545
+ id: "shape.system" | "shape.user" | "shape.retry" | "tool.propose_shapes" | "workshop.map.system" | "workshop.lane.system" | "workshop.chat.retry" | "tool.propose_map_edits" | "tool.propose_workshop_edits" | "workshop.draft.system" | "workshop.draft.map" | "workshop.draft.release" | "workshop.draft.rules" | "workshop.draft.retry" | "workshop.draft.repair" | "tool.draft_workshop" | "tool.draft_concept_map" | "tool.draft_release_plan" | "tool.revise_workshop_rules" | "exec.chat.system" | "exec.chat.fix" | "exec.chat.retry" | "agent.request.notes" | "presentation.segments" | "presentation.art" | "presentation.system" | "presentation.system.dynamic" | "presentation.system.slides" | "presentation.system.template" | "presentation.slate" | "presentation.user" | "presentation.brief" | "presentation.refine" | "tool.create-presentation" | "tool.create-presentation.image-query" | "tool.create-presentation.image-prompt" | "tool.create-presentation.image-why" | "library.refine.system" | "library.refine.request" | "library.refine.retry" | "tool.propose_library_refinement" | "connectors.plan.system" | "connectors.plan.next" | "connectors.plan.tool" | "connectors.layout.system" | "connectors.layout.budget" | "connectors.layout.tool" | "connectors.recipe.github" | "connectors.recipe.linear" | "connectors.recipe.huggingface" | "connectors.recipe.deepwiki" | "connectors.recipe.context7" | "connectors.recipe.wolfram" | "connectors.recipe.firecrawl" | "connectors.recipe.exa";
546
+ /** A saved version; 0 is the built-in text. (at least 0) */
547
+ version?: number;
548
+ /** The text. Values go in as {{name}}; {{#flag}}…{{/flag}} keeps text only when the flag is set, {{^flag}}…{{/flag}} only when it is not. (1–32768 characters) */
549
+ body?: string;
550
+ /** Per value: data encloses it in a <data> block so it reads as data, not instructions. */
551
+ wrap?: Record<string, "none" | "data">;
552
+ /** A built-in sample (ai.prompts.get lists them). Default: the first. (at most 40 characters) */
553
+ sample?: string;
554
+ /** Whose binding (model chain) to test against. */
555
+ surface?: "default" | "chat" | "chat.route" | "generation" | "presentation" | "vision" | "images" | "shape" | "workshop" | "workshop.draft" | "canvas" | "agent.slatebox" | "library" | "connectors";
556
+ }): Promise<({
557
+ rendered?: Record<string, unknown>;
558
+ answer?: Record<string, unknown>;
559
+ parses?: Record<string, unknown>;
560
+ latencyMs?: number;
561
+ model?: string | null;
562
+ costMicros?: number;
563
+ [key: string]: unknown;
564
+ }) & { mode: "save" }>;
565
+ }
566
+
567
+ declare namespace slatebox.ai.providers {
568
+ /** Save AI provider. Adds or changes a provider template: its wire protocol (openai-chat, anthropic-messages or openai-images), address, how the key is sent (bearer, a header, a query parameter or none), extra headers (nothing secret) and what its models can usually do. Built-in providers cannot be changed. Changing an address removes the keys of the connections that use it, after dropKeys true; a key is never sent to a new address. Only a person sets an address, key style or headers. Administrators only. @scope ai:admin @confirm @idempotent */
569
+ function save(input: {
570
+ provider: {
571
+ /** The provider's id, for example gemini. Built-in ids cannot be used. */
572
+ id: string;
573
+ /** (1–80 characters) */
574
+ label: string;
575
+ /** The wire protocol it speaks. Gemini, Meta, Mistral, OpenRouter, Groq, Together, Ollama and vLLM speak openai-chat. */
576
+ protocol: "openai-chat" | "anthropic-messages" | "openai-images";
577
+ /** The address up to /v1. null: each connection gives its own. (at most 500 characters) */
578
+ baseUrl?: string | null;
579
+ /** Connections of this provider keep its address (default true when an address is given). */
580
+ baseUrlLocked?: boolean;
581
+ /** How the key is sent: bearer (Authorization: Bearer), header { name }, query { name } or none. */
582
+ auth?: {
583
+ style: "bearer" | "header" | "query" | "none";
584
+ /** (at most 64 characters) */
585
+ name?: string;
586
+ };
587
+ /** Headers sent with every request. Nothing secret: names that look like credentials are refused. */
588
+ extraHeaders?: Record<string, string>;
589
+ keyRequired?: boolean;
590
+ modelOptional?: boolean;
591
+ /** What its models can usually do; a connection or model may say otherwise. */
592
+ defaultCapabilities?: {
593
+ tools?: boolean;
594
+ vision?: boolean;
595
+ json?: boolean;
596
+ images?: boolean;
597
+ reasoning?: boolean;
598
+ };
599
+ };
600
+ /** Go ahead with an address change that removes connections' keys. */
601
+ dropKeys?: boolean;
602
+ /** Why, for the change history. (1–500 characters) */
603
+ reason?: string;
604
+ }): Promise<({
605
+ provider?: Record<string, unknown>;
606
+ droppedKeys?: string[];
607
+ generation?: number | null;
608
+ [key: string]: unknown;
609
+ }) & { mode: "save" }>;
610
+ }
611
+
209
612
  declare namespace slatebox.ai {
210
613
  /** Set AI. Adds or changes AI connections (a cloud provider with its key, or any OpenAI-compatible endpoint with its address, optional key and model), removes some, and chooses which connection each feature uses. level me changes yours, team your team's (team admins), server this server's (administrators; ownProviders on or off lets people use their own). Mix freely: a choice names me:<name>, team:<name>, server:<name> or builtin. Keys are stored encrypted and never returned, and a run's record keeps its code with the apiKey replaced. Returns the settings as ai.get does. A token needs ai:admin as well for level team or server. Own AI (levels me and team) is for self-hosted Slatebox: Slatebox Cloud refuses it, as AI there comes with Slatebox Pro credits and top-ups. @scope ai:settings @destructive @confirm @idempotent */
211
614
  function update(input: {
@@ -215,8 +618,8 @@ declare namespace slatebox.ai {
215
618
  connections?: Array<{
216
619
  /** Your name for it, for example desk-model. */
217
620
  name: string;
218
- /** openai-compatible covers any host or local server (Ollama, llama.cpp, vLLM, LM Studio and others). */
219
- type: "openai-compatible" | "openai" | "anthropic" | "deepinfra";
621
+ /** The provider: openai-compatible (any host or local server: Ollama, llama.cpp, vLLM, LM Studio and others), openai, anthropic, deepinfra, or one an administrator added (ai.control.get lists them). */
622
+ type: string;
220
623
  /** For openai-compatible: the address up to /v1, for example http://host.docker.internal:11434/v1. (at most 500 characters) */
221
624
  baseUrl?: string;
222
625
  /** The model name the endpoint serves. (at most 200 characters) */
@@ -236,15 +639,19 @@ declare namespace slatebox.ai {
236
639
  }>;
237
640
  /** (at most 20 items) */
238
641
  remove?: string[];
239
- /** Which connection each feature uses. default serves every feature not named. */
642
+ /** Which connection each feature uses. An unset feature follows the one it belongs to (workshop follows chat), and default serves every feature not named. */
240
643
  use?: {
241
644
  /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
242
645
  default?: string | null;
243
646
  /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
244
647
  chat?: string | null;
245
648
  /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
649
+ "chat.route"?: string | null;
650
+ /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
246
651
  generation?: string | null;
247
652
  /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
653
+ "generation.notes"?: string | null;
654
+ /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
248
655
  presentation?: string | null;
249
656
  /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
250
657
  vision?: string | null;
@@ -252,10 +659,24 @@ declare namespace slatebox.ai {
252
659
  images?: string | null;
253
660
  /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
254
661
  shape?: string | null;
662
+ /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
663
+ workshop?: string | null;
664
+ /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
665
+ "workshop.draft"?: string | null;
666
+ /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
667
+ canvas?: string | null;
668
+ /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
669
+ "agent.slatebox"?: string | null;
670
+ /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
671
+ library?: string | null;
672
+ /** me:<name>, team:<name> or server:<name> for a connection, builtin for the AI this server provides, null to clear. (at most 48 characters) */
673
+ connectors?: string | null;
255
674
  };
256
675
  ownProviders?: "on" | "off";
257
676
  }): Promise<({
258
677
  features: Array<Record<string, unknown>>;
678
+ /** Every feature and part a choice may name, with the one it follows while unset. */
679
+ surfaces?: Array<Record<string, unknown>>;
259
680
  useKeys?: string[];
260
681
  ownProviders: boolean;
261
682
  keysAvailable?: boolean;
@@ -402,10 +823,553 @@ declare namespace slatebox.instance {
402
823
  workshops?: Record<string, unknown>;
403
824
  actions?: Array<Record<string, unknown>>;
404
825
  account?: Record<string, unknown>;
826
+ /** With a token or sign-in: the shared library's categories, and whether you review its submissions. */
827
+ library?: Record<string, unknown>;
828
+ [key: string]: unknown;
829
+ }>;
830
+ }
831
+
832
+ declare namespace slatebox.library {
833
+ /** Branch off a component. Start building a smart component on a new private slate (a builder slate): a copy of a library component to change (itemId), or an empty one (itemId "new"). Grow it by chat and with the controls on the board, then library.saveDraft and library.submit. A branch keeps its parent's category. @scope slates:write */
834
+ function branch(input: {
835
+ /** The component to branch off, or "new" for an empty builder slate. (1–120 characters) */
836
+ itemId: string;
837
+ /** A version number (item.publishedVersion by default). (at least 1) */
838
+ version?: number;
839
+ }): Promise<({
840
+ shareId: string;
841
+ revision?: number;
842
+ [key: string]: unknown;
843
+ }) & { mode: "save" }>;
844
+ }
845
+
846
+ declare namespace slatebox.library {
847
+ /** Write in the thread. Write in a library item's review thread: its author and the reviewers read it. @scope slates:write */
848
+ function comment(input: {
849
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
850
+ itemId: string;
851
+ /** (1–2000 characters) */
852
+ message: string;
853
+ }): Promise<({
854
+ itemId: string;
855
+ eventId: string;
856
+ [key: string]: unknown;
857
+ }) & { mode: "save" }>;
858
+ }
859
+
860
+ declare namespace slatebox.library {
861
+ /** Discard a draft. Delete your own draft library item (never submitted, or withdrawn). Its builder slate stays. @scope slates:write @destructive */
862
+ function discard(input: {
863
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
864
+ itemId: string;
865
+ }): Promise<({
866
+ itemId: string;
867
+ discarded: boolean;
868
+ [key: string]: unknown;
869
+ }) & { mode: "save" }>;
870
+ }
871
+
872
+ declare namespace slatebox.library {
873
+ /** Library export. Every published library item with its published version's content, 50 per page, oldest first: what the public gallery is built from. @scope slates:read */
874
+ function export(input: {
875
+ /** The next value the previous page gave. (at most 12 characters) */
876
+ cursor?: string;
877
+ }): Promise<{
878
+ items: Array<Record<string, unknown>>;
879
+ next?: string;
880
+ [key: string]: unknown;
881
+ }>;
882
+ }
883
+
884
+ declare namespace slatebox.library {
885
+ /** Use a library item. Use a library item: a slate or presentation becomes a new private slate of yours (a presentation with its deck), and a smart component goes onto a new slate, or beside the boards of a slate you can edit (targetShareId; a slate holds up to 8 boards, past that 409 component_opens_new_slate; an agent gets 423 agents_paused while people there paused agents). The copy remembers where it came from. Preview first to see the board and where it goes (canvas); save makes it. topic names the board ("Retro: Q3 launch"). @scope slates:write @modes save|preview */
886
+ function fork(input: {
887
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
888
+ itemId: string;
889
+ /** A version number (item.publishedVersion by default). (at least 1) */
890
+ version?: number;
891
+ /** The new slate's name (the item's title by default). (1–200 characters) */
892
+ name?: string;
893
+ /** A smart component only: the slate to add it to (one you can edit). (1–80 characters) */
894
+ targetShareId?: string;
895
+ /** With targetShareId: the slate revision you read; a slate changed since is refused with 409 slate_changed. (at least 0) */
896
+ expectedRevision?: number;
897
+ /** A smart component only: what it is about, which names its board. (1–100 characters) */
898
+ topic?: string;
899
+ /** preview returns what would change and saves nothing. (default "save") */
900
+ mode?: "save" | "preview";
901
+ }): Promise<({
902
+ /** The slate it went to (null in a preview that would make a new slate). */
903
+ shareId: string | null;
904
+ revision?: number;
905
+ boardId?: string;
906
+ itemId: string;
907
+ version: number;
908
+ /** A component preview: { workshop, origin } as the canvas draws it. */
909
+ canvas?: Record<string, unknown>;
910
+ name?: string;
911
+ notes?: number;
912
+ [key: string]: unknown;
913
+ }) & { mode: "save" | "preview" }>;
914
+ }
915
+
916
+ declare namespace slatebox.library {
917
+ /** Library item. One library item by id or slug, with a version's content: a smart component's board (workshop, with its rules), or a slate's notes (and a presentation's deck). Anyone reads published items; an item's author and reviewers also read its drafts, every version and its review thread. @scope slates:read */
918
+ function get(input: {
919
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
920
+ itemId: string;
921
+ /** A version number (item.publishedVersion by default). (at least 1) */
922
+ version?: number;
923
+ }): Promise<{
924
+ item: {
925
+ id: string;
926
+ slug: string;
927
+ kind: "component" | "slate" | "presentation";
928
+ origin: "builtin" | "user";
929
+ title: string;
930
+ summary: string;
931
+ /** One of the five categories: plan, decide, meetings, track, map. */
932
+ category?: "plan" | "decide" | "meetings" | "track" | "map";
933
+ authorName: string;
934
+ publishedAt?: string;
935
+ counts: {
936
+ copies?: number;
937
+ adds?: number;
938
+ branches?: number;
939
+ [key: string]: unknown;
940
+ };
941
+ /** branchedFrom or forkedFrom: { itemId, version, title }. */
942
+ provenance?: Record<string, unknown>;
943
+ url: string;
944
+ preview?: {
945
+ kind?: "component" | "slate" | "presentation";
946
+ boardKind?: string;
947
+ notes?: number;
948
+ [key: string]: unknown;
949
+ };
950
+ description?: string;
951
+ synonyms?: string[];
952
+ license?: string;
953
+ categoryLocked?: boolean;
954
+ versionCount?: number;
955
+ publishedVersion?: number;
956
+ /** How many times it has been published, when more than once (absent: once). */
957
+ publishedCount?: number;
958
+ /** Its author and reviewers only. */
959
+ status?: "draft" | "submitted" | "in_review" | "changes_requested" | "published" | "rejected" | "unpublished";
960
+ /** The state of the version waiting for review (its author and reviewers only). */
961
+ reviewStatus?: string;
962
+ pendingVersion?: number;
963
+ /** An update to a published item: its proposed details, public once approved. */
964
+ pendingMeta?: Record<string, unknown>;
965
+ /** A published item's saved draft details, not yet submitted (its author only). */
966
+ draftMeta?: Record<string, unknown>;
967
+ sourceShareId?: string;
968
+ reviewShareId?: string;
969
+ lastMessage?: Record<string, unknown>;
970
+ [key: string]: unknown;
971
+ };
972
+ version: {
973
+ n: number;
974
+ meta: Record<string, unknown>;
975
+ /** { kind: component, workshop } | { kind: slate, slate } | { kind: presentation, slate, deck } */
976
+ content: Record<string, unknown>;
977
+ createdAt?: string;
978
+ [key: string]: unknown;
979
+ };
980
+ /** Its author and reviewers only: the review thread (every action and message), oldest first. */
981
+ thread?: Array<Record<string, unknown>>;
982
+ [key: string]: unknown;
983
+ }>;
984
+ }
985
+
986
+ declare namespace slatebox.library {
987
+ /** Library. Published items of the shared library: smart components (boards that keep their rules: the ones built into Slatebox and the ones people built), slates and presentations anyone can copy. Filter by kind, category (plan, decide, meetings, track, map), origin (builtin or user) or words (q); sort new or popular. 24 per page by default (at most 48); pass next as cursor for more. Open to anyone. @scope slates:read */
988
+ function list(input: {
989
+ kind?: "component" | "slate" | "presentation";
990
+ /** One of the five categories: plan, decide, meetings, track, map. */
991
+ category?: "plan" | "decide" | "meetings" | "track" | "map";
992
+ /** (1–100 characters) */
993
+ q?: string;
994
+ /** (default "new") */
995
+ sort?: "new" | "popular";
996
+ origin?: "builtin" | "user";
997
+ /** The next value the previous page gave. (at most 12 characters) */
998
+ cursor?: string;
999
+ /** (1 to 48) */
1000
+ limit?: number;
1001
+ }): Promise<{
1002
+ items: Array<{
1003
+ id: string;
1004
+ slug: string;
1005
+ kind: "component" | "slate" | "presentation";
1006
+ origin: "builtin" | "user";
1007
+ title: string;
1008
+ summary: string;
1009
+ /** One of the five categories: plan, decide, meetings, track, map. */
1010
+ category?: "plan" | "decide" | "meetings" | "track" | "map";
1011
+ authorName: string;
1012
+ publishedAt?: string;
1013
+ counts: {
1014
+ copies?: number;
1015
+ adds?: number;
1016
+ branches?: number;
1017
+ [key: string]: unknown;
1018
+ };
1019
+ /** branchedFrom or forkedFrom: { itemId, version, title }. */
1020
+ provenance?: Record<string, unknown>;
1021
+ url: string;
1022
+ preview?: {
1023
+ kind?: "component" | "slate" | "presentation";
1024
+ boardKind?: string;
1025
+ notes?: number;
1026
+ [key: string]: unknown;
1027
+ };
1028
+ [key: string]: unknown;
1029
+ }>;
1030
+ next?: string;
1031
+ total: number;
1032
+ [key: string]: unknown;
1033
+ }>;
1034
+ }
1035
+
1036
+ declare namespace slatebox.library {
1037
+ /** My library. Your own library items, newest first: drafts, submissions waiting for review, items that need changes, published and not accepted ones, each with its status, the version waiting, the last message and the last 20 events of its thread. @scope slates:read */
1038
+ function mine(input: {
1039
+ status?: "draft" | "submitted" | "in_review" | "changes_requested" | "published" | "rejected" | "unpublished";
1040
+ }): Promise<{
1041
+ items: Array<Record<string, unknown>>;
1042
+ [key: string]: unknown;
1043
+ }>;
1044
+ }
1045
+
1046
+ declare namespace slatebox.library.review {
1047
+ /** Approve and publish. For administrators: publish an item in review as its review copy stands now (your refinements included), as the version its author sent. Anyone can then find, use and change it. The author is told. The person agrees first. @scope library:review @confirm */
1048
+ function approve(input: {
1049
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
1050
+ itemId: string;
1051
+ /** (1–2000 characters) */
1052
+ message?: string;
1053
+ /** Review your own submission. Allowed only on a server with one administrator; the thread records it. */
1054
+ selfReview?: boolean;
1055
+ }): Promise<({
1056
+ itemId: string;
1057
+ status: string;
1058
+ publishedVersion: number;
1059
+ /** How many times it has been published, this time included (1 the first time). */
1060
+ publishedCount?: number;
1061
+ url?: string;
1062
+ [key: string]: unknown;
1063
+ }) & { mode: "save" }>;
1064
+ }
1065
+
1066
+ declare namespace slatebox.library.review {
1067
+ /** Open for review. For administrators: make (or refresh) your private review copy of a submission's waiting version, a slate you can change on the canvas, and mark it in review. Approving publishes that copy as it stands. Opening again for the same version answers the same copy. @scope library:review */
1068
+ function open(input: {
1069
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
1070
+ itemId: string;
1071
+ /** Review your own submission. Allowed only on a server with one administrator; the thread records it. */
1072
+ selfReview?: boolean;
1073
+ }): Promise<({
1074
+ itemId: string;
1075
+ reviewShareId: string;
1076
+ status?: string;
1077
+ reviewStatus?: string | null;
1078
+ version?: number;
1079
+ [key: string]: unknown;
1080
+ }) & { mode: "save" }>;
1081
+ }
1082
+
1083
+ declare namespace slatebox.library.review {
1084
+ /** Review queue. For administrators: library items to review, oldest first: waiting (submitted and changes requested, the default), in_review, changes_requested, rejected, published or all. Each with its author, kind, the version waiting, whether it updates a published item, how long it has waited and the last message. source migration lists the slates moved from Community slates. @scope library:review */
1085
+ function queue(input: {
1086
+ /** (default "waiting") */
1087
+ status?: "waiting" | "submitted" | "in_review" | "changes_requested" | "rejected" | "published" | "all";
1088
+ kind?: "component" | "slate" | "presentation";
1089
+ source?: "migration";
1090
+ /** The next value the previous page gave. (at most 12 characters) */
1091
+ cursor?: string;
1092
+ }): Promise<{
1093
+ items: Array<Record<string, unknown>>;
1094
+ next?: string;
1095
+ total: number;
1096
+ [key: string]: unknown;
1097
+ }>;
1098
+ }
1099
+
1100
+ declare namespace slatebox.library.review {
1101
+ /** Refine by chat. For administrators: ask for a change to an item in review in plain words ("rename it to Weekly retro", "put it in Meetings", "Write a clearer one-line summary", "What should I check?"). Preview answers the proposal (metadata from and to, rule lines for a component's board, things to check) and its previewId; save with that previewId keeps exactly it, on the item and on the review copy. Simple renames, categories and summaries are read without AI. @scope library:review @modes save|preview */
1102
+ function refine(input: {
1103
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
1104
+ itemId: string;
1105
+ /** (1–2000 characters) */
1106
+ message: string;
1107
+ /** Review your own submission. Allowed only on a server with one administrator; the thread records it. */
1108
+ selfReview?: boolean;
1109
+ /** Save: the previewId a preview answered. Keeps exactly that proposal (no second AI answer). (at most 64 characters) */
1110
+ previewId?: string;
1111
+ /** (at most 6 items) */
1112
+ history?: Array<{
1113
+ role: "user" | "assistant";
1114
+ /** (at most 2000 characters) */
1115
+ text: string;
1116
+ }>;
1117
+ /** preview returns what would change and saves nothing. (default "save") */
1118
+ mode?: "save" | "preview";
1119
+ }): Promise<({
1120
+ itemId: string;
1121
+ reply: string;
1122
+ proposal?: Record<string, unknown>;
1123
+ diff?: Record<string, unknown>;
1124
+ previewId?: string;
1125
+ kept?: boolean;
1126
+ revision?: number;
1127
+ [key: string]: unknown;
1128
+ }) & { mode: "save" | "preview" }>;
1129
+ }
1130
+
1131
+ declare namespace slatebox.library.review {
1132
+ /** Reject. For administrators: turn down a submission, with a message saying why. A published item's rejected update leaves the published version as it is. @scope library:review */
1133
+ function reject(input: {
1134
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
1135
+ itemId: string;
1136
+ /** Why: the author reads it. (1–2000 characters) */
1137
+ message: string;
1138
+ }): Promise<({
1139
+ itemId: string;
1140
+ slug?: string;
1141
+ status: string;
1142
+ reviewStatus?: string | null;
1143
+ version?: number;
1144
+ [key: string]: unknown;
1145
+ }) & { mode: "save" }>;
1146
+ }
1147
+
1148
+ declare namespace slatebox.library.review {
1149
+ /** Request changes. For administrators: send an item in review back to its author for changes, with a message saying what to change. @scope library:review */
1150
+ function requestChanges(input: {
1151
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
1152
+ itemId: string;
1153
+ /** Why: the author reads it. (1–2000 characters) */
1154
+ message: string;
1155
+ }): Promise<({
1156
+ itemId: string;
1157
+ slug?: string;
1158
+ status: string;
1159
+ reviewStatus?: string | null;
1160
+ version?: number;
1161
+ [key: string]: unknown;
1162
+ }) & { mode: "save" }>;
1163
+ }
1164
+
1165
+ declare namespace slatebox.library.review {
1166
+ /** Unpublish. For administrators: take a published item out of the library, with a message saying why. Copies people already made stay theirs. @scope library:review @destructive */
1167
+ function unpublish(input: {
1168
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
1169
+ itemId: string;
1170
+ /** Why: the author reads it. (1–2000 characters) */
1171
+ message: string;
1172
+ }): Promise<({
1173
+ itemId: string;
1174
+ slug?: string;
1175
+ status: string;
1176
+ reviewStatus?: string | null;
1177
+ version?: number;
1178
+ [key: string]: unknown;
1179
+ }) & { mode: "save" }>;
1180
+ }
1181
+
1182
+ declare namespace slatebox.library.review {
1183
+ /** Edit details. For administrators: change a library item's title, summary, description, category or search words directly. A branch's category stays its parent's. @scope library:review */
1184
+ function update(input: {
1185
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
1186
+ itemId: string;
1187
+ /** Plain text, up to 80 characters. (1–80 characters) */
1188
+ title?: string;
1189
+ /** One line, up to 160 characters. (1–160 characters) */
1190
+ summary?: string;
1191
+ /** Plain text, up to 2,000 characters. (at most 2000 characters) */
1192
+ description?: string;
1193
+ /** One of the five categories: plan, decide, meetings, track, map. */
1194
+ category?: "plan" | "decide" | "meetings" | "track" | "map";
1195
+ /** Smart components only: words people might search for. (at most 12 items) */
1196
+ synonyms?: string[];
1197
+ /** Review your own submission. Allowed only on a server with one administrator; the thread records it. */
1198
+ selfReview?: boolean;
1199
+ }): Promise<({
1200
+ item: {
1201
+ id: string;
1202
+ slug: string;
1203
+ kind: "component" | "slate" | "presentation";
1204
+ origin: "builtin" | "user";
1205
+ title: string;
1206
+ summary: string;
1207
+ /** One of the five categories: plan, decide, meetings, track, map. */
1208
+ category?: "plan" | "decide" | "meetings" | "track" | "map";
1209
+ authorName: string;
1210
+ publishedAt?: string;
1211
+ counts: {
1212
+ copies?: number;
1213
+ adds?: number;
1214
+ branches?: number;
1215
+ [key: string]: unknown;
1216
+ };
1217
+ /** branchedFrom or forkedFrom: { itemId, version, title }. */
1218
+ provenance?: Record<string, unknown>;
1219
+ url: string;
1220
+ preview?: {
1221
+ kind?: "component" | "slate" | "presentation";
1222
+ boardKind?: string;
1223
+ notes?: number;
1224
+ [key: string]: unknown;
1225
+ };
1226
+ description?: string;
1227
+ synonyms?: string[];
1228
+ license?: string;
1229
+ categoryLocked?: boolean;
1230
+ versionCount?: number;
1231
+ publishedVersion?: number;
1232
+ /** How many times it has been published, when more than once (absent: once). */
1233
+ publishedCount?: number;
1234
+ /** Its author and reviewers only. */
1235
+ status?: "draft" | "submitted" | "in_review" | "changes_requested" | "published" | "rejected" | "unpublished";
1236
+ /** The state of the version waiting for review (its author and reviewers only). */
1237
+ reviewStatus?: string;
1238
+ pendingVersion?: number;
1239
+ /** An update to a published item: its proposed details, public once approved. */
1240
+ pendingMeta?: Record<string, unknown>;
1241
+ /** A published item's saved draft details, not yet submitted (its author only). */
1242
+ draftMeta?: Record<string, unknown>;
1243
+ sourceShareId?: string;
1244
+ reviewShareId?: string;
1245
+ lastMessage?: Record<string, unknown>;
1246
+ [key: string]: unknown;
1247
+ };
1248
+ [key: string]: unknown;
1249
+ }) & { mode: "save" }>;
1250
+ }
1251
+
1252
+ declare namespace slatebox.library {
1253
+ /** Save a component. Save the board of your builder slate (library.branch) as your own smart component, private to you: you can add it to any slate at once. The first save makes the item; later saves update it (itemId, or the builder slate remembers it). A component needs a category before it is submitted; a branch keeps its parent's (another is refused with 409 category_locked). @scope slates:write */
1254
+ function saveDraft(input: {
1255
+ /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
1256
+ shareId: string;
1257
+ /** The board on the builder slate (main by default). */
1258
+ boardId?: string;
1259
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
1260
+ itemId?: string;
1261
+ /** Plain text, up to 80 characters. (1–80 characters) */
1262
+ title: string;
1263
+ /** One line, up to 160 characters. (1–160 characters) */
1264
+ summary: string;
1265
+ /** Plain text, up to 2,000 characters. (at most 2000 characters) */
1266
+ description?: string;
1267
+ /** One of the five categories: plan, decide, meetings, track, map. */
1268
+ category?: "plan" | "decide" | "meetings" | "track" | "map";
1269
+ /** Smart components only: words people might search for. (at most 12 items) */
1270
+ synonyms?: string[];
1271
+ }): Promise<({
1272
+ itemId: string;
1273
+ slug?: string;
1274
+ status: string;
1275
+ reviewStatus?: string | null;
1276
+ version?: number;
1277
+ [key: string]: unknown;
1278
+ }) & { mode: "save" }>;
1279
+ }
1280
+
1281
+ declare namespace slatebox.library {
1282
+ /** Library counts. How many published items the shared library holds: smart components (built in and from the community, and the total), slates, presentations, and items per category. Open to anyone. @scope slates:read */
1283
+ function stats(input: Record<string, unknown>): Promise<{
1284
+ components: {
1285
+ builtin?: number;
1286
+ community?: number;
1287
+ total?: number;
1288
+ [key: string]: unknown;
1289
+ };
1290
+ slates: number;
1291
+ presentations: number;
1292
+ categories: Record<string, unknown>;
1293
+ updatedAt?: string;
405
1294
  [key: string]: unknown;
406
1295
  }>;
407
1296
  }
408
1297
 
1298
+ declare namespace slatebox.library {
1299
+ /** Submit to the library. Send something of yours for review, to be published in the shared library: a smart component you saved (itemId), or a slate you own or administer (shareId; kind presentation sends its deck too). Once approved anyone can find, use and change it, shared under CC BY 4.0. Sending a published item again proposes an update; the published version stays until the update is approved. Up to 10 a day. A guest must sign up first (403 sign_in_to_publish). The person agrees first. @scope slates:share @confirm */
1300
+ function submit(input: {
1301
+ kind: "component" | "slate" | "presentation";
1302
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
1303
+ itemId?: string;
1304
+ /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
1305
+ shareId?: string;
1306
+ /** Plain text, up to 80 characters. (1–80 characters) */
1307
+ title?: string;
1308
+ /** One line, up to 160 characters. (1–160 characters) */
1309
+ summary?: string;
1310
+ /** Plain text, up to 2,000 characters. (at most 2000 characters) */
1311
+ description?: string;
1312
+ /** One of the five categories: plan, decide, meetings, track, map. */
1313
+ category?: "plan" | "decide" | "meetings" | "track" | "map";
1314
+ /** Smart components only: words people might search for. (at most 12 items) */
1315
+ synonyms?: string[];
1316
+ /** A note for the reviewer: the first message of the item's thread. (1–2000 characters) */
1317
+ note?: string;
1318
+ }): Promise<({
1319
+ itemId: string;
1320
+ slug?: string;
1321
+ status: string;
1322
+ reviewStatus?: string | null;
1323
+ version?: number;
1324
+ [key: string]: unknown;
1325
+ }) & { mode: "save" }>;
1326
+ }
1327
+
1328
+ declare namespace slatebox.library {
1329
+ /** Withdraw. Take back your submission before it is reviewed (it is a draft again), or take your published item out of the library (copies people made stay theirs). @scope slates:write */
1330
+ function withdraw(input: {
1331
+ /** The item: its id or its slug (library.list items[].id or .slug). (1–120 characters) */
1332
+ itemId: string;
1333
+ }): Promise<({
1334
+ itemId: string;
1335
+ slug?: string;
1336
+ status: string;
1337
+ reviewStatus?: string | null;
1338
+ version?: number;
1339
+ [key: string]: unknown;
1340
+ }) & { mode: "save" }>;
1341
+ }
1342
+
1343
+ declare namespace slatebox.media {
1344
+ /** Video info. Read a YouTube, Vimeo or Loom address: the video's host, id, canonical address, start time, title and author, and its poster picture stored in this app (so people's browsers reach the video host only when they press play). Pass the answer as media in an add_nodes operation (count 1), or call slates.addMedia to look up and add in one step. When the host shares no title or picture the video still comes back, with a notice. Any other address is refused with 400 not_a_video. At most 60 new videos per person per hour. @scope slates:write @openWorld @idempotent */
1345
+ function lookup(input: {
1346
+ /** The video's address: a YouTube, Vimeo or Loom link. (1–2000 characters) */
1347
+ url: string;
1348
+ }): Promise<({
1349
+ /** A video a media note plays: the address, the host, and the title and poster when the host shared them. */
1350
+ media: {
1351
+ provider: "youtube" | "vimeo" | "loom";
1352
+ id: string;
1353
+ /** The canonical watch address. */
1354
+ url: string;
1355
+ hash?: string;
1356
+ /** Where it starts, in seconds. */
1357
+ start?: number;
1358
+ title?: string;
1359
+ author?: string;
1360
+ /** The poster picture, in this app's image store. */
1361
+ poster?: string;
1362
+ posterWidth?: number;
1363
+ posterHeight?: number;
1364
+ [key: string]: unknown;
1365
+ };
1366
+ /** False when the host shared nothing about the video (private, removed, or not answering). */
1367
+ found: boolean;
1368
+ notice?: string;
1369
+ [key: string]: unknown;
1370
+ }) & { mode: "save" }>;
1371
+ }
1372
+
409
1373
  declare namespace slatebox.presence {
410
1374
  /** Show a plan. Show the people on a slate what this run will do: 1 to 8 short steps, as a checklist beside your named pointer. The first step is under way; presence.step ticks the steps. Saves move the pointer to what they change. At most 3 plans per run. A preview run shows nothing. @scope slates:write @modes save|preview */
411
1375
  function plan(input: {
@@ -461,6 +1425,47 @@ declare namespace slatebox.presence {
461
1425
  }) & { mode: "save" | "preview" }>;
462
1426
  }
463
1427
 
1428
+ declare namespace slatebox.presentations {
1429
+ /** Present. Create a presentation of a slate with the planner the Present button uses: the AI (feature presentation, counted like other AI use) groups the notes into steps and chooses each step's layout, kicker and caption, played on the live canvas with camera moves. Optional: a style (voyage, stage, editorial, neon, sketch, blueprint, journey, calm), a palette (3 to 6 colours) and a brief (what to focus on). Needs edit access to the slate. Each call plans a new version; mode "preview" plans and returns the steps and saves nothing. Returns the presentation id, its steps and a link that opens the slate and plays it. @scope slates:write @modes save|preview @openWorld */
1430
+ function create(input: {
1431
+ /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
1432
+ shareId: string;
1433
+ /** The style to play it in. Left out, the AI chooses. */
1434
+ style?: "voyage" | "stage" | "editorial" | "neon" | "sketch" | "blueprint" | "journey" | "calm";
1435
+ /** Your own colours, with a style: the first three lead, the background stays the style's. (3–6 items) */
1436
+ palette?: string[];
1437
+ /** What the presentation should focus on or bring out, in plain words. (1–4000 characters) */
1438
+ brief?: string;
1439
+ /** preview returns what would change and saves nothing. (default "save") */
1440
+ mode?: "save" | "preview";
1441
+ }): Promise<({
1442
+ /** The new presentation (null in a preview, which saves nothing). */
1443
+ presentationId: string | null;
1444
+ version?: number | null;
1445
+ name?: string;
1446
+ published?: boolean;
1447
+ /** The style it plays in. */
1448
+ style: "voyage" | "stage" | "editorial" | "neon" | "sketch" | "blueprint" | "journey" | "calm" | null;
1449
+ /** Every style it can play in. */
1450
+ styles?: string[];
1451
+ steps: Array<{
1452
+ step: number;
1453
+ layout: "title" | "overview" | "dive" | "hero" | "treeBuild" | "trace" | "sweep" | "group" | "bigNumber" | "quote" | "split" | "compare" | "cover" | "finale";
1454
+ kicker?: string;
1455
+ caption: string;
1456
+ /** How many of the slate's notes the step shows. */
1457
+ notes?: number;
1458
+ [key: string]: unknown;
1459
+ }>;
1460
+ /** Opens the slate and plays this presentation (null in a preview). */
1461
+ link: string | null;
1462
+ /** True when Slatebox grouped the notes itself because the AI could not plan the slate; reason says why. */
1463
+ automatic: boolean;
1464
+ reason?: string;
1465
+ [key: string]: unknown;
1466
+ }) & { mode: "save" | "preview" }>;
1467
+ }
1468
+
464
1469
  declare namespace slatebox.presentations {
465
1470
  /** Deck. Read your latest presentation of a slate: its style, and each step's layout (title, overview, dive, hero, treeBuild, trace, sweep, group, bigNumber, quote, split, compare, cover, finale), kicker and caption. The deck plays on the live canvas with Prezi-style camera moves. @scope slates:read */
466
1471
  function get(input: {
@@ -573,6 +1578,12 @@ declare namespace slatebox.shapes {
573
1578
  textBox?: Record<string, unknown> | null;
574
1579
  visibility?: "private" | "team";
575
1580
  mine?: boolean;
1581
+ /** For an icon from The Noun Project: the credit to show with it. */
1582
+ credit?: {
1583
+ text?: string;
1584
+ url?: string | null;
1585
+ [key: string]: unknown;
1586
+ };
576
1587
  [key: string]: unknown;
577
1588
  }>;
578
1589
  cached?: boolean;
@@ -603,14 +1614,104 @@ declare namespace slatebox.shapes {
603
1614
  textBox?: Record<string, unknown> | null;
604
1615
  visibility?: "private" | "team";
605
1616
  mine?: boolean;
1617
+ /** For an icon from The Noun Project: the credit to show with it. */
1618
+ credit?: {
1619
+ text?: string;
1620
+ url?: string | null;
1621
+ [key: string]: unknown;
1622
+ };
1623
+ [key: string]: unknown;
1624
+ }>;
1625
+ [key: string]: unknown;
1626
+ }>;
1627
+ }
1628
+
1629
+ declare namespace slatebox.shapes {
1630
+ /** Icons. Search The Noun Project's icons by words. Each result is one checked outline in a 0..100 box (icons that cannot be one outline are left out) with credit: the text and link The Noun Project asks to show with the icon. An applyOperations update_nodes or add_nodes plan takes {name, d, fillRule} as the shape. Not counted as AI use. Answers 503 icons_not_set_up on a server without a Noun Project key. @scope slates:read @openWorld */
1631
+ function searchIcons(input: {
1632
+ /** Words for the icon, such as songbird. (1–100 characters) */
1633
+ q: string;
1634
+ /** (1 to 24, default 12) */
1635
+ limit?: number;
1636
+ }): Promise<{
1637
+ icons: Array<{
1638
+ iconId?: string;
1639
+ name?: string;
1640
+ /** The outline: one SVG path in a 0..100 box. */
1641
+ d?: string;
1642
+ fillRule?: "nonzero" | "evenodd";
1643
+ /** Width / height. */
1644
+ aspect?: number;
1645
+ /** Where a label sits, in 0..1 of the box. */
1646
+ textBox?: Record<string, unknown> | null;
1647
+ credit?: {
1648
+ text?: string;
1649
+ url?: string;
1650
+ [key: string]: unknown;
1651
+ };
1652
+ license?: string | null;
606
1653
  [key: string]: unknown;
607
1654
  }>;
1655
+ hasMore?: boolean;
1656
+ credit?: {
1657
+ text?: string;
1658
+ url?: string;
1659
+ [key: string]: unknown;
1660
+ };
608
1661
  [key: string]: unknown;
609
1662
  }>;
610
1663
  }
611
1664
 
612
1665
  declare namespace slatebox.slates {
613
- /** Edit a slate. mode "preview" shows the result without saving. Every edit names the revision it was made on: a canvas plan (notes and connections) sends expectedRevision, the revision slates.get returned; a workshop or map plan holds one operation with its own expectedRevision (workshop.revision), and saving it requires an Idempotency-Key. Without it the edit is refused with 400 invalid_request naming expectedRevision. On a workshop, workshop_edits makes 1 to 50 edits (add, move, rename, remove cards and lanes) by the rules people meet; a refusal answers 409 edit_refused with the sentence a person sees, and a move the rules refuse answers 409 move_refused. A saved workshop edit answers with a receiptId that undo_workshop_edit takes. A slate holds up to 8 boards: a workshop operation names its board (boardId, from slates.get boards[]); on a slate of several boards one that names none is refused with 400 board_required listing them. add_component adds a library component (components.list) beside the slate's notes and boards and answers with its boardId; it carries its own expectedRevision (the slate revision). @scope slates:write @modes save|preview @destructive */
1666
+ /** Add video. Add a video note to a slate from a YouTube, Vimeo or Loom address: the poster (stored in this app), a play button, and the title and host. It plays where it sits when someone presses play, never on its own, and plays inline in presentations. x and y place its top-left corner (320 by 180); without them it goes beside the slate's notes. One save, like slates.applyOperations; mode "preview" stores nothing. Added by an agent, the note is a live suggestion (202, outcome "suggested") for people on the slate to keep or discard, unless a person lets that agent edit directly. @scope slates:write @modes save|preview */
1667
+ function addMedia(input: {
1668
+ /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
1669
+ shareId: string;
1670
+ /** The video's address: a YouTube, Vimeo or Loom link. (1–2000 characters) */
1671
+ url: string;
1672
+ /** The note's left edge, in canvas units. Send with y. (-1000000 to 1000000) */
1673
+ x?: number;
1674
+ /** The note's top edge, in canvas units. Send with x. (-1000000 to 1000000) */
1675
+ y?: number;
1676
+ /** preview returns what would change and saves nothing. (default "save") */
1677
+ mode?: "save" | "preview";
1678
+ }): Promise<({
1679
+ ok: boolean;
1680
+ mode?: string;
1681
+ shareId: string;
1682
+ revision?: number;
1683
+ message: string;
1684
+ /** The video note's id. */
1685
+ nodeId?: string;
1686
+ /** suggested: added by an agent, the note is shown live on the slate for a person to keep or discard; nothing is saved yet. */
1687
+ outcome?: "saved" | "suggested";
1688
+ /** outcome suggested: the suggestion (actionId, items) as list_suggestions gives it. */
1689
+ suggestion?: Record<string, unknown>;
1690
+ /** A video a media note plays: the address, the host, and the title and poster when the host shared them. */
1691
+ media: {
1692
+ provider: "youtube" | "vimeo" | "loom";
1693
+ id: string;
1694
+ /** The canonical watch address. */
1695
+ url: string;
1696
+ hash?: string;
1697
+ /** Where it starts, in seconds. */
1698
+ start?: number;
1699
+ title?: string;
1700
+ author?: string;
1701
+ /** The poster picture, in this app's image store. */
1702
+ poster?: string;
1703
+ posterWidth?: number;
1704
+ posterHeight?: number;
1705
+ [key: string]: unknown;
1706
+ };
1707
+ notice?: string;
1708
+ report?: Record<string, unknown>;
1709
+ [key: string]: unknown;
1710
+ }) & { mode: "save" | "preview" }>;
1711
+ }
1712
+
1713
+ declare namespace slatebox.slates {
1714
+ /** Edit a slate. mode "preview" shows the result without saving. Every edit names the revision it was made on: a canvas plan (notes and connections) sends expectedRevision, the revision slates.get returned; a workshop or map plan holds one operation with its own expectedRevision (workshop.revision), and saving it requires an Idempotency-Key. Without it the edit is refused with 400 invalid_request naming expectedRevision. On a workshop, workshop_edits makes 1 to 50 edits (add, move, rename, remove cards and lanes) by the rules people meet; a refusal answers 409 edit_refused with the sentence a person sees, and a move the rules refuse answers 409 move_refused. A saved workshop edit answers with a receiptId that undo_workshop_edit takes. A slate holds up to 8 boards: a workshop operation names its board (boardId, from slates.get boards[]); on a slate of several boards one that names none is refused with 400 board_required listing them. add_component adds a library component (components.list) beside the slate's notes and boards and answers with its boardId; it carries its own expectedRevision (the slate revision). A canvas plan saved by an agent is shown live on the slate as suggestions (outcome "suggested", 202) for people there to keep or discard, unless a person lets that agent edit directly; its new notes' ids work in the next edit. @scope slates:write @modes save|preview @destructive */
614
1715
  function applyOperations(input: {
615
1716
  /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
616
1717
  shareId: string;
@@ -651,13 +1752,17 @@ declare namespace slatebox.slates {
651
1752
  };
652
1753
  /** A saved workshop edit: pass it to undo_workshop_edit. */
653
1754
  receiptId?: string;
1755
+ /** suggested: an agent's canvas edit is shown live on the slate as suggestions for people there to keep or discard; nothing was saved yet (revision is unchanged). Its new notes' ids work in your next edit. saved: the edit is saved. */
1756
+ outcome?: "saved" | "suggested";
1757
+ /** outcome suggested: the suggestion (actionId, items) as list_suggestions gives it. */
1758
+ suggestion?: Record<string, unknown>;
654
1759
  workshop?: Workshop;
655
1760
  [key: string]: unknown;
656
1761
  }) & { mode: "save" | "preview" }>;
657
1762
  }
658
1763
 
659
1764
  declare namespace slatebox.slates {
660
- /** Check move. Whether a card may move to a lane on one of the slate's boards (boardId; required on a slate of several boards, 400 board_required lists them), without moving it: the same verdict a drag gets. On a nested board (piles, a tree) the move names the card it goes under instead (under), or the area it goes to (lane). Answers {ok: true, warnings} or {refused: {sentence, ruleId, nearest, set}}: the one rule that refuses it (ruleId null for the board's own kind rule), who set it, and the nearest lane (or card) it may go to. rev is the rulebook's revision. Cards and lanes are named by id or by name. @scope slates:read */
1765
+ /** Check move. Whether a card may move to a lane on one of the slate's boards (boardId; required on a slate of several boards, 400 board_required lists them), without moving it: the same verdict a drag gets. On a nested board (piles, a tree) the move names the card it goes under instead (under), or the area it goes to (lane). Answers {ok: true, warnings} or {refused: {sentence, ruleId, nearest, set, overridable}}: the one rule that refuses it (ruleId null for the board's own kind rule), who set it, the nearest lane (or card) it may go to, and whether the person may agree to move it anyway (overridable: move_workshop_card with override true, held for them to confirm; false only for a hard limit). rev is the rulebook's revision. Cards and lanes are named by id or by name. @scope slates:read */
661
1766
  function checkMove(input: {
662
1767
  /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
663
1768
  shareId: string;
@@ -680,18 +1785,12 @@ declare namespace slatebox.slates {
680
1785
  }
681
1786
 
682
1787
  declare namespace slatebox.slates {
683
- /** Copy slate. Make a private copy of a slate you may edit, a public slate or template, or a slate whose presentation is published publicly. Someone who may only view a private slate cannot copy it. A template becomes an ordinary slate based on it unless keepTemplate is set. A published presentation of the slate is copied with it as a private presentation of the copy. @scope slates:write */
1788
+ /** Copy slate. Make a private copy of a slate you may edit, a public slate, or a slate whose presentation is published publicly. Someone who may only view a private slate cannot copy it. The copy is an ordinary private slate. A published presentation of the slate is copied with it as a private presentation of the copy. To use something from the library, fork it (library.fork). @scope slates:write */
684
1789
  function copy(input: {
685
1790
  /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
686
1791
  shareId: string;
687
1792
  /** (1–200 characters) */
688
1793
  name?: string;
689
- /** (1–200 characters) */
690
- projectName?: string;
691
- /** (default false) */
692
- keepTemplate?: boolean;
693
- /** (default false) */
694
- fromTemplate?: boolean;
695
1794
  }): Promise<({
696
1795
  shareId: string;
697
1796
  /** (at least 1) */
@@ -725,7 +1824,7 @@ declare namespace slatebox.slates {
725
1824
  }
726
1825
 
727
1826
  declare namespace slatebox.slates {
728
- /** Delete slate. Delete one of your own slates, with its sharing, comments and messages. Only the slate's owner can, and a theme other slates are built on cannot be deleted. This cannot be undone. @scope slates:delete @destructive */
1827
+ /** Delete slate. Delete one of your own slates, with its sharing, comments and messages. Only the slate's owner can. This cannot be undone. @scope slates:delete @destructive */
729
1828
  function delete(input: {
730
1829
  /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
731
1830
  shareId: string;
@@ -769,11 +1868,11 @@ declare namespace slatebox.slates {
769
1868
  }
770
1869
 
771
1870
  declare namespace slatebox.slates {
772
- /** Read a slate. Read a slate you can open: every note with every key a write sets, its connectors, what you may do here (access), its address, comments, conversation starters and, on a workshop or map, the workshop with its own revision (the one workshop and map edits use) and what it takes in plain words (workshop.can). revision is the slate's save count: send it as expectedRevision with an edit, and the edit is refused only if a note it changes was changed since. Select notes with ids, within, groupId or q (the notes a write naming that text would change) and keys with fields; page with cursor. include=full adds the slate as the engine loads it. A public slate reads without a token. @scope slates:read */
1871
+ /** Read a slate. Read a slate you can open: every note with every key a write sets, its connectors, what you may do here (access), its address, comments, conversation starters and, on a workshop or map, the workshop with its own revision (the one workshop and map edits use) and what it takes in plain words (workshop.can). revision is the slate's save count: send it as expectedRevision with an edit, and the edit is refused only if a note it changes was changed since. Select notes with ids, within, groupId or q (the notes a write naming that text would change) and keys with fields; page with cursor. include=full adds the slate as the engine loads it; include=suggestions adds what agents suggested here (waiting for people to keep or discard, with their ids) and what became of each agent's recent edits. A public slate reads without a token. @scope slates:read */
773
1872
  function get(input: {
774
1873
  /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
775
1874
  shareId: string;
776
- include?: "full";
1875
+ include?: "full" | "suggestions";
777
1876
  /** Comma-separated note keys to return (id always comes): any key a write sets, and image and comments. */
778
1877
  fields?: string;
779
1878
  /** Comma-separated note IDs: only these notes. */
@@ -856,6 +1955,35 @@ declare namespace slatebox.slates {
856
1955
  }>;
857
1956
  }
858
1957
 
1958
+ declare namespace slatebox.slates {
1959
+ /** Redo. Makes again the edit this caller last took back with slates.undo, if the caller has saved no edit on this slate since (a new edit clears what can be redone). Each part goes back to how the edit left it, unless someone else changed it since: that part stays as they left it and is listed in left[]. Saved as an edit, and refused for an agent, as slates.undo is. 409 nothing_to_redo when there is nothing of the caller's to redo. @scope slates:write @destructive */
1960
+ function redo(input: {
1961
+ /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
1962
+ shareId: string;
1963
+ }): Promise<({
1964
+ ok: boolean;
1965
+ shareId: string;
1966
+ /** The slate revision after this save. (at least 0) */
1967
+ revision?: number;
1968
+ message?: string;
1969
+ /** slates.undo: the edit it took back (its run id). */
1970
+ undone?: string;
1971
+ /** slates.redo: the edit it made again (its run id). */
1972
+ redone?: string;
1973
+ /** The canvas plan that was saved to do it. */
1974
+ operations: Array<Record<string, unknown>>;
1975
+ /** Each note, connection or setting someone else changed since, left as they left it. */
1976
+ left: Array<{
1977
+ kind?: string;
1978
+ id?: string;
1979
+ key?: string;
1980
+ reason?: string;
1981
+ [key: string]: unknown;
1982
+ }>;
1983
+ [key: string]: unknown;
1984
+ }) & { mode: "save" }>;
1985
+ }
1986
+
859
1987
  declare namespace slatebox.slates {
860
1988
  /** Unshare. Withdraws exactly this invitation. Named team grants stay. Repeating the request confirms the same withdrawal; a newer invitation is never withdrawn by an old command. @scope slates:share @destructive @idempotent */
861
1989
  function revokeInvite(input: {
@@ -871,6 +1999,60 @@ declare namespace slatebox.slates {
871
1999
  }) & { mode: "save" }>;
872
2000
  }
873
2001
 
2002
+ declare namespace slatebox.slates {
2003
+ /** Undo. Takes back the newest canvas edit this caller saved on the slate with slates.applyOperations (notes, connections, slate settings) that is not undone yet: the same account and the same token, so it never takes back a person's or another agent's edit. Each note, connection and setting the edit changed goes back to how it was, unless someone else changed it since: that part stays as they left it and is listed in left[]. The undo is saved as an edit (the revision goes up, every open canvas shows it) and answers the run it undid (undone). Workshop and map edits are undone with undo_workshop_edit. An agent undoes by the rules its edits meet: 423 agents_paused while people paused agents, 409 needs_direct_edit unless a person lets it edit directly. 409 nothing_to_undo when no edit of the caller is left to undo; 409 slate_changed when the slate changed while it was being saved (call again). @scope slates:write @destructive */
2004
+ function undo(input: {
2005
+ /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
2006
+ shareId: string;
2007
+ }): Promise<({
2008
+ ok: boolean;
2009
+ shareId: string;
2010
+ /** The slate revision after this save. (at least 0) */
2011
+ revision?: number;
2012
+ message?: string;
2013
+ /** slates.undo: the edit it took back (its run id). */
2014
+ undone?: string;
2015
+ /** slates.redo: the edit it made again (its run id). */
2016
+ redone?: string;
2017
+ /** The canvas plan that was saved to do it. */
2018
+ operations: Array<Record<string, unknown>>;
2019
+ /** Each note, connection or setting someone else changed since, left as they left it. */
2020
+ left: Array<{
2021
+ kind?: string;
2022
+ id?: string;
2023
+ key?: string;
2024
+ reason?: string;
2025
+ [key: string]: unknown;
2026
+ }>;
2027
+ [key: string]: unknown;
2028
+ }) & { mode: "save" }>;
2029
+ }
2030
+
2031
+ declare namespace slatebox.suggestions {
2032
+ /** Keep/discard/undo. Decide what an agent's work on a slate becomes, as the canvas does. keep or discard: what it suggested, as Keep and Discard on each ghost: name the action (actionId, from your edit or slates.get include=suggestions), optionally some of its items (itemIds); Keep all on an agent's chip decides each of its actions. Keeping saves them as one change (a line brings the new notes at its ends); an item whose note is gone is refused and says why. Discarding saves nothing. undo: one action (actionId) that was kept or saved directly, as Undo in the agent's activity list: only that action, and only what nobody changed since (left[] says what stayed and why), so it never undoes another agent's work or a person's. Needs the edit right on the slate. Only people keep: an agent never keeps suggestions, and undoes only its own work. @scope slates:write @destructive */
2033
+ function decide(input: {
2034
+ /** The slate ID from its address: /canvas/<shareId>. (1–80 characters) */
2035
+ shareId: string;
2036
+ decision: "keep" | "discard" | "undo";
2037
+ /** The action, as list_suggestions gives it (actions[].actionId). (1–64 characters) */
2038
+ actionId: string;
2039
+ /** Only these items of the action. (1–200 items) */
2040
+ itemIds?: string[];
2041
+ }): Promise<({
2042
+ ok: boolean;
2043
+ shareId: string;
2044
+ revision?: number;
2045
+ kept?: Array<Record<string, unknown>>;
2046
+ discarded?: Array<Record<string, unknown>>;
2047
+ refused?: Array<Record<string, unknown>>;
2048
+ /** undo: the items undone. */
2049
+ undone?: string[];
2050
+ /** undo: the items left as they are, each with its reason. */
2051
+ left?: Array<Record<string, unknown>>;
2052
+ [key: string]: unknown;
2053
+ }) & { mode: "save" }>;
2054
+ }
2055
+
874
2056
  declare namespace slatebox.team {
875
2057
  /** Export team. For a team admin: a one-time address (15 minutes) to download everything the team owns as one archive, in the open team export format: slates with their boards and smart components, recent versions and events, comments, presentations, files, people and roles, published-link settings, AI connections (never keys) and the names and scopes of API tokens (never secrets). A POST to downloadUrl downloads it; a passphrase (form or JSON field "passphrase", the Slatebox-Export-Passphrase-Base64 header as base64url of its UTF-8 bytes, or the Slatebox-Export-Passphrase header when it is plain ASCII; at least 12 characters, not starting or ending with a space) encrypts the archive. The archive is signed and checked; teamImports.start imports it on any Slatebox server. @scope team:export @confirm */
876
2058
  function export(input: Record<string, unknown>): Promise<({
@@ -1038,8 +2220,15 @@ interface AddComponentPlan {
1038
2220
  /** (1–1 items) */
1039
2221
  operations: Array<{
1040
2222
  kind: "add_component";
1041
- /** The library entry to add (components.list ids). */
1042
- component: "now-next-later" | "pros-cons" | "must-should-could" | "decision-path" | "retro" | "triage" | "team-board" | "launch-plan" | "customer-go-live" | "hiring-plan" | "sort-evidence" | "discovery-tree" | "break-down-problem" | "incident-review" | "impact-effort" | "reorg-sandbox" | "goals-owners" | "sales-pipeline" | "budget";
2223
+ /** The library entry to add (components.list ids). Or name a shared library item with library instead. */
2224
+ component?: "now-next-later" | "pros-cons" | "must-should-could" | "decision-path" | "retro" | "triage" | "team-board" | "launch-plan" | "customer-go-live" | "hiring-plan" | "sort-evidence" | "discovery-tree" | "break-down-problem" | "incident-review" | "impact-effort" | "reorg-sandbox" | "goals-owners" | "sales-pipeline" | "budget";
2225
+ /** A smart component from the shared library (in place of component). */
2226
+ library?: {
2227
+ /** A smart component from library.list (kind component), or one of your own. (1–120 characters) */
2228
+ itemId: string;
2229
+ /** (at least 1) */
2230
+ version?: number;
2231
+ };
1043
2232
  /** What it is about: names the board ("Retro: Q3 launch"). (1–100 characters) */
1044
2233
  topic?: string;
1045
2234
  /** The slate revision you read (slates.get). (at least 0) */
@@ -1101,6 +2290,23 @@ interface CanvasPlan {
1101
2290
  gap?: number;
1102
2291
  connect?: boolean;
1103
2292
  };
2293
+ /** add_nodes, count 1, no shape, preset or text: a media note, a video from YouTube, Vimeo or Loom drawn as its poster with a play button; it plays where it sits when someone presses play, never on its own. Hosts add videos through their own add-media action, which fetches the title and stores the poster. */
2294
+ media?: {
2295
+ /** The video's address. (at most 2000 characters) */
2296
+ url: string;
2297
+ /** (at most 300 characters) */
2298
+ title?: string;
2299
+ /** (at most 120 characters) */
2300
+ author?: string;
2301
+ /** Where to start, in seconds. (1 to 86400) */
2302
+ start?: number;
2303
+ /** The poster picture: an https address, or a path on this app (/...). (at most 2000 characters) */
2304
+ poster?: string;
2305
+ /** (1 to 10000) */
2306
+ posterWidth?: number;
2307
+ /** (1 to 10000) */
2308
+ posterHeight?: number;
2309
+ };
1104
2310
  /** add_nodes: note keys for the new notes. connect_nodes: connector keys for the new connectors. */
1105
2311
  style?: {
1106
2312
  /** (-360 to 360) */
@@ -1425,6 +2631,12 @@ interface SlateRead {
1425
2631
  } | null;
1426
2632
  /** Notes the selection matches, on every page. (at least 0) */
1427
2633
  nodeCount: number;
2634
+ /** include=suggestions: what agents suggested here (each waiting item is a ghost people keep or discard; your own canvas saves land here too) and each agent's recent actions, with the ids decide_suggestions takes. */
2635
+ suggestions?: {
2636
+ paused?: boolean;
2637
+ actions?: Array<Record<string, unknown>>;
2638
+ [key: string]: unknown;
2639
+ };
1428
2640
  nodes: Array<{
1429
2641
  id: string;
1430
2642
  /** The note's text. */
@@ -1847,6 +3059,8 @@ interface WorkshopEditsPlan {
1847
3059
  /** (1–64 characters) */
1848
3060
  id: string;
1849
3061
  };
3062
+ /** True to move it anyway when a rule refuses it, once the person agreed to break that rule (every board but release plans and startup experiences). The card shows who moved it anyway and when. */
3063
+ override?: boolean;
1850
3064
  } | {
1851
3065
  kind: "advance_card";
1852
3066
  /** The token. */
@@ -2103,8 +3317,10 @@ interface WorkshopEditsPlan {
2103
3317
  };
2104
3318
  /** Its days, 1 to 60. (1 to 60) */
2105
3319
  duration?: number;
2106
- /** Days it waits, 0 or more. (0 to 120) */
3320
+ /** Days it waits after what it waits on ends, 0 or more (below 0, with override: it starts before what it waits on ends). (-120 to 120) */
2107
3321
  lag?: number;
3322
+ /** True to set it anyway when a rule refuses it (a lock, a freeze, an overlap, the line, what it waits on), once the person agreed to break that rule. The task shows who moved it anyway and when. */
3323
+ override?: boolean;
2108
3324
  } | {
2109
3325
  kind: "link_tasks";
2110
3326
  /** The task that waits. */
@@ -2264,6 +3480,29 @@ interface WorkshopEditsPlan {
2264
3480
  kind: "remove_rule";
2265
3481
  /** The rule id. (1–64 characters) */
2266
3482
  rule: string;
3483
+ } | {
3484
+ kind: "set_appearance";
3485
+ /** Borders, headers and fills together. */
3486
+ emphasis?: "subtle" | "normal" | "strong";
3487
+ /** The columns’ outlines. */
3488
+ borders?: "subtle" | "normal" | "strong";
3489
+ /** Column headers: strong is bold with a deeper fill. */
3490
+ headers?: "subtle" | "normal" | "strong";
3491
+ /** Header text size. */
3492
+ headerSize?: "normal" | "large";
3493
+ /** The columns’ fills: soft is a softer background. */
3494
+ fill?: "soft" | "normal" | "strong";
3495
+ /** Grid lines between the columns (a 2 by 2’s quadrant lines). */
3496
+ lines?: boolean;
3497
+ /** Card size. */
3498
+ density?: "normal" | "compact";
3499
+ /** With color: the lane (on a 2 by 2, also a quadrant by name). */
3500
+ lane?: string | {
3501
+ /** (1–64 characters) */
3502
+ id: string;
3503
+ };
3504
+ /** With lane: its color, or none for its own. */
3505
+ color?: "red" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "teal" | "brown" | "gray" | "none";
2267
3506
  } | {
2268
3507
  kind: "set_plan_start";
2269
3508
  /** The new first day, as 2026-11-30. (10–10 characters) */
@@ -2304,6 +3543,8 @@ interface WorkshopEditsPlan {
2304
3543
  /** (1–64 characters) */
2305
3544
  id: string;
2306
3545
  };
3546
+ /** True to nest it anyway when a rule refuses it (a role, a depth, a parent’s limit), once the person agreed to break that rule. The card shows who moved it anyway and when. */
3547
+ override?: boolean;
2307
3548
  } | {
2308
3549
  kind: "start_pile";
2309
3550
  /** The card. */
@@ -2437,6 +3678,8 @@ interface WorkshopMovePlan {
2437
3678
  laneId: string;
2438
3679
  /** (at least 0) */
2439
3680
  expectedRevision: number;
3681
+ /** True to move it anyway when the board's rules refuse it (a 409 move_refused with overridable true), once the person agreed to break that rule. Held for the person to confirm (confirmation_required, rule breaks_board_rule); the card shows who moved it anyway and when. */
3682
+ override?: boolean;
2440
3683
  /** The board (slates.get boards[].id; main is the first). Required when the slate holds several boards. */
2441
3684
  boardId?: string;
2442
3685
  }>;