@superdoc/sdk 2.6.0 → 2.7.0

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 (48) hide show
  1. package/dist/agent/actions.cjs +1869 -160
  2. package/dist/agent/actions.d.ts +77 -10
  3. package/dist/agent/actions.js +1870 -161
  4. package/dist/agent/catalog.cjs +102 -9
  5. package/dist/agent/catalog.d.ts +243 -0
  6. package/dist/agent/catalog.js +99 -9
  7. package/dist/agent/doc-snapshot.cjs +200 -2
  8. package/dist/agent/doc-snapshot.d.ts +91 -0
  9. package/dist/agent/doc-snapshot.js +199 -2
  10. package/dist/agent/runtime.cjs +9 -1
  11. package/dist/agent/runtime.d.ts +8 -0
  12. package/dist/agent/runtime.js +9 -1
  13. package/dist/generated/client.cjs +754 -770
  14. package/dist/generated/client.d.ts +9 -9
  15. package/dist/generated/client.js +754 -770
  16. package/dist/generated/contract.cjs +16170 -272
  17. package/dist/generated/contract.d.ts +38 -0
  18. package/dist/generated/contract.js +17411 -1510
  19. package/dist/index.cjs +5 -4
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +5 -4
  22. package/dist/introspection.cjs +59 -0
  23. package/dist/introspection.d.ts +3 -0
  24. package/dist/introspection.js +53 -0
  25. package/dist/runtime/document-rpc.cjs +179 -40
  26. package/dist/runtime/document-rpc.d.ts +13 -4
  27. package/dist/runtime/document-rpc.js +175 -40
  28. package/dist/runtime/embedded-cli.cjs +5 -68
  29. package/dist/runtime/embedded-cli.js +5 -67
  30. package/dist/runtime/embedded-document-host.cjs +28 -0
  31. package/dist/runtime/embedded-document-host.d.ts +1 -0
  32. package/dist/runtime/embedded-document-host.js +23 -0
  33. package/dist/runtime/embedded-platform.cjs +102 -0
  34. package/dist/runtime/embedded-platform.d.ts +5 -0
  35. package/dist/runtime/embedded-platform.js +93 -0
  36. package/dist/runtime/host.cjs +70 -19
  37. package/dist/runtime/host.d.ts +2 -0
  38. package/dist/runtime/host.js +70 -20
  39. package/dist/runtime/process.cjs +30 -9
  40. package/dist/runtime/process.d.ts +9 -0
  41. package/dist/runtime/process.js +29 -9
  42. package/dist/runtime/transport-common.cjs +1 -0
  43. package/dist/runtime/transport-common.d.ts +28 -10
  44. package/dist/runtime/transport-common.js +1 -1
  45. package/package.json +6 -6
  46. package/tools/__pycache__/__init__.cpython-311.pyc +0 -0
  47. package/tools/__pycache__/intent_dispatch_generated.cpython-311.pyc +0 -0
  48. package/tools/tools-policy.json +1 -1
