lua-cli 3.35.0 → 3.37.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.
@@ -359,10 +359,113 @@ function isDesktopFileCommandName(value3) {
359
359
  function isDesktopFileSessionId(value3) {
360
360
  return typeof value3 === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value3);
361
361
  }
362
+ function workflowRetryMaxAttemptsMessage(got) {
363
+ const tail = got === void 0 ? "" : ` (got ${JSON.stringify(got)})`;
364
+ return `\`retry.maxAttempts\` must be an integer ${WORKFLOW_RETRY_MIN_ATTEMPTS}..${WORKFLOW_RETRY_MAX_ATTEMPTS}${tail}`;
365
+ }
366
+ function isWithinWorkflowRetryAttempts(value3) {
367
+ return typeof value3 === "number" && Number.isInteger(value3) && value3 >= WORKFLOW_RETRY_MIN_ATTEMPTS && value3 <= WORKFLOW_RETRY_MAX_ATTEMPTS;
368
+ }
369
+ function workflowRetryUnknownMembersMessage(keys) {
370
+ const named = keys.map((k) => {
371
+ const engine = WORKFLOW_RETRY_ENGINE_KEYS.includes(k);
372
+ return `\`${k}\`${engine ? " (engine-owned \u2014 stamped by resetAttempts, never authored)" : ""}`;
373
+ });
374
+ return `\`retry\` has no member ${named.join(", ")}; members: ${WORKFLOW_RETRY_POLICY_KEYS.join(", ")}`;
375
+ }
376
+ function unknownWorkflowRetryMembers(retry) {
377
+ if (!retry || typeof retry !== "object" || Array.isArray(retry)) return [];
378
+ return Object.keys(retry).filter((k) => !WORKFLOW_RETRY_POLICY_KEYS.includes(k));
379
+ }
380
+ function authoredRetryPolicy(retry) {
381
+ if (!retry || typeof retry !== "object" || Array.isArray(retry)) return void 0;
382
+ const src = retry;
383
+ const out = {};
384
+ for (const k of WORKFLOW_RETRY_POLICY_KEYS) if (src[k] !== void 0) out[k] = src[k];
385
+ return Object.keys(out).length ? out : void 0;
386
+ }
387
+ function retryBudgetBaseAttempt(row) {
388
+ const base = row.retry?.budgetBaseAttempt;
389
+ return typeof base === "number" && Number.isSafeInteger(base) && base > 0 ? base : 0;
390
+ }
391
+ function retryBudgetAttempt(row) {
392
+ return Math.max(0, row.attempt - retryBudgetBaseAttempt(row));
393
+ }
394
+ function retryBudgetMaxAttempts(row) {
395
+ const max = row.retry?.maxAttempts;
396
+ return typeof max === "number" && Number.isFinite(max) && max >= 1 ? max : 1;
397
+ }
398
+ function retryBudgetRemaining(row) {
399
+ return retryBudgetAttempt(row) < retryBudgetMaxAttempts(row);
400
+ }
401
+ function retriesRemaining(row) {
402
+ return Math.max(0, retryBudgetMaxAttempts(row) - retryBudgetAttempt(row));
403
+ }
404
+ function workflowModelCostComparison(estimate, onAgentModel, agentModel) {
405
+ if (agentModel === void 0 || onAgentModel === void 0 || !(onAgentModel > 0)) return void 0;
406
+ const ratio = Math.round(estimate / onAgentModel * 10) / 10;
407
+ return `\u2248 ${ratio}\xD7 the cost of running every step on ${agentModel}`;
408
+ }
409
+ function modelClassRank(modelClass) {
410
+ return WORKFLOW_MODEL_CLASSES.indexOf(modelClass);
411
+ }
412
+ function modelClassesAtOrBelow(maxClass) {
413
+ const ceiling = modelClassRank(maxClass);
414
+ return WORKFLOW_MODEL_CLASSES.filter((c) => modelClassRank(c) <= ceiling);
415
+ }
416
+ function workflowAutonomyMaxRunsPerHourCeiling(env2) {
417
+ const raw = Number((env2 ?? process.env)[WORKFLOW_AUTONOMY_MAX_RUNS_PER_HOUR_ENV]);
418
+ return Number.isFinite(raw) && raw > 0 ? raw : WORKFLOW_AUTONOMY_MAX_RUNS_PER_HOUR_CEILING;
419
+ }
420
+ function isWithinWorkflowAutonomyRange(value3, ceiling) {
421
+ return typeof value3 === "number" && Number.isInteger(value3) && value3 >= WORKFLOW_AUTONOMY_MIN_VALUE && value3 <= ceiling;
422
+ }
423
+ function workflowAutonomyRangeMessage(key, ceiling) {
424
+ return `\`${key}\` must be an integer ${WORKFLOW_AUTONOMY_MIN_VALUE}..${ceiling}`;
425
+ }
426
+ function isWithinWorkflowJobRange(member, value3) {
427
+ const { min, max } = WORKFLOW_JOB_RANGES[member];
428
+ return typeof value3 === "number" && Number.isInteger(value3) && value3 >= min && value3 <= max;
429
+ }
430
+ function workflowJobRangeMessage(member) {
431
+ const { min, max } = WORKFLOW_JOB_RANGES[member];
432
+ return `\`${member}\` must be an integer ${min}..${max}`;
433
+ }
434
+ function isWorkflowSingleStepType(type) {
435
+ return typeof type === "string" && WORKFLOW_SINGLE_STEP_TYPES.includes(type);
436
+ }
437
+ function isWorkflowHitlEntryType(type) {
438
+ return typeof type === "string" && WORKFLOW_HITL_ENTRY_TYPES.includes(type);
439
+ }
440
+ function isWorkflowArmEntryType(type) {
441
+ return typeof type === "string" && WORKFLOW_ARM_ENTRY_TYPES.includes(type);
442
+ }
443
+ function workflowContainerRunsHitlArm(container) {
444
+ return typeof container === "string" && WORKFLOW_HITL_ARM_CONTAINERS.includes(container);
445
+ }
446
+ function workflowHitlArmUnsupportedMessage(type, id, container) {
447
+ const legal = WORKFLOW_HITL_ARM_CONTAINERS.map((c) => `\`${c}\``).join(" / ");
448
+ return `the engine does not run \`${type}\` inside a \`${container}\` yet (node "${id}") \u2014 place it at the top level, as a ${legal} arm, or inside a child \`workflow\``;
449
+ }
450
+ function workflowHitlArmShapeMessage(type, id, shape) {
451
+ return shape === "mapped-arm" ? `\`${type}\` arm "${id}" takes the previous output as its payload \u2014 it cannot head a [mapping, step] chain; map before the container instead` : `a chunked foreach hands each child a slice of items, not one \u2014 \`${type}\` body "${id}" takes one item; drop \`chunk\``;
452
+ }
362
453
  function isModelIdSentinel(input) {
363
454
  const lower = (input ?? "").trim().toLowerCase();
364
455
  return lower === "auto" || lower.startsWith("auto/");
365
456
  }
