lua-cli 3.35.0 → 3.36.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.
@@ -130,6 +130,35 @@ declare interface AgentInvocationInput {
130
130
  /** Per-request model override ("provider/model" code). Unknown codes fall back per
131
131
  * approved-models policy server-side. */
132
132
  model?: string;
133
+ /**
134
+ * Workflow model classes (plan 6.4 "Caller-supplied legs", C.7) — the ordered,
135
+ * concrete `'provider/model'` codes THIS turn may run, primary first. The worker
136
+ * computes them (the resolved class row plus the other eligible rows of the same
137
+ * class, filtered to the run's consented estimate); the chat plane uses them
138
+ * VERBATIM as the fallback-leg list instead of the registry chain, which is the
139
+ * only way a workflow step can hop a leg at all — the worker sees the terminal
140
+ * turn and cannot hop mid-turn because tool side effects happen inside it.
141
+ *
142
+ * A pin passes exactly one leg, which is how "never substitute a model inside a
143
+ * workflow" becomes true: no registry chain, no last-resort platform default.
144
+ *
145
+ * Honoured server-side ONLY on internally-authenticated turns and ONLY for
146
+ * `channel: 'workflow'` — same posture as `toolScope`: `buildChatRequest` drops a
147
+ * Bearer client's value, so no client of `/chat/generate` can steer which models
148
+ * its turn may run.
149
+ */
150
+ legs?: string[];
151
+ /**
152
+ * Workflow model classes (plan 6.4, the `effort` row) — the reasoning effort for
153
+ * THIS turn. Deliberately the narrow three-value ladder the composer writes, not
154
+ * the six-value `ReasoningEffort` scale: the worker can never push `off`,
155
+ * `minimal` or `max` through the invocation. Mapped identity-wise onto
156
+ * `ChatRequest.options.reasoning.effort` (low → low, medium → medium, high →
157
+ * high), clamped to the served row's own `efforts` ladder and translated into the
158
+ * provider's dialect at the model-resolution seam. Inert on toggle-only rows.
159
+ * The applied value comes back on `AgentInvocationMeter.effortApplied`.
160
+ */
161
+ effort?: 'low' | 'medium' | 'high';
133
162
  /**
134
163
  * LUA-655 (review M2) — a platform re-ask the customer must not pay for: the workflow executor's
135
164
  * output-repair turns. Honoured server-side ONLY on internally-authenticated turns
@@ -215,6 +244,16 @@ declare interface AgentInvocationMeter {
215
244
  toolNames?: string[];
216
245
  byok?: boolean;
217
246
  chargedCredits?: boolean;
247
+ /**
248
+ * Workflow model classes (plan 6.4, the `effort` row; round-2 architect finding 7) — the
249
+ * effort that was ACTUALLY applied to the turn: the request/agent/tier merge clamped to the
250
+ * SERVED model's `efforts` ladder, which is not always what was asked for (a row whose ladder
251
+ * omits `medium` serves `low`). Server-owned and stamped beside `model` on the same
252
+ * `operationId`-bearing loopback turns, so the worker can record it on the step row without a
253
+ * seventh hop of its own. Absent when no effort was in play (no requested effort, or a model
254
+ * that advertises no reasoning) — a non-effort turn's meter is byte-identical to today's.
255
+ */
256
+ effortApplied?: ReasoningEffort;
218
257
  }
219
258
 
