@stablebaseline/sdk 0.5.3 → 0.6.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/dist/index.d.cts CHANGED
@@ -854,7 +854,7 @@ interface paths {
854
854
  put?: never;
855
855
  /**
856
856
  * listWhiteboards
857
- * @description List the whiteboards in a project (hidden whiteboard-kind documents). Returns documentId, diagramId, title and timestamps for each.
857
+ * @description List AND grep the whiteboards in a project (hidden whiteboard-kind documents). `query` searches the title and friendlyId (substring by default; set isRegex:true for a regular expression, caseSensitive:true for exact case). This is the tool to find a board by name — listDocuments deliberately excludes whiteboards. Returns documentId, diagramId, title and timestamps for each.
858
858
  */
859
859
  post: operations["listWhiteboards"];
860
860
  delete?: never;
@@ -1674,11 +1674,11 @@ interface paths {
1674
1674
  put?: never;
1675
1675
  /**
1676
1676
  * searchImprovements
1677
- * @description Locate any artefact (document / whiteboard / diagram / plan / task / improvement / compliance) by name or friendly id — AND ranked semantic search over improvements.
1677
+ * @description Ranked semantic search over IMPROVEMENTS AND TASKS — hybrid full-text + vector, so it matches meaning rather than just wording. Returns ranked { improvements }, each with a versionTimestamp you can pass straight to updateImprovement without a getImprovement round-trip.
1678
1678
  *
1679
- * • CROSS-ARTEFACT FINDER MODE (pass `types`): matches title + friendly id (e.g. "DOC-123", "WBD-9", "PLN-4", "TAS-7", "IMP-2") + description across every artefact type. Returns a typed navigable list ({ artefacts: [{ result_type, id, friendly_id, title, snippet, document_id, project_id, href }] }). This is the tool to use to find an artefact by its name or id — NOT kg_search (which retrieves knowledge from inside content). Pass types:["document","whiteboard","plan","task","improvement","compliance"] (or a subset) to search those types; an empty or all-inclusive list searches everything.
1679
+ * Improvements and tasks are one table (a task is an improvement with is_task=true), so both are searched by default. Pass types:["task"] or types:["improvement"] to narrow to one.
1680
1680
  *
1681
- * • IMPROVEMENT SEMANTIC MODE (omit `types`): hybrid full-text + vector search over improvements only. Returns ranked { improvements }.
1681
+ * This tool searches improvements and tasks ONLY. To find a document, whiteboard, plan or compliance item by name or friendly id, use kg_search({ query, artefactMetadataOnly: true }) — it matches title + friendly id + uuid across every artefact type and needs no knowledge graph. To search document CONTENT, use listDocuments.
1682
1682
  */
1683
1683
  post: operations["searchImprovements"];
1684
1684
  delete?: never;
@@ -2258,7 +2258,7 @@ interface paths {
2258
2258
  put?: never;
2259
2259
  /**
2260
2260
  * kg_search
2261
- * @description Unified Knowledge Graph KNOWLEDGE retrieval — facts, themes and relationships from INSIDE document CONTENT. This is NOT an artefact finder: do NOT use it to locate a document / whiteboard / diagram / plan / task / improvement by its TITLE or friendly id (e.g. "DOC-123", "find the GTM plan"). For locating an artefact by name or id use listDocuments / listWhiteboards / listPlans / listTasks / searchImprovements (they match title + friendly id). Use kg_search only to ANSWER A QUESTION from the knowledge contained in the artefacts.
2261
+ * @description Unified Knowledge Graph KNOWLEDGE retrieval — facts, themes and relationships from INSIDE document CONTENT. To LOCATE AN ARTEFACT BY NAME OR ID rather than answer a question, pass artefactMetadataOnly:true — see below. Without that flag this tool retrieves knowledge from inside content and will not reliably find a thing by its title.
2262
2262
  *
2263
2263
  * PICK THE MODE THAT FITS THE QUERY:
2264
2264
  *
@@ -2278,6 +2278,9 @@ interface paths {
2278
2278
  * - User asks 'how is X connected to Y' → 'path' (with both entity IDs)
2279
2279
  * - User asks 'what's near entity X' → 'graph' (with srcEntityId)
2280
2280
  * - 'local' returned nothing useful and the question is broad → retry with 'ppr'
2281
+ * - User wants to FIND a named artefact ("the GTM plan", "DOC-123", a uuid) → artefactMetadataOnly:true
2282
+ *
2283
+ * ARTEFACT-METADATA MODE (artefactMetadataOnly:true): ignores `mode` entirely and matches title + friendly id + uuid across EVERY artefact type — documents, whiteboards, plans, tasks, improvements, compliance frameworks. Returns a typed navigable list ({ artefacts: [{ result_type, id, friendly_id, title, snippet, document_id, project_id, href }] }). It reads no document content and needs no knowledge graph: unlike every other mode it is NOT limited to what has been ingested, so it still finds artefacts in projects where the KG is switched off. Narrow it with artefactTypes. To search inside document BODIES use listDocuments (full-content grep).
2281
2284
  */
2282
2285
  post: operations["kg_search"];
2283
2286
  delete?: never;
@@ -7893,6 +7896,12 @@ interface operations {
7893
7896
  content: {
7894
7897
  "application/json": {
7895
7898
  projectId: string;
7899
+ /** @description Grep across title and friendlyId. Substring by default; a regular expression when isRegex is true. */
7900
+ query?: string;
7901
+ /** @description Treat `query` as a regular expression. */
7902
+ isRegex?: boolean;
7903
+ /** @description Match case exactly. Default false. */
7904
+ caseSensitive?: boolean;
7896
7905
  };
7897
7906
  };
7898
7907
  };
@@ -11942,18 +11951,16 @@ interface operations {
11942
11951
  requestBody?: {
11943
11952
  content: {
11944
11953
  "application/json": {
11945
- /** @description Search query — a name fragment or a friendly id. */
11954
+ /** @description Search query — meaning, a name fragment, or a friendly id (e.g. "IMP-2", "TAS-7"). */
11946
11955
  query: string;
11947
- /** @description Switches on the cross-artefact finder. Artefact types to search (subset of document, whiteboard, improvement, task, plan, compliance). Empty / all = every type. Omit entirely for the improvements-only semantic search. */
11948
- types?: ("document" | "whiteboard" | "improvement" | "task" | "plan" | "compliance")[];
11956
+ /** @description Narrow to one kind. Omit (or pass both) to search improvements and tasks together. Other artefact types are NOT accepted here — use kg_search with artefactMetadataOnly:true for those. */
11957
+ types?: ("improvement" | "task")[];
11949
11958
  /** @description Limit to a project. */
11950
11959
  projectId?: string;
11951
11960
  /** @description Limit to a workspace. */
11952
11961
  workspaceId?: string;
11953
- /** @description Max results (default 20 semantic / 30 cross-artefact, max 50). */
11962
+ /** @description Max results (default 20, max 50). */
11954
11963
  limit?: number;
11955
- /** @description Pagination offset (cross-artefact mode). */
11956
- offset?: number;
11957
11964
  };
11958
11965
  };
11959
11966
  };
@@ -14714,8 +14721,17 @@ interface operations {
14714
14721
  requestBody?: {
14715
14722
  content: {
14716
14723
  "application/json": {
14717
- /** @description Natural-language query. Required for local/global/ppr; optional for graph (use srcEntityId instead). */
14724
+ /** @description Natural-language query. Required for local/global/ppr; optional for graph (use srcEntityId instead). With artefactMetadataOnly:true this is the artefact name, friendly id or uuid to find. */
14718
14725
  query?: string;
14726
+ /**
14727
+ * @description Find artefacts BY NAME/ID instead of retrieving knowledge. Matches title + friendly id + uuid only — never document content — across all artefact types, and does not require the knowledge graph to be enabled. Default false.
14728
+ * @default false
14729
+ */
14730
+ artefactMetadataOnly?: boolean;
14731
+ /** @description Only with artefactMetadataOnly:true. Restrict the search to these artefact types. Omit to search all of them. Unknown values are rejected rather than ignored. */
14732
+ artefactTypes?: ("document" | "whiteboard" | "improvement" | "task" | "plan" | "compliance")[];
14733
+ /** @description Only with artefactMetadataOnly:true. Skip this many results for paging. */
14734
+ offset?: number;
14719
14735
  /**
14720
14736
  * @description Retrieval strategy. See tool description for when to use each — strongly prefer 'global' for thematic/overview questions.
14721
14737
  * @default local
package/dist/index.d.ts CHANGED
@@ -854,7 +854,7 @@ interface paths {
854
854
  put?: never;
855
855
  /**
856
856
  * listWhiteboards
857
- * @description List the whiteboards in a project (hidden whiteboard-kind documents). Returns documentId, diagramId, title and timestamps for each.
857
+ * @description List AND grep the whiteboards in a project (hidden whiteboard-kind documents). `query` searches the title and friendlyId (substring by default; set isRegex:true for a regular expression, caseSensitive:true for exact case). This is the tool to find a board by name — listDocuments deliberately excludes whiteboards. Returns documentId, diagramId, title and timestamps for each.
858
858
  */
859
859
  post: operations["listWhiteboards"];
860
860
  delete?: never;
@@ -1674,11 +1674,11 @@ interface paths {
1674
1674
  put?: never;
1675
1675
  /**
1676
1676
  * searchImprovements
1677
- * @description Locate any artefact (document / whiteboard / diagram / plan / task / improvement / compliance) by name or friendly id — AND ranked semantic search over improvements.
1677
+ * @description Ranked semantic search over IMPROVEMENTS AND TASKS — hybrid full-text + vector, so it matches meaning rather than just wording. Returns ranked { improvements }, each with a versionTimestamp you can pass straight to updateImprovement without a getImprovement round-trip.
1678
1678
  *
1679
- * • CROSS-ARTEFACT FINDER MODE (pass `types`): matches title + friendly id (e.g. "DOC-123", "WBD-9", "PLN-4", "TAS-7", "IMP-2") + description across every artefact type. Returns a typed navigable list ({ artefacts: [{ result_type, id, friendly_id, title, snippet, document_id, project_id, href }] }). This is the tool to use to find an artefact by its name or id — NOT kg_search (which retrieves knowledge from inside content). Pass types:["document","whiteboard","plan","task","improvement","compliance"] (or a subset) to search those types; an empty or all-inclusive list searches everything.
1679
+ * Improvements and tasks are one table (a task is an improvement with is_task=true), so both are searched by default. Pass types:["task"] or types:["improvement"] to narrow to one.
1680
1680
  *
1681
- * • IMPROVEMENT SEMANTIC MODE (omit `types`): hybrid full-text + vector search over improvements only. Returns ranked { improvements }.
1681
+ * This tool searches improvements and tasks ONLY. To find a document, whiteboard, plan or compliance item by name or friendly id, use kg_search({ query, artefactMetadataOnly: true }) — it matches title + friendly id + uuid across every artefact type and needs no knowledge graph. To search document CONTENT, use listDocuments.
1682
1682
  */
1683
1683
  post: operations["searchImprovements"];
1684
1684
  delete?: never;
@@ -2258,7 +2258,7 @@ interface paths {
2258
2258
  put?: never;
2259
2259
  /**
2260
2260
  * kg_search
2261
- * @description Unified Knowledge Graph KNOWLEDGE retrieval — facts, themes and relationships from INSIDE document CONTENT. This is NOT an artefact finder: do NOT use it to locate a document / whiteboard / diagram / plan / task / improvement by its TITLE or friendly id (e.g. "DOC-123", "find the GTM plan"). For locating an artefact by name or id use listDocuments / listWhiteboards / listPlans / listTasks / searchImprovements (they match title + friendly id). Use kg_search only to ANSWER A QUESTION from the knowledge contained in the artefacts.
2261
+ * @description Unified Knowledge Graph KNOWLEDGE retrieval — facts, themes and relationships from INSIDE document CONTENT. To LOCATE AN ARTEFACT BY NAME OR ID rather than answer a question, pass artefactMetadataOnly:true — see below. Without that flag this tool retrieves knowledge from inside content and will not reliably find a thing by its title.
2262
2262
  *
2263
2263
  * PICK THE MODE THAT FITS THE QUERY:
2264
2264
  *
@@ -2278,6 +2278,9 @@ interface paths {
2278
2278
  * - User asks 'how is X connected to Y' → 'path' (with both entity IDs)
2279
2279
  * - User asks 'what's near entity X' → 'graph' (with srcEntityId)
2280
2280
  * - 'local' returned nothing useful and the question is broad → retry with 'ppr'
2281
+ * - User wants to FIND a named artefact ("the GTM plan", "DOC-123", a uuid) → artefactMetadataOnly:true
2282
+ *
2283
+ * ARTEFACT-METADATA MODE (artefactMetadataOnly:true): ignores `mode` entirely and matches title + friendly id + uuid across EVERY artefact type — documents, whiteboards, plans, tasks, improvements, compliance frameworks. Returns a typed navigable list ({ artefacts: [{ result_type, id, friendly_id, title, snippet, document_id, project_id, href }] }). It reads no document content and needs no knowledge graph: unlike every other mode it is NOT limited to what has been ingested, so it still finds artefacts in projects where the KG is switched off. Narrow it with artefactTypes. To search inside document BODIES use listDocuments (full-content grep).
2281
2284
  */
2282
2285
  post: operations["kg_search"];
2283
2286
  delete?: never;
@@ -7893,6 +7896,12 @@ interface operations {
7893
7896
  content: {
7894
7897
  "application/json": {
7895
7898
  projectId: string;
7899
+ /** @description Grep across title and friendlyId. Substring by default; a regular expression when isRegex is true. */
7900
+ query?: string;
7901
+ /** @description Treat `query` as a regular expression. */
7902
+ isRegex?: boolean;
7903
+ /** @description Match case exactly. Default false. */
7904
+ caseSensitive?: boolean;
7896
7905
  };
7897
7906
  };
7898
7907
  };
@@ -11942,18 +11951,16 @@ interface operations {
11942
11951
  requestBody?: {
11943
11952
  content: {
11944
11953
  "application/json": {
11945
- /** @description Search query — a name fragment or a friendly id. */
11954
+ /** @description Search query — meaning, a name fragment, or a friendly id (e.g. "IMP-2", "TAS-7"). */
11946
11955
  query: string;
11947
- /** @description Switches on the cross-artefact finder. Artefact types to search (subset of document, whiteboard, improvement, task, plan, compliance). Empty / all = every type. Omit entirely for the improvements-only semantic search. */
11948
- types?: ("document" | "whiteboard" | "improvement" | "task" | "plan" | "compliance")[];
11956
+ /** @description Narrow to one kind. Omit (or pass both) to search improvements and tasks together. Other artefact types are NOT accepted here — use kg_search with artefactMetadataOnly:true for those. */
11957
+ types?: ("improvement" | "task")[];
11949
11958
  /** @description Limit to a project. */
11950
11959
  projectId?: string;
11951
11960
  /** @description Limit to a workspace. */
11952
11961
  workspaceId?: string;
11953
- /** @description Max results (default 20 semantic / 30 cross-artefact, max 50). */
11962
+ /** @description Max results (default 20, max 50). */
11954
11963
  limit?: number;
11955
- /** @description Pagination offset (cross-artefact mode). */
11956
- offset?: number;
11957
11964
  };
11958
11965
  };
11959
11966
  };
@@ -14714,8 +14721,17 @@ interface operations {
14714
14721
  requestBody?: {
14715
14722
  content: {
14716
14723
  "application/json": {
14717
- /** @description Natural-language query. Required for local/global/ppr; optional for graph (use srcEntityId instead). */
14724
+ /** @description Natural-language query. Required for local/global/ppr; optional for graph (use srcEntityId instead). With artefactMetadataOnly:true this is the artefact name, friendly id or uuid to find. */
14718
14725
  query?: string;
14726
+ /**
14727
+ * @description Find artefacts BY NAME/ID instead of retrieving knowledge. Matches title + friendly id + uuid only — never document content — across all artefact types, and does not require the knowledge graph to be enabled. Default false.
14728
+ * @default false
14729
+ */
14730
+ artefactMetadataOnly?: boolean;
14731
+ /** @description Only with artefactMetadataOnly:true. Restrict the search to these artefact types. Omit to search all of them. Unknown values are rejected rather than ignored. */
14732
+ artefactTypes?: ("document" | "whiteboard" | "improvement" | "task" | "plan" | "compliance")[];
14733
+ /** @description Only with artefactMetadataOnly:true. Skip this many results for paging. */
14734
+ offset?: number;
14719
14735
  /**
14720
14736
  * @description Retrieval strategy. See tool description for when to use each — strongly prefer 'global' for thematic/overview questions.
14721
14737
  * @default local
package/openapi.json CHANGED
@@ -5396,7 +5396,7 @@
5396
5396
  "/tools/listWhiteboards": {
5397
5397
  "post": {
5398
5398
  "summary": "listWhiteboards",
5399
- "description": "List the whiteboards in a project (hidden whiteboard-kind documents). Returns documentId, diagramId, title and timestamps for each.",
5399
+ "description": "List AND grep the whiteboards in a project (hidden whiteboard-kind documents). `query` searches the title and friendlyId (substring by default; set isRegex:true for a regular expression, caseSensitive:true for exact case). This is the tool to find a board by name — listDocuments deliberately excludes whiteboards. Returns documentId, diagramId, title and timestamps for each.",
5400
5400
  "operationId": "listWhiteboards",
5401
5401
  "tags": [
5402
5402
  "whiteboards"
@@ -5410,6 +5410,18 @@
5410
5410
  "properties": {
5411
5411
  "projectId": {
5412
5412
  "type": "string"
5413
+ },
5414
+ "query": {
5415
+ "type": "string",
5416
+ "description": "Grep across title and friendlyId. Substring by default; a regular expression when isRegex is true."
5417
+ },
5418
+ "isRegex": {
5419
+ "type": "boolean",
5420
+ "description": "Treat `query` as a regular expression."
5421
+ },
5422
+ "caseSensitive": {
5423
+ "type": "boolean",
5424
+ "description": "Match case exactly. Default false."
5413
5425
  }
5414
5426
  },
5415
5427
  "required": [
@@ -11155,7 +11167,7 @@
11155
11167
  "/tools/searchImprovements": {
11156
11168
  "post": {
11157
11169
  "summary": "searchImprovements",
11158
- "description": "Locate any artefact (document / whiteboard / diagram / plan / task / improvement / compliance) by name or friendly id — AND ranked semantic search over improvements.\n\n• CROSS-ARTEFACT FINDER MODE (pass `types`): matches title + friendly id (e.g. \"DOC-123\", \"WBD-9\", \"PLN-4\", \"TAS-7\", \"IMP-2\") + description across every artefact type. Returns a typed navigable list ({ artefacts: [{ result_type, id, friendly_id, title, snippet, document_id, project_id, href }] }). This is the tool to use to find an artefact by its name or id — NOT kg_search (which retrieves knowledge from inside content). Pass types:[\"document\",\"whiteboard\",\"plan\",\"task\",\"improvement\",\"compliance\"] (or a subset) to search those types; an empty or all-inclusive list searches everything.\n\n• IMPROVEMENT SEMANTIC MODE (omit `types`): hybrid full-text + vector search over improvements only. Returns ranked { improvements }.",
11170
+ "description": "Ranked semantic search over IMPROVEMENTS AND TASKS — hybrid full-text + vector, so it matches meaning rather than just wording. Returns ranked { improvements }, each with a versionTimestamp you can pass straight to updateImprovement without a getImprovement round-trip.\n\nImprovements and tasks are one table (a task is an improvement with is_task=true), so both are searched by default. Pass types:[\"task\"] or types:[\"improvement\"] to narrow to one.\n\nThis tool searches improvements and tasks ONLY. To find a document, whiteboard, plan or compliance item by name or friendly id, use kg_search({ query, artefactMetadataOnly: true }) — it matches title + friendly id + uuid across every artefact type and needs no knowledge graph. To search document CONTENT, use listDocuments.",
11159
11171
  "operationId": "searchImprovements",
11160
11172
  "tags": [
11161
11173
  "improvements"
@@ -11169,22 +11181,18 @@
11169
11181
  "properties": {
11170
11182
  "query": {
11171
11183
  "type": "string",
11172
- "description": "Search query — a name fragment or a friendly id."
11184
+ "description": "Search query — meaning, a name fragment, or a friendly id (e.g. \"IMP-2\", \"TAS-7\")."
11173
11185
  },
11174
11186
  "types": {
11175
11187
  "type": "array",
11176
11188
  "items": {
11177
11189
  "type": "string",
11178
11190
  "enum": [
11179
- "document",
11180
- "whiteboard",
11181
11191
  "improvement",
11182
- "task",
11183
- "plan",
11184
- "compliance"
11192
+ "task"
11185
11193
  ]
11186
11194
  },
11187
- "description": "Switches on the cross-artefact finder. Artefact types to search (subset of document, whiteboard, improvement, task, plan, compliance). Empty / all = every type. Omit entirely for the improvements-only semantic search."
11195
+ "description": "Narrow to one kind. Omit (or pass both) to search improvements and tasks together. Other artefact types are NOT accepted here — use kg_search with artefactMetadataOnly:true for those."
11188
11196
  },
11189
11197
  "projectId": {
11190
11198
  "type": "string",
@@ -11196,11 +11204,7 @@
11196
11204
  },
11197
11205
  "limit": {
11198
11206
  "type": "number",
11199
- "description": "Max results (default 20 semantic / 30 cross-artefact, max 50)."
11200
- },
11201
- "offset": {
11202
- "type": "number",
11203
- "description": "Pagination offset (cross-artefact mode)."
11207
+ "description": "Max results (default 20, max 50)."
11204
11208
  }
11205
11209
  },
11206
11210
  "required": [
@@ -15083,7 +15087,7 @@
15083
15087
  "/tools/kg_search": {
15084
15088
  "post": {
15085
15089
  "summary": "kg_search",
15086
- "description": "Unified Knowledge Graph KNOWLEDGE retrieval — facts, themes and relationships from INSIDE document CONTENT. This is NOT an artefact finder: do NOT use it to locate a document / whiteboard / diagram / plan / task / improvement by its TITLE or friendly id (e.g. \"DOC-123\", \"find the GTM plan\"). For locating an artefact by name or id use listDocuments / listWhiteboards / listPlans / listTasks / searchImprovements (they match title + friendly id). Use kg_search only to ANSWER A QUESTION from the knowledge contained in the artefacts.\n\nPICK THE MODE THAT FITS THE QUERY:\n\n• mode='local' (default) — for SPECIFIC factual questions (\"what does section 15 say about deposits?\", \"who is the Chief Counsel?\"). FTS+vector RRF over individual document chunks. Returns precise excerpts with citations.\n\n• mode='global' — for THEMATIC / OVERVIEW / SUMMARY questions (\"what are the main themes\", \"give me an overview of the project\", \"what topics does this cover\"). Returns Louvain community summaries + curated wiki pages — far better than 'local' for big-picture queries because community summaries already aggregate across many chunks. ALWAYS PREFER over 'local' when the user asks for themes / summary / overview / topic landscape.\n\n• mode='graph' — for RELATIONSHIP questions (\"what's connected to entity X?\", \"who cites Section 5?\"). 1-hop entity-neighbourhood walk. Pass query OR srcEntityId.\n\n• mode='path' — for CONNECTION questions (\"how does X relate to Y?\"). Shortest path between two entities. Pass srcEntityId AND dstEntityId.\n\n• mode='ppr' — for MULTI-HOP discovery (\"what's relevant to X, even indirectly?\"). Personalised PageRank over AUTHORED-vs-EXTRACTED weighted edges, seeded by query-similar entities. Best when 'local' returns too few results and the answer requires walking through several entity hops.\n\nQuick decision tree:\n- User asks for an overview/summary/themes → 'global'\n- User asks a specific question with a clear answer → 'local'\n- User asks 'how is X connected to Y' → 'path' (with both entity IDs)\n- User asks 'what's near entity X' → 'graph' (with srcEntityId)\n- 'local' returned nothing useful and the question is broad → retry with 'ppr'",
15090
+ "description": "Unified Knowledge Graph KNOWLEDGE retrieval — facts, themes and relationships from INSIDE document CONTENT. To LOCATE AN ARTEFACT BY NAME OR ID rather than answer a question, pass artefactMetadataOnly:true — see below. Without that flag this tool retrieves knowledge from inside content and will not reliably find a thing by its title.\n\nPICK THE MODE THAT FITS THE QUERY:\n\n• mode='local' (default) — for SPECIFIC factual questions (\"what does section 15 say about deposits?\", \"who is the Chief Counsel?\"). FTS+vector RRF over individual document chunks. Returns precise excerpts with citations.\n\n• mode='global' — for THEMATIC / OVERVIEW / SUMMARY questions (\"what are the main themes\", \"give me an overview of the project\", \"what topics does this cover\"). Returns Louvain community summaries + curated wiki pages — far better than 'local' for big-picture queries because community summaries already aggregate across many chunks. ALWAYS PREFER over 'local' when the user asks for themes / summary / overview / topic landscape.\n\n• mode='graph' — for RELATIONSHIP questions (\"what's connected to entity X?\", \"who cites Section 5?\"). 1-hop entity-neighbourhood walk. Pass query OR srcEntityId.\n\n• mode='path' — for CONNECTION questions (\"how does X relate to Y?\"). Shortest path between two entities. Pass srcEntityId AND dstEntityId.\n\n• mode='ppr' — for MULTI-HOP discovery (\"what's relevant to X, even indirectly?\"). Personalised PageRank over AUTHORED-vs-EXTRACTED weighted edges, seeded by query-similar entities. Best when 'local' returns too few results and the answer requires walking through several entity hops.\n\nQuick decision tree:\n- User asks for an overview/summary/themes → 'global'\n- User asks a specific question with a clear answer → 'local'\n- User asks 'how is X connected to Y' → 'path' (with both entity IDs)\n- User asks 'what's near entity X' → 'graph' (with srcEntityId)\n- 'local' returned nothing useful and the question is broad → retry with 'ppr'\n- User wants to FIND a named artefact (\"the GTM plan\", \"DOC-123\", a uuid) → artefactMetadataOnly:true\n\nARTEFACT-METADATA MODE (artefactMetadataOnly:true): ignores `mode` entirely and matches title + friendly id + uuid across EVERY artefact type — documents, whiteboards, plans, tasks, improvements, compliance frameworks. Returns a typed navigable list ({ artefacts: [{ result_type, id, friendly_id, title, snippet, document_id, project_id, href }] }). It reads no document content and needs no knowledge graph: unlike every other mode it is NOT limited to what has been ingested, so it still finds artefacts in projects where the KG is switched off. Narrow it with artefactTypes. To search inside document BODIES use listDocuments (full-content grep).",
15087
15091
  "operationId": "kg_search",
15088
15092
  "tags": [
15089
15093
  "knowledge_graph"
@@ -15097,7 +15101,31 @@
15097
15101
  "properties": {
15098
15102
  "query": {
15099
15103
  "type": "string",
15100
- "description": "Natural-language query. Required for local/global/ppr; optional for graph (use srcEntityId instead)."
15104
+ "description": "Natural-language query. Required for local/global/ppr; optional for graph (use srcEntityId instead). With artefactMetadataOnly:true this is the artefact name, friendly id or uuid to find."
15105
+ },
15106
+ "artefactMetadataOnly": {
15107
+ "type": "boolean",
15108
+ "default": false,
15109
+ "description": "Find artefacts BY NAME/ID instead of retrieving knowledge. Matches title + friendly id + uuid only — never document content — across all artefact types, and does not require the knowledge graph to be enabled. Default false."
15110
+ },
15111
+ "artefactTypes": {
15112
+ "type": "array",
15113
+ "items": {
15114
+ "type": "string",
15115
+ "enum": [
15116
+ "document",
15117
+ "whiteboard",
15118
+ "improvement",
15119
+ "task",
15120
+ "plan",
15121
+ "compliance"
15122
+ ]
15123
+ },
15124
+ "description": "Only with artefactMetadataOnly:true. Restrict the search to these artefact types. Omit to search all of them. Unknown values are rejected rather than ignored."
15125
+ },
15126
+ "offset": {
15127
+ "type": "number",
15128
+ "description": "Only with artefactMetadataOnly:true. Skip this many results for paging."
15101
15129
  },
15102
15130
  "mode": {
15103
15131
  "type": "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stablebaseline/sdk",
3
- "version": "0.5.3",
3
+ "version": "0.6.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. 196 tools across 18 categories.",
5
5
  "homepage": "https://stablebaseline.io",
6
6
  "repository": {
@@ -855,7 +855,7 @@ export interface paths {
855
855
  put?: never;
856
856
  /**
857
857
  * listWhiteboards
858
- * @description List the whiteboards in a project (hidden whiteboard-kind documents). Returns documentId, diagramId, title and timestamps for each.
858
+ * @description List AND grep the whiteboards in a project (hidden whiteboard-kind documents). `query` searches the title and friendlyId (substring by default; set isRegex:true for a regular expression, caseSensitive:true for exact case). This is the tool to find a board by name — listDocuments deliberately excludes whiteboards. Returns documentId, diagramId, title and timestamps for each.
859
859
  */
860
860
  post: operations["listWhiteboards"];
861
861
  delete?: never;
@@ -1675,11 +1675,11 @@ export interface paths {
1675
1675
  put?: never;
1676
1676
  /**
1677
1677
  * searchImprovements
1678
- * @description Locate any artefact (document / whiteboard / diagram / plan / task / improvement / compliance) by name or friendly id — AND ranked semantic search over improvements.
1678
+ * @description Ranked semantic search over IMPROVEMENTS AND TASKS — hybrid full-text + vector, so it matches meaning rather than just wording. Returns ranked { improvements }, each with a versionTimestamp you can pass straight to updateImprovement without a getImprovement round-trip.
1679
1679
  *
1680
- * • CROSS-ARTEFACT FINDER MODE (pass `types`): matches title + friendly id (e.g. "DOC-123", "WBD-9", "PLN-4", "TAS-7", "IMP-2") + description across every artefact type. Returns a typed navigable list ({ artefacts: [{ result_type, id, friendly_id, title, snippet, document_id, project_id, href }] }). This is the tool to use to find an artefact by its name or id — NOT kg_search (which retrieves knowledge from inside content). Pass types:["document","whiteboard","plan","task","improvement","compliance"] (or a subset) to search those types; an empty or all-inclusive list searches everything.
1680
+ * Improvements and tasks are one table (a task is an improvement with is_task=true), so both are searched by default. Pass types:["task"] or types:["improvement"] to narrow to one.
1681
1681
  *
1682
- * • IMPROVEMENT SEMANTIC MODE (omit `types`): hybrid full-text + vector search over improvements only. Returns ranked { improvements }.
1682
+ * This tool searches improvements and tasks ONLY. To find a document, whiteboard, plan or compliance item by name or friendly id, use kg_search({ query, artefactMetadataOnly: true }) — it matches title + friendly id + uuid across every artefact type and needs no knowledge graph. To search document CONTENT, use listDocuments.
1683
1683
  */
1684
1684
  post: operations["searchImprovements"];
1685
1685
  delete?: never;
@@ -2259,7 +2259,7 @@ export interface paths {
2259
2259
  put?: never;
2260
2260
  /**
2261
2261
  * kg_search
2262
- * @description Unified Knowledge Graph KNOWLEDGE retrieval — facts, themes and relationships from INSIDE document CONTENT. This is NOT an artefact finder: do NOT use it to locate a document / whiteboard / diagram / plan / task / improvement by its TITLE or friendly id (e.g. "DOC-123", "find the GTM plan"). For locating an artefact by name or id use listDocuments / listWhiteboards / listPlans / listTasks / searchImprovements (they match title + friendly id). Use kg_search only to ANSWER A QUESTION from the knowledge contained in the artefacts.
2262
+ * @description Unified Knowledge Graph KNOWLEDGE retrieval — facts, themes and relationships from INSIDE document CONTENT. To LOCATE AN ARTEFACT BY NAME OR ID rather than answer a question, pass artefactMetadataOnly:true — see below. Without that flag this tool retrieves knowledge from inside content and will not reliably find a thing by its title.
2263
2263
  *
2264
2264
  * PICK THE MODE THAT FITS THE QUERY:
2265
2265
  *
@@ -2279,6 +2279,9 @@ export interface paths {
2279
2279
  * - User asks 'how is X connected to Y' → 'path' (with both entity IDs)
2280
2280
  * - User asks 'what's near entity X' → 'graph' (with srcEntityId)
2281
2281
  * - 'local' returned nothing useful and the question is broad → retry with 'ppr'
2282
+ * - User wants to FIND a named artefact ("the GTM plan", "DOC-123", a uuid) → artefactMetadataOnly:true
2283
+ *
2284
+ * ARTEFACT-METADATA MODE (artefactMetadataOnly:true): ignores `mode` entirely and matches title + friendly id + uuid across EVERY artefact type — documents, whiteboards, plans, tasks, improvements, compliance frameworks. Returns a typed navigable list ({ artefacts: [{ result_type, id, friendly_id, title, snippet, document_id, project_id, href }] }). It reads no document content and needs no knowledge graph: unlike every other mode it is NOT limited to what has been ingested, so it still finds artefacts in projects where the KG is switched off. Narrow it with artefactTypes. To search inside document BODIES use listDocuments (full-content grep).
2282
2285
  */
2283
2286
  post: operations["kg_search"];
2284
2287
  delete?: never;
@@ -7894,6 +7897,12 @@ export interface operations {
7894
7897
  content: {
7895
7898
  "application/json": {
7896
7899
  projectId: string;
7900
+ /** @description Grep across title and friendlyId. Substring by default; a regular expression when isRegex is true. */
7901
+ query?: string;
7902
+ /** @description Treat `query` as a regular expression. */
7903
+ isRegex?: boolean;
7904
+ /** @description Match case exactly. Default false. */
7905
+ caseSensitive?: boolean;
7897
7906
  };
7898
7907
  };
7899
7908
  };
@@ -11943,18 +11952,16 @@ export interface operations {
11943
11952
  requestBody?: {
11944
11953
  content: {
11945
11954
  "application/json": {
11946
- /** @description Search query — a name fragment or a friendly id. */
11955
+ /** @description Search query — meaning, a name fragment, or a friendly id (e.g. "IMP-2", "TAS-7"). */
11947
11956
  query: string;
11948
- /** @description Switches on the cross-artefact finder. Artefact types to search (subset of document, whiteboard, improvement, task, plan, compliance). Empty / all = every type. Omit entirely for the improvements-only semantic search. */
11949
- types?: ("document" | "whiteboard" | "improvement" | "task" | "plan" | "compliance")[];
11957
+ /** @description Narrow to one kind. Omit (or pass both) to search improvements and tasks together. Other artefact types are NOT accepted here — use kg_search with artefactMetadataOnly:true for those. */
11958
+ types?: ("improvement" | "task")[];
11950
11959
  /** @description Limit to a project. */
11951
11960
  projectId?: string;
11952
11961
  /** @description Limit to a workspace. */
11953
11962
  workspaceId?: string;
11954
- /** @description Max results (default 20 semantic / 30 cross-artefact, max 50). */
11963
+ /** @description Max results (default 20, max 50). */
11955
11964
  limit?: number;
11956
- /** @description Pagination offset (cross-artefact mode). */
11957
- offset?: number;
11958
11965
  };
11959
11966
  };
11960
11967
  };
@@ -14715,8 +14722,17 @@ export interface operations {
14715
14722
  requestBody?: {
14716
14723
  content: {
14717
14724
  "application/json": {
14718
- /** @description Natural-language query. Required for local/global/ppr; optional for graph (use srcEntityId instead). */
14725
+ /** @description Natural-language query. Required for local/global/ppr; optional for graph (use srcEntityId instead). With artefactMetadataOnly:true this is the artefact name, friendly id or uuid to find. */
14719
14726
  query?: string;
14727
+ /**
14728
+ * @description Find artefacts BY NAME/ID instead of retrieving knowledge. Matches title + friendly id + uuid only — never document content — across all artefact types, and does not require the knowledge graph to be enabled. Default false.
14729
+ * @default false
14730
+ */
14731
+ artefactMetadataOnly?: boolean;
14732
+ /** @description Only with artefactMetadataOnly:true. Restrict the search to these artefact types. Omit to search all of them. Unknown values are rejected rather than ignored. */
14733
+ artefactTypes?: ("document" | "whiteboard" | "improvement" | "task" | "plan" | "compliance")[];
14734
+ /** @description Only with artefactMetadataOnly:true. Skip this many results for paging. */
14735
+ offset?: number;
14720
14736
  /**
14721
14737
  * @description Retrieval strategy. See tool description for when to use each — strongly prefer 'global' for thematic/overview questions.
14722
14738
  * @default local