@beyondwork/xlsx-substrate-bindings 0.2.0 → 0.3.1

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/README.md CHANGED
@@ -13,6 +13,8 @@ and the TypeScript bridge over it.
13
13
  | `@beyondwork/xlsx-substrate-bindings/wasm/web` | The browser loader. No `node:` imports. |
14
14
  | `@beyondwork/xlsx-substrate-bindings/wasm/web/glue` | The wasm-bindgen glue (ES module) the browser loader takes. |
15
15
  | `@beyondwork/xlsx-substrate-bindings/wasm/web/binary` | The one `.wasm` binary, for hosts that serve or preload it. |
16
+ | `@beyondwork/xlsx-substrate-bindings/blank-workbook` | `createBlankWorkbookBytes()`: a new one-sheet workbook to open and edit. No imports at all, so it bundles for a browser. |
17
+ | `@beyondwork/xlsx-substrate-bindings/assets/blank-workbook.xlsx` | The same blank workbook as a file. |
16
18
 
17
19
  ## Node
18
20
 
@@ -117,6 +119,57 @@ so to send one to another thread post `serializeXlsxWasmBridgeError(error)`;
117
119
  the receiving side recognises that plain object with `isXlsxWasmBridgeError`
118
120
  and can rebuild the error with `deserializeXlsxWasmBridgeError`.
119
121
 
122
+ ## Release notes
123
+
124
+ ### 0.3.1 (bridge `xlsx-wasm-bridge-v49`)
125
+
126
+ A PATCH release on the same bridge.
127
+
128
+ - **Browser hosting.** `@beyondwork/xlsx-substrate-bindings/wasm/web` is safe
129
+ in a browser bundle (no Node built-in is reachable from it, guarded by a
130
+ bundle test) and exports the capability helpers, `BRIDGE_*` and the
131
+ mutation router.
132
+ - The root entry exports the session-commit result types
133
+ (`XlsxFormulaRecalculateResult`, `XlsxRuntimeSessionExportResult`,
134
+ `XlsxRuntimeSessionMutationReceipt`, `XlsxSessionVolatileInputs`).
135
+ - `@beyondwork/xlsx-react-component` 0.1.0 depends on this release.
136
+
137
+ ### 0.3.0 (bridge `xlsx-wasm-bridge-v49`)
138
+
139
+ A MINOR release: the bridge moved from v46 (0.2.0) to v49. Hosts on 0.2.0
140
+ should upgrade; 0.3.0 carries correctness fixes.
141
+
142
+ - **Format edits on Excel-saved workbooks export.** A format edit (bold,
143
+ number format, fill, border) on a workbook Excel saved used to make the
144
+ export refuse, because Excel's styles part carries an extension list and
145
+ differential formats. The export now carries the source styles root and its
146
+ extension list byte for byte and keeps every differential-format binding.
147
+ Unknown styles extensions and `mc:AlternateContent` still refuse typed. A
148
+ worksheet whose own extension list holds x14 conditional formatting (data
149
+ bars) still refuses cell edits (`PreserveOnlyExportRisk`).
150
+ - **A blank workbook.** `createBlankWorkbookBytes()` from
151
+ `@beyondwork/xlsx-substrate-bindings/blank-workbook` returns a fresh copy of
152
+ a one-sheet workbook Conductor wrote itself. The entry imports nothing, so it
153
+ is safe in a browser bundle.
154
+ - **Stateless commits recalculate honestly.** A stateless (bytes-in,
155
+ bytes-out) commit recalculates the formulas its edit dirties, including
156
+ volatile functions when the host passes the volatile inputs (v48). Before
157
+ 0.3.0 such a commit could return stale formula values.
158
+ - **Smaller and faster runtime.** One evaluator serves every cell store: the
159
+ wasm binary went from about 11.9 MB to about 8.0 MB, and cold load is faster.
160
+ - **Name reads and go-to.** A sheet-qualified read of a name the sheet defines
161
+ evaluates to that sheet's name; a two-area name (a Print_Titles with
162
+ columns and rows) selects both areas in go-to (v49).
163
+
164
+ Limits that stay in 0.3.0: single-user sessions; the runtime runs on the
165
+ calling thread; very large workbooks (about a million cells) take seconds per
166
+ commit; three calculation shapes may differ from Excel until an Excel capture
167
+ settles them: SUMX2MY2, SUMX2PY2 and SUMXMY2 with a non-number element in a
168
+ pair (Conductor folds it as 0), the implicit intersection of a plain TAKE,
169
+ DROP, CHOOSECOLS or CHOOSEROWS over a range (Conductor takes the top-left),
170
+ and SUBTOTAL 1-11 on a sheet whose table is filtered, for rows hidden by hand
171
+ outside that table (Conductor skips them).
172
+
120
173
  ## Version policy
121
174
 
122
175
  This is the S34 runtime policy ruling. The 2 GiB memory maximum above comes
Binary file
@@ -110,6 +110,27 @@ export interface XlsxAiUndoSubjectToolInput {
110
110
  readonly targetRequestId: string;
111
111
  readonly undoBoundaryId: string;
112
112
  }
113
+ /** The journal cut a graph pin names: the checkpoint's `journal_cut_seq` and the chain head it was cut at (64 lowercase hex). */
114
+ export interface XlsxAiGraphPinJournalCutToolInput {
115
+ readonly journal_cut_seq: number;
116
+ readonly chain_head: string;
117
+ }
118
+ /**
119
+ * The consumer's graph pin on `/ai/propose` (WP-DOC T-I; published by DW-C2): the tenant-wide graph epoch the agent
120
+ * read at and the journal cut it was projected from, with the engine read token when the read carried one
121
+ * (`glt1.<service>.<incarnation>.<epoch>`). Advisory evidence carried on the staged subject beside the check's
122
+ * facts; no fence reads it and it is outside the request memo's digest. At most 256 canonical bytes. The service
123
+ * admits it only while it runs the graph projector (`CONDUCTOR_GRAPH_PROJECTION=on`): with the projector off (the
124
+ * default) a `/ai/propose` body carrying it is refused BEFORE the request memo with the roster row
125
+ * `transport:graph-projection:off` (404; Composer parity; DW-C2 R-DWC2-3 — the row stands in
126
+ * `crates/sheets-scope/tests/fixtures/ai-refusal-roster.json`), nothing is staged, and a retry without the pin
127
+ * proposes afresh.
128
+ */
129
+ export interface XlsxAiGraphPinToolInput {
130
+ readonly graphEpoch: number;
131
+ readonly journalCut: XlsxAiGraphPinJournalCutToolInput;
132
+ readonly readToken?: string;
133
+ }
113
134
  /** `/ai/propose {proposal}`: stage one replacement proposal. */
