@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 +20 -10
- package/dist/generated/client.cjs +8 -0
- package/dist/generated/client.d.ts +2039 -678
- package/dist/generated/client.d.ts.map +1 -1
- package/dist/generated/client.js +8 -0
- package/dist/generated/contract.cjs +19497 -9209
- package/dist/generated/contract.d.ts.map +1 -1
- package/dist/generated/contract.js +19497 -9209
- package/dist/generated/intent-dispatch.generated.cjs +93 -0
- package/dist/generated/intent-dispatch.generated.d.ts +2 -0
- package/dist/generated/intent-dispatch.generated.d.ts.map +1 -0
- package/dist/generated/intent-dispatch.generated.js +89 -0
- package/dist/index.cjs +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/tools.cjs +135 -211
- package/dist/tools.d.ts +17 -55
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +134 -209
- package/package.json +7 -6
- package/tools/__pycache__/__init__.cpython-312.pyc +0 -0
- package/tools/__pycache__/intent_dispatch_generated.cpython-312.pyc +0 -0
- package/tools/catalog.json +3699 -62897
- package/tools/intent_dispatch_generated.py +120 -0
- package/tools/system-prompt.md +94 -0
- package/tools/tools-policy.json +40 -95
- package/tools/tools.anthropic.json +3004 -26458
- package/tools/tools.generic.json +3543 -60785
- package/tools/tools.openai.json +2988 -27393
- package/tools/tools.vercel.json +2988 -27393
- package/tools/tool-name-map.json +0 -327
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
|
|
94
|
+
The SDK includes built-in support for exposing grouped intent tools as AI tool definitions:
|
|
95
95
|
|
|
96
96
|
```ts
|
|
97
|
-
import {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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)` |
|
|
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
|
-
| `
|
|
115
|
-
| `
|
|
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),
|