@nanobpm/urban 0.54.0 → 0.56.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 (29) hide show
  1. package/dist/runtime/core/host.d.ts +31 -5
  2. package/dist/runtime/core/modules/pages.js +5 -1850
  3. package/dist/runtime/core/modules/runtime.gen.d.ts +1 -0
  4. package/dist/runtime/core/modules/runtime.gen.js +5 -0
  5. package/dist/runtime/engine/nanosdk.d.ts +6 -5
  6. package/dist/runtime/engine/nanosdk.js +6 -0
  7. package/dist/runtime/index.d.ts +1 -1
  8. package/package.json +5 -3
  9. package/src/runtime/browser/runtime.browser.js +2179 -0
  10. package/src/runtime/browser/runtime.browser.test.ts +118 -0
  11. package/src/runtime/core/host.ts +32 -5
  12. package/src/runtime/core/modules/actions.test.ts +1 -0
  13. package/src/runtime/core/modules/agent.test.ts +1 -0
  14. package/src/runtime/core/modules/api.test.ts +1 -0
  15. package/src/runtime/core/modules/cancel.test.ts +1 -0
  16. package/src/runtime/core/modules/connectors.test.ts +1 -0
  17. package/src/runtime/core/modules/datasource.migrations.test.ts +1 -0
  18. package/src/runtime/core/modules/instance-tracking.test.ts +1 -0
  19. package/src/runtime/core/modules/pages.test.ts +114 -7
  20. package/src/runtime/core/modules/pages.ts +5 -1850
  21. package/src/runtime/core/modules/runtime.gen.ts +6 -0
  22. package/src/runtime/core/modules/surfaces.test.ts +2 -0
  23. package/src/runtime/core/modules/triggers.test.ts +1 -0
  24. package/src/runtime/core/modules/workers.test.ts +1 -0
  25. package/src/runtime/core/runtime.extensions.test.ts +3 -0
  26. package/src/runtime/core/runtime.test.ts +3 -0
  27. package/src/runtime/engine/nanosdk.test.ts +18 -0
  28. package/src/runtime/engine/nanosdk.ts +9 -4
  29. package/src/runtime/index.ts +1 -0
@@ -216,6 +216,17 @@ export interface UserTaskSummary {
216
216
  /** An external form reference (a form linked outside the deployment), if any. */
217
217
  readonly externalFormReference?: string;
218
218
  }
219
+ /**
220
+ * The lifecycle-state-agnostic selectors for a user-task search: which process instance,
221
+ * assignee, and/or candidate group to match. Shared by {@link EngineClient.searchUserTasks}
222
+ * (which adds an optional `state`) and {@link EngineClient.openUserTasks} (which pins
223
+ * `state: "CREATED"` for you), so the two accessors cannot drift on how a task is selected.
224
+ */
225
+ export interface UserTaskFilter {
226
+ processInstanceKey?: string;
227
+ assignee?: string;
228
+ candidateGroup?: string;
229
+ }
219
230
  /**
220
231
  * A deployed form's form-js schema plus its identifying metadata, as
221
232
  * {@link EngineClient.getForm} returns it. `schema` is the parsed form-js document
@@ -267,13 +278,28 @@ export interface EngineClient {
267
278
  * By default this is unfiltered by lifecycle state and may return tasks in any state
268
279
  * (e.g. completed/canceled); pass `state: "CREATED"` to constrain the search to open
269
280
  * (answerable) tasks. Each result carries the task's resolved form linkage
270
- * (`formKey`/`externalFormReference`) when present. */
271
- searchUserTasks(filter?: {
272
- processInstanceKey?: string;
273
- assignee?: string;
274
- candidateGroup?: string;
281
+ * (`formKey`/`externalFormReference`) when present.
282
+ *
283
+ * **Footgun:** because this defaults to *any* lifecycle state and lags a completion,
284
+ * a just-answered task is still returned for a moment — so treating mere *existence*
285
+ * of a result as "open / actionable" projects a completed task as if a human could
286
+ * still act on it (a torn read-model row). {@link UserTaskSummary} deliberately omits
287
+ * `state`, so a caller cannot re-filter results defensively. If you are deciding
288
+ * whether a human can act — any reconcile / affordance path — use
289
+ * {@link EngineClient.openUserTasks} instead; reserve `searchUserTasks` for the rare
290
+ * legitimate "any lifecycle state" audit/read case. */
291
+ searchUserTasks(filter?: UserTaskFilter & {
275
292
  state?: UserTaskState;
276
293
  }): Promise<UserTaskSummary[]>;
294
+ /** The user tasks that are actually *open* (answerable) — semantically the accessor to
295
+ * reach for whenever you are deciding whether a human can act (reconcile / affordance
296
+ * paths). A thin, intent-named wrapper that pins the lifecycle-state invariant the SDK
297
+ * documents: exactly `searchUserTasks({ ...filter, state: "CREATED" })`, since `CREATED`
298
+ * is the only open state ({@link UserTaskState}). Unlike a bare `searchUserTasks`, it
299
+ * cannot surface a completed/canceled task as if it were still actionable — the footgun
300
+ * described on `searchUserTasks`. Same selectors as `searchUserTasks` minus `state`
301
+ * (pinned to `CREATED`). */
302
+ openUserTasks(filter?: UserTaskFilter): Promise<UserTaskSummary[]>;
277
303
  /**
278
304
  * Fetch a deployed form's form-js schema for the `taskInbox` surface. Resolve by
279
305
  * `formKey` (the linkage the engine attaches to a user task) or, as a best-effort