114
135
  export interface XlsxAiProposeProposalToolInput {
115
136
  readonly requestId: string;
@@ -124,6 +145,7 @@ export interface XlsxAiProposeProposalToolInput {
124
145
  */
125
146
  readonly fidelity?: "guards-only" | "simulated";
126
147
  readonly workflowContext?: XlsxWorkflowContextInput;
148
+ readonly graph?: XlsxAiGraphPinToolInput;
127
149
  }
128
150
  /** `/ai/propose {plan}`: stage one plan. */
129
151
  export interface XlsxAiProposePlanToolInput {
@@ -131,6 +153,7 @@ export interface XlsxAiProposePlanToolInput {
131
153
  readonly expectedSessionFence: XlsxSessionFence;
132
154
  readonly plan: XlsxAiPlanToolBody;
133
155
  readonly workflowContext?: XlsxWorkflowContextInput;
156
+ readonly graph?: XlsxAiGraphPinToolInput;
134
157
  }
135
158
  /** `/ai/propose {undo}`: stage one undo. */
136
159
  export interface XlsxAiProposeUndoToolInput {
@@ -138,6 +161,7 @@ export interface XlsxAiProposeUndoToolInput {
138
161
  readonly expectedSessionFence: XlsxSessionFence;
139
162
  readonly undo: XlsxAiUndoSubjectToolInput;
140
163
  readonly workflowContext?: XlsxWorkflowContextInput;
164
+ readonly graph?: XlsxAiGraphPinToolInput;
141
165
  }
142
166
  /** `/ai/propose`: exactly one subject per request (Q7 "Governed mutations are staged subjects"). */
143
167
  export type XlsxAiProposeToolInput = XlsxAiProposeProposalToolInput | XlsxAiProposePlanToolInput | XlsxAiProposeUndoToolInput;
@@ -495,6 +495,13 @@ export interface XlsxAiNeighborhoodNode {
495
495
  export interface XlsxAiScopeNeighborhoodResult extends XlsxAiSessionStamp {
496
496
  readonly verdict: Extract<XlsxVerdict, "available" | "refused">;
497
497
  readonly status: "measured" | "unmeasured" | "refused";
498
+ /**
499
+ * The graph-currency reason of an `unmeasured` answer. The read mounts the session's keep-alive graph as a cache when
500
+ * nothing is pending (the one mount path every commit and the preview take), so a never-edited session answers
501
+ * `measured`; `needs-full-recalc` names a pending structural rebuild, `not-synced` a graph the next recalculation
502
+ * repairs. `not-mounted` stays on the wire for older bundles and the service's lanes double; the live bridge does not
503
+ * answer it from this op.
504
+ */
498
505
  readonly reason?: "not-mounted" | "not-synced" | "needs-full-recalc" | "seeds-unresolved";
499
506
  readonly refusal?: XlsxAiRefusal;
500
507
  readonly seeds: readonly XlsxAiNeighborhoodNode[];
@@ -534,11 +541,24 @@ export interface XlsxAiCalcGraphDescriptor {
534
541
  * composite endpoint of the returned edges, `edgeCount` the total before
535
542
  * `limit`, `truncated` when the list is a prefix. `unmeasured` carries the
536
543
  * graph-currency reason and no edges — never an empty list read as measured.
544
+ * The export mounts the session's keep-alive graph as a cache when nothing is
545
+ * pending (the one mount path every commit and the preview take), so a
546
+ * never-edited session — the Conductor service's AI sessions, both lanes —
547
+ * answers `measured` under the fence it was asked with; the mount is the
548
+ * unconditional graph build (no recalc budget bounds it), paid once per
549
+ * resident handle and kept by the runtime's graph-currency rule — a handle
550
+ * the service invalidates (`runtime-handle-stale`) mounts again on its next
551
+ * first read.
552
+ * `needs-full-recalc` names a pending structural rebuild; `not-mounted` stays
553
+ * on the wire for older bundles and the lanes double only. The set is the
554
+ * crate's `graph_view` answers (`crates/sheets-wasm/src/ai_session.rs`): the
555
+ * export resolves no seeds, so `seeds-unresolved` (a neighborhood reason) is
556
+ * never answered here.
537
557
  */
538
558
  export interface XlsxAiCalcGraphEdgesResult extends XlsxAiSessionStamp {
539
559
  readonly verdict: Extract<XlsxVerdict, "available" | "refused">;
540
560
  readonly status: "measured" | "unmeasured" | "refused";
541
- readonly reason?: "not-mounted" | "not-synced" | "needs-full-recalc" | "seeds-unresolved";
561
+ readonly reason?: "not-mounted" | "not-synced" | "needs-full-recalc";
542
562
  readonly refusal?: XlsxAiRefusal;
543
563
  readonly edges: readonly XlsxAiCalcGraphEdge[];
544
564
  readonly descriptors: readonly XlsxAiCalcGraphDescriptor[];
@@ -0,0 +1,24 @@
1
+ /**
2
+ * X1-D-080: a blank workbook to start a new spreadsheet from.
3
+ *
4
+ * The bytes are `assets/blank-workbook.xlsx`, Conductor's own export of a
5
+ * one-sheet workbook (`Sheet1`, no cells) whose styleSheet Conductor wrote
6
+ * itself, so no part of it is source-owned and every edit exports. They are
7
+ * embedded here as base64 (3438 bytes) so this module needs no file
8
+ * system and no bundler asset handling: it has no `node:` import and decodes
9
+ * with the global `atob`, which Node and every browser provide.
10
+ *
11
+ * crates/sheets-runtime/tests/x1_d_080_blank_workbook_asset.rs pins the asset
12
+ * to Conductor's current export, and blank-workbook.test.ts pins these bytes
13
+ * to the asset.
14
+ */
15
+ /** The file name a host can offer when it saves a new workbook. */
16
+ export declare const BLANK_WORKBOOK_FILE_NAME = "blank-workbook.xlsx";
17
+ /** The `.xlsx` media type of the bytes. */
18
+ export declare const BLANK_WORKBOOK_MEDIA_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
19
+ /**
20
+ * A fresh copy of the blank workbook's bytes. Open it like any other workbook
21
+ * (for example `openWorkbookRuntimeSession(createBlankWorkbookBytes())`).
22
+ * Each call returns a new array, so a caller may hand it over or change it.
23
+ */
24
+ export declare function createBlankWorkbookBytes(): Uint8Array;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * X1-D-080: a blank workbook to start a new spreadsheet from.
3
+ *
4
+ * The bytes are `assets/blank-workbook.xlsx`, Conductor's own export of a
5
+ * one-sheet workbook (`Sheet1`, no cells) whose styleSheet Conductor wrote
6
+ * itself, so no part of it is source-owned and every edit exports. They are
7
+ * embedded here as base64 (3438 bytes) so this module needs no file
8
+ * system and no bundler asset handling: it has no `node:` import and decodes
9
+ * with the global `atob`, which Node and every browser provide.
10
+ *
11
+ * crates/sheets-runtime/tests/x1_d_080_blank_workbook_asset.rs pins the asset
12
+ * to Conductor's current export, and blank-workbook.test.ts pins these bytes
13
+ * to the asset.
14
+ */
15
+ const BLANK_WORKBOOK_BASE64 = "UEsDBBQAAAAAAAAAIQB2qvOvpwIAAKcCAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbDw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rp" +
16
+ "bmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz48VHlwZXMgeG1sbnM9Imh0dHA6Ly9zY2hlbWFzLm9wZW54bWxmb3JtYXRzLm9y" +
17
+ "Zy9wYWNrYWdlLzIwMDYvY29udGVudC10eXBlcyI+PERlZmF1bHQgRXh0ZW5zaW9uPSJyZWxzIiBDb250ZW50VHlwZT0iYXBwbGlj" +
18
+ "YXRpb24vdm5kLm9wZW54bWxmb3JtYXRzLXBhY2thZ2UucmVsYXRpb25zaGlwcyt4bWwiLz48RGVmYXVsdCBFeHRlbnNpb249Inht" +
19
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+wIAAPsCAAANAAAAAAAAAAAAAACkgQcGAAB4bC9zdHlsZXMueG1sUEsBAi4DFAAAAAAAAAAh" +
59
+ "AJ1sQ70bAQAAGwEAAA8AAAAAAAAAAAAAAKSBLQkAAHhsL3dvcmtib29rLnhtbFBLAQIuAxQAAAAAAAAAIQAhhfgSLQEAAC0BAAAY" +
60
+ "AAAAAAAAAAAAAACkgXUKAAB4bC93b3Jrc2hlZXRzL3NoZWV0MS54bWxQSwUGAAAAAAYABgCAAQAA2AsAAAAA";
61
+ /** The file name a host can offer when it saves a new workbook. */
62
+ export const BLANK_WORKBOOK_FILE_NAME = "blank-workbook.xlsx";
63
+ /** The `.xlsx` media type of the bytes. */
64
+ export const BLANK_WORKBOOK_MEDIA_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
65
+ /**
66
+ * A fresh copy of the blank workbook's bytes. Open it like any other workbook
67
+ * (for example `openWorkbookRuntimeSession(createBlankWorkbookBytes())`).
68
+ * Each call returns a new array, so a caller may hand it over or change it.
69
+ */
70
+ export function createBlankWorkbookBytes() {
71
+ const binary = atob(BLANK_WORKBOOK_BASE64);
72
+ const bytes = new Uint8Array(binary.length);
73
+ for (let index = 0; index < binary.length; index += 1) {
74
+ bytes[index] = binary.charCodeAt(index);
75
+ }
76
+ return bytes;
77
+ }
package/dist/index.d.ts CHANGED
@@ -42,6 +42,7 @@ export type { XlsxAiAgentRefusalCategory, XlsxAiAgentToolEffect, XlsxAiAgentTool
42
42
  export type { XlsxAiMutationApplyResult, XlsxAiMutationBridge, XlsxAiMutationBridgeOptions, XlsxAiMutationBridgeSession, XlsxAiMutationProposal, XlsxAiMutationProposeInput, XlsxAiMutationProposeResult, XlsxAiMutationReadback } from "./ai/index.ts";
43
43
  export type { XlsxAiBlocker, XlsxAiBlockerCode, XlsxAiCompressedContextRequest, XlsxAiCompressedContextResult, XlsxAiCompressedDrilldownRequest, XlsxAiCompressedDrilldownResult, XlsxAiCompressedFormatPostureCounts, XlsxAiCompressedSheetContext, XlsxAiFormulaDiagnostic, XlsxAiFormulaExplanation, XlsxAiFormulaExplanationResult, XlsxAiFormulaPrecedent, XlsxAiKernelActionKind, XlsxAiKernelActionProposal, XlsxAiKernelActionValidation, XlsxAiReferenceMatch, XlsxAiReferenceQuery, XlsxAiReferenceReadback, XlsxAiReferenceResolution, XlsxAiReplacementApplyResult, XlsxAiReplacementProposal, XlsxAiReplacementValidation, XlsxAiScopeBundleResult, XlsxAiScopeListRequest, XlsxAiScopeListResult, XlsxAiUnsupportedAction, XlsxAiUnsupportedActionResult, XlsxAiWorkbookInspection, XlsxKernelScopeEvidence, XlsxRangeWriteCell, XlsxScopeBundle, XlsxScopePageCursor, XlsxAiApplyPlanRequest, XlsxAiApplyProposalRequest, XlsxAiApplyReceipt, XlsxAiCellReadback, XlsxAiCellValue, XlsxAiDrain, XlsxAiFenceTriple, XlsxAiImpact, XlsxAiNeighborhoodNode, XlsxAiPlan, XlsxAiPlanReceipt, XlsxAiPlanStepReceipt, XlsxAiPreviewRequest, XlsxAiPreviewResult, XlsxAiRangeWriteCell, XlsxAiRefusal, XlsxAiReplacementOperation, XlsxAiScopeBundleReadRequest, XlsxAiScopeNeighborhoodRequest, XlsxAiScopeNeighborhoodResult, XlsxAiScopeReadResult, XlsxAiSessionProposal, XlsxAiSessionReferenceRequest, XlsxAiSessionReferenceResult, XlsxAiSessionScopeBundle, XlsxAiSessionScopeBundleResult, XlsxAiSessionStamp, XlsxAiSettledFence, XlsxAiAfterState, XlsxAiSimulatedGate, XlsxAiSimulatedPreview, XlsxAiUnknownOpRefusal, XlsxAiValidateRequest, XlsxAiValidateResult, XlsxSessionFence } from "./ai/index.ts";
44
44
  export type { XlsxBorderStyle, XlsxRangeBorderEdit, XlsxRangeHorizontalAlignmentEdit, XlsxFormulaCommitRequest, XlsxFormulaCommitResult, XlsxRangeFillCommitRequest, XlsxRangeFillCommitResult, XlsxRangeClearCommitRequest, XlsxRangeClearCommitResult, XlsxRangePasteCommitRequest, XlsxRangePasteCommitResult, XlsxLayoutMetricAxis, XlsxLayoutMetricResizeRequest, XlsxLayoutMetricResizeResult, XlsxLayoutMetricVisibilityRequest, XlsxLayoutMetricVisibilityResult, XlsxFrozenPaneRequest, XlsxFrozenPaneResult, XlsxMergeCellsRequest, XlsxMergeCellsResult, XlsxOutlineGroupVisibilityResult, XlsxOutlineLevelOperation, XlsxOutlineLevelRequest, XlsxOutlineLevelResult, XlsxSheetStructureAxis, XlsxSheetStructureMutationRequest, XlsxSheetStructureMutationResult, XlsxSheetStructureOperation, XlsxShiftCellsCommitRequest, XlsxShiftCellsCommitResult, XlsxShiftCellsDirection, XlsxShiftCellsOperation, XlsxFilterCriterionKind, XlsxFilterCondition, XlsxFilterCriterion, XlsxFilterColumn, XlsxRangeFilterApplyRequest, XlsxRangeFilterClearRequest, XlsxRangeFilterResult, XlsxSortColumn, XlsxRangeSortRequest, XlsxRangeSortResult, XlsxTableAppendCellValue, XlsxTableAppendRowRequest, XlsxTableAppendRowResult, XlsxSheetTabMutationOperation, XlsxSheetTabMutationRequest, XlsxSheetTabMutationResult, XlsxDefinedNameMutationOperation, XlsxDefinedNameMutationRequest, XlsxDefinedNameMutationResult, XlsxDefinedNameReadback, XlsxKernelActionKind, XlsxKernelActionRequest, XlsxKernelActionValidation, XlsxKernelAnchor, XlsxKernelBindingState, XlsxKernelCachePosture, XlsxKernelCellValue, XlsxKernelDeclaredInput, XlsxKernelLanguage, XlsxKernelMutationReadback, XlsxKernelMutationResult, XlsxKernelPanelActions, XlsxKernelPanelBinding, XlsxKernelPanelReadback, XlsxKernelRunDiagnostics, XlsxKernelRunOutput, XlsxKernelRunResult, XlsxOperationPatternHint, XlsxOperationPatternValueKindCounts, XlsxRuntimeAuditDeltaSummary, XlsxRuntimeAuditEnvelope, XlsxRuntimeCellReadback, XlsxRuntimeCommandVerdict, XlsxRuntimeInvalidationBucket, XlsxRuntimeInvalidationClass, XlsxRuntimeInvalidationReceipt, XlsxRuntimeUndoBoundary, XlsxRuntimeWarning, XlsxWorkflowContextInput, XlsxWorkflowLaneEntryInput, XlsxWorkflowLaneEntryStatusInput, XlsxWorkflowLaneSnapshotInput, XlsxWorkflowOverlayLaneKindInput, XlsxWorkflowPostureFactInput, XlsxWorkflowPostureKindInput, XlsxWorkflowSeverityInput, XlsxWorkflowTargetInput } from "./runtime/index.ts";
45
+ export type { XlsxFormulaRecalculateResult, XlsxRuntimeSessionExportResult, XlsxRuntimeSessionMutationReceipt, XlsxSessionVolatileInputs, } from "./runtime/types.ts";
45
46
  export { classifyXlsxUiState } from "./ui/index.ts";
46
47
  export { createXlsxWasmBridge, loadGeneratedXlsxWasmBridge, supportsRuntimeSessionMutations } from "./wasm/index.ts";
47
48
  export type { XlsxRuntimeSessionMutationBridge, XlsxWasmBridge, XlsxWasmBridgeLoadResult, XlsxWasmBridgeStatus } from "./wasm/index.ts";
@@ -1,2 +1,2 @@
1
- export type { XlsxFormulaCommitRequest, XlsxFormulaCommitResult, XlsxFormulaRecalculateRequest, XlsxFormulaRecalculateResult, XlsxRangeFillCommitRequest, XlsxRangeFillCommitResult, XlsxRangeClearCommitRequest, XlsxRangeClearCommitResult, XlsxRangeFormatCommitRequest, XlsxRangeFormatCommitResult, XlsxDataValidationEntryMode, XlsxDataValidationErrorStyle, XlsxDataValidationOperator, XlsxDataValidationRuleType, XlsxRangeDataValidationCommitRequest, XlsxRangeDataValidationCommitResult, XlsxRangeDataValidationTargetRange, XlsxFindLookIn, XlsxFindMatch, XlsxFindMatchKind, XlsxFindQueryEcho, XlsxFindRequest, XlsxFindResult, XlsxFindScope, XlsxGoToDefinedName, XlsxGoToRequest, XlsxGoToResult, XlsxGoToTarget, XlsxGoToTargetKind, XlsxDataRegionDirection, XlsxDataRegionRequest, XlsxDataRegionResult, XlsxDataRegionTarget, XlsxDataRegionTargetKind, XlsxReviewCommentCommitRequest, XlsxReviewCommentCommitResult, XlsxReviewCommentVerb, XlsxRangeHyperlinkCommitRequest, XlsxRangeHyperlinkCommitResult, XlsxRangeHyperlinkKind, XlsxRangeAppearanceEdit, XlsxBorderStyle, XlsxRangeBorderEdit, XlsxRangeHorizontalAlignmentEdit, XlsxRangeNumberFormatPreset, XlsxRangePasteCommitRequest, XlsxRangePasteCommitResult, XlsxRangeTransferCommitRequest, XlsxRangeTransferCommitResult, XlsxRangeTransferMode, XlsxSelectionSetClearCommitRequest, XlsxSelectionSetFormatCommitRequest, XlsxSelectionSetPasteCommitRequest, XlsxLayoutMetricAxis, XlsxLayoutMetricResizeRequest, XlsxLayoutMetricResizeResult, XlsxLayoutMetricVisibilityRequest, XlsxLayoutMetricVisibilityResult, XlsxFrozenPaneRequest, XlsxFrozenPaneResult, XlsxMergeCellsRequest, XlsxMergeCellsResult, XlsxOutlineGroupVisibilityResult, XlsxOutlineLevelOperation, XlsxOutlineLevelRequest, XlsxOutlineLevelResult, XlsxSheetStructureAxis, XlsxSheetStructureMutationRequest, XlsxSheetStructureMutationResult, XlsxSheetStructureOperation, XlsxShiftCellsCommitRequest, XlsxShiftCellsCommitResult, XlsxShiftCellsDirection, XlsxShiftCellsOperation, XlsxFilterCriterionKind, XlsxFilterCondition, XlsxFilterCriterion, XlsxFilterColumn, XlsxRangeFilterApplyRequest, XlsxRangeFilterClearRequest, XlsxRangeFilterResult, XlsxSortColumn, XlsxRangeSortRequest, XlsxRangeSortResult, XlsxTableAppendCellValue, XlsxTableAppendRowRequest, XlsxTableAppendRowResult, XlsxSheetTabMutationOperation, XlsxSheetTabMutationRequest, XlsxSheetTabMutationResult, XlsxDefinedNameMutationOperation, XlsxDefinedNameMutationRequest, XlsxDefinedNameMutationResult, XlsxDefinedNameReadback, XlsxKernelActionKind, XlsxKernelActionRequest, XlsxKernelActionValidation, XlsxKernelAnchor, XlsxKernelBindingState, XlsxKernelCachePosture, XlsxKernelCellValue, XlsxKernelCreateRequest, XlsxKernelDeclaredInput, XlsxKernelLanguage, XlsxKernelMutationReadback, XlsxKernelMutationResult, XlsxKernelPanelActions, XlsxKernelPanelBinding, XlsxKernelPanelReadback, XlsxKernelRunDiagnostics, XlsxKernelRunOutput, XlsxKernelRunResult, XlsxOperationPatternHint, XlsxOperationPatternValueKindCounts, XlsxRuntimeAuditDeltaSummary, XlsxRuntimeAuditEnvelope, XlsxRuntimeCellReadback, XlsxRuntimeCommandVerdict, XlsxRuntimeInvalidationBucket, XlsxRuntimeInvalidationClass, XlsxRuntimeInvalidationReceipt, XlsxDelimitedExportRefusal, XlsxRuntimeSessionDelimitedExportRequest, XlsxRuntimeSessionDelimitedExportResult, XlsxRuntimeSessionExportRequest, XlsxRuntimeSessionExportResult, XlsxRuntimeSessionMutationReceipt, XlsxSessionRecalculateRequest, XlsxSessionVolatileInputs, XlsxRuntimeUndoBoundary, XlsxRuntimeWarning, XlsxWorkflowContextInput, XlsxWorkflowLaneEntryInput, XlsxWorkflowLaneEntryStatusInput, XlsxWorkflowLaneSnapshotInput, XlsxWorkflowOverlayLaneKindInput, XlsxWorkflowPostureFactInput, XlsxWorkflowPostureKindInput, XlsxWorkflowSeverityInput, XlsxWorkflowTargetInput } from "./types.ts";
1
+ export type { XlsxFormulaCommitRequest, XlsxFormulaCommitResult, XlsxFormulaRecalculateRequest, XlsxFormulaRecalculateResult, XlsxRangeFillCommitRequest, XlsxRangeFillCommitResult, XlsxRangeClearCommitRequest, XlsxRangeClearCommitResult, XlsxRangeFormatCommitRequest, XlsxRangeFormatCommitResult, XlsxDataValidationEntryMode, XlsxDataValidationErrorStyle, XlsxDataValidationOperator, XlsxDataValidationRuleType, XlsxRangeDataValidationCommitRequest, XlsxRangeDataValidationCommitResult, XlsxRangeDataValidationTargetRange, XlsxFindLookIn, XlsxFindMatch, XlsxFindMatchKind, XlsxFindQueryEcho, XlsxFindRequest, XlsxFindResult, XlsxFindScope, XlsxGoToDefinedName, XlsxGoToRequest, XlsxGoToResult, XlsxGoToArea, XlsxGoToTarget, XlsxGoToTargetKind, XlsxDataRegionDirection, XlsxDataRegionRequest, XlsxDataRegionResult, XlsxDataRegionTarget, XlsxDataRegionTargetKind, XlsxReviewCommentCommitRequest, XlsxReviewCommentCommitResult, XlsxReviewCommentVerb, XlsxRangeHyperlinkCommitRequest, XlsxRangeHyperlinkCommitResult, XlsxRangeHyperlinkKind, XlsxRangeAppearanceEdit, XlsxBorderStyle, XlsxRangeBorderEdit, XlsxRangeHorizontalAlignmentEdit, XlsxRangeNumberFormatPreset, XlsxRangePasteCommitRequest, XlsxRangePasteCommitResult, XlsxRangeTransferCommitRequest, XlsxRangeTransferCommitResult, XlsxRangeTransferMode, XlsxSelectionSetClearCommitRequest, XlsxSelectionSetFormatCommitRequest, XlsxSelectionSetPasteCommitRequest, XlsxLayoutMetricAxis, XlsxLayoutMetricResizeRequest, XlsxLayoutMetricResizeResult, XlsxLayoutMetricVisibilityRequest, XlsxLayoutMetricVisibilityResult, XlsxFrozenPaneRequest, XlsxFrozenPaneResult, XlsxMergeCellsRequest, XlsxMergeCellsResult, XlsxOutlineGroupVisibilityResult, XlsxOutlineLevelOperation, XlsxOutlineLevelRequest, XlsxOutlineLevelResult, XlsxSheetStructureAxis, XlsxSheetStructureMutationRequest, XlsxSheetStructureMutationResult, XlsxSheetStructureOperation, XlsxShiftCellsCommitRequest, XlsxShiftCellsCommitResult, XlsxShiftCellsDirection, XlsxShiftCellsOperation, XlsxFilterCriterionKind, XlsxFilterCondition, XlsxFilterCriterion, XlsxFilterColumn, XlsxRangeFilterApplyRequest, XlsxRangeFilterClearRequest, XlsxRangeFilterResult, XlsxSortColumn, XlsxRangeSortRequest, XlsxRangeSortResult, XlsxTableAppendCellValue, XlsxTableAppendRowRequest, XlsxTableAppendRowResult, XlsxSheetTabMutationOperation, XlsxSheetTabMutationRequest, XlsxSheetTabMutationResult, XlsxDefinedNameMutationOperation, XlsxDefinedNameMutationRequest, XlsxDefinedNameMutationResult, XlsxDefinedNameReadback, XlsxKernelActionKind, XlsxKernelActionRequest, XlsxKernelActionValidation, XlsxKernelAnchor, XlsxKernelBindingState, XlsxKernelCachePosture, XlsxKernelCellValue, XlsxKernelCreateRequest, XlsxKernelDeclaredInput, XlsxKernelLanguage, XlsxKernelMutationReadback, XlsxKernelMutationResult, XlsxKernelPanelActions, XlsxKernelPanelBinding, XlsxKernelPanelReadback, XlsxKernelRunDiagnostics, XlsxKernelRunOutput, XlsxKernelRunResult, XlsxOperationPatternHint, XlsxOperationPatternValueKindCounts, XlsxRuntimeAuditDeltaSummary, XlsxRuntimeAuditEnvelope, XlsxRuntimeCellReadback, XlsxRuntimeCommandVerdict, XlsxRuntimeInvalidationBucket, XlsxRuntimeInvalidationClass, XlsxRuntimeInvalidationReceipt, XlsxDelimitedExportRefusal, XlsxRuntimeSessionDelimitedExportRequest, XlsxRuntimeSessionDelimitedExportResult, XlsxRuntimeSessionExportRequest, XlsxRuntimeSessionExportResult, XlsxRuntimeSessionMutationReceipt, XlsxSessionRecalculateRequest, XlsxSessionVolatileInputs, XlsxStatelessCommitRecalcInputs, XlsxRuntimeUndoBoundary, XlsxRuntimeWarning, XlsxWorkflowContextInput, XlsxWorkflowLaneEntryInput, XlsxWorkflowLaneEntryStatusInput, XlsxWorkflowLaneSnapshotInput, XlsxWorkflowOverlayLaneKindInput, XlsxWorkflowPostureFactInput, XlsxWorkflowPostureKindInput, XlsxWorkflowSeverityInput, XlsxWorkflowTargetInput } from "./types.ts";
2
2
  export { XLSX_BORDER_STYLES } from "./types.ts";
@@ -1,6 +1,6 @@
1
1
  import type { XlsxBlocker, XlsxCellAddress, XlsxCellRange, XlsxReadbackEnvelope, XlsxRuntimeActor, XlsxScopeHandle } from "../shared.ts";
2
2
  export type XlsxRuntimeCommandVerdict = "applied" | "applied-with-warnings" | "blocked" | "refused";
3
- export interface XlsxFormulaCommitRequest {
3
+ export interface XlsxFormulaCommitRequest extends XlsxStatelessCommitRecalcInputs {
4
4
  readonly handle?: XlsxScopeHandle;
5
5
  readonly targetAddress?: XlsxFormulaCommitTargetAddress;
6
6
  readonly formulaText: string;
@@ -78,6 +78,22 @@ export interface XlsxSessionVolatileInputs {
78
78
  /** Non-negative safe integer; reuse it to replay the same random values. */
79
79
  readonly randomSeed: number;
80
80
  }
81
+ /**
82
+ * X5-U-089: the host's volatile inputs on a stateless (bytes-lane) commit.
83
+ * A stateless commit that changes a value recalculates the committed workbook
84
+ * before it exports (X5-U-088; the dirty closure of what it wrote since
85
+ * X4-R-028, and the readers of a kernel output write since X5-U-090). A
86
+ * workbook that holds TODAY, NOW, RAND, RANDBETWEEN, RANDARRAY or INFO needs
87
+ * an explicit clock and seed for that recalculation, as `recalculateFormulas`
88
+ * and the session drain do (X1-D-059); without them it refuses with
89
+ * missing-volatile-inputs and the commit exports unrecalculated. The runtime
90
+ * never invents ambient time or randomness. The in-session ports ignore the
91
+ * field: the session lane takes the inputs on its drain
92
+ * (`XlsxSessionRecalculateRequest.volatileInputs`).
93
+ */
94
+ export interface XlsxStatelessCommitRecalcInputs {
95
+ readonly volatileInputs?: XlsxSessionVolatileInputs;
96
+ }
81
97
  /**
82
98
  * `recalculateInSession` request: the byte-based recalculate request plus an
83
99
  * optional mode ("dirty" default, or "full").
@@ -167,7 +183,7 @@ export interface XlsxRuntimeSessionDelimitedExportResult {
167
183
  readonly blockers: readonly XlsxBlocker[];
168
184
  readonly warnings: readonly XlsxRuntimeWarning[];
169
185
  }
170
- export interface XlsxRangeFillCommitRequest {
186
+ export interface XlsxRangeFillCommitRequest extends XlsxStatelessCommitRecalcInputs {
171
187
  readonly sourceHandle: XlsxScopeHandle;
172
188
  readonly sheetId: string;
173
189
  readonly targetRange: XlsxCellRange;
@@ -199,7 +215,7 @@ export interface XlsxRangeFillCommitResult {
199
215
  * does not validate. The invalid-data marker still reports the cells.
200
216
  */
201
217
  export type XlsxDataValidationEntryMode = "enforce" | "bypass";
202
- export interface XlsxRangePasteCommitRequest {
218
+ export interface XlsxRangePasteCommitRequest extends XlsxStatelessCommitRecalcInputs {
203
219
  readonly sourceHandle?: XlsxScopeHandle;
204
220
  readonly targetHandle?: XlsxScopeHandle;
205
221
  readonly targetAddress?: XlsxFormulaCommitTargetAddress;
@@ -223,7 +239,7 @@ export interface XlsxRangePasteCommitResult {
223
239
  readonly session?: XlsxRuntimeSessionMutationReceipt;
224
240
  }
225
241
  export type XlsxRangeTransferMode = "move" | "copy";
226
- export interface XlsxRangeTransferCommitRequest {
242
+ export interface XlsxRangeTransferCommitRequest extends XlsxStatelessCommitRecalcInputs {
227
243
  readonly sourceHandle: XlsxScopeHandle;
228
244
  readonly sheetId: string;
229
245
  readonly targetRange: XlsxCellRange;
@@ -250,7 +266,7 @@ export interface XlsxRangeTransferCommitResult {
250
266
  */
251
267
  export type XlsxShiftCellsOperation = "insert-cells" | "delete-cells";
252
268
  export type XlsxShiftCellsDirection = "shift-right" | "shift-down" | "shift-left" | "shift-up";
253
- export interface XlsxShiftCellsCommitRequest {
269
+ export interface XlsxShiftCellsCommitRequest extends XlsxStatelessCommitRecalcInputs {
254
270
  readonly sheetId: string;
255
271
  readonly range: XlsxCellRange;
256
272
  readonly operation: XlsxShiftCellsOperation;
@@ -275,7 +291,7 @@ export interface XlsxShiftCellsCommitResult {
275
291
  /** Present only on `*InSession` results (strict superset receipt). */
276
292
  readonly session?: XlsxRuntimeSessionMutationReceipt;
277
293
  }
278
- export interface XlsxRangeClearCommitRequest {
294
+ export interface XlsxRangeClearCommitRequest extends XlsxStatelessCommitRecalcInputs {
279
295
  readonly targetHandle?: XlsxScopeHandle;
280
296
  readonly targetAddress?: XlsxFormulaCommitTargetAddress;
281
297
  readonly sheetId?: string;
@@ -363,7 +379,7 @@ export interface XlsxRangeFormatCommitRequest extends XlsxRangeAppearanceEdit {
363
379
  readonly actor?: XlsxRuntimeActor;
364
380
  readonly workflowContext?: XlsxWorkflowContextInput;
365
381
  }
366
- export interface XlsxSelectionSetPasteCommitRequest {
382
+ export interface XlsxSelectionSetPasteCommitRequest extends XlsxStatelessCommitRecalcInputs {
367
383
  readonly selectionSetHandles: readonly XlsxScopeHandle[];
368
384
  readonly sheetId?: string;
369
385
  readonly clipboardText: string;
@@ -372,7 +388,7 @@ export interface XlsxSelectionSetPasteCommitRequest {
372
388
  /** X5-U-011 (bridge v31). Absent = `"enforce"`. */
373
389
  readonly dataValidation?: XlsxDataValidationEntryMode;
374
390
  }
375
- export interface XlsxSelectionSetClearCommitRequest {
391
+ export interface XlsxSelectionSetClearCommitRequest extends XlsxStatelessCommitRecalcInputs {
376
392
  readonly selectionSetHandles: readonly XlsxScopeHandle[];
377
393
  readonly sheetId?: string;
378
394
  readonly actor?: XlsxRuntimeActor;
@@ -630,6 +646,24 @@ export interface XlsxGoToTarget {
630
646
  * it and the grid readback and formula bar follow.
631
647
  */
632
648
  readonly selectionHandle: XlsxScopeHandle;
649
+ /**
650
+ * X5-U-023 (bridge v49): the areas after the first of a multi-area target
651
+ * (a `Print_Titles` that repeats both columns and rows is the column band,
652
+ * then the row band, the order Excel stores the name in), on the target's
653
+ * sheet. Absent or empty for a one-area target. A host selects every area
654
+ * as one selection set, the first area active, and `label` spells them all
655
+ * (`A:A,1:1`).
656
+ */
657
+ readonly additionalAreas?: readonly XlsxGoToArea[];
658
+ }
659
+ /** X5-U-023 (bridge v49): one more area of a multi-area go-to target. */
660
+ export interface XlsxGoToArea {
661
+ readonly kind: XlsxGoToTargetKind;
662
+ readonly range: XlsxCellRange;
663
+ /** The area's own spelling (`1:1`, or `'Sheet 2'!1:1` off the sheet in view). */
664
+ readonly label: string;
665
+ /** The derived range / row / column handle that selects the area. */
666
+ readonly selectionHandle: XlsxScopeHandle;
633
667
  }
634
668
  /**
635
669
  * `resolved` carries the target; `refused` the typed blockers
@@ -724,7 +758,7 @@ export interface XlsxLayoutMetricResizeResult {
724
758
  /** Present only on `*InSession` results (strict superset receipt). */
725
759
  readonly session?: XlsxRuntimeSessionMutationReceipt;
726
760
  }
727
- export interface XlsxLayoutMetricVisibilityRequest {
761
+ export interface XlsxLayoutMetricVisibilityRequest extends XlsxStatelessCommitRecalcInputs {
728
762
  readonly sheetId: string;
729
763
  readonly index: number;
730
764
  readonly hidden: boolean;
@@ -790,7 +824,7 @@ export interface XlsxFrozenPaneResult {
790
824
  * user, then re-sends with `discardCoveredContent: true`. A merge that
791
825
  * discards nothing applies on the first send, as Excel does.
792
826
  */
793
- export interface XlsxMergeCellsRequest {
827
+ export interface XlsxMergeCellsRequest extends XlsxStatelessCommitRecalcInputs {
794
828
  readonly sheetId: string;
795
829
  readonly range: XlsxCellRange;
796
830
  readonly unmerge?: boolean;
@@ -889,7 +923,7 @@ export type XlsxSheetStructureOperation = "insert-before" | "insert-after" | "de
889
923
  * undo boundary. The result's `index` is the span's first index and `count`
890
924
  * its length.
891
925
  */
892
- export interface XlsxSheetStructureMutationRequest {
926
+ export interface XlsxSheetStructureMutationRequest extends XlsxStatelessCommitRecalcInputs {
893
927
  readonly sheetId: string;
894
928
  readonly axis: XlsxSheetStructureAxis;
895
929
  readonly operation: XlsxSheetStructureOperation;
@@ -915,7 +949,7 @@ export interface XlsxSheetStructureMutationResult {
915
949
  /** Present only on `*InSession` results (strict superset receipt). */
916
950
  readonly session?: XlsxRuntimeSessionMutationReceipt;
917
951
  }
918
- export interface XlsxTableAppendRowRequest {
952
+ export interface XlsxTableAppendRowRequest extends XlsxStatelessCommitRecalcInputs {
919
953
  readonly sheetId: string;
920
954
  readonly tableId: string;
921
955
  readonly values: readonly XlsxTableAppendCellValue[];
@@ -969,14 +1003,14 @@ export interface XlsxFilterColumn {
969
1003
  readonly colId: number;
970
1004
  readonly criterion: XlsxFilterCriterion;
971
1005
  }
972
- export interface XlsxRangeFilterApplyRequest {
1006
+ export interface XlsxRangeFilterApplyRequest extends XlsxStatelessCommitRecalcInputs {
973
1007
  readonly sheetId: string;
974
1008
  readonly range: XlsxCellRange;
975
1009
  readonly columns: readonly XlsxFilterColumn[];
976
1010
  readonly actor?: XlsxRuntimeActor;
977
1011
  readonly workflowContext?: XlsxWorkflowContextInput;
978
1012
  }
979
- export interface XlsxRangeFilterClearRequest {
1013
+ export interface XlsxRangeFilterClearRequest extends XlsxStatelessCommitRecalcInputs {
980
1014
  readonly sheetId: string;
981
1015
  readonly range: XlsxCellRange;
982
1016
  readonly actor?: XlsxRuntimeActor;
@@ -1004,7 +1038,7 @@ export interface XlsxSortColumn {
1004
1038
  readonly column: number;
1005
1039
  readonly descending?: boolean;
1006
1040
  }
1007
- export interface XlsxRangeSortRequest {
1041
+ export interface XlsxRangeSortRequest extends XlsxStatelessCommitRecalcInputs {
1008
1042
  readonly sheetId: string;
1009
1043
  readonly range: XlsxCellRange;
1010
1044
  /** Sort keys in priority order (the first is primary). */
@@ -1028,7 +1062,7 @@ export interface XlsxRangeSortResult {
1028
1062
  readonly session?: XlsxRuntimeSessionMutationReceipt;
1029
1063
  }
1030
1064
  export type XlsxSheetTabMutationOperation = "add" | "rename" | "duplicate" | "delete" | "move-left" | "move-right";
1031
- export interface XlsxSheetTabMutationRequest {
1065
+ export interface XlsxSheetTabMutationRequest extends XlsxStatelessCommitRecalcInputs {
1032
1066
  readonly sheetId?: string;
1033
1067
  readonly operation: XlsxSheetTabMutationOperation;
1034
1068
  readonly name?: string;
@@ -1052,7 +1086,7 @@ export interface XlsxSheetTabMutationResult {
1052
1086
  }
1053
1087
  /** X5-U-023 (bridge v44): one Name Manager edit. */
1054
1088
  export type XlsxDefinedNameMutationOperation = "create" | "update" | "delete";
1055
- export interface XlsxDefinedNameMutationRequest {
1089
+ export interface XlsxDefinedNameMutationRequest extends XlsxStatelessCommitRecalcInputs {
1056
1090
  readonly operation: XlsxDefinedNameMutationOperation;
1057
1091
  /** The name to create, or the existing name an update or delete addresses (Excel's name fold). */
1058
1092
  readonly name: string;
@@ -1174,7 +1208,7 @@ export interface XlsxKernelCreateRequest {
1174
1208
  */
1175
1209
  readonly expectedCanonicalHash?: string;
1176
1210
  }
1177
- export interface XlsxKernelActionRequest {
1211
+ export interface XlsxKernelActionRequest extends XlsxStatelessCommitRecalcInputs {
1178
1212
  readonly bindingId: string;
1179
1213
  readonly action: XlsxKernelActionKind;
1180
1214
  readonly actor?: XlsxRuntimeActor;
@@ -10,7 +10,7 @@ export { estimateXlsxPackageMemory, readWasmMemoryLimits, XLSX_WASM_LINEAR_MEMOR
10
10
  export interface XlsxWasmBridgeStatus {
11
11
  readonly packageName: "@beyondwork/xlsx-substrate-bindings";
12
12
  readonly role: "wasm-ai-ui-runtime-binding";
13
- readonly bridgeVersion: "xlsx-wasm-bridge-v46";
13
+ readonly bridgeVersion: "xlsx-wasm-bridge-v49";
14
14
  readonly capabilities: readonly ("workflow-context-v1" | "workflow-context-v2" | "workflow-overlay-lanes-v1" | "sheet-window-paint-geometry-v1" | "sheet-window-coordinate-posture-v1" | "formula-diagnostics-v2" | "formula-address-commit-v1" | "formula-recalculate-commit-v1" | "formula-recalculate-volatile-inputs-v1" | "formula-translation-interaction-v1" | "kernel-ui-v1" | "runtime-session-handles-v1" | "runtime-session-mutations-v1" | "staged-open-v1" | "sheet-window-cache-v1" | "readback-envelope-v1" | "preserve-only-entities-v1" | "selection-set-v1" | "multi-area-mutation-v1" | "range-fill-commit-v1" | "range-paste-commit-v1" | "range-clear-commit-v1" | "range-format-commit-v1" | "range-transfer-v1" | "layout-metric-resize-v1" | "layout-metric-visibility-v1" | "outline-group-visibility-v1" | "sheet-structure-v1" | "sheet-tabs-v1" | "table-mutation-v1" | "filter-sort-v1" | "sort-commit-v1" | "operation-pattern-hints-v1" | "ai-compressed-bundles-v1" | "ui-capability-records-v1" | "drawing-media-v1" | "drawing-chart-v1" | "sheet-window-binary-v1" | "frozen-pane-v1" | "sheet-window-extent-v1" | "selection-cursor-v1" | "merge-cells-v1" | "shift-cells-v1" | "selection-set-capabilities-v1" | "find-v1" | "go-to-v1" | "data-region-v1" | "ai-session-agent-v1" | "defined-names-v1")[];
15
15
  readonly wasmBinding: "mounted";
16
16
  readonly nativeBinding: "not-mounted";
@@ -70,7 +70,7 @@ export function supportsRuntimeSessionMutations(bridge) {
70
70
  RUNTIME_SESSION_MUTATION_METHODS.every((method) => typeof bridge[method] === "function"));
71
71
  }
72
72
  export { createSheetWindowDecodedReader, decodeSheetWindowBinary, SHEET_WINDOW_BINARY_SCHEMA_ID } from "./sheet-window-binary.js";
73
- const requiredBridgeVersion = "xlsx-wasm-bridge-v46"; // v46: X5-U-083 (table-append empty cell; v45 was WP-DOC-T-O)
73
+ const requiredBridgeVersion = "xlsx-wasm-bridge-v49"; // v49: X5-U-023 (go-to answers carry a multi-area target's further areas; v48 was X5-U-089)
74
74
  const requiredCapabilities = [
75
75
  "workflow-context-v2",
76
76
  "workflow-overlay-lanes-v1",
@@ -236,7 +236,7 @@ const requiredRawMethods = [
236
236
  "defineName",
237
237
  // XB5 (§5.5 under Q8's fold): the AI lane's ONE raw export, declared once
238
238
  // in ai-session-bridge.ts and spread here so the mount gate and the pool
239
- // allowlists read one declaration (the eight verbs are its `op` values).
239
+ // allowlists read one declaration (the nine verbs are its `op` values).
240
240
  ...AI_SESSION_RAW_METHODS
241
241
  ];
242
242
  /**
@@ -1,7 +1,7 @@
1
1
  import type { XlsxFormulaCommitRequest, XlsxFormulaCommitResult, XlsxFormulaRecalculateResult, XlsxLayoutMetricResizeRequest, XlsxLayoutMetricResizeResult, XlsxLayoutMetricVisibilityRequest, XlsxLayoutMetricVisibilityResult, XlsxFrozenPaneRequest, XlsxFrozenPaneResult, XlsxMergeCellsRequest, XlsxMergeCellsResult, XlsxRangeClearCommitRequest, XlsxRangeClearCommitResult, XlsxRangeFillCommitRequest, XlsxRangeFillCommitResult, XlsxRangeFormatCommitRequest, XlsxRangeFormatCommitResult, XlsxRangePasteCommitRequest, XlsxRangePasteCommitResult, XlsxRangeTransferCommitRequest, XlsxRangeTransferCommitResult, XlsxRuntimeSessionExportRequest, XlsxRuntimeSessionMutationReceipt, XlsxRuntimeWarning, XlsxSessionRecalculateRequest, XlsxSheetStructureMutationRequest, XlsxSheetStructureMutationResult, XlsxSheetTabMutationRequest, XlsxSheetTabMutationResult, XlsxShiftCellsCommitRequest, XlsxShiftCellsCommitResult, XlsxTableAppendRowRequest, XlsxTableAppendRowResult } from "../runtime/index.ts";
2
2
  import type { XlsxBlocker } from "../shared.ts";
3
3
  import type { XlsxRuntimeCommandVerdict } from "../runtime/index.ts";
4
- import { type XlsxWasmBridge } from "./index.ts";
4
+ import { type XlsxWasmBridge } from "./bridge-contract.ts";
5
5
  /**
6
6
  * T1 (runtime-session-mutations-v1): host-side routing seam for workbook
7
7
  * mutations.
@@ -1,4 +1,7 @@
1
- import { supportsRuntimeSessionMutations } from "./index.js";
1
+ // X1-D-081: from the target-independent contract, never through the Node
2
+ // loader (./index.ts imports node:crypto, node:fs, node:module, node:path and
3
+ // node:url), so the browser entry (./web.ts) can export the router.
4
+ import { supportsRuntimeSessionMutations } from "./bridge-contract.js";
2
5
  export function createXlsxWorkbookMutationRouter(bridge, init) {
3
6
  let currentBytes = init.bytes;
4
7
  if (init.sessionHandleId !== undefined && supportsRuntimeSessionMutations(bridge)) {
@@ -1,4 +1,6 @@
1
1
  import { type RawXlsxWasmModule, type XlsxWasmBridgeLoadResult } from "./bridge-contract.ts";
2
+ export { BRIDGE_CAPABILITIES, BRIDGE_VERSION, missingXlsxWasmCapabilities, supportsRuntimeSessionMutations, type XlsxRuntimeSessionHandle, type XlsxRuntimeSessionMutationBridge, type XlsxRuntimeSessionOpenRequest, type XlsxSelectionSetRequest, type XlsxWasmBridge, type XlsxWasmBridgeLoadResult, type XlsxWasmBridgeStatus } from "./bridge-contract.ts";
3
+ export { createXlsxWorkbookMutationRouter, type XlsxWorkbookBytesSnapshot, type XlsxWorkbookMutationMode, type XlsxWorkbookMutationRouter, type XlsxWorkbookMutationRouterInit } from "./session-router.ts";
2
4
  /**
3
5
  * Accepted wasm sources for the web glue's init entry point
4
6
  * (wasm-bindgen `--target web`): URL/string/Request/Response stream through
package/dist/wasm/web.js CHANGED
@@ -8,6 +8,14 @@
8
8
  // dynamic remote imports — self-contained for Beyond Work iframe
9
9
  // deployments where the wasm bytes are host-supplied, never CDN-fetched.
10
10
  import { createXlsxWasmBridge, createXlsxWasmRuntime, readWasmMemoryLimits, validateRawXlsxWasmModule, XLSX_WASM_LINEAR_MEMORY_MAXIMUM_BYTES } from "./bridge-contract.js";
11
+ // X1-D-081: the browser entry carries what a host needs to gate and drive a
12
+ // mounted bridge without reaching the Node loader (./index.ts): the
13
+ // capability helpers, the BRIDGE_* constants and the mutation router. Each
14
+ // comes from a module with no `node:` import; the bundling guard
15
+ // test/xlsx/browser-entry-node-free.test.ts holds that for every browser
16
+ // entry of the package.
17
+ export { BRIDGE_CAPABILITIES, BRIDGE_VERSION, missingXlsxWasmCapabilities, supportsRuntimeSessionMutations } from "./bridge-contract.js";
18
+ export { createXlsxWorkbookMutationRouter } from "./session-router.js";
11
19
  /**
12
20
  * Instantiate and mount the XLSX wasm bridge from the web-target artifact.
13
21
  *
@@ -132,9 +132,9 @@ export function dataRegionInRuntimeSession(handle_id: string, request: any): any
132
132
  /**
133
133
  * X5-U-023 (v44): Name Manager authoring over workbook bytes — create,
134
134
  * edit (body and/or spelling) or delete one workbook- or sheet-scoped
135
- * defined name, then export. Readers of the name are not recalculated here
136
- * (parity with every byte commit); the session port forces the full
137
- * recalculation lane instead.
135
+ * defined name, then export. A name can be read by any formula, so the
136
+ * export recalculates in full first (X5-U-088, `export_committed_workbook`),
137
+ * the values the session port's full-recalculation lane reaches.
138
138
  */
139
139
  export function defineName(bytes: Uint8Array, request: any): any;
140
140
 
@@ -676,9 +676,9 @@ export function createXlsxSubstrateGlue() {
676
676
  /**
677
677
  * X5-U-023 (v44): Name Manager authoring over workbook bytes — create,
678
678
  * edit (body and/or spelling) or delete one workbook- or sheet-scoped
679
- * defined name, then export. Readers of the name are not recalculated here
680
- * (parity with every byte commit); the session port forces the full
681
- * recalculation lane instead.
679
+ * defined name, then export. A name can be read by any formula, so the
680
+ * export recalculates in full first (X5-U-088, `export_committed_workbook`),
681
+ * the values the session port's full-recalculation lane reaches.
682
682
  * @param {Uint8Array} bytes
683
683
  * @param {any} request
684
684
  * @returns {any}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@beyondwork/xlsx-substrate-bindings",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Conductor, the Ensemble spreadsheet runtime: native XLSX sessions compiled to WebAssembly for Node and browsers.",
5
5
  "conductor": {
6
- "bridgeVersion": "xlsx-wasm-bridge-v46",
6
+ "bridgeVersion": "xlsx-wasm-bridge-v49",
7
7
  "versionPolicy": "Versions stay 0.x. A release is MINOR when its bridgeVersion differs from the last published release's, PATCH for fixes on the same bridgeVersion, and MAJOR only for removing a required method or capability. A bridge version change on pe2 does not by itself need a release.",
8
8
  "wasm": "generated/wasm-web/xlsx_substrate_wasm_bg.wasm",
9
9
  "linearMemoryMaximumBytes": 2147483648
@@ -32,6 +32,11 @@
32
32
  "import": "./generated/wasm-web/xlsx_substrate_wasm.js"
33
33
  },
34
34
  "./wasm/web/binary": "./generated/wasm-web/xlsx_substrate_wasm_bg.wasm",
35
+ "./blank-workbook": {
36
+ "types": "./dist/blank-workbook/index.d.ts",
37
+ "import": "./dist/blank-workbook/index.js"
38
+ },
39
+ "./assets/blank-workbook.xlsx": "./assets/blank-workbook.xlsx",
35
40
  "./package.json": "./package.json"
36
41
  },
37
42
  "publishConfig": {
@@ -40,6 +45,7 @@
40
45
  "files": [
41
46
  "dist",
42
47
  "generated/wasm-web",
48
+ "assets/blank-workbook.xlsx",
43
49
  "LICENSE.md",
44
50
  "README.md"
45
51
  ],