@bilig/workbook 0.59.0 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -57
- package/dist/check.js +3 -0
- package/dist/check.js.map +1 -1
- package/dist/describe.d.ts +6 -0
- package/dist/describe.js +8 -0
- package/dist/describe.js.map +1 -1
- package/dist/features.d.ts +150 -0
- package/dist/features.js +489 -0
- package/dist/features.js.map +1 -0
- package/dist/find.d.ts +41 -0
- package/dist/find.js +250 -5
- package/dist/find.js.map +1 -1
- package/dist/formula.d.ts +7 -0
- package/dist/formula.js +49 -6
- package/dist/formula.js.map +1 -1
- package/dist/guards.js +32 -0
- package/dist/guards.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/input.d.ts +16 -0
- package/dist/input.js +119 -0
- package/dist/input.js.map +1 -1
- package/dist/model.d.ts +2 -1
- package/dist/model.js +25 -1
- package/dist/model.js.map +1 -1
- package/dist/plan-data.d.ts +28 -0
- package/dist/plan-data.js +278 -0
- package/dist/plan-data.js.map +1 -0
- package/dist/requirements.d.ts +49 -2
- package/dist/requirements.js +266 -1
- package/dist/requirements.js.map +1 -1
- package/dist/result.d.ts +4 -2
- package/dist/result.js +7 -0
- package/dist/result.js.map +1 -1
- package/dist/run.d.ts +5 -3
- package/dist/run.js +81 -42
- package/dist/run.js.map +1 -1
- package/dist/verify.d.ts +3 -2
- package/dist/verify.js +74 -3
- package/dist/verify.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -26,52 +26,56 @@ import {
|
|
|
26
26
|
formula,
|
|
27
27
|
planWorkbookAction,
|
|
28
28
|
runWorkbookPlan,
|
|
29
|
+
toPlanData,
|
|
29
30
|
verifyPlan,
|
|
30
|
-
|
|
31
|
+
verifyPlanData,
|
|
32
|
+
} from '@bilig/workbook'
|
|
31
33
|
|
|
32
34
|
export const model = defineModel({
|
|
33
|
-
name:
|
|
35
|
+
name: 'generic-row-calculator',
|
|
34
36
|
|
|
35
37
|
find(workbook) {
|
|
36
38
|
const table = workbook.findTable({
|
|
37
|
-
headers: [
|
|
38
|
-
})
|
|
39
|
+
headers: ['Item', 'Quantity', 'Rate', 'Status', 'Total'],
|
|
40
|
+
})
|
|
39
41
|
const rows = workbook.findRows({
|
|
40
42
|
table,
|
|
41
|
-
where: { column:
|
|
42
|
-
})
|
|
43
|
+
where: { column: 'Status', op: 'eq', value: 'ready' },
|
|
44
|
+
})
|
|
43
45
|
|
|
44
46
|
return {
|
|
45
47
|
table,
|
|
46
48
|
rows,
|
|
47
|
-
quantity: rows.column(
|
|
48
|
-
rate: rows.column(
|
|
49
|
-
total: rows.column(
|
|
50
|
-
}
|
|
49
|
+
quantity: rows.column('Quantity'),
|
|
50
|
+
rate: rows.column('Rate'),
|
|
51
|
+
total: rows.column('Total'),
|
|
52
|
+
}
|
|
51
53
|
},
|
|
52
54
|
|
|
53
55
|
checks({ refs, workbook }) {
|
|
54
|
-
return [workbook.check.exists(refs.table), workbook.check.noFormulaErrors(refs.total)]
|
|
56
|
+
return [workbook.check.exists(refs.table), workbook.check.noFormulaErrors(refs.total)]
|
|
55
57
|
},
|
|
56
58
|
|
|
57
59
|
actions: {
|
|
58
60
|
recompute({ refs, workbook }) {
|
|
59
|
-
const expected = formula.multiply(refs.quantity, refs.rate)
|
|
60
|
-
workbook.writeFormula(refs.total, expected)
|
|
61
|
-
workbook.check.formulaEquals(refs.total, expected)
|
|
61
|
+
const expected = formula.multiply(refs.quantity, refs.rate)
|
|
62
|
+
workbook.writeFormula(refs.total, expected)
|
|
63
|
+
workbook.check.formulaEquals(refs.total, expected)
|
|
62
64
|
},
|
|
63
65
|
},
|
|
64
|
-
})
|
|
66
|
+
})
|
|
65
67
|
|
|
66
|
-
const planned = planWorkbookAction(model,
|
|
67
|
-
if (planned.status ===
|
|
68
|
+
const planned = planWorkbookAction(model, 'recompute')
|
|
69
|
+
if (planned.status === 'failed') throw new Error(planned.errors[0]?.message)
|
|
68
70
|
|
|
69
|
-
const staticProof = verifyPlan(planned.plan)
|
|
70
|
-
const requirements = describeRuntimeRequirements(planned.plan)
|
|
71
|
-
const planForLogs = describePlan(planned.plan)
|
|
71
|
+
const staticProof = verifyPlan(planned.plan)
|
|
72
|
+
const requirements = describeRuntimeRequirements(planned.plan)
|
|
73
|
+
const planForLogs = describePlan(planned.plan)
|
|
74
|
+
const transportedPlan = JSON.parse(JSON.stringify(toPlanData(planned.plan)))
|
|
75
|
+
const transportProof = verifyPlanData(transportedPlan)
|
|
72
76
|
|
|
73
|
-
const result = await runWorkbookPlan(
|
|
74
|
-
const resultForLogs = describeRunResult(result)
|
|
77
|
+
const result = await runWorkbookPlan(transportedPlan, adapter)
|
|
78
|
+
const resultForLogs = describeRunResult(result)
|
|
75
79
|
```
|
|
76
80
|
|
|
77
81
|
That is the core flow:
|
|
@@ -82,7 +86,8 @@ That is the core flow:
|
|
|
82
86
|
4. An action builds workbook intent.
|
|
83
87
|
5. `verifyPlan` checks the plan without running an engine.
|
|
84
88
|
6. `describeRuntimeRequirements` tells an adapter what it must apply, read, and prove.
|
|
85
|
-
7. `
|
|
89
|
+
7. `toPlanData` makes the plan JSON-safe for handoff.
|
|
90
|
+
8. `runWorkbookPlan` applies either the in-memory plan or transported plan data through a runtime-owned adapter and returns a boring result with check proof and apply proof when the adapter provides it.
|
|
86
91
|
|
|
87
92
|
## Public Contract
|
|
88
93
|
|
|
@@ -91,18 +96,26 @@ The main API is intentionally small:
|
|
|
91
96
|
- model: `defineModel`, `inspectModel`, `planWorkbookAction`, `buildWorkbookActionPlan`
|
|
92
97
|
- selectors: `findTable`, `findColumn`, `findRange`, `findName`, `findRows`, `find`
|
|
93
98
|
- checks: `check.exists`, `check.noFormulaErrors`, `check.valueEquals`, `check.formulaEquals`, `check.custom`
|
|
94
|
-
- formulas: `formula.add`, `formula.subtract`, `formula.multiply`, `formula.divide`, `formula.sum`, `formula.call`, `formula.raw`, `formula.text`
|
|
99
|
+
- formulas: `formula.add`, `formula.subtract`, `formula.multiply`, `formula.divide`, `formula.sum`, `formula.call`, `formula.raw`, `formula.text`, `formula.labels`
|
|
100
|
+
- input: `checkInput`, `normalizeWorkbookActionInputDescription`
|
|
95
101
|
- proof: `verifyPlan`, `verifyModel`, `verifyWorkbookReadbacks`
|
|
96
|
-
- descriptions: `describeModel`, `describeRef`, `describePlan`, `describePlanResult`, `describeRuntimeRequirements`, `describeRunResult`
|
|
102
|
+
- descriptions: `describeModel`, `describeRef`, `describePlan`, `describePlanResult`, `describeRuntimeRequirements`, `checkRuntimeRequirements`, `checkRuntimeAdapter`, `describeRunResult`
|
|
103
|
+
- transport data: `isWorkbookRefData`, `toWorkbookRefData`, `collectWorkbookRefData`, `hydrateWorkbookRef`, `hydrateWorkbookRefs`, `toPlanData`, `isPlanData`, `checkPlanData`, `hydratePlanData`, `verifyPlanData`
|
|
97
104
|
- runtime handoff: `runWorkbookPlan`, `runWorkbookAction`, `WorkbookRunAdapter`
|
|
105
|
+
- feature handoff: `defineWorkbookFeaturePlugin`, `checkWorkbookCommandRequest`, `normalizeWorkbookCommandRequest`, `checkWorkbookCommandReceipt`, `normalizeWorkbookCommandReceipt`, `workbookCommandReceiptOpsMatch`
|
|
98
106
|
- low-level language: `WorkbookOp`, `WorkbookTxn`, `EngineOp`, `EngineOpBatch`, `isEngineOpBatch`
|
|
99
107
|
|
|
100
108
|
Stable data helpers are exported for generic tool builders:
|
|
101
109
|
|
|
102
110
|
- `workbookRefKinds`, `isWorkbookRefKind`, `isWorkbookRef`
|
|
111
|
+
- `isWorkbookRefData`, `toWorkbookRefData`, `collectWorkbookRefData`, `hydrateWorkbookRef`, `hydrateWorkbookRefs`
|
|
112
|
+
- `isPlanData`, `checkPlanData`
|
|
103
113
|
- `workbookRowOperators`, `workbookRowOperatorValueTypes`, `isWorkbookRowOperator`, `isWorkbookRowValueCompatible`
|
|
104
114
|
- `builtInWorkbookCheckKinds`, `isBuiltInWorkbookCheckKind`
|
|
105
|
-
- `workbookActionInputDescriptionKinds`, `isWorkbookActionInputDescriptionKind`, `isWorkbookActionInputDescription`, `isWorkbookActionInput`
|
|
115
|
+
- `workbookActionInputDescriptionKinds`, `isWorkbookActionInputDescriptionKind`, `isWorkbookActionInputDescription`, `isWorkbookActionInput`, `checkInput`
|
|
116
|
+
- `workbookRuntimeRequirementKinds`, `isWorkbookRuntimeRequirementKind`, `workbookRuntimeCapabilities`, `isWorkbookRuntimeCapability`, `checkRuntimeRequirements`
|
|
117
|
+
- `workbookCommandCategories`, `isWorkbookCommandCategory`, `workbookCommandExecutionModes`, `isWorkbookCommandExecutionMode`, `workbookCommandReceiptStatuses`, `isWorkbookCommandReceiptStatus`
|
|
118
|
+
- `workbookProjectionInterceptorPoints`, `isWorkbookProjectionInterceptorPoint`, `workbookUiContributionSlots`, `isWorkbookUiContributionSlot`, `checkWorkbookCommandRequest`
|
|
106
119
|
- `workbookRunErrorCodes`, `isWorkbookRunErrorCode`
|
|
107
120
|
|
|
108
121
|
## Selectors
|
|
@@ -121,18 +134,45 @@ agents.
|
|
|
121
134
|
|
|
122
135
|
Refs are frozen data. Helpers such as `table.column("Total")` and
|
|
123
136
|
`rows.column("Total")` are non-enumerable, so JSON descriptions stay data-first.
|
|
137
|
+
Use `toWorkbookRefData` or `describeRef` when a ref must cross a JSON boundary.
|
|
138
|
+
Use `hydrateWorkbookRef` or `hydrateWorkbookRefs` after transport to regain the
|
|
139
|
+
local helpers. `verifyPlanData(describePlan(plan))` checks transported plan data
|
|
140
|
+
without requiring the consumer's private `refs` object shape.
|
|
141
|
+
|
|
142
|
+
For full action handoff, use `toPlanData(plan)` before JSON transport. A runtime
|
|
143
|
+
can call `checkPlanData(data)` to get structured path-based issues before
|
|
144
|
+
hydration, call `hydratePlanData(data)` to regain frozen refs and helper
|
|
145
|
+
methods, or pass the data directly to `describeRuntimeRequirements(data)` and
|
|
146
|
+
`runWorkbookPlan(data, adapter)`. The hydrated plan exposes
|
|
147
|
+
`refs: { refsUsed }` instead of the consumer's private model-shaped `refs`
|
|
148
|
+
object, so transported execution stays generic.
|
|
149
|
+
|
|
150
|
+
## Action Input
|
|
151
|
+
|
|
152
|
+
Action input is JSON-safe data, not a schema-framework object. Action metadata
|
|
153
|
+
can describe generic input with `json`, `object`, `array`, `string`, `number`,
|
|
154
|
+
`boolean`, and `null` kinds. `checkInput(description, value)` returns a plain
|
|
155
|
+
`{ status, input, issues }` result so an agent can reject malformed tool payloads
|
|
156
|
+
before running workbook model code. Omitted input is valid unless the top-level
|
|
157
|
+
description sets `required: true`, so agents can distinguish an optional payload
|
|
158
|
+
from a malformed payload. `planWorkbookAction` uses the same check when an action
|
|
159
|
+
declares input metadata.
|
|
124
160
|
|
|
125
161
|
## Formulas
|
|
126
162
|
|
|
127
163
|
`@bilig/workbook` creates formula expressions. `@bilig/formula` parses and
|
|
128
164
|
normalizes formula text. `@bilig/core` or an app runtime calculates it.
|
|
129
165
|
|
|
130
|
-
Formula helpers keep formula text
|
|
131
|
-
formula write includes
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
166
|
+
Formula helpers keep formula text, workbook dependencies, and formula labels
|
|
167
|
+
separate. A planned formula write includes the formula string, the refs used to
|
|
168
|
+
build it, and a `labels` array mapping each formula token to the workbook ref it
|
|
169
|
+
represents. Runtime adapters use those labels to materialize table columns,
|
|
170
|
+
filtered rows, names, and ranges without reverse-engineering hidden JS helpers.
|
|
171
|
+
For custom formula text, use `formula.raw(source, { inputs })`; pass
|
|
172
|
+
`labels: [{ name, ref }]` when the raw formula uses custom tokens. For
|
|
173
|
+
spreadsheet string literals, use `formula.text(value)`. Bare strings are not
|
|
174
|
+
formula operands because agents should not guess whether a string is code, a
|
|
175
|
+
label, a named range, or user text.
|
|
136
176
|
|
|
137
177
|
## Runtime Adapter
|
|
138
178
|
|
|
@@ -141,25 +181,33 @@ named range, or user text.
|
|
|
141
181
|
```ts
|
|
142
182
|
const adapter = {
|
|
143
183
|
apply(plan) {
|
|
144
|
-
const ops = materializeForThisRuntime(plan)
|
|
184
|
+
const ops = materializeForThisRuntime(plan)
|
|
145
185
|
return {
|
|
146
|
-
status:
|
|
186
|
+
status: 'applied',
|
|
147
187
|
previewOps: ops,
|
|
148
188
|
appliedOps: ops,
|
|
149
|
-
proof: { source:
|
|
150
|
-
undo: { id:
|
|
151
|
-
}
|
|
189
|
+
proof: { source: 'runtime', opCount: ops.length },
|
|
190
|
+
undo: { id: 'undo-1' },
|
|
191
|
+
}
|
|
152
192
|
},
|
|
153
193
|
read(targets, plan) {
|
|
154
|
-
return targets.map((target) => ({ target, value: 12 }))
|
|
194
|
+
return targets.map((target) => ({ target, value: 12 }))
|
|
155
195
|
},
|
|
156
196
|
verifyChecks(checks, plan) {
|
|
157
|
-
return checks.map((entry) => ({ ...entry, status:
|
|
197
|
+
return checks.map((entry) => ({ ...entry, status: 'passed' }))
|
|
158
198
|
},
|
|
159
|
-
}
|
|
199
|
+
}
|
|
160
200
|
```
|
|
161
201
|
|
|
162
|
-
`runWorkbookPlan`
|
|
202
|
+
`runWorkbookPlan` accepts either a live plan or transported plan data and
|
|
203
|
+
refuses to call `apply` if static plan verification fails or if the adapter is
|
|
204
|
+
missing a required method. Use `checkRuntimeRequirements(data)` when runtime
|
|
205
|
+
requirements crossed a JSON boundary and an agent needs path-based diagnostics
|
|
206
|
+
before trusting the handoff. Use `checkRuntimeAdapter(planOrRequirements,
|
|
207
|
+
adapter)` when an agent wants to check `apply`, `read`, and `verifyChecks`
|
|
208
|
+
coverage before calling the runtime. Check-only plans do not require `apply`;
|
|
209
|
+
when runtime requirements contain only `read` or `verifyCheck`, `runWorkbookPlan`
|
|
210
|
+
skips mutation and verifies the declared checks directly.
|
|
163
211
|
If an adapter returns both `previewOps` and `appliedOps`, the result reports
|
|
164
212
|
whether they matched. If the adapter returns neither, the run records an
|
|
165
213
|
unverified apply fact. Use `runWorkbookPlan(plan, adapter, { requireApplyProof:
|
|
@@ -170,32 +218,49 @@ Readback checks attach proof to passed checks, such as
|
|
|
170
218
|
Generic check verifiers may only change `status` or add JSON-safe `proof`; they
|
|
171
219
|
cannot rewrite the check contract.
|
|
172
220
|
If runtime apply succeeds but readback or check proof fails, the failed result
|
|
173
|
-
still carries `changed` and `undo` when the adapter returned
|
|
174
|
-
failed result before apply
|
|
221
|
+
still carries `changed` and `undo` when the adapter returned applied ops or undo
|
|
222
|
+
metadata. A failed result before apply, or a failed apply that reports
|
|
223
|
+
`appliedOps: []` without undo metadata, uses `changed: []`.
|
|
175
224
|
|
|
176
225
|
The result is deliberately plain:
|
|
177
226
|
|
|
178
227
|
```ts
|
|
179
228
|
type WorkbookRunResult =
|
|
180
229
|
| {
|
|
181
|
-
status:
|
|
182
|
-
apply?: WorkbookRunApplySummary
|
|
183
|
-
changed: WorkbookChangeSummary[]
|
|
184
|
-
checks: WorkbookCheckResult[]
|
|
185
|
-
undo?: WorkbookUndoRef
|
|
186
|
-
unverified?: WorkbookRunUnverified[]
|
|
230
|
+
status: 'done'
|
|
231
|
+
apply?: WorkbookRunApplySummary
|
|
232
|
+
changed: WorkbookChangeSummary[]
|
|
233
|
+
checks: WorkbookCheckResult[]
|
|
234
|
+
undo?: WorkbookUndoRef
|
|
235
|
+
unverified?: WorkbookRunUnverified[]
|
|
187
236
|
}
|
|
188
237
|
| {
|
|
189
|
-
status:
|
|
190
|
-
errors: WorkbookRunError[]
|
|
191
|
-
apply?: WorkbookRunApplySummary
|
|
192
|
-
changed: WorkbookChangeSummary[]
|
|
193
|
-
checks: WorkbookCheckResult[]
|
|
194
|
-
undo?: WorkbookUndoRef
|
|
195
|
-
unverified?: WorkbookRunUnverified[]
|
|
196
|
-
}
|
|
238
|
+
status: 'failed'
|
|
239
|
+
errors: WorkbookRunError[]
|
|
240
|
+
apply?: WorkbookRunApplySummary
|
|
241
|
+
changed: WorkbookChangeSummary[]
|
|
242
|
+
checks: WorkbookCheckResult[]
|
|
243
|
+
undo?: WorkbookUndoRef
|
|
244
|
+
unverified?: WorkbookRunUnverified[]
|
|
245
|
+
}
|
|
197
246
|
```
|
|
198
247
|
|
|
248
|
+
## Feature Handoff
|
|
249
|
+
|
|
250
|
+
Feature command requests are plain data for runtimes that expose workbook
|
|
251
|
+
features to agents. Use `checkWorkbookCommandRequest(data)` before dispatching a
|
|
252
|
+
transported request. It returns stable path issues such as `featureId`,
|
|
253
|
+
`commandId`, `category`, `mode`, and `input`, and `normalizeWorkbookCommandRequest`
|
|
254
|
+
returns the frozen request data for the runtime. The exported command category,
|
|
255
|
+
execution-mode, receipt-status, projection-point, and UI-slot lists let tool
|
|
256
|
+
builders present and validate command contracts without importing a schema
|
|
257
|
+
framework.
|
|
258
|
+
|
|
259
|
+
Use `checkWorkbookCommandReceipt(data)` before trusting runtime command evidence.
|
|
260
|
+
It returns the same boring `{ status, issues }` shape for receipt fields such as
|
|
261
|
+
`status`, `featureId`, `commandId`, `previewOps`, `appliedOps`, `undo`,
|
|
262
|
+
`changedRanges`, `proof`, `metadata`, and `errors`.
|
|
263
|
+
|
|
199
264
|
## Low-Level Ops
|
|
200
265
|
|
|
201
266
|
Most models should use the small action API: `writeFormula`, `writeValue`,
|
package/dist/check.js
CHANGED
|
@@ -52,6 +52,7 @@ function createWorkbookCheck(options) {
|
|
|
52
52
|
? Object.freeze({
|
|
53
53
|
...options.expectation,
|
|
54
54
|
inputs: Object.freeze([...options.expectation.inputs]),
|
|
55
|
+
labels: Object.freeze(options.expectation.labels.map((label) => Object.freeze({ ...label }))),
|
|
55
56
|
})
|
|
56
57
|
: Object.freeze({ ...options.expectation });
|
|
57
58
|
return Object.freeze({
|
|
@@ -98,6 +99,7 @@ export function createWorkbookCheckApi(record) {
|
|
|
98
99
|
formulaEquals(target, value, options = {}) {
|
|
99
100
|
const source = formula.source(value);
|
|
100
101
|
const inputs = formula.inputs(value);
|
|
102
|
+
const labels = formula.labels(value);
|
|
101
103
|
return planned({
|
|
102
104
|
kind: 'formulaEquals',
|
|
103
105
|
target,
|
|
@@ -106,6 +108,7 @@ export function createWorkbookCheckApi(record) {
|
|
|
106
108
|
kind: 'formulaEquals',
|
|
107
109
|
formula: source,
|
|
108
110
|
inputs,
|
|
111
|
+
labels,
|
|
109
112
|
},
|
|
110
113
|
});
|
|
111
114
|
},
|
package/dist/check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,iBAAiB,CAAA;AAEnE,OAAO,EAAE,OAAO,EAA+B,MAAM,cAAc,CAAA;AA4BnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC;IACrD,QAAQ;IACR,iBAAiB;IACjB,aAAa;IACb,eAAe;CAC8B,CAAC,CAAA;AAEhD,MAAM,UAAU,0BAA0B,CAAC,KAAc;IACvD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAA;AAC9F,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAAY,EAAE,MAAmB,EAAE,OAAe;IAC1F,OAAO,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;AACvD,CAAC;AAMD,SAAS,YAAY,CAAC,KAAa,EAAE,IAAY;IAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAC5B,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,kBAAkB,CAAC,CAAA;IAC3D,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAmB;IAC9C,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,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yBAAyB,CAAC,OAAO,CAAC,CAAA;YAChD,MAAM,EAAE,CAAC,KAAK,CAAC,CAAA;YACf,OAAO,KAAK,CAAA;QACd,CAAC;KACF,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAqB,sBAAsB,EAAE,CAAA"}
|
package/dist/describe.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export type WorkbookActionCommandDescription = {
|
|
|
52
52
|
readonly target: WorkbookRefDescription;
|
|
53
53
|
readonly formula: string;
|
|
54
54
|
readonly inputs: readonly WorkbookRefDescription[];
|
|
55
|
+
readonly labels: readonly WorkbookFormulaLabelDescription[];
|
|
55
56
|
} | {
|
|
56
57
|
readonly kind: 'writeValue';
|
|
57
58
|
readonly target: WorkbookRefDescription;
|
|
@@ -91,7 +92,12 @@ export type WorkbookCheckExpectationDescription = {
|
|
|
91
92
|
readonly kind: 'formulaEquals';
|
|
92
93
|
readonly formula: string;
|
|
93
94
|
readonly inputs: readonly WorkbookRefDescription[];
|
|
95
|
+
readonly labels: readonly WorkbookFormulaLabelDescription[];
|
|
94
96
|
};
|
|
97
|
+
export interface WorkbookFormulaLabelDescription {
|
|
98
|
+
readonly name: string;
|
|
99
|
+
readonly ref: WorkbookRefDescription;
|
|
100
|
+
}
|
|
95
101
|
export interface WorkbookActionPlanDescription {
|
|
96
102
|
readonly modelName: string;
|
|
97
103
|
readonly actionName: string;
|
package/dist/describe.js
CHANGED
|
@@ -70,6 +70,7 @@ function describeCommand(command) {
|
|
|
70
70
|
target: describeRef(command.target),
|
|
71
71
|
formula: command.formula,
|
|
72
72
|
inputs: command.inputs.map(describeRef),
|
|
73
|
+
labels: command.labels.map(describeFormulaLabel),
|
|
73
74
|
};
|
|
74
75
|
case 'writeValue':
|
|
75
76
|
return {
|
|
@@ -98,6 +99,12 @@ function describeCommand(command) {
|
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
101
|
}
|
|
102
|
+
function describeFormulaLabel(label) {
|
|
103
|
+
return {
|
|
104
|
+
name: label.name,
|
|
105
|
+
ref: describeRef(label.ref),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
101
108
|
function describeChange(change) {
|
|
102
109
|
return {
|
|
103
110
|
kind: change.kind,
|
|
@@ -128,6 +135,7 @@ function describeExpectation(expectation) {
|
|
|
128
135
|
kind: 'formulaEquals',
|
|
129
136
|
formula: expectation.formula,
|
|
130
137
|
inputs: expectation.inputs.map(describeRef),
|
|
138
|
+
labels: expectation.labels.map(describeFormulaLabel),
|
|
131
139
|
};
|
|
132
140
|
}
|
|
133
141
|
}
|
package/dist/describe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../src/describe.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,YAAY,GAOb,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../src/describe.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,YAAY,GAOb,MAAM,YAAY,CAAA;AAyMnB,MAAM,UAAU,aAAa,CAC3B,KAAmC;IAEnC,OAAO,YAAY,CAAC,KAAK,CAAC,CAAA;AAC5B,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAqB;IAC7C,OAAO;QACL,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,KAAK,EAAE,EAAE,GAAG,GAAG,CAAC,KAAK,EAAE;KACxB,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CAAC,GAAoB;IAC3C,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,IAAI,EAAE,GAAG,CAAC,IAAI;KACf,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAqB;IAC7C,OAAO;QACL,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,GAAG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CAAC,MAAM,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtG,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { CellRangeRef, CellStylePatch, CellStyleRecord, LiteralInput } from '@bilig/protocol';
|
|
2
|
+
import { type WorkbookActionInput, type WorkbookActionInputDescription } from './input.js';
|
|
3
|
+
import type { EngineOp } from './ops.js';
|
|
4
|
+
import type { WorkbookUndoRef } from './result.js';
|
|
5
|
+
export type WorkbookFeatureId = string;
|
|
6
|
+
export type WorkbookCommandCategory = 'command' | 'operation' | 'mutation';
|
|
7
|
+
export type WorkbookCommandExecutionMode = 'preview' | 'apply' | 'applyAndVerify';
|
|
8
|
+
export type WorkbookCommandReceiptStatus = 'previewed' | 'applied' | 'rejected' | 'noop';
|
|
9
|
+
export type WorkbookProjectionInterceptorPoint = 'cellDisplay' | 'cellStyle' | 'rangeChrome' | 'rowVisibility' | 'beforeCommand' | 'commandMetadata';
|
|
10
|
+
export type WorkbookUiContributionSlot = 'toolbar' | 'sidePanel' | 'floatingOverlay' | 'status';
|
|
11
|
+
export declare const workbookCommandCategories: readonly ["command", "operation", "mutation"];
|
|
12
|
+
export declare const workbookCommandExecutionModes: readonly ["preview", "apply", "applyAndVerify"];
|
|
13
|
+
export declare const workbookCommandReceiptStatuses: readonly ["previewed", "applied", "rejected", "noop"];
|
|
14
|
+
export declare const workbookProjectionInterceptorPoints: readonly ["cellDisplay", "cellStyle", "rangeChrome", "rowVisibility", "beforeCommand", "commandMetadata"];
|
|
15
|
+
export declare const workbookUiContributionSlots: readonly ["toolbar", "sidePanel", "floatingOverlay", "status"];
|
|
16
|
+
export interface WorkbookFeatureLifecycleContext {
|
|
17
|
+
readonly featureId: WorkbookFeatureId;
|
|
18
|
+
readonly activeFeatures: readonly WorkbookFeatureId[];
|
|
19
|
+
}
|
|
20
|
+
export interface WorkbookCommandDescriptor {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly featureId: WorkbookFeatureId;
|
|
23
|
+
readonly category: WorkbookCommandCategory;
|
|
24
|
+
readonly label: string;
|
|
25
|
+
readonly description?: string;
|
|
26
|
+
readonly input?: WorkbookActionInputDescription;
|
|
27
|
+
}
|
|
28
|
+
export interface WorkbookCommandRequest {
|
|
29
|
+
readonly featureId: WorkbookFeatureId;
|
|
30
|
+
readonly commandId: string;
|
|
31
|
+
readonly category?: WorkbookCommandCategory;
|
|
32
|
+
readonly mode?: WorkbookCommandExecutionMode;
|
|
33
|
+
readonly input?: WorkbookActionInput;
|
|
34
|
+
}
|
|
35
|
+
export type WorkbookCommandRequestIssueCode = 'invalid_command_request';
|
|
36
|
+
export interface WorkbookCommandRequestIssue {
|
|
37
|
+
readonly code: WorkbookCommandRequestIssueCode;
|
|
38
|
+
readonly path: string;
|
|
39
|
+
readonly message: string;
|
|
40
|
+
}
|
|
41
|
+
export type WorkbookCommandRequestCheckResult = {
|
|
42
|
+
readonly status: 'valid';
|
|
43
|
+
readonly request: WorkbookCommandRequest;
|
|
44
|
+
readonly issues: readonly [];
|
|
45
|
+
} | {
|
|
46
|
+
readonly status: 'invalid';
|
|
47
|
+
readonly issues: readonly WorkbookCommandRequestIssue[];
|
|
48
|
+
};
|
|
49
|
+
export interface WorkbookCommandReceipt {
|
|
50
|
+
readonly status: WorkbookCommandReceiptStatus;
|
|
51
|
+
readonly featureId: WorkbookFeatureId;
|
|
52
|
+
readonly commandId: string;
|
|
53
|
+
readonly category: WorkbookCommandCategory;
|
|
54
|
+
readonly previewOps?: readonly EngineOp[];
|
|
55
|
+
readonly appliedOps?: readonly EngineOp[];
|
|
56
|
+
readonly undo?: WorkbookUndoRef;
|
|
57
|
+
readonly changedRanges?: readonly CellRangeRef[];
|
|
58
|
+
readonly proof?: WorkbookActionInput;
|
|
59
|
+
readonly message?: string;
|
|
60
|
+
readonly metadata?: WorkbookActionInput;
|
|
61
|
+
readonly errors?: readonly string[];
|
|
62
|
+
}
|
|
63
|
+
export type WorkbookCommandReceiptIssueCode = 'invalid_command_receipt';
|
|
64
|
+
export interface WorkbookCommandReceiptIssue {
|
|
65
|
+
readonly code: WorkbookCommandReceiptIssueCode;
|
|
66
|
+
readonly path: string;
|
|
67
|
+
readonly message: string;
|
|
68
|
+
}
|
|
69
|
+
export type WorkbookCommandReceiptCheckResult = {
|
|
70
|
+
readonly status: 'valid';
|
|
71
|
+
readonly receipt: WorkbookCommandReceipt;
|
|
72
|
+
readonly issues: readonly [];
|
|
73
|
+
} | {
|
|
74
|
+
readonly status: 'invalid';
|
|
75
|
+
readonly issues: readonly WorkbookCommandReceiptIssue[];
|
|
76
|
+
};
|
|
77
|
+
export interface WorkbookCellDisplayProjection {
|
|
78
|
+
readonly value?: LiteralInput;
|
|
79
|
+
readonly text?: string;
|
|
80
|
+
readonly metadata?: WorkbookActionInput;
|
|
81
|
+
}
|
|
82
|
+
export interface WorkbookCellStyleProjection {
|
|
83
|
+
readonly style?: CellStylePatch | CellStyleRecord;
|
|
84
|
+
readonly metadata?: WorkbookActionInput;
|
|
85
|
+
}
|
|
86
|
+
export interface WorkbookRangeChromeProjection {
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly featureId: WorkbookFeatureId;
|
|
89
|
+
readonly source: 'workbook-metadata' | 'command-preview' | 'runtime';
|
|
90
|
+
readonly range: CellRangeRef;
|
|
91
|
+
readonly role: string;
|
|
92
|
+
readonly label?: string;
|
|
93
|
+
readonly metadata?: WorkbookActionInput;
|
|
94
|
+
}
|
|
95
|
+
export interface WorkbookRowVisibilityProjection {
|
|
96
|
+
readonly hidden?: boolean;
|
|
97
|
+
readonly metadata?: WorkbookActionInput;
|
|
98
|
+
}
|
|
99
|
+
export interface WorkbookCommandMetadataProjection {
|
|
100
|
+
readonly label?: string;
|
|
101
|
+
readonly changedRanges?: readonly CellRangeRef[];
|
|
102
|
+
readonly semanticTargets?: readonly WorkbookActionInput[];
|
|
103
|
+
readonly metadata?: WorkbookActionInput;
|
|
104
|
+
}
|
|
105
|
+
export interface WorkbookProjectionContext {
|
|
106
|
+
readonly featureId: WorkbookFeatureId;
|
|
107
|
+
}
|
|
108
|
+
export interface WorkbookProjectionInterceptorRegistration {
|
|
109
|
+
readonly id: string;
|
|
110
|
+
readonly featureId: WorkbookFeatureId;
|
|
111
|
+
readonly point: WorkbookProjectionInterceptorPoint;
|
|
112
|
+
readonly priority?: number;
|
|
113
|
+
readonly label?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface WorkbookUiContribution {
|
|
116
|
+
readonly id: string;
|
|
117
|
+
readonly featureId: WorkbookFeatureId;
|
|
118
|
+
readonly slot: WorkbookUiContributionSlot;
|
|
119
|
+
readonly label: string;
|
|
120
|
+
readonly order?: number;
|
|
121
|
+
readonly metadata?: WorkbookActionInput;
|
|
122
|
+
}
|
|
123
|
+
export interface WorkbookFeatureRegistration {
|
|
124
|
+
readonly commands: readonly WorkbookCommandDescriptor[];
|
|
125
|
+
readonly projectionInterceptors: readonly WorkbookProjectionInterceptorRegistration[];
|
|
126
|
+
readonly uiContributions: readonly WorkbookUiContribution[];
|
|
127
|
+
}
|
|
128
|
+
export interface WorkbookFeaturePlugin extends WorkbookFeatureRegistration {
|
|
129
|
+
readonly id: WorkbookFeatureId;
|
|
130
|
+
readonly version: string;
|
|
131
|
+
readonly dependsOn?: readonly WorkbookFeatureId[];
|
|
132
|
+
readonly register?: (context: WorkbookFeatureLifecycleContext) => void;
|
|
133
|
+
readonly activate?: (context: WorkbookFeatureLifecycleContext) => void;
|
|
134
|
+
readonly dispose?: (context: WorkbookFeatureLifecycleContext) => void;
|
|
135
|
+
}
|
|
136
|
+
export declare function normalizeWorkbookFeatureId(value: string, label?: string): WorkbookFeatureId;
|
|
137
|
+
export declare function isWorkbookCommandCategory(value: unknown): value is WorkbookCommandCategory;
|
|
138
|
+
export declare function isWorkbookCommandExecutionMode(value: unknown): value is WorkbookCommandExecutionMode;
|
|
139
|
+
export declare function isWorkbookCommandReceiptStatus(value: unknown): value is WorkbookCommandReceiptStatus;
|
|
140
|
+
export declare function isWorkbookProjectionInterceptorPoint(value: unknown): value is WorkbookProjectionInterceptorPoint;
|
|
141
|
+
export declare function isWorkbookUiContributionSlot(value: unknown): value is WorkbookUiContributionSlot;
|
|
142
|
+
export declare function checkWorkbookCommandRequest(value: unknown): WorkbookCommandRequestCheckResult;
|
|
143
|
+
export declare function normalizeWorkbookCommandRequest(value: unknown): WorkbookCommandRequest;
|
|
144
|
+
export declare function isWorkbookCommandRequest(value: unknown): value is WorkbookCommandRequest;
|
|
145
|
+
export declare function checkWorkbookCommandReceipt(value: unknown): WorkbookCommandReceiptCheckResult;
|
|
146
|
+
export declare function defineWorkbookFeaturePlugin(plugin: WorkbookFeaturePlugin): WorkbookFeaturePlugin;
|
|
147
|
+
export declare function normalizeWorkbookCommandDescriptor(descriptor: WorkbookCommandDescriptor, expectedFeatureId?: WorkbookFeatureId): WorkbookCommandDescriptor;
|
|
148
|
+
export declare function normalizeWorkbookCommandReceipt(receipt: unknown): WorkbookCommandReceipt;
|
|
149
|
+
export declare function isWorkbookCommandReceipt(value: unknown): value is WorkbookCommandReceipt;
|
|
150
|
+
export declare function workbookCommandReceiptOpsMatch(receipt: Pick<WorkbookCommandReceipt, 'previewOps' | 'appliedOps'>): boolean | null;
|