@superdoc-dev/cli 0.5.0-next.7 → 0.5.0-next.71

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.
Files changed (3) hide show
  1. package/dist/index.js +136757 -100264
  2. package/package.json +10 -10
  3. package/skill/SKILL.md +62 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.5.0-next.7",
3
+ "version": "0.5.0-next.71",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -11,8 +11,8 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "@hocuspocus/provider": "^2.13.6",
14
- "@liveblocks/client": "^3.11.0",
15
- "@liveblocks/yjs": "^3.11.0",
14
+ "@liveblocks/client": "^3.15.5",
15
+ "@liveblocks/yjs": "^3.15.5",
16
16
  "fast-glob": "^3.3.3",
17
17
  "happy-dom": "^20.3.4",
18
18
  "ws": "^8.18.0",
@@ -25,20 +25,20 @@
25
25
  "@types/ws": "^8.5.13",
26
26
  "typescript": "^5.9.2",
27
27
  "@superdoc/document-api": "0.0.1",
28
- "@superdoc/pm-adapter": "0.0.0",
29
28
  "@superdoc/super-editor": "0.0.1",
30
- "superdoc": "1.23.0"
29
+ "superdoc": "1.25.0",
30
+ "@superdoc/pm-adapter": "0.0.0"
31
31
  },
32
32
  "module": "src/index.ts",
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@superdoc-dev/cli-darwin-arm64": "0.5.0-next.7",
38
- "@superdoc-dev/cli-darwin-x64": "0.5.0-next.7",
39
- "@superdoc-dev/cli-linux-x64": "0.5.0-next.7",
40
- "@superdoc-dev/cli-windows-x64": "0.5.0-next.7",
41
- "@superdoc-dev/cli-linux-arm64": "0.5.0-next.7"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.5.0-next.71",
38
+ "@superdoc-dev/cli-darwin-x64": "0.5.0-next.71",
39
+ "@superdoc-dev/cli-linux-x64": "0.5.0-next.71",
40
+ "@superdoc-dev/cli-windows-x64": "0.5.0-next.71",
41
+ "@superdoc-dev/cli-linux-arm64": "0.5.0-next.71"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",
package/skill/SKILL.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: editing-docx
2
+ name: superdoc-edit-docx
3
3
  description: Edit, query, and transform Word documents with the SuperDoc CLI v1 operation surface. Use when the user asks to read, search, modify, comment, or review changes in .docx files.
4
4
  ---
5
5
 
@@ -24,7 +24,7 @@ Use `describe command` for per-command args and constraints.
24
24
 
25
25
  ## Preferred Workflows
26
26
 
27
- ### 1) Stateful multi-step edits (recommended)
27
+ ### 1) Edit an existing document (recommended for targeted changes)
28
28
 
29
29
  ```bash
30
30
  superdoc open ./contract.docx
@@ -34,12 +34,51 @@ superdoc save --in-place
34
34
  superdoc close
35
35
  ```
36
36
 
37
- - Always use `query match` (not `find`) to discover mutation targets it returns exact addresses with cardinality guarantees.
37
+ - Use `query match` when you are modifying existing content and need an exact mutation target.
38
38
  - After `open`, commands run against the active/default session when `<doc>` is omitted.
39
39
  - Use `superdoc session list|set-default|save|close` for explicit session control.
40
40
  - `close` on dirty state requires `--discard` or a prior `save`.
41
41
 
