@superdoc-dev/sdk 1.0.0-alpha.30 → 1.0.0-alpha.31
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 +8 -10
- package/dist/generated/client.cjs +8 -0
- package/dist/generated/client.d.ts +1010 -4
- package/dist/generated/client.d.ts.map +1 -1
- package/dist/generated/client.js +8 -0
- package/dist/generated/contract.cjs +15950 -5410
- package/dist/generated/contract.d.ts.map +1 -1
- package/dist/generated/contract.js +15950 -5410
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime/transport-common.cjs +1 -1
- package/dist/runtime/transport-common.js +1 -1
- package/dist/tools.cjs +69 -140
- package/dist/tools.d.ts +42 -65
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +68 -139
- package/package.json +6 -6
- package/tools/catalog.json +34590 -71420
- package/tools/tool-name-map.json +7 -264
- package/tools/tools-policy.json +79 -82
- package/tools/tools.anthropic.json +16805 -30495
- package/tools/tools.generic.json +35821 -71008
- package/tools/tools.openai.json +17263 -31721
- package/tools/tools.vercel.json +17263 -31721
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
|
|
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',
|
|
102
|
-
|
|
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
|
|
114
|
-
| `listTools(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(
|
|
118
|
-
| `
|
|
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),
|