@superdoc/sdk 2.13.1-next.1 → 2.13.1-next.3
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/action-primitives/tools/structure-insert.cjs +24 -19
- package/dist/action-primitives/tools/structure-insert.js +24 -19
- package/dist/agent/action-change-mode.cjs +35 -0
- package/dist/agent/action-change-mode.d.ts +3 -0
- package/dist/agent/action-change-mode.js +30 -0
- package/dist/agent/actions.cjs +59 -59
- package/dist/agent/actions.d.ts +10 -7
- package/dist/agent/actions.js +59 -59
- package/dist/embedded-prompts.generated.cjs +1 -1
- package/dist/embedded-prompts.generated.js +1 -1
- package/dist/generated/client.d.ts +2 -0
- package/dist/generated/contract.cjs +27 -10
- package/dist/generated/contract.js +27 -10
- package/dist/presets/core.cjs +9 -1
- package/dist/presets/core.js +10 -2
- package/dist/prompts/system-prompt.md +8 -8
- package/dist/runtime/sdk-version.generated.cjs +1 -1
- package/dist/runtime/sdk-version.generated.d.ts +1 -1
- package/dist/runtime/sdk-version.generated.js +1 -1
- package/dist/runtime/transport-common.cjs +7 -1
- package/dist/runtime/transport-common.js +7 -1
- package/package.json +6 -6
- package/tools/tools-policy.json +1 -1
|
@@ -325,7 +325,9 @@ const CONTRACT = {
|
|
|
325
325
|
"stability": "stable",
|
|
326
326
|
"mutates": true,
|
|
327
327
|
"requiresDocumentContext": true,
|
|
328
|
-
"capabilities": [
|
|
328
|
+
"capabilities": [
|
|
329
|
+
"dryRun"
|
|
330
|
+
],
|
|
329
331
|
"aliases": [],
|
|
330
332
|
"examples": [],
|
|
331
333
|
"errors": [
|
|
@@ -22857,6 +22859,13 @@ const CONTRACT = {
|
|
|
22857
22859
|
"type": "string"
|
|
22858
22860
|
},
|
|
22859
22861
|
"description": "Edit mode: \"direct\" applies changes immediately, \"tracked\" records as suggestions."
|
|
22862
|
+
},
|
|
22863
|
+
{
|
|
22864
|
+
"name": "dryRun",
|
|
22865
|
+
"kind": "flag",
|
|
22866
|
+
"type": "boolean",
|
|
22867
|
+
"flag": "dry-run",
|
|
22868
|
+
"description": "Preview the result without applying changes."
|
|
22860
22869
|
}
|
|
22861
22870
|
],
|
|
22862
22871
|
"constraints": null,
|
|
@@ -22865,7 +22874,7 @@ const CONTRACT = {
|
|
|
22865
22874
|
"idempotency": "conditional",
|
|
22866
22875
|
"supportsTrackedMode": false,
|
|
22867
22876
|
"supportsConditionalTrackedMode": false,
|
|
22868
|
-
"supportsDryRun":
|
|
22877
|
+
"supportsDryRun": true,
|
|
22869
22878
|
"inputSchema": {
|
|
22870
22879
|
"type": "object",
|
|
22871
22880
|
"properties": {},
|
|
@@ -250118,7 +250127,8 @@ const CONTRACT = {
|
|
|
250118
250127
|
"type": "string"
|
|
250119
250128
|
},
|
|
250120
250129
|
"rel": {
|
|
250121
|
-
"type": "string"
|
|
250130
|
+
"type": "string",
|
|
250131
|
+
"description": "Browser relationship tokens for the current editing session. Not restored from DOCX."
|
|
250122
250132
|
}
|
|
250123
250133
|
},
|
|
250124
250134
|
"additionalProperties": false
|
|
@@ -250316,7 +250326,8 @@ const CONTRACT = {
|
|
|
250316
250326
|
"type": "string"
|
|
250317
250327
|
},
|
|
250318
250328
|
"rel": {
|
|
250319
|
-
"type": "string"
|
|
250329
|
+
"type": "string",
|
|
250330
|
+
"description": "Browser relationship tokens for the current editing session. Not restored from DOCX."
|
|
250320
250331
|
}
|
|
250321
250332
|
},
|
|
250322
250333
|
"additionalProperties": false
|
|
@@ -250640,7 +250651,8 @@ const CONTRACT = {
|
|
|
250640
250651
|
"type": "string"
|
|
250641
250652
|
},
|
|
250642
250653
|
"rel": {
|
|
250643
|
-
"type": "string"
|
|
250654
|
+
"type": "string",
|
|
250655
|
+
"description": "Browser relationship tokens kept for the current editing session; not persisted in DOCX or reviewed by Word."
|
|
250644
250656
|
}
|
|
250645
250657
|
},
|
|
250646
250658
|
"required": [
|
|
@@ -250687,7 +250699,8 @@ const CONTRACT = {
|
|
|
250687
250699
|
"type": "string"
|
|
250688
250700
|
},
|
|
250689
250701
|
"rel": {
|
|
250690
|
-
"type": "string"
|
|
250702
|
+
"type": "string",
|
|
250703
|
+
"description": "Browser relationship tokens kept for the current editing session; not persisted in DOCX or reviewed by Word."
|
|
250691
250704
|
}
|
|
250692
250705
|
},
|
|
250693
250706
|
"additionalProperties": false,
|
|
@@ -251163,7 +251176,8 @@ const CONTRACT = {
|
|
|
251163
251176
|
"type": "string"
|
|
251164
251177
|
},
|
|
251165
251178
|
"rel": {
|
|
251166
|
-
"type": "string"
|
|
251179
|
+
"type": "string",
|
|
251180
|
+
"description": "Browser relationship tokens kept for the current editing session; not persisted in DOCX or reviewed by Word."
|
|
251167
251181
|
}
|
|
251168
251182
|
},
|
|
251169
251183
|
"required": [
|
|
@@ -251213,7 +251227,8 @@ const CONTRACT = {
|
|
|
251213
251227
|
"type": "string"
|
|
251214
251228
|
},
|
|
251215
251229
|
"rel": {
|
|
251216
|
-
"type": "string"
|
|
251230
|
+
"type": "string",
|
|
251231
|
+
"description": "Browser relationship tokens kept for the current editing session; not persisted in DOCX or reviewed by Word."
|
|
251217
251232
|
}
|
|
251218
251233
|
},
|
|
251219
251234
|
"additionalProperties": false,
|
|
@@ -251567,7 +251582,8 @@ const CONTRACT = {
|
|
|
251567
251582
|
{
|
|
251568
251583
|
"type": "json"
|
|
251569
251584
|
}
|
|
251570
|
-
]
|
|
251585
|
+
],
|
|
251586
|
+
"description": "Session-only browser relationship tokens. Null or an empty string clears them; omission preserves them. Changes are undoable but do not create Word revisions."
|
|
251571
251587
|
}
|
|
251572
251588
|
}
|
|
251573
251589
|
}
|
|
@@ -251664,7 +251680,8 @@ const CONTRACT = {
|
|
|
251664
251680
|
{
|
|
251665
251681
|
"type": "null"
|
|
251666
251682
|
}
|
|
251667
|
-
]
|
|
251683
|
+
],
|
|
251684
|
+
"description": "Session-only browser relationship tokens. Null or an empty string clears them; omission preserves them. Changes are undoable but do not create Word revisions."
|
|
251668
251685
|
}
|
|
251669
251686
|
},
|
|
251670
251687
|
"additionalProperties": false
|
|
@@ -3242,7 +3242,9 @@ export const CONTRACT = {
|
|
|
3242
3242
|
"stability": "stable",
|
|
3243
3243
|
"mutates": true,
|
|
3244
3244
|
"requiresDocumentContext": true,
|
|
3245
|
-
"capabilities": [
|
|
3245
|
+
"capabilities": [
|
|
3246
|
+
"dryRun"
|
|
3247
|
+
],
|
|
3246
3248
|
"aliases": [],
|
|
3247
3249
|
"examples": [],
|
|
3248
3250
|
"errors": [
|
|
@@ -25774,6 +25776,13 @@ export const CONTRACT = {
|
|
|
25774
25776
|
"type": "string"
|
|
25775
25777
|
},
|
|
25776
25778
|
"description": "Edit mode: \"direct\" applies changes immediately, \"tracked\" records as suggestions."
|
|
25779
|
+
},
|
|
25780
|
+
{
|
|
25781
|
+
"name": "dryRun",
|
|
25782
|
+
"kind": "flag",
|
|
25783
|
+
"type": "boolean",
|
|
25784
|
+
"flag": "dry-run",
|
|
25785
|
+
"description": "Preview the result without applying changes."
|
|
25777
25786
|
}
|
|
25778
25787
|
],
|
|
25779
25788
|
"constraints": null,
|
|
@@ -25782,7 +25791,7 @@ export const CONTRACT = {
|
|
|
25782
25791
|
"idempotency": "conditional",
|
|
25783
25792
|
"supportsTrackedMode": false,
|
|
25784
25793
|
"supportsConditionalTrackedMode": false,
|
|
25785
|
-
"supportsDryRun":
|
|
25794
|
+
"supportsDryRun": true,
|
|
25786
25795
|
"inputSchema": {
|
|
25787
25796
|
"type": "object",
|
|
25788
25797
|
"properties": {},
|
|
@@ -253035,7 +253044,8 @@ export const CONTRACT = {
|
|
|
253035
253044
|
"type": "string"
|
|
253036
253045
|
},
|
|
253037
253046
|
"rel": {
|
|
253038
|
-
"type": "string"
|
|
253047
|
+
"type": "string",
|
|
253048
|
+
"description": "Browser relationship tokens for the current editing session. Not restored from DOCX."
|
|
253039
253049
|
}
|
|
253040
253050
|
},
|
|
253041
253051
|
"additionalProperties": false
|
|
@@ -253233,7 +253243,8 @@ export const CONTRACT = {
|
|
|
253233
253243
|
"type": "string"
|
|
253234
253244
|
},
|
|
253235
253245
|
"rel": {
|
|
253236
|
-
"type": "string"
|
|
253246
|
+
"type": "string",
|
|
253247
|
+
"description": "Browser relationship tokens for the current editing session. Not restored from DOCX."
|
|
253237
253248
|
}
|
|
253238
253249
|
},
|
|
253239
253250
|
"additionalProperties": false
|
|
@@ -253557,7 +253568,8 @@ export const CONTRACT = {
|
|
|
253557
253568
|
"type": "string"
|
|
253558
253569
|
},
|
|
253559
253570
|
"rel": {
|
|
253560
|
-
"type": "string"
|
|
253571
|
+
"type": "string",
|
|
253572
|
+
"description": "Browser relationship tokens kept for the current editing session; not persisted in DOCX or reviewed by Word."
|
|
253561
253573
|
}
|
|
253562
253574
|
},
|
|
253563
253575
|
"required": [
|
|
@@ -253604,7 +253616,8 @@ export const CONTRACT = {
|
|
|
253604
253616
|
"type": "string"
|
|
253605
253617
|
},
|
|
253606
253618
|
"rel": {
|
|
253607
|
-
"type": "string"
|
|
253619
|
+
"type": "string",
|
|
253620
|
+
"description": "Browser relationship tokens kept for the current editing session; not persisted in DOCX or reviewed by Word."
|
|
253608
253621
|
}
|
|
253609
253622
|
},
|
|
253610
253623
|
"additionalProperties": false,
|
|
@@ -254080,7 +254093,8 @@ export const CONTRACT = {
|
|
|
254080
254093
|
"type": "string"
|
|
254081
254094
|
},
|
|
254082
254095
|
"rel": {
|
|
254083
|
-
"type": "string"
|
|
254096
|
+
"type": "string",
|
|
254097
|
+
"description": "Browser relationship tokens kept for the current editing session; not persisted in DOCX or reviewed by Word."
|
|
254084
254098
|
}
|
|
254085
254099
|
},
|
|
254086
254100
|
"required": [
|
|
@@ -254130,7 +254144,8 @@ export const CONTRACT = {
|
|
|
254130
254144
|
"type": "string"
|
|
254131
254145
|
},
|
|
254132
254146
|
"rel": {
|
|
254133
|
-
"type": "string"
|
|
254147
|
+
"type": "string",
|
|
254148
|
+
"description": "Browser relationship tokens kept for the current editing session; not persisted in DOCX or reviewed by Word."
|
|
254134
254149
|
}
|
|
254135
254150
|
},
|
|
254136
254151
|
"additionalProperties": false,
|
|
@@ -254484,7 +254499,8 @@ export const CONTRACT = {
|
|
|
254484
254499
|
{
|
|
254485
254500
|
"type": "json"
|
|
254486
254501
|
}
|
|
254487
|
-
]
|
|
254502
|
+
],
|
|
254503
|
+
"description": "Session-only browser relationship tokens. Null or an empty string clears them; omission preserves them. Changes are undoable but do not create Word revisions."
|
|
254488
254504
|
}
|
|
254489
254505
|
}
|
|
254490
254506
|
}
|
|
@@ -254581,7 +254597,8 @@ export const CONTRACT = {
|
|
|
254581
254597
|
{
|
|
254582
254598
|
"type": "null"
|
|
254583
254599
|
}
|
|
254584
|
-
]
|
|
254600
|
+
],
|
|
254601
|
+
"description": "Session-only browser relationship tokens. Null or an empty string clears them; omission preserves them. Changes are undoable but do not create Word revisions."
|
|
254585
254602
|
}
|
|
254586
254603
|
},
|
|
254587
254604
|
"additionalProperties": false
|
package/dist/presets/core.cjs
CHANGED
|
@@ -337,7 +337,15 @@ async function dispatchAgentToolInner(documentHandle, toolName, args, invokeOpti
|
|
|
337
337
|
case 'agent_operation':
|
|
338
338
|
return runtime.agentOperation(documentHandle, args);
|
|
339
339
|
case 'superdoc_perform_action':
|
|
340
|
-
return compactAgentReceipt(await actions.superdocPerformAction(documentHandle,
|
|
340
|
+
return compactAgentReceipt(await actions.superdocPerformAction(documentHandle, {
|
|
341
|
+
...args,
|
|
342
|
+
...(args.changeMode === undefined &&
|
|
343
|
+
invokeOptions?.changeMode !== undefined &&
|
|
344
|
+
actions.isActionName(args.action) &&
|
|
345
|
+
actions.ACTION_ARGS[args.action].includes('changeMode')
|
|
346
|
+
? { changeMode: invokeOptions.changeMode }
|
|
347
|
+
: {}),
|
|
348
|
+
}));
|
|
341
349
|
case 'superdoc_execute_code':
|
|
342
350
|
return dispatchExecuteCode(documentHandle, args, invokeOptions);
|
|
343
351
|
}
|
package/dist/presets/core.js
CHANGED
|
@@ -20,7 +20,7 @@ import { SuperDocCliError } from '../runtime/errors.js';
|
|
|
20
20
|
import { writeSdkDebugTrace } from '../runtime/debug-trace.js';
|
|
21
21
|
import { AGENT_TOOL_DEFINITIONS, isAgentToolName, listAgentTools, resolveActionPolicy, PUBLIC_AGENT_TOOL_NAMES, } from '../agent/catalog.js';
|
|
22
22
|
import { agentApply, agentInspect, agentOperation, agentVerify } from '../agent/runtime.js';
|
|
23
|
-
import { ACTION_DISPOSITIONS, isActionName, superdocPerformAction } from '../agent/actions.js';
|
|
23
|
+
import { ACTION_ARGS, ACTION_DISPOSITIONS, isActionName, superdocPerformAction } from '../agent/actions.js';
|
|
24
24
|
import { EMBEDDED_PROMPTS } from '../embedded-prompts.generated.js';
|
|
25
25
|
// Prompts ship as <dist>/prompts/*.md. Resolve relative to the compiled
|
|
26
26
|
// module, but the module's depth differs by build: in the SDK package this
|
|
@@ -333,7 +333,15 @@ async function dispatchAgentToolInner(documentHandle, toolName, args, invokeOpti
|
|
|
333
333
|
case 'agent_operation':
|
|
334
334
|
return agentOperation(documentHandle, args);
|
|
335
335
|
case 'superdoc_perform_action':
|
|
336
|
-
return compactAgentReceipt(await superdocPerformAction(documentHandle,
|
|
336
|
+
return compactAgentReceipt(await superdocPerformAction(documentHandle, {
|
|
337
|
+
...args,
|
|
338
|
+
...(args.changeMode === undefined &&
|
|
339
|
+
invokeOptions?.changeMode !== undefined &&
|
|
340
|
+
isActionName(args.action) &&
|
|
341
|
+
ACTION_ARGS[args.action].includes('changeMode')
|
|
342
|
+
? { changeMode: invokeOptions.changeMode }
|
|
343
|
+
: {}),
|
|
344
|
+
}));
|
|
337
345
|
case 'superdoc_execute_code':
|
|
338
346
|
return dispatchExecuteCode(documentHandle, args, invokeOptions);
|
|
339
347
|
}
|
|
@@ -44,7 +44,7 @@ ACTIONS (superdoc_perform_action with flat args)
|
|
|
44
44
|
- append_list: items (string array), kind:"ordered"|"bullet". headingText/headingLevel only if asked for a heading above. placement:{at:"after"|"before",selector:{...}} builds the list at that block instead of document end — when the list belongs inside a section, ALWAYS pass placement. The receipt's placement-honored check is the truth.
|
|
45
45
|
- add_list_items: entries:[{text, level?}] (level relative to the anchor: 0 = same level, 1 = nested sub-item) — or items:[…] plain strings at the list level. Locate the list by anchorText (text inside one of its items) or listOrdinal (1-based). THE way to ADD items into an EXISTING list — reuses its numbering + markers, matches the anchor item's font/size/bold/colour automatically (receipt.formattingMatched — do NOT re-format after adding unless asked), joins imported list-looking paragraphs in place, and is tracked-safe. NOT append_list (which starts a brand-new list).
|
|
46
46
|
- convert_list: kind:"ordered"|"bullet", with listOrdinal or anchorText for real lists, OR fromMarker+toMarker (rendered clause numbers from inspect, e.g. "2.1.", "2.3.") for NUMBERED-CLAUSE ranges — including heading-styled clauses, OR fromText+toText (exact text inside the FIRST and LAST of consecutive plain paragraphs) to convert existing paragraphs into a list IN PLACE. Sub-clauses in range included automatically. THE way to convert numbering<->bullets AND the way to make existing paragraphs a list; never rewrite text to fake it, never recreate-the-content-then-delete-the-originals (two chances to lose text — convert_list fromText/toText is one lossless call).
|
|
47
|
-
- split_list: anchorText (text inside the item that should START the second list), restartNumbering? (default true). Splits ONE list into two at that item — the new list restarts at 1, nested sub-items stay with their parent. THE way to "split the list starting at item N into a new list with reset numbering"; never fake it with convert_list/attach_numbering.
|
|
47
|
+
- split_list: anchorText (text inside the item that should START the second list), restartNumbering? (default true). Splits ONE list into two at that item — the new list restarts at 1, nested sub-items stay with their parent. THE way to "split the list starting at item N into a new list with reset numbering"; never fake it with convert_list/attach_numbering. changeMode:"tracked" records the change for review.
|
|
48
48
|
- undo_changes: untilMarker (rendered marker from the original state, e.g. "2.1.") or steps (1-25). Deterministic revert — steps history back until the marker reappears; the receipt proves it. NEVER use steps > 1 blindly: prefer untilMarker, and after ANY undo verify (superdoc_inspect) that content you meant to KEEP still exists — if you overshot, redo_changes {steps:N} steps forward again to recover it.
|
|
49
49
|
- redo_changes: steps (1-25, default 1). Steps history FORWARD to re-apply edits a prior undo removed — THE recovery for an undo overshoot. Only reaches the forward branch until a NEW edit is made.
|
|
50
50
|
- attach_numbering: anchorText (text of the block) or nodeId, likeMarker (rendered marker of a sibling clause, e.g. "10."). Makes an EXISTING block a numbered clause at the same scheme/level — "make this the section 11 heading" in a clause-numbered document is exactly this (it will render as the next number).
|
|
@@ -59,21 +59,21 @@ ACTIONS (superdoc_perform_action with flat args)
|
|
|
59
59
|
- resolve_comments: anchorText? (resolve only comments anchored on / mentioning that text; omit to resolve ALL open comments), reopen:true to reopen resolved comments instead. THE way to "resolve the comment(s)" / "mark comments resolved".
|
|
60
60
|
- accept_tracked_changes / reject_tracked_changes: id:"change-id" or id:["id1","id2"] for one atomic set, OR optional author:"Full Name" / changeType:"insert"|"delete"|"replacement"|"format" to filter. Do not combine id with author/changeType. "Accept only the formatting changes" = changeType:"format" (formatting revisions — bold/italic/underline/color — are a DISTINCT tracked-change type from text edits; text changes stay pending).
|
|
61
61
|
- format_text: bold/italic/underline/strike:true, highlight:"yellow", color (named or hex), fontSize — applied to EVERY occurrence of targetText (or targetTexts:["…","…"] for several phrases in one call; or selector for a whole block). caseSensitive:true for exact case. changeMode:"tracked" produces format-type tracked changes. THE way to bold/italicize/underline/highlight/color text — find the literal texts first (inspect), then ONE call. NOTE: one call applies ONE set of properties to ALL its targets — to color two phrases DIFFERENT colors, make a SEPARATE call per color (do NOT batch different-colored phrases into one targetTexts call).
|
|
62
|
-
- apply_style: selector (the block to restyle), then ONE of styleId ("Heading2"), headingLevel (1-6), or likeText (text inside the block whose style AND effective look to copy). "Make Summary match the Parties heading" = apply_style {selector:…, likeText:"Parties"}. THE way to restyle an existing block — never delete-and-recreate it.
|
|
62
|
+
- apply_style: selector (the block to restyle), then ONE of styleId ("Heading2"), headingLevel (1-6), or likeText (text inside the block whose style AND effective look to copy). "Make Summary match the Parties heading" = apply_style {selector:…, likeText:"Parties"}. THE way to restyle an existing block — never delete-and-recreate it. changeMode:"tracked" records the change for review.
|
|
63
63
|
- normalize_body_font_size: fontSize:N.
|
|
64
64
|
- set_font_family: fontFamily ("Arial", "Times New Roman"). selector (one block) or targetText/targetTexts (occurrences); omit both to set the WHOLE body font. changeMode:"tracked" if asked. THE way to change the typeface ("change the font to X").
|
|
65
65
|
- apply_letter_spacing: selector, letterSpacing (points).
|
|
66
66
|
- format_paragraph: selector, alignment:"left"|"center"|"right"|"justify". changeMode:"tracked" records the former alignment as a tracked change. THE way to set paragraph alignment.
|
|
67
|
-
- set_paragraph_spacing: selector, lineSpacing (multiplier, e.g. 1.5 or 2), spaceBefore/spaceAfter (points). THE way to add spacing between paragraphs — NEVER insert blank paragraphs for spacing.
|
|
68
|
-
- insert_page_break: selector (the block that should START on a new page). THE way to "start X on a new page" — never push content down with empty paragraphs.
|
|
69
|
-
- add_hyperlink: text (exact existing text to link), url, optional tooltip. Makes existing text a clickable hyperlink.
|
|
67
|
+
- set_paragraph_spacing: selector, lineSpacing (multiplier, e.g. 1.5 or 2), spaceBefore/spaceAfter (points). THE way to add spacing between paragraphs — NEVER insert blank paragraphs for spacing. changeMode:"tracked" records the change for review.
|
|
68
|
+
- insert_page_break: selector (the block that should START on a new page). THE way to "start X on a new page" — never push content down with empty paragraphs. changeMode:"tracked" records the change for review.
|
|
69
|
+
- add_hyperlink: text (exact existing text to link), url, optional tooltip. Makes existing text a clickable hyperlink. changeMode:"tracked" records the change for review.
|
|
70
70
|
- fill_placeholders: values:[...] and/or fields:[{label?,value}]. changeMode:"tracked" if asked.
|
|
71
|
-
- move_range: fromText (text in the FIRST block of the range), toText? (text in the LAST block — omit to auto-extend across the whole VISUAL SECTION: from fromText up to the next heading-like/ALL-CAPS/bold title), then exactly ONE destination: afterText OR beforeText (text
|
|
71
|
+
- move_range: fromText (text in the FIRST block of the range), toText? (text in the LAST block — omit to auto-extend across the whole VISUAL SECTION: from fromText up to the next heading-like/ALL-CAPS/bold title), then exactly ONE destination: afterText OR beforeText (text inside the block to land after/before). changeMode:"tracked" records both the inserted copies and source deletion for review. Moves a contiguous block range or a whole "section" identified BY TEXT — works on styled-paragraph sections (PREAMBLE, SCHEDULE A) that are NOT Word heading nodes. afterText on a heading-like block lands the range after that block's WHOLE section. Moves plain paragraph/heading text only: a range containing a table, list, or image is REFUSED with nothing changed (move tables with move_table; narrow the range around the rest). Use move_text for text-span moves.
|
|
72
72
|
- insert_toc: title (optional), placement (defaults to document_start).
|
|
73
73
|
- move_text: text (the exact span/clause to relocate), afterText (destination — REQUIRED for a direct move). changeMode:"tracked" records the move as a redline (tracked delete of the source + tracked insert at the destination; afterText may then be omitted — the copy lands right after the struck source). For a text SPAN; whole sections = move_range, tables = move_table.
|
|
74
|
-
- move_table: tableOrdinal? (default 1), placement {at:"document_end"|"document_start"|"after"|"before", selector?}. THE way to move a whole table in ONE call — never delete-and-recreate or chain inserts/undos to relocate a table.
|
|
74
|
+
- move_table: tableOrdinal? (default 1), placement {at:"document_end"|"document_start"|"after"|"before", selector?}. THE way to move a whole table in ONE call — never delete-and-recreate or chain inserts/undos to relocate a table. changeMode:"tracked" records the move for review.
|
|
75
75
|
- delete_table: tableOrdinal? (default 1), changeMode?. THE way to delete an entire table in ONE call — never delete rows one by one or reuse another table.
|
|
76
|
-
- style_table: tableOrdinal? (default 1), accentColor? (header fill hex). ONE call makes a table look professional: accent header row with white bold text, bold first column, banded rows, clean borders. Use after create_table or on any existing table.
|
|
76
|
+
- style_table: tableOrdinal? (default 1), accentColor? (header fill hex). ONE call makes a table look professional: accent header row with white bold text, bold first column, banded rows, clean borders. Use after create_table or on any existing table. changeMode:"tracked" records the formatting for review.
|
|
77
77
|
- insert_table_row: tableOrdinal (1-based), rowIndex (0-based; omit to append), position:"above"|"below", optional cellTexts. dryRun:true for preview.
|
|
78
78
|
- insert_table_column: tableOrdinal, columnIndex (0-based; omit to append right), position:"left"|"right", optional headerText.
|
|
79
79
|
- delete_table_row / delete_table_column: rowIndex or columnIndex required, tableOrdinal optional.
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
// AUTO-GENERATED by scripts/embed-version.mjs — DO NOT EDIT.
|
|
4
4
|
// Source of truth: package.json. Regenerated on every SDK build so the
|
|
5
5
|
// SDK retains its own version identity when bundled into another package.
|
|
6
|
-
const SDK_VERSION = '2.13.1-next.
|
|
6
|
+
const SDK_VERSION = '2.13.1-next.3';
|
|
7
7
|
|
|
8
8
|
exports.SDK_VERSION = SDK_VERSION;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.13.1-next.
|
|
1
|
+
export declare const SDK_VERSION = "2.13.1-next.3";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// AUTO-GENERATED by scripts/embed-version.mjs — DO NOT EDIT.
|
|
2
2
|
// Source of truth: package.json. Regenerated on every SDK build so the
|
|
3
3
|
// SDK retains its own version identity when bundled into another package.
|
|
4
|
-
export const SDK_VERSION = '2.13.1-next.
|
|
4
|
+
export const SDK_VERSION = '2.13.1-next.3';
|
|
@@ -113,6 +113,11 @@ function applyOperationParamAliases(operation, params) {
|
|
|
113
113
|
* - Booleans encoded as `--flag true`/`--flag false` explicitly, matching current CLI.
|
|
114
114
|
*/
|
|
115
115
|
function buildOperationArgv(operation, params, options, runtimeTimeoutMs, defaultChangeMode, user) {
|
|
116
|
+
if (operation.operationId === 'doc.mutations.apply' && (params.dryRun !== undefined || options.dryRun === true)) {
|
|
117
|
+
throw new errors.SuperDocCliError('mutations.apply does not accept dryRun; use mutations.preview.', {
|
|
118
|
+
code: 'INVALID_INPUT',
|
|
119
|
+
});
|
|
120
|
+
}
|
|
116
121
|
// Precedence: explicit input param > explicit per-call option > client-wide
|
|
117
122
|
// defaultChangeMode. The default is a fallback and must never beat an explicit
|
|
118
123
|
// per-call options.changeMode — injecting it first silently downgraded e.g.
|
|
@@ -147,7 +152,8 @@ function buildOperationArgv(operation, params, options, runtimeTimeoutMs, defaul
|
|
|
147
152
|
const argv = [...operation.commandTokens];
|
|
148
153
|
for (const spec of operation.params) {
|
|
149
154
|
const value = normalizedParams[spec.name];
|
|
150
|
-
|
|
155
|
+
// Nullable JSON inputs use null to clear values; omission leaves them unchanged.
|
|
156
|
+
if (value === undefined || (value === null && spec.kind !== 'jsonFlag'))
|
|
151
157
|
continue;
|
|
152
158
|
const flag = `--${spec.flag ?? spec.name}`;
|
|
153
159
|
switch (spec.kind) {
|
|
@@ -110,6 +110,11 @@ export function applyOperationParamAliases(operation, params) {
|
|
|
110
110
|
* - Booleans encoded as `--flag true`/`--flag false` explicitly, matching current CLI.
|
|
111
111
|
*/
|
|
112
112
|
export function buildOperationArgv(operation, params, options, runtimeTimeoutMs, defaultChangeMode, user) {
|
|
113
|
+
if (operation.operationId === 'doc.mutations.apply' && (params.dryRun !== undefined || options.dryRun === true)) {
|
|
114
|
+
throw new SuperDocCliError('mutations.apply does not accept dryRun; use mutations.preview.', {
|
|
115
|
+
code: 'INVALID_INPUT',
|
|
116
|
+
});
|
|
117
|
+
}
|
|
113
118
|
// Precedence: explicit input param > explicit per-call option > client-wide
|
|
114
119
|
// defaultChangeMode. The default is a fallback and must never beat an explicit
|
|
115
120
|
// per-call options.changeMode — injecting it first silently downgraded e.g.
|
|
@@ -144,7 +149,8 @@ export function buildOperationArgv(operation, params, options, runtimeTimeoutMs,
|
|
|
144
149
|
const argv = [...operation.commandTokens];
|
|
145
150
|
for (const spec of operation.params) {
|
|
146
151
|
const value = normalizedParams[spec.name];
|
|
147
|
-
|
|
152
|
+
// Nullable JSON inputs use null to clear values; omission leaves them unchanged.
|
|
153
|
+
if (value === undefined || (value === null && spec.kind !== 'jsonFlag'))
|
|
148
154
|
continue;
|
|
149
155
|
const flag = `--${spec.flag ?? spec.name}`;
|
|
150
156
|
switch (spec.kind) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc/sdk",
|
|
3
|
-
"version": "2.13.1-next.
|
|
3
|
+
"version": "2.13.1-next.3",
|
|
4
4
|
"description": "Node SDK for SuperDoc, wrapping the SuperDoc CLI to read and edit .docx files from JavaScript and TypeScript.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"typescript": "^5.9.2"
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
|
-
"@superdoc/sdk-darwin-arm64": "2.13.1-next.
|
|
42
|
-
"@superdoc/sdk-darwin-x64": "2.13.1-next.
|
|
43
|
-
"@superdoc/sdk-linux-x64": "2.13.1-next.
|
|
44
|
-
"@superdoc/sdk-linux-arm64": "2.13.1-next.
|
|
45
|
-
"@superdoc/sdk-windows-x64": "2.13.1-next.
|
|
41
|
+
"@superdoc/sdk-darwin-arm64": "2.13.1-next.3",
|
|
42
|
+
"@superdoc/sdk-darwin-x64": "2.13.1-next.3",
|
|
43
|
+
"@superdoc/sdk-linux-x64": "2.13.1-next.3",
|
|
44
|
+
"@superdoc/sdk-linux-arm64": "2.13.1-next.3",
|
|
45
|
+
"@superdoc/sdk-windows-x64": "2.13.1-next.3"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
package/tools/tools-policy.json
CHANGED