42
- ### 2) Stateless one-off reads
42
+ ### 2) Generate or seed a document body (recommended for synthetic/probe docs)
43
+
44
+ Use `open --content-override` when you want to create a new body from Markdown, HTML, or plain text in one step.
45
+
46
+ ```bash
47
+ superdoc open --content-override "# Probe Title\n\nALPHA01" --override-type markdown
48
+ superdoc save --out ./probe.docx
49
+ superdoc close
50
+ ```
51
+
52
+ ```bash
53
+ superdoc open template.docx \
54
+ --content-override '<p>ALPHA01 <strong>BRAVO02</strong><br/>CHARLIE03</p>' \
55
+ --override-type html
56
+ superdoc save --out ./probe.docx
57
+ superdoc close
58
+ ```
59
+
60
+ - `--content-override` is the fastest way to seed paragraphs, headings, lists, and `<br/>` line breaks.
61
+ - Use `--override-type markdown|html|text` explicitly. `open` rejects `--content-override` without it.
62
+ - For generation, do not start with `query match` unless you are modifying content that already exists.
63
+
64
+ ### 3) Generate incrementally, then reuse the insert receipt target
65
+
66
+ When you need deterministic inline formatting after seeding text, insert first, then reuse the returned target block/range.
67
+
68
+ ```bash
69
+ superdoc open
70
+ superdoc insert --value "ALPHA01 BRAVO02 CHARLIE03"
71
+ superdoc format apply --block-id <from-insert-receipt> --start 8 --end 15 --inline-json '{"fontSize":16,"fontFamily":"Times New Roman"}'
72
+ superdoc format apply --block-id <from-insert-receipt> --start 16 --end 25 --inline-json '{"fontSize":10,"fontFamily":"Arial"}'
73
+ superdoc save --out ./probe.docx
74
+ superdoc close
75
+ ```
76
+
77
+ - The insert receipt contains the resolved target under `receipt.resolution.target`.
78
+ - For a simple one-paragraph synthetic doc, direct `--block-id --start --end` formatting is usually shorter than re-querying.
79
+ - Use `query match` again only if later steps need to rediscover content by meaning, not by the range you just created.
80
+
81
+ ### 4) Stateless one-off reads
43
82
 
44
83
  ```bash
45
84
  superdoc get-text ./proposal.docx
@@ -47,7 +86,7 @@ superdoc get-markdown ./proposal.docx
47
86
  superdoc info ./proposal.docx
48
87
  ```
49
88
 
50
- ### 3) Stateless one-off mutations
89
+ ### 5) Stateless one-off mutations
51
90
 
52
91
  ```bash
53
92
  superdoc replace ./proposal.docx \
@@ -58,6 +97,20 @@ superdoc replace ./proposal.docx \
58
97
 
59
98
  - In stateless mode (`<doc>` provided), mutating commands require `--out` unless using `--dry-run`.
60
99
 
100
+ ### 6) Inline special nodes: tabs vs line breaks
101
+
102
+ - `insert line-break` inserts a real Word line break node inside the current paragraph.
103
+ - `insert tab` inserts a real Word tab node inside the current paragraph.
104
+ - Paragraph tab stops are different. Tab stops control layout positions; tab nodes are inline content characters that advance to the next tab stop.
105
+
106
+ ```bash
107
+ superdoc insert line-break --block-id p1 --offset 12
108
+ superdoc insert tab --block-id p1 --offset 12
109
+ ```
110
+
111
+ - Use `format paragraph set-tab-stop` / related paragraph formatting commands when you need the tab stop definitions themselves.
112
+ - Use the inline insert commands when you need actual `w:br` or `w:tab` content in exported DOCX.
113
+
61
114
  ### Safety: preview before apply
62
115
 
63
116
  - Use `--dry-run` to preview any mutation without applying it.
@@ -76,6 +129,7 @@ superdoc replace ./proposal.docx \
76
129
 
77
130
  - Replace text: `replace --target-json '{...}' --text "..."`
78
131
  - Insert inline text: `insert --block-id <id> --offset <n> --value "..."`
132
+ - Insert inline tab/line break nodes: `insert tab`, `insert line-break`
79
133
  - Delete text/node: `delete --target-json '{...}'`
80
134
  - Delete blocks: `blocks delete`, `blocks delete-range`
81
135
  - Batch mutations: `mutations apply --steps-json '[...]' --atomic true --change-mode direct`
@@ -131,8 +185,10 @@ Always supported alongside their `-json` counterpart (use one, not both):
131
185
  ## Output and Global Flags
132
186
 
133
187
  - Default output is JSON envelope.
188
+ - In JSON mode, command results are returned as a JSON envelope.
134
189
  - Use `--pretty` for human-readable output (not supported by `call`).
135
- - Global flags: `--output <json|pretty>`, `--session <id>`, `--timeout-ms <n>`.
190
+ - Use `--quiet` to suppress non-essential warnings in pretty mode.
191
+ - Global flags: `--output <json|pretty>`, `--session <id>`, `--timeout-ms <n>`, `--quiet`.
136
192
  - `<doc>` can be `-` to read DOCX bytes from stdin.
137
193
 
138
194
  ## Legacy Compatibility (Use Sparingly)