@beyondwork/xlsx-substrate-bindings 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +136 -0
  2. package/dist/ai/agent-metadata.d.ts +363 -0
  3. package/dist/ai/agent-metadata.js +227 -0
  4. package/dist/ai/index.d.ts +5 -1
  5. package/dist/ai/index.js +6 -0
  6. package/dist/ai/mutation-bridge.d.ts +82 -0
  7. package/dist/ai/mutation-bridge.js +179 -0
  8. package/dist/ai/types.d.ts +448 -3
  9. package/dist/index.d.ts +7 -3
  10. package/dist/index.js +20 -2
  11. package/dist/runtime/index.d.ts +1 -1
  12. package/dist/runtime/types.d.ts +57 -1
  13. package/dist/wasm/ai-session-bridge.d.ts +97 -0
  14. package/dist/wasm/ai-session-bridge.js +154 -0
  15. package/dist/wasm/bridge-contract.d.ts +108 -6
  16. package/dist/wasm/bridge-contract.js +146 -7
  17. package/dist/wasm/index.d.ts +43 -2
  18. package/dist/wasm/index.js +253 -23
  19. package/dist/wasm/memory-budget.d.ts +77 -0
  20. package/dist/wasm/memory-budget.js +532 -0
  21. package/dist/wasm/runtime-guard.d.ts +141 -0
  22. package/dist/wasm/runtime-guard.js +373 -0
  23. package/dist/wasm/web.d.ts +16 -3
  24. package/dist/wasm/web.js +91 -9
  25. package/generated/wasm-web/xlsx_substrate_wasm.d.ts +66 -0
  26. package/generated/wasm-web/xlsx_substrate_wasm.js +2488 -2104
  27. package/generated/wasm-web/xlsx_substrate_wasm_bg.wasm +0 -0
  28. package/generated/wasm-web/xlsx_substrate_wasm_bg.wasm.d.ts +15 -0
  29. package/package.json +18 -4
  30. package/dist/wasm/chart-test-fixture.d.ts +0 -19
  31. package/dist/wasm/chart-test-fixture.js +0 -42
  32. package/dist/wasm/media-test-fixture.d.ts +0 -44
  33. package/dist/wasm/media-test-fixture.js +0 -160
  34. package/dist/wasm/volatile-test-fixture.d.ts +0 -7
  35. package/dist/wasm/volatile-test-fixture.js +0 -35
  36. package/generated/wasm/package.json +0 -3
  37. package/generated/wasm/sheet-window-binary.mjs +0 -482
  38. package/generated/wasm/snippets/ironcalc_base-89b4f49381e1e289/inline0.js +0 -45
  39. package/generated/wasm/xlsx_substrate_wasm.d.ts +0 -336
  40. package/generated/wasm/xlsx_substrate_wasm.js +0 -2108
  41. package/generated/wasm/xlsx_substrate_wasm_bg.wasm +0 -0
  42. package/generated/wasm/xlsx_substrate_wasm_bg.wasm.d.ts +0 -105
@@ -1,4 +1,5 @@
1
1
  import type { XlsxBlocker, XlsxCellAddress, XlsxCellRange, XlsxReadbackEnvelope, XlsxRuntimeActor, XlsxScopeHandle, XlsxVerdict } from "../shared.ts";
2
+ import type { XlsxRuntimeAuditEnvelope, XlsxRuntimeCellReadback, XlsxRuntimeUndoBoundary, XlsxRuntimeWarning, XlsxSessionVolatileInputs, XlsxWorkflowContextInput } from "../runtime/types.ts";
2
3
  export type XlsxAiBlockerCode = "unsupported-action" | "unsupported-reference" | "ambiguous-reference" | "invalid-target" | "scope-validation-failed" | "runtime-refused" | "runtime-blocked" | "kernel-stale" | "kernel-running" | "kernel-adapter-unavailable" | "kernel-output-too-large" | "kernel-action-requires-host";