457
+ function isModelClassRef(input) {
458
+ return modelClassOf(input) !== void 0;
459
+ }
460
+ function modelClassOf(input) {
461
+ const lower = (input ?? "").trim().toLowerCase();
462
+ if (!lower.startsWith(MODEL_CLASS_REF_PREFIX)) return void 0;
463
+ const c = lower.slice(MODEL_CLASS_REF_PREFIX.length);
464
+ return WORKFLOW_MODEL_CLASSES.includes(c) ? c : void 0;
465
+ }
466
+ function modelClassRef(modelClass) {
467
+ return `${MODEL_CLASS_REF_PREFIX}${modelClass}`;
468
+ }
366
469
  function normalizeModelId(input, registry) {
367
470
  const requested = typeof input === "string" ? input.trim() : "";
368
471
  if (!requested) return {
@@ -377,6 +480,11 @@ function normalizeModelId(input, registry) {
377
480
  id: lower,
378
481
  form: "sentinel"
379
482
  };
483
+ if (modelClassOf(lower) !== void 0) return {
484
+ ok: true,
485
+ id: lower,
486
+ form: "class"
487
+ };
380
488
  const slash = requested.indexOf("/");
381
489
  const malformed = slash === 0;
382
490
  const provider = slash > 0 ? lower.slice(0, slash) : void 0;
@@ -437,6 +545,9 @@ function modelUnresolvedMessage(r) {
437
545
  }
438
546
  return r.candidates.length ? `model "${r.requested}" does not resolve to an approved model \u2014 accepted forms: ${r.candidates.join(", ")}` : `model "${r.requested}" does not resolve to an approved model \u2014 accepted forms are the registry's provider-prefixed ids (provider/model) or a bare id that names exactly one of them`;
439
547
  }
548
+ function modelClassUnresolvedMessage(ref) {
549
+ return `model "${ref.trim()}" is a model-class request that was not resolved before dispatch \u2014 a class is resolved to a concrete approved model by the class map at dispatch, and is never sent to a provider as written; this step refuses rather than run on a substituted model`;
550
+ }
440
551
  function providerModelId(code) {
441
552
  const requested = typeof code === "string" ? code.trim() : "";
442
553
  if (!requested || isModelIdSentinel(requested)) return requested;
@@ -833,81 +944,15 @@ function workflowOccurrenceId(lineageId, stepId) {
833
944
  function workflowOrgSlotKey(orgId, kind) {
834
945
  return `wf:org:${orgId}:${kind}`;
835
946
  }
947
+ function workflowJobModelSourceLabel(source) {
948
+ return WORKFLOW_JOB_MODEL_SOURCE_LABELS[source];
949
+ }
836
950
  function scheduledTimeKey(scheduledTime) {
837
951
  return scheduledTime.replace(/[^0-9TZ]/g, "");
838
952
  }
839
953
  function scheduledWorkflowRunIdForTime(jobId, scheduledTime) {
840
954
  return scheduledWorkflowRunId(jobId, scheduledTime);
841
955
  }
842
- function workflowRetryMaxAttemptsMessage(got) {
843
- const tail = got === void 0 ? "" : ` (got ${JSON.stringify(got)})`;
844
- return `\`retry.maxAttempts\` must be an integer ${WORKFLOW_RETRY_MIN_ATTEMPTS}..${WORKFLOW_RETRY_MAX_ATTEMPTS}${tail}`;
845
- }
846
- function isWithinWorkflowRetryAttempts(value3) {
847
- return typeof value3 === "number" && Number.isInteger(value3) && value3 >= WORKFLOW_RETRY_MIN_ATTEMPTS && value3 <= WORKFLOW_RETRY_MAX_ATTEMPTS;
848
- }
849
- function workflowRetryUnknownMembersMessage(keys) {
850
- const named = keys.map((k) => {
851
- const engine = WORKFLOW_RETRY_ENGINE_KEYS.includes(k);
852
- return `\`${k}\`${engine ? " (engine-owned \u2014 stamped by resetAttempts, never authored)" : ""}`;
853
- });
854
- return `\`retry\` has no member ${named.join(", ")}; members: ${WORKFLOW_RETRY_POLICY_KEYS.join(", ")}`;
855
- }
856
- function unknownWorkflowRetryMembers(retry) {
857
- if (!retry || typeof retry !== "object" || Array.isArray(retry)) return [];
858
- return Object.keys(retry).filter((k) => !WORKFLOW_RETRY_POLICY_KEYS.includes(k));
859
- }
860
- function authoredRetryPolicy(retry) {
861
- if (!retry || typeof retry !== "object" || Array.isArray(retry)) return void 0;
862
- const src = retry;
863
- const out = {};
864
- for (const k of WORKFLOW_RETRY_POLICY_KEYS) if (src[k] !== void 0) out[k] = src[k];
865
- return Object.keys(out).length ? out : void 0;
866
- }
867
- function retryBudgetBaseAttempt(row) {
868
- const base = row.retry?.budgetBaseAttempt;
869
- return typeof base === "number" && Number.isSafeInteger(base) && base > 0 ? base : 0;
870
- }
871
- function retryBudgetAttempt(row) {
872
- return Math.max(0, row.attempt - retryBudgetBaseAttempt(row));
873
- }
874
- function retryBudgetMaxAttempts(row) {
875
- const max = row.retry?.maxAttempts;
876
- return typeof max === "number" && Number.isFinite(max) && max >= 1 ? max : 1;
877
- }
878
- function retryBudgetRemaining(row) {
879
- return retryBudgetAttempt(row) < retryBudgetMaxAttempts(row);
880
- }
881
- function retriesRemaining(row) {
882
- return Math.max(0, retryBudgetMaxAttempts(row) - retryBudgetAttempt(row));
883
- }
884
- function isWithinWorkflowJobRange(member, value3) {
885
- const { min, max } = WORKFLOW_JOB_RANGES[member];
886
- return typeof value3 === "number" && Number.isInteger(value3) && value3 >= min && value3 <= max;
887
- }
888
- function workflowJobRangeMessage(member) {
889
- const { min, max } = WORKFLOW_JOB_RANGES[member];
890
- return `\`${member}\` must be an integer ${min}..${max}`;
891
- }
892
- function isWorkflowSingleStepType(type) {
893
- return typeof type === "string" && WORKFLOW_SINGLE_STEP_TYPES.includes(type);
894
- }
895
- function isWorkflowHitlEntryType(type) {
896
- return typeof type === "string" && WORKFLOW_HITL_ENTRY_TYPES.includes(type);
897
- }
898
- function isWorkflowArmEntryType(type) {
899
- return typeof type === "string" && WORKFLOW_ARM_ENTRY_TYPES.includes(type);
900
- }
901
- function workflowContainerRunsHitlArm(container) {
902
- return typeof container === "string" && WORKFLOW_HITL_ARM_CONTAINERS.includes(container);
903
- }
904
- function workflowHitlArmUnsupportedMessage(type, id, container) {
905
- const legal = WORKFLOW_HITL_ARM_CONTAINERS.map((c) => `\`${c}\``).join(" / ");
906
- return `the engine does not run \`${type}\` inside a \`${container}\` yet (node "${id}") \u2014 place it at the top level, as a ${legal} arm, or inside a child \`workflow\``;
907
- }
908
- function workflowHitlArmShapeMessage(type, id, shape) {
909
- return shape === "mapped-arm" ? `\`${type}\` arm "${id}" takes the previous output as its payload \u2014 it cannot head a [mapping, step] chain; map before the container instead` : `a chunked foreach hands each child a slice of items, not one \u2014 \`${type}\` body "${id}" takes one item; drop \`chunk\``;
910
- }
911
956
  function workflowGoalJudgeKind(judge) {
912
957
  return judge && typeof judge === "object" && judge.predicate !== void 0 ? "predicate" : "agent";
913
958
  }
@@ -1212,7 +1257,7 @@ function effectiveAgentFeatures(base, override, rule) {
1212
1257
  if (rule === "wholesale") return override || base || void 0;
1213
1258
  return effectiveAgentFeatureRows(base, override).rows;
1214
1259
  }
1215
- var __defProp2, __name2, CHANNEL_SEND_CHANNELS, REVIEWABLE_ACTION_EXECUTE_TOOL_ALLOWLIST, REVIEWABLE_STANDING_START_TOOLS, REVIEWABLE_MCP_SEND_TOOL_SUFFIX, MCP_TOOL_READ_VERB_RE, MCP_DRAFT_CREATE_VERBS, NON_INTERACTIVE_CHANNELS, RICH_PARTS_MESSAGE_ID_PREFIX, SCREENSHOT_MESSAGE_ID_PREFIX, BROWSER_COMMANDS, BROWSER_COMMAND_NAMES, DESKTOP_FILE_COMMANDS, DESKTOP_FILE_COMMAND_SET, MODEL_ID_BYOK_PROVIDERS, MODEL_SNAPSHOT_SUFFIX, REASONING_EFFORT_VALUES, IMPLICIT_MODEL_SELECTION_SOURCES, PLATFORM_FALLBACK_MODEL_SOURCE, AGENT_NAME_TOKEN, DEFAULT_PERSONA_GUIDE, PERSONAL_SPACE_STARTING_PERSONA, CORE_DRAINING_CODE, CORE_DRAINING_DEFAULT_RETRY_MS, CORE_DRAINING_MAX_RETRY_MS, VoiceNameSchema, PluginProviderSchema, RealtimeProviderSchema, PluginClassSchema, ModelDescriptorSchema, InferenceModelSchema, PluginModelSchema, RealtimeModelSchema, LuaVoiceModelSchema, TurnDetectionSchema, InterruptionSchema, BuiltinAudioClipSchema, AudioConfigSchema, BackgroundAudioEntrySchema, BackgroundAudioSchema, LuaVoiceConfigInnerSchema, LuaVoiceConfigSchema, LuaVoiceRefSchema, LUA_JOB_DEFAULT_TIMEOUT_SECONDS, LUA_JOB_MIN_TIMEOUT_SECONDS, LUA_JOB_MAX_TIMEOUT_SECONDS, KEYS, MAX_BODY_BYTES, MAX_ID_LENGTH, UTC_ISO, TEMPLATE_TRIGGER_URL_ENV_PREFIX, TEMPLATE_INSTALL_POLICY_PER_WORKSPACE_VALUES, SUBJECT_TYPES, SubjectTypeSchema, CREDENTIAL_TYPES, CredentialTypeSchema, DEVICE_OPERATIONS, DeviceOperationSchema, DEVICE_SCOPE_BY_OPERATION, DeviceBindingSchema, IdSchema, SESSION_AUTH_TIME_MAX_S, PrincipalDescriptorSchema, ActorDescriptorSchema, PrincipalOwnerSchema, CredentialLifecycleSchema, GeneralCredentialDescriptorSchema, DeviceCredentialDescriptorSchema, GeneralPrincipalContextSchema, DeviceCredentialPrincipalContextSchema, RawPrincipalContextSchema, PrincipalContextSchema, DeviceCredentialClaimSchema, LUA_CLIENT_HEADER, LUA_CLIENT_APPS, SEMVER_PATTERN, WEB_RELEASE_PATTERN, CLIENT_HEADER_PATTERN, LUA_SESSION_ID_CLAIM, SESSION_REVOKED_CODE, AUTHZ_PROJECTION_VERSION, ProjectedScopeSchema, DisplayRoleSchema, AuthorizationPrincipalSchema, CredentialContextSchema, ProjectionAnomalySchema, ProjectedOrgSchema, ProjectedResourceSchema, CapabilityProfilesSchema, RoleCatalogSchema, EffectiveAuthorizationSchema, ResourcePageSchema, SYSTEM_USER_PREFIX, WORKFLOW_RUN_IN_FLIGHT, WORKFLOW_RUN_IDLE, WORKFLOW_RUN_TERMINAL, WORKFLOW_RUN_STATUSES, WORKFLOW_RUN_GATE_KINDS, WORKFLOW_STEP_STATUSES, WORKFLOW_STEP_IN_FLIGHT, WORKFLOW_SIGNAL_EVENT_SITES, ARCHIVE_WINDOW_MARGIN_DAYS, WORKFLOW_ORG_PURGING_TTL_S, WORKFLOW_ORG_PURGE_FORCE_AFTER_MS, IDEMPOTENCY_HOLDING_STATUSES, WORKFLOW_SCHEDULED_RUN_ID_PREFIX, CLOUD_TASK_RUN_ID_PREFIX, WORKFLOW_SCHEDULE_KEY_MAX, WORKFLOW_SCHEDULE_IDEMPOTENCY_KEY_PREFIX, WORKFLOW_OPERATION_ID_PREFIX, WORKFLOW_CONNECTION_KEY_RE, WORKFLOW_SUSPEND_KINDS, WORKFLOW_RUN_NOTIFICATION_SUSPENDED_KINDS, WORKFLOW_SIGNAL_PAYLOAD_MAX_BYTES, WORKFLOW_RESOLVE_OUTPUT_MAX_BYTES, WORKFLOW_RETRY_BACKOFFS, WORKFLOW_RETRY_MIN_ATTEMPTS, WORKFLOW_RETRY_POLICY_KEYS, WORKFLOW_RETRY_MAX_ATTEMPTS, WORKFLOW_RETRY_ENGINE_KEYS, WORKFLOW_JOB_RESOURCES, WORKFLOW_SIDE_EFFECTS, WORKFLOW_JOB_RANGES, WORKFLOW_JOB_RANGE_MEMBERS, WORKFLOW_SINGLE_STEP_TYPES, WORKFLOW_HITL_ENTRY_TYPES, WORKFLOW_ARM_ENTRY_TYPES, WORKFLOW_HITL_ARM_CONTAINERS, WORKFLOW_GRAPH_ENTRY_STEP_KINDS, WORKFLOW_ARM_ENTRY_STEP_KINDS, WORKFLOW_BUDGET_MAX_DURATION_SECONDS, WORKFLOW_GOAL_JUDGE_SELF, REDACTED_PLACEHOLDER, PROVIDER_MESSAGE_MAX_CHARS, ERROR_MESSAGE_MAX_CHARS, SECRET_LITERAL_PATTERNS, SECRET_NAME, SECRET_PAIR_PATTERNS, GROUP_COUNT, WORKFLOW_SECRET_KEY_RE, WORKFLOW_RESERVED_SECRET_KEYS, SCRUB_INPUT_MAX_CHARS, SCRUB_CUT_BACKOFF_CHARS, WORKFLOW_AUDIT_EVENTS, WORKFLOW_AUDIT_METADATA_MAX_BYTES, INDENT, WRAP_WIDTH, NOUNS, GET_TOOL_NAMES, PREAMBLE, WORKFLOW_APPROVAL_OUTPUT_DECISIONS, WORKFLOW_APPROVAL_OUTPUT_SCHEMA, JSON_FENCE_RE, DEFAULT_ON_AGENT_FEATURES, SUBAGENT_PER_KEY_FLAG_ENV, PER_KEY_FLAG_VALUES;
1260
+ var __defProp2, __name2, CHANNEL_SEND_CHANNELS, REVIEWABLE_ACTION_EXECUTE_TOOL_ALLOWLIST, REVIEWABLE_STANDING_START_TOOLS, REVIEWABLE_MCP_SEND_TOOL_SUFFIX, MCP_TOOL_READ_VERB_RE, MCP_DRAFT_CREATE_VERBS, NON_INTERACTIVE_CHANNELS, RICH_PARTS_MESSAGE_ID_PREFIX, SCREENSHOT_MESSAGE_ID_PREFIX, BROWSER_COMMANDS, BROWSER_COMMAND_NAMES, DESKTOP_FILE_COMMANDS, DESKTOP_FILE_COMMAND_SET, WORKFLOW_RETRY_BACKOFFS, WORKFLOW_RETRY_MIN_ATTEMPTS, WORKFLOW_RETRY_POLICY_KEYS, WORKFLOW_RETRY_MAX_ATTEMPTS, WORKFLOW_RETRY_ENGINE_KEYS, WORKFLOW_JOB_RESOURCES, WORKFLOW_SIDE_EFFECTS, WORKFLOW_MODEL_CLASSES, WORKFLOW_DEFAULT_TASK_CLASS_MAP, WORKFLOW_MODELS_MAX_CLASS_DEFAULT, WORKFLOW_AUTONOMY_NUMERIC_KEYS, WORKFLOW_AUTONOMY_ENVELOPE_KEYS, WORKFLOW_AUTONOMY_DEFAULTS, WORKFLOW_AUTONOMY_CEILINGS, WORKFLOW_AUTONOMY_MAX_RUNS_PER_HOUR_ENV, WORKFLOW_AUTONOMY_MAX_RUNS_PER_HOUR_CEILING, WORKFLOW_AUTONOMY_FORMS_DEFAULT, WORKFLOW_AUTONOMY_MIN_VALUE, WORKFLOW_JOB_RANGES, WORKFLOW_JOB_RANGE_MEMBERS, WORKFLOW_SINGLE_STEP_TYPES, WORKFLOW_HITL_ENTRY_TYPES, WORKFLOW_ARM_ENTRY_TYPES, WORKFLOW_HITL_ARM_CONTAINERS, WORKFLOW_GRAPH_ENTRY_STEP_KINDS, WORKFLOW_ARM_ENTRY_STEP_KINDS, WORKFLOW_BUDGET_MAX_DURATION_SECONDS, MODEL_ID_BYOK_PROVIDERS, MODEL_CLASS_REF_PREFIX, MODEL_SNAPSHOT_SUFFIX, REASONING_EFFORT_VALUES, IMPLICIT_MODEL_SELECTION_SOURCES, PLATFORM_FALLBACK_MODEL_SOURCE, AGENT_NAME_TOKEN, DEFAULT_PERSONA_GUIDE, PERSONAL_SPACE_STARTING_PERSONA, CORE_DRAINING_CODE, CORE_DRAINING_DEFAULT_RETRY_MS, CORE_DRAINING_MAX_RETRY_MS, VoiceNameSchema, PluginProviderSchema, RealtimeProviderSchema, PluginClassSchema, ModelDescriptorSchema, InferenceModelSchema, PluginModelSchema, RealtimeModelSchema, LuaVoiceModelSchema, TurnDetectionSchema, InterruptionSchema, BuiltinAudioClipSchema, AudioConfigSchema, BackgroundAudioEntrySchema, BackgroundAudioSchema, LuaVoiceConfigInnerSchema, LuaVoiceConfigSchema, LuaVoiceRefSchema, LUA_JOB_DEFAULT_TIMEOUT_SECONDS, LUA_JOB_MIN_TIMEOUT_SECONDS, LUA_JOB_MAX_TIMEOUT_SECONDS, KEYS, MAX_BODY_BYTES, MAX_ID_LENGTH, UTC_ISO, TEMPLATE_TRIGGER_URL_ENV_PREFIX, TEMPLATE_INSTALL_POLICY_PER_WORKSPACE_VALUES, SUBJECT_TYPES, SubjectTypeSchema, CREDENTIAL_TYPES, CredentialTypeSchema, DEVICE_OPERATIONS, DeviceOperationSchema, DEVICE_SCOPE_BY_OPERATION, DeviceBindingSchema, IdSchema, SESSION_AUTH_TIME_MAX_S, PrincipalDescriptorSchema, ActorDescriptorSchema, PrincipalOwnerSchema, CredentialLifecycleSchema, GeneralCredentialDescriptorSchema, DeviceCredentialDescriptorSchema, GeneralPrincipalContextSchema, DeviceCredentialPrincipalContextSchema, RawPrincipalContextSchema, PrincipalContextSchema, DeviceCredentialClaimSchema, LUA_CLIENT_HEADER, LUA_CLIENT_APPS, SEMVER_PATTERN, WEB_RELEASE_PATTERN, CLIENT_HEADER_PATTERN, LUA_SESSION_ID_CLAIM, SESSION_REVOKED_CODE, AUTHZ_PROJECTION_VERSION, ProjectedScopeSchema, DisplayRoleSchema, AuthorizationPrincipalSchema, CredentialContextSchema, ProjectionAnomalySchema, ProjectedOrgSchema, ProjectedResourceSchema, CapabilityProfilesSchema, RoleCatalogSchema, EffectiveAuthorizationSchema, ResourcePageSchema, SYSTEM_USER_PREFIX, WORKFLOW_RUN_IN_FLIGHT, WORKFLOW_RUN_IDLE, WORKFLOW_RUN_TERMINAL, WORKFLOW_RUN_STATUSES, WORKFLOW_RUN_GATE_KINDS, WORKFLOW_STEP_STATUSES, WORKFLOW_STEP_IN_FLIGHT, WORKFLOW_SIGNAL_EVENT_SITES, ARCHIVE_WINDOW_MARGIN_DAYS, WORKFLOW_ORG_PURGING_TTL_S, WORKFLOW_ORG_PURGE_FORCE_AFTER_MS, IDEMPOTENCY_HOLDING_STATUSES, WORKFLOW_SCHEDULED_RUN_ID_PREFIX, CLOUD_TASK_RUN_ID_PREFIX, WORKFLOW_SCHEDULE_KEY_MAX, WORKFLOW_SCHEDULE_IDEMPOTENCY_KEY_PREFIX, WORKFLOW_OPERATION_ID_PREFIX, WORKFLOW_CONNECTION_KEY_RE, WORKFLOW_JOB_MODEL_SOURCE_LABELS, WORKFLOW_SUSPEND_KINDS, WORKFLOW_RUN_NOTIFICATION_SUSPENDED_KINDS, WORKFLOW_SIGNAL_PAYLOAD_MAX_BYTES, WORKFLOW_RESOLVE_OUTPUT_MAX_BYTES, WORKFLOW_GOAL_JUDGE_SELF, REDACTED_PLACEHOLDER, PROVIDER_MESSAGE_MAX_CHARS, ERROR_MESSAGE_MAX_CHARS, SECRET_LITERAL_PATTERNS, SECRET_NAME, SECRET_PAIR_PATTERNS, GROUP_COUNT, WORKFLOW_SECRET_KEY_RE, WORKFLOW_RESERVED_SECRET_KEYS, SCRUB_INPUT_MAX_CHARS, SCRUB_CUT_BACKOFF_CHARS, WORKFLOW_AUDIT_EVENTS, WORKFLOW_AUDIT_METADATA_MAX_BYTES, INDENT, WRAP_WIDTH, NOUNS, GET_TOOL_NAMES, PREAMBLE, WORKFLOW_APPROVAL_OUTPUT_DECISIONS, WORKFLOW_APPROVAL_OUTPUT_SCHEMA, JSON_FENCE_RE, DEFAULT_ON_AGENT_FEATURES, SUBAGENT_PER_KEY_FLAG_ENV, PER_KEY_FLAG_VALUES;
1216
1261
  var init_dist = __esm({
1217
1262
  "../shared-types/dist/index.mjs"() {
1218
1263
  "use strict";
@@ -1534,16 +1579,202 @@ var init_dist = __esm({
1534
1579
  __name2(isDesktopFileCommandName, "isDesktopFileCommandName");
1535
1580
  __name(isDesktopFileSessionId, "isDesktopFileSessionId");
1536
1581
  __name2(isDesktopFileSessionId, "isDesktopFileSessionId");
1582
+ WORKFLOW_RETRY_BACKOFFS = [
1583
+ "fixed",
1584
+ "exponential"
1585
+ ];
1586
+ WORKFLOW_RETRY_MIN_ATTEMPTS = 1;
1587
+ WORKFLOW_RETRY_POLICY_KEYS = [
1588
+ "maxAttempts",
1589
+ "backoffSeconds",
1590
+ "backoff",
1591
+ "maxBackoffSeconds"
1592
+ ];
1593
+ WORKFLOW_RETRY_MAX_ATTEMPTS = 20;
1594
+ __name(workflowRetryMaxAttemptsMessage, "workflowRetryMaxAttemptsMessage");
1595
+ __name2(workflowRetryMaxAttemptsMessage, "workflowRetryMaxAttemptsMessage");
1596
+ __name(isWithinWorkflowRetryAttempts, "isWithinWorkflowRetryAttempts");
1597
+ __name2(isWithinWorkflowRetryAttempts, "isWithinWorkflowRetryAttempts");
1598
+ WORKFLOW_RETRY_ENGINE_KEYS = [
1599
+ "budgetBaseAttempt"
1600
+ ];
1601
+ __name(workflowRetryUnknownMembersMessage, "workflowRetryUnknownMembersMessage");
1602
+ __name2(workflowRetryUnknownMembersMessage, "workflowRetryUnknownMembersMessage");
1603
+ __name(unknownWorkflowRetryMembers, "unknownWorkflowRetryMembers");
1604
+ __name2(unknownWorkflowRetryMembers, "unknownWorkflowRetryMembers");
1605
+ __name(authoredRetryPolicy, "authoredRetryPolicy");
1606
+ __name2(authoredRetryPolicy, "authoredRetryPolicy");
1607
+ __name(retryBudgetBaseAttempt, "retryBudgetBaseAttempt");
1608
+ __name2(retryBudgetBaseAttempt, "retryBudgetBaseAttempt");
1609
+ __name(retryBudgetAttempt, "retryBudgetAttempt");
1610
+ __name2(retryBudgetAttempt, "retryBudgetAttempt");
1611
+ __name(retryBudgetMaxAttempts, "retryBudgetMaxAttempts");
1612
+ __name2(retryBudgetMaxAttempts, "retryBudgetMaxAttempts");
1613
+ __name(retryBudgetRemaining, "retryBudgetRemaining");
1614
+ __name2(retryBudgetRemaining, "retryBudgetRemaining");
1615
+ __name(retriesRemaining, "retriesRemaining");
1616
+ __name2(retriesRemaining, "retriesRemaining");
1617
+ WORKFLOW_JOB_RESOURCES = [
1618
+ "small",
1619
+ "medium",
1620
+ "large"
1621
+ ];
1622
+ WORKFLOW_SIDE_EFFECTS = [
1623
+ "none",
1624
+ "external"
1625
+ ];
1626
+ WORKFLOW_MODEL_CLASSES = [
1627
+ "fast",
1628
+ "balanced",
1629
+ "strong"
1630
+ ];
1631
+ __name(workflowModelCostComparison, "workflowModelCostComparison");
1632
+ __name2(workflowModelCostComparison, "workflowModelCostComparison");
1633
+ WORKFLOW_DEFAULT_TASK_CLASS_MAP = Object.freeze({
1634
+ classify: "fast",
1635
+ extract: "fast",
1636
+ transform: "fast",
1637
+ draft: "balanced",
1638
+ research: "balanced",
1639
+ judge: "balanced",
1640
+ reason: "strong",
1641
+ code: "strong"
1642
+ });
1643
+ WORKFLOW_MODELS_MAX_CLASS_DEFAULT = WORKFLOW_MODEL_CLASSES[WORKFLOW_MODEL_CLASSES.length - 1];
1644
+ __name(modelClassRank, "modelClassRank");
1645
+ __name2(modelClassRank, "modelClassRank");
1646
+ __name(modelClassesAtOrBelow, "modelClassesAtOrBelow");
1647
+ __name2(modelClassesAtOrBelow, "modelClassesAtOrBelow");
1648
+ WORKFLOW_AUTONOMY_NUMERIC_KEYS = [
1649
+ "maxCredits",
1650
+ "maxSteps",
1651
+ "maxDurationSeconds",
1652
+ "maxActions",
1653
+ "maxRunsPerHour"
1654
+ ];
1655
+ WORKFLOW_AUTONOMY_ENVELOPE_KEYS = [
1656
+ "enabled",
1657
+ ...WORKFLOW_AUTONOMY_NUMERIC_KEYS,
1658
+ "forms"
1659
+ ];
1660
+ WORKFLOW_AUTONOMY_DEFAULTS = Object.freeze({
1661
+ maxCredits: 20,
1662
+ maxSteps: 15,
1663
+ maxDurationSeconds: 86400,
1664
+ maxRunsPerHour: 20
1665
+ });
1666
+ WORKFLOW_AUTONOMY_CEILINGS = Object.freeze({
1667
+ maxSteps: 40,
1668
+ maxDurationSeconds: 604800
1669
+ });
1670
+ WORKFLOW_AUTONOMY_MAX_RUNS_PER_HOUR_ENV = "LUA_WF_AUTONOMY_MAX_RUNS_PER_HOUR";
1671
+ WORKFLOW_AUTONOMY_MAX_RUNS_PER_HOUR_CEILING = 200;
1672
+ __name(workflowAutonomyMaxRunsPerHourCeiling, "workflowAutonomyMaxRunsPerHourCeiling");
1673
+ __name2(workflowAutonomyMaxRunsPerHourCeiling, "workflowAutonomyMaxRunsPerHourCeiling");
1674
+ WORKFLOW_AUTONOMY_FORMS_DEFAULT = Object.freeze([
1675
+ "graph",
1676
+ "static"
1677
+ ]);
1678
+ WORKFLOW_AUTONOMY_MIN_VALUE = 1;
1679
+ __name(isWithinWorkflowAutonomyRange, "isWithinWorkflowAutonomyRange");
1680
+ __name2(isWithinWorkflowAutonomyRange, "isWithinWorkflowAutonomyRange");
1681
+ __name(workflowAutonomyRangeMessage, "workflowAutonomyRangeMessage");
1682
+ __name2(workflowAutonomyRangeMessage, "workflowAutonomyRangeMessage");
1683
+ WORKFLOW_JOB_RANGES = Object.freeze({
1684
+ /** Coding-turn cap (`claude -p --max-turns`); absent ⇒ the cluster default (LUA_WF_JOB_MAX_TURNS). */
1685
+ maxTurns: Object.freeze({
1686
+ min: 1,
1687
+ max: 500
1688
+ }),
1689
+ /** Harness messages per attempt (one per content block); absent ⇒ the cluster default (400). */
1690
+ maxMessages: Object.freeze({
1691
+ min: 1,
1692
+ max: 5e3
1693
+ }),
1694
+ /** Input-side tokens per attempt (prompt + cache); absent ⇒ the cluster default (4M — LUA-708, was 30M). */
1695
+ maxInputTokens: Object.freeze({
1696
+ min: 1e6,
1697
+ max: 5e8
1698
+ })
1699
+ });
1700
+ WORKFLOW_JOB_RANGE_MEMBERS = Object.keys(WORKFLOW_JOB_RANGES);
1701
+ __name(isWithinWorkflowJobRange, "isWithinWorkflowJobRange");
1702
+ __name2(isWithinWorkflowJobRange, "isWithinWorkflowJobRange");
1703
+ __name(workflowJobRangeMessage, "workflowJobRangeMessage");
1704
+ __name2(workflowJobRangeMessage, "workflowJobRangeMessage");
1705
+ WORKFLOW_SINGLE_STEP_TYPES = [
1706
+ "agent",
1707
+ "tool",
1708
+ "workflow",
1709
+ "step"
1710
+ ];
1711
+ WORKFLOW_HITL_ENTRY_TYPES = [
1712
+ "approval",
1713
+ "waitForSignal"
1714
+ ];
1715
+ WORKFLOW_ARM_ENTRY_TYPES = [
1716
+ ...WORKFLOW_SINGLE_STEP_TYPES,
1717
+ ...WORKFLOW_HITL_ENTRY_TYPES
1718
+ ];
1719
+ WORKFLOW_HITL_ARM_CONTAINERS = [
1720
+ "parallel",
1721
+ "conditional",
1722
+ "foreach"
1723
+ ];
1724
+ __name(isWorkflowSingleStepType, "isWorkflowSingleStepType");
1725
+ __name2(isWorkflowSingleStepType, "isWorkflowSingleStepType");
1726
+ __name(isWorkflowHitlEntryType, "isWorkflowHitlEntryType");
1727
+ __name2(isWorkflowHitlEntryType, "isWorkflowHitlEntryType");
1728
+ __name(isWorkflowArmEntryType, "isWorkflowArmEntryType");
1729
+ __name2(isWorkflowArmEntryType, "isWorkflowArmEntryType");
1730
+ __name(workflowContainerRunsHitlArm, "workflowContainerRunsHitlArm");
1731
+ __name2(workflowContainerRunsHitlArm, "workflowContainerRunsHitlArm");
1732
+ __name(workflowHitlArmUnsupportedMessage, "workflowHitlArmUnsupportedMessage");
1733
+ __name2(workflowHitlArmUnsupportedMessage, "workflowHitlArmUnsupportedMessage");
1734
+ __name(workflowHitlArmShapeMessage, "workflowHitlArmShapeMessage");
1735
+ __name2(workflowHitlArmShapeMessage, "workflowHitlArmShapeMessage");
1736
+ WORKFLOW_GRAPH_ENTRY_STEP_KINDS = Object.freeze({
1737
+ agent: "agent",
1738
+ tool: "tool",
1739
+ workflow: "subrun",
1740
+ step: "code",
1741
+ mapping: "map",
1742
+ sleep: "sleep",
1743
+ sleepUntil: "sleepUntil",
1744
+ parallel: null,
1745
+ conditional: "branch",
1746
+ foreach: "foreach",
1747
+ loop: "loop",
1748
+ approval: "approval",
1749
+ waitForSignal: "signal"
1750
+ });
1751
+ WORKFLOW_ARM_ENTRY_STEP_KINDS = Object.freeze(Object.fromEntries(WORKFLOW_ARM_ENTRY_TYPES.map((t) => [
1752
+ t,
1753
+ WORKFLOW_GRAPH_ENTRY_STEP_KINDS[t]
1754
+ ])));
1755
+ WORKFLOW_BUDGET_MAX_DURATION_SECONDS = Object.freeze({
1756
+ min: 60,
1757
+ max: 2592e3
1758
+ });
1537
1759
  MODEL_ID_BYOK_PROVIDERS = [
1538
1760
  "azure",
1539
1761
  "bedrock"
1540
1762
  ];
1541
1763
  __name(isModelIdSentinel, "isModelIdSentinel");
1542
1764
  __name2(isModelIdSentinel, "isModelIdSentinel");
1765
+ MODEL_CLASS_REF_PREFIX = "class/";
1766
+ __name(isModelClassRef, "isModelClassRef");
1767
+ __name2(isModelClassRef, "isModelClassRef");
1768
+ __name(modelClassOf, "modelClassOf");
1769
+ __name2(modelClassOf, "modelClassOf");
1770
+ __name(modelClassRef, "modelClassRef");
1771
+ __name2(modelClassRef, "modelClassRef");
1543
1772
  __name(normalizeModelId, "normalizeModelId");
1544
1773
  __name2(normalizeModelId, "normalizeModelId");
1545
1774
  __name(modelUnresolvedMessage, "modelUnresolvedMessage");
1546
1775
  __name2(modelUnresolvedMessage, "modelUnresolvedMessage");
1776
+ __name(modelClassUnresolvedMessage, "modelClassUnresolvedMessage");
1777
+ __name2(modelClassUnresolvedMessage, "modelClassUnresolvedMessage");
1547
1778
  __name(providerModelId, "providerModelId");
1548
1779
  __name2(providerModelId, "providerModelId");
1549
1780
  MODEL_SNAPSHOT_SUFFIX = /(?:[-@](?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])|-(?:19|20)\d{2}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01]))$/;
@@ -2175,7 +2406,15 @@ This text is who you are for this person. As you learn them, their name, their w
2175
2406
  "org-grant",
2176
2407
  "agent-grant-only"
2177
2408
  ]).describe("For user and staff principals, grant provenance: org-grant means a stored org grant produced the row. For owner-ceiling API keys, effective provenance: org-grant means the credential-owner intersection has org-level capability; agent-grant-only means the intersection reaches only an exact agent inside the org."),
2178
- anomalies: z3.array(ProjectionAnomalySchema).optional()
2409
+ anomalies: z3.array(ProjectionAnomalySchema).optional(),
2410
+ /**
2411
+ * How many agents and Spaces in this org the caller can read — the size of
2412
+ * the org's resource page under the same discovery rule, without paging it.
2413
+ */
2414
+ resourceCounts: z3.object({
2415
+ agents: z3.number().int().nonnegative(),
2416
+ spaces: z3.number().int().nonnegative()
2417
+ }).optional()
2179
2418
  }).passthrough();
2180
2419
  ProjectedResourceSchema = z3.object({
2181
2420
  resourceType: z3.literal("agent"),
@@ -2214,7 +2453,21 @@ This text is who you are for this person. As you learn them, their name, their w
2214
2453
  id: z3.string().min(1).max(256),
2215
2454
  name: z3.string().optional(),
2216
2455
  email: z3.string().optional()
2217
- }).optional()
2456
+ }).optional(),
2457
+ /**
2458
+ * Presentation enrichment (PRO-1994), product data only — never influences
2459
+ * discovery. These moved off the O(orgs) `/context` roster onto the bounded
2460
+ * per-active-org resource page so Desktop stops paying an org-count-scaled
2461
+ * cost at sign-in. `persona`/`avatar` are loose (`PersonaText` / `AgentAvatar`
2462
+ * are structured-or-string), `platform` marks the org's Designer agent
2463
+ * (previously stamped only by `/context`; retires with PRO-1657).
2464
+ */
2465
+ persona: z3.unknown().optional(),
2466
+ description: z3.string().optional(),
2467
+ avatar: z3.unknown().nullish(),
2468
+ platform: z3.boolean().optional(),
2469
+ /** A Space's supervised agent ids (`kind: 'space'` rows only). */
2470
+ supervisedAgents: z3.array(z3.string()).optional()
2218
2471
  }).passthrough();
