@superdoc-dev/sdk 1.0.0-alpha.30 → 1.0.0-alpha.32

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
@@ -94,14 +94,12 @@ client.doc.insert(params)
94
94
  The SDK includes built-in support for exposing document operations as AI tool definitions:
95
95
 
96
96
  ```ts
97
- import { chooseTools, dispatchSuperDocTool, inferDocumentFeatures } from '@superdoc-dev/sdk';
97
+ import { chooseTools, dispatchSuperDocTool } from '@superdoc-dev/sdk';
98
98
 
99
- // Get tool definitions for your AI provider
99
+ // Get tool definitions for your AI provider, filtered by group
100
100
  const { tools, selected } = await chooseTools({
101
- provider: 'openai', // 'openai' | 'anthropic' | 'vercel' | 'generic'
102
- profile: 'intent', // human-friendly tool names
103
- taskContext: { phase: 'mutate' },
104
- documentFeatures: inferDocumentFeatures(await client.doc.info()),
101
+ provider: 'openai', // 'openai' | 'anthropic' | 'vercel' | 'generic'
102
+ groups: ['core', 'format', 'comments'], // core is always auto-included
105
103
  });
106
104
 
107
105
  // Dispatch a tool call from the AI model
@@ -110,12 +108,12 @@ const result = await dispatchSuperDocTool(client, toolName, args);
110
108
 
111
109
  | Function | Description |
112
110
  |----------|-------------|
113
- | `chooseTools(input)` | Select tools filtered by phase, capabilities, and budget |
114
- | `listTools(provider, options?)` | List all tool definitions for a provider |
111
+ | `chooseTools(input)` | Select tools filtered by group for a provider |
112
+ | `listTools(provider)` | List all tool definitions for a provider |
115
113
  | `dispatchSuperDocTool(client, toolName, args)` | Execute a tool call against a client |
116
114
  | `resolveToolOperation(toolName)` | Map a tool name to its operation ID |
117
- | `getToolCatalog(options?)` | Load the full tool catalog |
118
- | `inferDocumentFeatures(infoResult)` | Derive feature flags from `doc.info` output |
115
+ | `getToolCatalog()` | Load the full tool catalog |
116
+ | `getAvailableGroups()` | List all available tool groups |
119
117
 
120
118
  ## Part of SuperDoc
121
119
 
@@ -258,6 +258,14 @@ function createDocApi(runtime) {
258
258
  setAnchorOptions: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.images.setAnchorOptions"], params, options),
259
259
  setZOrder: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.images.setZOrder"], params, options),
260
260
  },
261
+ hyperlinks: {
262
+ list: (params = {}, options) => runtime.invoke(contract.CONTRACT.operations["doc.hyperlinks.list"], params, options),
263
+ get: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.hyperlinks.get"], params, options),
264
+ wrap: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.hyperlinks.wrap"], params, options),
265
+ insert: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.hyperlinks.insert"], params, options),
266
+ patch: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.hyperlinks.patch"], params, options),
267
+ remove: (params, options) => runtime.invoke(contract.CONTRACT.operations["doc.hyperlinks.remove"], params, options),
268
+ },
261
269
  open: (params = {}, options) => runtime.invoke(contract.CONTRACT.operations["doc.open"], params, options),
262
270
  save: (params = {}, options) => runtime.invoke(contract.CONTRACT.operations["doc.save"], params, options),
263
271
  close: (params = {}, options) => runtime.invoke(contract.CONTRACT.operations["doc.close"], params, options),