3
4
  export interface XlsxAiBlocker extends XlsxBlocker {
4
5
  readonly code: XlsxAiBlockerCode;
@@ -211,9 +212,11 @@ export interface XlsxAiReplacementProposal {
211
212
  readonly cells: readonly XlsxRangeWriteCell[];
212
213
  };
213
214
  /**
214
- * Optimistic concurrency: must be an identity previously handed out by a
215
- * receipt or readback; refused when it no longer matches the current
216
- * session identity. Opaque — never synthesized by callers.
215
+ * Optimistic concurrency on the bytes and scope path: compared with the
216
+ * workbook's STATE SHA (`crates/sheets-scope/src/replacement.rs`,
217
+ * `validate_scope_replacement`), never with a session identity. The
218
+ * session AI lane (`XlsxAiSessionProposal`) carries `expectedSessionFence`
219
+ * instead (design record Q1). Opaque — never synthesized by callers.
217
220
  */
218
221
  readonly expectedCanonicalHash?: string;
219
222
  readonly reason?: string;
@@ -318,3 +321,445 @@ export interface XlsxAiUnsupportedActionResult {
318
321
  }
319
322
  export type XlsxAiUnsupportedAction = "ai.actions.solveGoalSeek" | "ai.actions.refreshPivot" | "ai.actions.updateChartSource" | "ai.exportReviewedWorkbook";
320
323
  export declare function aiUnsupportedAction(action: XlsxAiUnsupportedAction): XlsxAiUnsupportedActionResult;
324
+ /**
325
+ * The session fence (Q1): `xsf1:e:<epoch32hex>:<identity64hex>` at revision
326
+ * >= 1, `xsf1:r:<identity64hex>` at revision 0. Never composed by callers;
327
+ * echoed from the last AI result. A bare state SHA is refused
328
+ * `input:fence-format`.
329
+ */
330
+ export type XlsxSessionFence = `xsf1:e:${string}:${string}` | `xsf1:r:${string}`;
331
+ export interface XlsxAiSessionStamp {
332
+ readonly sessionFence: XlsxSessionFence;
333
+ readonly sessionEpoch: string;
334
+ /** Advisory, never compared. */
335
+ readonly revision: number;
336
+ }
337
+ /**
338
+ * The post-drain fence minted inside a commit call (Q1 item 5): the wire shape
339
+ * is `{epoch, revision, identity, sessionFence}`; the session epoch travels as
340
+ * `epoch` here and as `sessionEpoch` on the receipt's top-level stamp.
341
+ */
342
+ export interface XlsxAiSettledFence {
343
+ readonly epoch: string;
344
+ /** Advisory, never compared. */
345
+ readonly revision: number;
346
+ readonly identity: string;
347
+ readonly sessionFence: XlsxSessionFence;
348
+ }
349
+ export type XlsxAiReplacementOperation = "cell-set-value" | "cell-set-formula" | "cell-clear" | "range-write";
350
+ /** A typed cell value, the shape the kernel DTOs already use. */
351
+ export type XlsxAiCellValue = {
352
+ readonly kind: "number";
353
+ readonly value: string;
354
+ } | {
355
+ readonly kind: "text";
356
+ readonly value: string;
357
+ } | {
358
+ readonly kind: "boolean";
359
+ readonly value: boolean;
360
+ } | {
361
+ readonly kind: "error";
362
+ readonly value: string;
363
+ };
364
+ export type XlsxAiRangeWriteCell = {
365
+ readonly kind: "value";
366
+ readonly value: XlsxAiCellValue;
367
+ } | {
368
+ readonly kind: "formula";
369
+ readonly formula: string;
370
+ readonly cachedValue?: XlsxAiCellValue;
371
+ } | {
372
+ readonly kind: "clear";
373
+ };
374
+ /**
375
+ * One replacement proposal on the agent lane. The payload rides the field
376
+ * its operation names: `value` (cell-set-value), `formula` + `cachedValue`
377
+ * (cell-set-formula), `cells` (range-write); cell-clear carries none.
378
+ */
379
+ export interface XlsxAiSessionProposal {
380
+ readonly scopeId?: string;
381
+ readonly handle: XlsxScopeHandle;
382
+ readonly operation: XlsxAiReplacementOperation;
383
+ readonly value?: XlsxAiCellValue;
384
+ readonly formula?: string;
385
+ readonly cachedValue?: XlsxAiCellValue;
386
+ readonly cells?: readonly XlsxAiRangeWriteCell[];
387
+ /** Required on the agent lane's single-proposal verbs. */
388
+ readonly expectedSessionFence: XlsxSessionFence;
389
+ readonly reason?: string;
390
+ }
391
+ /**
392
+ * D8: the AI lane's one refusal shape. Structurally `Omit<EnsembleRefusal,
393
+ * "recommendedRoute"> & { target?: XlsxScopeHandle }`; the parity with the
394
+ * root `EnsembleRefusal` is asserted by a root-level test only (the bindings
395
+ * never import the repository's `src/`).
396
+ */
397
+ export interface XlsxAiRefusal {
398
+ readonly code: string;
399
+ readonly category: "input" | "unresolved-target" | "ambiguous-target" | "unsupported" | "warning" | "blocked";
400
+ readonly message: string;
401
+ readonly nextStep: string;
402
+ readonly ownerRoute?: string;
403
+ readonly requirement?: {
404
+ readonly kind: "input" | "context" | "binding" | "capability" | "authority" | "evidence" | "validation";
405
+ readonly detail: string;
406
+ };
407
+ readonly retry?: "correct-input" | "refresh-context" | "resolve-scope" | "obtain-authority" | "supply-evidence" | "after-implementation" | "after-repair";
408
+ readonly target?: XlsxScopeHandle;
409
+ }
410
+ /**
411
+ * §5.5 under Q8's fold (R-XB5-6): the one export's answer to an unknown
412
+ * `op` (the Rust `AiUnknownOpExportDto`): a `verdict: "refused"` DTO naming
413
+ * the op it could not dispatch, carrying an `input:malformed-body` refusal,
414
+ * and with NO stamp (nothing was borrowed: there is no operation to fence).
415
+ * The typed methods never send an unknown op, so the bindings' normalizer
416
+ * surfaces this answer as the thrown `XlsxAiUnknownOpRefusalError`.
417
+ */
418
+ export interface XlsxAiUnknownOpRefusal {
419
+ readonly verdict: Extract<XlsxVerdict, "refused">;
420
+ readonly op: string;
421
+ readonly refusal: XlsxAiRefusal;
422
+ }
423
+ export interface XlsxAiCellReadback {
424
+ readonly sheetId: string;
425
+ readonly address: XlsxCellAddress;
426
+ readonly valueKind?: "number" | "text" | "boolean" | "error";
427
+ readonly value?: string;
428
+ readonly formulaText?: string;
429
+ readonly blank: boolean;
430
+ }
431
+ export interface XlsxAiScopeBundleReadRequest {
432
+ readonly handle: XlsxScopeHandle;
433
+ readonly expectedSessionFence: XlsxSessionFence;
434
+ readonly workflowContext?: XlsxWorkflowContextInput;
435
+ }
436
+ export interface XlsxAiSessionScopeBundle {
437
+ readonly handle: XlsxScopeHandle;
438
+ readonly classifications: readonly string[];
439
+ readonly capability: {
440
+ readonly mutate: "supported" | "warn-and-proceed" | "hard-refusal";
441
+ readonly inspect: "supported" | "warn-and-proceed" | "hard-refusal";
442
+ readonly blockers: readonly XlsxBlocker[];
443
+ };
444
+ readonly readback: {
445
+ readonly label: string;
446
+ readonly sheetId?: string;
447
+ readonly address?: XlsxCellAddress;
448
+ readonly range?: XlsxCellRange;
449
+ readonly valueKindSummary?: string;
450
+ readonly formulaText?: string;
451
+ };
452
+ readonly geometry: {
453
+ readonly status: "unavailable" | "not-projected" | "projected";
454
+ readonly projection?: "complete" | "clipped";
455
+ };
456
+ readonly hasBlockingWorkflowFact: boolean;
457
+ }
458
+ export interface XlsxAiSessionScopeBundleResult extends XlsxAiSessionStamp {
459
+ readonly verdict: Extract<XlsxVerdict, "available" | "refused">;
460
+ readonly bundle?: XlsxAiSessionScopeBundle;
461
+ readonly refusal?: XlsxAiRefusal;
462
+ }
463
+ export interface XlsxAiSessionReferenceRequest extends XlsxAiReferenceQuery {
464
+ readonly expectedSessionFence: XlsxSessionFence;
465
+ }
466
+ export interface XlsxAiSessionReferenceResult extends XlsxAiSessionStamp {
467
+ readonly verdict: Extract<XlsxVerdict, "available" | "refused">;
468
+ readonly query: string;
469
+ readonly matches: readonly XlsxAiReferenceMatch[];
470
+ readonly blockers: readonly XlsxAiBlocker[];
471
+ readonly refusal?: XlsxAiRefusal;
472
+ }
473
+ export interface XlsxAiScopeReadResult extends XlsxAiSessionStamp {
474
+ readonly verdict: Extract<XlsxVerdict, "available" | "refused">;
475
+ readonly handle?: XlsxScopeHandle;
476
+ readonly cells: readonly XlsxAiCellReadback[];
477
+ readonly refusal?: XlsxAiRefusal;
478
+ }
479
+ export interface XlsxAiScopeNeighborhoodRequest {
480
+ readonly handle: XlsxScopeHandle;
481
+ readonly direction?: "precedents" | "dependents" | "both";
482
+ /** 1..=2 */
483
+ readonly depth: number;
484
+ readonly limit?: number;
485
+ readonly expectedSessionFence: XlsxSessionFence;
486
+ }
487
+ export interface XlsxAiNeighborhoodNode {
488
+ readonly kind: string;
489
+ readonly key: string;
490
+ readonly depth: number;
491
+ readonly sheetId?: string;
492
+ readonly address?: XlsxCellAddress;
493
+ readonly formula?: string;
494
+ }
495
+ export interface XlsxAiScopeNeighborhoodResult extends XlsxAiSessionStamp {
496
+ readonly verdict: Extract<XlsxVerdict, "available" | "refused">;
497
+ readonly status: "measured" | "unmeasured" | "refused";
498
+ readonly reason?: "not-mounted" | "not-synced" | "needs-full-recalc" | "seeds-unresolved";
499
+ readonly refusal?: XlsxAiRefusal;
500
+ readonly seeds: readonly XlsxAiNeighborhoodNode[];
501
+ readonly precedents: readonly XlsxAiNeighborhoodNode[];
502
+ readonly dependents: readonly XlsxAiNeighborhoodNode[];
503
+ readonly truncated: boolean;
504
+ }
505
+ /**
506
+ * T-O (WP-DOC P4-prep-2, R-WPD-1): the calc-graph adjacency export's request —
507
+ * the fence (checked first, like the eight) and a `limit` on the sorted edge
508
+ * list (the bridge's default when absent). The projector's read only.
509
+ */
510
+ export interface XlsxAiCalcGraphEdgesRequest {
511
+ readonly limit?: number;
512
+ readonly expectedSessionFence: XlsxSessionFence;
513
+ }
514
+ /** One `(dependent, precedent)` pair of the forward adjacency; `key`s are the neighborhood's `key`, kinds `GraphNode::kind()`. */
515
+ export interface XlsxAiCalcGraphEdge {
516
+ readonly dependent: string;
517
+ readonly precedent: string;
518
+ readonly dependentKind: "cell" | "range" | "output-region" | "defined-name" | "table" | string;
519
+ readonly precedentKind: "cell" | "range" | "output-region" | "defined-name" | "table" | string;
520
+ }
521
+ /** One composite endpoint of the returned edges (§0.27): a defined name's name / raw text / sheet scope, a table's display name, the covering sheet + range. */
522
+ export interface XlsxAiCalcGraphDescriptor {
523
+ readonly key: string;
524
+ readonly kind: "range" | "output-region" | "defined-name" | "table" | string;
525
+ readonly name?: string;
526
+ readonly rawText?: string;
527
+ readonly sheetScope?: string;
528
+ readonly sheetId?: string;
529
+ readonly range?: XlsxCellRange;
530
+ }
531
+ /**
532
+ * The adjacency export's answer: `edges` SORTED by `(dependent.stable_key,
533
+ * precedent.stable_key)` (the sort is the contract), `descriptors` one per
534
+ * composite endpoint of the returned edges, `edgeCount` the total before
535
+ * `limit`, `truncated` when the list is a prefix. `unmeasured` carries the
536
+ * graph-currency reason and no edges — never an empty list read as measured.
537
+ */
538
+ export interface XlsxAiCalcGraphEdgesResult extends XlsxAiSessionStamp {
539
+ readonly verdict: Extract<XlsxVerdict, "available" | "refused">;
540
+ readonly status: "measured" | "unmeasured" | "refused";
541
+ readonly reason?: "not-mounted" | "not-synced" | "needs-full-recalc" | "seeds-unresolved";
542
+ readonly refusal?: XlsxAiRefusal;
543
+ readonly edges: readonly XlsxAiCalcGraphEdge[];
544
+ readonly descriptors: readonly XlsxAiCalcGraphDescriptor[];
545
+ readonly edgeCount: number;
546
+ readonly limit: number;
547
+ readonly truncated: boolean;
548
+ }
549
+ export interface XlsxAiPreviewRequest {
550
+ readonly proposal: XlsxAiSessionProposal;
551
+ readonly actor?: XlsxRuntimeActor;
552
+ readonly fidelity?: "guards-only" | "simulated";
553
+ readonly workflowContext?: XlsxWorkflowContextInput;
554
+ }
555
+ export type XlsxAiImpact = {
556
+ readonly status: "measured";
557
+ readonly dirtyFormulaCells: number;
558
+ readonly sample: readonly XlsxScopeHandle[];
559
+ } | {
560
+ readonly status: "unmeasured";
561
+ readonly reason: string;
562
+ };
563
+ /**
564
+ * XBC-2 (design record Q2 item 7): the simulated arm's size gate, answered
565
+ * whenever `fidelity: "simulated"` was requested AND the preview reached
566
+ * the gate (admitted or not): a preview refused BEFORE it — a malformed or
567
+ * stale fence, a proposal that does not resolve — answers `guards-only`
568
+ * with neither the gate nor the arm (R-XBC2-2 item 5). Both facts are
569
+ * deterministic session facts: populated cells over every sheet, and the
570
+ * loaded package's part bytes.
571
+ */
572
+ export interface XlsxAiSimulatedGate {
573
+ readonly admitted: boolean;
574
+ readonly populatedCells: number;
575
+ readonly packageBytes: number;
576
+ /** 10 000 */
577
+ readonly maxPopulatedCells: number;
578
+ /** 5 MiB */
579
+ readonly maxPackageBytes: number;
580
+ }
581
+ /**
582
+ * XBC-2 R1 (R-XBC2-1 item 2): the post-apply CONTENT facts of a workbook —
583
+ * its state SHA (`readRuntimeSessionIntegrity`'s `canonicalHash`, the digest
584
+ * of the whole content) and the changed-cells digest over the replacement's
585
+ * footprint (one producer in sheets-ai: sheet, row, column, the formula's
586
+ * display spelling, the value by kind). The preview's
587
+ * `simulated.predictedAfterState` is the clone's; the apply's `afterState`
588
+ * is the resident's after its commit step and before the drain. The service
589
+ * compares the two pairs; the eval's `cloneEqualsApplyOverMatrix` compares
590
+ * exactly these (never identities, which are op-chain tokens equal by
591
+ * construction once the fence passes).
592
+ */
593
+ export interface XlsxAiAfterState {
594
+ readonly stateSha: string;
595
+ readonly changedCellsDigest: string;
596
+ }
597
+ /**
598
+ * XBC-2: what the simulated (clone) arm answered; present whenever it ran
599
+ * (`fidelity: "simulated"`: agreed, or diverged and the preview refused).
600
+ * The arm runs sheets-scope's bytes-path twin on a clone of the resident
601
+ * (R-XBC2-1 item 3), so `verdict` is an independent oracle's. On an agreed
602
+ * apply `predictedAfterState` is the clone's post-apply content; the service
603
+ * pins it on the staged subject (`/ai/propose` with `fidelity: "simulated"`)
604
+ * and compares it at `/ai/apply` with the receipt's `afterState` (a mismatch
605
+ * is the `ai.preview-arm-divergence` line and the
606
+ * `internal:preview-arm-divergence` warning on the executed outcome).
607
+ */
608
+ export interface XlsxAiSimulatedPreview {
609
+ /**
610
+ * The clone arm's own verdict. On a validated preview it equals the guards-only verdict on the APPLY-PHASE warning set
611
+ * (a disagreement there is the fail-closed refusal); it reads `applied-with-warnings` where the guards-only arm read
612
+ * `applied` exactly when a commit-phase-only warning rides it (R-XBC2-2 item 2), which `validation` then carries.
613
+ */
614
+ readonly verdict: "applied" | "applied-with-warnings" | "refused";
615
+ readonly changedCells: number;
616
+ /** The clone's post-apply content; absent when the clone wrote nothing (a refusal both arms agree on, a divergence). */
617
+ readonly predictedAfterState?: XlsxAiAfterState;
618
+ /** On a divergence where the clone arm refused: the clone arm's own roster row (its blocker code and evidence). */
619
+ readonly cloneRefusal?: XlsxAiRefusal;
620
+ }
621
+ export interface XlsxAiPreviewResult extends XlsxAiSessionStamp {
622
+ readonly verdict: Extract<XlsxVerdict, "validated" | "refused">;
623
+ /**
624
+ * The guards-only arm's verdict and warnings; when `fidelity` is
625
+ * `simulated`, the clone arm's (R-XBC2-2 item 2): the same apply-phase
626
+ * warning set by construction, plus the commit-phase-only warnings the
627
+ * apply will report (`package-diagnostics-present` on a session whose
628
+ * package carries a warning/error-severity diagnostic,
629
+ * `calculation-diagnostics-present`), which the agreement rule excludes
630
+ * on both arms and surfaces here — so `verdict` reads
631
+ * `applied-with-warnings` exactly when the apply will.
632
+ */
633
+ readonly validation: {
634
+ readonly verdict?: Extract<XlsxVerdict, "applied" | "applied-with-warnings">;
635
+ readonly warnings: readonly XlsxRuntimeWarning[];
636
+ readonly refusal?: XlsxAiRefusal;
637
+ };
638
+ /**
639
+ * `simulated` when the clone arm ran and agreed (under the gate, on
640
+ * request); `guards-only` otherwise — including above the gate, where the
641
+ * `preview:simulated-unavailable` warning rides `warnings`.
642
+ */
643
+ readonly fidelity: "guards-only" | "simulated";
644
+ readonly before: readonly XlsxAiCellReadback[];
645
+ /** The clone's post-apply cells over the footprint when `fidelity` is `simulated`; the projected cells otherwise. */
646
+ readonly proposed: readonly XlsxAiCellReadback[];
647
+ /**
648
+ * When `fidelity` is `simulated`: measured on a graph built on the clone's post-apply workbook (Q2 item 6 on the
649
+ * clone) when every written address resolves on that graph; when one does not (a cleared target is blank after the
650
+ * apply), the pre-edit address-seeded impact the guards-only arm measured, unmarked (R-XBC2-2 item 5 states the
651
+ * condition; the DTO carries no marker of which graph a `measured` impact came from).
652
+ */
653
+ readonly impact: XlsxAiImpact;
654
+ /** `preview:simulated-unavailable` when the simulated arm was asked for and the gate excluded it. */
655
+ readonly warnings: readonly XlsxAiRefusal[];
656
+ /** XBC-2, optional/additive: present whenever `fidelity: "simulated"` was requested. */
657
+ readonly simulatedGate?: XlsxAiSimulatedGate;
658
+ /**
659
+ * XBC-2, optional/additive: present whenever the clone arm RAN (`fidelity: "simulated"` admitted by the gate) —
660
+ * agreed or diverged. On a divergence the refused preview carries it with the clone arm's own `verdict` and, when
661
+ * the clone refused, its `cloneRefusal`; absent when the gate excluded the arm (`simulatedGate` then says why).
662
+ */
663
+ readonly simulated?: XlsxAiSimulatedPreview;
664
+ }
665
+ export interface XlsxAiValidateRequest {
666
+ readonly proposal: XlsxAiSessionProposal;
667
+ readonly actor?: XlsxRuntimeActor;
668
+ readonly workflowContext?: XlsxWorkflowContextInput;
669
+ }
670
+ export interface XlsxAiValidateResult extends XlsxAiSessionStamp {
671
+ readonly verdict: Extract<XlsxVerdict, "validated" | "refused">;
672
+ readonly warnings: readonly XlsxRuntimeWarning[];
673
+ readonly refusal?: XlsxAiRefusal;
674
+ }
675
+ export interface XlsxAiApplyProposalRequest {
676
+ readonly proposal: XlsxAiSessionProposal;
677
+ readonly actor?: XlsxRuntimeActor;
678
+ /** The drain's clock and seed (D12). */
679
+ readonly volatileInputs?: XlsxSessionVolatileInputs;
680
+ readonly workflowContext?: XlsxWorkflowContextInput;
681
+ /**
682
+ * XBC-2 R1, optional/additive: answer `afterState` on the receipt (the resident's post-commit state SHA and
683
+ * changed-cells digest). The service sets it exactly when the staged subject carries a clone-arm prediction.
684
+ */
685
+ readonly attestAfterState?: boolean;
686
+ }
687
+ export interface XlsxAiFenceTriple {
688
+ readonly epoch: string;
689
+ readonly revision: number;
690
+ readonly identity: string;
691
+ }
692
+ export interface XlsxAiDrain {
693
+ readonly status: "applied" | "noop" | "refused" | "failed";
694
+ readonly recalc: "dirty" | "full" | "none";
695
+ readonly evaluatedCellCount?: number;
696
+ readonly blocker?: XlsxAiRefusal;
697
+ readonly error?: string;
698
+ }
699
+ /**
700
+ * `XlsxAiApplyReceipt` (§5.6). `sessionFence` is the settled fence, absent
701
+ * when the drain failed or the session was disposed in the call.
702
+ */
703
+ export interface XlsxAiApplyReceipt {
704
+ readonly verdict: Extract<XlsxVerdict, "applied" | "applied-with-warnings" | "refused">;
705
+ readonly dispatch: XlsxAiFenceTriple;
706
+ /** The apply step's own bookkeeping; the Q4 predicate reads it. */
707
+ readonly receipt?: XlsxAiFenceTriple;
708
+ readonly drain?: XlsxAiDrain;
709
+ /** Post-drain; absent when `drain.status` is `failed`. */
710
+ readonly settled?: XlsxAiSettledFence;
711
+ readonly undoBoundary?: XlsxRuntimeUndoBoundary;
712
+ readonly audit?: XlsxRuntimeAuditEnvelope;
713
+ readonly cells: readonly XlsxRuntimeCellReadback[];
714
+ readonly warnings: readonly XlsxRuntimeWarning[];
715
+ readonly refusal?: XlsxAiRefusal;
716
+ /** XBC-2 R1, optional/additive: the resident's post-commit content facts (before the drain), present exactly when `attestAfterState` was asked and the apply step passed. */
717
+ readonly afterState?: XlsxAiAfterState;
718
+ readonly defectAfterCheck: boolean;
719
+ readonly sessionDisposed: boolean;
720
+ readonly sessionFence?: XlsxSessionFence;
721
+ readonly sessionEpoch: string;
722
+ readonly revision: number;
723
+ }
724
+ export interface XlsxAiPlan {
725
+ /** At most 50 pairwise disjoint replacement steps. */
726
+ readonly steps: readonly Omit<XlsxAiSessionProposal, "expectedSessionFence">[];
727
+ readonly expectedSessionFence: XlsxSessionFence;
728
+ }
729
+ export interface XlsxAiApplyPlanRequest {
730
+ readonly plan: XlsxAiPlan;
731
+ readonly actor?: XlsxRuntimeActor;
732
+ /** Applies and reverts every step; never bookkeeps or drains. */
733
+ readonly dryRun?: boolean;
734
+ readonly volatileInputs?: XlsxSessionVolatileInputs;
735
+ readonly workflowContext?: XlsxWorkflowContextInput;
736
+ }
737
+ export interface XlsxAiPlanStepReceipt {
738
+ readonly step: number;
739
+ readonly scopeId: string;
740
+ readonly verdict: Extract<XlsxVerdict, "applied" | "applied-with-warnings">;
741
+ readonly warnings: readonly XlsxRuntimeWarning[];
742
+ }
743
+ export interface XlsxAiPlanReceipt {
744
+ readonly verdict: Extract<XlsxVerdict, "applied" | "validated" | "refused">;
745
+ readonly dryRun: boolean;
746
+ /**
747
+ * 64 hex once the plan was read; the boundary id embeds its first 16
748
+ * characters. Empty on the two pre-digest refusal arms (malformed plan body,
749
+ * malformed or stale plan fence), where no plan was parsed.
750
+ */
751
+ readonly planDigest: string;
752
+ readonly dispatch: XlsxAiFenceTriple;
753
+ readonly receipt?: XlsxAiFenceTriple;
754
+ readonly drain?: XlsxAiDrain;
755
+ readonly settled?: XlsxAiSettledFence;
756
+ readonly undoBoundary?: XlsxRuntimeUndoBoundary;
757
+ readonly audit?: XlsxRuntimeAuditEnvelope;
758
+ readonly steps: readonly XlsxAiPlanStepReceipt[];
759
+ readonly failedStep?: number;
760
+ readonly refusal?: XlsxAiRefusal;
761
+ readonly sessionDisposed: boolean;
762
+ readonly sessionFence?: XlsxSessionFence;
763
+ readonly sessionEpoch: string;
764
+ readonly revision: number;
765
+ }
package/dist/index.d.ts CHANGED
@@ -35,9 +35,13 @@ export interface XlsxBrowserWorkerPosture {
35
35
  }
36
36
  export declare function getBindingStatus(): XlsxSubstrateBindingStatus;
37
37
  export type { XlsxBindingNativeBridge, XlsxBlocker, XlsxCellAddress, XlsxCellRange, XlsxReadbackEnvelope, XlsxRuntimeActor, XlsxScopeHandle, XlsxVerdict } from "./shared.ts";
38
- export { aiKernelActionRequiresHost, aiUnsupportedAction } from "./ai/index.ts";
39
- 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 } from "./ai/index.ts";
40
- 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, XlsxTableAppendRowRequest, XlsxTableAppendRowResult, XlsxSheetTabMutationOperation, XlsxSheetTabMutationRequest, XlsxSheetTabMutationResult, 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";
38
+ export { BRIDGE_CAPABILITIES, BRIDGE_VERSION } from "./wasm/bridge-contract.ts";
39
+ export { aiKernelActionRequiresHost, aiUnsupportedAction, createXlsxAiMutationBridge, XLSX_AI_MUTATION_RANGE_FILL_BLOCKER, XLSX_AI_MUTATION_WORKBOOK_MISMATCH_BLOCKER } from "./ai/index.ts";
40
+ export { CONDUCTOR_AI_FENCE, XLSX_AI_AGENT_TOOLS } from "./ai/index.ts";
41
+ export type { XlsxAiAgentRefusalCategory, XlsxAiAgentToolEffect, XlsxAiAgentToolFence, XlsxAiAgentToolHttp, XlsxAiAgentToolInput, XlsxAiAgentToolRecord, XlsxAiApplyToolInput, XlsxAiAttestation, XlsxAiBundleToolResult, XlsxAiDiscardAnswer, XlsxAiDiscardToolInput, XlsxAiDiscardToolResult, XlsxAiImpactMeasured, XlsxAiImpactStatus, XlsxAiImpactUnmeasured, XlsxAiInvalidationCause, XlsxAiMutationOutcome, XlsxAiNeighborhoodToolResult, XlsxAiOutcomeInvalidation, XlsxAiOutcomeWarning, XlsxAiPlanToolBody, XlsxAiPlanToolInput, XlsxAiPlanToolStep, XlsxAiPreviewToolInput, XlsxAiPreviewToolResult, XlsxAiPreviewToolValidation, XlsxAiProposePlanToolInput, XlsxAiProposeProposalToolInput, XlsxAiProposeToolInput, XlsxAiProposeUndoToolInput, XlsxAiResolveToolResult, XlsxAiScopeReadPage, XlsxAiScopeReadToolInput, XlsxAiScopeReadToolResult, XlsxAiStaleCause, XlsxAiStaleTaggedRefusal, XlsxAiUndoAttestation, XlsxAiUndoSubjectToolInput, XlsxAiUndoToolInput, XlsxAiValidateToolInput, XlsxAiValidateToolResult } from "./ai/index.ts";
42
+ export type { XlsxAiMutationApplyResult, XlsxAiMutationBridge, XlsxAiMutationBridgeOptions, XlsxAiMutationBridgeSession, XlsxAiMutationProposal, XlsxAiMutationProposeInput, XlsxAiMutationProposeResult, XlsxAiMutationReadback } from "./ai/index.ts";
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
+ 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";
41
45
  export { classifyXlsxUiState } from "./ui/index.ts";