220
259
  declare interface AgentInvocationOutput {
@@ -370,6 +409,30 @@ export declare interface AgentStepOptions {
370
409
  */
371
410
  maxMessages?: number;
372
411
  maxInputTokens?: number;
412
+ /**
413
+ * What this step DOES: `classify` | `extract` | `transform` | `draft` | `research` | `reason` | `code` |
414
+ * `judge`. On a PUSHED definition it must come with a `model` — a static `taskClass` with none is refused
415
+ * `task-class-without-model`, because nothing maps a task class to a model at dispatch.
416
+ */
417
+ taskClass?: WorkflowTaskClass;
418
+ /**
419
+ * Traits the chosen model must have: `vision` | `structured` | `largeContext` | `codeExecution`. Write these
420
+ * rather than pinning a code that may retire. A step with an `outputSchema` needs `structured`; one reading
421
+ * images needs `vision`.
422
+ */
423
+ requires?: WorkflowModelTrait[];
424
+ /** One line on why this class or pin was chosen — at most 160 characters, plain text, never parsed. */
425
+ modelReason?: string;
426
+ /**
427
+ * Reasoning effort for this step: `low` for fast work and tool-heavy orchestration, `high` for `reason` and
428
+ * `code`, `medium` otherwise. Inert on rows whose ladder is toggle-only.
429
+ *
430
+ * COMPATIBILITY: writing it changes nothing on its own. A plain `lua push` keeps the envelope at
431
+ * `luaWorkflow: 1`, and the executor forwards effort only when the run's frozen snapshot says 2 — opted into
432
+ * by `lua push --apply-effort` or by a new compose while assignment is on (plan 6.4, "The effort marker").
433
+ * Until then the value is carried and estimated, never applied.
434
+ */
435
+ effort?: WorkflowAgentEffort;
373
436
  }
374
437
 
375
438
  export declare interface AgentToolScope {
@@ -1394,6 +1457,52 @@ export declare type ChatMessage = TextMessage | ImageMessage | FileMessage;
1394
1457
  */
1395
1458
  export declare type ContainerArm = StepRef | [LuaMapConfig, StepRef];
1396
1459
 
1460
+ /**
1461
+ * Who is in the conversation this turn runs in.
1462
+ */
1463
+ export declare type ConversationKind = 'direct' | 'group';
1464
+
1465
+ export declare interface ConversationParticipant {
1466
+ /** Lua user id. For a Teams participant this is the user Lua minted for them. */
1467
+ userId: string;
1468
+ /** Server-resolved display name. */
1469
+ displayName: string;
1470
+ /** True for the room owner (desktop rooms); absent on channel rooms, which have no human owner. */
1471
+ isOwner?: boolean;
1472
+ /** True for the person who sent this turn. */
1473
+ isCurrentSpeaker?: boolean;
1474
+ /** How this person is known on the external channel (Teams group chats). */
1475
+ channelIdentity?: {
1476
+ provider: 'teams' | 'slack' | 'whatsapp';
1477
+ externalId: string;
1478
+ email?: string;
1479
+ };
1480
+ }
1481
+
1482
+ /**
1483
+ * The conversation a turn runs in. Present on group turns (a desktop room or a
1484
+ * Teams group chat); undefined on 1:1 chats, jobs, webhooks, triggers and
1485
+ * workflow steps.
1486
+ */
1487
+ export declare interface ConversationRef {
1488
+ /** The room conversation id (`room:<id>`). */
1489
+ id: string;
1490
+ kind: ConversationKind;
1491
+ channel: Channel;
1492
+ /** The provider's conversation id; pass it to `Channels.send({ to: { conversationId } })` to reply proactively. */
1493
+ externalId?: string;
1494
+ currentSpeakerId?: string;
1495
+ /** Capped at 50 entries, current speaker first; see `participantCount` and `truncated`. */
1496
+ participants: ConversationParticipant[];
1497
+ participantCount: number;
1498
+ truncated: boolean;
1499
+ /** The agents seated in the conversation. */
1500
+ agents?: Array<{
1501
+ agentId: string;
1502
+ name?: string;
1503
+ }>;
1504
+ }
1505
+
1397
1506
  /**
1398
1507
  * Options for creating a custom data entry.
1399
1508
  */
@@ -3056,6 +3165,13 @@ export declare const lte: (l: TypedRef<number> | number, r: TypedRef<number> | L
3056
3165
  * if (Lua.request.webhook) {
3057
3166
  * const payload = Lua.request.webhook.payload;
3058
3167
  * }
3168
+ *
3169
+ * // In a group conversation (a desktop room or a Teams group chat), see who is in it
3170
+ * const conversation = Lua.request.conversation;
3171
+ * if (conversation?.kind === 'group') {
3172
+ * const speaker = conversation.participants.find((p) => p.isCurrentSpeaker);
3173
+ * const others = conversation.participants.filter((p) => !p.isCurrentSpeaker).map((p) => p.displayName);
3174
+ * }
3059
3175
  * ```
3060
3176
  */
3061
3177
  export declare const Lua: LuaRuntime;
@@ -3618,6 +3734,11 @@ export declare interface LuaRequest {
3618
3734
  userId?: string;
3619
3735
  /** The id of the agent handling this turn. */
3620
3736
  agentId?: string;
3737
+ /**
3738
+ * The group conversation this turn belongs to, with its participants and the
3739
+ * current speaker. Undefined on 1:1 turns and on non-chat executions.
3740
+ */
3741
+ conversation?: ConversationRef;
3621
3742
  }
3622
3743
 
3623
3744
  /**
@@ -4017,13 +4138,13 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4017
4138
  }, "strip", z.ZodTypeAny, {
4018
4139
  provider?: "deepgram" | "elevenlabs";
4019
4140
  kind?: "plugin";
4020
- options?: Record<string, unknown>;
4021
4141
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4142
+ options?: Record<string, unknown>;
4022
4143
  }, {
4023
4144
  provider?: "deepgram" | "elevenlabs";
4024
4145
  kind?: "plugin";
4025
- options?: Record<string, unknown>;
4026
4146
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4147
+ options?: Record<string, unknown>;
4027
4148
  }>, z.ZodObject<{
4028
4149
  kind: z.ZodLiteral<"realtime">;
4029
4150
  provider: z.ZodEnum<["openai", "google", "xai"]>;
@@ -4083,13 +4204,13 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4083
4204
  }, "strip", z.ZodTypeAny, {
4084
4205
  provider?: "deepgram" | "elevenlabs";
4085
4206
  kind?: "plugin";
4086
- options?: Record<string, unknown>;
4087
4207
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4208
+ options?: Record<string, unknown>;
4088
4209
  }, {
4089
4210
  provider?: "deepgram" | "elevenlabs";
4090
4211
  kind?: "plugin";
4091
- options?: Record<string, unknown>;
4092
4212
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4213
+ options?: Record<string, unknown>;
4093
4214
  }>, z.ZodObject<{
4094
4215
  kind: z.ZodLiteral<"realtime">;
4095
4216
  provider: z.ZodEnum<["openai", "google", "xai"]>;
@@ -4149,13 +4270,13 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4149
4270
  }, "strip", z.ZodTypeAny, {
4150
4271
  provider?: "deepgram" | "elevenlabs";
4151
4272
  kind?: "plugin";
4152
- options?: Record<string, unknown>;
4153
4273
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4274
+ options?: Record<string, unknown>;
4154
4275
  }, {
4155
4276
  provider?: "deepgram" | "elevenlabs";
4156
4277
  kind?: "plugin";
4157
- options?: Record<string, unknown>;
4158
4278
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4279
+ options?: Record<string, unknown>;
4159
4280
  }>, z.ZodObject<{
4160
4281
  kind: z.ZodLiteral<"realtime">;
4161
4282
  provider: z.ZodEnum<["openai", "google", "xai"]>;
@@ -4341,8 +4462,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4341
4462
  } | {
4342
4463
  provider?: "deepgram" | "elevenlabs";
4343
4464
  kind?: "plugin";
4344
- options?: Record<string, unknown>;
4345
4465
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4466
+ options?: Record<string, unknown>;
4346
4467
  } | {
4347
4468
  provider?: "google" | "xai" | "openai";
4348
4469
  kind?: "realtime";
@@ -4357,8 +4478,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4357
4478
  } | {
4358
4479
  provider?: "deepgram" | "elevenlabs";
4359
4480
  kind?: "plugin";
4360
- options?: Record<string, unknown>;
4361
4481
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4482
+ options?: Record<string, unknown>;
4362
4483
  } | {
4363
4484
  provider?: "google" | "xai" | "openai";
4364
4485
  kind?: "realtime";
@@ -4372,8 +4493,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4372
4493
  } | {
4373
4494
  provider?: "deepgram" | "elevenlabs";
4374
4495
  kind?: "plugin";
4375
- options?: Record<string, unknown>;
4376
4496
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4497
+ options?: Record<string, unknown>;
4377
4498
  } | {
4378
4499
  provider?: "google" | "xai" | "openai";
4379
4500
  kind?: "realtime";
@@ -4435,8 +4556,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4435
4556
  } | {
4436
4557
  provider?: "deepgram" | "elevenlabs";
4437
4558
  kind?: "plugin";
4438
- options?: Record<string, unknown>;
4439
4559
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4560
+ options?: Record<string, unknown>;
4440
4561
  } | {
4441
4562
  provider?: "google" | "xai" | "openai";
4442
4563
  kind?: "realtime";
@@ -4451,8 +4572,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4451
4572
  } | {
4452
4573
  provider?: "deepgram" | "elevenlabs";
4453
4574
  kind?: "plugin";
4454
- options?: Record<string, unknown>;
4455
4575
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4576
+ options?: Record<string, unknown>;
4456
4577
  } | {
4457
4578
  provider?: "google" | "xai" | "openai";
4458
4579
  kind?: "realtime";
@@ -4466,8 +4587,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4466
4587
  } | {
4467
4588
  provider?: "deepgram" | "elevenlabs";
4468
4589
  kind?: "plugin";
4469
- options?: Record<string, unknown>;
4470
4590
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4591
+ options?: Record<string, unknown>;
4471
4592
  } | {
4472
4593
  provider?: "google" | "xai" | "openai";
4473
4594
  kind?: "realtime";
@@ -4529,8 +4650,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4529
4650
  } | {
4530
4651
  provider?: "deepgram" | "elevenlabs";
4531
4652
  kind?: "plugin";
4532
- options?: Record<string, unknown>;
4533
4653
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4654
+ options?: Record<string, unknown>;
4534
4655
  } | {
4535
4656
  provider?: "google" | "xai" | "openai";
4536
4657
  kind?: "realtime";
@@ -4545,8 +4666,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4545
4666
  } | {
4546
4667
  provider?: "deepgram" | "elevenlabs";
4547
4668
  kind?: "plugin";
4548
- options?: Record<string, unknown>;
4549
4669
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4670
+ options?: Record<string, unknown>;
4550
4671
  } | {
4551
4672
  provider?: "google" | "xai" | "openai";
4552
4673
  kind?: "realtime";
@@ -4560,8 +4681,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4560
4681
  } | {
4561
4682
  provider?: "deepgram" | "elevenlabs";
4562
4683
  kind?: "plugin";
4563
- options?: Record<string, unknown>;
4564
4684
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4685
+ options?: Record<string, unknown>;
4565
4686
  } | {
4566
4687
  provider?: "google" | "xai" | "openai";
4567
4688
  kind?: "realtime";
@@ -4623,8 +4744,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4623
4744
  } | {
4624
4745
  provider?: "deepgram" | "elevenlabs";
4625
4746
  kind?: "plugin";
4626
- options?: Record<string, unknown>;
4627
4747
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4748
+ options?: Record<string, unknown>;
4628
4749
  } | {
4629
4750
  provider?: "google" | "xai" | "openai";
4630
4751
  kind?: "realtime";
@@ -4639,8 +4760,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4639
4760
  } | {
4640
4761
  provider?: "deepgram" | "elevenlabs";
4641
4762
  kind?: "plugin";
4642
- options?: Record<string, unknown>;
4643
4763
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4764
+ options?: Record<string, unknown>;
4644
4765
  } | {
4645
4766
  provider?: "google" | "xai" | "openai";
4646
4767
  kind?: "realtime";
@@ -4654,8 +4775,8 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4654
4775
  } | {
4655
4776
  provider?: "deepgram" | "elevenlabs";
4656
4777
  kind?: "plugin";
4657
- options?: Record<string, unknown>;
4658
4778
  class?: "LLM" | "STT" | "STTv2" | "TTS";
4779
+ options?: Record<string, unknown>;
4659
4780
  } | {
4660
4781
  provider?: "google" | "xai" | "openai";
4661
4782
  kind?: "realtime";
@@ -6379,6 +6500,12 @@ declare interface StartWorkflowRunResult {
6379
6500
  /** ISO — the existing run's creation time. */
6380
6501
  startedAt?: string;
6381
6502
  output?: unknown;
6503
+ /**
6504
+ * [WMC-E7] §6.4 — the run's `modelConsent`, the SAME object the run detail carries, served with a `gated`
6505
+ * start so the person deciding sees the plan and the cost line at the moment they are asked. Absent on a
6506
+ * run that assigned no model and on every server that does not serve it.
6507
+ */
6508
+ modelConsent?: WorkflowModelConsentView;
6382
6509
  }
6383
6510
 
6384
6511
  export declare const state: <T = unknown>(path: string) => TypedRef<T>;
@@ -7230,6 +7357,9 @@ declare interface WhatsAppTemplateUrlButton {
7230
7357
  example?: string | string[];
7231
7358
  }
7232
7359
 
7360
+ /** `agent.effort` — the reasoning-effort hint a graph agent node may carry (lua-core's envelope member). */
7361
+ declare const WORKFLOW_AGENT_EFFORTS: readonly ["low", "medium", "high"];
7362
+
7233
7363
  /** `approval.onDeny` (§6.4.11 deny-as-data): `'fail'` fails the step on a denial; default `'continue'`. */
7234
7364
  declare const WORKFLOW_APPROVAL_ON_DENY: readonly ["fail", "continue"];
7235
7365
 
@@ -7239,6 +7369,13 @@ declare const WORKFLOW_JOB_HARNESSES: readonly ["claude-code", "generic"];
7239
7369
  /** `jobResources` (05 §5.17): the Job-tier pod size class. Default `'small'` at spawn. */
7240
7370
  declare const WORKFLOW_JOB_RESOURCES: readonly ["small", "medium", "large"];
7241
7371
 
7372
+ /**
7373
+ * Required traits — capabilities the chosen model MUST have (`AgentNode.requires`), so a composed step can
7374
+ * say "needs vision" without pinning a code that may retire. Derived from the catalog row's `media`,
7375
+ * `structuredOutput`, `contextWindow` and `tools.codeExecution` (plan 6.2).
7376
+ */
7377
+ declare const WORKFLOW_MODEL_TRAITS: readonly ["vision", "structured", "largeContext", "codeExecution"];
7378
+
7242
7379
  /** What the FINAL failure of a step does to the run: `'park'` → the §06 §6.3.5 exception gate. Default `'fail'`. */
7243
7380
  declare const WORKFLOW_ON_ERROR: readonly ["fail", "continue", "park"];
7244
7381
 
@@ -7251,9 +7388,18 @@ declare const WORKFLOW_SIDE_EFFECTS: readonly ["none", "external"];
7251
7388
  /** `waitForSignal.onTimeout`: default `'fail'`; `'continue'` ⇒ output `{received:false, timedOut:true}`. */
7252
7389
  declare const WORKFLOW_SIGNAL_ON_TIMEOUT: readonly ["fail", "continue"];
7253
7390
 
7391
+ /**
7392
+ * Task class — what a step DOES, the composer's primary output for model choice (`AgentNode.taskClass`).
7393
+ * The platform maps a task class to a model class (plan 6.3's default `classMap`; an org may override it),
7394
+ * so a composer never has to reason about concrete models. Eight values to start.
7395
+ */
7396
+ declare const WORKFLOW_TASK_CLASSES: readonly ["classify", "extract", "transform", "draft", "research", "reason", "code", "judge"];
7397
+
7254
7398
  /** The only tier a node may DECLARE (`tier:'job'`, implied by `workspace`); the worker tier is the absence. */
7255
7399
  declare const WORKFLOW_TIERS: readonly ["job"];
7256
7400
 
7401
+ declare type WorkflowAgentEffort = (typeof WORKFLOW_AGENT_EFFORTS)[number];
7402
+
7257
7403
  declare type WorkflowApprovalOnDeny = (typeof WORKFLOW_APPROVAL_ON_DENY)[number];
7258
7404
 
7259
7405
  export declare type WorkflowApproverSpec = 'creator' | 'org-admins' | {
@@ -7289,6 +7435,33 @@ export declare interface WorkflowArtefactMeta {
7289
7435
  };
7290
7436
  }
7291
7437
 
7438
+ /**
7439
+ * [WMC-A6] research §H2 — the organization's `autonomy` block: the pre-consented ENVELOPE inside which a
7440
+ * start that would have asked a person starts on its own instead (`ask → auto`).
7441
+ *
7442
+ * Every member is optional and absent means "the platform default applies". The CLI never fills one in and
7443
+ * never computes one: what a run is actually admitted under is `effectiveWorkflowAutonomy(policy, agent)`'s
7444
+ * answer, served back by `GET ?effective=true`, and the two are rendered side by side rather than merged
7445
+ * here — a CLI that guessed at the resolution would be a second source of truth for a price nobody consents
7446
+ * to twice.
7447
+ *
7448
+ * `enabled` is the one member whose absence is a VALUE rather than a platform default: absent ⇒ false. That
7449
+ * is deliberate (research §H2 — autonomy is the file's single opt-in default), so `get` words it as such.
7450
+ */
7451
+ declare interface WorkflowAutonomyEnvelopeDto {
7452
+ /** Absent ⇒ FALSE. The org opt-in; `enabled: false` on the agent or the platform switch still wins above it. */
7453
+ enabled?: boolean;
7454
+ maxCredits?: number;
7455
+ maxSteps?: number;
7456
+ /** Sized against the ladder's duration BOUND, not a wall (research §H2) — which is why the default is a day. */
7457
+ maxDurationSeconds?: number;
7458
+ /** The model overlay's estimated actions — the fourth ladder dimension (research §B4). */
7459
+ maxActions?: number;
7460
+ maxRunsPerHour?: number;
7461
+ /** The composition forms the envelope admits; `script` opts in. */
7462
+ forms?: string[];
7463
+ }
7464
+
7292
7465
  export declare interface WorkflowBusinessHours {
7293
7466
  tz: string;
7294
7467
  calendar?: 'mon-fri' | {
@@ -7376,6 +7549,43 @@ export declare interface WorkflowMergePolicy {
7376
7549
  onConflict: 'fail' | 'agent';
7377
7550
  }
7378
7551
 
7552
+ /**
7553
+ * [WMC-E7] §6.4 — the consent card, as the SERVER builds it.
7554
+ *
7555
+ * The twin of E6's `WorkflowRunDetail.modelConsent`, narrowed to what the CLI reads. `card` is the
7556
+ * already-rendered card and is printed verbatim; `plan` rides along for `--json` consumers and is never
7557
+ * re-rendered here. There is deliberately no CLI-side card shape and no CLI-side renderer: the number a
7558
+ * person consents to is worded once, by the projection, so the CLI, REST and the desktop cannot disagree.
7559
+ *
7560
+ * Absent on every run that assigned no model, which includes every run written before the change.
7561
+ */
7562
+ declare interface WorkflowModelConsentView {
7563
+ /** The structured plan behind the card. Passed through to `--json`; the CLI never renders from it. */
7564
+ plan?: {
7565
+ runName?: string;
7566
+ stepCount?: number;
7567
+ steps?: Array<{
7568
+ index?: number;
7569
+ stepId?: string;
7570
+ kind?: string;
7571
+ modelClass?: string;
7572
+ pin?: string;
7573
+ likelyModel?: string;
7574
+ effort?: string;
7575
+ reason?: string;
7576
+ }>;
7577
+ cost?: {
7578
+ actionsLowerBound?: number;
7579
+ agentModelActions?: number;
7580
+ unit?: 'actions' | 'credits';
7581
+ };
7582
+ };
7583
+ /** The rendered card, line by line. What `lua workflows start` prints, unchanged. */
7584
+ card?: string[];
7585
+ }
7586
+
7587
+ declare type WorkflowModelTrait = (typeof WORKFLOW_MODEL_TRAITS)[number];
7588
+
7379
7589
  declare type WorkflowOnError = (typeof WORKFLOW_ON_ERROR)[number];
7380
7590
 
7381
7591
  /**
@@ -7446,6 +7656,28 @@ declare interface WorkflowRun {
7446
7656
  * else `none`. Absent on an older server.
7447
7657
  */
7448
7658
  nextAction?: 'cancel_again' | 'force' | 'none' | 'raise_budget' | 'top_up';
7659
+ /**
7660
+ * [WMC-A6] The START's consent stamp, as A5 projects it (research §H2 "the consent stamp").
7661
+ *
7662
+ * `via` is the discriminator and it is what the CLI renders on: `'human'` is a person who cleared the
7663
+ * consent gate, `'autonomy'` is A3's pre-consented envelope (`approvedBy: 'system:policy'`). Absent on
7664
+ * every run started before the stamp existed, and on every server that does not project it — which is why
7665
+ * `via` is optional beside a `consent` that may be present with nothing else the CLI reads (D28: a run
7666
+ * with a stamp but no `via` prints no consent line rather than guessing at one).
7667
+ *
7668
+ * The union is left open (`| string`) on purpose, §6.9: a NEWER server may stamp a `via` this CLI has
7669
+ * never heard of, and an unknown member must fall through to "print nothing", never to a crash or to a
7670
+ * line worded as if it were one of the two known ones.
7671
+ */
7672
+ consent?: {
7673
+ approvedBy?: string;
7674
+ at?: number;
7675
+ /** The HITL approval link a human decision was recorded against. Optional since A2 — an autonomous start has none. */
7676
+ approvalLinkId?: string;
7677
+ via?: 'human' | 'autonomy' | string;
7678
+ /** The resolved envelope an `autonomy` start was admitted under — the numbers the line quotes. */
7679
+ envelope?: WorkflowAutonomyEnvelopeDto;
7680
+ };
7449
7681
  /**
7450
7682
  * The pending / audited cancel request (`runCancelView`): who asked and when; `wall` when it was the run wall's
7451
7683
  * own (LUA-686); LUA-704: `forcedBy` / `forcedAt` / `forceReason` on a forced terminal (`abandoned`, or
@@ -7502,6 +7734,12 @@ declare interface WorkflowRun {
7502
7734
  steps?: number;
7503
7735
  inputTokens?: number;
7504
7736
  outputTokens?: number;
7737
+ /**
7738
+ * [WMC-E7] §6.6 — the run's spend split by the model that actually served each call, present only once
7739
+ * the server projects it (a run that never reached an agent step, and every older server, omit it).
7740
+ * `lua workflows status` prints the roll-up when it is there and says nothing when it is not.
7741
+ */
7742
+ byModel?: WorkflowRunModelUsageRow[];
7505
7743
  };
7506
7744
  /**
7507
7745
  * R4: the run's caps and settled spend. `maxCredits` and `remaining` are both absent on an uncapped run (`0` = unset);
@@ -7526,6 +7764,26 @@ declare interface WorkflowRun {
7526
7764
  updatedAt: string;
7527
7765
  }
7528
7766
 
7767
+ /**
7768
+ * [WMC-E7] §6.6 — one row of `usage.byModel`: what a model was actually asked to do on this run and what it
7769
+ * cost. `model` is the SERVED code (canonicalised from the meter), which is not necessarily what the step
7770
+ * requested — a same-class hop is recorded here under the model that answered.
7771
+ */
7772
+ declare interface WorkflowRunModelUsageRow {
7773
+ /** The served model code, `provider/model`. */
7774
+ model: string;
7775
+ /** The model class it served for, when the step asked for one. */
7776
+ class?: string;
7777
+ /** Model calls served by this model on this run. */
7778
+ calls?: number;
7779
+ /** Priced actions on a seat plan. */
7780
+ actions?: number;
7781
+ /** Credits on the legacy plan. */
7782
+ credits?: number;
7783
+ /** Steps whose request this model answered because an earlier leg failed. */
7784
+ fallbacks?: number;
7785
+ }
7786
+
7529
7787
  /** §02 §2.4 run statuses (one union across every section). */
7530
7788
  declare type WorkflowRunStatus = 'queued' | 'running' | 'cancellation_requested' | 'gated' | 'suspended' | 'waiting' | 'completed' | 'failed' | 'cancelled' | 'abandoned' | 'timed_out';
7531
7789
 
@@ -7868,6 +8126,8 @@ export declare type WorkflowSuspendTimeoutChainMember = 'deny' | 'cancel-run' |
7868
8126
  timeoutHours: number;
7869
8127
  };
7870
8128
 
8129
+ declare type WorkflowTaskClass = (typeof WORKFLOW_TASK_CLASSES)[number];
8130
+
7871
8131
  declare type WorkflowTier = (typeof WORKFLOW_TIERS)[number];
7872
8132
 
7873
8133
  export declare type WorkflowWorkspaceBackend = 'ebs' | 'efs' | 's3';