@stablebaseline/sdk 0.5.0 → 0.5.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stablebaseline/sdk",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
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": {
@@ -60,7 +60,7 @@
60
60
  "openapi-typescript": "^7.5.0",
61
61
  "tsup": "^8.3.5",
62
62
  "typescript": "^5.6.3",
63
- "vitest": "^4.1.9"
63
+ "vitest": "^4.1.10"
64
64
  },
65
65
  "engines": {
66
66
  "node": ">=18"
@@ -435,7 +435,7 @@ export interface paths {
435
435
  put?: never;
436
436
  /**
437
437
  * getDocument
438
- * @description Read a document's content with line numbers. Returns numbered lines for use with editDocument. Diagrams/images appear as OMITTED markers with metadata (type, diagramId, nlDescription) — use getDiagramInDocument(diagramId) for full DSL code, or dedicated diagram/image tools to manage them. Pass includeDiagramDsl:true to inline each diagram's DSL and versionTimestamp directly into its DIAGRAM_OMITTED marker (saves a getDiagramInDocument call when you intend to read or edit diagrams).
438
+ * @description Read a document's content with line numbers. content.text lines are formatted `NNNNN<TAB>content` (cat -n style); the number+tab prefix is DISPLAY ONLY — never part of the document — so when building editDocument anchor patches, copy only the text AFTER the tab. Reads paginate by lines (offset/limit, default 200): use content.totalLines and content.nextOffset to page. document.versionTimestamp is the optimistic-lock token that every mutating document tool accepts (as versionTimestamp; the older documentVersionTimestamp name also works) — and every mutating tool returns a fresh token, so you rarely need to re-read just to keep editing. Diagrams/images appear as OMITTED markers with metadata (type, diagramId, renderStatus, nlDescription) — use getDiagramInDocument(diagramId) for full DSL code, or pass includeDiagramDsl:true to inline each diagram's DSL and versionTimestamp directly into its DIAGRAM_OMITTED marker (saves a getDiagramInDocument call when you intend to read or edit diagrams).
439
439
  */
440
440
  post: operations["getDocument"];
441
441
  delete?: never;
@@ -455,7 +455,7 @@ export interface paths {
455
455
  put?: never;
456
456
  /**
457
457
  * createDocument
458
- * @description Create a document from CDMD markdown. Call getCdmdLanguageGuide first if unfamiliar with syntax. Do not include DIAGRAM/IMAGE markers — insert them after with dedicated tools. Supports @-mentioning people: embed `<!-- REFERENCE: {"type":"user","id":"<user_uuid>","label":"Name"} -->` to notify a teammate. Use listAssignablePrincipals to look up the user_id from a name; mentions of users outside the project are silently dropped.
458
+ * @description Create a document from CDMD markdown (standard Markdown plus SB extensions — call getCdmdLanguageGuide if unfamiliar). The body goes in `cdmd` (`content` is accepted as an alias). Do not include DIAGRAM/IMAGE markers — insert them after with dedicated tools. Returns the new document's id and versionTimestamp (the optimistic-lock token for subsequent edits). Supports @-mentioning people: embed `<!-- REFERENCE: {"type":"user","id":"<user_uuid>","label":"Name"} -->` to notify a teammate. Use listAssignablePrincipals to look up the user_id from a name; mentions of users outside the project are silently dropped.
459
459
  */
460
460
  post: operations["createDocument"];
461
461
  delete?: never;
@@ -475,7 +475,7 @@ export interface paths {
475
475
  put?: never;
476
476
  /**
477
477
  * editDocument
478
- * @description Edit a document: the PREFERRED tool for small targeted changes. Two patch dialects — do NOT mix them in one call. (1) ANCHOR patches {oldText, newText, before?, after?} — RECOMMENDED: replace an exact snippet of existing text with new text. oldText must match the document byte-for-byte AND be unique; if it occurs more than once, either expand oldText until it is unique, or add `before`/`after` (the EXACT text immediately before/after the match) to disambiguate. A no-match returns nearby context; an ambiguous match returns the occurrence count. Anchors do NOT drift, so you don't need fresh line numbers and they survive concurrent edits. Use newText:"" to delete. (2) LINE patches {startLine, endLine, replacement} — 1-based and INCLUSIVE: call getDocument first for line numbers; replace line 5 with {startLine:5,endLine:5}; INSERT before line N (deleting nothing) with {startLine:N,endLine:N-1}; append to an L-line document with {startLine:L+1,endLine:L}. Line numbers are ABSOLUTE and GO STALE after ANY edit — re-call getDocument before further line patches; out-of-range patches are rejected with the current line count. versionTimestamp from getDocument is required for optimistic locking, EXCEPT when dryRun:true. Set dryRun:true to apply the patches and get the resulting text back WITHOUT saving (verify before committing — kills retry loops). Do not edit or delete DIAGRAM/IMAGE marker lines (rejected with guidance) — use dedicated diagram/image tools. To @-mention a person, insert `<!-- REFERENCE: {"type":"user","id":"<user_uuid>","label":"Name"} -->`; look up the user_id via listAssignablePrincipals. Mentioned users are notified automatically.
478
+ * @description Edit a document: the PREFERRED tool for small targeted changes. Two patch dialects — do NOT mix them in one call. (1) ANCHOR patches {oldText, newText, before?, after?} — RECOMMENDED: replace an exact snippet of existing text with new text. oldText must match the document byte-for-byte AND be unique; if it occurs more than once, either expand oldText until it is unique, or add `before`/`after` (the EXACT text immediately before/after the match) to disambiguate. A no-match returns nearby context; an ambiguous match returns the occurrence count. Anchors do NOT drift, so you don't need fresh line numbers and they survive concurrent edits. Use newText:"" to delete. (2) LINE patches {startLine, endLine, replacement} — 1-based and INCLUSIVE: call getDocument first for line numbers; replace line 5 with {startLine:5,endLine:5}; INSERT before line N (deleting nothing) with {startLine:N,endLine:N-1}; append to an L-line document with {startLine:L+1,endLine:L}. Line numbers are ABSOLUTE and GO STALE after ANY edit — re-call getDocument before further line patches; out-of-range patches are rejected with the current line count. versionTimestamp from getDocument (or from any mutating tool's response — they all return the fresh token) is required for optimistic locking, EXCEPT when dryRun:true. If your token is stale, the error tells you who changed the document, when, and the currentVersionTimestamp — anchor patches survive concurrent edits, so retrying with that token is usually safe. Set dryRun:true to apply the patches and get the resulting text back WITHOUT saving (verify before committing — kills retry loops). IMPORTANT: getDocument displays lines as `NNNNN<TAB>content`; that prefix is display-only — oldText/before/after must contain only the content AFTER the tab. Do not edit or delete DIAGRAM/IMAGE marker lines (rejected with guidance) — use dedicated diagram/image tools. To @-mention a person, insert `<!-- REFERENCE: {"type":"user","id":"<user_uuid>","label":"Name"} -->`; look up the user_id via listAssignablePrincipals. Mentioned users are notified automatically.
479
479
  */
480
480
  post: operations["editDocument"];
481
481
  delete?: never;
@@ -495,7 +495,7 @@ export interface paths {
495
495
  put?: never;
496
496
  /**
497
497
  * findAndReplaceTextInDocument
498
- * @description Find and replace EXACT substrings in a document (NOT regex: wildcards and patterns are matched literally). Replaces EVERY occurrence and returns the replacement count; best for renames and repeated phrases. For a single targeted change at a known location, prefer editDocument (line patches with optimistic locking). Case-sensitive by default. Diagrams/images are automatically protected — only document text is affected. Note: when the `replace` value contains a `<!-- REFERENCE: {...} -->` marker (e.g. inserting a user mention), it round-trips losslessly through the editor and triggers notifications if it adds a new user mention.
498
+ * @description Find and replace EXACT substrings in a document (NOT regex: wildcards and patterns are matched literally). Replaces EVERY occurrence and returns the replacement count; best for renames and repeated phrases. For a single targeted change at a known location, prefer editDocument (anchor patches). Case-sensitive by default. Diagrams/images are automatically protected — only document text is affected. Returns document.versionTimestamp (the fresh optimistic-lock token) like every other mutating tool, so you can chain straight into editDocument or the diagram tools. Pass versionTimestamp to opt into optimistic locking (optional here — whole-document find/replace is position-independent). Note: when the `replace` value contains a `<!-- REFERENCE: {...} -->` marker (e.g. inserting a user mention), it round-trips losslessly through the editor and triggers notifications if it adds a new user mention.
499
499
  */
500
500
  post: operations["findAndReplaceTextInDocument"];
501
501
  delete?: never;
@@ -515,7 +515,7 @@ export interface paths {
515
515
  put?: never;
516
516
  /**
517
517
  * getDiagramInDocument
518
- * @description Get a diagram's full details including raw DSL source code. Use diagramId from DIAGRAM_OMITTED markers in getDocument output. Returns diagramCode, type, name, nlDescription, and versionTimestamp.
518
+ * @description Get a diagram's full details including raw DSL source code. Use diagramId from DIAGRAM_OMITTED markers in getDocument output. Returns diagramCode, type, name, nlDescription, renderStatus/renderError, and versionTimestamp — the diagram's optimistic-lock token for updateDiagramInDocument (every diagram write also returns it fresh).
519
519
  */
520
520
  post: operations["getDiagramInDocument"];
521
521
  delete?: never;
@@ -535,7 +535,7 @@ export interface paths {
535
535
  put?: never;
536
536
  /**
537
537
  * insertDiagramInDocument
538
- * @description Insert a new diagram into a document. Call listDiagramTypes to find your type, then getDiagramTypeGuide for DSL syntax before writing diagramCode. Always set prompt + nlDescription to describe what the diagram shows (they are its saved description) and keep them accurate. After inserting, VERIFY the render — set returnImage:true (or call getDiagramImage) to actually SEE it — and if it is wrong or ugly, correct it with updateDiagramInDocument (provide the full updated diagramCode).
538
+ * @description Insert a new diagram into a document. Call listDiagramTypes to find your type, then getDiagramTypeGuide for DSL syntax before writing diagramCode. The diagramCode is COMPILE-CHECKED BY RENDERING at write time: broken DSL is rejected with the renderer's error (fix and retry), and valid DSL is rendered + thumbnailed immediately so the document displays instantly everywhere. The response tells you what happened: diagram.renderStatus ('rendered' | 'pending_render' with renderError when the renderer was unavailable), plus fresh optimistic-lock tokens — document.versionTimestamp and diagram.versionTimestamp — so you can keep editing without re-reading. Always set prompt (and ideally nlDescription) to describe what the diagram shows. To SEE the result inline set returnImage:true, or call getDiagramImage afterwards; if it is wrong or ugly, correct it with updateDiagramInDocument (provide the full updated diagramCode).
539
539
  */
540
540
  post: operations["insertDiagramInDocument"];
541
541
  delete?: never;
@@ -555,7 +555,7 @@ export interface paths {
555
555
  put?: never;
556
556
  /**
557
557
  * updateDiagramInDocument
558
- * @description Update a diagram's code, description, or properties. Call getDiagramTypeGuide for DSL syntax. Provide a version lock: EITHER documentVersionTimestamp (from getDocument — locks the whole document) OR diagramVersionTimestamp (from getDiagramInDocument, or getDocument with includeDiagramDsl:true — locks just THIS diagram, so two agents can edit two different diagrams in the same document concurrently without a conflict). At least one is required; diagramVersionTimestamp is preferred for concurrency. IMPORTANT: To change what the diagram visually shows, you MUST provide diagramCode with the full updated DSL source. The prompt and nlDescription fields are metadata only and do NOT change the rendered diagram. After updating, re-render with getDiagramImage to confirm it now looks right (iterate if not), and keep prompt/nlDescription in step with what the diagram now shows.
558
+ * @description Update a diagram's code, description, or properties. Call getDiagramTypeGuide for DSL syntax. New diagramCode is COMPILE-CHECKED BY RENDERING at write time — broken DSL is rejected with the renderer's error — and a valid change is re-rendered + re-thumbnailed immediately (response diagram.renderStatus tells you the outcome). Provide a version lock: diagramVersionTimestamp (from getDiagramInDocument, getDocument with includeDiagramDsl:true, or any diagram write's response — PREFERRED: locks just this diagram, so concurrent edits elsewhere in the document don't conflict; bare versionTimestamp is accepted as an alias) OR documentVersionTimestamp (locks the whole document). The response returns BOTH fresh tokens for chaining. Documents carrying a legacy marker (no embedded diagramId) are upgraded automatically on update. IMPORTANT: to change what the diagram visually shows you MUST provide diagramCode with the full updated DSL source — prompt/nlDescription are metadata only. After updating, view it with getDiagramImage and keep prompt/nlDescription in step with what the diagram now shows.
559
559
  */
560
560
  post: operations["updateDiagramInDocument"];
561
561
  delete?: never;
@@ -575,7 +575,7 @@ export interface paths {
575
575
  put?: never;
576
576
  /**
577
577
  * deleteDiagramInDocument
578
- * @description Delete a diagram from a document.
578
+ * @description Delete a diagram: removes the database record AND every reference to it in the document body — the current marker format plus legacy forms (markers without an embedded diagramId, and old plain-text `[Diagram: name]` placeholders). The response's removedFromBody says whether a marker was actually found in the body, and versionTimestamp is the document's fresh lock token.
579
579
  */
580
580
  post: operations["deleteDiagramInDocument"];
581
581
  delete?: never;
@@ -764,6 +764,66 @@ export interface paths {
764
764
  patch?: never;
765
765
  trace?: never;
766
766
  };
767
+ "/tools/startMeetingScribe": {
768
+ parameters: {
769
+ query?: never;
770
+ header?: never;
771
+ path?: never;
772
+ cookie?: never;
773
+ };
774
+ get?: never;
775
+ put?: never;
776
+ /**
777
+ * startMeetingScribe
778
+ * @description Invite the Stable Baseline Meeting Scribe bot to a LIVE meeting (Zoom, Google Meet, Microsoft Teams, or Webex) so it paints a live, editable whiteboard of the conversation as it happens: sticky notes and topic clusters, an agenda that ticks itself off, and decisions and actions pinned to rails, on a real board the team keeps working in afterwards. The bot transcribes only and stores no recording. WHITEBOARD IS REQUIRED: the scribe always paints an existing whiteboard, so documentId (the whiteboard's id) is required. If you do not have a whiteboard id, ASK THE USER which whiteboard to use; do not create one automatically. COST + APPROVAL: it bills 2 credits per minute in 5-minute blocks while it runs (a 60-minute meeting is about 120 credits; hard cap 180 minutes), and it needs the user's explicit approval. Call FIRST without confirm to get the exact quote plus the workspace balance, show that to the user, and only call again with confirm:true once they agree. Available on the Pro and Enterprise plans. It returns immediately with a sessionId; poll getMeetingScribeStatus to watch it join and paint, and stopMeetingScribe to end it. The user can also just remove the bot from the meeting to stop it.
779
+ */
780
+ post: operations["startMeetingScribe"];
781
+ delete?: never;
782
+ options?: never;
783
+ head?: never;
784
+ patch?: never;
785
+ trace?: never;
786
+ };
787
+ "/tools/getMeetingScribeStatus": {
788
+ parameters: {
789
+ query?: never;
790
+ header?: never;
791
+ path?: never;
792
+ cookie?: never;
793
+ };
794
+ get?: never;
795
+ put?: never;
796
+ /**
797
+ * getMeetingScribeStatus
798
+ * @description Get a meeting scribe's status after startMeetingScribe: the session state (joining, in the waiting room, live in the call, paused, ending, ended, or failed), the live activity feed of what the scribe has painted, and the board it is painting. Give it the sessionId returned by startMeetingScribe. Poll every 15 to 30 seconds while the meeting runs. When the meeting ends the board holds the finished 'meeting map' (topics, decisions, actions, and a summary).
799
+ */
800
+ post: operations["getMeetingScribeStatus"];
801
+ delete?: never;
802
+ options?: never;
803
+ head?: never;
804
+ patch?: never;
805
+ trace?: never;
806
+ };
807
+ "/tools/stopMeetingScribe": {
808
+ parameters: {
809
+ query?: never;
810
+ header?: never;
811
+ path?: never;
812
+ cookie?: never;
813
+ };
814
+ get?: never;
815
+ put?: never;
816
+ /**
817
+ * stopMeetingScribe
818
+ * @description Stop a running meeting scribe: the bot leaves the meeting and the board is finalised (tidy pass plus a summary frame). Give it the sessionId returned by startMeetingScribe. Billing stops at the current block; the user can also stop the scribe simply by removing the bot from the meeting.
819
+ */
820
+ post: operations["stopMeetingScribe"];
821
+ delete?: never;
822
+ options?: never;
823
+ head?: never;
824
+ patch?: never;
825
+ trace?: never;
826
+ };
767
827
  "/tools/createWhiteboard": {
768
828
  parameters: {
769
829
  query?: never;
@@ -915,7 +975,7 @@ export interface paths {
915
975
  put?: never;
916
976
  /**
917
977
  * insertWhiteboardDiagram
918
- * @description Insert a real DIAGRAM (BPMN, Diagrams-as-Code / any DSL: mermaid, d2, plantuml, graphviz, …) into a whiteboard as an editable SB diagram element. Provide documentId, diagramType (call listDiagramTypes / getDiagramTypeGuide), and source (the DSL). The diagram is rendered to an image stored like a pasted image, and its editable source is kept in a sidecar so it stays a live, re-openable diagram on the board (double-click on the canvas opens the BPMN / code / AI editor). Options: caption (label beneath it), width/height to size it, and x/y or align ('left'|'center'|'right') to place it (defaults to the right of existing content). After inserting, call getWhiteboardImage to see it and verify it rendered correctly (fix the source and re-insert if it is wrong). For a plain picture (not a diagram) use insertWhiteboardImage; to generate a diagram image WITHOUT inserting use renderDiagram.
978
+ * @description Insert (or re-render in place) a real DIAGRAM (BPMN, Diagrams-as-Code / any DSL: mermaid, d2, plantuml, graphviz, …) on a whiteboard as an editable SB diagram element. Provide documentId, diagramType (call listDiagramTypes / getDiagramTypeGuide), and source (the DSL). The diagram is rendered to an image stored like a pasted image, and its editable source is kept in a sidecar so it stays a live, re-openable diagram (double-click on the canvas opens the BPMN / code / AI editor). Options: caption (label beneath it), width/height to size it (auto width caps at 480px; an explicit width may go up to 1200px), and x/y or align ('left'|'center'|'right') to place it (defaults to the right of existing content). Pass updateElementId to UPDATE an existing embedded diagram in place — re-render + replace its image and DSL while keeping the same element id and board position (used to live-edit a diagram as it evolves); if that id is not on the board yet it is created carrying that id. After inserting, call getWhiteboardImage to see it and verify it rendered correctly (fix the source and re-insert if it is wrong). For a plain picture (not a diagram) use insertWhiteboardImage; to generate a diagram image WITHOUT inserting use renderDiagram.
919
979
  */
920
980
  post: operations["insertWhiteboardDiagram"];
921
981
  delete?: never;
@@ -1055,7 +1115,7 @@ export interface paths {
1055
1115
  put?: never;
1056
1116
  /**
1057
1117
  * getDiagramImage
1058
- * @description Render a diagram that ALREADY exists in a document to an IMAGE (svg/png/jpeg @1x/2x/3x) and return it — a temporary signed URL (expires in 1 hour) plus, for png/jpeg, the image inline so you can see it. Pass the diagramId (from getDocument's DIAGRAM markers or getDiagramInDocument). Reuses the diagram's cached server render when available (pixel-identical to the editor). Use renderDiagram instead to generate from raw DSL without an existing diagram.
1118
+ * @description Render a diagram that ALREADY exists in a document to an IMAGE (svg/png/jpeg @1x/2x/3x) and return it — a temporary signed URL (expires in 1 hour) plus, for png/jpeg, the image inline so you can see it. Pass the diagramId (from getDocument's DIAGRAM markers or getDiagramInDocument). Reuses the diagram's cached server render when available (pixel-identical to the editor); when the diagram has no cached render yet, the fresh render is persisted back to the document (persistedRender:true in the response), so reading repairs unrendered diagrams. Use renderDiagram instead to generate from raw DSL without an existing diagram.
1059
1119
  */
1060
1120
  post: operations["getDiagramImage"];
1061
1121
  delete?: never;
@@ -1195,7 +1255,7 @@ export interface paths {
1195
1255
  put?: never;
1196
1256
  /**
1197
1257
  * updateImageInDocument
1198
- * @description Update image metadata (alt, caption, dimensions, alignment). Requires documentVersionTimestamp from getDocument for optimistic locking.
1258
+ * @description Update image metadata (alt, caption, dimensions, alignment). Requires the document's versionTimestamp (from getDocument or any mutating tool's response) for optimistic locking.
1199
1259
  */
1200
1260
  post: operations["updateImageInDocument"];
1201
1261
  delete?: never;
@@ -5884,7 +5944,10 @@ export interface operations {
5884
5944
  projectId: string;
5885
5945
  folderId?: string;
5886
5946
  title?: string;
5887
- cdmd: string;
5947
+ /** @description Document body in CDMD markdown. Alias: content. */
5948
+ cdmd?: string;
5949
+ /** @description Alias for cdmd — provide one of the two. */
5950
+ content?: string;
5888
5951
  /** @description Sort position within the parent folder (or project root if no folderId). When omitted, the document is appended at the end. */
5889
5952
  position?: number;
5890
5953
  /** @description Version history summary. */
@@ -5977,7 +6040,7 @@ export interface operations {
5977
6040
  folderId?: string;
5978
6041
  /** @description Sort position within the parent folder. Use to reposition a single document. For batch sibling reorder, use reorderDocuments. */
5979
6042
  position?: number;
5980
- /** @description Version timestamp from getDocument() for optimistic locking. Required unless dryRun:true. */
6043
+ /** @description Optimistic-lock token from getDocument() or any mutating tool's response. Required unless dryRun:true. (Alias accepted: documentVersionTimestamp.) */
5981
6044
  versionTimestamp?: number;
5982
6045
  /** @description If true, apply the patches and RETURN the resulting document text without saving — no version bump, no lock required. Use to preview/verify a patch before committing. Default false. */
5983
6046
  dryRun?: boolean;
@@ -6089,6 +6152,8 @@ export interface operations {
6089
6152
  replace: string;
6090
6153
  /** @description Case-sensitive matching. Default: true. */
6091
6154
  caseSensitive?: boolean;
6155
+ /** @description Optional optimistic-lock token from getDocument() or a previous write; validated when provided. (Alias accepted: documentVersionTimestamp.) */
6156
+ versionTimestamp?: number;
6092
6157
  /** @description Version history summary. */
6093
6158
  changeSummary?: string;
6094
6159
  };
@@ -6258,8 +6323,8 @@ export interface operations {
6258
6323
  content: {
6259
6324
  "application/json": {
6260
6325
  documentId: string;
6261
- /** @description Version timestamp from getDocument() for optimistic locking. */
6262
- documentVersionTimestamp: number;
6326
+ /** @description Optimistic-lock token: the document's versionTimestamp from getDocument() or any mutating tool's response. (Alias accepted: versionTimestamp.) */
6327
+ documentVersionTimestamp?: number;
6263
6328
  /** @description Diagram type (e.g. mermaid, plantuml, bpmn, d2). Call listDiagramTypes for all types. */
6264
6329
  type: string;
6265
6330
  /** @description Diagram DSL code. Call getDiagramTypeGuide for syntax. EXCEPTION — for type 'infographic', put a plain-English DESCRIPTION of the infographic here (NOT code); the system designs the AntV spec and renders it. */
@@ -6267,16 +6332,16 @@ export interface operations {
6267
6332
  /** @description Short description of what the diagram shows (1-2 sentences). */
6268
6333
  prompt: string;
6269
6334
  /** @description Extended description of the diagram (2-4 sentences). */
6270
- nlDescription: string;
6335
+ nlDescription?: string;
6271
6336
  /**
6272
6337
  * @description Alignment.
6273
6338
  * @enum {string}
6274
6339
  */
6275
- align: "left" | "center" | "right";
6340
+ align?: "left" | "center" | "right";
6276
6341
  /** @description Caption below the diagram. */
6277
- caption: string;
6342
+ caption?: string;
6278
6343
  /** @description Insert after this line number (1-based). */
6279
- afterLine: number;
6344
+ afterLine?: number;
6280
6345
  /** @description BPMN only. Color plan: { byElementId: { ElementId: SwatchName } }. */
6281
6346
  colorPlan?: {
6282
6347
  /** @description Map of element IDs to color swatch names. */
@@ -6381,7 +6446,7 @@ export interface operations {
6381
6446
  "application/json": {
6382
6447
  /** @description Diagram ID from DIAGRAM_OMITTED markers. */
6383
6448
  diagramId: string;
6384
- /** @description New diagram DSL source code. REQUIRED to change what the diagram visually renders. Call getDiagramTypeGuide for syntax. Must provide the COMPLETE updated DSL, not just the changed parts. */
6449
+ /** @description New diagram DSL source code. REQUIRED to change what the diagram visually renders. Call getDiagramTypeGuide for syntax. Must provide the COMPLETE updated DSL, not just the changed parts. EXCEPTION — for type 'infographic', pass either a plain-English DESCRIPTION of the new infographic (the system designs, renders, and stores the AntV spec, same as insert) or complete AntV Infographic DSL (first line `infographic <template-name>`). */
6385
6450
  diagramCode?: string;
6386
6451
  /** @description New short description (metadata only — does NOT change the rendered diagram). */
6387
6452
  prompt?: string;
@@ -6403,7 +6468,7 @@ export interface operations {
6403
6468
  };
6404
6469
  /** @description Document-level optimistic lock: versionTimestamp from getDocument(). Locks the whole document. Provide this OR diagramVersionTimestamp (at least one is required). */
6405
6470
  documentVersionTimestamp?: number;
6406
- /** @description Diagram-level optimistic lock: versionTimestamp of THIS diagram (from getDiagramInDocument, or getDocument with includeDiagramDsl:true). Pass this instead of documentVersionTimestamp to lock only this diagram, so concurrent edits to OTHER diagrams in the same document don't conflict. Preferred for multi-agent concurrency. The response returns the new diagram.diagramVersionTimestamp for chaining further edits. */
6471
+ /** @description Diagram-level optimistic lock: versionTimestamp of THIS diagram (from getDiagramInDocument, getDocument with includeDiagramDsl:true, or a previous write's response). Preferred: locks only this diagram, so concurrent edits to OTHER diagrams in the same document don't conflict. (Alias accepted: versionTimestamp.) The response returns the new diagram.versionTimestamp for chaining further edits. */
6407
6472
  diagramVersionTimestamp?: number;
6408
6473
  };
6409
6474
  };
@@ -6488,6 +6553,8 @@ export interface operations {
6488
6553
  "application/json": {
6489
6554
  /** @description Diagram ID from DIAGRAM_OMITTED markers. */
6490
6555
  diagramId: string;
6556
+ /** @description Optional document optimistic-lock token; validated when provided. (Alias accepted: documentVersionTimestamp.) */
6557
+ versionTimestamp?: number;
6491
6558
  };
6492
6559
  };
6493
6560
  };
@@ -6748,6 +6815,13 @@ export interface operations {
6748
6815
  designProfile?: "standard" | "branded-executive" | "illustrated" | "image" | "agentic" | "agentic-deck";
6749
6816
  /** @description Optional brand kit id (from listBrandKits) to theme a branded-executive deck. If omitted, the org's built-in default is used. Create one from just a logo (or a .pptx/.docx) via createBrandKit. */
6750
6817
  brandKitId?: string;
6818
+ /** @description Design the board from a meeting transcript (exactly one of documentId or text). When set, the board is built as a 'meeting map' (topics, decisions, actions) from the transcript instead of from the goal alone. This mode is billed by transcript LENGTH — 2 credits per minute of transcript (10-minute minimum), not the flat 50; the first (unconfirmed) call returns the exact cost to relay to the user. */
6819
+ sourceTranscript?: {
6820
+ /** @description The id of a Stable Baseline document holding the meeting transcript/notes to design from. */
6821
+ documentId?: string;
6822
+ /** @description The raw transcript text to design from (pasted). Provide this OR documentId, not both. */
6823
+ text?: string;
6824
+ };
6751
6825
  };
6752
6826
  };
6753
6827
  };
@@ -7416,6 +7490,270 @@ export interface operations {
7416
7490
  };
7417
7491
  };
7418
7492
  };
7493
+ startMeetingScribe: {
7494
+ parameters: {
7495
+ query?: never;
7496
+ header?: never;
7497
+ path?: never;
7498
+ cookie?: never;
7499
+ };
7500
+ requestBody?: {
7501
+ content: {
7502
+ "application/json": {
7503
+ /** @description The whiteboard the scribe paints into. REQUIRED: a meeting scribe always paints an existing board. If you do not have a whiteboard id, ask the user which whiteboard to use; never create one automatically. */
7504
+ documentId: string;
7505
+ /** @description The meeting link to join: a Zoom, Google Meet, Microsoft Teams, or Webex URL (https only). Any other host is rejected. */
7506
+ meetingUrl: string;
7507
+ /** @description Optional agenda pre-drawn on the board as a left rail; each item gets a status sticker (pending, active, done) as the conversation reaches it. Omit to let the rail build itself from the topics that emerge. */
7508
+ agenda?: {
7509
+ /** @description The agenda item text. */
7510
+ label: string;
7511
+ /** @description Optional stable id; one is minted if omitted. */
7512
+ id?: string;
7513
+ }[];
7514
+ /** @description Optional per-meeting settings: { language (BCP-47, e.g. 'en'), sttProvider ('assemblyai' default, or 'captions'), presentMode ('off' default, or 'camera'/'screenshare' to stream the live board back into the meeting), botName (override the default '{Org} Scribe (Stable Baseline)') }. */
7515
+ settings?: {
7516
+ [key: string]: unknown;
7517
+ };
7518
+ /** @description Set true ONLY after the user has approved the per-minute cost. Leave unset/false on the first call to receive the quote plus balance. */
7519
+ confirm?: boolean;
7520
+ };
7521
+ };
7522
+ };
7523
+ responses: {
7524
+ /** @description Tool result (shape varies per tool — refer to the tool's docs for the exact return value). */
7525
+ 200: {
7526
+ headers: {
7527
+ [name: string]: unknown;
7528
+ };
7529
+ content: {
7530
+ "application/json": {
7531
+ [key: string]: unknown;
7532
+ };
7533
+ };
7534
+ };
7535
+ /** @description Validation error. */
7536
+ 400: {
7537
+ headers: {
7538
+ [name: string]: unknown;
7539
+ };
7540
+ content: {
7541
+ "application/json": components["schemas"]["ErrorResponse"];
7542
+ };
7543
+ };
7544
+ /** @description Missing or invalid credentials. */
7545
+ 401: {
7546
+ headers: {
7547
+ [name: string]: unknown;
7548
+ };
7549
+ content: {
7550
+ "application/json": components["schemas"]["ErrorResponse"];
7551
+ };
7552
+ };
7553
+ /** @description Authenticated but lacking the required permission or feature flag. */
7554
+ 403: {
7555
+ headers: {
7556
+ [name: string]: unknown;
7557
+ };
7558
+ content: {
7559
+ "application/json": components["schemas"]["ErrorResponse"];
7560
+ };
7561
+ };
7562
+ /** @description Resource not found. */
7563
+ 404: {
7564
+ headers: {
7565
+ [name: string]: unknown;
7566
+ };
7567
+ content: {
7568
+ "application/json": components["schemas"]["ErrorResponse"];
7569
+ };
7570
+ };
7571
+ /** @description Body did not match the tool's input schema. */
7572
+ 422: {
7573
+ headers: {
7574
+ [name: string]: unknown;
7575
+ };
7576
+ content: {
7577
+ "application/json": components["schemas"]["ErrorResponse"];
7578
+ };
7579
+ };
7580
+ /** @description Server error. */
7581
+ 500: {
7582
+ headers: {
7583
+ [name: string]: unknown;
7584
+ };
7585
+ content: {
7586
+ "application/json": components["schemas"]["ErrorResponse"];
7587
+ };
7588
+ };
7589
+ };
7590
+ };
7591
+ getMeetingScribeStatus: {
7592
+ parameters: {
7593
+ query?: never;
7594
+ header?: never;
7595
+ path?: never;
7596
+ cookie?: never;
7597
+ };
7598
+ requestBody?: {
7599
+ content: {
7600
+ "application/json": {
7601
+ /** @description The meeting scribe session to poll, as returned by startMeetingScribe. */
7602
+ sessionId: string;
7603
+ };
7604
+ };
7605
+ };
7606
+ responses: {
7607
+ /** @description Tool result (shape varies per tool — refer to the tool's docs for the exact return value). */
7608
+ 200: {
7609
+ headers: {
7610
+ [name: string]: unknown;
7611
+ };
7612
+ content: {
7613
+ "application/json": {
7614
+ [key: string]: unknown;
7615
+ };
7616
+ };
7617
+ };
7618
+ /** @description Validation error. */
7619
+ 400: {
7620
+ headers: {
7621
+ [name: string]: unknown;
7622
+ };
7623
+ content: {
7624
+ "application/json": components["schemas"]["ErrorResponse"];
7625
+ };
7626
+ };
7627
+ /** @description Missing or invalid credentials. */
7628
+ 401: {
7629
+ headers: {
7630
+ [name: string]: unknown;
7631
+ };
7632
+ content: {
7633
+ "application/json": components["schemas"]["ErrorResponse"];
7634
+ };
7635
+ };
7636
+ /** @description Authenticated but lacking the required permission or feature flag. */
7637
+ 403: {
7638
+ headers: {
7639
+ [name: string]: unknown;
7640
+ };
7641
+ content: {
7642
+ "application/json": components["schemas"]["ErrorResponse"];
7643
+ };
7644
+ };
7645
+ /** @description Resource not found. */
7646
+ 404: {
7647
+ headers: {
7648
+ [name: string]: unknown;
7649
+ };
7650
+ content: {
7651
+ "application/json": components["schemas"]["ErrorResponse"];
7652
+ };
7653
+ };
7654
+ /** @description Body did not match the tool's input schema. */
7655
+ 422: {
7656
+ headers: {
7657
+ [name: string]: unknown;
7658
+ };
7659
+ content: {
7660
+ "application/json": components["schemas"]["ErrorResponse"];
7661
+ };
7662
+ };
7663
+ /** @description Server error. */
7664
+ 500: {
7665
+ headers: {
7666
+ [name: string]: unknown;
7667
+ };
7668
+ content: {
7669
+ "application/json": components["schemas"]["ErrorResponse"];
7670
+ };
7671
+ };
7672
+ };
7673
+ };
7674
+ stopMeetingScribe: {
7675
+ parameters: {
7676
+ query?: never;
7677
+ header?: never;
7678
+ path?: never;
7679
+ cookie?: never;
7680
+ };
7681
+ requestBody?: {
7682
+ content: {
7683
+ "application/json": {
7684
+ /** @description The meeting scribe session to stop, as returned by startMeetingScribe. */
7685
+ sessionId: string;
7686
+ };
7687
+ };
7688
+ };
7689
+ responses: {
7690
+ /** @description Tool result (shape varies per tool — refer to the tool's docs for the exact return value). */
7691
+ 200: {
7692
+ headers: {
7693
+ [name: string]: unknown;
7694
+ };
7695
+ content: {
7696
+ "application/json": {
7697
+ [key: string]: unknown;
7698
+ };
7699
+ };
7700
+ };
7701
+ /** @description Validation error. */
7702
+ 400: {
7703
+ headers: {
7704
+ [name: string]: unknown;
7705
+ };
7706
+ content: {
7707
+ "application/json": components["schemas"]["ErrorResponse"];
7708
+ };
7709
+ };
7710
+ /** @description Missing or invalid credentials. */
7711
+ 401: {
7712
+ headers: {
7713
+ [name: string]: unknown;
7714
+ };
7715
+ content: {
7716
+ "application/json": components["schemas"]["ErrorResponse"];
7717
+ };
7718
+ };
7719
+ /** @description Authenticated but lacking the required permission or feature flag. */
7720
+ 403: {
7721
+ headers: {
7722
+ [name: string]: unknown;
7723
+ };
7724
+ content: {
7725
+ "application/json": components["schemas"]["ErrorResponse"];
7726
+ };
7727
+ };
7728
+ /** @description Resource not found. */
7729
+ 404: {
7730
+ headers: {
7731
+ [name: string]: unknown;
7732
+ };
7733
+ content: {
7734
+ "application/json": components["schemas"]["ErrorResponse"];
7735
+ };
7736
+ };
7737
+ /** @description Body did not match the tool's input schema. */
7738
+ 422: {
7739
+ headers: {
7740
+ [name: string]: unknown;
7741
+ };
7742
+ content: {
7743
+ "application/json": components["schemas"]["ErrorResponse"];
7744
+ };
7745
+ };
7746
+ /** @description Server error. */
7747
+ 500: {
7748
+ headers: {
7749
+ [name: string]: unknown;
7750
+ };
7751
+ content: {
7752
+ "application/json": components["schemas"]["ErrorResponse"];
7753
+ };
7754
+ };
7755
+ };
7756
+ };
7419
7757
  createWhiteboard: {
7420
7758
  parameters: {
7421
7759
  query?: never;
@@ -8157,19 +8495,26 @@ export interface operations {
8157
8495
  source: string;
8158
8496
  /** @description Optional caption shown beneath the diagram. */
8159
8497
  caption?: string;
8160
- /** @description Display width in px (aspect ratio preserved). Defaults to a capped natural size. */
8498
+ /** @description Display width in px (aspect ratio preserved). Auto-size caps at 480px; an explicit width is honoured up to 1200px. */
8161
8499
  width?: number;
8162
8500
  /** @description Display height in px (defaults from width + aspect). */
8163
8501
  height?: number;
8164
- /** @description Top-left x on the canvas. Omit to auto-place. */
8502
+ /** @description Top-left x on the canvas. Omit to auto-place (or to keep the existing position when updateElementId is given). */
8165
8503
  x?: number;
8166
- /** @description Top-left y on the canvas. Omit to auto-place. */
8504
+ /** @description Top-left y on the canvas. Omit to auto-place (or to keep the existing position when updateElementId is given). */
8167
8505
  y?: number;
8168
8506
  /**
8169
8507
  * @description Horizontal alignment relative to existing content (placed below it). Ignored if x/y given.
8170
8508
  * @enum {string}
8171
8509
  */
8172
8510
  align?: "left" | "center" | "right";
8511
+ /** @description Element id of an EXISTING embedded diagram to re-render and replace in place (keeps the element id + board position). Omit for a fresh insert. If the id is not on the board, a new element is created with it. */
8512
+ updateElementId?: string;
8513
+ /**
8514
+ * @description When 'contain' AND both width and height are given, treat width/height as a BOUNDING BOX: the diagram is scaled to its natural aspect ratio to fit inside the box (never upscaled past 1.5x natural) and centred, so it never stretches. The response's diagram.{x,y,width,height} carry the final drawn geometry. Omit for the exact width/height behaviour.
8515
+ * @enum {string}
8516
+ */
8517
+ fit?: "contain";
8173
8518
  };
8174
8519
  };
8175
8520
  };
@@ -9356,8 +9701,8 @@ export interface operations {
9356
9701
  content: {
9357
9702
  "application/json": {
9358
9703
  documentId: string;
9359
- /** @description Version timestamp from getDocument() for optimistic locking. */
9360
- documentVersionTimestamp: number;
9704
+ /** @description Optimistic-lock token: the document's versionTimestamp from getDocument() or any mutating tool's response. (Alias accepted: versionTimestamp.) */
9705
+ documentVersionTimestamp?: number;
9361
9706
  /** @description Base64-encoded image data. Mutually exclusive with imageBinary/imageUrl. */
9362
9707
  imageBase64?: string;
9363
9708
  /** @description Raw binary as byte array. Mutually exclusive with imageBase64/imageUrl. */
@@ -9466,8 +9811,8 @@ export interface operations {
9466
9811
  "application/json": {
9467
9812
  /** @description Image ID from IMAGE_OMITTED markers. */
9468
9813
  imageId: string;
9469
- /** @description Version timestamp from getDocument() for optimistic locking. */
9470
- documentVersionTimestamp: number;
9814
+ /** @description Optimistic-lock token: the document's versionTimestamp from getDocument() or any mutating tool's response. (Alias accepted: versionTimestamp.) */
9815
+ documentVersionTimestamp?: number;
9471
9816
  /** @description New alt text. */
9472
9817
  alt?: string;
9473
9818
  /** @description New image description. */