@nanobpm/engine-wasm 0.9.3 → 0.10.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 CHANGED
@@ -68,7 +68,7 @@ variablesJson)` evaluates a deployed decision standalone.
68
68
 
69
69
  `activateJobs(type, maxJobs, timeoutMs, worker, withLease?)` defaults to nonleasing
70
70
  for **every** job kind and agent marker. Activated jobs always contain
71
- `leaseToken`: `null` without a lease, otherwise an opaque string. Never parse it
71
+ `jobLeaseToken`: `null` without a lease, otherwise an opaque string. Never parse it
72
72
  as a number. Once a job is leased, subsequent activations must also opt in;
73
73
  nonleasing workers skip it after failures and timeouts.
74
74
 
@@ -79,14 +79,16 @@ a supplied stale value is rejected. Timeout updates accept signed millisecond
79
79
  durations; zero and negative updates make the activation immediately eligible for
80
80
  expiry on the next clock tick without discarding its current lease.
81
81
 
82
- Agent APIs follow the vendored stable/8.10 contract:
82
+ Agent APIs follow the vendored stable/8.10 contract. Requests take `jobLeaseToken`
83
+ (the Camunda 8.10 name); the pre-8.10 name `jobLease` is still accepted as a
84
+ deprecated alias (#1283):
83
85
 
84
- - `createAgentInstance(JSON.stringify({elementInstanceKey, jobKey, jobLease, history}))`
85
- requires nonempty history establishing CONFIGURATION. `jobLease` is the activated
86
- job's `leaseToken`, unchanged. Definition, limits, tools, and metrics are history
86
+ - `createAgentInstance(JSON.stringify({elementInstanceKey, jobKey, jobLeaseToken, history}))`
87
+ requires nonempty history establishing CONFIGURATION. `jobLeaseToken` is the activated
88
+ job's `jobLeaseToken`, unchanged. Definition, limits, tools, and metrics are history
87
89
  fields, not top-level request properties.
88
90
  - `updateAgentInstance(agentInstanceKey, JSON.stringify({elementInstanceKey, jobKey,
89
- jobLease, status?, history?}))` requires all three attribution fields even without
91
+ jobLeaseToken, status?, history?}))` requires all three attribution fields even without
90
92
  history.
91
93
  - Both return canonical results containing positionally correlated `createdHistory`;
92
94
  CREATE also returns `agentInstanceKey`. Duplicate CREATE rejects rather than upserting.