42
46
  export { createXlsxWasmBridge, loadGeneratedXlsxWasmBridge, supportsRuntimeSessionMutations } from "./wasm/index.ts";
43
47
  export type { XlsxRuntimeSessionMutationBridge, XlsxWasmBridge, XlsxWasmBridgeLoadResult, XlsxWasmBridgeStatus } from "./wasm/index.ts";
package/dist/index.js CHANGED
@@ -39,7 +39,17 @@ export function getBindingStatus() {
39
39
  "validateKernelAction",
40
40
  "validateReplacementScope",
41
41
  "applyReplacementScope",
42
- "unsupportedAction"
42
+ "unsupportedAction",
43
+ // XB5: the eight session-AI verbs (ai-session-agent-v1), plus T-O's adjacency export (WP-DOC P4-prep-2).
44
+ "getRuntimeSessionScopeBundle",
45
+ "resolveRuntimeSessionReference",
46
+ "readRuntimeSessionScope",
47
+ "readRuntimeSessionScopeNeighborhood",
48
+ "readRuntimeSessionCalcGraphEdges",
49
+ "previewRuntimeSessionAiProposal",
50
+ "validateRuntimeSessionAiProposal",
51
+ "applyRuntimeSessionAiProposal",
52
+ "applyRuntimeSessionAiPlan"
43
53
  ],
