@beyondwork/xlsx-substrate-bindings 0.1.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 +189 -0
- package/assets/blank-workbook.xlsx +0 -0
- package/dist/ai/agent-metadata.d.ts +387 -0
- package/dist/ai/agent-metadata.js +227 -0
- package/dist/ai/index.d.ts +5 -1
- package/dist/ai/index.js +6 -0
- package/dist/ai/mutation-bridge.d.ts +82 -0
- package/dist/ai/mutation-bridge.js +179 -0
- package/dist/ai/types.d.ts +468 -3
- package/dist/blank-workbook/index.d.ts +24 -0
- package/dist/blank-workbook/index.js +77 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.js +20 -2
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/types.d.ts +108 -18
- package/dist/wasm/ai-session-bridge.d.ts +97 -0
- package/dist/wasm/ai-session-bridge.js +154 -0
- package/dist/wasm/bridge-contract.d.ts +108 -6
- package/dist/wasm/bridge-contract.js +146 -7
- package/dist/wasm/index.d.ts +43 -2
- package/dist/wasm/index.js +253 -23
- package/dist/wasm/memory-budget.d.ts +77 -0
- package/dist/wasm/memory-budget.js +532 -0
- package/dist/wasm/runtime-guard.d.ts +141 -0
- package/dist/wasm/runtime-guard.js +373 -0
- package/dist/wasm/session-router.d.ts +1 -1
- package/dist/wasm/session-router.js +4 -1
- package/dist/wasm/web.d.ts +18 -3
- package/dist/wasm/web.js +99 -9
- package/generated/wasm-web/xlsx_substrate_wasm.d.ts +66 -0
- package/generated/wasm-web/xlsx_substrate_wasm.js +2488 -2104
- package/generated/wasm-web/xlsx_substrate_wasm_bg.wasm +0 -0
- package/generated/wasm-web/xlsx_substrate_wasm_bg.wasm.d.ts +15 -0
- package/package.json +24 -4
- package/dist/wasm/chart-test-fixture.d.ts +0 -19
- package/dist/wasm/chart-test-fixture.js +0 -42
- package/dist/wasm/media-test-fixture.d.ts +0 -44
- package/dist/wasm/media-test-fixture.js +0 -160
- package/dist/wasm/volatile-test-fixture.d.ts +0 -7
- package/dist/wasm/volatile-test-fixture.js +0 -35
- package/generated/wasm/package.json +0 -3
- package/generated/wasm/sheet-window-binary.mjs +0 -482
- package/generated/wasm/snippets/ironcalc_base-89b4f49381e1e289/inline0.js +0 -45
- package/generated/wasm/xlsx_substrate_wasm.d.ts +0 -336
- package/generated/wasm/xlsx_substrate_wasm.js +0 -2108
- package/generated/wasm/xlsx_substrate_wasm_bg.wasm +0 -0
- package/generated/wasm/xlsx_substrate_wasm_bg.wasm.d.ts +0 -105
package/dist/ai/types.d.ts
CHANGED
|
@@ -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
|
|
215
|
-
*
|
|
216
|
-
*
|
|
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,465 @@ 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
|
+
/**
|
|
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
|
+
*/
|
|
505
|
+
readonly reason?: "not-mounted" | "not-synced" | "needs-full-recalc" | "seeds-unresolved";
|
|
506
|
+
readonly refusal?: XlsxAiRefusal;
|
|
507
|
+
readonly seeds: readonly XlsxAiNeighborhoodNode[];
|
|
508
|
+
readonly precedents: readonly XlsxAiNeighborhoodNode[];
|
|
509
|
+
readonly dependents: readonly XlsxAiNeighborhoodNode[];
|
|
510
|
+
readonly truncated: boolean;
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* T-O (WP-DOC P4-prep-2, R-WPD-1): the calc-graph adjacency export's request —
|
|
514
|
+
* the fence (checked first, like the eight) and a `limit` on the sorted edge
|
|
515
|
+
* list (the bridge's default when absent). The projector's read only.
|
|
516
|
+
*/
|
|
517
|
+
export interface XlsxAiCalcGraphEdgesRequest {
|
|
518
|
+
readonly limit?: number;
|
|
519
|
+
readonly expectedSessionFence: XlsxSessionFence;
|
|
520
|
+
}
|
|
521
|
+
/** One `(dependent, precedent)` pair of the forward adjacency; `key`s are the neighborhood's `key`, kinds `GraphNode::kind()`. */
|
|
522
|
+
export interface XlsxAiCalcGraphEdge {
|
|
523
|
+
readonly dependent: string;
|
|
524
|
+
readonly precedent: string;
|
|
525
|
+
readonly dependentKind: "cell" | "range" | "output-region" | "defined-name" | "table" | string;
|
|
526
|
+
readonly precedentKind: "cell" | "range" | "output-region" | "defined-name" | "table" | string;
|
|
527
|
+
}
|
|
528
|
+
/** 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. */
|
|
529
|
+
export interface XlsxAiCalcGraphDescriptor {
|
|
530
|
+
readonly key: string;
|
|
531
|
+
readonly kind: "range" | "output-region" | "defined-name" | "table" | string;
|
|
532
|
+
readonly name?: string;
|
|
533
|
+
readonly rawText?: string;
|
|
534
|
+
readonly sheetScope?: string;
|
|
535
|
+
readonly sheetId?: string;
|
|
536
|
+
readonly range?: XlsxCellRange;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* The adjacency export's answer: `edges` SORTED by `(dependent.stable_key,
|
|
540
|
+
* precedent.stable_key)` (the sort is the contract), `descriptors` one per
|
|
541
|
+
* composite endpoint of the returned edges, `edgeCount` the total before
|
|
542
|
+
* `limit`, `truncated` when the list is a prefix. `unmeasured` carries the
|
|
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.
|
|
557
|
+
*/
|
|
558
|
+
export interface XlsxAiCalcGraphEdgesResult extends XlsxAiSessionStamp {
|
|
559
|
+
readonly verdict: Extract<XlsxVerdict, "available" | "refused">;
|
|
560
|
+
readonly status: "measured" | "unmeasured" | "refused";
|
|
561
|
+
readonly reason?: "not-mounted" | "not-synced" | "needs-full-recalc";
|
|
562
|
+
readonly refusal?: XlsxAiRefusal;
|
|
563
|
+
readonly edges: readonly XlsxAiCalcGraphEdge[];
|
|
564
|
+
readonly descriptors: readonly XlsxAiCalcGraphDescriptor[];
|
|
565
|
+
readonly edgeCount: number;
|
|
566
|
+
readonly limit: number;
|
|
567
|
+
readonly truncated: boolean;
|
|
568
|
+
}
|
|
569
|
+
export interface XlsxAiPreviewRequest {
|
|
570
|
+
readonly proposal: XlsxAiSessionProposal;
|
|
571
|
+
readonly actor?: XlsxRuntimeActor;
|
|
572
|
+
readonly fidelity?: "guards-only" | "simulated";
|
|
573
|
+
readonly workflowContext?: XlsxWorkflowContextInput;
|
|
574
|
+
}
|
|
575
|
+
export type XlsxAiImpact = {
|
|
576
|
+
readonly status: "measured";
|
|
577
|
+
readonly dirtyFormulaCells: number;
|
|
578
|
+
readonly sample: readonly XlsxScopeHandle[];
|
|
579
|
+
} | {
|
|
580
|
+
readonly status: "unmeasured";
|
|
581
|
+
readonly reason: string;
|
|
582
|
+
};
|
|
583
|
+
/**
|
|
584
|
+
* XBC-2 (design record Q2 item 7): the simulated arm's size gate, answered
|
|
585
|
+
* whenever `fidelity: "simulated"` was requested AND the preview reached
|
|
586
|
+
* the gate (admitted or not): a preview refused BEFORE it — a malformed or
|
|
587
|
+
* stale fence, a proposal that does not resolve — answers `guards-only`
|
|
588
|
+
* with neither the gate nor the arm (R-XBC2-2 item 5). Both facts are
|
|
589
|
+
* deterministic session facts: populated cells over every sheet, and the
|
|
590
|
+
* loaded package's part bytes.
|
|
591
|
+
*/
|
|
592
|
+
export interface XlsxAiSimulatedGate {
|
|
593
|
+
readonly admitted: boolean;
|
|
594
|
+
readonly populatedCells: number;
|
|
595
|
+
readonly packageBytes: number;
|
|
596
|
+
/** 10 000 */
|
|
597
|
+
readonly maxPopulatedCells: number;
|
|
598
|
+
/** 5 MiB */
|
|
599
|
+
readonly maxPackageBytes: number;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* XBC-2 R1 (R-XBC2-1 item 2): the post-apply CONTENT facts of a workbook —
|
|
603
|
+
* its state SHA (`readRuntimeSessionIntegrity`'s `canonicalHash`, the digest
|
|
604
|
+
* of the whole content) and the changed-cells digest over the replacement's
|
|
605
|
+
* footprint (one producer in sheets-ai: sheet, row, column, the formula's
|
|
606
|
+
* display spelling, the value by kind). The preview's
|
|
607
|
+
* `simulated.predictedAfterState` is the clone's; the apply's `afterState`
|
|
608
|
+
* is the resident's after its commit step and before the drain. The service
|
|
609
|
+
* compares the two pairs; the eval's `cloneEqualsApplyOverMatrix` compares
|
|
610
|
+
* exactly these (never identities, which are op-chain tokens equal by
|
|
611
|
+
* construction once the fence passes).
|
|
612
|
+
*/
|
|
613
|
+
export interface XlsxAiAfterState {
|
|
614
|
+
readonly stateSha: string;
|
|
615
|
+
readonly changedCellsDigest: string;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* XBC-2: what the simulated (clone) arm answered; present whenever it ran
|
|
619
|
+
* (`fidelity: "simulated"`: agreed, or diverged and the preview refused).
|
|
620
|
+
* The arm runs sheets-scope's bytes-path twin on a clone of the resident
|
|
621
|
+
* (R-XBC2-1 item 3), so `verdict` is an independent oracle's. On an agreed
|
|
622
|
+
* apply `predictedAfterState` is the clone's post-apply content; the service
|
|
623
|
+
* pins it on the staged subject (`/ai/propose` with `fidelity: "simulated"`)
|
|
624
|
+
* and compares it at `/ai/apply` with the receipt's `afterState` (a mismatch
|
|
625
|
+
* is the `ai.preview-arm-divergence` line and the
|
|
626
|
+
* `internal:preview-arm-divergence` warning on the executed outcome).
|
|
627
|
+
*/
|
|
628
|
+
export interface XlsxAiSimulatedPreview {
|
|
629
|
+
/**
|
|
630
|
+
* The clone arm's own verdict. On a validated preview it equals the guards-only verdict on the APPLY-PHASE warning set
|
|
631
|
+
* (a disagreement there is the fail-closed refusal); it reads `applied-with-warnings` where the guards-only arm read
|
|
632
|
+
* `applied` exactly when a commit-phase-only warning rides it (R-XBC2-2 item 2), which `validation` then carries.
|
|
633
|
+
*/
|
|
634
|
+
readonly verdict: "applied" | "applied-with-warnings" | "refused";
|
|
635
|
+
readonly changedCells: number;
|
|
636
|
+
/** The clone's post-apply content; absent when the clone wrote nothing (a refusal both arms agree on, a divergence). */
|
|
637
|
+
readonly predictedAfterState?: XlsxAiAfterState;
|
|
638
|
+
/** On a divergence where the clone arm refused: the clone arm's own roster row (its blocker code and evidence). */
|
|
639
|
+
readonly cloneRefusal?: XlsxAiRefusal;
|
|
640
|
+
}
|
|
641
|
+
export interface XlsxAiPreviewResult extends XlsxAiSessionStamp {
|
|
642
|
+
readonly verdict: Extract<XlsxVerdict, "validated" | "refused">;
|
|
643
|
+
/**
|
|
644
|
+
* The guards-only arm's verdict and warnings; when `fidelity` is
|
|
645
|
+
* `simulated`, the clone arm's (R-XBC2-2 item 2): the same apply-phase
|
|
646
|
+
* warning set by construction, plus the commit-phase-only warnings the
|
|
647
|
+
* apply will report (`package-diagnostics-present` on a session whose
|
|
648
|
+
* package carries a warning/error-severity diagnostic,
|
|
649
|
+
* `calculation-diagnostics-present`), which the agreement rule excludes
|
|
650
|
+
* on both arms and surfaces here — so `verdict` reads
|
|
651
|
+
* `applied-with-warnings` exactly when the apply will.
|
|
652
|
+
*/
|
|
653
|
+
readonly validation: {
|
|
654
|
+
readonly verdict?: Extract<XlsxVerdict, "applied" | "applied-with-warnings">;
|
|
655
|
+
readonly warnings: readonly XlsxRuntimeWarning[];
|
|
656
|
+
readonly refusal?: XlsxAiRefusal;
|
|
657
|
+
};
|
|
658
|
+
/**
|
|
659
|
+
* `simulated` when the clone arm ran and agreed (under the gate, on
|
|
660
|
+
* request); `guards-only` otherwise — including above the gate, where the
|
|
661
|
+
* `preview:simulated-unavailable` warning rides `warnings`.
|
|
662
|
+
*/
|
|
663
|
+
readonly fidelity: "guards-only" | "simulated";
|
|
664
|
+
readonly before: readonly XlsxAiCellReadback[];
|
|
665
|
+
/** The clone's post-apply cells over the footprint when `fidelity` is `simulated`; the projected cells otherwise. */
|
|
666
|
+
readonly proposed: readonly XlsxAiCellReadback[];
|
|
667
|
+
/**
|
|
668
|
+
* When `fidelity` is `simulated`: measured on a graph built on the clone's post-apply workbook (Q2 item 6 on the
|
|
669
|
+
* clone) when every written address resolves on that graph; when one does not (a cleared target is blank after the
|
|
670
|
+
* apply), the pre-edit address-seeded impact the guards-only arm measured, unmarked (R-XBC2-2 item 5 states the
|
|
671
|
+
* condition; the DTO carries no marker of which graph a `measured` impact came from).
|
|
672
|
+
*/
|
|
673
|
+
readonly impact: XlsxAiImpact;
|
|
674
|
+
/** `preview:simulated-unavailable` when the simulated arm was asked for and the gate excluded it. */
|
|
675
|
+
readonly warnings: readonly XlsxAiRefusal[];
|
|
676
|
+
/** XBC-2, optional/additive: present whenever `fidelity: "simulated"` was requested. */
|
|
677
|
+
readonly simulatedGate?: XlsxAiSimulatedGate;
|
|
678
|
+
/**
|
|
679
|
+
* XBC-2, optional/additive: present whenever the clone arm RAN (`fidelity: "simulated"` admitted by the gate) —
|
|
680
|
+
* agreed or diverged. On a divergence the refused preview carries it with the clone arm's own `verdict` and, when
|
|
681
|
+
* the clone refused, its `cloneRefusal`; absent when the gate excluded the arm (`simulatedGate` then says why).
|
|
682
|
+
*/
|
|
683
|
+
readonly simulated?: XlsxAiSimulatedPreview;
|
|
684
|
+
}
|
|
685
|
+
export interface XlsxAiValidateRequest {
|
|
686
|
+
readonly proposal: XlsxAiSessionProposal;
|
|
687
|
+
readonly actor?: XlsxRuntimeActor;
|
|
688
|
+
readonly workflowContext?: XlsxWorkflowContextInput;
|
|
689
|
+
}
|
|
690
|
+
export interface XlsxAiValidateResult extends XlsxAiSessionStamp {
|
|
691
|
+
readonly verdict: Extract<XlsxVerdict, "validated" | "refused">;
|
|
692
|
+
readonly warnings: readonly XlsxRuntimeWarning[];
|
|
693
|
+
readonly refusal?: XlsxAiRefusal;
|
|
694
|
+
}
|
|
695
|
+
export interface XlsxAiApplyProposalRequest {
|
|
696
|
+
readonly proposal: XlsxAiSessionProposal;
|
|
697
|
+
readonly actor?: XlsxRuntimeActor;
|
|
698
|
+
/** The drain's clock and seed (D12). */
|
|
699
|
+
readonly volatileInputs?: XlsxSessionVolatileInputs;
|
|
700
|
+
readonly workflowContext?: XlsxWorkflowContextInput;
|
|
701
|
+
/**
|
|
702
|
+
* XBC-2 R1, optional/additive: answer `afterState` on the receipt (the resident's post-commit state SHA and
|
|
703
|
+
* changed-cells digest). The service sets it exactly when the staged subject carries a clone-arm prediction.
|
|
704
|
+
*/
|
|
705
|
+
readonly attestAfterState?: boolean;
|
|
706
|
+
}
|
|
707
|
+
export interface XlsxAiFenceTriple {
|
|
708
|
+
readonly epoch: string;
|
|
709
|
+
readonly revision: number;
|
|
710
|
+
readonly identity: string;
|
|
711
|
+
}
|
|
712
|
+
export interface XlsxAiDrain {
|
|
713
|
+
readonly status: "applied" | "noop" | "refused" | "failed";
|
|
714
|
+
readonly recalc: "dirty" | "full" | "none";
|
|
715
|
+
readonly evaluatedCellCount?: number;
|
|
716
|
+
readonly blocker?: XlsxAiRefusal;
|
|
717
|
+
readonly error?: string;
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* `XlsxAiApplyReceipt` (§5.6). `sessionFence` is the settled fence, absent
|
|
721
|
+
* when the drain failed or the session was disposed in the call.
|
|
722
|
+
*/
|
|
723
|
+
export interface XlsxAiApplyReceipt {
|
|
724
|
+
readonly verdict: Extract<XlsxVerdict, "applied" | "applied-with-warnings" | "refused">;
|
|
725
|
+
readonly dispatch: XlsxAiFenceTriple;
|
|
726
|
+
/** The apply step's own bookkeeping; the Q4 predicate reads it. */
|
|
727
|
+
readonly receipt?: XlsxAiFenceTriple;
|
|
728
|
+
readonly drain?: XlsxAiDrain;
|
|
729
|
+
/** Post-drain; absent when `drain.status` is `failed`. */
|
|
730
|
+
readonly settled?: XlsxAiSettledFence;
|
|
731
|
+
readonly undoBoundary?: XlsxRuntimeUndoBoundary;
|
|
732
|
+
readonly audit?: XlsxRuntimeAuditEnvelope;
|
|
733
|
+
readonly cells: readonly XlsxRuntimeCellReadback[];
|
|
734
|
+
readonly warnings: readonly XlsxRuntimeWarning[];
|
|
735
|
+
readonly refusal?: XlsxAiRefusal;
|
|
736
|
+
/** 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. */
|
|
737
|
+
readonly afterState?: XlsxAiAfterState;
|
|
738
|
+
readonly defectAfterCheck: boolean;
|
|
739
|
+
readonly sessionDisposed: boolean;
|
|
740
|
+
readonly sessionFence?: XlsxSessionFence;
|
|
741
|
+
readonly sessionEpoch: string;
|
|
742
|
+
readonly revision: number;
|
|
743
|
+
}
|
|
744
|
+
export interface XlsxAiPlan {
|
|
745
|
+
/** At most 50 pairwise disjoint replacement steps. */
|
|
746
|
+
readonly steps: readonly Omit<XlsxAiSessionProposal, "expectedSessionFence">[];
|
|
747
|
+
readonly expectedSessionFence: XlsxSessionFence;
|
|
748
|
+
}
|
|
749
|
+
export interface XlsxAiApplyPlanRequest {
|
|
750
|
+
readonly plan: XlsxAiPlan;
|
|
751
|
+
readonly actor?: XlsxRuntimeActor;
|
|
752
|
+
/** Applies and reverts every step; never bookkeeps or drains. */
|
|
753
|
+
readonly dryRun?: boolean;
|
|
754
|
+
readonly volatileInputs?: XlsxSessionVolatileInputs;
|
|
755
|
+
readonly workflowContext?: XlsxWorkflowContextInput;
|
|
756
|
+
}
|
|
757
|
+
export interface XlsxAiPlanStepReceipt {
|
|
758
|
+
readonly step: number;
|
|
759
|
+
readonly scopeId: string;
|
|
760
|
+
readonly verdict: Extract<XlsxVerdict, "applied" | "applied-with-warnings">;
|
|
761
|
+
readonly warnings: readonly XlsxRuntimeWarning[];
|
|
762
|
+
}
|
|
763
|
+
export interface XlsxAiPlanReceipt {
|
|
764
|
+
readonly verdict: Extract<XlsxVerdict, "applied" | "validated" | "refused">;
|
|
765
|
+
readonly dryRun: boolean;
|
|
766
|
+
/**
|
|
767
|
+
* 64 hex once the plan was read; the boundary id embeds its first 16
|
|
768
|
+
* characters. Empty on the two pre-digest refusal arms (malformed plan body,
|
|
769
|
+
* malformed or stale plan fence), where no plan was parsed.
|
|
770
|
+
*/
|
|
771
|
+
readonly planDigest: string;
|
|
772
|
+
readonly dispatch: XlsxAiFenceTriple;
|
|
773
|
+
readonly receipt?: XlsxAiFenceTriple;
|
|
774
|
+
readonly drain?: XlsxAiDrain;
|
|
775
|
+
readonly settled?: XlsxAiSettledFence;
|
|
776
|
+
readonly undoBoundary?: XlsxRuntimeUndoBoundary;
|
|
777
|
+
readonly audit?: XlsxRuntimeAuditEnvelope;
|
|
778
|
+
readonly steps: readonly XlsxAiPlanStepReceipt[];
|
|
779
|
+
readonly failedStep?: number;
|
|
780
|
+
readonly refusal?: XlsxAiRefusal;
|
|
781
|
+
readonly sessionDisposed: boolean;
|
|
782
|
+
readonly sessionFence?: XlsxSessionFence;
|
|
783
|
+
readonly sessionEpoch: string;
|
|
784
|
+
readonly revision: number;
|
|
785
|
+
}
|
|
@@ -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
|
+
"YXRpb24vdm5kLm9wZW54bWxmb3JtYXRzLXBhY2thZ2UucmVsYXRpb25zaGlwcyt4bWwiLz48RGVmYXV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AAApIEA" +
|
|
56
|
+
"AAAAW0NvbnRlbnRfVHlwZXNdLnhtbFBLAQIuAxQAAAAAAAAAIQCY2uuLJwEAACcBAAALAAAAAAAAAAAAAACkgdgCAABfcmVscy8u" +
|
|
57
|
+
"cmVsc1BLAQIuAxQAAAAAAAAAIQCrISxupwEAAKcBAAAaAAAAAAAAAAAAAACkgSgEAAB4bC9fcmVscy93b3JrYm9vay54bWwucmVs" +
|
|
58
|
+
"c1BLAQIuAxQAAAAAAAAAIQC6a9x1+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
|
@@ -35,9 +35,14 @@ 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 {
|
|
39
|
-
export
|
|
40
|
-
export
|
|
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";
|
|
45
|
+
export type { XlsxFormulaRecalculateResult, XlsxRuntimeSessionExportResult, XlsxRuntimeSessionMutationReceipt, XlsxSessionVolatileInputs, } from "./runtime/types.ts";
|
|
41
46
|
export { classifyXlsxUiState } from "./ui/index.ts";
|
|
42
47
|
export { createXlsxWasmBridge, loadGeneratedXlsxWasmBridge, supportsRuntimeSessionMutations } from "./wasm/index.ts";
|
|
43
48
|
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
|
-
|
|
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";
|