2219
2472
  CapabilityProfilesSchema = z3.record(z3.string().min(1).max(64), z3.array(ProjectedScopeSchema));
2220
2473
  RoleCatalogSchema = z3.record(z3.string().min(1).max(128), z3.object({
@@ -2304,7 +2557,8 @@ This text is who you are for this person. As you learn them, their name, their w
2304
2557
  "org_archived",
2305
2558
  "disabled",
2306
2559
  "exception",
2307
- "budget"
2560
+ "budget",
2561
+ "model_policy"
2308
2562
  ];
2309
2563
  WORKFLOW_STEP_STATUSES = [
2310
2564
  "pending",
@@ -2372,6 +2626,16 @@ This text is who you are for this person. As you learn them, their name, their w
2372
2626
  __name(workflowOrgSlotKey, "workflowOrgSlotKey");
2373
2627
  __name2(workflowOrgSlotKey, "workflowOrgSlotKey");
2374
2628
  WORKFLOW_CONNECTION_KEY_RE = /^[a-z][a-z0-9_-]{0,63}$/;
2629
+ WORKFLOW_JOB_MODEL_SOURCE_LABELS = {
2630
+ stamp: "lease stamp",
2631
+ initData: "run input",
2632
+ default: "placeholder default",
2633
+ node: "node.model",
2634
+ env: "platform default",
2635
+ org: "org default"
2636
+ };
2637
+ __name(workflowJobModelSourceLabel, "workflowJobModelSourceLabel");
2638
+ __name2(workflowJobModelSourceLabel, "workflowJobModelSourceLabel");
2375
2639
  __name(scheduledTimeKey, "scheduledTimeKey");
2376
2640
  __name2(scheduledTimeKey, "scheduledTimeKey");
2377
2641
  __name(scheduledWorkflowRunIdForTime, "scheduledWorkflowRunIdForTime");
@@ -2388,126 +2652,6 @@ This text is who you are for this person. As you learn them, their name, their w
2388
2652
  ];
2389
2653
  WORKFLOW_SIGNAL_PAYLOAD_MAX_BYTES = 64 * 1024;
2390
2654
  WORKFLOW_RESOLVE_OUTPUT_MAX_BYTES = 256 * 1024;
2391
- WORKFLOW_RETRY_BACKOFFS = [
2392
- "fixed",
2393
- "exponential"
2394
- ];
2395
- WORKFLOW_RETRY_MIN_ATTEMPTS = 1;
2396
- WORKFLOW_RETRY_POLICY_KEYS = [
2397
- "maxAttempts",
2398
- "backoffSeconds",
2399
- "backoff",
2400
- "maxBackoffSeconds"
2401
- ];
2402
- WORKFLOW_RETRY_MAX_ATTEMPTS = 20;
2403
- __name(workflowRetryMaxAttemptsMessage, "workflowRetryMaxAttemptsMessage");
2404
- __name2(workflowRetryMaxAttemptsMessage, "workflowRetryMaxAttemptsMessage");
2405
- __name(isWithinWorkflowRetryAttempts, "isWithinWorkflowRetryAttempts");
2406
- __name2(isWithinWorkflowRetryAttempts, "isWithinWorkflowRetryAttempts");
2407
- WORKFLOW_RETRY_ENGINE_KEYS = [
2408
- "budgetBaseAttempt"
2409
- ];
2410
- __name(workflowRetryUnknownMembersMessage, "workflowRetryUnknownMembersMessage");
2411
- __name2(workflowRetryUnknownMembersMessage, "workflowRetryUnknownMembersMessage");
2412
- __name(unknownWorkflowRetryMembers, "unknownWorkflowRetryMembers");
2413
- __name2(unknownWorkflowRetryMembers, "unknownWorkflowRetryMembers");
2414
- __name(authoredRetryPolicy, "authoredRetryPolicy");
2415
- __name2(authoredRetryPolicy, "authoredRetryPolicy");
2416
- __name(retryBudgetBaseAttempt, "retryBudgetBaseAttempt");
2417
- __name2(retryBudgetBaseAttempt, "retryBudgetBaseAttempt");
2418
- __name(retryBudgetAttempt, "retryBudgetAttempt");
2419
- __name2(retryBudgetAttempt, "retryBudgetAttempt");
2420
- __name(retryBudgetMaxAttempts, "retryBudgetMaxAttempts");
2421
- __name2(retryBudgetMaxAttempts, "retryBudgetMaxAttempts");
2422
- __name(retryBudgetRemaining, "retryBudgetRemaining");
2423
- __name2(retryBudgetRemaining, "retryBudgetRemaining");
2424
- __name(retriesRemaining, "retriesRemaining");
2425
- __name2(retriesRemaining, "retriesRemaining");
2426
- WORKFLOW_JOB_RESOURCES = [
2427
- "small",
2428
- "medium",
2429
- "large"
2430
- ];
2431
- WORKFLOW_SIDE_EFFECTS = [
2432
- "none",
2433
- "external"
2434
- ];
2435
- WORKFLOW_JOB_RANGES = Object.freeze({
2436
- /** Coding-turn cap (`claude -p --max-turns`); absent ⇒ the cluster default (LUA_WF_JOB_MAX_TURNS). */
2437
- maxTurns: Object.freeze({
2438
- min: 1,
2439
- max: 500
2440
- }),
2441
- /** Harness messages per attempt (one per content block); absent ⇒ the cluster default (400). */
2442
- maxMessages: Object.freeze({
2443
- min: 1,
2444
- max: 5e3
2445
- }),
2446
- /** Input-side tokens per attempt (prompt + cache); absent ⇒ the cluster default (4M — LUA-708, was 30M). */
2447
- maxInputTokens: Object.freeze({
2448
- min: 1e6,
2449
- max: 5e8
2450
- })
2451
- });
2452
- WORKFLOW_JOB_RANGE_MEMBERS = Object.keys(WORKFLOW_JOB_RANGES);
2453
- __name(isWithinWorkflowJobRange, "isWithinWorkflowJobRange");
2454
- __name2(isWithinWorkflowJobRange, "isWithinWorkflowJobRange");
2455
- __name(workflowJobRangeMessage, "workflowJobRangeMessage");
2456
- __name2(workflowJobRangeMessage, "workflowJobRangeMessage");
2457
- WORKFLOW_SINGLE_STEP_TYPES = [
2458
- "agent",
2459
- "tool",
2460
- "workflow",
2461
- "step"
2462
- ];
2463
- WORKFLOW_HITL_ENTRY_TYPES = [
2464
- "approval",
2465
- "waitForSignal"
2466
- ];
2467
- WORKFLOW_ARM_ENTRY_TYPES = [
2468
- ...WORKFLOW_SINGLE_STEP_TYPES,
2469
- ...WORKFLOW_HITL_ENTRY_TYPES
2470
- ];
2471
- WORKFLOW_HITL_ARM_CONTAINERS = [
2472
- "parallel",
2473
- "conditional",
2474
- "foreach"
2475
- ];
2476
- __name(isWorkflowSingleStepType, "isWorkflowSingleStepType");
2477
- __name2(isWorkflowSingleStepType, "isWorkflowSingleStepType");
2478
- __name(isWorkflowHitlEntryType, "isWorkflowHitlEntryType");
2479
- __name2(isWorkflowHitlEntryType, "isWorkflowHitlEntryType");
2480
- __name(isWorkflowArmEntryType, "isWorkflowArmEntryType");
2481
- __name2(isWorkflowArmEntryType, "isWorkflowArmEntryType");
2482
- __name(workflowContainerRunsHitlArm, "workflowContainerRunsHitlArm");
2483
- __name2(workflowContainerRunsHitlArm, "workflowContainerRunsHitlArm");
2484
- __name(workflowHitlArmUnsupportedMessage, "workflowHitlArmUnsupportedMessage");
2485
- __name2(workflowHitlArmUnsupportedMessage, "workflowHitlArmUnsupportedMessage");
2486
- __name(workflowHitlArmShapeMessage, "workflowHitlArmShapeMessage");
2487
- __name2(workflowHitlArmShapeMessage, "workflowHitlArmShapeMessage");
2488
- WORKFLOW_GRAPH_ENTRY_STEP_KINDS = Object.freeze({
2489
- agent: "agent",
2490
- tool: "tool",
2491
- workflow: "subrun",
2492
- step: "code",
2493
- mapping: "map",
2494
- sleep: "sleep",
2495
- sleepUntil: "sleepUntil",
2496
- parallel: null,
2497
- conditional: "branch",
2498
- foreach: "foreach",
2499
- loop: "loop",
2500
- approval: "approval",
2501
- waitForSignal: "signal"
2502
- });
2503
- WORKFLOW_ARM_ENTRY_STEP_KINDS = Object.freeze(Object.fromEntries(WORKFLOW_ARM_ENTRY_TYPES.map((t) => [
2504
- t,
2505
- WORKFLOW_GRAPH_ENTRY_STEP_KINDS[t]
2506
- ])));
2507
- WORKFLOW_BUDGET_MAX_DURATION_SECONDS = Object.freeze({
2508
- min: 60,
2509
- max: 2592e3
2510
- });
2511
2655
  WORKFLOW_GOAL_JUDGE_SELF = "$self";
2512
2656
  __name(workflowGoalJudgeKind, "workflowGoalJudgeKind");
2513
2657
  __name2(workflowGoalJudgeKind, "workflowGoalJudgeKind");
@@ -2712,7 +2856,36 @@ This text is who you are for this person. As you learn them, their name, their w
2712
2856
  "workflow.export.auto_pushed",
2713
2857
  "workflow.retention.restamped",
2714
2858
  "workflow.retention.reaped",
2715
- "workflow.run.schema_migrated"
2859
+ "workflow.run.schema_migrated",
2860
+ // --- per-step model selection (Workflow Model Selection plan 6.5 / Appendix C.4) ---
2861
+ /** A `PATCH /admin/orgs/:orgId/workflow-policy` that changed the `models` block (who, what moved). */
2862
+ "workflow.policy.models_changed",
2863
+ /** A step's invocation hopped to another leg of its class — `{from, to, reason}`, priced at the served model. */
2864
+ "workflow.step.model_fallback",
2865
+ // --- autonomy envelope (Workflow autonomy plan A1; research/consent-gates.md §H2) ---
2866
+ /**
2867
+ * A start the consent ladder would have PARKED was admitted by `workflowPolicy.autonomy` instead —
2868
+ * `WorkflowRunAutonomyAppliedPayload`. Deliberately NOT `workflow.run.gate_cleared`: nothing was
2869
+ * gated and nobody approved it, and conflating the two would make "who approved this run"
2870
+ * unanswerable for every run of either kind (§H2 "Audit").
2871
+ */
2872
+ "workflow.run.autonomy_applied",
2873
+ // --- run budget cap enforcement (Job-tier billing plan D4; BAC-677) ---
2874
+ /**
2875
+ * The audit twin of the `run.budget_exceeded` run event (WJB-B2a): the run overshot its
2876
+ * `budget.maxCredits` on its LAST step and completed anyway, `budget.exceeded: true`. The budget family
2877
+ * already mirrors run events here — `workflow.run.budget_parked` / `workflow.run.budget_raised` are the
2878
+ * twins of `run.budget_parked` / `run.budget_raised` — and an organisation reviewing what it was charged
2879
+ * needs the overshoot in the audit store beside the raise that preceded it, not only in the run's own
2880
+ * event stream.
2881
+ *
2882
+ * Declared with the run event rather than after it because the emitter port
2883
+ * (`WorkflowAuditPort.action`, typed `workflow.run.${string}`) does not check against this tuple: a name
2884
+ * that is NOT declared here is written to the audit store all the same and no compiler says so.
2885
+ * Declaring it is what makes the later emitter checkable. `workflow.run.budget_parked` is likewise
2886
+ * declared and not yet emitted.
2887
+ */
2888
+ "workflow.run.budget_exceeded"
2716
2889
  ];
2717
2890
  WORKFLOW_AUDIT_METADATA_MAX_BYTES = 4 * 1024;
2718
2891
  __name(isWorkflowAuditEvent, "isWorkflowAuditEvent");
@@ -3172,7 +3345,7 @@ function modelTemplateInvalidMessage(model, why) {
3172
3345
  return `model "${model.trim()}" is not a valid run-input-bound model placeholder \u2014 ${why}; the forms are \${initData.<path>} and \${initData.<path>|<provider/model default>}`;
3173
3346
  }
3174
3347
  function modelTemplateDefaultRequiredMessage(model) {
3175
- return `model "${model}" runs on the Job tier, so its placeholder needs a default \u2014 the harness / provider gates (harness:'claude-code' needs an Anthropic model) classify it at push; write ${model.replace(/\}$/, "|<provider/model>}")}`;
3348
+ return `model "${model}" runs on the Job tier, so its placeholder needs a default \u2014 the harness / provider gates (harness:'claude-code' needs an Anthropic model) classify it at push; write ${model.replace(/\}$/, "|<provider/model>}")} or a class reference (|class/fast, |class/balanced, |class/strong)`;
3176
3349
  }
3177
3350
  function staticModelPin(model) {
3178
3351
  if (typeof model !== "string") return void 0;
@@ -3764,6 +3937,21 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
3764
3937
  err("required-connection-unknown", `requiredConnections ${JSON.stringify(unknown)} are neither declared connections[].key values nor connections the owner can mount`, `${path3}.requiredConnections`, singleId(node));
3765
3938
  }
3766
3939
  }, "checkRequiredConnections");