44
54
  uiSurface: [
45
55
  "bindSession",
@@ -63,7 +73,15 @@ export function getBindingStatus() {
63
73
  ]
64
74
  };
65
75
  }
66
- export { aiKernelActionRequiresHost, aiUnsupportedAction } from "./ai/index.js";
76
+ // R5 (runtime 0.2.0): the bridge version this package mounts and the
77
+ // capability list every mounted bridge advertises, from the package root so
78
+ // a host can read them without loading the wasm entry.
79
+ export { BRIDGE_CAPABILITIES, BRIDGE_VERSION } from "./wasm/bridge-contract.js";
80
+ export { aiKernelActionRequiresHost, aiUnsupportedAction, createXlsxAiMutationBridge, XLSX_AI_MUTATION_RANGE_FILL_BLOCKER, XLSX_AI_MUTATION_WORKBOOK_MISMATCH_BLOCKER } from "./ai/index.js";
81
+ // XB11 (Q8 "Bindings package surface", Q9): the Conductor agent metadata and
82
+ // the ONE fence record, so the route guard and the catalogue generator import
83
+ // one constant through the package's `.` entry.
84
+ export { CONDUCTOR_AI_FENCE, XLSX_AI_AGENT_TOOLS } from "./ai/index.js";
67
85
  export { classifyXlsxUiState } from "./ui/index.js";
