@nanobpm/urban 0.80.0 → 0.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/runtime/core/manifest.d.ts +44 -11
  2. package/dist/runtime/core/modules/cancel.d.ts +13 -8
  3. package/dist/runtime/core/modules/cancel.js +40 -21
  4. package/dist/runtime/core/modules/datasource.js +7 -4
  5. package/dist/runtime/core/modules/gateway.js +5 -4
  6. package/dist/runtime/core/modules/instance-status-read-model.d.ts +56 -0
  7. package/dist/runtime/core/modules/instance-status-read-model.js +127 -0
  8. package/dist/runtime/core/modules/instance-tracking.d.ts +47 -19
  9. package/dist/runtime/core/modules/instance-tracking.js +451 -123
  10. package/dist/runtime/core/modules/open-user-tasks-store.d.ts +5 -0
  11. package/dist/runtime/core/modules/open-user-tasks-store.js +8 -0
  12. package/dist/runtime/core/modules/pages.js +6 -4
  13. package/dist/runtime/core/modules/workers.js +25 -1
  14. package/dist/runtime/core/read-model.d.ts +296 -5
  15. package/dist/runtime/core/read-model.js +1077 -39
  16. package/dist/runtime/core/validate.js +192 -0
  17. package/dist/runtime/index.d.ts +4 -3
  18. package/dist/runtime/index.js +11 -1
  19. package/package.json +1 -1
  20. package/src/runtime/core/manifest.ts +44 -11
  21. package/src/runtime/core/modules/cancel.test.ts +112 -38
  22. package/src/runtime/core/modules/cancel.ts +42 -22
  23. package/src/runtime/core/modules/datasource.ts +7 -4
  24. package/src/runtime/core/modules/gateway.ts +7 -4
  25. package/src/runtime/core/modules/instance-status-read-model.ts +156 -0
  26. package/src/runtime/core/modules/instance-tracking.test.ts +589 -60
  27. package/src/runtime/core/modules/instance-tracking.ts +469 -126
  28. package/src/runtime/core/modules/open-user-tasks-store.test.ts +11 -0
  29. package/src/runtime/core/modules/open-user-tasks-store.ts +11 -0
  30. package/src/runtime/core/modules/pages.ts +6 -5
  31. package/src/runtime/core/modules/workers.ts +24 -1
  32. package/src/runtime/core/read-model.test.ts +94 -0
  33. package/src/runtime/core/read-model.ts +1356 -45
  34. package/src/runtime/core/rollup.test.ts +818 -0
  35. package/src/runtime/core/validate.test.ts +341 -0
  36. package/src/runtime/core/validate.ts +188 -0
  37. package/src/runtime/index.ts +58 -0