3940
+ const jobClassifiablePin = /* @__PURE__ */ __name4((model) => {
3941
+ const pin = staticModelPin(model);
3942
+ const modelClass = modelClassOf(pin);
3943
+ if (modelClass === void 0) return pin;
3944
+ const codes = opts.classMap?.[modelClass];
3945
+ if (!codes) return void 0;
3946
+ const jobProviders = opts.policy?.jobProviders;
3947
+ for (const code of codes) {
3948
+ const p = classifyModelProvider(code);
3949
+ if (p === null) continue;
3950
+ if (jobProviders && !jobProviders.includes(p)) continue;
3951
+ return code;
3952
+ }
3953
+ return void 0;
3954
+ }, "jobClassifiablePin");
3767
3955
  const checkTier = /* @__PURE__ */ __name4((node, path3) => {
3768
3956
  const id = singleId(node);
3769
3957
  if (node.workspace && node.workspace !== "inherit" && node.tier !== void 0 && node.tier !== "job") {
@@ -3772,7 +3960,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
3772
3960
  if (node.harness !== void 0 && node.tier !== "job") {
3773
3961
  err("harness-requires-job-tier", "`harness` is only legal on a tier:'job' agent step", `${path3}.harness`, id);
3774
3962
  }
3775
- const provider = node.type === "agent" ? classifyModelProvider(staticModelPin(node.model)) : null;
3963
+ const provider = node.type === "agent" ? classifyModelProvider(jobClassifiablePin(node.model)) : null;
3776
3964
  if (node.harness === "claude-code" && provider !== null && provider !== "anthropic") {
3777
3965
  err("harness-provider-mismatch", `harness:'claude-code' needs an Anthropic model (model "${node.type === "agent" ? node.model : ""}" is ${provider})`, `${path3}.harness`, id);
3778
3966
  }
@@ -3796,6 +3984,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
3796
3984
  }
3797
3985
  const pin = parsed.kind === "template" ? parsed.template.default : node.model;
3798
3986
  if (pin === void 0) return;
3987
+ if (isModelClassRef(pin)) return;
3799
3988
  const inContext = /* @__PURE__ */ __name4((message) => parsed.kind === "template" ? `${message} (the default of ${parsed.template.placeholder})` : message, "inContext");
3800
3989
  const registry = opts.approvedModels;
3801
3990
  if (registry === void 0) return;
@@ -3809,6 +3998,12 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
3809
3998
  const resolved = normalizeModelId(pin, registry);
3810
3999
  if (!resolved.ok) err("model-unresolved", inContext(modelUnresolvedMessage(resolved)), `${path3}.model`, id);
3811
4000
  }, "checkModel");
