@components-kit/open-workbook 0.1.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.
- package/LICENSE +21 -0
- package/README.md +80 -0
- package/assets/backend/dist/addin-rpc-client.d.ts +17 -0
- package/assets/backend/dist/addin-rpc-client.d.ts.map +1 -0
- package/assets/backend/dist/addin-rpc-client.js +66 -0
- package/assets/backend/dist/addin-rpc-client.js.map +1 -0
- package/assets/backend/dist/addin-websocket-server.d.ts +13 -0
- package/assets/backend/dist/addin-websocket-server.d.ts.map +1 -0
- package/assets/backend/dist/addin-websocket-server.js +199 -0
- package/assets/backend/dist/addin-websocket-server.js.map +1 -0
- package/assets/backend/dist/file-bridge.d.ts +2 -0
- package/assets/backend/dist/file-bridge.d.ts.map +1 -0
- package/assets/backend/dist/file-bridge.js +15 -0
- package/assets/backend/dist/file-bridge.js.map +1 -0
- package/assets/backend/dist/index.d.ts +4 -0
- package/assets/backend/dist/index.d.ts.map +1 -0
- package/assets/backend/dist/index.js +17 -0
- package/assets/backend/dist/index.js.map +1 -0
- package/assets/backend/dist/native-file-bridge-server.d.ts +28 -0
- package/assets/backend/dist/native-file-bridge-server.d.ts.map +1 -0
- package/assets/backend/dist/native-file-bridge-server.js +496 -0
- package/assets/backend/dist/native-file-bridge-server.js.map +1 -0
- package/assets/backend/dist/native-file-bridge.d.ts +20 -0
- package/assets/backend/dist/native-file-bridge.d.ts.map +1 -0
- package/assets/backend/dist/native-file-bridge.js +140 -0
- package/assets/backend/dist/native-file-bridge.js.map +1 -0
- package/assets/backend/dist/runtime-service.d.ts +3167 -0
- package/assets/backend/dist/runtime-service.d.ts.map +1 -0
- package/assets/backend/dist/runtime-service.js +6003 -0
- package/assets/backend/dist/runtime-service.js.map +1 -0
- package/assets/backend/dist/session-registry.d.ts +20 -0
- package/assets/backend/dist/session-registry.d.ts.map +1 -0
- package/assets/backend/dist/session-registry.js +53 -0
- package/assets/backend/dist/session-registry.js.map +1 -0
- package/assets/backend/dist/state-store.d.ts +26 -0
- package/assets/backend/dist/state-store.d.ts.map +1 -0
- package/assets/backend/dist/state-store.js +44 -0
- package/assets/backend/dist/state-store.js.map +1 -0
- package/assets/excel-addin/dist/connection.d.ts +26 -0
- package/assets/excel-addin/dist/connection.d.ts.map +1 -0
- package/assets/excel-addin/dist/connection.js +320 -0
- package/assets/excel-addin/dist/connection.js.map +1 -0
- package/assets/excel-addin/dist/excel-executor.d.ts +225 -0
- package/assets/excel-addin/dist/excel-executor.d.ts.map +1 -0
- package/assets/excel-addin/dist/excel-executor.js +2487 -0
- package/assets/excel-addin/dist/excel-executor.js.map +1 -0
- package/assets/excel-addin/dist/taskpane.d.ts +2 -0
- package/assets/excel-addin/dist/taskpane.d.ts.map +1 -0
- package/assets/excel-addin/dist/taskpane.js +28 -0
- package/assets/excel-addin/dist/taskpane.js.map +1 -0
- package/assets/excel-addin/manifest.xml +93 -0
- package/assets/excel-addin/public/taskpane.css +47 -0
- package/assets/excel-addin/public/taskpane.html +35 -0
- package/assets/excel-addin/scripts/dev-server.mjs +128 -0
- package/assets/instructions/open-workbook-excel/SKILL.md +52 -0
- package/assets/instructions/open-workbook-excel/references/multi-agent.md +43 -0
- package/assets/instructions/open-workbook-excel/references/performance.md +41 -0
- package/assets/instructions/open-workbook-excel/references/reliability.md +76 -0
- package/assets/instructions/open-workbook-excel/references/tool-selection.md +82 -0
- package/assets/instructions/open-workbook-excel/references/workflows.md +93 -0
- package/assets/mcp-server/dist/catalog.d.ts +5 -0
- package/assets/mcp-server/dist/catalog.d.ts.map +1 -0
- package/assets/mcp-server/dist/catalog.js +8 -0
- package/assets/mcp-server/dist/catalog.js.map +1 -0
- package/assets/mcp-server/dist/index.d.ts +3 -0
- package/assets/mcp-server/dist/index.d.ts.map +1 -0
- package/assets/mcp-server/dist/index.js +3779 -0
- package/assets/mcp-server/dist/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +721 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Multi-Agent Work
|
|
2
|
+
|
|
3
|
+
Open Workbook coordinates multiple agents through the shared `owb daemon`. Multiple agents may read and plan in parallel, but workbook mutations commit through a serialized transaction path.
|
|
4
|
+
|
|
5
|
+
## Start
|
|
6
|
+
|
|
7
|
+
1. Call `excel.collab.get_status`.
|
|
8
|
+
2. Create or claim a task with `excel.task.create` or `excel.task.claim` for substantial work.
|
|
9
|
+
3. Call `excel.task.evaluate_schedule` before starting scoped workbook changes.
|
|
10
|
+
4. Acquire a scoped lock with `excel.lock.acquire` for long planning work or guarded user workflows.
|
|
11
|
+
|
|
12
|
+
Use specific scopes: workbook, sheet, range, table, named range, chart, pivot, or template.
|
|
13
|
+
|
|
14
|
+
## Progress
|
|
15
|
+
|
|
16
|
+
- Use `excel.task.set_progress` for percentage and current step.
|
|
17
|
+
- Use `excel.task.add_blocker` when waiting on locks, dependencies, user decisions, or manual review.
|
|
18
|
+
- Use `excel.task.resolve_blocker` when a wait clears.
|
|
19
|
+
- Use `excel.task.complete`, `excel.task.fail`, or `excel.task.cancel` for terminal task state.
|
|
20
|
+
|
|
21
|
+
Do not hide waits as generic failures.
|
|
22
|
+
|
|
23
|
+
## Locks
|
|
24
|
+
|
|
25
|
+
- Use read locks for long analyses over shared ranges.
|
|
26
|
+
- Use `write_values`, `write_formulas`, `write_styles`, `format_layout`, `table`, `chart`, `pivot`, `structure`, or `workbook` modes to match mutation risk.
|
|
27
|
+
- Renew long-lived locks with `excel.lock.renew`.
|
|
28
|
+
- Release manual locks with `excel.lock.release` when the plan is applied or abandoned.
|
|
29
|
+
|
|
30
|
+
If locks conflict, call `excel.conflict.get_guidance` and wait, split scope, or hand off.
|
|
31
|
+
|
|
32
|
+
## Transactions
|
|
33
|
+
|
|
34
|
+
- `excel.batch.apply` and `excel.plan.apply` are serialized by the daemon.
|
|
35
|
+
- Inspect work with `excel.transaction.list` and `excel.transaction.get`.
|
|
36
|
+
- Use `excel.transaction.preview_rollback` before reverting.
|
|
37
|
+
- Use rollback-chain preview/apply when later dependent transactions overlap.
|
|
38
|
+
|
|
39
|
+
Report transaction IDs for auditability.
|
|
40
|
+
|
|
41
|
+
## Conflict Telemetry
|
|
42
|
+
|
|
43
|
+
Use `excel.conflict.get_telemetry` during long sessions to identify repeated contention by range, table, task, or agent. Use the result to split work or sequence tasks.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Performance
|
|
2
|
+
|
|
3
|
+
Fast Excel automation is part of correctness. Slow workflows push agents toward unsafe shortcuts.
|
|
4
|
+
|
|
5
|
+
## Defaults
|
|
6
|
+
|
|
7
|
+
- Prefer bulk Office.js operations over per-cell actions.
|
|
8
|
+
- Use 2D matrices for values, formulas, and number formats.
|
|
9
|
+
- Use table APIs for table-shaped work.
|
|
10
|
+
- Group writes by workbook, sheet, and contiguous range.
|
|
11
|
+
- Read only requested properties.
|
|
12
|
+
- Use `excel.runtime.get_capabilities` before trying expensive or host-limited features.
|
|
13
|
+
|
|
14
|
+
## Reads
|
|
15
|
+
|
|
16
|
+
- For user-visible reporting, read display text.
|
|
17
|
+
- For computation, read raw values.
|
|
18
|
+
- For formula review, read formulas or formula patterns.
|
|
19
|
+
- For formatting review, read number formats or styles only for the relevant range.
|
|
20
|
+
- For table analysis, read the table instead of a sheet-sized range.
|
|
21
|
+
|
|
22
|
+
Avoid workbook-wide reads unless the task is search, validation, audit, or discovery.
|
|
23
|
+
|
|
24
|
+
## Writes
|
|
25
|
+
|
|
26
|
+
- Use one batch or plan for related edits.
|
|
27
|
+
- Keep matrix shapes exact: rows and columns must match the target range.
|
|
28
|
+
- Let Open Workbook chunk large values/formulas/number formats through its batch compiler.
|
|
29
|
+
- Avoid alternating read/write/read/write loops. Read once, compute, apply once, validate once.
|
|
30
|
+
|
|
31
|
+
For very large writes, consider a plan preview first so the agent can expose scope, chunk count, and rollback coverage before applying.
|
|
32
|
+
|
|
33
|
+
## Formulas
|
|
34
|
+
|
|
35
|
+
- Prefer formula pattern tools for repeated formula layouts.
|
|
36
|
+
- Trace precedents/dependents before editing source ranges used by reports, charts, pivots, or formulas.
|
|
37
|
+
- Recalculate with `excel.formula.recalculate` or `excel.workbook.calculate` when the workflow requires fresh computed values.
|
|
38
|
+
|
|
39
|
+
## Telemetry
|
|
40
|
+
|
|
41
|
+
Read tool results for duration, sync count, payload bytes, cells read/written, range count, chunk count, engine, and warnings. Use that telemetry to explain unusually slow or partial work.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Reliability
|
|
2
|
+
|
|
3
|
+
Open Workbook treats Excel as a transaction target. Preserve that contract.
|
|
4
|
+
|
|
5
|
+
## Mutation Contract
|
|
6
|
+
|
|
7
|
+
Every mutation should go through:
|
|
8
|
+
|
|
9
|
+
1. Target resolution.
|
|
10
|
+
2. Permission and locked-region checks.
|
|
11
|
+
3. Snapshot or backup capture.
|
|
12
|
+
4. Fingerprint checks.
|
|
13
|
+
5. Office.js execution through the backend.
|
|
14
|
+
6. Validation where relevant.
|
|
15
|
+
7. Transaction/audit output.
|
|
16
|
+
8. Rollback guidance.
|
|
17
|
+
|
|
18
|
+
If a tool returns backup IDs, transaction IDs, warnings, diffs, or rollback IDs, include the important ones in the final user-facing result.
|
|
19
|
+
|
|
20
|
+
## Validation Defaults
|
|
21
|
+
|
|
22
|
+
- Before risky changes: `excel.validate.workbook`, `excel.validate.sheet`, or a scoped validator.
|
|
23
|
+
- After formula edits: `excel.validate.no_formula_errors` and `excel.validate.no_broken_references`.
|
|
24
|
+
- After template work: `excel.template.validate_sheet_against_template`.
|
|
25
|
+
- After table/filter work: `excel.validate.tables` and `excel.validate.filters`.
|
|
26
|
+
- After broad changes: compare snapshots or use `excel.validate.no_unintended_changes`.
|
|
27
|
+
|
|
28
|
+
Validation reports have `ok`, issue counts, issue severities, stable codes, and targets. Surface the actual codes and affected ranges when they matter.
|
|
29
|
+
|
|
30
|
+
## Stale Plans
|
|
31
|
+
|
|
32
|
+
If a plan was previewed earlier, call `excel.plan.refresh_preview` or `excel.plan.rebase` before applying. If the tool returns `TARGET_REGION_CHANGED`, stop and create a new plan. Do not merge stale Excel edits by guessing.
|
|
33
|
+
|
|
34
|
+
## Conflicts And Locks
|
|
35
|
+
|
|
36
|
+
For blocked transactions or lock waits:
|
|
37
|
+
|
|
38
|
+
1. Call `excel.conflict.get_guidance`.
|
|
39
|
+
2. If a task is involved, update progress with `excel.task.set_progress`.
|
|
40
|
+
3. Add a blocker with `excel.task.add_blocker` when waiting for user input, another task, or a lock.
|
|
41
|
+
4. Retry only after the suggested wait or after splitting the scope.
|
|
42
|
+
|
|
43
|
+
Structure conflicts and broad workbook conflicts usually require manual review.
|
|
44
|
+
|
|
45
|
+
## Rollback
|
|
46
|
+
|
|
47
|
+
- Preview rollback with `excel.transaction.preview_rollback`.
|
|
48
|
+
- If later related transactions overlap, use `excel.transaction.preview_rollback_chain`.
|
|
49
|
+
- Apply rollback chains newest-first only with the returned confirmation token.
|
|
50
|
+
- If rollback metadata is unavailable, switch to backup/template repair and explain the limitation.
|
|
51
|
+
|
|
52
|
+
Never roll back a transaction without checking for later overlapping workbook work.
|
|
53
|
+
|
|
54
|
+
## Capability Limits
|
|
55
|
+
|
|
56
|
+
Treat these as real outcomes:
|
|
57
|
+
|
|
58
|
+
- `CAPABILITY_UNAVAILABLE`
|
|
59
|
+
- `unsupported`
|
|
60
|
+
- `partial`
|
|
61
|
+
- host-limited Office.js warnings
|
|
62
|
+
- disconnected add-in responses
|
|
63
|
+
- native file bridge unavailable responses
|
|
64
|
+
|
|
65
|
+
Choose a supported tool path or ask for user/host setup. Do not claim that unsupported pivot, chart, comment, note, save-as, or print-layout dimensions were changed.
|
|
66
|
+
|
|
67
|
+
## Disconnected Add-In
|
|
68
|
+
|
|
69
|
+
If Excel is not connected:
|
|
70
|
+
|
|
71
|
+
1. Ask the user to start the agent UI that has the Open Workbook MCP config.
|
|
72
|
+
2. If troubleshooting manually, ask the user to run `npx -y @components-kit/open-workbook@latest mcp`.
|
|
73
|
+
3. Ask the user to open Excel and load the Open Workbook add-in.
|
|
74
|
+
4. Retry `excel.runtime.get_status`.
|
|
75
|
+
|
|
76
|
+
Do not use stale snapshots as the source of truth for current workbook state.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Tool Selection
|
|
2
|
+
|
|
3
|
+
Choose the narrowest Open Workbook MCP interface that preserves workbook intent.
|
|
4
|
+
|
|
5
|
+
## Session And Discovery
|
|
6
|
+
|
|
7
|
+
- Runtime health: `excel.runtime.get_status`
|
|
8
|
+
- Active workbook and selection context: `excel.runtime.get_active_context`
|
|
9
|
+
- Host/tool capability matrix: `excel.runtime.get_capabilities`
|
|
10
|
+
- Workbook structure: `excel.workbook.get_workbook_map`
|
|
11
|
+
- Open workbooks: `excel.workbook.list_open_workbooks`
|
|
12
|
+
- Sheets: `excel.sheet.list`, `excel.sheet.get_info`, `excel.sheet.get_used_range`
|
|
13
|
+
|
|
14
|
+
If capabilities are unknown because the add-in is disconnected, stop and ask for runtime setup instead of guessing.
|
|
15
|
+
|
|
16
|
+
## Reading Data
|
|
17
|
+
|
|
18
|
+
- Values only: `excel.range.read_values`
|
|
19
|
+
- Formulas only: `excel.range.read_formulas`
|
|
20
|
+
- Display text for user-visible output: `excel.range.read_display_text`
|
|
21
|
+
- Formatting: `excel.range.read_number_formats`, `excel.range.read_styles`
|
|
22
|
+
- Full cell payload: `excel.range.read_full`
|
|
23
|
+
- Search and diagnostics: `excel.range.search`, `excel.range.find_blank_cells`, `excel.range.find_errors`
|
|
24
|
+
- Table-shaped data: `excel.table.read`
|
|
25
|
+
|
|
26
|
+
Use explicit sheet/address ranges whenever possible. Use used-range or workbook-wide scans only for audits, validation, search, or discovery.
|
|
27
|
+
|
|
28
|
+
## Writing Data
|
|
29
|
+
|
|
30
|
+
- Simple range values: `excel.range.write_values`
|
|
31
|
+
- Simple formulas: `excel.range.write_formulas`
|
|
32
|
+
- Number formats: `excel.range.write_number_formats`
|
|
33
|
+
- Styles: `excel.range.write_styles`
|
|
34
|
+
- Multiple related range edits: `excel.batch.validate`, `excel.batch.dry_run`, `excel.batch.apply`
|
|
35
|
+
- Previewable or user-reviewable edits: `excel.plan.create`, `excel.plan.preview`, `excel.plan.apply`
|
|
36
|
+
- Stale plan handling: `excel.plan.refresh_preview`, `excel.plan.rebase`
|
|
37
|
+
|
|
38
|
+
Prefer `excel.plan.*` when a user should review a diff, when formulas/templates are at risk, or when rollback clarity matters. Prefer `excel.batch.*` for compact, well-scoped range mutations.
|
|
39
|
+
|
|
40
|
+
## Tables, Filters, And Sorts
|
|
41
|
+
|
|
42
|
+
- Inspect tables: `excel.table.list`, `excel.table.get_info`, `excel.table.read`
|
|
43
|
+
- Append or update rows: `excel.table.append_rows`, `excel.table.update_rows`
|
|
44
|
+
- Resize or structure changes: `excel.table.resize`, `excel.table.copy_structure`
|
|
45
|
+
- Filters: `excel.filter.get_filters`, `excel.filter.apply`, `excel.filter.clear`, `excel.filter.validate`
|
|
46
|
+
- Sorts: `excel.sort.apply`, `excel.sort.clear`
|
|
47
|
+
|
|
48
|
+
Use table tools instead of range tools when the target is an Excel table. This preserves headers, totals rows, filters, structured references, and table styles.
|
|
49
|
+
|
|
50
|
+
## Templates, Styles, And Formulas
|
|
51
|
+
|
|
52
|
+
- Template discovery and registration: `excel.template.detect_templates`, `excel.template.register`, `excel.template.list`
|
|
53
|
+
- New period/report sheet: `excel.template.create_sheet_from_template`
|
|
54
|
+
- Template data fills: `excel.template.clear_data_regions`, `excel.template.fill_regions`
|
|
55
|
+
- Template validation/repair: `excel.template.validate_sheet_against_template`, `excel.template.repair_sheet_from_template`
|
|
56
|
+
- Style fingerprints and copy: `excel.style.get_fingerprint`, `excel.style.compare_fingerprint`, `excel.style.copy_from_template`
|
|
57
|
+
- Formula patterns and repair: `excel.formula.read_patterns`, `excel.formula.copy_patterns`, `excel.formula.validate`, `excel.formula.repair_patterns`
|
|
58
|
+
- Formula dependency safety: `excel.formula.get_dependency_graph`, `excel.formula.trace_precedents`, `excel.formula.trace_dependents`
|
|
59
|
+
|
|
60
|
+
Use these tools when the workbook has established formatting, formula patterns, reports, print layout, or period templates.
|
|
61
|
+
|
|
62
|
+
## Pivots And Charts
|
|
63
|
+
|
|
64
|
+
- Pivot inspect/refresh: `excel.pivot.list`, `excel.pivot.get_info`, `excel.pivot.refresh`, `excel.pivot.refresh_all`
|
|
65
|
+
- Pivot create/rebuild: `excel.pivot.create`, `excel.pivot.rebuild_with_source`
|
|
66
|
+
- Pivot template work: `excel.pivot.get_fingerprint`, `excel.pivot.compare_fingerprint`, `excel.pivot.copy_from_template`, `excel.pivot.repair_from_template`
|
|
67
|
+
- Chart inspect/create/update: `excel.chart.list`, `excel.chart.get_info`, `excel.chart.create`, `excel.chart.update_data_source`, `excel.chart.copy_from_template`
|
|
68
|
+
|
|
69
|
+
For host-limited pivot/chart dimensions, report capability warnings and avoid claiming deterministic replay.
|
|
70
|
+
|
|
71
|
+
## Validation And Recovery
|
|
72
|
+
|
|
73
|
+
- Workbook/sheet health: `excel.validate.workbook`, `excel.validate.sheet`
|
|
74
|
+
- Formula errors: `excel.validate.no_formula_errors`, `excel.formula.find_errors`
|
|
75
|
+
- Broken references: `excel.validate.no_broken_references`
|
|
76
|
+
- Template/style/table/filter checks: `excel.validate.template_consistency`, `excel.validate.styles`, `excel.validate.tables`, `excel.validate.filters`
|
|
77
|
+
- Unintended changes: `excel.validate.no_unintended_changes`
|
|
78
|
+
- Snapshots and diffs: `excel.snapshot.create`, `excel.snapshot.compare`, `excel.diff.summarize`
|
|
79
|
+
- Rollback: `excel.plan.rollback`, `excel.transaction.preview_rollback`, `excel.transaction.rollback`, `excel.transaction.preview_rollback_chain`, `excel.transaction.rollback_chain`
|
|
80
|
+
- File backups: `excel.backup.create_file`, `excel.backup.verify`, `excel.backup.restore_file`
|
|
81
|
+
|
|
82
|
+
Always present validation issues with severity and target, not vague success/failure language.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Workflows
|
|
2
|
+
|
|
3
|
+
These are default Open Workbook MCP workflows. Adjust scope and validation to the workbook risk.
|
|
4
|
+
|
|
5
|
+
## Inspect A Workbook
|
|
6
|
+
|
|
7
|
+
1. Call `excel.runtime.get_status`.
|
|
8
|
+
2. Call `excel.runtime.get_active_context`.
|
|
9
|
+
3. Call `excel.runtime.get_capabilities`.
|
|
10
|
+
4. Call `excel.workbook.get_workbook_map`.
|
|
11
|
+
5. For a specific sheet, call `excel.sheet.get_used_range` and scoped `excel.range.read_*` tools.
|
|
12
|
+
|
|
13
|
+
Use display text when reporting what a user sees. Use values/formulas/number formats when making calculations or edits.
|
|
14
|
+
|
|
15
|
+
## Read And Analyze Data
|
|
16
|
+
|
|
17
|
+
1. Identify the smallest sheet, table, region, or range that answers the question.
|
|
18
|
+
2. Use `excel.table.read` for Excel tables; otherwise use `excel.range.read_values` or `excel.range.read_full`.
|
|
19
|
+
3. For formula-sensitive analysis, also call `excel.range.read_formulas` or `excel.formula.read_patterns`.
|
|
20
|
+
4. For data-quality work, use `excel.clean.detect_header_row`, `excel.range.find_blank_cells`, `excel.range.find_errors`, and relevant validators.
|
|
21
|
+
|
|
22
|
+
Do not read the whole workbook when a named table, used range, or explicit range is enough.
|
|
23
|
+
|
|
24
|
+
## Write Values Safely
|
|
25
|
+
|
|
26
|
+
1. Resolve workbook, sheet, and target address.
|
|
27
|
+
2. Use `excel.batch.validate` or `excel.plan.preview` for non-trivial changes.
|
|
28
|
+
3. Apply through `excel.batch.apply` or `excel.plan.apply`.
|
|
29
|
+
4. Validate the target with `excel.validate.no_unintended_changes`, `excel.validate.no_formula_errors`, or a scoped validator.
|
|
30
|
+
5. Return transaction IDs, backup IDs, warnings, and rollback options.
|
|
31
|
+
|
|
32
|
+
For a one-range value update, direct `excel.range.write_values` is acceptable because it routes through the backend safety lifecycle.
|
|
33
|
+
|
|
34
|
+
## Create A New Period Sheet From Template
|
|
35
|
+
|
|
36
|
+
1. Call `excel.template.list` or `excel.template.detect_templates`.
|
|
37
|
+
2. Register the template if needed with `excel.template.register`.
|
|
38
|
+
3. Create the sheet with `excel.template.create_sheet_from_template`.
|
|
39
|
+
4. Clear declared input/data regions with `excel.template.clear_data_regions`.
|
|
40
|
+
5. Fill declared regions with `excel.template.fill_regions`.
|
|
41
|
+
6. Validate with `excel.template.validate_sheet_against_template`.
|
|
42
|
+
|
|
43
|
+
If no registered template exists, warn before mutation. Preserve the template's formatting, formulas, filters, print layout, tables, freeze panes, and named ranges.
|
|
44
|
+
|
|
45
|
+
## Repair Formulas Or Styles
|
|
46
|
+
|
|
47
|
+
1. Identify the template and target sheet/range.
|
|
48
|
+
2. Capture current state with `excel.snapshot.create` when the repair may affect user work.
|
|
49
|
+
3. Compare fingerprints with `excel.style.compare_fingerprint` or formula patterns with `excel.formula.validate_against_template`.
|
|
50
|
+
4. Repair with `excel.repair.style_from_template`, `excel.repair.formulas_from_template`, `excel.style.copy_from_template`, or `excel.formula.repair_patterns`.
|
|
51
|
+
5. Validate again and report any Office.js capability-status warnings.
|
|
52
|
+
|
|
53
|
+
Do not convert formulas to values unless the user explicitly asks or the workflow requires a static export.
|
|
54
|
+
|
|
55
|
+
## Clean A Sheet Or Range
|
|
56
|
+
|
|
57
|
+
1. Detect headers with `excel.clean.detect_header_row`.
|
|
58
|
+
2. Prefer read-only detectors first: outliers, fuzzy matches, blanks, errors.
|
|
59
|
+
3. For mutations, apply a scoped cleaning tool such as `excel.clean.trim_whitespace`, `excel.clean.normalize_headers`, `excel.clean.parse_dates`, `excel.clean.parse_numbers`, `excel.clean.remove_duplicates`, or `excel.clean.fill_missing_values`.
|
|
60
|
+
4. Validate formulas, tables, and unintended changes after cleaning.
|
|
61
|
+
|
|
62
|
+
Cleaning writes must stay within the requested sheet, range, table, or registered region.
|
|
63
|
+
|
|
64
|
+
## Update Tables, Filters, Or Sorts
|
|
65
|
+
|
|
66
|
+
1. Inspect with `excel.table.get_info` and `excel.filter.get_filters`.
|
|
67
|
+
2. Use `excel.table.append_rows` or `excel.table.update_rows` for data.
|
|
68
|
+
3. Use `excel.table.resize` only when structure must change.
|
|
69
|
+
4. Preserve or reapply filters with `excel.filter.apply`, `excel.filter.preserve_from_template`, or `excel.table.preserve_filters`.
|
|
70
|
+
5. Validate with `excel.validate.tables` and `excel.validate.filters`.
|
|
71
|
+
|
|
72
|
+
Avoid raw range writes inside table bodies when table tools can express the intent.
|
|
73
|
+
|
|
74
|
+
## Create Or Update Pivots And Charts
|
|
75
|
+
|
|
76
|
+
1. Confirm active host support with `excel.runtime.get_capabilities`.
|
|
77
|
+
2. Inspect source tables/ranges and existing objects.
|
|
78
|
+
3. For pivots, use `excel.pivot.validate_source`, `excel.pivot.create`, or `excel.pivot.rebuild_with_source`.
|
|
79
|
+
4. For charts, use `excel.chart.create` or `excel.chart.update_data_source`.
|
|
80
|
+
5. For template parity, use pivot/chart fingerprint or copy-from-template tools.
|
|
81
|
+
6. Refresh and validate before reporting success.
|
|
82
|
+
|
|
83
|
+
When Office.js cannot expose deterministic pivot/chart dimensions, return the capability warning instead of inventing proof.
|
|
84
|
+
|
|
85
|
+
## Save, Export, And Back Up
|
|
86
|
+
|
|
87
|
+
1. Use `excel.workbook.save` for normal save.
|
|
88
|
+
2. Use `excel.workbook.export_copy` for a true `.xlsx` copy when supported.
|
|
89
|
+
3. Use `excel.backup.create_file` for durable file backup records.
|
|
90
|
+
4. Use `excel.backup.verify` before trusting a backup path.
|
|
91
|
+
5. Use `excel.workbook.save_as` only when the native file bridge is configured.
|
|
92
|
+
|
|
93
|
+
Full file replacement of an open workbook is host-limited. Prefer safe open-as-new restore unless the user confirms replacement.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function getToolCatalog(options?: {
|
|
2
|
+
includePreview?: boolean;
|
|
3
|
+
}): import("@components-kit/open-workbook-protocol").ToolContract[];
|
|
4
|
+
export declare function getResourceCatalog(): import("@components-kit/open-workbook-protocol").ResourceContract[];
|
|
5
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,mEAExE;AAED,wBAAgB,kBAAkB,wEAEjC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getExposedToolCatalog, ResourceCatalog } from "@components-kit/open-workbook-protocol";
|
|
2
|
+
export function getToolCatalog(options = {}) {
|
|
3
|
+
return getExposedToolCatalog(options);
|
|
4
|
+
}
|
|
5
|
+
export function getResourceCatalog() {
|
|
6
|
+
return ResourceCatalog;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAEhG,MAAM,UAAU,cAAc,CAAC,UAAwC,EAAE;IACvE,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|