@camunda8/orchestration-cluster-api 10.0.0-alpha.45 → 10.0.0-alpha.46

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.
@@ -3426,7 +3426,7 @@ var init_zod_gen = __esm({
3426
3426
  description: "The client-supplied identifier this item was created with."
3427
3427
  });
3428
3428
  zJobLeaseToken = z.string().min(1).register(z.globalRegistry, {
3429
- description: "An opaque, engine-minted fencing token identifying a single activation of a job.\nReturned by Activate Jobs as `ActivatedJobResult.leaseToken` when the job is\nactivated with a lease, and passed back on fenced job commands \u2014 and on\nagent-instance creation/updates as `jobLease` \u2014 to prove the caller holds the\ncurrent lease. The token is opaque: clients may rely on its presence and equality\nonly, and must never construct, parse, or otherwise interpret it beyond equality\nchecks. It cannot be minted client-side; only the engine produces it, exactly once\nper leased activation, and clients must not depend on any particular internal format.\n"
3429
+ description: "An opaque, engine-minted fencing token identifying a single activation of a job.\nReturned by Activate Jobs as `ActivatedJobResult.jobLeaseToken` when the job is\nactivated with a lease, and passed back under the same name on fenced job\ncommands and on agent-instance creation/updates, to prove the caller holds the\ncurrent lease. The token is opaque: clients may rely on its presence and equality\nonly, and must never construct, parse, or otherwise interpret it beyond equality\nchecks. It cannot be minted client-side; only the engine produces it, exactly once\nper leased activation, and clients must not depend on any particular internal format.\n"
3430
3430
  });
3431
3431
  zAdvancedElementIdFilter = z.object({
3432
3432
  $eq: zElementId.optional(),
@@ -3672,7 +3672,7 @@ var init_zod_gen = __esm({
3672
3672
  variables: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
3673
3673
  description: "JSON object that will instantiate the variables at the local scope of the job's associated task.\n"
3674
3674
  }).optional(),
3675
- leaseToken: zJobLeaseToken.nullish()
3675
+ jobLeaseToken: zJobLeaseToken.nullish()
3676
3676
  });
