@eigenpal/docx-js-editor 0.0.16 → 0.0.19
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/ClipboardManager-D6dkOFg6.d.ts +436 -0
- package/dist/ClipboardManager-EZ0C6Onq.d.cts +436 -0
- package/dist/{DocumentAgent-Ci6_T-XM.d.ts → DocumentAgent-B0EC8lPC.d.cts} +2 -2
- package/dist/{DocumentAgent-DEGFgYEN.d.cts → DocumentAgent-BcCDg7i2.d.ts} +2 -2
- package/dist/{FindReplaceDialog-UMXCBBST.js → FindReplaceDialog-AWQXKEUQ.js} +2 -1
- package/dist/FindReplaceDialog-AWQXKEUQ.js.map +1 -0
- package/dist/FindReplaceDialog-I4SZDSVP.cjs +2 -0
- package/dist/FindReplaceDialog-I4SZDSVP.cjs.map +1 -0
- package/dist/{FootnotePropertiesDialog-OBQXOBJE.cjs → FootnotePropertiesDialog-73VT2ZVZ.cjs} +2 -1
- package/dist/FootnotePropertiesDialog-73VT2ZVZ.cjs.map +1 -0
- package/dist/{FootnotePropertiesDialog-TYQGPWPX.js → FootnotePropertiesDialog-ZM3EF3EF.js} +2 -1
- package/dist/FootnotePropertiesDialog-ZM3EF3EF.js.map +1 -0
- package/dist/{HyperlinkDialog-UOERZIBM.js → HyperlinkDialog-BA25XUT5.js} +2 -1
- package/dist/HyperlinkDialog-BA25XUT5.js.map +1 -0
- package/dist/HyperlinkDialog-V63LPOT2.cjs +2 -0
- package/dist/HyperlinkDialog-V63LPOT2.cjs.map +1 -0
- package/dist/{ImagePositionDialog-52FDANUK.js → ImagePositionDialog-AIAMKPFK.js} +2 -1
- package/dist/ImagePositionDialog-AIAMKPFK.js.map +1 -0
- package/dist/{ImagePositionDialog-ZK5WFBRC.cjs → ImagePositionDialog-KMK7ROV2.cjs} +2 -1
- package/dist/ImagePositionDialog-KMK7ROV2.cjs.map +1 -0
- package/dist/{ImagePropertiesDialog-YPSLPSF6.js → ImagePropertiesDialog-ERFCUVCW.js} +2 -1
- package/dist/ImagePropertiesDialog-ERFCUVCW.js.map +1 -0
- package/dist/{ImagePropertiesDialog-LU44RDIY.cjs → ImagePropertiesDialog-USMMRK6X.cjs} +2 -1
- package/dist/ImagePropertiesDialog-USMMRK6X.cjs.map +1 -0
- package/dist/{TablePropertiesDialog-KMOYHPGF.cjs → TablePropertiesDialog-72CIUAZT.cjs} +2 -1
- package/dist/TablePropertiesDialog-72CIUAZT.cjs.map +1 -0
- package/dist/{TablePropertiesDialog-OUUJAA7D.js → TablePropertiesDialog-EMUEVYB3.js} +2 -1
- package/dist/TablePropertiesDialog-EMUEVYB3.js.map +1 -0
- package/dist/{agentApi-CbVUCZRu.d.cts → agentApi-BFVyKagE.d.cts} +143 -2
- package/dist/{agentApi-CbVUCZRu.d.ts → agentApi-BFVyKagE.d.ts} +143 -2
- package/dist/{chunk-OEOUMSWH.cjs → chunk-2CHPKB5A.cjs} +8 -7
- package/dist/chunk-2CHPKB5A.cjs.map +1 -0
- package/dist/{chunk-R5SKERM2.js → chunk-2QOEHCBX.js} +2 -1
- package/dist/chunk-2QOEHCBX.js.map +1 -0
- package/dist/chunk-4QT5LPBA.cjs +24 -0
- package/dist/chunk-4QT5LPBA.cjs.map +1 -0
- package/dist/chunk-5DYSI4O4.cjs +60 -0
- package/dist/chunk-5DYSI4O4.cjs.map +1 -0
- package/dist/{chunk-DYQUXFE5.cjs → chunk-5FJXHXFV.cjs} +2 -1
- package/dist/chunk-5FJXHXFV.cjs.map +1 -0
- package/dist/chunk-6FEWNF6B.js +4 -0
- package/dist/chunk-6FEWNF6B.js.map +1 -0
- package/dist/chunk-6LF5HZCV.js +10 -0
- package/dist/chunk-6LF5HZCV.js.map +1 -0
- package/dist/{chunk-EMKABJPH.js → chunk-7JSPKVOW.js} +2 -1
- package/dist/chunk-7JSPKVOW.js.map +1 -0
- package/dist/chunk-C33XDRDJ.cjs +28 -0
- package/dist/chunk-C33XDRDJ.cjs.map +1 -0
- package/dist/chunk-CV5WFE7K.js +24 -0
- package/dist/chunk-CV5WFE7K.js.map +1 -0
- package/dist/{chunk-WFYRA2TH.js → chunk-CXJRNISO.js} +2 -1
- package/dist/chunk-CXJRNISO.js.map +1 -0
- package/dist/{chunk-VTAS7VZ6.cjs → chunk-DJAEBZ33.cjs} +2 -1
- package/dist/chunk-DJAEBZ33.cjs.map +1 -0
- package/dist/chunk-DP6Q75ZD.js +28 -0
- package/dist/chunk-DP6Q75ZD.js.map +1 -0
- package/dist/chunk-FDANI5P4.cjs +2 -0
- package/dist/chunk-FDANI5P4.cjs.map +1 -0
- package/dist/chunk-FGVGZLBL.js +2 -0
- package/dist/chunk-FGVGZLBL.js.map +1 -0
- package/dist/{chunk-SF53KLDZ.cjs → chunk-GJ4GKSDU.cjs} +2 -1
- package/dist/chunk-GJ4GKSDU.cjs.map +1 -0
- package/dist/{chunk-FYAWM7MP.cjs → chunk-GWBTKVFD.cjs} +2 -1
- package/dist/chunk-GWBTKVFD.cjs.map +1 -0
- package/dist/{chunk-WFWLPKQA.js → chunk-JOYPFQW2.js} +2 -1
- package/dist/chunk-JOYPFQW2.js.map +1 -0
- package/dist/{chunk-ZDYHAYN6.js → chunk-L54YNLSE.js} +2 -1
- package/dist/chunk-L54YNLSE.js.map +1 -0
- package/dist/chunk-LPGMLJMO.js +259 -0
- package/dist/chunk-LPGMLJMO.js.map +1 -0
- package/dist/{chunk-CTYOM6BE.js → chunk-M2T6XKT5.js} +2 -1
- package/dist/chunk-M2T6XKT5.js.map +1 -0
- package/dist/chunk-OHG7ROFC.js +11 -0
- package/dist/chunk-OHG7ROFC.js.map +1 -0
- package/dist/chunk-PANKMCFX.cjs +4 -0
- package/dist/chunk-PANKMCFX.cjs.map +1 -0
- package/dist/{chunk-PJVI53AH.js → chunk-Q6HUGWO6.js} +2 -1
- package/dist/chunk-Q6HUGWO6.js.map +1 -0
- package/dist/{chunk-MLSHZVL7.js → chunk-QDV75OJ4.js} +8 -7
- package/dist/chunk-QDV75OJ4.js.map +1 -0
- package/dist/chunk-QEBO3EQP.cjs +2 -0
- package/dist/chunk-QEBO3EQP.cjs.map +1 -0
- package/dist/chunk-QVIZ775M.cjs +259 -0
- package/dist/chunk-QVIZ775M.cjs.map +1 -0
- package/dist/chunk-RMUMR42R.cjs +10 -0
- package/dist/chunk-RMUMR42R.cjs.map +1 -0
- package/dist/{chunk-XS2AQFMF.cjs → chunk-S26DZVRQ.cjs} +2 -1
- package/dist/chunk-S26DZVRQ.cjs.map +1 -0
- package/dist/{chunk-L34XFLQZ.cjs → chunk-T2HQYRA7.cjs} +2 -1
- package/dist/chunk-T2HQYRA7.cjs.map +1 -0
- package/dist/chunk-ULXNEG66.js +60 -0
- package/dist/chunk-ULXNEG66.js.map +1 -0
- package/dist/{chunk-PXC7ARQB.cjs → chunk-WD2HTKRR.cjs} +2 -1
- package/dist/chunk-WD2HTKRR.cjs.map +1 -0
- package/dist/chunk-XZNOV52K.cjs +11 -0
- package/dist/chunk-XZNOV52K.cjs.map +1 -0
- package/dist/chunk-Y6VCTLCJ.js +2 -0
- package/dist/chunk-Y6VCTLCJ.js.map +1 -0
- package/dist/{clipboard-Cx7cb3kX.d.cts → clipboard-CqE-UZ2d.d.cts} +1 -1
- package/dist/{clipboard-BOocwmAM.d.ts → clipboard-beGtyabO.d.ts} +1 -1
- package/dist/{colorResolver-KXbUgzWC.d.ts → colorResolver-B5YbO_a4.d.ts} +170 -170
- package/dist/{colorResolver-CIDiSPWd.d.cts → colorResolver-Cu46bSKr.d.cts} +170 -170
- package/dist/core-plugins-reexport.cjs +2 -0
- package/dist/core-plugins-reexport.cjs.map +1 -0
- package/dist/{core-plugins.d.cts → core-plugins-reexport.d.cts} +4 -4
- package/dist/{core-plugins.d.ts → core-plugins-reexport.d.ts} +4 -4
- package/dist/core-plugins-reexport.js +2 -0
- package/dist/core-plugins-reexport.js.map +1 -0
- package/dist/core-reexport.cjs +2 -0
- package/dist/core-reexport.cjs.map +1 -0
- package/dist/core-reexport.d.cts +309 -0
- package/dist/core-reexport.d.ts +309 -0
- package/dist/core-reexport.js +2 -0
- package/dist/core-reexport.js.map +1 -0
- package/dist/executor-K5RXUTTR.js +2 -0
- package/dist/executor-K5RXUTTR.js.map +1 -0
- package/dist/executor-XIPIU3H4.cjs +2 -0
- package/dist/executor-XIPIU3H4.cjs.map +1 -0
- package/dist/{insertOperations-CzB5b-Of.d.ts → fontLoader-CFKpg0Ri.d.ts} +86 -86
- package/dist/{insertOperations-DKVmCV32.d.cts → fontLoader-HZYfILUm.d.cts} +86 -86
- package/dist/headless-reexport.cjs +5 -0
- package/dist/headless-reexport.cjs.map +1 -0
- package/dist/{headless.d.cts → headless-reexport.d.cts} +7 -7
- package/dist/{headless.d.ts → headless-reexport.d.ts} +7 -7
- package/dist/{headless.js → headless-reexport.js} +3 -2
- package/dist/headless-reexport.js.map +1 -0
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +15 -13
- package/dist/index.d.ts +15 -13
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -0
- package/dist/{mcp.cjs → mcp-reexport.cjs} +11 -10
- package/dist/mcp-reexport.cjs.map +1 -0
- package/dist/{mcp.d.cts → mcp-reexport.d.cts} +2 -2
- package/dist/{mcp.d.ts → mcp-reexport.d.ts} +2 -2
- package/dist/{mcp.js → mcp-reexport.js} +10 -9
- package/dist/mcp-reexport.js.map +1 -0
- package/dist/{processTemplate-RJN6452W.js → processTemplate-G37IM66O.js} +2 -1
- package/dist/processTemplate-G37IM66O.js.map +1 -0
- package/dist/processTemplate-RFBGVH7T.cjs +2 -0
- package/dist/processTemplate-RFBGVH7T.cjs.map +1 -0
- package/dist/{react-BZxD04XV.d.ts → react-BjOCdeTs.d.ts} +43 -366
- package/dist/{react-D8eAYckC.d.cts → react-UzAn4o7l.d.cts} +43 -366
- package/dist/react.cjs +2 -1
- package/dist/react.cjs.map +1 -0
- package/dist/react.css +1 -0
- package/dist/react.css.map +1 -0
- package/dist/react.d.cts +6 -5
- package/dist/react.d.ts +6 -5
- package/dist/react.js +2 -1
- package/dist/react.js.map +1 -0
- package/dist/{registry-D4tvj9f3.d.ts → registry-CV6nYWqP.d.ts} +1 -1
- package/dist/{registry-ngv6Bumt.d.cts → registry-DjacfR6Q.d.cts} +1 -1
- package/dist/selectionRects-6DU7HN7E.js +2 -0
- package/dist/selectionRects-6DU7HN7E.js.map +1 -0
- package/dist/selectionRects-YZSC24ZP.cjs +2 -0
- package/dist/selectionRects-YZSC24ZP.cjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/{types-D96elyJF.d.cts → types-Bnp8rvJn.d.cts} +2 -2
- package/dist/{types-xMzSPT4i.d.ts → types-DwZ3xysp.d.ts} +2 -2
- package/dist/ui.cjs +2 -1
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.cts +3 -3
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -1
- package/dist/ui.js.map +1 -0
- package/dist/{variableDetector-DeM1N-_L.d.ts → variableDetector-BaDeXz7D.d.ts} +1 -1
- package/dist/{variableDetector-CPxKo9jP.d.cts → variableDetector-CMhJtM96.d.cts} +1 -1
- package/package.json +26 -79
- package/LICENSE +0 -21
- package/README.md +0 -171
- package/dist/FindReplaceDialog-46BE7Q2G.cjs +0 -1
- package/dist/HyperlinkDialog-22NH7ZLP.cjs +0 -1
- package/dist/chunk-24N3L4IL.cjs +0 -258
- package/dist/chunk-2ASOEN3V.js +0 -1
- package/dist/chunk-46OFHSPJ.cjs +0 -2
- package/dist/chunk-65OFYOHF.cjs +0 -58
- package/dist/chunk-6YFGCUHU.js +0 -4
- package/dist/chunk-ESI4BSBF.js +0 -1
- package/dist/chunk-GLFFXY2X.js +0 -258
- package/dist/chunk-ITWEFKGQ.cjs +0 -1
- package/dist/chunk-JKN7TNPA.js +0 -12
- package/dist/chunk-KESNGXGO.js +0 -1
- package/dist/chunk-NO7WUK5E.cjs +0 -12
- package/dist/chunk-NT2REEAA.cjs +0 -1
- package/dist/chunk-O7QVCJN6.cjs +0 -4
- package/dist/chunk-OW5H5DNE.cjs +0 -1
- package/dist/chunk-OWMXCVKB.js +0 -1
- package/dist/chunk-RM3ITJ2H.cjs +0 -10
- package/dist/chunk-TOI5W3HK.js +0 -8
- package/dist/chunk-UAVOWAIF.cjs +0 -8
- package/dist/chunk-ULNHBTYA.js +0 -2
- package/dist/chunk-UXXV4GT6.js +0 -10
- package/dist/chunk-VOWKSURW.cjs +0 -1
- package/dist/chunk-YMXKVLTU.js +0 -58
- package/dist/core-plugins.cjs +0 -1
- package/dist/core-plugins.js +0 -1
- package/dist/core.cjs +0 -1
- package/dist/core.d.cts +0 -23
- package/dist/core.d.ts +0 -23
- package/dist/core.js +0 -1
- package/dist/executor-ITYZTNSH.cjs +0 -1
- package/dist/executor-TC7CLATE.js +0 -1
- package/dist/headless.cjs +0 -4
- package/dist/mcp-cli.js +0 -136
- package/dist/processTemplate-525HZL4S.cjs +0 -1
- package/dist/selectionRects-PQEUEW35.cjs +0 -1
- package/dist/selectionRects-QAG5RSHD.js +0 -1
|
@@ -1,172 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Command Executor
|
|
6
|
-
*
|
|
7
|
-
* Executes agent commands on a document immutably:
|
|
8
|
-
* - Handles all command types from AgentCommand
|
|
9
|
-
* - Preserves surrounding formatting
|
|
10
|
-
* - Returns new document (immutable updates)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Execute an agent command on a document
|
|
15
|
-
* Returns a new document with the command applied (immutable)
|
|
16
|
-
*
|
|
17
|
-
* Dispatch order:
|
|
18
|
-
* 1. Try plugin handlers first (allows plugins to override built-in commands)
|
|
19
|
-
* 2. Fall back to built-in handlers
|
|
20
|
-
*
|
|
21
|
-
* @param doc - The document to modify
|
|
22
|
-
* @param command - The command to execute
|
|
23
|
-
* @returns New document with command applied
|
|
24
|
-
*/
|
|
25
|
-
declare function executeCommand(doc: Document, command: AgentCommand): Document;
|
|
26
|
-
/**
|
|
27
|
-
* Execute multiple commands in sequence
|
|
28
|
-
*
|
|
29
|
-
* @param doc - The document to modify
|
|
30
|
-
* @param commands - Commands to execute in order
|
|
31
|
-
* @returns New document with all commands applied
|
|
32
|
-
*/
|
|
33
|
-
declare function executeCommands(doc: Document, commands: AgentCommand[]): Document;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Agent Context Builder
|
|
37
|
-
*
|
|
38
|
-
* Generates context objects for AI/LLM consumption from DOCX documents.
|
|
39
|
-
* The context provides a structured summary of the document that can be
|
|
40
|
-
* used by AI agents to understand the document structure and content.
|
|
41
|
-
*
|
|
42
|
-
* All outputs are JSON serializable for easy transmission to AI backends.
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Options for building agent context
|
|
47
|
-
*/
|
|
48
|
-
interface AgentContextOptions {
|
|
49
|
-
/** Maximum characters per paragraph in outline (default: 100) */
|
|
50
|
-
outlineMaxChars?: number;
|
|
51
|
-
/** Maximum paragraphs to include in outline (default: 50) */
|
|
52
|
-
maxOutlineParagraphs?: number;
|
|
53
|
-
/** Include table content in context (default: false) */
|
|
54
|
-
includeTableContent?: boolean;
|
|
55
|
-
/** Include detailed formatting info (default: false) */
|
|
56
|
-
includeFormatting?: boolean;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Options for building selection context
|
|
60
|
-
*/
|
|
61
|
-
interface SelectionContextOptions$1 {
|
|
62
|
-
/** Characters of context before/after selection (default: 200) */
|
|
63
|
-
contextChars?: number;
|
|
64
|
-
/** Include suggested actions (default: true) */
|
|
65
|
-
includeSuggestions?: boolean;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Build agent context from a document
|
|
69
|
-
*
|
|
70
|
-
* @param doc - The parsed document
|
|
71
|
-
* @param options - Context building options
|
|
72
|
-
* @returns AgentContext object (JSON serializable)
|
|
73
|
-
*/
|
|
74
|
-
declare function getAgentContext(doc: Document, options?: AgentContextOptions): AgentContext;
|
|
75
|
-
/**
|
|
76
|
-
* Build selection context for AI operations
|
|
77
|
-
*
|
|
78
|
-
* @param doc - The parsed document
|
|
79
|
-
* @param range - The selected range
|
|
80
|
-
* @param options - Selection context options
|
|
81
|
-
* @returns SelectionContext object (JSON serializable)
|
|
82
|
-
*/
|
|
83
|
-
declare function buildSelectionContext$1(doc: Document, range: Range, options?: SelectionContextOptions$1): SelectionContext;
|
|
84
|
-
/**
|
|
85
|
-
* Get a simple document summary for quick context
|
|
86
|
-
*
|
|
87
|
-
* @param doc - The parsed document
|
|
88
|
-
* @returns Summary string
|
|
89
|
-
*/
|
|
90
|
-
declare function getDocumentSummary(doc: Document): string;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Selection Context Builder
|
|
94
|
-
*
|
|
95
|
-
* Builds rich context objects from document selections for AI operations.
|
|
96
|
-
* Includes selected text, formatting, surrounding context, and suggested actions.
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Options for building selection context
|
|
101
|
-
*/
|
|
102
|
-
interface SelectionContextOptions {
|
|
103
|
-
/** Characters of context before selection (default: 200) */
|
|
104
|
-
contextCharsBefore?: number;
|
|
105
|
-
/** Characters of context after selection (default: 200) */
|
|
106
|
-
contextCharsAfter?: number;
|
|
107
|
-
/** Include suggested actions (default: true) */
|
|
108
|
-
includeSuggestions?: boolean;
|
|
109
|
-
/** Include document summary (default: true) */
|
|
110
|
-
includeDocumentSummary?: boolean;
|
|
111
|
-
/** Maximum suggested actions (default: 8) */
|
|
112
|
-
maxSuggestions?: number;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Extended selection context with additional details
|
|
116
|
-
*/
|
|
117
|
-
interface ExtendedSelectionContext extends SelectionContext {
|
|
118
|
-
/** Document summary for additional context */
|
|
119
|
-
documentSummary?: string;
|
|
120
|
-
/** Selection word count */
|
|
121
|
-
wordCount?: number;
|
|
122
|
-
/** Selection character count */
|
|
123
|
-
characterCount?: number;
|
|
124
|
-
/** Is selection multi-paragraph */
|
|
125
|
-
isMultiParagraph?: boolean;
|
|
126
|
-
/** Selected paragraph indices */
|
|
127
|
-
paragraphIndices?: number[];
|
|
128
|
-
/** Language detection hint */
|
|
129
|
-
detectedLanguage?: string;
|
|
130
|
-
/** Content type hints */
|
|
131
|
-
contentType?: 'prose' | 'list' | 'heading' | 'table' | 'mixed';
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Selection formatting summary
|
|
135
|
-
*/
|
|
136
|
-
interface FormattingSummary {
|
|
137
|
-
/** Predominant formatting */
|
|
138
|
-
predominant: Partial<TextFormatting>;
|
|
139
|
-
/** Is formatting consistent across selection */
|
|
140
|
-
isConsistent: boolean;
|
|
141
|
-
/** All formatting found */
|
|
142
|
-
allFormatting: Partial<TextFormatting>[];
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Build selection context for AI operations
|
|
146
|
-
*
|
|
147
|
-
* @param doc - The parsed document
|
|
148
|
-
* @param range - The selected range
|
|
149
|
-
* @param options - Selection context options
|
|
150
|
-
* @returns SelectionContext object
|
|
151
|
-
*/
|
|
152
|
-
declare function buildSelectionContext(doc: Document, range: Range, options?: SelectionContextOptions): SelectionContext;
|
|
153
|
-
/**
|
|
154
|
-
* Build extended selection context with additional details
|
|
155
|
-
*
|
|
156
|
-
* @param doc - The parsed document
|
|
157
|
-
* @param range - The selected range
|
|
158
|
-
* @param options - Selection context options
|
|
159
|
-
* @returns ExtendedSelectionContext object
|
|
160
|
-
*/
|
|
161
|
-
declare function buildExtendedSelectionContext(doc: Document, range: Range, options?: SelectionContextOptions): ExtendedSelectionContext;
|
|
162
|
-
/**
|
|
163
|
-
* Get formatting summary for a selection
|
|
164
|
-
*
|
|
165
|
-
* @param doc - The parsed document
|
|
166
|
-
* @param range - The selected range
|
|
167
|
-
* @returns FormattingSummary object
|
|
168
|
-
*/
|
|
169
|
-
declare function getSelectionFormattingSummary(doc: Document, range: Range): FormattingSummary;
|
|
1
|
+
import { D as Document, d as DocumentBody, C as SectionProperties, A as AgentCommand, h as AgentContext, R as Range, G as SelectionContext, T as TextFormatting, ae as ColorValue, X as Theme, af as ThemeColorSlot } from './agentApi-BFVyKagE.js';
|
|
2
|
+
import { f as DocxInput } from './DocumentAgent-BcCDg7i2.js';
|
|
170
3
|
|
|
171
4
|
/**
|
|
172
5
|
* Main Parser Orchestrator - Unified parseDocx function
|
|
@@ -438,6 +271,173 @@ declare function createEmptyDocument(options?: CreateEmptyDocumentOptions): Docu
|
|
|
438
271
|
*/
|
|
439
272
|
declare function createDocumentWithText(text: string, options?: Omit<CreateEmptyDocumentOptions, 'initialText'>): Document;
|
|
440
273
|
|
|
274
|
+
/**
|
|
275
|
+
* Command Executor
|
|
276
|
+
*
|
|
277
|
+
* Executes agent commands on a document immutably:
|
|
278
|
+
* - Handles all command types from AgentCommand
|
|
279
|
+
* - Preserves surrounding formatting
|
|
280
|
+
* - Returns new document (immutable updates)
|
|
281
|
+
*/
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Execute an agent command on a document
|
|
285
|
+
* Returns a new document with the command applied (immutable)
|
|
286
|
+
*
|
|
287
|
+
* Dispatch order:
|
|
288
|
+
* 1. Try plugin handlers first (allows plugins to override built-in commands)
|
|
289
|
+
* 2. Fall back to built-in handlers
|
|
290
|
+
*
|
|
291
|
+
* @param doc - The document to modify
|
|
292
|
+
* @param command - The command to execute
|
|
293
|
+
* @returns New document with command applied
|
|
294
|
+
*/
|
|
295
|
+
declare function executeCommand(doc: Document, command: AgentCommand): Document;
|
|
296
|
+
/**
|
|
297
|
+
* Execute multiple commands in sequence
|
|
298
|
+
*
|
|
299
|
+
* @param doc - The document to modify
|
|
300
|
+
* @param commands - Commands to execute in order
|
|
301
|
+
* @returns New document with all commands applied
|
|
302
|
+
*/
|
|
303
|
+
declare function executeCommands(doc: Document, commands: AgentCommand[]): Document;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Agent Context Builder
|
|
307
|
+
*
|
|
308
|
+
* Generates context objects for AI/LLM consumption from DOCX documents.
|
|
309
|
+
* The context provides a structured summary of the document that can be
|
|
310
|
+
* used by AI agents to understand the document structure and content.
|
|
311
|
+
*
|
|
312
|
+
* All outputs are JSON serializable for easy transmission to AI backends.
|
|
313
|
+
*/
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Options for building agent context
|
|
317
|
+
*/
|
|
318
|
+
interface AgentContextOptions {
|
|
319
|
+
/** Maximum characters per paragraph in outline (default: 100) */
|
|
320
|
+
outlineMaxChars?: number;
|
|
321
|
+
/** Maximum paragraphs to include in outline (default: 50) */
|
|
322
|
+
maxOutlineParagraphs?: number;
|
|
323
|
+
/** Include table content in context (default: false) */
|
|
324
|
+
includeTableContent?: boolean;
|
|
325
|
+
/** Include detailed formatting info (default: false) */
|
|
326
|
+
includeFormatting?: boolean;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Options for building selection context
|
|
330
|
+
*/
|
|
331
|
+
interface SelectionContextOptions$1 {
|
|
332
|
+
/** Characters of context before/after selection (default: 200) */
|
|
333
|
+
contextChars?: number;
|
|
334
|
+
/** Include suggested actions (default: true) */
|
|
335
|
+
includeSuggestions?: boolean;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Build agent context from a document
|
|
339
|
+
*
|
|
340
|
+
* @param doc - The parsed document
|
|
341
|
+
* @param options - Context building options
|
|
342
|
+
* @returns AgentContext object (JSON serializable)
|
|
343
|
+
*/
|
|
344
|
+
declare function getAgentContext(doc: Document, options?: AgentContextOptions): AgentContext;
|
|
345
|
+
/**
|
|
346
|
+
* Build selection context for AI operations
|
|
347
|
+
*
|
|
348
|
+
* @param doc - The parsed document
|
|
349
|
+
* @param range - The selected range
|
|
350
|
+
* @param options - Selection context options
|
|
351
|
+
* @returns SelectionContext object (JSON serializable)
|
|
352
|
+
*/
|
|
353
|
+
declare function buildSelectionContext$1(doc: Document, range: Range, options?: SelectionContextOptions$1): SelectionContext;
|
|
354
|
+
/**
|
|
355
|
+
* Get a simple document summary for quick context
|
|
356
|
+
*
|
|
357
|
+
* @param doc - The parsed document
|
|
358
|
+
* @returns Summary string
|
|
359
|
+
*/
|
|
360
|
+
declare function getDocumentSummary(doc: Document): string;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Selection Context Builder
|
|
364
|
+
*
|
|
365
|
+
* Builds rich context objects from document selections for AI operations.
|
|
366
|
+
* Includes selected text, formatting, surrounding context, and suggested actions.
|
|
367
|
+
*/
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Options for building selection context
|
|
371
|
+
*/
|
|
372
|
+
interface SelectionContextOptions {
|
|
373
|
+
/** Characters of context before selection (default: 200) */
|
|
374
|
+
contextCharsBefore?: number;
|
|
375
|
+
/** Characters of context after selection (default: 200) */
|
|
376
|
+
contextCharsAfter?: number;
|
|
377
|
+
/** Include suggested actions (default: true) */
|
|
378
|
+
includeSuggestions?: boolean;
|
|
379
|
+
/** Include document summary (default: true) */
|
|
380
|
+
includeDocumentSummary?: boolean;
|
|
381
|
+
/** Maximum suggested actions (default: 8) */
|
|
382
|
+
maxSuggestions?: number;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Extended selection context with additional details
|
|
386
|
+
*/
|
|
387
|
+
interface ExtendedSelectionContext extends SelectionContext {
|
|
388
|
+
/** Document summary for additional context */
|
|
389
|
+
documentSummary?: string;
|
|
390
|
+
/** Selection word count */
|
|
391
|
+
wordCount?: number;
|
|
392
|
+
/** Selection character count */
|
|
393
|
+
characterCount?: number;
|
|
394
|
+
/** Is selection multi-paragraph */
|
|
395
|
+
isMultiParagraph?: boolean;
|
|
396
|
+
/** Selected paragraph indices */
|
|
397
|
+
paragraphIndices?: number[];
|
|
398
|
+
/** Language detection hint */
|
|
399
|
+
detectedLanguage?: string;
|
|
400
|
+
/** Content type hints */
|
|
401
|
+
contentType?: 'prose' | 'list' | 'heading' | 'table' | 'mixed';
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Selection formatting summary
|
|
405
|
+
*/
|
|
406
|
+
interface FormattingSummary {
|
|
407
|
+
/** Predominant formatting */
|
|
408
|
+
predominant: Partial<TextFormatting>;
|
|
409
|
+
/** Is formatting consistent across selection */
|
|
410
|
+
isConsistent: boolean;
|
|
411
|
+
/** All formatting found */
|
|
412
|
+
allFormatting: Partial<TextFormatting>[];
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Build selection context for AI operations
|
|
416
|
+
*
|
|
417
|
+
* @param doc - The parsed document
|
|
418
|
+
* @param range - The selected range
|
|
419
|
+
* @param options - Selection context options
|
|
420
|
+
* @returns SelectionContext object
|
|
421
|
+
*/
|
|
422
|
+
declare function buildSelectionContext(doc: Document, range: Range, options?: SelectionContextOptions): SelectionContext;
|
|
423
|
+
/**
|
|
424
|
+
* Build extended selection context with additional details
|
|
425
|
+
*
|
|
426
|
+
* @param doc - The parsed document
|
|
427
|
+
* @param range - The selected range
|
|
428
|
+
* @param options - Selection context options
|
|
429
|
+
* @returns ExtendedSelectionContext object
|
|
430
|
+
*/
|
|
431
|
+
declare function buildExtendedSelectionContext(doc: Document, range: Range, options?: SelectionContextOptions): ExtendedSelectionContext;
|
|
432
|
+
/**
|
|
433
|
+
* Get formatting summary for a selection
|
|
434
|
+
*
|
|
435
|
+
* @param doc - The parsed document
|
|
436
|
+
* @param range - The selected range
|
|
437
|
+
* @returns FormattingSummary object
|
|
438
|
+
*/
|
|
439
|
+
declare function getSelectionFormattingSummary(doc: Document, range: Range): FormattingSummary;
|
|
440
|
+
|
|
441
441
|
/**
|
|
442
442
|
* Convert twips to pixels (at 96 DPI)
|
|
443
443
|
*
|
|
@@ -615,4 +615,4 @@ declare function blendColors(color1: ColorValue | undefined | null, color2: Colo
|
|
|
615
615
|
*/
|
|
616
616
|
declare function colorsEqual(color1: ColorValue | undefined | null, color2: ColorValue | undefined | null, theme: Theme | null | undefined): boolean;
|
|
617
617
|
|
|
618
|
-
export {
|
|
618
|
+
export { validateTemplate as $, type AgentContextOptions as A, isWhite as B, type CreateEmptyDocumentOptions as C, lightenColor as D, type ExtendedSelectionContext as E, type FormattingSummary as F, parseColorString as G, parseDocx as H, pixelsToEmu as I, pixelsToTwips as J, pointsToPixels as K, previewTemplate as L, processTemplate as M, processTemplateAdvanced as N, processTemplateAsBlob as O, type ProcessTemplateOptions as P, processTemplateDetailed as Q, resolveColor as R, type SelectionContextOptions$1 as S, type TemplateError as T, resolveHighlightColor as U, resolveShadingColor as V, serializeDocumentBody as W, serializeDocument as X, serializeSectionProperties as Y, twipsToEmu as Z, twipsToPixels as _, type ProcessTemplateResult as a, type SelectionContextOptions as b, blendColors as c, buildExtendedSelectionContext as d, buildSelectionContext as e, buildSelectionContext$1 as f, colorsEqual as g, createDocumentWithText as h, createEmptyDocument as i, createRgbColor as j, createTemplateProcessor as k, createThemeColor as l, darkenColor as m, emuToPixels as n, emuToTwips as o, executeCommand as p, executeCommands as q, formatPx as r, getAgentContext as s, getContrastingColor as t, getDocumentSummary as u, getMissingVariables as v, getSelectionFormattingSummary as w, getTemplateTags as x, halfPointsToPixels as y, isBlack as z };
|