@@ -37,6 +37,14 @@ export type InsertParagraphsArgs = {
37
37
  action: 'insert_paragraphs';
38
38
  texts?: readonly string[];
39
39
  text?: string;
40
+ /**
41
+ * Per-paragraph styling specs aligned with `texts` (same order/length).
42
+ * Entries with runs/marks get a post-insert format.apply pass so an inserted
43
+ * paragraph can mirror its section's pattern (e.g. a bold "(n)" lead-in).
44
+ * Populated by the dispatcher when a texts entry is a {text, runs, marks}
45
+ * object instead of a plain string.
46
+ */
47
+ textSpecs?: ReadonlyArray<AgentListItemSpec | null>;
40
48
  placement?: ActionPlacement;
41
49
  changeMode?: AgentChangeMode;
42
50
  headingLevel?: number;
@@ -74,7 +82,12 @@ export type DeleteBlocksArgs = {
74
82
  };
75
83
  export type AppendListArgs = {
76
84
  action: 'append_list';
77
- items: readonly string[];
85
+ /**
86
+ * Plain strings or styled `{text|runs, marks?}` objects — the shared `items`
87
+ * schema advertises both, so both must dispatch. Styled entries are inserted
88
+ * as text and formatted in a post-pass, the same way add_list_items does it.
89
+ */
90
+ items: readonly (string | AgentListItemSpec)[];
78
91
  kind?: 'ordered' | 'bullet';
79
92
  headingText?: string;
80
93
  headingLevel?: number;
@@ -88,28 +101,80 @@ export type AppendListArgs = {
88
101
  export type InsertListItemsArgs = {
89
102
  listOrdinal?: number;
90
103
  items: readonly string[];
104
+ /**
105
+ * Per-item styling aligned by index with `items`, applied as a post-insert
106
+ * format pass (the workflow insert itself is text-only). Present when the
107
+ * caller wants run-level formatting on the new items.
108
+ */
109
+ styled?: readonly AgentListItemSpec[];
91
110
  changeMode?: AgentChangeMode;
92
111
  };
112
+ /**
113
+ * Inline run marks the agent can request on a list-item segment. `fontSize` is
114
+ * in POINTS; `color`/`highlight` are hex (e.g. `#1a1a1a`). Mirrors the keys the
115
+ * shared `doc.format.apply` `inline` payload understands (see marksToInline).
116
+ */
117
+ export type AgentRunMarks = {
118
+ bold?: boolean;
119
+ italic?: boolean;
120
+ underline?: boolean;
121
+ strikethrough?: boolean;
122
+ fontFamily?: string;
123
+ fontSize?: number;
124
+ color?: string;
125
+ highlight?: string;
126
+ };
127
+ /** One styled text segment of a list item (e.g. first word plain, second italic). */
128
+ export type AgentRunSpec = {
129
+ text: string;
130
+ marks?: AgentRunMarks;
131
+ };
132
+ /**
133
+ * One list item to append. Either plain `text`, or ordered styled `runs` so the
134
+ * agent can replicate an intra-item formatting PATTERN it inferred from the
135
+ * sibling items (e.g. "first word plain, second word italic"). `marks` are
136
+ * whole-item defaults applied UNDER the per-run marks, so unstyled runs still
137
+ * inherit them. `level` nests relative to the anchor (0 = same level).
138
+ */
139
+ export type AgentListItemSpec = {
140
+ text?: string;
141
+ runs?: readonly AgentRunSpec[];
142
+ marks?: AgentRunMarks;
143
+ level?: number;
144
+ };
145
+ /**
146
+ * One table cell's content — plain `text`, or ordered styled `runs` (so a cell
147
+ * can reproduce an intra-cell formatting pattern), with an optional whole-cell
148
+ * `marks` default. Same run/marks model as list items.
149
+ */
150
+ export type AgentCellSpec = {
151
+ text?: string;
152
+ runs?: readonly AgentRunSpec[];
153
+ marks?: AgentRunMarks;
154
+ };
93
155
  export type AddListItemsArgs = {
94
156
  action: 'add_list_items';
95
157
  /** Text inside an existing list item to identify the list to extend. Provide this OR listOrdinal. */
96
158
  anchorText?: string;
159
+ /**
160
+ * Anchor an existing list item directly by nodeId (internal — used when
161
+ * listOrdinal is resolved to a concrete item, so styled inserts reach this
162
+ * path regardless of which locator the model passed).
163
+ */
164
+ anchorNodeId?: string;
97
165
  /** 1-based index of the target list (from inspect). Alternative to anchorText. */
98
166
  listOrdinal?: number;
99
- /** Items to append, with relative nesting level (0 = same as anchor, 1 = nested sub-item). */
100
- entries?: ReadonlyArray<{
101
- text: string;
102
- level?: number;
103
- }>;
104
- /** Plain items to append at the list's base level (simple alias for entries without nesting). */
105
- items?: readonly string[];
167
+ /** Items to append, with relative nesting level and optional per-run styling. */
168
+ entries?: ReadonlyArray<AgentListItemSpec>;
169
+ /** Plain or styled items to append at the list's base level. */
170
+ items?: ReadonlyArray<string | AgentListItemSpec>;
106
171
  changeMode?: AgentChangeMode;
107
172
  };
108
173
  export type CreateTableArgs = {
109
174
  action: 'create_table';
110
175
  rows: number;
111
176
  columns: number;
112
- cellTexts?: ReadonlyArray<ReadonlyArray<string>>;
177
+ cellTexts?: ReadonlyArray<ReadonlyArray<string | AgentCellSpec>>;
113
178
  placement?: ActionPlacement;
114
179
  changeMode?: AgentChangeMode;
115
180
  };
@@ -233,7 +298,7 @@ export type InsertTableRowArgs = {
233
298
  tableOrdinal?: number;
234
299
  rowIndex?: number;
235
300
  position?: 'before' | 'after' | 'above' | 'below';
236
- cellTexts?: readonly string[];
301
+ cellTexts?: readonly (string | AgentCellSpec)[];
237
302
  changeMode?: AgentChangeMode;
238
303
  dryRun?: boolean;
239
304
  };
@@ -243,6 +308,8 @@ export type InsertTableColumnArgs = {
243
308
  columnIndex?: number;
244
309
  position?: 'left' | 'right';
245
310
  headerText?: string;
311
+ /** Optional styled content per row for the new column's cells (index 0 = top row). */
312
+ cellTexts?: readonly (string | AgentCellSpec)[];
246
313
  changeMode?: AgentChangeMode;
247
314
  };
248
315
  export type DeleteTableRowArgs = {