@stablebaseline/sdk 0.4.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/openapi.json CHANGED
@@ -606,7 +606,7 @@
606
606
  "description": "Semantic search over the 276 AntV Infographic templates — call this FIRST when building an `infographic` diagram so you pick the right structure for the content. Describe the intent (e.g. 'compare two options', 'show a process timeline', 'pyramid of priorities', 'org hierarchy', 'flow between systems', 'parts of a whole'); results are vector-ranked. Each result has `key` (use as line 1 `infographic <key>`), `name`, `family` (list|sequence|compare|relation|chart|hierarchy|quadrant), and `description`. The result's `usage` explains the family→data-field mapping for writing the DSL.",
607
607
  "operationId": "searchInfographicTemplates",
608
608
  "tags": [
609
- "uncategorized"
609
+ "diagrams"
610
610
  ],
611
611
  "requestBody": {
612
612
  "required": false,
@@ -3876,11 +3876,11 @@
3876
3876
  }
3877
3877
  }
3878
3878
  },
3879
- "/tools/designWhiteboard": {
3879
+ "/tools/autoDesignWhiteboard": {
3880
3880
  "post": {
3881
- "summary": "designWhiteboard",
3882
- "description": "Design a complete, visually polished whiteboard from a natural-language goal using the PREMIUM multi-agent pipeline (the same one the in-app assistant uses): it browses the stencil/icon library, composes the board, renders it, critiques the rendered image, and refines — far better than hand-placing shapes. COST + APPROVAL: this costs 50 credits per board and requires the user's explicit approval. Call it FIRST without `confirm` to get the exact cost + the workspace credit balance; show that to the user and only call again with `confirm: true` once they agree. If they decline (or lack credits), build the board directly with the standard whiteboard tools (addWhiteboardElements / insertWhiteboardDiagram / listWhiteboardStencils) at no extra charge. It runs in the BACKGROUND and returns immediately with a sessionId; the board fills in over 1-3 minutes. The 50 credits are refunded automatically if the design fails on our side. Optional `designProfile: 'branded-executive'` instead builds an ON-BRAND, fully-editable McKinsey-style SLIDE DECK themed by the org's brand kit (palette/fonts) — use it when the user wants polished branded business slides; it builds in-process and the board is ready on return. Optional `designProfile: 'illustrated'` instead builds an editable-illustration board: pick it for illustrated, image-based, picture-style, richly-drawn or educational explainer boards (e.g. illustrate photosynthesis, an illustrated diagram of the water cycle, a textbook-style visual). It generates a rich text-free vector illustration and overlays real, editable text labels with leader lines on top. It is gated per organisation; if it is not enabled the call returns a clear message, so fall back to the standard design. Optional `designProfile: 'image'` instead builds a single, polished, on-brand IMAGE board with all the text baked into the picture (no editable shapes): pick 'image' when the user wants a single finished image, poster or infographic they will refine by AI mask edits rather than by moving editable shapes. It is also gated per organisation; if it is not enabled the call returns a clear message.",
3883
- "operationId": "designWhiteboard",
3881
+ "summary": "autoDesignWhiteboard",
3882
+ "description": "Auto-design a complete, visually polished whiteboard from a natural-language goal using the PREMIUM multi-agent pipeline (the same one the in-app assistant uses): it browses the stencil/icon library, composes the WHOLE board, renders it, critiques the rendered image, and refines — far better than hand-placing shapes. This is the one-shot whole-board designer; it is NOT a conversation (for a deck you can chat with and refine turn by turn use designDeckInWhiteboard, and for a refinable illustration use designIllustrationInWhiteboard). COST + APPROVAL: this costs 50 credits per board and requires the user's explicit approval. Call it FIRST without `confirm` to get the exact cost + the workspace credit balance; show that to the user and only call again with `confirm: true` once they agree. If they decline (or lack credits), build the board directly with the standard whiteboard tools (addWhiteboardElements / insertWhiteboardDiagram / listWhiteboardStencils) at no extra charge. It runs in the BACKGROUND and returns immediately with a sessionId; the board fills in over 1-3 minutes. The 50 credits are refunded automatically if the design fails on our side. Optional `designProfile: 'branded-executive'` instead builds an ON-BRAND, fully-editable McKinsey-style SLIDE DECK themed by the org's brand kit (palette/fonts) — use it when the user wants polished branded business slides; it builds in-process and the board is ready on return. Optional `designProfile: 'illustrated'` instead builds an editable-illustration board: pick it for illustrated, image-based, picture-style, richly-drawn or educational explainer boards (e.g. illustrate photosynthesis, an illustrated diagram of the water cycle, a textbook-style visual). It generates a rich text-free vector illustration and overlays real, editable text labels with leader lines on top. It is available to every organisation and costs the same flat 50 credits (credits are the only gate). Optional `designProfile: 'image'` instead builds a single, polished, on-brand IMAGE board with all the text baked into the picture (no editable shapes): pick 'image' when the user wants a single finished image, poster or infographic they will refine by AI mask edits rather than by moving editable shapes. It is also available to every organisation at the same flat 50 credits.",
3883
+ "operationId": "autoDesignWhiteboard",
3884
3884
  "tags": [
3885
3885
  "whiteboards"
3886
3886
  ],
@@ -3921,7 +3921,7 @@
3921
3921
  "agentic",
3922
3922
  "agentic-deck"
3923
3923
  ],
3924
- "description": "Optional. 'standard' (default) = the general multi-agent design. 'agentic' = an AI-chat-style agentic slide composer that drives the whiteboard tools and self-corrects from renders, composing ONE polished slide. 'agentic-deck' = the same agentic composer run over a planned storyline, building a multi-slide deck (each slide on its own frame, tiled left to right). 'branded-executive' = an on-brand, McKinsey-style editable SLIDE DECK themed by the org's brand kit (pair with brandKitId, or omit for the org default). 'illustrated' = an editable-illustration board: a rich text-free vector illustration with real editable text labels and leader lines placed on top. 'image' = a single polished, on-brand IMAGE board with all the text baked into the picture (no editable shapes), which the user then refines with AI mask edits. 'illustrated' and 'image' are each gated per organisation; if not enabled the call returns a clear message."
3924
+ "description": "Optional. 'standard' (default) = the general multi-agent design. 'agentic' = an AI-chat-style agentic slide composer that drives the whiteboard tools and self-corrects from renders, composing ONE polished slide. 'agentic-deck' = the same agentic composer run over a planned storyline, building a multi-slide deck (each slide on its own frame, tiled left to right). 'branded-executive' = an on-brand, McKinsey-style editable SLIDE DECK themed by the org's brand kit (pair with brandKitId, or omit for the org default). 'illustrated' = an editable-illustration board: a rich text-free vector illustration with real editable text labels and leader lines placed on top. 'image' = a single polished, on-brand IMAGE board with all the text baked into the picture (no editable shapes), which the user then refines with AI mask edits. Every profile is available to every organisation; the flat credit fee is the only gate."
3925
3925
  },
3926
3926
  "brandKitId": {
3927
3927
  "type": "string",
@@ -4013,10 +4013,10 @@
4013
4013
  "/tools/designComponent": {
4014
4014
  "post": {
4015
4015
  "summary": "designComponent",
4016
- "description": "Design ONE reusable, on-brand SLIDE COMPONENT and add it to the org's component library so every future branded deck (designWhiteboard designProfile:'branded-executive') can use it. This is the self-improving design loop: an agent AUTHORS the component as a declarative template (a gradient/shadow/curve SVG skin + a native editable PPTX shape + reflowing bound-text slots), RENDERS it, a vision critic COMPARES the render to your brief and lists gaps, and it FIXES + re-renders until polished — then validates and stores it. Use it to grow the deck component catalogue beyond the built-ins (e.g. a 'kpi.delta' stat with an up/down arrow, a 'quote.card', a 'logo.strip'). Browse-first: if a component with this `key` already exists it is reused (pass force:true to redesign). Provide example `sampleSlots` so it can lay out real content, and a `projectId` for the small preview board it builds. Returns the stored component, the per-round critique trail, and the preview board id. It uses a few AI calls + renders (no flat credit charge); the new component is then free to reuse forever.",
4016
+ "description": "Design ONE reusable, on-brand SLIDE COMPONENT and add it to the org's component library so every future branded deck (autoDesignWhiteboard designProfile:'branded-executive') can use it. This is the self-improving design loop: an agent AUTHORS the component as a declarative template (a gradient/shadow/curve SVG skin + a native editable PPTX shape + reflowing bound-text slots), RENDERS it, a vision critic COMPARES the render to your brief and lists gaps, and it FIXES + re-renders until polished — then validates and stores it. Use it to grow the deck component catalogue beyond the built-ins (e.g. a 'kpi.delta' stat with an up/down arrow, a 'quote.card', a 'logo.strip'). Browse-first: if a component with this `key` already exists it is reused (pass force:true to redesign). Provide example `sampleSlots` so it can lay out real content, and a `projectId` for the small preview board it builds. Returns the stored component, the per-round critique trail, and the preview board id. It uses a few AI calls + renders (no flat credit charge); the new component is then free to reuse forever.",
4017
4017
  "operationId": "designComponent",
4018
4018
  "tags": [
4019
- "uncategorized"
4019
+ "whiteboards"
4020
4020
  ],
4021
4021
  "requestBody": {
4022
4022
  "required": false,
@@ -4163,7 +4163,7 @@
4163
4163
  "/tools/editWhiteboardImageRegion": {
4164
4164
  "post": {
4165
4165
  "summary": "editWhiteboardImageRegion",
4166
- "description": "Mask-edit (inpaint) one region of an image element on a whiteboard. Given the target image element id and a paint MASK (a PNG where WHITE marks the area to regenerate and BLACK is kept), it regenerates only the masked region using the prompt and replaces the image IN PLACE (same position + size). This is mainly used by the in-app image-board mask editor for boards designed with designProfile:'image'. It costs a small flat credit charge (refunded automatically if the edit fails on our side). It is gated per organisation behind the same 'whiteboard_design_image' feature as the image design profile; if that is not enabled the call returns a clear message.",
4166
+ "description": "Mask-edit (inpaint) one region of an image element on a whiteboard. Given the target image element id and a paint MASK (a PNG where WHITE marks the area to regenerate and BLACK is kept), it regenerates only the masked region using the prompt and replaces the image IN PLACE (same position + size). This is mainly used by the in-app image-board mask editor for boards designed with designProfile:'image'. It is available to every organisation; the small flat credit charge is the only gate (refunded automatically if the edit fails on our side).",
4167
4167
  "operationId": "editWhiteboardImageRegion",
4168
4168
  "tags": [
4169
4169
  "whiteboards"
@@ -4281,13 +4281,13 @@
4281
4281
  }
4282
4282
  }
4283
4283
  },
4284
- "/tools/exportDeck": {
4284
+ "/tools/designDeckInWhiteboard": {
4285
4285
  "post": {
4286
- "summary": "exportDeck",
4287
- "description": "Export an already-generated slide DECK (from the branded HTML-deck pipeline) to an editable PowerPoint (PPTX), PDF, PNG images, or raw HTML. Give it the deckId of a deck whose status is 'ready'; it downloads the deck's stored HTML and renders it in a headless browser via the export worker. 'pptx' = native, fully-editable PowerPoint (real shapes and text, not screenshots); 'pdf' = vector, one page per slide; 'png' = one image per slide (returned as a base64 array); 'html' = the self-contained deck HTML. Returns the file as base64 in `data` (pptx/pdf/html) or per-slide base64 in `slides` (png). The deck must be finished; a deck that is still generating, failed, or archived returns a clear message.",
4288
- "operationId": "exportDeck",
4286
+ "summary": "designDeckInWhiteboard",
4287
+ "description": "Create or refine a slide deck INSIDE an existing whiteboard by conversing with the AI design agent. Send a brief for a NEW deck, a change to an EXISTING one, or an answer to the agent's question. The agent builds a polished, on-brand deck and places it on the board; if the brief is ambiguous it asks ONE clarifying question (answer with the same sessionId). Returns immediately; poll getDeckReplyInWhiteboard for the result. Use for building or editing slide decks / presentations. WHITEBOARD IS REQUIRED: a deck always lives inside a whiteboard, so documentId (the whiteboard's id) is required. If you do NOT already have a whiteboard id, ASK THE USER which whiteboard they want the deck designed in — do NOT create a whiteboard automatically. Only call createWhiteboard first if the user explicitly asks for a brand-new board; otherwise use the id of the whiteboard they name. FIRST vs FOLLOW-UP: the first call (from nothing) builds; a follow-up call (an answer, a change, or a new instruction) passes the sessionId (or the deckId) plus the new message. kind:'deck' (default) is the premium on-brand HTML deck; kind:'express' builds the native, deterministic branded-executive deck directly on the whiteboard (faster, lower fidelity, one-shot, not conversational). COST + APPROVAL: a build costs 50 credits and an edit 10; a clarifying question is FREE. Call FIRST without confirm to get the exact cost plus the workspace balance, show it to the user, and only call again with confirm:true once they agree. The fee is auto-refunded if a turn produces no change or fails. Returns sessionId (the conversation), deckId (the deck), status, turnType, started, awaitingUser, needsConfirmation, insufficientCredits, and assistantMessage. Export the finished deck with exportFromWhiteboard.",
4288
+ "operationId": "designDeckInWhiteboard",
4289
4289
  "tags": [
4290
- "uncategorized"
4290
+ "whiteboards"
4291
4291
  ],
4292
4292
  "requestBody": {
4293
4293
  "required": false,
@@ -4296,149 +4296,78 @@
4296
4296
  "schema": {
4297
4297
  "type": "object",
4298
4298
  "properties": {
4299
- "deckId": {
4299
+ "documentId": {
4300
4300
  "type": "string",
4301
- "description": "The id of an existing, finished ('ready') deck to export."
4301
+ "description": "The whiteboard the deck lives in. REQUIRED: a deck cannot exist without a whiteboard, and this is that whiteboard's id. If you do not already have a whiteboard id, ASK THE USER which whiteboard to design the deck in — never create one automatically. Only call createWhiteboard first if the user explicitly wants a new board."
4302
4302
  },
4303
- "format": {
4303
+ "message": {
4304
4304
  "type": "string",
4305
- "enum": [
4306
- "pptx",
4307
- "pdf",
4308
- "png",
4309
- "html"
4310
- ],
4311
- "description": "Output format. 'pptx' (default) = editable PowerPoint; 'pdf' = vector PDF; 'png' = one base64 image per slide; 'html' = the deck's self-contained HTML."
4305
+ "description": "This turn's message in plain language: the design brief on the first turn, an edit instruction later, or the user's ANSWER to a clarifying question the agent asked. On a follow-up turn, pass this together with the sessionId (or deckId) from the earlier call."
4312
4306
  },
4313
- "brandKitId": {
4314
- "type": "string",
4315
- "description": "Optional brand kit id (reserved for future per-export theming; the deck is already branded, so this is usually unnecessary)."
4316
- }
4317
- },
4318
- "required": [
4319
- "deckId"
4320
- ]
4321
- }
4322
- }
4323
- }
4324
- },
4325
- "responses": {
4326
- "200": {
4327
- "description": "Tool result (shape varies per tool — refer to the tool's docs for the exact return value).",
4328
- "content": {
4329
- "application/json": {
4330
- "schema": {
4331
- "type": "object",
4332
- "additionalProperties": true
4333
- }
4334
- }
4335
- }
4336
- },
4337
- "400": {
4338
- "description": "Validation error.",
4339
- "content": {
4340
- "application/json": {
4341
- "schema": {
4342
- "$ref": "#/components/schemas/ErrorResponse"
4343
- }
4344
- }
4345
- }
4346
- },
4347
- "401": {
4348
- "description": "Missing or invalid credentials.",
4349
- "content": {
4350
- "application/json": {
4351
- "schema": {
4352
- "$ref": "#/components/schemas/ErrorResponse"
4353
- }
4354
- }
4355
- }
4356
- },
4357
- "403": {
4358
- "description": "Authenticated but lacking the required permission or feature flag.",
4359
- "content": {
4360
- "application/json": {
4361
- "schema": {
4362
- "$ref": "#/components/schemas/ErrorResponse"
4363
- }
4364
- }
4365
- }
4366
- },
4367
- "404": {
4368
- "description": "Resource not found.",
4369
- "content": {
4370
- "application/json": {
4371
- "schema": {
4372
- "$ref": "#/components/schemas/ErrorResponse"
4373
- }
4374
- }
4375
- }
4376
- },
4377
- "422": {
4378
- "description": "Body did not match the tool's input schema.",
4379
- "content": {
4380
- "application/json": {
4381
- "schema": {
4382
- "$ref": "#/components/schemas/ErrorResponse"
4383
- }
4384
- }
4385
- }
4386
- },
4387
- "500": {
4388
- "description": "Server error.",
4389
- "content": {
4390
- "application/json": {
4391
- "schema": {
4392
- "$ref": "#/components/schemas/ErrorResponse"
4393
- }
4394
- }
4395
- }
4396
- }
4397
- }
4398
- }
4399
- },
4400
- "/tools/generateIllustration": {
4401
- "post": {
4402
- "summary": "generateIllustration",
4403
- "description": "Generate a standalone, on-brand ILLUSTRATION (raw pixels) from a plain-language prompt, the one thing native shapes and diagrams cannot make. Returns a durable image URL you can insert into a whiteboard or document. Colour-conditioned to the organisation's brand (or a specific brandKitId) and rendered in a clean flat-vector editorial style with NO text, letters, or numbers baked in. Costs a small flat credit charge (refunded automatically if generation fails on our side); an identical prompt reuses a cached image at no charge.",
4404
- "operationId": "generateIllustration",
4405
- "tags": [
4406
- "uncategorized"
4407
- ],
4408
- "requestBody": {
4409
- "required": false,
4410
- "content": {
4411
- "application/json": {
4412
- "schema": {
4413
- "type": "object",
4414
- "properties": {
4415
- "prompt": {
4307
+ "sessionId": {
4416
4308
  "type": "string",
4417
- "description": "Plain-language description of the illustration to generate (e.g. 'a friendly robot assistant helping a small team')."
4309
+ "description": "The design conversation to continue, as returned by an earlier designDeckInWhiteboard call. Pass it together with message to answer a question, make an edit, or send a follow-up. Omit on the very first call to start a new conversation."
4418
4310
  },
4419
- "width": {
4420
- "type": "number",
4421
- "description": "Optional output width in px (rounded to a multiple of 64, 512 to 2048). Default 1024."
4311
+ "deckId": {
4312
+ "type": "string",
4313
+ "description": "Optional. An existing deck to continue designing (usually you pass sessionId instead; when both are given the session's deck wins)."
4422
4314
  },
4423
- "height": {
4424
- "type": "number",
4425
- "description": "Optional output height in px (rounded to a multiple of 64, 512 to 2048). Default 1024."
4315
+ "kind": {
4316
+ "type": "string",
4317
+ "enum": [
4318
+ "deck",
4319
+ "illustration",
4320
+ "design",
4321
+ "express"
4322
+ ],
4323
+ "description": "Which engine. 'deck' (default) = the premium on-brand HTML deck (conversational, build + edit); 'illustration' and 'design' are conversational variants. 'express' = the native, deterministic branded-executive deck (faster, lower fidelity, one-shot, not conversational)."
4426
4324
  },
4427
- "style": {
4325
+ "title": {
4428
4326
  "type": "string",
4429
- "description": "Optional extra style hint appended to the prompt (e.g. 'isometric', 'soft gradients, pastel')."
4327
+ "description": "Optional title. If omitted, a clear one is derived from the brief."
4430
4328
  },
4431
4329
  "brandKitId": {
4432
4330
  "type": "string",
4433
- "description": "Optional brand kit id to colour-condition the illustration. Defaults to the organisation's effective brand."
4331
+ "description": "Optional brand kit id (from listBrandKits) to theme the deck. If omitted, the organisation's effective brand is used."
4434
4332
  },
4435
- "documentId": {
4436
- "type": "string",
4437
- "description": "Optional document this illustration is for (used only for usage logging and provenance)."
4333
+ "slideCount": {
4334
+ "type": "number",
4335
+ "description": "Optional target number of slides for a build turn (the composer adjusts to fit the story). Typical 6 to 12."
4336
+ },
4337
+ "attachments": {
4338
+ "type": "array",
4339
+ "description": "Optional reference images for THIS turn (up to 8; images only). The agent lifts palette, layout, and tone from them (it does not pixel-copy). Non-image attachments are ignored.",
4340
+ "items": {
4341
+ "type": "object",
4342
+ "description": "One reference image: give a public url, OR base64 data plus its mediaType.",
4343
+ "properties": {
4344
+ "url": {
4345
+ "type": "string",
4346
+ "description": "A public https URL to the image."
4347
+ },
4348
+ "data": {
4349
+ "type": "string",
4350
+ "description": "The image as base64 (no data: prefix). Provide mediaType alongside it."
4351
+ },
4352
+ "mediaType": {
4353
+ "type": "string",
4354
+ "description": "The image MIME type, e.g. 'image/png' or 'image/jpeg'."
4355
+ },
4356
+ "name": {
4357
+ "type": "string",
4358
+ "description": "Optional human-readable name for the image."
4359
+ }
4360
+ }
4361
+ }
4362
+ },
4363
+ "confirm": {
4364
+ "type": "boolean",
4365
+ "description": "Set true ONLY after the user has approved the cost (50 for a build, 10 for an edit). Leave unset/false on the first call of a turn to receive the cost quote plus balance. A clarifying question turn is never charged."
4438
4366
  }
4439
4367
  },
4440
4368
  "required": [
4441
- "prompt"
4369
+ "documentId",
4370
+ "message"
4442
4371
  ]
4443
4372
  }
4444
4373
  }
@@ -4519,13 +4448,13 @@
4519
4448
  }
4520
4449
  }
4521
4450
  },
4522
- "/tools/designDeck": {
4451
+ "/tools/designIllustrationInWhiteboard": {
4523
4452
  "post": {
4524
- "summary": "designDeck",
4525
- "description": "Design a complete, branded HTML slide deck from a plain-language goal using the premium agentic deck builder. COST-GATED (50 credits): the first call (confirm unset) returns the cost quote plus the workspace balance so you can ask the user; only a call with confirm:true charges the flat fee and builds the deck. The deck is themed to the organisation's brand (or a brandKitId), composed slide by slide, rendered and self-corrected, then saved as a finished deck you can export with exportDeck (pptx/pdf/png/html). The fee is auto-refunded if the build fails or produces nothing. If the user would rather not spend the credits, build slides another way. Requires a projectId for a new deck, or a deckId to rebuild an existing one.",
4526
- "operationId": "designDeck",
4453
+ "summary": "designIllustrationInWhiteboard",
4454
+ "description": "Create or refine a standalone ILLUSTRATION INSIDE an existing whiteboard by conversing with the AI design agent. This is the illustration sibling of designDeckInWhiteboard: same conversation, same follow-up flow, but it makes ONE on-brand illustration placed on the board (not a slide deck). Send a brief for a NEW illustration, a change to an existing one, or an answer to the agent's question. The agent generates the illustration, places it on the board, and if the brief is ambiguous it asks ONE clarifying question (answer with the same sessionId). Returns immediately; poll getDeckReplyInWhiteboard for the result. Use it when the user wants a picture they can talk about and refine turn by turn (e.g. 'draw a friendly robot onboarding a new team', then 'make it warmer', 'add a second robot'). For a quick one-shot illustration with no follow-up, use generateIllustrationInWhiteboard instead. WHITEBOARD IS REQUIRED: an illustration always lives inside a whiteboard, so documentId (the whiteboard's id) is required. If you do NOT already have a whiteboard id, ASK THE USER which whiteboard they want the illustration designed in do NOT create a whiteboard automatically. Only call createWhiteboard first if the user explicitly asks for a brand-new board; otherwise use the id of the whiteboard they name. FIRST vs FOLLOW-UP: the first call (from nothing) builds; a follow-up call (an answer, a change, or a new instruction) passes the sessionId (or the deckId) plus the new message. COST + APPROVAL: a build costs 50 credits and an edit 10; a clarifying question is FREE. Call FIRST without confirm to get the exact cost plus the workspace balance, show it to the user, and only call again with confirm:true once they agree. The fee is auto-refunded if a turn produces no change or fails. Returns sessionId (the conversation), deckId (the illustration's id), status, turnType, started, awaitingUser, needsConfirmation, insufficientCredits, and assistantMessage.",
4455
+ "operationId": "designIllustrationInWhiteboard",
4527
4456
  "tags": [
4528
- "uncategorized"
4457
+ "whiteboards"
4529
4458
  ],
4530
4459
  "requestBody": {
4531
4460
  "required": false,
@@ -4534,38 +4463,64 @@
4534
4463
  "schema": {
4535
4464
  "type": "object",
4536
4465
  "properties": {
4537
- "goal": {
4466
+ "documentId": {
4538
4467
  "type": "string",
4539
- "description": "The deck to build, in plain language (topic, audience, and what it should cover)."
4468
+ "description": "The whiteboard the illustration lives in. REQUIRED: an illustration cannot exist without a whiteboard, and this is that whiteboard's id. If you do not already have a whiteboard id, ASK THE USER which whiteboard to design the illustration in — never create one automatically. Only call createWhiteboard first if the user explicitly wants a new board."
4540
4469
  },
4541
- "projectId": {
4470
+ "message": {
4542
4471
  "type": "string",
4543
- "description": "The project to create the deck in. Required when no deckId is given (a deck must live in a project)."
4472
+ "description": "This turn's message in plain language: the illustration brief on the first turn, a change instruction later, or the user's ANSWER to a clarifying question the agent asked. On a follow-up turn, pass this together with the sessionId (or deckId) from the earlier call."
4544
4473
  },
4545
- "title": {
4474
+ "sessionId": {
4546
4475
  "type": "string",
4547
- "description": "Optional deck title. If omitted, a clear title is derived from the goal."
4476
+ "description": "The design conversation to continue, as returned by an earlier designIllustrationInWhiteboard call. Pass it together with message to answer a question, make a change, or send a follow-up. Omit on the very first call to start a new conversation."
4548
4477
  },
4549
4478
  "deckId": {
4550
4479
  "type": "string",
4551
- "description": "Optional. An existing deck to rebuild. If omitted, a new deck is created in projectId."
4480
+ "description": "Optional. An existing illustration to continue refining (usually you pass sessionId instead; when both are given the session's illustration wins). The id is called deckId because illustrations and decks share the same conversation spine."
4481
+ },
4482
+ "title": {
4483
+ "type": "string",
4484
+ "description": "Optional title. If omitted, a clear one is derived from the brief."
4552
4485
  },
4553
4486
  "brandKitId": {
4554
4487
  "type": "string",
4555
- "description": "Optional brand kit id (from listBrandKits) to theme the deck. If omitted, the organisation's effective brand is used. Create one from a logo or a .pptx/.docx via createBrandKit."
4488
+ "description": "Optional brand kit id (from listBrandKits) to colour-condition the illustration. If omitted, the organisation's effective brand is used."
4556
4489
  },
4557
- "slideCount": {
4558
- "type": "number",
4559
- "description": "Optional target number of slides (the composer adjusts to fit the story). Typical 6 to 12."
4490
+ "attachments": {
4491
+ "type": "array",
4492
+ "description": "Optional reference images for THIS turn (up to 8; images only). The agent lifts palette, layout, and tone from them (it does not pixel-copy). Non-image attachments are ignored.",
4493
+ "items": {
4494
+ "type": "object",
4495
+ "description": "One reference image: give a public url, OR base64 data plus its mediaType.",
4496
+ "properties": {
4497
+ "url": {
4498
+ "type": "string",
4499
+ "description": "A public https URL to the image."
4500
+ },
4501
+ "data": {
4502
+ "type": "string",
4503
+ "description": "The image as base64 (no data: prefix). Provide mediaType alongside it."
4504
+ },
4505
+ "mediaType": {
4506
+ "type": "string",
4507
+ "description": "The image MIME type, e.g. 'image/png' or 'image/jpeg'."
4508
+ },
4509
+ "name": {
4510
+ "type": "string",
4511
+ "description": "Optional human-readable name for the image."
4512
+ }
4513
+ }
4514
+ }
4560
4515
  },
4561
4516
  "confirm": {
4562
4517
  "type": "boolean",
4563
- "description": "Set true ONLY after the user has approved the 50-credit cost. Leave unset/false on the first call to receive the cost quote plus balance."
4518
+ "description": "Set true ONLY after the user has approved the cost (50 for a build, 10 for an edit). Leave unset/false on the first call of a turn to receive the cost quote plus balance. A clarifying question turn is never charged."
4564
4519
  }
4565
4520
  },
4566
4521
  "required": [
4567
- "goal",
4568
- "projectId"
4522
+ "documentId",
4523
+ "message"
4569
4524
  ]
4570
4525
  }
4571
4526
  }
@@ -4646,13 +4601,13 @@
4646
4601
  }
4647
4602
  }
4648
4603
  },
4649
- "/tools/editDeck": {
4604
+ "/tools/getDeckReplyInWhiteboard": {
4650
4605
  "post": {
4651
- "summary": "editDeck",
4652
- "description": "Make a targeted change to an existing, finished deck using the agentic deck builder. COST-GATED (10 credits): the first call (confirm unset) returns the cost quote plus balance; only confirm:true charges the fee and applies the edit. Loads the deck's current HTML, makes ONLY the requested change (leaving other slides intact), renders to verify it, and re-saves. The fee is auto-refunded if the edit makes no change or fails.",
4653
- "operationId": "editDeck",
4606
+ "summary": "getDeckReplyInWhiteboard",
4607
+ "description": "Get the design agent's reply after calling designDeckInWhiteboard OR designIllustrationInWhiteboard: the status (thinking/building/ready) and EITHER the finished result (a deck's slide count + preview, or the placed illustration) OR a clarifying question to answer (call the SAME tool you started with, passing the sessionId + your answer). Poll until ready or a question appears. Give it the whiteboard documentId and the deckId (both returned by the tool you called). It returns the build status ('generating' while working, 'ready' when finished, 'failed' if it failed) plus, once ready, the slide count and a thumbnail image URL. IMPORTANT for the conversation: if the agent asked a CLARIFYING QUESTION instead of doing the work, this returns awaitingUser:true with pendingQuestion (and assistantMessage) — relay that question to the user, then call the SAME design tool again with the same sessionId and the user's answer as message to continue. It also returns the full conversation (history + status + pending question). A turn usually takes about 1 to 3 minutes, so poll every 15 to 30 seconds until it is 'ready' or awaitingUser is true. When ready, the deck or illustration has already been placed on the whiteboard; a deck can also be exported with exportFromWhiteboard. If a turn failed or produced no change, the user was not charged.",
4608
+ "operationId": "getDeckReplyInWhiteboard",
4654
4609
  "tags": [
4655
- "uncategorized"
4610
+ "whiteboards"
4656
4611
  ],
4657
4612
  "requestBody": {
4658
4613
  "required": false,
@@ -4661,26 +4616,18 @@
4661
4616
  "schema": {
4662
4617
  "type": "object",
4663
4618
  "properties": {
4664
- "deckId": {
4619
+ "documentId": {
4665
4620
  "type": "string",
4666
- "description": "The id of the finished deck to edit."
4621
+ "description": "The whiteboard that hosts the deck or illustration (it lives inside the board). REQUIRED."
4667
4622
  },
4668
- "instruction": {
4623
+ "deckId": {
4669
4624
  "type": "string",
4670
- "description": "The change to make, in plain language (e.g. 'change the title slide subhead to ...', 'make slide 3 a bar chart of these numbers ...')."
4671
- },
4672
- "slideIndex": {
4673
- "type": "number",
4674
- "description": "Optional 1-based slide number to focus the edit on. Omit to let the builder find the right slide(s) from the instruction."
4675
- },
4676
- "confirm": {
4677
- "type": "boolean",
4678
- "description": "Set true ONLY after the user has approved the 10-credit cost. Leave unset/false on the first call to receive the cost quote plus balance."
4625
+ "description": "The deck or illustration to poll, as returned by designDeckInWhiteboard or designIllustrationInWhiteboard."
4679
4626
  }
4680
4627
  },
4681
4628
  "required": [
4682
- "deckId",
4683
- "instruction"
4629
+ "documentId",
4630
+ "deckId"
4684
4631
  ]
4685
4632
  }
4686
4633
  }
@@ -4761,11 +4708,11 @@
4761
4708
  }
4762
4709
  }
4763
4710
  },
4764
- "/tools/insertDeckIntoWhiteboard": {
4711
+ "/tools/exportFromWhiteboard": {
4765
4712
  "post": {
4766
- "summary": "insertDeckIntoWhiteboard",
4767
- "description": "Render a FINISHED slide DECK's pages into framed images on a WHITEBOARD: one Excalidraw frame per slide, laid out as a horizontal row of pages so the whole deck appears on the board to pan across, annotate around, and edit beside. Give it the deckId of a deck whose status is 'ready'; it renders each slide to a PNG (via the export worker) and drops each image inside its own 1280x720 frame named 'Slide N'. Pass an existing whiteboard documentId to place the slides on it, or a projectId to create a new board (defaults to the deck's own project; the new board is named '<deck title> (deck)'). Returns the documentId, the number of slide frames placed, and the board title. The deck must be finished; a deck that is still generating, failed, or archived returns a clear message.",
4768
- "operationId": "insertDeckIntoWhiteboard",
4713
+ "summary": "exportFromWhiteboard",
4714
+ "description": "Export a design that lives in a whiteboard to an editable PowerPoint (PPTX), PDF, PNG images, or raw HTML. Give it the whiteboard documentId and the designId (the deck). kind:'deck' (default) renders the finished deck via the export worker: 'pptx' = native, fully-editable PowerPoint (real shapes and text, not screenshots); 'pdf' = vector, one page per slide; 'png' = one image per slide (returned as a base64 array); 'html' = the self-contained deck HTML. Returns the file as base64 in data (pptx/pdf/html) or per-slide base64 in slides (png). The design must be finished; one that is still generating, failed, or archived returns a clear message.",
4715
+ "operationId": "exportFromWhiteboard",
4769
4716
  "tags": [
4770
4717
  "whiteboards"
4771
4718
  ],
@@ -4776,21 +4723,39 @@
4776
4723
  "schema": {
4777
4724
  "type": "object",
4778
4725
  "properties": {
4779
- "deckId": {
4726
+ "documentId": {
4780
4727
  "type": "string",
4781
- "description": "The id of an existing, finished ('ready') deck whose slides to place on a whiteboard."
4728
+ "description": "The whiteboard that hosts the design."
4782
4729
  },
4783
- "documentId": {
4730
+ "designId": {
4784
4731
  "type": "string",
4785
- "description": "Optional existing whiteboard to place the slides on. When omitted, a new whiteboard is created in projectId."
4732
+ "description": "The design to export (the deck id), as returned by designDeckInWhiteboard."
4786
4733
  },
4787
- "projectId": {
4734
+ "kind": {
4788
4735
  "type": "string",
4789
- "description": "Optional project to create the new whiteboard in when documentId is omitted. Defaults to the deck's own project."
4736
+ "enum": [
4737
+ "deck"
4738
+ ],
4739
+ "description": "Which engine. 'deck' (default)."
4740
+ },
4741
+ "format": {
4742
+ "type": "string",
4743
+ "enum": [
4744
+ "pptx",
4745
+ "pdf",
4746
+ "png",
4747
+ "html"
4748
+ ],
4749
+ "description": "Output format. 'pptx' (default) = editable PowerPoint; 'pdf' = vector PDF; 'png' = one base64 image per slide; 'html' = the design's self-contained HTML."
4750
+ },
4751
+ "brandKitId": {
4752
+ "type": "string",
4753
+ "description": "Optional brand kit id (reserved for future per-export theming; the design is already branded, so this is usually unnecessary)."
4790
4754
  }
4791
4755
  },
4792
4756
  "required": [
4793
- "deckId"
4757
+ "documentId",
4758
+ "designId"
4794
4759
  ]
4795
4760
  }
4796
4761
  }
@@ -5546,6 +5511,11 @@
5546
5511
  ]
5547
5512
  }
5548
5513
  }
5514
+ },
5515
+ "customData": {
5516
+ "type": "object",
5517
+ "description": "Arbitrary Excalidraw customData stored on the element (e.g. a slide frame's { deckId } so a board frame resolves back to its source deck). Merged with any builder-set customData.",
5518
+ "additionalProperties": true
5549
5519
  }
5550
5520
  },
5551
5521
  "additionalProperties": true
@@ -5831,6 +5801,10 @@
5831
5801
  "fileName": {
5832
5802
  "type": "string",
5833
5803
  "description": "Optional original filename (for storage + type hinting)."
5804
+ },
5805
+ "locked": {
5806
+ "type": "boolean",
5807
+ "description": "Lock the placed image so it cannot be moved, resized, or deleted by hand (e.g. a deck-owned framed slide image that changes only via the deck conversation). Defaults to false."
5834
5808
  }
5835
5809
  },
5836
5810
  "required": [
@@ -6455,7 +6429,7 @@
6455
6429
  "/tools/getWhiteboardImage": {
6456
6430
  "post": {
6457
6431
  "summary": "getWhiteboardImage",
6458
- "description": "Render a whiteboard to an IMAGE so you can SEE it and confirm your edits look right, then iterate — like taking a screenshot. Returns the rendered board as a viewable image attached to the result. Pass elementIds to render only specific shapes (e.g. to inspect one section/slide), region:{x,y,width,height} to capture an exact scene-coordinate window (e.g. the user's viewport), theme:'light' for the fastest single-variant render, format:'svg' for vector markup, or background to set the canvas colour. Unchanged boards return instantly from a content-keyed cache. Call this after addWhiteboardElements/updateWhiteboardScene to check layout, overlaps, labels and alignment before continuing.",
6432
+ "description": "Render a whiteboard to a raster IMAGE so you can SEE it and confirm your edits look right, then iterate — like taking a screenshot. Returns the rendered board as a viewable image attached to the result (always raster: a JPEG light variant and/or a PNG dark variant; there is no vector/SVG output, so for a vector export of a single diagram use getDiagramImage). Pass elementIds to render only specific shapes (e.g. to inspect one section/slide), region:{x,y,width,height} to capture an exact scene-coordinate window (e.g. the user's viewport), theme:'light' for the fastest single-variant render, or background to set the canvas colour. Unchanged boards return instantly from a content-keyed cache. Call this after addWhiteboardElements/updateWhiteboardScene to check layout, overlaps, labels and alignment before continuing.",
6459
6433
  "operationId": "getWhiteboardImage",
6460
6434
  "tags": [
6461
6435
  "whiteboards"
@@ -6471,14 +6445,6 @@
6471
6445
  "type": "string",
6472
6446
  "description": "The whiteboard's documentId."
6473
6447
  },
6474
- "format": {
6475
- "type": "string",
6476
- "enum": [
6477
- "png",
6478
- "svg"
6479
- ],
6480
- "description": "png (default — a viewable raster) or svg (vector markup)."
6481
- },
6482
6448
  "elementIds": {
6483
6449
  "type": "array",
6484
6450
  "items": {
@@ -22634,7 +22600,7 @@
22634
22600
  "description": "Create a per-org BRAND KIT so Stable Baseline outputs come out fully on-brand. Upload your branding and it is auto-applied: pass a `logoUrl` (as little as your logo, and the vision model AUTO-EXTRACTS your palette and fonts), or an `officeUrl` (an existing .pptx/.docx, from which it extracts theme colours, fonts, logo, watermark and the embedded font files), or explicit `tokens`. The kit themes branded-executive slides AND document exports (PDF, Word, PowerPoint). Auth: can_admin_org. Tiered: free 0, pro 1, enterprise unlimited. Optionally set it as the default at a scope in one call.",
22635
22601
  "operationId": "createBrandKit",
22636
22602
  "tags": [
22637
- "uncategorized"
22603
+ "settings"
22638
22604
  ],
22639
22605
  "requestBody": {
22640
22606
  "required": false,
@@ -22771,7 +22737,7 @@
22771
22737
  "description": "List an organisation's BRAND KITS (palette/fonts/logo), newest first. Use a returned `id` as brandKitId for a design call or setDefaultBrandKit. Auth: can_admin_org.",
22772
22738
  "operationId": "listBrandKits",
22773
22739
  "tags": [
22774
- "uncategorized"
22740
+ "settings"
22775
22741
  ],
22776
22742
  "requestBody": {
22777
22743
  "required": false,
@@ -22872,7 +22838,7 @@
22872
22838
  "description": "Set or clear the default BRAND KIT at a scope: organization, workspace, or project. Defaults cascade most-specific-first (a per-board/document override beats project beats workspace beats organization). Pass brandKitId:null to clear. Auth: org owner/admin.",
22873
22839
  "operationId": "setDefaultBrandKit",
22874
22840
  "tags": [
22875
- "uncategorized"
22841
+ "settings"
22876
22842
  ],
22877
22843
  "requestBody": {
22878
22844
  "required": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stablebaseline/sdk",
3
- "version": "0.4.4",
3
+ "version": "0.5.0",
4
4
  "description": "TypeScript SDK for the Stable Baseline REST API. End-to-end agent-managed company brain — docs, diagrams, plans, and a self-learning Knowledge Graph. 184 tools across 19 categories.",
5
5
  "homepage": "https://stablebaseline.io",
6
6
  "repository": {