@nanobpm/urban 0.79.0 → 0.81.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/dist/runtime/core/manifest.d.ts +44 -11
- package/dist/runtime/core/modules/cancel.d.ts +13 -8
- package/dist/runtime/core/modules/cancel.js +40 -21
- package/dist/runtime/core/modules/datasource.js +7 -4
- package/dist/runtime/core/modules/formjs.gen.d.ts +1 -0
- package/dist/runtime/core/modules/formjs.gen.js +5 -0
- package/dist/runtime/core/modules/forms.d.ts +22 -0
- package/dist/runtime/core/modules/forms.js +59 -0
- package/dist/runtime/core/modules/gateway.js +5 -4
- package/dist/runtime/core/modules/instance-status-read-model.d.ts +56 -0
- package/dist/runtime/core/modules/instance-status-read-model.js +127 -0
- package/dist/runtime/core/modules/instance-tracking.d.ts +47 -19
- package/dist/runtime/core/modules/instance-tracking.js +451 -123
- package/dist/runtime/core/modules/open-user-tasks-store.d.ts +5 -0
- package/dist/runtime/core/modules/open-user-tasks-store.js +8 -0
- package/dist/runtime/core/modules/pages.js +42 -4
- package/dist/runtime/core/modules/runtime.gen.js +1 -1
- package/dist/runtime/core/modules/surfaces.js +18 -124
- package/dist/runtime/core/read-model.d.ts +28 -0
- package/dist/runtime/core/read-model.js +44 -4
- package/dist/runtime/core/validate.js +192 -0
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.js +5 -0
- package/package.json +1 -1
- package/src/runtime/browser/fake-dom.test-utils.ts +114 -0
- package/src/runtime/browser/formjs.browser.js +192 -0
- package/src/runtime/browser/formjs.browser.test.ts +136 -0
- package/src/runtime/browser/runtime.browser.js +101 -1
- package/src/runtime/browser/runtime.engineform.test.ts +158 -0
- package/src/runtime/core/manifest.ts +44 -11
- package/src/runtime/core/modules/cancel.test.ts +112 -38
- package/src/runtime/core/modules/cancel.ts +42 -22
- package/src/runtime/core/modules/datasource.ts +7 -4
- package/src/runtime/core/modules/formjs.gen.ts +6 -0
- package/src/runtime/core/modules/forms.test.ts +122 -0
- package/src/runtime/core/modules/forms.ts +67 -0
- package/src/runtime/core/modules/gateway.ts +7 -4
- package/src/runtime/core/modules/gen-artifacts.test.ts +41 -0
- package/src/runtime/core/modules/instance-status-read-model.ts +156 -0
- package/src/runtime/core/modules/instance-tracking.test.ts +589 -60
- package/src/runtime/core/modules/instance-tracking.ts +469 -126
- package/src/runtime/core/modules/open-user-tasks-store.test.ts +11 -0
- package/src/runtime/core/modules/open-user-tasks-store.ts +11 -0
- package/src/runtime/core/modules/pages.test.ts +99 -0
- package/src/runtime/core/modules/pages.ts +44 -5
- package/src/runtime/core/modules/runtime.gen.ts +1 -1
- package/src/runtime/core/modules/surfaces.ts +19 -121
- package/src/runtime/core/read-model.test.ts +69 -0
- package/src/runtime/core/read-model.ts +43 -4
- package/src/runtime/core/validate.test.ts +341 -0
- package/src/runtime/core/validate.ts +188 -0
- package/src/runtime/index.ts +15 -0
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
// base/api/complete`). A task with no linked form keeps the bare key-list + raw-complete
|
|
7
7
|
// behavior. The `chat` surface is stubbed as a mount point (LLM wiring is a separate concern).
|
|
8
8
|
// Surfaces contribute routes to the shared server.
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { html, json, normalizeRoutePath } from "../router.js";
|
|
10
|
+
import { FORMJS_JS } from "./formjs.gen.js";
|
|
11
|
+
import { completeUserTaskResponse, resolveFormResponse } from "./forms.js";
|
|
11
12
|
import { mountActions } from "./actions.js";
|
|
12
13
|
import { mountAgent } from "./agent.js";
|
|
13
14
|
import { mountApi } from "./api.js";
|
|
@@ -30,13 +31,15 @@ function inboxPage() {
|
|
|
30
31
|
ul{list-style:none;padding:0}li{margin:.4rem 0;display:flex;align-items:center;gap:.5rem}
|
|
31
32
|
code{background:#f4f4f4;padding:.1rem .3rem;border-radius:3px}
|
|
32
33
|
button{font:inherit;padding:.2rem .6rem;cursor:pointer}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
.njf-field label{display:block;margin:.6rem 0 .2rem;font-weight:600}
|
|
35
|
+
.njf-field input,.njf-field textarea,.njf-field select{font:inherit;padding:.3rem;width:100%;box-sizing:border-box;max-width:24rem}
|
|
36
|
+
.njf-field input[type=checkbox],.njf-field input[type=radio]{width:auto}
|
|
37
|
+
.njf-actions{margin-top:.6rem}
|
|
36
38
|
#form{margin-top:1.5rem;border-top:1px solid #ddd;padding-top:1rem}
|
|
37
39
|
.muted{color:#666}</style>
|
|
38
40
|
<h1>Task inbox</h1><ul id="tasks"><li>loading…</li></ul>
|
|
39
41
|
<div id="form"></div>
|
|
42
|
+
<script>${FORMJS_JS}</script>
|
|
40
43
|
<script>
|
|
41
44
|
const BASE=location.pathname.replace(/[/]+$/,'');
|
|
42
45
|
const tasksEl=document.getElementById('tasks');
|
|
@@ -71,7 +74,14 @@ function openForm(t){
|
|
|
71
74
|
api('/api/form?'+q).then(f=>{
|
|
72
75
|
formEl.replaceChildren();
|
|
73
76
|
if(!f||!f.schema){renderNoForm(t);return;}
|
|
74
|
-
|
|
77
|
+
// Reuse the ONE shared form-js renderer (NanoFormJs) — no fork with the pages surface.
|
|
78
|
+
formEl.appendChild(NanoFormJs.renderForm(f.schema,{
|
|
79
|
+
heading:'Task '+(t.elementId||t.userTaskKey),
|
|
80
|
+
submitLabel:'Submit',
|
|
81
|
+
cancelLabel:'Cancel',
|
|
82
|
+
onSubmit:(variables)=>complete(t.userTaskKey,variables),
|
|
83
|
+
onCancel:loadTasks,
|
|
84
|
+
}));
|
|
75
85
|
}).catch(err=>{formEl.replaceChildren(el('p',{class:'muted'},'Failed to load form: '+err.message));});
|
|
76
86
|
}
|
|
77
87
|
|
|
@@ -83,93 +93,6 @@ function renderNoForm(t){
|
|
|
83
93
|
formEl.appendChild(bar);
|
|
84
94
|
}
|
|
85
95
|
|
|
86
|
-
function renderForm(t,schema){
|
|
87
|
-
const form=document.createElement('form');
|
|
88
|
-
form.appendChild(el('h2',{},'Task '+(t.elementId||t.userTaskKey)));
|
|
89
|
-
const components=Array.isArray(schema.components)?schema.components:[];
|
|
90
|
-
const inputs=[];
|
|
91
|
-
for(const c of components){
|
|
92
|
-
const built=buildField(c);
|
|
93
|
-
if(!built)continue;
|
|
94
|
-
form.appendChild(built.field);
|
|
95
|
-
if(built.read)inputs.push(built.read);
|
|
96
|
-
}
|
|
97
|
-
const submit=btn('Submit',null);submit.type='submit';
|
|
98
|
-
const bar=el('div',{});bar.appendChild(submit);bar.appendChild(btn('Cancel',loadTasks));
|
|
99
|
-
form.appendChild(bar);
|
|
100
|
-
form.addEventListener('submit',e=>{
|
|
101
|
-
e.preventDefault();
|
|
102
|
-
// Null-prototype: field keys come from the engine-supplied form schema. A component
|
|
103
|
-
// keyed '__proto__'/'constructor' must land as a plain own property (and round-trip
|
|
104
|
-
// through JSON), never mutate a prototype — no prototype pollution in the page runtime.
|
|
105
|
-
const variables=Object.create(null);
|
|
106
|
-
for(const read of inputs){const kv=read();if(kv)variables[kv.key]=kv.value;}
|
|
107
|
-
submit.disabled=true;
|
|
108
|
-
complete(t.userTaskKey,variables).catch(()=>{submit.disabled=false;});
|
|
109
|
-
});
|
|
110
|
-
formEl.appendChild(form);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function buildField(c){
|
|
114
|
-
const type=c&&c.type;
|
|
115
|
-
// Static (keyless) components: show text as a paragraph, ignore layout-only ones.
|
|
116
|
-
if(type==='text'){return {field:el('p',{class:'muted'},typeof c.text==='string'?c.text:'')};}
|
|
117
|
-
const key=c&&c.key;
|
|
118
|
-
if(!key)return null;
|
|
119
|
-
const wrap=el('div',{class:'field'});
|
|
120
|
-
const label=typeof c.label==='string'&&c.label?c.label:key;
|
|
121
|
-
if(type==='checkbox'){
|
|
122
|
-
const input=document.createElement('input');input.type='checkbox';
|
|
123
|
-
const lab=el('label',{});lab.appendChild(input);lab.appendChild(document.createTextNode(' '+label));
|
|
124
|
-
wrap.appendChild(lab);
|
|
125
|
-
return {field:wrap,read:()=>({key,value:input.checked})};
|
|
126
|
-
}
|
|
127
|
-
const labelEl=el('label',{},label);
|
|
128
|
-
wrap.appendChild(labelEl);
|
|
129
|
-
let input;
|
|
130
|
-
if(type==='textarea'){input=document.createElement('textarea');}
|
|
131
|
-
else if(type==='select'){
|
|
132
|
-
input=document.createElement('select');
|
|
133
|
-
input.appendChild(el('option',{value:''},'—'));
|
|
134
|
-
for(const o of (Array.isArray(c.values)?c.values:[])){
|
|
135
|
-
input.appendChild(el('option',{value:String(o.value)},String(o.label!=null?o.label:o.value)));
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
else if(type==='radio'){
|
|
139
|
-
const name='r'+Math.random().toString(36).slice(2);
|
|
140
|
-
const group=el('div',{});
|
|
141
|
-
for(const o of (Array.isArray(c.values)?c.values:[])){
|
|
142
|
-
const rlab=el('label',{});
|
|
143
|
-
const r=document.createElement('input');r.type='radio';r.name=name;r.value=String(o.value);
|
|
144
|
-
rlab.appendChild(r);rlab.appendChild(document.createTextNode(' '+String(o.label!=null?o.label:o.value)));
|
|
145
|
-
group.appendChild(rlab);
|
|
146
|
-
}
|
|
147
|
-
wrap.appendChild(group);
|
|
148
|
-
return {field:wrap,read:()=>{const sel=group.querySelector('input:checked');return sel?{key,value:sel.value}:null;}};
|
|
149
|
-
}
|
|
150
|
-
else{
|
|
151
|
-
input=document.createElement('input');
|
|
152
|
-
input.type=(type==='number')?'number':(type==='datetime'?'datetime-local':'text');
|
|
153
|
-
}
|
|
154
|
-
// Associate the label with the input (for/id) so screen readers announce it on focus.
|
|
155
|
-
const fieldId='f'+Math.random().toString(36).slice(2);
|
|
156
|
-
input.id=fieldId;labelEl.setAttribute('for',fieldId);
|
|
157
|
-
wrap.appendChild(input);
|
|
158
|
-
const isNumber=type==='number';
|
|
159
|
-
return {field:wrap,read:()=>{
|
|
160
|
-
const raw=input.value;
|
|
161
|
-
if(raw===''||raw==null)return null;
|
|
162
|
-
if(isNumber){
|
|
163
|
-
const n=Number(raw);
|
|
164
|
-
// A non-numeric value in a number field is only reachable via tampering (the browser
|
|
165
|
-
// blanks invalid type=number input). Treat it as absent rather than silently submitting
|
|
166
|
-
// NaN, which JSON.stringify serializes as null — quietly changing the submitted value.
|
|
167
|
-
return Number.isFinite(n)?{key,value:n}:null;
|
|
168
|
-
}
|
|
169
|
-
return {key,value:raw};
|
|
170
|
-
}};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
96
|
function complete(userTaskKey,variables){
|
|
174
97
|
return api('/api/complete',{method:'POST',headers:{'content-type':'application/json'},
|
|
175
98
|
body:JSON.stringify({userTaskKey,variables})}).then(loadTasks);
|
|
@@ -222,42 +145,13 @@ export function mountSurfaces(ctx, app) {
|
|
|
222
145
|
method: "GET",
|
|
223
146
|
path: `${base}/api/form`,
|
|
224
147
|
source: "surface:taskInbox",
|
|
225
|
-
handler: async (req) =>
|
|
226
|
-
const formKey = req.query.get("formKey") ?? undefined;
|
|
227
|
-
const formId = req.query.get("formId") ?? undefined;
|
|
228
|
-
// Reject only when *neither* identifier is present. Presence follows getForm's
|
|
229
|
-
// canonical rule (`presentFormIdentifier`: empty/whitespace = absent) so a
|
|
230
|
-
// whitespace-only `?formKey= ` request 400s here instead of slipping past a raw
|
|
231
|
-
// truthiness check and returning a spurious 204. The raw values are still passed
|
|
232
|
-
// through unchanged — resolving a blank key to its `formId` fallback is getForm's
|
|
233
|
-
// single responsibility.
|
|
234
|
-
if (!presentFormIdentifier(formKey) && !presentFormIdentifier(formId))
|
|
235
|
-
return json({ error: "formKey or formId required" }, 400);
|
|
236
|
-
const form = await app.engine.getForm({ formKey, formId });
|
|
237
|
-
// A task whose form can't be resolved returns 204: the client renders the
|
|
238
|
-
// no-form fallback rather than erroring.
|
|
239
|
-
if (!form)
|
|
240
|
-
return noContent();
|
|
241
|
-
return json(form);
|
|
242
|
-
},
|
|
148
|
+
handler: async (req) => resolveFormResponse(app.engine, req.query.get("formKey") ?? undefined, req.query.get("formId") ?? undefined),
|
|
243
149
|
});
|
|
244
150
|
routes.push({
|
|
245
151
|
method: "POST",
|
|
246
152
|
path: `${base}/api/complete`,
|
|
247
153
|
source: "surface:taskInbox",
|
|
248
|
-
handler: async (req) =>
|
|
249
|
-
let body;
|
|
250
|
-
try {
|
|
251
|
-
body = JSON.parse((await req.text()) || "{}");
|
|
252
|
-
}
|
|
253
|
-
catch {
|
|
254
|
-
return json({ error: "invalid JSON body" }, 400);
|
|
255
|
-
}
|
|
256
|
-
if (!body.userTaskKey)
|
|
257
|
-
return json({ error: "userTaskKey required" }, 400);
|
|
258
|
-
await app.engine.completeUserTask(body.userTaskKey, body.variables);
|
|
259
|
-
return json({ ok: true });
|
|
260
|
-
},
|
|
154
|
+
handler: async (req) => completeUserTaskResponse(app.engine, await req.text()),
|
|
261
155
|
});
|
|
262
156
|
}
|
|
263
157
|
const chat = surfaces.chat;
|
|
@@ -128,7 +128,27 @@ export interface SqlCompileOptions {
|
|
|
128
128
|
/** Resolve a projection NAME to its physical SQL table/view. Defaults to {@link projectionRegistry}. */
|
|
129
129
|
readonly resolveProjectionTable?: (name: string) => string;
|
|
130
130
|
}
|
|
131
|
+
/** A conservative SQL identifier guard — we interpolate names directly into DDL/SQL. This is the
|
|
132
|
+
* single source of truth for "is this a legal identifier"; the manifest validator imports it (rather
|
|
133
|
+
* than re-declaring the regex) so a name accepted at author time is accepted at VIEW provisioning too
|
|
134
|
+
* (No Drift Surfaces — a divergence would let a manifest validate but fail at boot). */
|
|
135
|
+
export declare const SQL_IDENT: RegExp;
|
|
136
|
+
/** True iff `name` is a legal SQL identifier per {@link SQL_IDENT}. The boolean twin of
|
|
137
|
+
* {@link assertSqlIdentifier}, for callers (e.g. the manifest validator) that collect issues rather
|
|
138
|
+
* than throw. */
|
|
139
|
+
export declare function isSqlIdentifier(name: string): boolean;
|
|
131
140
|
export declare function assertSqlIdentifier(kind: string, name: string): string;
|
|
141
|
+
/** Object-name prefixes reserved for engine/runtime internals. Tables and views whose names begin
|
|
142
|
+
* with one of these are Nano bookkeeping (`_urban_*` / `_nano_*`) or SQLite internals (`sqlite_*`):
|
|
143
|
+
* the provenance recorder skips them (`modules/datasource.ts`) and the datasource `schema()` surface
|
|
144
|
+
* filters them out (`modules/gateway.ts`), so they are invisible to `/app/data`, DB Manager, and forms.
|
|
145
|
+
* This is the single source of truth for that prefix set (No Drift Surfaces — a manifest that provisions
|
|
146
|
+
* a `_urban_*` VIEW would otherwise validate yet be unreadable by the documented pages surface). */
|
|
147
|
+
export declare const RESERVED_OBJECT_PREFIXES: readonly ["_urban_", "_nano_", "sqlite_"];
|
|
148
|
+
/** True iff `name` begins with a {@link RESERVED_OBJECT_PREFIXES} prefix. Case-insensitive, matching
|
|
149
|
+
* SQLite's ASCII identifier folding (a `_URBAN_x` table resolves to the same reserved object as
|
|
150
|
+
* `_urban_x`), so a reserved name cannot slip through by casing. */
|
|
151
|
+
export declare function isReservedObjectName(name: string): boolean;
|
|
132
152
|
/**
|
|
133
153
|
* Compile ONE derivation expression to a SQLite select-list expression string — the derived column's
|
|
134
154
|
* body inside the managed VIEW. Both backends walk the SAME AST, so the SQL here and the function
|
|
@@ -143,6 +163,14 @@ export type DerivationFn = (baseRow: BaseRow, projections?: ProjectionRows) => u
|
|
|
143
163
|
* named projection's rows (the TS side of the projection-name seam). Both backends walk the SAME AST.
|
|
144
164
|
*/
|
|
145
165
|
export declare function compileToFn(expr: Expr): DerivationFn;
|
|
166
|
+
/** Resolve a column value the way SQLite resolves an identifier: an exact-key match first, then a
|
|
167
|
+
* case-insensitive fallback. SQLite folds ASCII identifier case even for quoted identifiers, so the
|
|
168
|
+
* VIEW's `col("Status")` binds to a table declared with column `status`; a plain case-sensitive JS
|
|
169
|
+
* `row["Status"]` would miss it and return null, breaking VIEW/TS parity on the no-edge fallback and on
|
|
170
|
+
* `keyField` correlation. Fold here so both backends read the same column. (A table cannot declare two
|
|
171
|
+
* columns differing only in case, so the fallback is unambiguous.) Returns `null` for a missing column,
|
|
172
|
+
* preserving the previous `?? null` contract. */
|
|
173
|
+
export declare function lookupColumn(row: Record<string, unknown>, name: string): unknown;
|
|
146
174
|
/** The declarative read-model input passed to {@link defineReadModel}. */
|
|
147
175
|
export interface ReadModelDecl {
|
|
148
176
|
/** The managed VIEW name (also the read-model identifier). */
|
|
@@ -133,14 +133,37 @@ const DEFAULT_BASE_ALIAS = "base";
|
|
|
133
133
|
function resolveBaseAlias(alias) {
|
|
134
134
|
return assertSqlIdentifier("base alias", alias ?? DEFAULT_BASE_ALIAS);
|
|
135
135
|
}
|
|
136
|
-
/** A conservative SQL identifier guard — we interpolate names directly into DDL/SQL.
|
|
137
|
-
|
|
136
|
+
/** A conservative SQL identifier guard — we interpolate names directly into DDL/SQL. This is the
|
|
137
|
+
* single source of truth for "is this a legal identifier"; the manifest validator imports it (rather
|
|
138
|
+
* than re-declaring the regex) so a name accepted at author time is accepted at VIEW provisioning too
|
|
139
|
+
* (No Drift Surfaces — a divergence would let a manifest validate but fail at boot). */
|
|
140
|
+
export const SQL_IDENT = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
141
|
+
/** True iff `name` is a legal SQL identifier per {@link SQL_IDENT}. The boolean twin of
|
|
142
|
+
* {@link assertSqlIdentifier}, for callers (e.g. the manifest validator) that collect issues rather
|
|
143
|
+
* than throw. */
|
|
144
|
+
export function isSqlIdentifier(name) {
|
|
145
|
+
return SQL_IDENT.test(name);
|
|
146
|
+
}
|
|
138
147
|
export function assertSqlIdentifier(kind, name) {
|
|
139
148
|
if (!SQL_IDENT.test(name)) {
|
|
140
149
|
throw new Error(`invalid ${kind} "${name}": must match ${SQL_IDENT.source}`);
|
|
141
150
|
}
|
|
142
151
|
return name;
|
|
143
152
|
}
|
|
153
|
+
/** Object-name prefixes reserved for engine/runtime internals. Tables and views whose names begin
|
|
154
|
+
* with one of these are Nano bookkeeping (`_urban_*` / `_nano_*`) or SQLite internals (`sqlite_*`):
|
|
155
|
+
* the provenance recorder skips them (`modules/datasource.ts`) and the datasource `schema()` surface
|
|
156
|
+
* filters them out (`modules/gateway.ts`), so they are invisible to `/app/data`, DB Manager, and forms.
|
|
157
|
+
* This is the single source of truth for that prefix set (No Drift Surfaces — a manifest that provisions
|
|
158
|
+
* a `_urban_*` VIEW would otherwise validate yet be unreadable by the documented pages surface). */
|
|
159
|
+
export const RESERVED_OBJECT_PREFIXES = ["_urban_", "_nano_", "sqlite_"];
|
|
160
|
+
/** True iff `name` begins with a {@link RESERVED_OBJECT_PREFIXES} prefix. Case-insensitive, matching
|
|
161
|
+
* SQLite's ASCII identifier folding (a `_URBAN_x` table resolves to the same reserved object as
|
|
162
|
+
* `_urban_x`), so a reserved name cannot slip through by casing. */
|
|
163
|
+
export function isReservedObjectName(name) {
|
|
164
|
+
const folded = name.toLowerCase();
|
|
165
|
+
return RESERVED_OBJECT_PREFIXES.some((p) => folded.startsWith(p));
|
|
166
|
+
}
|
|
144
167
|
function quoteIdent(name) {
|
|
145
168
|
return `"${name.replace(/"/g, '""')}"`;
|
|
146
169
|
}
|
|
@@ -365,11 +388,11 @@ export function compileToFn(expr) {
|
|
|
365
388
|
case "lit":
|
|
366
389
|
return node.value;
|
|
367
390
|
case "col":
|
|
368
|
-
return baseRow
|
|
391
|
+
return lookupColumn(baseRow, node.name);
|
|
369
392
|
case "pcol":
|
|
370
393
|
if (!projRow)
|
|
371
394
|
throw new Error(`pcol("${node.name}") evaluated outside an EXISTS projection context`);
|
|
372
|
-
return projRow
|
|
395
|
+
return lookupColumn(projRow, node.name);
|
|
373
396
|
case "compare":
|
|
374
397
|
return compareValues(node.op, evalNode(node.left, baseRow, projections, projRow), evalNode(node.right, baseRow, projections, projRow));
|
|
375
398
|
case "and":
|
|
@@ -394,6 +417,23 @@ export function compileToFn(expr) {
|
|
|
394
417
|
};
|
|
395
418
|
return (baseRow, projections = {}) => evalNode(expr, baseRow, projections);
|
|
396
419
|
}
|
|
420
|
+
/** Resolve a column value the way SQLite resolves an identifier: an exact-key match first, then a
|
|
421
|
+
* case-insensitive fallback. SQLite folds ASCII identifier case even for quoted identifiers, so the
|
|
422
|
+
* VIEW's `col("Status")` binds to a table declared with column `status`; a plain case-sensitive JS
|
|
423
|
+
* `row["Status"]` would miss it and return null, breaking VIEW/TS parity on the no-edge fallback and on
|
|
424
|
+
* `keyField` correlation. Fold here so both backends read the same column. (A table cannot declare two
|
|
425
|
+
* columns differing only in case, so the fallback is unambiguous.) Returns `null` for a missing column,
|
|
426
|
+
* preserving the previous `?? null` contract. */
|
|
427
|
+
export function lookupColumn(row, name) {
|
|
428
|
+
if (Object.hasOwn(row, name))
|
|
429
|
+
return row[name] ?? null;
|
|
430
|
+
const folded = name.toLowerCase();
|
|
431
|
+
for (const key of Object.keys(row)) {
|
|
432
|
+
if (key.toLowerCase() === folded)
|
|
433
|
+
return row[key] ?? null;
|
|
434
|
+
}
|
|
435
|
+
return null;
|
|
436
|
+
}
|
|
397
437
|
function collectProjectionNames(expr, into) {
|
|
398
438
|
switch (expr.kind) {
|
|
399
439
|
case "exists":
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
import schema from "@nanobpm/nano-app-schema/schema" with { type: "json" };
|
|
11
11
|
import { isRecord } from "./guards.js";
|
|
12
12
|
import { BIND_MODES, NETWORK_KEYS, isBindMode, isConfiguredStatusSelector } from "./manifest.js";
|
|
13
|
+
import { DEFAULT_DERIVED_STATUS_COLUMN, defaultInstanceTrackingViewName, } from "./modules/instance-status-read-model.js";
|
|
14
|
+
import { SQL_IDENT, isReservedObjectName } from "./read-model.js";
|
|
13
15
|
export class ManifestValidationError extends Error {
|
|
14
16
|
issues;
|
|
15
17
|
constructor(issues) {
|
|
@@ -169,12 +171,47 @@ export function collectManifestIssues(m) {
|
|
|
169
171
|
if (tracking) {
|
|
170
172
|
tracking.forEach((t, i) => {
|
|
171
173
|
const b = isRecord(t) ? t : undefined;
|
|
174
|
+
// Only a status-bearing binding builds a derived VIEW; a status-less binding just feeds projections
|
|
175
|
+
// and is polled through `api.data.table()`, whose `Table<T>` gateway safely `quoteIdent`s the base
|
|
176
|
+
// table and key column (so a name like `external-orders` works). The SQL_IDENT restriction below is
|
|
177
|
+
// therefore required ONLY when a VIEW is actually built (`table`/`keyField` are interpolated raw into
|
|
178
|
+
// its DDL/edge predicates then) — enforcing it on a status-less binding wrongly rejects a valid name
|
|
179
|
+
// that provisioning never touches. Gate on `buildsView` so validation and provisioning agree exactly
|
|
180
|
+
// (No Drift — a name is rejected here iff it would break at VIEW build).
|
|
181
|
+
const buildsView = typeof b?.statusField === "string" && b.statusField.length > 0;
|
|
172
182
|
if (typeof b?.table !== "string" || b.table.length === 0) {
|
|
173
183
|
issues.push({ path: `instanceTracking[${i}].table`, message: "missing table" });
|
|
174
184
|
}
|
|
185
|
+
else if (buildsView && !SQL_IDENT.test(b.table)) {
|
|
186
|
+
// The base `table` is compiled directly into the derived VIEW's DDL (`defineReadModel` asserts
|
|
187
|
+
// `baseTable` matches SQL_IDENT). Manifest validation historically only checked non-empty, so a
|
|
188
|
+
// name like `external-orders` validated and was polled while the VIEW was silently skipped at
|
|
189
|
+
// mount (read-model construction throws). Enforce the identifier rule at author time so validation
|
|
190
|
+
// and provisioning agree (No Drift — a name accepted here is accepted at VIEW build).
|
|
191
|
+
issues.push({
|
|
192
|
+
path: `instanceTracking[${i}].table`,
|
|
193
|
+
message: `table must be a SQL identifier (${SQL_IDENT.source})`,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
175
196
|
if (typeof b?.keyField !== "string" || b.keyField.length === 0) {
|
|
176
197
|
issues.push({ path: `instanceTracking[${i}].keyField`, message: "missing keyField" });
|
|
177
198
|
}
|
|
199
|
+
else if (buildsView && !SQL_IDENT.test(b.keyField)) {
|
|
200
|
+
// `keyField` is interpolated into the derived VIEW's edge predicates (`terminatedEdgeExpr`), so it
|
|
201
|
+
// must be a bare identifier for the same reason `table` must — but only when a VIEW is built.
|
|
202
|
+
issues.push({
|
|
203
|
+
path: `instanceTracking[${i}].keyField`,
|
|
204
|
+
message: `keyField must be a SQL identifier (${SQL_IDENT.source})`,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
// `statusField`, when present, becomes a VIEW output column (`col(statusField)`), so it must also be
|
|
208
|
+
// a bare identifier — a non-identifier would fail opaquely at VIEW construction.
|
|
209
|
+
if (typeof b?.statusField === "string" && b.statusField.length > 0 && !SQL_IDENT.test(b.statusField)) {
|
|
210
|
+
issues.push({
|
|
211
|
+
path: `instanceTracking[${i}].statusField`,
|
|
212
|
+
message: `statusField must be a SQL identifier (${SQL_IDENT.source})`,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
178
215
|
const onTerminated = isRecord(b?.onTerminated) ? b.onTerminated : undefined;
|
|
179
216
|
const set = isRecord(onTerminated?.set) ? onTerminated.set : undefined;
|
|
180
217
|
if (!set || Object.keys(set).length === 0) {
|
|
@@ -183,6 +220,9 @@ export function collectManifestIssues(m) {
|
|
|
183
220
|
message: "missing onTerminated.set patch (a non-empty column → value map)",
|
|
184
221
|
});
|
|
185
222
|
}
|
|
223
|
+
// The single derived-status target for this binding (used by the readModel.statusColumn collision
|
|
224
|
+
// guard below). Undefined when absent/blank.
|
|
225
|
+
const statusFieldName = typeof b?.statusField === "string" && b.statusField.length > 0 ? b.statusField : undefined;
|
|
186
226
|
// `onWaitingHuman` (issue #355) is the optional wait-on-human edge — the twin of
|
|
187
227
|
// `onTerminated`. It is optional (a binding may reconcile only the terminal edge), but when
|
|
188
228
|
// present its `set` must be a non-empty column → value patch for the same reason
|
|
@@ -246,6 +286,158 @@ export function collectManifestIssues(m) {
|
|
|
246
286
|
message: "pollMs must be a finite positive number of milliseconds",
|
|
247
287
|
});
|
|
248
288
|
}
|
|
289
|
+
// `readModel` (ADR 0065, the writer→source inversion) overrides the derived status VIEW name /
|
|
290
|
+
// column the runtime provisions. Both are compiled into SQL identifiers, so a non-identifier
|
|
291
|
+
// value would fail opaquely at VIEW provisioning; validate them here. The VIEW must differ from
|
|
292
|
+
// the base `table` (SQLite forbids a view and a table sharing a name).
|
|
293
|
+
if (b?.readModel !== undefined) {
|
|
294
|
+
const rm = isRecord(b.readModel) ? b.readModel : undefined;
|
|
295
|
+
if (!rm) {
|
|
296
|
+
issues.push({
|
|
297
|
+
path: `instanceTracking[${i}].readModel`,
|
|
298
|
+
message: "readModel must be an object with optional `view` / `statusColumn`",
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
// Mirror the schema's `additionalProperties: false` intent (as the `network` block does): reject
|
|
303
|
+
// unknown keys so a typo like `statusColum` fails loudly instead of silently falling back to the
|
|
304
|
+
// default derived column while the page reads the wrong field.
|
|
305
|
+
for (const k of Object.keys(rm)) {
|
|
306
|
+
if (k !== "view" && k !== "statusColumn") {
|
|
307
|
+
issues.push({
|
|
308
|
+
path: `instanceTracking[${i}].readModel.${k}`,
|
|
309
|
+
message: "unknown key (readModel additionalProperties: false)",
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
for (const field of ["view", "statusColumn"]) {
|
|
314
|
+
const v = rm[field];
|
|
315
|
+
if (v !== undefined && (typeof v !== "string" || !SQL_IDENT.test(v))) {
|
|
316
|
+
issues.push({
|
|
317
|
+
path: `instanceTracking[${i}].readModel.${field}`,
|
|
318
|
+
message: `readModel.${field} must be a SQL identifier (${SQL_IDENT.source})`,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
// Fold case before comparing: `defineReadModel`/SQLite treat identifiers case-insensitively,
|
|
323
|
+
// so `table:"plans"` + `readModel.view:"Plans"` would pass a case-sensitive check here yet be
|
|
324
|
+
// rejected as a base-table collision at VIEW construction. Compare folded so author-time
|
|
325
|
+
// validation matches provisioning behavior.
|
|
326
|
+
if (typeof rm.view === "string" && typeof b?.table === "string" && rm.view.toLowerCase() === b.table.toLowerCase()) {
|
|
327
|
+
issues.push({
|
|
328
|
+
path: `instanceTracking[${i}].readModel.view`,
|
|
329
|
+
message: "readModel.view must differ from the base table (a view cannot shadow its table)",
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
// The VIEW emits `${statusColumn} AS ...` after `base.*`; if the derived status column folds to
|
|
333
|
+
// the same identifier as the base `statusField`, SQLite exposes two output columns of that name
|
|
334
|
+
// and keeps the base (stored) one — so consumers read the STALE value, silently defeating the
|
|
335
|
+
// derivation. Reject the collision at author time (case-insensitive, matching SQLite's folding).
|
|
336
|
+
if (typeof rm.statusColumn === "string" && statusFieldName !== undefined &&
|
|
337
|
+
rm.statusColumn.toLowerCase() === statusFieldName.toLowerCase()) {
|
|
338
|
+
issues.push({
|
|
339
|
+
path: `instanceTracking[${i}].readModel.statusColumn`,
|
|
340
|
+
message: `readModel.statusColumn must differ from statusField "${statusFieldName}" (a same-named derived column is shadowed by the stored base column and reads stale)`,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
// Validate the EFFECTIVE default target too, not just an explicit override. When
|
|
346
|
+
// `readModel.statusColumn` is omitted (or `readModel` entirely), the VIEW derives the status
|
|
347
|
+
// under the default column `derived_status`. A binding with `statusField: "derived_status"` and
|
|
348
|
+
// no override therefore collides with the default derived column exactly as an explicit override
|
|
349
|
+
// would — SQLite keeps the stored base column and the derived read is stale. The explicit-override
|
|
350
|
+
// collision is caught above; this closes the omitted-override path (which the runtime would
|
|
351
|
+
// otherwise only discover at boot, then skip the VIEW).
|
|
352
|
+
const rmRec = isRecord(b?.readModel) ? b.readModel : undefined;
|
|
353
|
+
const hasExplicitStatusColumn = typeof rmRec?.statusColumn === "string" && rmRec.statusColumn.length > 0;
|
|
354
|
+
if (statusFieldName !== undefined && !hasExplicitStatusColumn &&
|
|
355
|
+
DEFAULT_DERIVED_STATUS_COLUMN.toLowerCase() === statusFieldName.toLowerCase()) {
|
|
356
|
+
issues.push({
|
|
357
|
+
path: `instanceTracking[${i}].statusField`,
|
|
358
|
+
message: `statusField "${statusFieldName}" collides with the default derived status column "${DEFAULT_DERIVED_STATUS_COLUMN}" (set readModel.statusColumn to a distinct name, or rename statusField)`,
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
// Reserved-base-table guard (ADR 0065): the base `table` must not itself be a reserved runtime
|
|
362
|
+
// object (`_urban_` / `_nano_` / `sqlite_`). The reserved-VIEW guard below only rejects a reserved
|
|
363
|
+
// *effective view name*, so a binding like `table: "_urban_instance_state", readModel: { view:
|
|
364
|
+
// "tracking" }` slips through — it would publish a NON-reserved `tracking` VIEW that SELECTs the
|
|
365
|
+
// runtime's hidden instance-state sidecar, and `gateway.schema()` filters only the object NAME, so
|
|
366
|
+
// `/app/data/.../tracking` would expose those internal rows. A tracking binding over a reserved
|
|
367
|
+
// runtime table is never legitimate; reject it at author time regardless of statusField.
|
|
368
|
+
if (typeof b?.table === "string" && b.table.length > 0 && isReservedObjectName(b.table)) {
|
|
369
|
+
issues.push({
|
|
370
|
+
path: `instanceTracking[${i}].table`,
|
|
371
|
+
message: `base table "${b.table}" uses a reserved prefix (_urban_ / _nano_ / sqlite_); tracking a reserved runtime table would publish a derived VIEW over hidden runtime state (choose an application base table)`,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
// Reserved-prefix guard (ADR 0065): the effective managed VIEW name (`readModel.view` or the
|
|
375
|
+
// default `<table>__tracking`) must not begin with a reserved object prefix (`_urban_` / `_nano_`
|
|
376
|
+
// / `sqlite_`). Such a VIEW provisions fine but is filtered out of the datasource `schema()`
|
|
377
|
+
// surface (`gateway.ts`), so the operator page configured for it reads `unknown table`. Reject at
|
|
378
|
+
// author time rather than let it fail opaquely at read. Only bindings with a `statusField`
|
|
379
|
+
// provision a VIEW, so only those can hit this.
|
|
380
|
+
if (statusFieldName !== undefined && typeof b?.table === "string" && b.table.length > 0) {
|
|
381
|
+
const rmView = typeof rmRec?.view === "string" && rmRec.view.length > 0 ? rmRec.view : undefined;
|
|
382
|
+
const effectiveView = rmView ?? defaultInstanceTrackingViewName(b.table);
|
|
383
|
+
if (isReservedObjectName(effectiveView)) {
|
|
384
|
+
issues.push({
|
|
385
|
+
path: rmView ? `instanceTracking[${i}].readModel.view` : `instanceTracking[${i}].table`,
|
|
386
|
+
message: `managed VIEW name "${effectiveView}" uses a reserved prefix (_urban_ / _nano_ / sqlite_); such a view is hidden from the datasource surface and cannot be read by a page (choose a non-reserved readModel.view or base table name)`,
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
// Duplicate managed-VIEW names across bindings (ADR 0065): each binding's read model DROP+CREATEs a
|
|
392
|
+
// VIEW named `readModel.view` or, by default, `<table>__tracking`. Two bindings that fold to the same
|
|
393
|
+
// VIEW name (two bindings on one base table with no distinct override, or names differing only by
|
|
394
|
+
// case) would silently clobber each other at provisioning — the later CREATE wins and the earlier
|
|
395
|
+
// binding loses its derivation. Reject the collision here, folded (SQLite folds identifiers), naming
|
|
396
|
+
// both bindings. Only bindings with a `statusField` provision a VIEW, so only those can collide.
|
|
397
|
+
const viewOwners = new Map();
|
|
398
|
+
// Also reserve every binding's BASE TABLE name: SQLite shares one namespace for tables and views,
|
|
399
|
+
// so a managed VIEW `orders__tracking` for one binding collides with another binding whose base
|
|
400
|
+
// `table` is `orders__tracking`. The manifest would pass validation, then `CREATE VIEW` fails at boot
|
|
401
|
+
// and the first binding loses its derived surface. Collect base tables first (folded), then flag any
|
|
402
|
+
// managed-view name that lands on one.
|
|
403
|
+
const baseTableOwners = new Map();
|
|
404
|
+
tracking.forEach((t, i) => {
|
|
405
|
+
const b = isRecord(t) ? t : undefined;
|
|
406
|
+
if (typeof b?.table !== "string" || b.table.length === 0)
|
|
407
|
+
return;
|
|
408
|
+
const folded = b.table.toLowerCase();
|
|
409
|
+
if (!baseTableOwners.has(folded))
|
|
410
|
+
baseTableOwners.set(folded, i);
|
|
411
|
+
});
|
|
412
|
+
tracking.forEach((t, i) => {
|
|
413
|
+
const b = isRecord(t) ? t : undefined;
|
|
414
|
+
if (typeof b?.table !== "string" || b.table.length === 0)
|
|
415
|
+
return;
|
|
416
|
+
if (typeof b?.statusField !== "string" || b.statusField.length === 0)
|
|
417
|
+
return; // no VIEW ⇒ no collision
|
|
418
|
+
const rm = isRecord(b.readModel) ? b.readModel : undefined;
|
|
419
|
+
const view = typeof rm?.view === "string" && rm.view.length > 0 ? rm.view : defaultInstanceTrackingViewName(b.table);
|
|
420
|
+
const folded = view.toLowerCase();
|
|
421
|
+
const prev = viewOwners.get(folded);
|
|
422
|
+
if (prev !== undefined) {
|
|
423
|
+
issues.push({
|
|
424
|
+
path: `instanceTracking[${i}].readModel.view`,
|
|
425
|
+
message: `managed VIEW name "${view}" collides with instanceTracking[${prev}] (identifiers fold case-insensitively); give each binding a distinct readModel.view`,
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
viewOwners.set(folded, i);
|
|
430
|
+
}
|
|
431
|
+
// A managed VIEW name that folds to another binding's base table shares SQLite's table/view
|
|
432
|
+
// namespace and would fail `CREATE VIEW` at boot. (Its own base table is already rejected above as
|
|
433
|
+
// "view cannot shadow its table"; here we catch collisions with a DIFFERENT binding's base table.)
|
|
434
|
+
const tableOwner = baseTableOwners.get(folded);
|
|
435
|
+
if (tableOwner !== undefined && tableOwner !== i) {
|
|
436
|
+
issues.push({
|
|
437
|
+
path: `instanceTracking[${i}].readModel.view`,
|
|
438
|
+
message: `managed VIEW name "${view}" collides with the base table of instanceTracking[${tableOwner}] (SQLite shares one table/view namespace); give this binding a distinct readModel.view`,
|
|
439
|
+
});
|
|
440
|
+
}
|
|
249
441
|
});
|
|
250
442
|
}
|
|
251
443
|
return issues;
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type { DispatchMode, Disposer, EmitChannel, ErrorSink, EventBusOptions, L
|
|
|
5
5
|
export { URBAN_EVENT_MODES, createUrbanEvents, mountExtensions, urbanEventMode } from "./core/extensions.ts";
|
|
6
6
|
export type { DispatchRequest, DispatchResponse, ExtensionHost, ExtensionRegistered, ExtensionSetupContext, GateDecision, GateRequest, LifecycleEvent, MountExtensionsOptions, ReconcileEvent, UrbanEventName, UrbanEvents, UrbanExtension, } from "./core/extensions.ts";
|
|
7
7
|
export { bindModeToHost, expandEnv, expandEnvString, isBindMode, loadManifest, parseManifest, resolveBindHost, resolveBindMode, workerJobType, ALL_INTERFACES_HOST, BIND_ENV_VAR, LOOPBACK_HOST, } from "./core/manifest.ts";
|
|
8
|
-
export type { ActionDecl, AppManifest, BindMode, ChatSurface, DataSource, DomainField, DomainType, LlmBinding, NetworkConfig, PagesSurface, Surfaces, TaskInboxSurface, Trigger, Worker, } from "./core/manifest.ts";
|
|
8
|
+
export type { ActionDecl, AppManifest, BindMode, ChatSurface, DataSource, DomainField, DomainType, InstanceTracking, LlmBinding, NetworkConfig, PagesSurface, Surfaces, TaskInboxSurface, Trigger, Worker, } from "./core/manifest.ts";
|
|
9
9
|
export { collectManifestIssues, ManifestValidationError, validateManifest, } from "./core/validate.ts";
|
|
10
10
|
export type { ValidationIssue } from "./core/validate.ts";
|
|
11
11
|
export type { EngineClient, EngineJob, FormSchema, HostContext, HttpHandler, HttpRequest, HttpResponse, HttpServer, JobHandler, ProcessInstanceSnapshot, ProcessInstanceState, SqliteDb, UserTaskState, UserTaskSummary, UserTaskFilter, WatchHandle, WorkerSubscription, } from "./core/host.ts";
|
|
@@ -47,6 +47,7 @@ export { OPEN_USER_TASKS_PROJECTION, OPEN_USER_TASKS_SCHEMA_SQL, OPEN_USER_TASKS
|
|
|
47
47
|
export type { OpenUserTaskRow, OpenUserTasksStoreOptions, } from "./core/modules/open-user-tasks-store.ts";
|
|
48
48
|
export { INSTANCE_STATE_PROJECTION, INSTANCE_STATE_SCHEMA_SQL, INSTANCE_STATE_TABLE, InstanceStateStore, } from "./core/modules/instance-state-store.ts";
|
|
49
49
|
export type { InstanceStateRow, InstanceStateStoreOptions, } from "./core/modules/instance-state-store.ts";
|
|
50
|
+
export { DEFAULT_DERIVED_STATUS_COLUMN, defaultInstanceTrackingViewName, defineInstanceTrackingReadModel, deriveInstanceStatusExpr, instanceTrackingReadModelTarget, TERMINATED_STATE, terminatedEdgeExpr, waitingHumanEdgeExpr, } from "./core/modules/instance-status-read-model.ts";
|
|
50
51
|
export { buildScopeIndex, derivePhase, deriveInstancePhases, furthestReached, rollupLineagePhase, SCOPE_CONTAINERS, } from "./core/phase.ts";
|
|
51
52
|
export type { CrumbKind, CrumbSource, DerivePhaseOptions, FurthestReached, InstancePhase, LineagePhaseRollup, Phase, PhaseCrumb, PhaseGranularity, ProvenanceProgressRow, ScopeElement, ScopeIndex, } from "./core/phase.ts";
|
|
52
53
|
export { deployModels, RESOURCES_DIR } from "./core/modules/deploy.ts";
|
package/dist/runtime/index.js
CHANGED
|
@@ -61,6 +61,11 @@ export { and, assertReadModelParity, assertSqlIdentifier, caseWhen, col, compile
|
|
|
61
61
|
export { CANONICAL_PROJECTIONS, registerCanonicalProjections, } from "./core/modules/canonical-projections.js";
|
|
62
62
|
export { OPEN_USER_TASKS_PROJECTION, OPEN_USER_TASKS_SCHEMA_SQL, OPEN_USER_TASKS_TABLE, OpenUserTasksStore, } from "./core/modules/open-user-tasks-store.js";
|
|
63
63
|
export { INSTANCE_STATE_PROJECTION, INSTANCE_STATE_SCHEMA_SQL, INSTANCE_STATE_TABLE, InstanceStateStore, } from "./core/modules/instance-state-store.js";
|
|
64
|
+
// The DERIVED half of the instanceTracking writer→source inversion (ADR 0065, #439-L1 / #318): the
|
|
65
|
+
// builder that declares a binding's effective-status read model — the terminal + wait-on-human edges —
|
|
66
|
+
// as ONE `defineReadModel` derivation over the canonical projections, compiled to both the managed
|
|
67
|
+
// SQLite VIEW and the TS function. The reconciler feeds the projections; this derives the status edge.
|
|
68
|
+
export { DEFAULT_DERIVED_STATUS_COLUMN, defaultInstanceTrackingViewName, defineInstanceTrackingReadModel, deriveInstanceStatusExpr, instanceTrackingReadModelTarget, TERMINATED_STATE, terminatedEdgeExpr, waitingHumanEdgeExpr, } from "./core/modules/instance-status-read-model.js";
|
|
64
69
|
// instance in?" from the BPMN scope hierarchy + write-provenance (Tier 0, zero declaration), an
|
|
65
70
|
// optional `nano:phase` override (Tier 1), and a lineage rollup for the epic frontier (Tier 2).
|
|
66
71
|
export { buildScopeIndex, derivePhase, deriveInstancePhases, furthestReached, rollupLineagePhase, SCOPE_CONTAINERS, } from "./core/phase.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanobpm/urban",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.81.0",
|
|
4
4
|
"description": "Urban: build and run code-first apps on Nano — runtime, derivation toolkit, and CLI in one. Author durable processes with @nanobpm/workflow (defineFlow), a typed datasource, forms, triggers and surfaces from a nano.app.json manifest, on Node or Deno.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|