@superdoc-dev/sdk 1.0.0-alpha.44 → 1.0.0-alpha.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -91,29 +91,39 @@ client.doc.insert(params)
91
91
 
92
92
  ### AI Tool Integration
93
93
 
94
- The SDK includes built-in support for exposing document operations as AI tool definitions:
94
+ The SDK includes built-in support for exposing grouped intent tools as AI tool definitions:
95
95
 
96
96
  ```ts
97
- import { chooseTools, dispatchSuperDocTool } from '@superdoc-dev/sdk';
98
-
99
- // Get tool definitions for your AI provider, filtered by group
100
- const { tools, selected } = await chooseTools({
97
+ import {
98
+ chooseTools,
99
+ dispatchSuperDocTool,
100
+ getToolCatalog,
101
+ } from '@superdoc-dev/sdk';
102
+
103
+ // Get the full grouped tool set for your AI provider
104
+ const { tools, meta } = await chooseTools({
101
105
  provider: 'openai', // 'openai' | 'anthropic' | 'vercel' | 'generic'
102
- groups: ['core', 'format', 'comments'], // core is always auto-included
103
106
  });
104
107
 
108
+ // Optional: inspect the generated tool catalog
109
+ const catalog = await getToolCatalog();
110
+
105
111
  // Dispatch a tool call from the AI model
106
112
  const result = await dispatchSuperDocTool(client, toolName, args);
107
113
  ```
108
114
 
115
+ The current catalog contains 9 grouped tools:
116
+ `superdoc_get_content`, `superdoc_edit`, `superdoc_format`, `superdoc_create`, `superdoc_list`, `superdoc_comment`, `superdoc_track_changes`, `superdoc_search`, and `superdoc_mutations`.
117
+
118
+ Multi-action tools use an `action` field to select the underlying operation. Single-action tools like `superdoc_search` do not require `action`.
119
+
109
120
  | Function | Description |
110
121
  |----------|-------------|
111
- | `chooseTools(input)` | Select tools filtered by group for a provider |
122
+ | `chooseTools(input)` | Load grouped tool definitions for a provider |
112
123
  | `listTools(provider)` | List all tool definitions for a provider |
113
124
  | `dispatchSuperDocTool(client, toolName, args)` | Execute a tool call against a client |
114
- | `resolveToolOperation(toolName)` | Map a tool name to its operation ID |
115
- | `getToolCatalog()` | Load the full tool catalog |
116
- | `getAvailableGroups()` | List all available tool groups |
125
+ | `getToolCatalog()` | Load the grouped tool catalog with metadata |
126
+ | `getSystemPrompt()` | Read the bundled system prompt for intent tools |
117
127
 
118
128
  ## Part of SuperDoc
119
129
 
@@ -187,6 +187,9 @@ function createDocApi(runtime) {
187
187
  query: {
188
188
  match: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.query.match"], params, options),
189
189
  },
190
+ ranges: {
191
+ resolve: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.ranges.resolve"], params, options),
192
+ },
190
193
  mutations: {
191
194
  preview: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.mutations.preview"], params, options),
192
195
  apply: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.mutations.apply"], params, options),
@@ -463,6 +466,11 @@ function createDocApi(runtime) {
463
466
  remove: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.authorities.entries.remove"], params, options),
464
467
  },
465
468
  },
469
+ diff: {
470
+ capture: (params = {}, options) => runtime.invoke(contract.CONTRACT.operations["doc.diff.capture"], params, options),
471
+ compare: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.diff.compare"], params, options),
472
+ apply: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.diff.apply"], params, options),
473
+ },
466
474
  open: (params = {}, options) => runtime.invoke(contract.CONTRACT.operations["doc.open"], params, options),
467
475
  save: (params = {}, options) => runtime.invoke(contract.CONTRACT.operations["doc.save"], params, options),
468
476
  close: (params = {}, options) => runtime.invoke(contract.CONTRACT.operations["doc.close"], params, options),