@superdoc-dev/sdk 1.0.0 → 1.0.1-next.1
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/helpers/format.d.ts +16 -16
- package/dist/helpers/format.d.ts.map +1 -1
- package/dist/helpers/format.js +24 -41
- package/package.json +6 -6
- package/tools/__pycache__/__init__.cpython-312.pyc +0 -0
- package/tools/__pycache__/intent_dispatch_generated.cpython-312.pyc +0 -0
- package/tools/intent_dispatch_generated.py +2 -0
- package/tools/system-prompt.md +2 -2
- package/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- package/tools/__pycache__/intent_dispatch_generated.cpython-313.pyc +0 -0
package/dist/helpers/format.d.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* await clearBold(doc.format.apply, { blockId: 'p1', start: 0, end: 5 });
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
import type { InvokeOptions
|
|
27
|
+
import type { InvokeOptions } from '../runtime/transport-common.js';
|
|
28
28
|
export interface FormatHelperParams {
|
|
29
29
|
target?: {
|
|
30
30
|
kind: 'text';
|
|
@@ -45,33 +45,33 @@ export interface FormatHelperParams {
|
|
|
45
45
|
expectedRevision?: string;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
48
|
+
* Bound format.apply method from a document handle.
|
|
49
|
+
* Signature matches `doc.format.apply(params, options)`.
|
|
50
50
|
*/
|
|
51
|
-
type
|
|
51
|
+
type FormatApplyFn = (params?: Record<string, unknown>, options?: InvokeOptions) => Promise<unknown>;
|
|
52
52
|
/** Apply bold ON. Equivalent to `format.apply` with `inline: { bold: 'on' }`. */
|
|
53
|
-
export declare function formatBold(
|
|
53
|
+
export declare function formatBold(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
54
54
|
/** Apply italic ON. Equivalent to `format.apply` with `inline: { italic: 'on' }`. */
|
|
55
|
-
export declare function formatItalic(
|
|
55
|
+
export declare function formatItalic(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
56
56
|
/** Apply underline ON. Equivalent to `format.apply` with `inline: { underline: 'on' }`. */
|
|
57
|
-
export declare function formatUnderline(
|
|
57
|
+
export declare function formatUnderline(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
58
58
|
/** Apply strikethrough ON. Equivalent to `format.apply` with `inline: { strike: 'on' }`. */
|
|
59
|
-
export declare function formatStrikethrough(
|
|
59
|
+
export declare function formatStrikethrough(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
60
60
|
/** Apply bold OFF. Equivalent to `format.apply` with `inline: { bold: 'off' }`. */
|
|
61
|
-
export declare function unformatBold(
|
|
61
|
+
export declare function unformatBold(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
62
62
|
/** Apply italic OFF. Equivalent to `format.apply` with `inline: { italic: 'off' }`. */
|
|
63
|
-
export declare function unformatItalic(
|
|
63
|
+
export declare function unformatItalic(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
64
64
|
/** Apply underline OFF. Equivalent to `format.apply` with `inline: { underline: 'off' }`. */
|
|
65
|
-
export declare function unformatUnderline(
|
|
65
|
+
export declare function unformatUnderline(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
66
66
|
/** Apply strikethrough OFF. Equivalent to `format.apply` with `inline: { strike: 'off' }`. */
|
|
67
|
-
export declare function unformatStrikethrough(
|
|
67
|
+
export declare function unformatStrikethrough(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
68
68
|
/** Clear bold formatting. Equivalent to `format.apply` with `inline: { bold: 'clear' }`. */
|
|
69
|
-
export declare function clearBold(
|
|
69
|
+
export declare function clearBold(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
70
70
|
/** Clear italic formatting. Equivalent to `format.apply` with `inline: { italic: 'clear' }`. */
|
|
71
|
-
export declare function clearItalic(
|
|
71
|
+
export declare function clearItalic(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
72
72
|
/** Clear underline formatting. Equivalent to `format.apply` with `inline: { underline: 'clear' }`. */
|
|
73
|
-
export declare function clearUnderline(
|
|
73
|
+
export declare function clearUnderline(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
74
74
|
/** Clear strikethrough formatting. Equivalent to `format.apply` with `inline: { strike: 'clear' }`. */
|
|
75
|
-
export declare function clearStrikethrough(
|
|
75
|
+
export declare function clearStrikethrough(apply: FormatApplyFn, params?: FormatHelperParams, options?: InvokeOptions): Promise<unknown>;
|
|
76
76
|
export {};
|
|
77
77
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/helpers/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/helpers/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAClF,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;I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OAAO,CAAC,EAAE,aAAa,oBAE/G;AAED,8FAA8F;AAC9F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,GAAE,kBAAuB,EAAE,OAAO,CAAC,EAAE,aAAa,oBAEnH;AAMD,4FAA4F;AAC5F,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,GAAE,kBAAuB,EAAE,OAAO,CAAC,EAAE,aAAa,oBAEvG;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,GAAE,kBAAuB,EAAE,OAAO,CAAC,EAAE,aAAa,oBAEzG;AAED,sGAAsG;AACtG,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,GAAE,kBAAuB,EAAE,OAAO,CAAC,EAAE,aAAa,oBAE5G;AAED,uGAAuG;AACvG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,GAAE,kBAAuB,EAAE,OAAO,CAAC,EAAE,aAAa,oBAEhH"}
|
package/dist/helpers/format.js
CHANGED
|
@@ -24,23 +24,6 @@
|
|
|
24
24
|
* await clearBold(doc.format.apply, { blockId: 'p1', start: 0, end: 5 });
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
/**
|
|
28
|
-
* Minimal operation spec for `format.apply`. Used to invoke the canonical
|
|
29
|
-
* operation through the runtime without depending on generated code.
|
|
30
|
-
*
|
|
31
|
-
* doc and sessionId are omitted — the bound document handle injects them.
|
|
32
|
-
*/
|
|
33
|
-
const FORMAT_APPLY_SPEC = {
|
|
34
|
-
operationId: 'doc.format.apply',
|
|
35
|
-
commandTokens: ['format', 'apply'],
|
|
36
|
-
params: [
|
|
37
|
-
{ name: 'target', kind: 'jsonFlag', type: 'json' },
|
|
38
|
-
{ name: 'inline', kind: 'jsonFlag', type: 'json' },
|
|
39
|
-
{ name: 'dryRun', kind: 'flag', type: 'boolean' },
|
|
40
|
-
{ name: 'changeMode', kind: 'flag', type: 'string' },
|
|
41
|
-
{ name: 'expectedRevision', kind: 'flag', type: 'string' },
|
|
42
|
-
],
|
|
43
|
-
};
|
|
44
27
|
/**
|
|
45
28
|
* Normalizes flat-flag shorthand params (blockId, start, end) into a
|
|
46
29
|
* canonical `target` object. If `target` is already provided, flat flags
|
|
@@ -63,56 +46,56 @@ function mergeInlineStyles(params, inline) {
|
|
|
63
46
|
// format* helpers — apply ON directive
|
|
64
47
|
// ---------------------------------------------------------------------------
|
|
65
48
|
/** Apply bold ON. Equivalent to `format.apply` with `inline: { bold: 'on' }`. */
|
|
66
|
-
export function formatBold(
|
|
67
|
-
return
|
|
49
|
+
export function formatBold(apply, params = {}, options) {
|
|
50
|
+
return apply(mergeInlineStyles(params, { bold: 'on' }), options);
|
|
68
51
|
}
|
|
69
52
|
/** Apply italic ON. Equivalent to `format.apply` with `inline: { italic: 'on' }`. */
|
|
70
|
-
export function formatItalic(
|
|
71
|
-
return
|
|
53
|
+
export function formatItalic(apply, params = {}, options) {
|
|
54
|
+
return apply(mergeInlineStyles(params, { italic: 'on' }), options);
|
|
72
55
|
}
|
|
73
56
|
/** Apply underline ON. Equivalent to `format.apply` with `inline: { underline: 'on' }`. */
|
|
74
|
-
export function formatUnderline(
|
|
75
|
-
return
|
|
57
|
+
export function formatUnderline(apply, params = {}, options) {
|
|
58
|
+
return apply(mergeInlineStyles(params, { underline: 'on' }), options);
|
|
76
59
|
}
|
|
77
60
|
/** Apply strikethrough ON. Equivalent to `format.apply` with `inline: { strike: 'on' }`. */
|
|
78
|
-
export function formatStrikethrough(
|
|
79
|
-
return
|
|
61
|
+
export function formatStrikethrough(apply, params = {}, options) {
|
|
62
|
+
return apply(mergeInlineStyles(params, { strike: 'on' }), options);
|
|
80
63
|
}
|
|
81
64
|
// ---------------------------------------------------------------------------
|
|
82
65
|
// unformat* helpers — apply explicit OFF directive (style override)
|
|
83
66
|
// ---------------------------------------------------------------------------
|
|
84
67
|
/** Apply bold OFF. Equivalent to `format.apply` with `inline: { bold: 'off' }`. */
|
|
85
|
-
export function unformatBold(
|
|
86
|
-
return
|
|
68
|
+
export function unformatBold(apply, params = {}, options) {
|
|
69
|
+
return apply(mergeInlineStyles(params, { bold: 'off' }), options);
|
|
87
70
|
}
|
|
88
71
|
/** Apply italic OFF. Equivalent to `format.apply` with `inline: { italic: 'off' }`. */
|
|
89
|
-
export function unformatItalic(
|
|
90
|
-
return
|
|
72
|
+
export function unformatItalic(apply, params = {}, options) {
|
|
73
|
+
return apply(mergeInlineStyles(params, { italic: 'off' }), options);
|
|
91
74
|
}
|
|
92
75
|
/** Apply underline OFF. Equivalent to `format.apply` with `inline: { underline: 'off' }`. */
|
|
93
|
-
export function unformatUnderline(
|
|
94
|
-
return
|
|
76
|
+
export function unformatUnderline(apply, params = {}, options) {
|
|
77
|
+
return apply(mergeInlineStyles(params, { underline: 'off' }), options);
|
|
95
78
|
}
|
|
96
79
|
/** Apply strikethrough OFF. Equivalent to `format.apply` with `inline: { strike: 'off' }`. */
|
|
97
|
-
export function unformatStrikethrough(
|
|
98
|
-
return
|
|
80
|
+
export function unformatStrikethrough(apply, params = {}, options) {
|
|
81
|
+
return apply(mergeInlineStyles(params, { strike: 'off' }), options);
|
|
99
82
|
}
|
|
100
83
|
// ---------------------------------------------------------------------------
|
|
101
84
|
// clear* helpers — remove direct formatting (inherit from style cascade)
|
|
102
85
|
// ---------------------------------------------------------------------------
|
|
103
86
|
/** Clear bold formatting. Equivalent to `format.apply` with `inline: { bold: 'clear' }`. */
|
|
104
|
-
export function clearBold(
|
|
105
|
-
return
|
|
87
|
+
export function clearBold(apply, params = {}, options) {
|
|
88
|
+
return apply(mergeInlineStyles(params, { bold: 'clear' }), options);
|
|
106
89
|
}
|
|
107
90
|
/** Clear italic formatting. Equivalent to `format.apply` with `inline: { italic: 'clear' }`. */
|
|
108
|
-
export function clearItalic(
|
|
109
|
-
return
|
|
91
|
+
export function clearItalic(apply, params = {}, options) {
|
|
92
|
+
return apply(mergeInlineStyles(params, { italic: 'clear' }), options);
|
|
110
93
|
}
|
|
111
94
|
/** Clear underline formatting. Equivalent to `format.apply` with `inline: { underline: 'clear' }`. */
|
|
112
|
-
export function clearUnderline(
|
|
113
|
-
return
|
|
95
|
+
export function clearUnderline(apply, params = {}, options) {
|
|
96
|
+
return apply(mergeInlineStyles(params, { underline: 'clear' }), options);
|
|
114
97
|
}
|
|
115
98
|
/** Clear strikethrough formatting. Equivalent to `format.apply` with `inline: { strike: 'clear' }`. */
|
|
116
|
-
export function clearStrikethrough(
|
|
117
|
-
return
|
|
99
|
+
export function clearStrikethrough(apply, params = {}, options) {
|
|
100
|
+
return apply(mergeInlineStyles(params, { strike: 'clear' }), options);
|
|
118
101
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-next.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"typescript": "^5.9.2"
|
|
27
27
|
},
|
|
28
28
|
"optionalDependencies": {
|
|
29
|
-
"@superdoc-dev/sdk-darwin-
|
|
30
|
-
"@superdoc-dev/sdk-
|
|
31
|
-
"@superdoc-dev/sdk-
|
|
32
|
-
"@superdoc-dev/sdk-linux-
|
|
33
|
-
"@superdoc-dev/sdk-
|
|
29
|
+
"@superdoc-dev/sdk-darwin-arm64": "1.0.1-next.1",
|
|
30
|
+
"@superdoc-dev/sdk-darwin-x64": "1.0.1-next.1",
|
|
31
|
+
"@superdoc-dev/sdk-windows-x64": "1.0.1-next.1",
|
|
32
|
+
"@superdoc-dev/sdk-linux-x64": "1.0.1-next.1",
|
|
33
|
+
"@superdoc-dev/sdk-linux-arm64": "1.0.1-next.1"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
Binary file
|
|
Binary file
|
|
@@ -21,6 +21,8 @@ def dispatch_intent_tool(
|
|
|
21
21
|
return execute('doc.getHtml', rest)
|
|
22
22
|
elif action == 'info':
|
|
23
23
|
return execute('doc.info', rest)
|
|
24
|
+
elif action == 'blocks':
|
|
25
|
+
return execute('doc.blocks.list', rest)
|
|
24
26
|
else:
|
|
25
27
|
raise SuperDocError(f'Unknown action for superdoc_get_content: {action}', code='TOOL_DISPATCH_NOT_FOUND', details={'toolName': 'superdoc_get_content', 'action': action})
|
|
26
28
|
elif tool_name == 'superdoc_edit':
|
package/tools/system-prompt.md
CHANGED
|
@@ -129,9 +129,9 @@ To add a comment on specific text:
|
|
|
129
129
|
|
|
130
130
|
**Only pass `action`, `text`, and `target` for creating a new comment.** Do not pass other params — they belong to different comment actions.
|
|
131
131
|
|
|
132
|
-
### Resolving
|
|
132
|
+
### Resolving comments
|
|
133
133
|
|
|
134
|
-
To resolve a comment, use `action: "update"` with `{ commentId: "<id>", status: "resolved" }`.
|
|
134
|
+
To resolve a comment, use `action: "update"` with `{ commentId: "<id>", status: "resolved" }`. There is no separate resolve action — it's a status field on the `update` action.
|
|
135
135
|
|
|
136
136
|
## Important rules
|
|
137
137
|
|
|
Binary file
|
|
Binary file
|