@@ -88,7 +88,7 @@ export class TestEngine {
88
88
  */
89
89
  correlateMessage(message_name: string, correlation_key: string, variables_json: string): string;
90
90
  /**
91
- * Create an agent using `{ elementInstanceKey, jobKey, jobLease, history }`.
91
+ * Create an agent using `{ elementInstanceKey, jobKey, jobLeaseToken, history }`.
92
92
  * History must establish its CONFIGURATION. Returns the canonical creation
93
93
  * result with `agentInstanceKey` and positionally correlated `createdHistory`.
94
94
  */
@@ -288,7 +288,7 @@ export class TestEngine {
288
288
  */
289
289
  unassignUserTask(user_task_key: string): string;
290
290
  /**
291
- * Update an agent with `{ elementInstanceKey, jobKey, jobLease, status?, history? }`.
291
+ * Update an agent with `{ elementInstanceKey, jobKey, jobLeaseToken, status?, history? }`.
292
292
  * Configuration and metrics are submitted through history, never top-level fields.
293
293
  * Returns `createdHistory`; the engine owns pending/commit/discard semantics.
294
294
  */
@@ -400,7 +400,7 @@ export class TestEngine {
400
400
  }
401
401
  }
402
402
  /**
403
- * Create an agent using `{ elementInstanceKey, jobKey, jobLease, history }`.
403
+ * Create an agent using `{ elementInstanceKey, jobKey, jobLeaseToken, history }`.
404
404
  * History must establish its CONFIGURATION. Returns the canonical creation
405
405
  * result with `agentInstanceKey` and positionally correlated `createdHistory`.
406
406
  * @param {string} request_json
@@ -1226,7 +1226,7 @@ export class TestEngine {
1226
1226
  }
1227
1227
  }
1228
1228
  /**
1229
- * Update an agent with `{ elementInstanceKey, jobKey, jobLease, status?, history? }`.
1229
+ * Update an agent with `{ elementInstanceKey, jobKey, jobLeaseToken, status?, history? }`.
1230
1230
  * Configuration and metrics are submitted through history, never top-level fields.
1231
1231
  * Returns `createdHistory`; the engine owns pending/commit/discard semantics.
1232
1232
  * @param {string} agent_instance_key
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/engine-wasm",
3
- "version": "0.9.3",
3
+ "version": "0.10.0",
4
4
  "description": "The nanobpmn engine (engine-core) compiled to WebAssembly for in-browser BPMN execution: deploy a diagram, start instances, activate/complete jobs, and read live snapshots/traces. Published as two subpath entrypoints — a lean baseline engine (default) and a read-model engine (the gateway's C8-style REST read surface). The substrate for the Bojtos demo framework (ADR 0043) and the console test-run panel.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -88,7 +88,7 @@ export class TestEngine {
88
88
  */
89
89
  correlateMessage(message_name: string, correlation_key: string, variables_json: string): string;
90
90
  /**
91
- * Create an agent using `{ elementInstanceKey, jobKey, jobLease, history }`.
91
+ * Create an agent using `{ elementInstanceKey, jobKey, jobLeaseToken, history }`.
92
92
  * History must establish its CONFIGURATION. Returns the canonical creation
93
93
  * result with `agentInstanceKey` and positionally correlated `createdHistory`.
94
94
  */
@@ -347,7 +347,7 @@ export class TestEngine {
347
347
  */
348
348
  unassignUserTask(user_task_key: string): string;
349
349
  /**
350
- * Update an agent with `{ elementInstanceKey, jobKey, jobLease, status?, history? }`.
350
+ * Update an agent with `{ elementInstanceKey, jobKey, jobLeaseToken, status?, history? }`.
351
351
  * Configuration and metrics are submitted through history, never top-level fields.
352
352
  * Returns `createdHistory`; the engine owns pending/commit/discard semantics.
353
353
  */
@@ -400,7 +400,7 @@ export class TestEngine {
400
400
  }
401
401
  }
402
402
  /**
403
- * Create an agent using `{ elementInstanceKey, jobKey, jobLease, history }`.
403
+ * Create an agent using `{ elementInstanceKey, jobKey, jobLeaseToken, history }`.
404
404
  * History must establish its CONFIGURATION. Returns the canonical creation
405
405
  * result with `agentInstanceKey` and positionally correlated `createdHistory`.
406
406
  * @param {string} request_json
@@ -1477,7 +1477,7 @@ export class TestEngine {
1477
1477
  }
1478
1478
  }
1479
1479
  /**
1480
- * Update an agent with `{ elementInstanceKey, jobKey, jobLease, status?, history? }`.
1480
+ * Update an agent with `{ elementInstanceKey, jobKey, jobLeaseToken, status?, history? }`.
1481
1481
  * Configuration and metrics are submitted through history, never top-level fields.
1482
1482
  * Returns `createdHistory`; the engine owns pending/commit/discard semantics.
1483
1483
  * @param {string} agent_instance_key
Binary file
@@ -127,7 +127,7 @@ export type AgentInstanceCreationRequest = {
127
127
  * rather than committed.
128
128
  *
129
129
  */
130
- jobLease: string;
130
+ jobLeaseToken?: string;
131
131
  /**
132
132
  * A batch of history items to append to the agent instance's conversation
133
133
  * history, in request order. Each created item is echoed back in the
@@ -432,7 +432,7 @@ export type AgentInstanceHistoryItemResult = {
432
432
  /**
433
433
  * The lease token of the activation that produced this item.
434
434
  */
435
- jobLease: string;
435
+ jobLeaseToken: string;
436
436
  /**
437
437
  * The loop iteration this item belongs to.
438
438
  */
@@ -807,7 +807,7 @@ export type AgentInstanceUpdateRequest = {
807
807
  * rather than committed.
808
808
  *
809
809
  */
810
- jobLease: string;
810
+ jobLeaseToken?: string;
811
811
  /**
812
812
  * A batch of history items to append to the agent instance's conversation
813
813
  * history, in request order. Each created item is echoed back in the
@@ -5468,7 +5468,7 @@ export type ActivatedJobResult = {
5468
5468
  * The lease token identifying this activation. This is null when the job was activated without a lease.
5469
5469
  *
5470
5470
  */
5471
- leaseToken: string | null;
5471
+ jobLeaseToken: string | null;
5472
5472
  };
5473
5473
 
5474
5474
  /**
@@ -5583,7 +5583,7 @@ export type JobActivationRequest = {
5583
5583
  */
5584
5584
  tenantFilter?: TenantFilterEnum;
5585
5585
  /**
5586
- * Whether to activate the jobs with a lease. When true, each activated job is assigned a distinct, opaque lease token, returned as ActivatedJobResult.leaseToken. The lease fences the complete, fail, and throw-error commands against a superseded activation of the same job. Once a job has been activated with a lease, it is served only to leasing workers of that job type. Omit or set to false to activate jobs without a lease.
5586
+ * Whether to activate the jobs with a lease. When true, each activated job is assigned a distinct, opaque lease token, returned as ActivatedJobResult.jobLeaseToken. The lease fences the complete, fail, and throw-error commands against a superseded activation of the same job. Once a job has been activated with a lease, it is served only to leasing workers of that job type. Omit or set to false to activate jobs without a lease.
5587
5587
  *
5588
5588
  */
5589
5589
  withLease?: boolean | null;
@@ -5636,10 +5636,10 @@ export type JobCompletionRequest = {
5636
5636
  } | null;
5637
5637
  result?: JobResult;
5638
5638
  /**
5639
- * The token identifying a leased job's activation, obtained from ActivatedJobResult.leaseToken. A leased job requires its matching token; missing or stale tokens are rejected. A job activated without a lease requires no token.
5639
+ * The token identifying a leased job's activation, obtained from ActivatedJobResult.jobLeaseToken. A leased job requires its matching token; missing or stale tokens are rejected. A job activated without a lease requires no token.
5640
5640
  *
5641
5641
  */
5642
- leaseToken?: string | null;
5642
+ jobLeaseToken?: string | null;
5643
5643
  };