68
86
  export { createXlsxWasmBridge, loadGeneratedXlsxWasmBridge, supportsRuntimeSessionMutations } from "./wasm/index.js";
69
87
  export { createXlsxWorkbookMutationRouter } from "./wasm/session-router.js";
@@ -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, XlsxTableAppendRowRequest, XlsxTableAppendRowResult, XlsxSheetTabMutationOperation, XlsxSheetTabMutationRequest, XlsxSheetTabMutationResult, 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, 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";
2
2
  export { XLSX_BORDER_STYLES } from "./types.ts";
@@ -839,6 +839,8 @@ export interface XlsxOutlineGroupVisibilityResult {
839
839
  readonly undoBoundary?: XlsxRuntimeUndoBoundary;
840
840
  readonly blockers: readonly XlsxBlocker[];
841
841
  readonly warnings: readonly XlsxRuntimeWarning[];
842
+ /** UX-P-102 P2b: present only on `*InSession` results (strict superset receipt). */
843
+ readonly session?: XlsxRuntimeSessionMutationReceipt;
842
844
  }
843
845
  export type XlsxOutlineLevelOperation = "group" | "ungroup";
844
846
  /**
@@ -869,6 +871,8 @@ export interface XlsxOutlineLevelResult {
869
871
  readonly undoBoundary?: XlsxRuntimeUndoBoundary;
870
872
  readonly blockers: readonly XlsxBlocker[];
871
873
  readonly warnings: readonly XlsxRuntimeWarning[];
874
+ /** UX-P-102 P2b: present only on `*InSession` results (strict superset receipt). */
875
+ readonly session?: XlsxRuntimeSessionMutationReceipt;
872
876
  }