4001
+ const checkTaskClass = /* @__PURE__ */ __name4((node, path3) => {
4002
+ if (node.type !== "agent" || node.taskClass === void 0) return;
4003
+ if (!opts.static) return;
4004
+ if (typeof node.model === "string" && node.model.trim()) return;
4005
+ err("task-class-without-model", `taskClass '${String(node.taskClass)}' needs a \`model\` on a pushed definition \u2014 write a class (model: 'class/fast' | 'class/balanced' | 'class/strong') or an approved provider/model code; nothing maps a task class to a model at dispatch, so a step with neither would run on the agent\u2019s own model`, `${path3}.taskClass`, singleId(node));
4006
+ }, "checkTaskClass");
3812
4007
  const checkWorkspace = /* @__PURE__ */ __name4((node, path3) => {
3813
4008
  const id = singleId(node);
3814
4009
  const ws = workspaceOf(node);
@@ -3895,6 +4090,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
3895
4090
  checkTimeout(node, path3);
3896
4091
  checkTier(node, path3);
3897
4092
  checkModel(node, path3);
4093
+ checkTaskClass(node, path3);
3898
4094
  checkRetry(node, path3);
3899
4095
  checkWorkspace(node, path3);
3900
4096
  if (!opts.static) {
@@ -6327,6 +6523,49 @@ function graphHasJobTierStep(envelopeOrGraph) {
6327
6523
  const graph = Array.isArray(envelopeOrGraph) ? envelopeOrGraph : env2.definition?.graph ?? [];
6328
6524
  return Array.isArray(graph) && graph.some(entryHasJobTier);
6329
6525
  }
6526
+ function jobTierSteps(envelopeOrGraph) {
6527
+ const out = [];
6528
+ if (!envelopeOrGraph || typeof envelopeOrGraph !== "object") return out;
6529
+ const env2 = envelopeOrGraph;
6530
+ const graph = Array.isArray(envelopeOrGraph) ? envelopeOrGraph : env2.definition?.graph ?? [];
6531
+ if (!Array.isArray(graph)) return out;
6532
+ for (const entry of graph) collectJobTierSteps(entry, out);
6533
+ return out;
6534
+ }
6535
+ function jobTierStepIds(envelopeOrGraph) {
6536
+ return jobTierSteps(envelopeOrGraph).map((s) => s.stepId);
6537
+ }
6538
+ function collectJobTierSteps(entry, out) {
6539
+ const n2 = armEntry2(entry);
6540
+ if (!n2 || typeof n2 !== "object") return;
6541
+ const node = n2;
6542
+ const ws = node.workspace;
6543
+ if (node.tier === "job" || ws !== void 0 && ws !== "inherit") {
6544
+ const stepId = typeof node.id === "string" && node.id ? node.id : "(unnamed)";
6545
+ const model = typeof node.model === "string" && node.model.trim() ? node.model.trim() : void 0;
6546
+ out.push(model === void 0 ? {
6547
+ stepId
6548
+ } : {
6549
+ stepId,
6550
+ model
6551
+ });
6552
+ }
6553
+ switch (node.type) {
6554
+ case "parallel":
6555
+ if (Array.isArray(node.steps)) for (const s of node.steps) collectJobTierSteps(s, out);
6556
+ return;
6557
+ case "conditional":
6558
+ if (Array.isArray(node.steps)) for (const s of node.steps) collectJobTierSteps(s, out);
6559
+ if (node.otherwise !== void 0) collectJobTierSteps(node.otherwise, out);
6560
+ return;
6561
+ case "foreach":
6562
+ case "loop":
6563
+ collectJobTierSteps(node.step, out);
6564
+ return;
6565
+ default:
6566
+ return;
6567
+ }
6568
+ }
6330
6569
  var __defProp4, __name4, WorkflowTemplateError, TEMPLATE_PLACEHOLDER, TEMPLATE_NAMESPACES, MAP_DESCRIPTOR_KEYS, MAP_MEMBER_MALFORMED_CODE, fromInit, fromStep, value, template, fromRequest, rows, fromKnowledge, SideEffectsSchema, JobResourcesSchema, WORKFLOW_MODEL_TEMPLATE_ROOT, WORKFLOW_MODEL_TEMPLATE_RE, PATH_SEGMENT_RE, APPROVER_SPEC_MAX_USERS, ESCALATION_MAX_HOPS, TemplateBindingSchema, ApproverSpecSchema, FourEyesSchema, EscalationHopSchema, TerminalOutcomeSchema, ApprovalOnTimeoutSchema, APPROVER_SPEC_SHAPES, APPROVER_WRITTEN_MAX, USER_ID_SHAPED_RE, BINDING_ROOTS, WORKSPACE_TEMPLATE_EXPR_RE, SLEEP_UNTIL_REPLACEMENT, WORKFLOW_CAPS_DEFAULT, WORKFLOW_STEP_DEFAULT_TIMEOUT_SECONDS, WORKFLOW_AGENT_DEFAULT_TIMEOUT_SECONDS, WORKFLOW_JOB_DEFAULT_TIMEOUT_SECONDS, WORKFLOW_FOREACH_DEFAULT_CONCURRENCY, WORKFLOW_FOREACH_DEFAULT_MAX_ITEMS, WORKFLOW_LOOP_DEFAULT_MAX_ITERATIONS, WORKFLOW_SUSPEND_DEFAULT_TIMEOUT_HOURS, WORKFLOW_SIGNAL_DEFAULT_SOURCES, clone, CONNECTION_ID_HEX_RE, WORKFLOW_JOB_MAX_WORKTREE_ARMS, workspaceOf, mountsWorkspace, isJobTier, jobToolsOf, schemaIsArray, isHitlNode, isSingleStep, singleId, armId, TEMPLATE_STEP_REF, EDITABLE_PATH_RE, PREDICATE_OPS, isPredicateScalar, GRAPH_HASH_PREFIX, WorkflowPlanError, isArmStep, armStepId, armStepKind, joinIdOf, containerIdOf, PATH_PLACEHOLDER, MISSING, stepIdOf, cmp, eq, ne, gt, gte, lt, lte, inSet, notIn, exists, notExists, truthy, falsy, and, or, not, CONTINUED_FAILURE_TAG, CONTINUED_FAILURE_DEFAULT_CODE, CONTINUED_FAILURE_OUTPUT_SCHEMA, CONTINUED_FAILURE_LEAF_PATHS, isHitlNode2, nodeIdOf, GOAL_JUDGE_STEP_ID, NON_LEAF_KINDS, CONDITIONAL_JOIN_ID, branchArmId, canonical, sortKeys, JOIN, entryOfJoin, FORCE_CANCEL_STALE_MS, TERMINAL, WORKFLOW_INLINE_RUN_TAG, RUN_ERROR_ISSUES_MAX, IN_FLIGHT, n, STEP_ERROR_DETAIL_KEYS, STEP_ERROR_DETAIL_MAX_BYTES, DETAIL_MAX_DEPTH, DETAIL_MAX_ITEMS, MAX_HOLIDAYS, MAX_WALK_DAYS, HHMM, YMD, MS_PER_MIN, MS_PER_DAY, MON_FRI, supportedTz, fmtCache, WEEKDAYS, JSON_PATCH_OPS, JSON_PATCH_MAX_OPS, JSON_PATCH_MAX_VALUE_BYTES, JSON_PATCH_MAX_TOTAL_BYTES, SEGMENT_RE, WORKFLOW_SCHEDULE_TYPES, WORKFLOW_SCHEDULE_SHAPE_ISSUE, WORKFLOW_SCHEDULE_SHAPES_HINT, WORKFLOW_SCHEDULE_RUN_AS, isObject, WORKFLOW_ENV_OVERLAY_MAX_KEYS, WORKFLOW_ENV_OVERLAY_MAX_VALUE_BYTES, WORKFLOW_ENV_TEMPLATE_SECRET_KEY_RE, isEnvRef, looksLikeEmbeddedJson, ZERO, isRecord2;
6331
6570
  var init_dist2 = __esm({
6332
6571
  "../workflow-graph/dist/index.mjs"() {
@@ -7131,6 +7370,12 @@ var init_dist2 = __esm({
7131
7370
  __name4(entryHasJobTier, "entryHasJobTier");
7132
7371
  __name(graphHasJobTierStep, "graphHasJobTierStep");
7133
7372
  __name4(graphHasJobTierStep, "graphHasJobTierStep");
7373
+ __name(jobTierSteps, "jobTierSteps");
7374
+ __name4(jobTierSteps, "jobTierSteps");
7375
+ __name(jobTierStepIds, "jobTierStepIds");
7376
+ __name4(jobTierStepIds, "jobTierStepIds");
7377
+ __name(collectJobTierSteps, "collectJobTierSteps");
7378
+ __name4(collectJobTierSteps, "collectJobTierSteps");
7134
7379
  }
7135
7380
  });
7136
7381
 
@@ -7461,6 +7706,10 @@ var init_workflow = __esm({
7461
7706
  maxDurationSeconds: cfg.budget?.maxDurationSeconds ?? (hitl ? WORKFLOW_HITL_MAX_DURATION_SECONDS : WORKFLOW_DEFAULT_MAX_DURATION_SECONDS)
7462
7707
  });
7463
7708
  const envelope = {
7709
+ // A plain build/push is ALWAYS marker 1 (plan 6.4's compatibility row: "a CLI test that a plain push of
7710
+ // such a definition stays at 1"). Moving a definition to 2 — the effort marker — is an explicit act
7711
+ // (`lua push --apply-effort`, or a new compose while assignment is on), never a side effect of the SDK
7712
+ // gaining an `effort` member.
7464
7713
  luaWorkflow: 1,
7465
7714
  budget,
7466
7715
  definition: defined({
@@ -7781,6 +8030,10 @@ var init_workflow = __esm({
7781
8030
  promptTemplate: templateText(opts.prompt),
7782
8031
  outputSchema: schemaToJson(opts.outputSchema),
7783
8032
  model: opts.model,
8033
+ taskClass: opts.taskClass,
8034
+ requires: opts.requires,
8035
+ modelReason: opts.modelReason,
8036
+ effort: opts.effort,
7784
8037
  toolScope: opts.toolScope,
7785
8038
  systemPrompt: opts.systemPrompt,
7786
8039
  timeoutSeconds: opts.timeoutSeconds,
@@ -14992,6 +15245,68 @@ var init_workflow_api_service = __esm({
14992
15245
  const qs = query.toString();
14993
15246
  return this.httpGet(`${this.runs}/${runId}/steps/${pathId(stepId)}/job${qs ? `?${qs}` : ""}`, await this.auth());
14994
15247
  }
15248
+ // ─── [WMC-E7] Per-step model selection (§6.5, §6.7) ───
15249
+ /**
15250
+ * §6.5 — the organization's workflow policy, `models` block included. The route is the organization's, not
15251
+ * the agent's, so the orgId comes from the project config rather than from `this.agentId`.
15252
+ */
15253
+ async getWorkflowPolicy(orgId, opts = {}) {
15254
+ const qs = opts.effective ? "?effective=true" : "";
15255
+ return this.httpGet(`/admin/orgs/${encodeURIComponent(orgId)}/workflow-policy${qs}`, await this.auth());
15256
+ }
15257
+ /**
15258
+ * §6.5 — PATCH the `models` block. Only the members the caller named are sent, so a `set` of one field
15259
+ * never clears the rest; the server validates against the organization's effective model set and refuses
15260
+ * with a code the CLI prints verbatim (a class with no eligible row, a cap the raise would exceed).
15261
+ */
15262
+ async patchWorkflowPolicyModels(orgId, models) {
15263
+ return this.httpPatch(`/admin/orgs/${encodeURIComponent(orgId)}/workflow-policy`, {
15264
+ models
15265
+ }, await this.auth());
15266
+ }
15267
+ // ─── [WMC-A6] Autonomy — the pre-consented envelope (research §H3) ───
15268
+ /**
15269
+ * PATCH the `autonomy` block of the ORGANIZATION's policy — the same R23 route the `models` block uses, and
15270
+ * a sibling of it in the body, so one PATCH never has to carry two blocks it did not mean to touch.
15271
+ *
15272
+ * A member sent as `null` is CLEARED (`--clear`); a member omitted is left exactly as it was. That
15273
+ * distinction is the route's, not the CLI's — which is why the patch type carries `null` rather than the CLI
15274
+ * collapsing it to an absent key on the way out.
15275
+ *
15276
+ * Every ceiling is the server's: `caps.maxCreditsPerRun`, the organization's own `models.consentActions` and
15277
+ * the platform's runs-per-hour env are all figures this client has never seen, so a value above one comes
15278
+ * back as a typed 400 and is printed verbatim.
15279
+ */
15280
+ async patchWorkflowPolicyAutonomy(orgId, autonomy) {
15281
+ return this.httpPatch(`/admin/orgs/${encodeURIComponent(orgId)}/workflow-policy`, {
15282
+ autonomy
15283
+ }, await this.auth());
15284
+ }
15285
+ /*
15286
+ * There is deliberately NO per-agent writer here. `SubAgentWorkflowSettings.autonomy` is read by
15287
+ * `effectiveWorkflowAutonomy`, but no HTTP surface writes it: `UpdateSubAgentRequestDto` has no
15288
+ * `workflows` member, so a PATCH carrying one is accepted and DISCARDED. A client method that posted a
15289
+ * narrowing into that hole would return 200 and change nothing, and the CLI would print a success line
15290
+ * over it — on a consent surface, a false confirmation is worse than a missing feature. The read half
15291
+ * already works: `?effective=true` shows a per-agent narrowing when the projection carries one.
15292
+ */
15293
+ /**
15294
+ * §6.5 — clear a run gate by kind. `model_policy` is the kind a class request that could not be resolved
15295
+ * parks on; the sweep clears it on its own when the switch returns, and this is the by-hand path.
15296
+ */
15297
+ async clearRunGate(runId, kind) {
15298
+ return this.httpPost(`${this.runs}/${runId}/clear-gate`, {
15299
+ kind
15300
+ }, await this.auth());
15301
+ }
15302
+ /**
15303
+ * §6.4 (Q19) — the deterministic rewrite of a dynamic parent's stored task classes into `class/<c>`.
15304
+ * Not a fresh model composition: the server rewrites and publishes a NEW version on the immutable parent,
15305
+ * and answers with it, so the CLI only has to print the version it got back.
15306
+ */
15307
+ async recomposeWorkflow(workflowId) {
15308
+ return this.httpPost(`${this.base}/${workflowId}/recompose`, {}, await this.auth());
15309
+ }
14995
15310
  };
14996
15311
  }
14997
15312
  });