5644
5644
 
5645
5645
  export type JobErrorRequest = {
@@ -5661,10 +5661,10 @@ export type JobErrorRequest = {
5661
5661
  [key: string]: unknown;
5662
5662
  } | null;
5663
5663
  /**
5664
- * The token identifying a leased job's activation, obtained from ActivatedJobResult.leaseToken. A leased job requires its matching token; missing or stale tokens are rejected. A job activated without a lease requires no token.
5664
+ * The token identifying a leased job's activation, obtained from ActivatedJobResult.jobLeaseToken. A leased job requires its matching token; missing or stale tokens are rejected. A job activated without a lease requires no token.
5665
5665
  *
5666
5666
  */
5667
- leaseToken?: string | null;
5667
+ jobLeaseToken?: string | null;
5668
5668
  };
5669
5669
 
5670
5670
  export type JobFailRequest = {
@@ -5688,10 +5688,10 @@ export type JobFailRequest = {
5688
5688
  [key: string]: unknown;
5689
5689
  };
5690
5690
  /**
5691
- * The token identifying a leased job's activation, obtained from ActivatedJobResult.leaseToken. A leased job requires its matching token; missing or stale tokens are rejected. A job activated without a lease requires no token.
5691
+ * The token identifying a leased job's activation, obtained from ActivatedJobResult.jobLeaseToken. A leased job requires its matching token; missing or stale tokens are rejected. A job activated without a lease requires no token.
5692
5692
  *
5693
5693
  */
5694
- leaseToken?: string | null;
5694
+ jobLeaseToken?: string | null;
5695
5695
  };
5696
5696
 
5697
5697
  /**
@@ -6098,10 +6098,10 @@ export type JobUpdateRequest = {
6098
6098
  changeset: JobChangeset;
6099
6099
  operationReference?: OperationReference;
6100
6100
  /**
6101
- * The token identifying a leased job's activation, obtained from ActivatedJobResult.leaseToken. A supplied token is validated against the current lease. An update without a token applies to support operator and bulk updates, unlike complete, fail, and throw-error requests, which require a token for leased jobs.
6101
+ * The token identifying a leased job's activation, obtained from ActivatedJobResult.jobLeaseToken. A supplied token is validated against the current lease. An update without a token applies to support operator and bulk updates, unlike complete, fail, and throw-error requests, which require a token for leased jobs.
6102
6102
  *
6103
6103
  */
6104
- leaseToken?: string | null;
6104
+ jobLeaseToken?: string | null;
6105
6105
  };
6106
6106
 
6107
6107
  /**