873
877
  export type XlsxSheetStructureAxis = "row" | "column";
874
878
  export type XlsxSheetStructureOperation = "insert-before" | "insert-after" | "delete";
@@ -914,7 +918,7 @@ export interface XlsxSheetStructureMutationResult {
914
918
  export interface XlsxTableAppendRowRequest {
915
919
  readonly sheetId: string;
916
920
  readonly tableId: string;
917
- readonly values: readonly XlsxKernelCellValue[];
921
+ readonly values: readonly XlsxTableAppendCellValue[];
918
922
  readonly actor?: XlsxRuntimeActor;
919
923
  readonly workflowContext?: XlsxWorkflowContextInput;
920
924
  }
@@ -992,6 +996,8 @@ export interface XlsxRangeFilterResult {
992
996
  readonly undoBoundary?: XlsxRuntimeUndoBoundary;
993
997
  readonly blockers: readonly XlsxBlocker[];
994
998
  readonly warnings: readonly XlsxRuntimeWarning[];
999
+ /** UX-P-102 P2b: present only on `*InSession` results (strict superset receipt). */
1000
+ readonly session?: XlsxRuntimeSessionMutationReceipt;
995
1001
  }
996
1002
  export interface XlsxSortColumn {
997
1003
  /** Absolute 1-based worksheet column; must fall inside the sort range. */
@@ -1018,6 +1024,8 @@ export interface XlsxRangeSortResult {
1018
1024
  readonly undoBoundary?: XlsxRuntimeUndoBoundary;
1019
1025
  readonly blockers: readonly XlsxBlocker[];
1020
1026
  readonly warnings: readonly XlsxRuntimeWarning[];
1027
+ /** UX-P-102 P2b: present only on `*InSession` results (strict superset receipt). */
1028
+ readonly session?: XlsxRuntimeSessionMutationReceipt;
1021
1029
  }
1022
1030
  export type XlsxSheetTabMutationOperation = "add" | "rename" | "duplicate" | "delete" | "move-left" | "move-right";
1023
1031
  export interface XlsxSheetTabMutationRequest {
@@ -1042,6 +1050,46 @@ export interface XlsxSheetTabMutationResult {
1042
1050
  /** Present only on `*InSession` results (strict superset receipt). */
1043
1051
  readonly session?: XlsxRuntimeSessionMutationReceipt;
1044
1052
  }
1053
+ /** X5-U-023 (bridge v44): one Name Manager edit. */
1054
+ export type XlsxDefinedNameMutationOperation = "create" | "update" | "delete";
1055
+ export interface XlsxDefinedNameMutationRequest {
1056
+ readonly operation: XlsxDefinedNameMutationOperation;
1057
+ /** The name to create, or the existing name an update or delete addresses (Excel's name fold). */
1058
+ readonly name: string;
1059
+ /** The scope sheet's id; absent for a workbook-level name. An update keeps the scope. */
1060
+ readonly sheetScope?: string;
1061
+ /** Update only: the new spelling. */
1062
+ readonly newName?: string;
1063
+ /** The "Refers to" body, with or without its leading `=`; required for create. */
1064
+ readonly refersTo?: string;
1065
+ /** The sheet in view: a bare reference body on a workbook-level name is qualified with it. */
1066
+ readonly activeSheetId?: string;
1067
+ readonly actor?: XlsxRuntimeActor;
1068
+ readonly workflowContext?: XlsxWorkflowContextInput;
1069
+ }
1070
+ /** The name as the edit left it (for a delete, the name removed). */
1071
+ export interface XlsxDefinedNameReadback {
1072
+ readonly name: string;
1073
+ readonly sheetScope?: string;
1074
+ /** The body as stored: no leading `=`, Excel's `_xlfn.` storage prefixes applied. */
1075
+ readonly refersTo: string;
1076
+ /** The sheet and range the body names when it is one sheet range. */
1077
+ readonly targetSheetId?: string;
1078
+ readonly targetRange?: XlsxCellRange;
1079
+ }
1080
+ export interface XlsxDefinedNameMutationResult {
1081
+ readonly verdict: XlsxRuntimeCommandVerdict;
1082
+ readonly exportedBytes?: Uint8Array;
1083
+ readonly operation?: XlsxDefinedNameMutationOperation;
1084
+ readonly definedName?: XlsxDefinedNameReadback;
1085
+ readonly audit?: XlsxRuntimeAuditEnvelope;
1086
+ readonly invalidation: XlsxRuntimeInvalidationReceipt;
1087
+ readonly undoBoundary?: XlsxRuntimeUndoBoundary;
1088
+ readonly blockers: readonly XlsxBlocker[];
1089
+ readonly warnings: readonly XlsxRuntimeWarning[];
1090
+ /** Present only on `defineNameInSession` results (strict superset receipt). */
1091
+ readonly session?: XlsxRuntimeSessionMutationReceipt;
1092
+ }
1045
1093
  export type XlsxKernelLanguage = "python" | "sql" | "javascript" | "ai-prompt";
1046
1094
  export type XlsxKernelBindingState = "fresh" | "stale" | "running" | "failed" | "detached";
1047
1095
  export type XlsxKernelCachePosture = "fresh" | "stale" | "missing" | "failed" | "running" | "detached";
@@ -1219,6 +1267,14 @@ export type XlsxKernelCellValue = {
1219
1267
  readonly kind: "error";
1220
1268
  readonly value: string;
1221
1269
  };
1270
+ /**
1271
+ * X5-U-083 (bridge v46): one cell of a table-append row. `{ kind: "empty" }`
1272
+ * leaves the cell empty, so a calculated column takes the column's formula
1273
+ * for the new row, as Excel fills it; any other column stays empty.
1274
+ */
1275
+ export type XlsxTableAppendCellValue = XlsxKernelCellValue | {
1276
+ readonly kind: "empty";
1277
+ };
1222
1278
  export interface XlsxKernelRunDiagnostics {
1223
1279
  readonly accessedReferences: readonly string[];
1224
1280
  readonly stdoutDigest?: string;