3677
3677
  zJobErrorRequest = z.object({
3678
3678
  errorCode: z.string().register(z.globalRegistry, {
@@ -3680,7 +3680,7 @@ var init_zod_gen = __esm({
3680
3680
  }),
3681
3681
  errorMessage: z.string().nullish(),
3682
3682
  variables: z.record(z.string(), z.unknown()).nullish(),
3683
- leaseToken: zJobLeaseToken.nullish()
3683
+ jobLeaseToken: zJobLeaseToken.nullish()
3684
3684
  });
3685
3685
  zJobResultCorrections = z.object({
3686
3686
  assignee: z.string().nullish(),
@@ -3729,7 +3729,7 @@ var init_zod_gen = __esm({
3729
3729
  zJobCompletionRequest = z.object({
3730
3730
  variables: z.record(z.string(), z.unknown()).nullish(),
3731
3731
  result: zJobResult.optional(),
3732
- leaseToken: zJobLeaseToken.nullish(),
3732
+ jobLeaseToken: zJobLeaseToken.nullish(),
3733
3733
  businessId: zBusinessId.nullish()
3734
3734
  });
3735
3735
  zJobChangeset = z.object({
@@ -4163,7 +4163,7 @@ var init_zod_gen = __esm({
4163
4163
  zAgentInstanceCreationRequest = z.object({
4164
4164
  elementInstanceKey: zElementInstanceKey,
4165
4165
  jobKey: zJobKey,
4166
- jobLease: zJobLeaseToken,
4166
+ jobLeaseToken: zJobLeaseToken,
4167
4167
  history: z.array(zAgentInstanceHistoryItem).min(1).register(z.globalRegistry, {
4168
4168
  description: "A batch of history items to append to the agent instance's conversation\nhistory, in request order. Each created item is echoed back in the\nresponse's createdHistory, positionally correlated. Must include a\nCONFIGURATION item establishing model, provider, and systemPrompt (and,\nif needed, limits). Every item's role must be CONFIGURATION or USER, and\nno item may carry non-zero usage-token metrics (inputTokens, outputTokens,\nreasoningTokenCount, cacheCreationTokenCount, cacheReadTokenCount);\ndurationMs is exempt and may be non-zero.\n"
4169
4169
  })
@@ -4174,7 +4174,7 @@ var init_zod_gen = __esm({
4174
4174
  elementInstanceKey: zElementInstanceKey,
4175
4175
  status: zAgentInstanceUpdateStatusEnum.optional(),
4176
4176
  jobKey: zJobKey,
4177
- jobLease: zJobLeaseToken,
4177
+ jobLeaseToken: zJobLeaseToken,
4178
4178
  history: z.array(zAgentInstanceHistoryItem).nullish()
4179
4179
  }).register(z.globalRegistry, {
4180
4180
  description: "Request to update the mutable state of an agent instance.\n"
@@ -4285,7 +4285,7 @@ var init_zod_gen = __esm({
4285
4285
  priority: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }).register(z.globalRegistry, {
4286
4286
  description: "The priority of the job. Higher values indicate higher priority. Jobs created before 8.10 have no stored priority; the API returns 0 for such jobs.\n"
4287
4287
  }),
4288
- leaseToken: zJobLeaseToken.nullish()
4288
+ jobLeaseToken: zJobLeaseToken.nullish()
4289
4289
  });
4290
4290
  zJobActivationResult = z.object({
4291
4291
  jobs: z.array(zActivatedJobResult).register(z.globalRegistry, {
@@ -4691,7 +4691,7 @@ var init_zod_gen = __esm({
4691
4691
  zJobUpdateRequest = z.object({
4692
4692
  changeset: zJobChangeset,
4693
4693
  operationReference: zOperationReference.optional(),
4694
- leaseToken: zJobLeaseToken.nullish()
4694
+ jobLeaseToken: zJobLeaseToken.nullish()
4695
4695
  });
4696
4696
  zAgentDefinitionKey = zLongKey;
4697
4697
  zAgentDefinitionResult = z.object({
@@ -4774,7 +4774,7 @@ var init_zod_gen = __esm({
4774
4774
  agentInstanceKey: zAgentInstanceKey,
4775
4775
  elementInstanceKey: zElementInstanceKey,
4776
4776
  jobKey: zJobKey,
4777
- jobLease: zJobLeaseToken,
4777
+ jobLeaseToken: zJobLeaseToken,
4778
4778
  loopIteration: zLoopIterationId,
4779
4779
  role: zAgentInstanceHistoryRoleEnum,
4780
4780
  content: z.array(zAgentInstanceMessageContent).register(z.globalRegistry, {
@@ -14276,7 +14276,7 @@ function createLogger(opts = {}) {
14276
14276
  }
14277
14277
 
14278
14278
  // src/runtime/version.ts
14279
- var packageVersion = "10.0.0-alpha.45";
14279
+ var packageVersion = "10.0.0-alpha.46";
14280
14280
 
14281
14281
  // src/runtime/supportLogger.ts
14282
14282
  var NoopSupportLogger = class {
@@ -15869,7 +15869,7 @@ var JobWorker = class {
15869
15869
  errorMessage: e?.message || "Handler error",
15870
15870
  retries: typeof retries === "number" ? Math.max(0, retries - 1) : 0,
15871
15871
  // Fence the failure against a superseded activation when leased.
15872
- ...raw.leaseToken != null ? { leaseToken: raw.leaseToken } : {}
15872
+ ...raw.jobLeaseToken != null ? { jobLeaseToken: raw.jobLeaseToken } : {}
15873
15873
  });
15874
15874
  } catch (failErr) {
15875
15875
  this._log.error("job.fail.error", failErr);
@@ -15885,7 +15885,7 @@ var JobWorker = class {
15885
15885
  jobKey: raw.jobKey,
15886
15886
  errorMessage: msg,
15887
15887
  // Fence the failure against a superseded activation when leased.
15888
- ...raw.leaseToken != null ? { leaseToken: raw.leaseToken } : {}
15888
+ ...raw.jobLeaseToken != null ? { jobLeaseToken: raw.jobLeaseToken } : {}
15889
15889
  });
15890
15890
  } catch (e) {
15891
15891
  this._log.error("job.fail.validation.error", e);
@@ -15918,7 +15918,7 @@ function enrichActivatedJob(raw, client2, log, clock = client2.clock) {
15918
15918
  variables,
15919
15919
  jobKey: raw.jobKey,
15920
15920
  ...result !== void 0 && { result },
15921
- ...raw.leaseToken != null ? { leaseToken: raw.leaseToken } : {}
15921
+ ...raw.jobLeaseToken != null ? { jobLeaseToken: raw.jobLeaseToken } : {}
15922
15922
  });
15923
15923
  } finally {
15924
15924
  ack();
@@ -15930,7 +15930,7 @@ function enrichActivatedJob(raw, client2, log, clock = client2.clock) {
15930
15930
  await client2.failJob({
15931
15931
  ...reason,
15932
15932
  jobKey: raw.jobKey,
15933
- ...raw.leaseToken != null ? { leaseToken: raw.leaseToken } : {}
15933
+ ...raw.jobLeaseToken != null ? { jobLeaseToken: raw.jobLeaseToken } : {}
15934
15934
  });
15935
15935
  } finally {
15936
15936
  ack();
@@ -15942,7 +15942,7 @@ function enrichActivatedJob(raw, client2, log, clock = client2.clock) {
15942
15942
  await client2.throwJobError({
15943
15943
  ...error,
15944
15944
  jobKey: raw.jobKey,
15945
- ...raw.leaseToken != null ? { leaseToken: raw.leaseToken } : {}
15945
+ ...raw.jobLeaseToken != null ? { jobLeaseToken: raw.jobLeaseToken } : {}
15946
15946
  });
15947
15947
  } finally {
15948
15948
  ack();
@@ -15966,12 +15966,12 @@ function enrichActivatedJob(raw, client2, log, clock = client2.clock) {
15966
15966
  job.modifyJobTimeout = ({ newTimeoutMs }) => client2.updateJob({
15967
15967
  changeset: { timeout: newTimeoutMs },
15968
15968
  jobKey: raw.jobKey,
15969
- ...raw.leaseToken != null ? { leaseToken: raw.leaseToken } : {}
15969
+ ...raw.jobLeaseToken != null ? { jobLeaseToken: raw.jobLeaseToken } : {}
15970
15970
  });
15971
15971
  job.modifyRetries = ({ retries }) => client2.updateJob({
15972
15972
  changeset: { retries },
15973
15973
  jobKey: raw.jobKey,
15974
- ...raw.leaseToken != null ? { leaseToken: raw.leaseToken } : {}
15974
+ ...raw.jobLeaseToken != null ? { jobLeaseToken: raw.jobLeaseToken } : {}
15975
15975
  });
15976
15976
  return job;
15977
15977
  }
@@ -16163,7 +16163,7 @@ var ThreadedJobWorker = class {
16163
16163
  errorMessage: err?.message || "Thread handler error",
16164
16164
  retries: typeof raw.retries === "number" ? Math.max(0, raw.retries - 1) : 0,
16165
16165
  // Fence the failure against a superseded activation when leased.
16166
- ...raw.leaseToken != null ? { leaseToken: raw.leaseToken } : {}
16166
+ ...raw.jobLeaseToken != null ? { jobLeaseToken: raw.jobLeaseToken } : {}
16167
16167
  }).catch((failErr) => {
16168
16168
  this._log.error("job.fail.error", failErr);
16169
16169
  }).finally(() => {
@@ -16310,7 +16310,7 @@ var ThreadedJobWorker = class {
16310
16310
  jobKey: raw.jobKey,
16311
16311
  errorMessage: msg,
16312
16312
  // Fence the failure against a superseded activation when leased.
16313
- ...raw.leaseToken != null ? { leaseToken: raw.leaseToken } : {}
16313
+ ...raw.jobLeaseToken != null ? { jobLeaseToken: raw.jobLeaseToken } : {}
16314
16314
  });
16315
16315
  } catch (e) {
16316
16316
  this._log.error("job.fail.validation.error", e);
@@ -17244,8 +17244,8 @@ var CamundaClientBase = class {
17244
17244
  }
17245
17245
  if (data && data.jobs && _body && _body.withLease === true) {
17246
17246
  for (const _el of data.jobs) {
17247
- if (_el.leaseToken == null) {
17248
- const _e = new Error("activateJobs: withLease=true was requested but the server returned an item without 'leaseToken' \u2014 the server may predate this feature. Refusing to silently mis-type the dependent field.");
17247
+ if (_el.jobLeaseToken == null) {
17248
+ const _e = new Error("activateJobs: withLease=true was requested but the server returned an item without 'jobLeaseToken' \u2014 the server may predate this feature. Refusing to silently mis-type the dependent field.");
17249
17249
  _e.name = "PresentWhenUnsupportedError";
17250
17250
  _e.nonRetryable = true;
17251
17251
  throw _e;
@@ -31393,7 +31393,7 @@ function completeJob2(job, vars) {
31393
31393
  yield* camunda.completeJob({
31394
31394
  jobKey: job.jobKey,
31395
31395
  variables: vars ?? {},
31396
- ...job.leaseToken != null ? { leaseToken: job.leaseToken } : {}
31396
+ ...job.jobLeaseToken != null ? { jobLeaseToken: job.jobLeaseToken } : {}
31397
31397
  });
31398
31398
  });
31399
31399
  }
@@ -31406,7 +31406,7 @@ function failJobRetryable(job, error) {
31406
31406
  retries: Math.max(0, (job.retries ?? 1) - 1),
31407
31407
  ...error.retryBackoff !== void 0 ? { retryBackOff: toMillis(error.retryBackoff) } : {},
31408
31408
  ...error.variables ? { variables: { ...error.variables } } : {},
31409
- ...job.leaseToken != null ? { leaseToken: job.leaseToken } : {}
31409
+ ...job.jobLeaseToken != null ? { jobLeaseToken: job.jobLeaseToken } : {}
31410
31410
  });
31411
31411
  });
31412
31412
  }
@@ -31418,7 +31418,7 @@ function raiseIncident(job, error) {
31418
31418
  errorCode: error.code,
31419
31419
  errorMessage: error.message,
31420
31420
  ...error.variables ? { variables: { ...error.variables } } : {},
31421
- ...job.leaseToken != null ? { leaseToken: job.leaseToken } : {}
31421
+ ...job.jobLeaseToken != null ? { jobLeaseToken: job.jobLeaseToken } : {}
31422
31422
  });
31423
31423
  });
31424
31424
  }
@@ -31429,7 +31429,7 @@ function releaseLease(job) {
31429
31429
  jobKey: job.jobKey,
31430
31430
  errorMessage: "worker interrupted; releasing lease for re-activation",
31431
31431
  retries: job.retries ?? 1,
31432
- ...job.leaseToken != null ? { leaseToken: job.leaseToken } : {}
31432
+ ...job.jobLeaseToken != null ? { jobLeaseToken: job.jobLeaseToken } : {}
31433
31433
  });
31434
31434
  }).pipe(import_effect2.Effect.ignore);
31435
31435
  }
@@ -31444,7 +31444,7 @@ function failJobOnDefect(job, defect) {
31444
31444
  jobKey: job.jobKey,
31445
31445
  errorMessage: defect instanceof Error ? defect.message : "Handler error",
31446
31446
  retries: Math.max(0, (job.retries ?? 1) - 1),
31447
- ...job.leaseToken != null ? { leaseToken: job.leaseToken } : {}
31447
+ ...job.jobLeaseToken != null ? { jobLeaseToken: job.jobLeaseToken } : {}
31448
31448
  });
31449
31449
  });
31450
31450
  }