@@ -62,6 +62,7 @@ export type {
62
62
  DataSource,
63
63
  DomainField,
64
64
  DomainType,
65
+ InstanceTracking,
65
66
  LlmBinding,
66
67
  NetworkConfig,
67
68
  PagesSurface,
@@ -226,45 +227,76 @@ export type {
226
227
  // workers.ts) applies its managed VIEW. The `writer-source-inversion` task registers here.
227
228
  // • `projectionRegistry` — register a canonical engine-truth projection NAME usable in `exists(...)`.
228
229
  // The `canonical-projections` task registers `urban_open_user_tasks` / `urban_instance_state`.
230
+ // The GROUP-BY sibling `defineRollup` (ADR 0065, #468): a declare-once aggregate rollup compiled to
231
+ // BOTH a managed `*_counts` VIEW and a TS group-reduce (closed aggregate op set: `count`/`countWhere`/
232
+ // `max`/`minWhere`/`coalesce`/`add`), registered as a canonical projection via `rollupRegistry` and
233
+ // parity-guarded by `assertRollupParity`. `defineReadModel` gains a key-correlated rollup lookup
234
+ // (`ReadModelDecl.lookups` + `rcol`) so per-row derivations read a rollup's columns for the base row.
229
235
  export {
236
+ add,
230
237
  and,
231
238
  assertReadModelParity,
239
+ assertRollupParity,
232
240
  assertSqlIdentifier,
233
241
  caseWhen,
242
+ coalesce,
234
243
  col,
235
244
  compileToFn,
236
245
  compileToSqlSelect,
246
+ count,
247
+ countWhere,
237
248
  defineReadModel,
249
+ defineRollup,
238
250
  deriveReadModelViewDdl,
239
251
  eq,
240
252
  exists,
253
+ fromProjection,
254
+ fromRollup,
255
+ fromTable,
241
256
  gt,
242
257
  gte,
258
+ isNotNull,
259
+ isNull,
260
+ joinSource,
243
261
  lit,
244
262
  lt,
245
263
  lte,
264
+ max,
265
+ minWhere,
246
266
  neq,
247
267
  not,
248
268
  or,
249
269
  pcol,
250
270
  ProjectionRegistry,
251
271
  projectionRegistry,
272
+ rcol,
252
273
  ReadModelRegistry,
253
274
  readModelRegistry,
275
+ RollupRegistry,
276
+ rollupRegistry,
254
277
  when,
255
278
  } from "./core/read-model.ts";
256
279
  export type {
280
+ AddAgg,
281
+ AggExpr,
257
282
  AndExpr,
258
283
  BaseRow,
259
284
  CaseExpr,
260
285
  ColExpr,
286
+ CoalesceAgg,
261
287
  CompareExpr,
262
288
  CompareOp,
289
+ CountAgg,
290
+ CountWhereAgg,
263
291
  DerivationFn,
264
292
  ExistsExpr,
265
293
  Expr,
294
+ IsNullExpr,
266
295
  Literal,
267
296
  LitExpr,
297
+ LookupRows,
298
+ MaxAgg,
299
+ MinWhereAgg,
268
300
  NotExpr,
269
301
  OrExpr,
270
302
  ParityDb,
@@ -275,6 +307,18 @@ export type {
275
307
  ProjectionSource,
276
308
  ReadModel,
277
309
  ReadModelDecl,
310
+ RollupColExpr,
311
+ Rollup,
312
+ RollupDecl,
313
+ RollupInputs,
314
+ RollupJoinSource,
315
+ RollupLookupDecl,
316
+ RollupParityOptions,
317
+ RollupProjectionSource,
318
+ RollupRelation,
319
+ RollupRollupSource,
320
+ RollupSource,
321
+ RollupTableSource,
278
322
  SqlCompileOptions,
279
323
  WhenClause,
280
324
  } from "./core/read-model.ts";
@@ -308,6 +352,20 @@ export type {
308
352
  InstanceStateRow,
309
353
  InstanceStateStoreOptions,
310
354
  } from "./core/modules/instance-state-store.ts";
355
+ // The DERIVED half of the instanceTracking writer→source inversion (ADR 0065, #439-L1 / #318): the
356
+ // builder that declares a binding's effective-status read model — the terminal + wait-on-human edges —
357
+ // as ONE `defineReadModel` derivation over the canonical projections, compiled to both the managed
358
+ // SQLite VIEW and the TS function. The reconciler feeds the projections; this derives the status edge.
359
+ export {
360
+ DEFAULT_DERIVED_STATUS_COLUMN,
361
+ defaultInstanceTrackingViewName,
362
+ defineInstanceTrackingReadModel,
363
+ deriveInstanceStatusExpr,
364
+ instanceTrackingReadModelTarget,
365
+ TERMINATED_STATE,
366
+ terminatedEdgeExpr,
367
+ waitingHumanEdgeExpr,
368
+ } from "./core/modules/instance-status-read-model.ts";
311
369
  // instance in?" from the BPMN scope hierarchy + write-provenance (Tier 0, zero declaration), an
312
370
  // optional `nano:phase` override (Tier 1), and a lineage rollup for the epic frontier (Tier 2).
313
371
  export {