lua-cli 3.39.4 → 3.41.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.
@@ -44,18 +44,6 @@ declare interface AgentInvocationEffects {
44
44
  blocker?: TaskRunBlocker;
45
45
  }
46
46
 
47
- /**
48
- * Wire-format input for sandbox `Agents.invoke` / `POST /chat/generate/:agentId`
49
- * when triggered programmatically by another agent/skill/tool.
50
- *
51
- * Intentionally a narrow, safe subset of the public `ChatMessageDto` — omits
52
- * sandbox-only overrides (`skillOverride`, `preprocessorOverride`, etc.),
53
- * navigation hints, and persona override.
54
- *
55
- * Either `prompt` or `messages` must be provided. When `prompt` is given, it is
56
- * converted into a single `{ role: 'user', content: [{ type: 'text', text: prompt }] }`
57
- * message downstream.
58
- */
59
47
  declare interface AgentInvocationInput {
60
48
  /** Shortcut: plain-text prompt. Mutually exclusive with `messages`. */
61
49
  prompt?: string;
@@ -364,6 +352,87 @@ export declare interface AgentsApi {
364
352
  * ```
365
353
  */
366
354
  invoke(targetAgentId: string, input: AgentInvocationInput): Promise<AgentInvocationOutput>;
355
+ /** Agents of your organization, with the supervision actions you hold on each. */
356
+ list(): Promise<SupervisedAgentSummary[]>;
357
+ /** One agent of your organization. */
358
+ get(agentId: string): Promise<SupervisedAgentSummary & {
359
+ personaVersion?: number;
360
+ }>;
361
+ /** Recent execution logs of a supervised agent (`supervision:observe`). No user ids; message bodies only with `supervision:observe-content`. */
362
+ logs(agentId: string, opts?: {
363
+ since?: string | number;
364
+ limit?: number;
365
+ level?: 'debug' | 'info' | 'warn' | 'error';
366
+ logSource?: string;
367
+ }): Promise<SupervisionLogRow[]>;
368
+ /** Workflow run metadata (no inputs/outputs) (`supervision:observe`). */
369
+ runs(agentId: string): {
370
+ list(opts?: {
371
+ limit?: number;
372
+ status?: string;
373
+ workflowId?: string;
374
+ }): Promise<SupervisionRunSummary[]>;
375
+ get(runId: string): Promise<SupervisionRunSummary>;
376
+ };
377
+ /** Read-only Data — only the collections the org admin named on the grant (`supervision:observe`). */
378
+ data(agentId: string): {
379
+ get(collection: string, entryId: string): Promise<unknown>;
380
+ query(collection: string, filter?: Record<string, unknown>, opts?: {
381
+ page?: number;
382
+ limit?: number;
383
+ }): Promise<unknown>;
384
+ };
385
+ versions(agentId: string): {
386
+ list(opts?: {
387
+ limit?: number;
388
+ }): Promise<unknown>;
389
+ get(version: number): Promise<unknown>;
390
+ diff(from: number, to: number): Promise<unknown>;
391
+ /** Chat staged `version` (`supervision:preview`). No tools run unless `toolScope.skillIds` allowlists them. */
392
+ preview(version: number, prompt: string, opts?: {
393
+ toolScope?: {
394
+ skillIds?: string[];
395
+ };
396
+ }): Promise<{
397
+ version: number;
398
+ text: string;
399
+ toolsUsed: string[];
400
+ finishReason?: string;
401
+ }>;
402
+ /**
403
+ * Make `version` live (`supervision:release`; only from a workflow step whose workflow the grant names).
404
+ * Compare-and-swap: refused (409 `PROMOTE_CONFLICT`) unless `expectActive` is the live version.
405
+ */
406
+ promote(version: number, opts: {
407
+ expectActive: number | null;
408
+ }): Promise<unknown>;
409
+ };
410
+ persona(agentId: string): {
411
+ versions(): Promise<unknown>;
412
+ /** Serve persona `version` (`supervision:release`). CAS on the served persona version. */
413
+ activate(version: number, opts: {
414
+ expectActive: number | null;
415
+ }): Promise<unknown>;
416
+ };
417
+ /** The source backup (`supervision:observe`). */
418
+ source(agentId: string): {
419
+ list(): Promise<{
420
+ files: {
421
+ path: string;
422
+ size?: number;
423
+ }[];
424
+ }>;
425
+ get(path: string): Promise<{
426
+ path: string;
427
+ content: string;
428
+ }>;
429
+ };
430
+ /** Environment variable NAMES only — values are never returned (`supervision:observe`). */
431
+ env(agentId: string): {
432
+ keys(): Promise<{
433
+ keys: string[];
434
+ }>;
435
+ };
367
436
  }
368
437
 
369
438
  export declare interface AgentStepOptions {
@@ -396,6 +465,23 @@ export declare interface AgentStepOptions {
396
465
  */
397
466
  maxMessages?: number;
398
467
  maxInputTokens?: number;
468
+ /**
469
+ * Claude Code plugins a tier:'job' coding turn loads (EM-WS3). Platform allowlist only — today
470
+ * `'lua-agent-builder'` (the lua-cli playbooks). Needs the claude-code harness (an Anthropic model) and the `shell`
471
+ * job tool; the turn then reaches the Lua API through a platform proxy pinned to THIS workflow's agent that allows
472
+ * staging only (compile, push of skills/jobs/webhooks/triggers/processors/backup, `version create`, status, logs)
473
+ * and refuses every deploy, promote, publish, activate, env, chat and runtime call.
474
+ */
475
+ plugins?: WorkflowJobPluginId[];
476
+ /**
477
+ * EM-WS3: pin a plugin step's Lua-API proxy (and its key) to ANOTHER agent instead of this workflow's own. Legal only
478
+ * beside `plugins`. Refused at run time (`target_not_granted`) unless the platform's plugin-target switch is on AND
479
+ * this workflow's agent holds a `supervision:act` or `supervision:release` grant on the target. EM-WS3 × EM-WS2: the
480
+ * id may be `template('${initData.<path>}')`, rendered from the run input at dispatch (a per-run target).
481
+ */
482
+ target?: {
483
+ agentId: string | TemplateBinding;
484
+ };
399
485
  /**
400
486
  * What this step DOES: `classify` | `extract` | `transform` | `draft` | `research` | `reason` | `code` |
401
487
  * `judge`. On a PUSHED definition it must come with a `model` — a static `taskClass` with none is refused
@@ -1913,7 +1999,9 @@ export declare function defineDeviceTrigger(config: LuaDeviceTriggerConfig): Lua
1913
1999
  * });
1914
2000
  * ```
1915
2001
  */
1916
- export declare function defineTrigger<T = any>(config: LuaTriggerConfig<T>): LuaTrigger<T>;
2002
+ export declare function defineTrigger<S extends ZodType = ZodType<any>>(config: Omit<LuaTriggerConfig<z.infer<S>>, 'inputSchema'> & {
2003
+ inputSchema?: S;
2004
+ }): LuaTrigger<z.infer<S>>;
1917
2005
 
1918
2006
  /**
1919
2007
  * Function-style LuaVoice definition. Equivalent to `new LuaVoice(config)`,
@@ -2445,8 +2533,8 @@ declare abstract class HttpClient {
2445
2533
  * Use this only when a successful response contains a one-time secret that
2446
2534
  * cannot be recovered after an ambiguous network or server failure.
2447
2535
  */
2448
- protected httpPostOnce<T>(url: string, data?: any, headers?: Record<string, string>): Promise<ApiResponse<T>>;
2449
- protected httpPostCoreDrainRetry<T>(url: string, data?: any, headers?: Record<string, string>): Promise<ApiResponse<T>>;
2536
+ protected httpPostOnce<T>(url: string, data?: any, headers?: Record<string, string>, overrides?: RequestOverrides): Promise<ApiResponse<T>>;
2537
+ protected httpPostCoreDrainRetry<T>(url: string, data?: any, headers?: Record<string, string>, overrides?: RequestOverrides): Promise<ApiResponse<T>>;
2450
2538
  /**
2451
2539
  * Performs an HTTP PUT request
2452
2540
  * @param url - The relative URL path to request (will be appended to baseUrl)
@@ -2678,6 +2766,26 @@ export declare interface IntegrationsApi {
2678
2766
  passthrough(integrationType: string, request: IntegrationPassthroughRequest): Promise<IntegrationPassthroughResponse>;
2679
2767
  }
2680
2768
 
2769
+ /**
2770
+ * Who invoked this turn, when another agent created it through `Agents.invoke`.
2771
+ * Verified server-side from the invocation token; never caller-supplied.
2772
+ *
2773
+ * Treat any turn that carries `invokedBy` as agent-initiated: a mutating tool
2774
+ * should refuse it unless `supervisor` is true (the caller holds `supervision:act`
2775
+ * on this agent) and the tool's own supervisor allowlist admits the change. A
2776
+ * `delegatedUserId` NEVER grants owner rights.
2777
+ */
2778
+ export declare interface InvokedBy {
2779
+ /** The calling agent's id. */
2780
+ agentId: string;
2781
+ /** True only when an org admin granted the caller `supervision:act` on this agent. */
2782
+ supervisor: boolean;
2783
+ /** The caller's supervision scopes on this agent (e.g. `supervision:act`); `[]` on preview turns. */
2784
+ scopes: string[];
2785
+ /** Set when the caller passed `input.userId` to `Agents.invoke` (a delegated turn). */
2786
+ delegatedUserId?: string;
2787
+ }
2788
+
2681
2789
  /**
2682
2790
  * Job with versions array
2683
2791
  * Matches JobDto and job.schema.ts
@@ -3295,6 +3403,7 @@ export declare class LuaAgent {
3295
3403
  private readonly triggers;
3296
3404
  private readonly jobs;
3297
3405
  private readonly workflows;
3406
+ private readonly webApps;
3298
3407
  private readonly preProcessors;
3299
3408
  private readonly postProcessors;
3300
3409
  private readonly mcpServers;
@@ -3334,6 +3443,7 @@ export declare class LuaAgent {
3334
3443
  getTriggers(): LuaTrigger[];
3335
3444
  getJobs(): LuaJob[];
3336
3445
  getWorkflows(): LuaWorkflow[];
3446
+ getWebApps(): LuaWebApp[];
3337
3447
  getPreProcessors(): PreProcessor[];
3338
3448
  getPostProcessors(): PostProcessor[];
3339
3449
  getMCPServers(): LuaMCPServer[];
@@ -3378,6 +3488,8 @@ export declare interface LuaAgentConfig {
3378
3488
  jobs?: LuaJob[];
3379
3489
  /** Array of workflows (createWorkflow / defineWorkflow) — 03 §3.1; resolved by the compiler traverser, dropped from the agent bundle */
3380
3490
  workflows?: LuaWorkflow[];
3491
+ /** Web apps (defineWebApp) opened from Lua Workspace and the admin console; pushed with `lua push webapp` */
3492
+ webApps?: LuaWebApp[];
3381
3493
  /** Array of preprocessors (run before messages reach the agent) */
3382
3494
  preProcessors?: PreProcessor[];
3383
3495
  /** Array of postprocessors (run after agent generates responses) */
@@ -3625,6 +3737,7 @@ export declare class LuaJob {
3625
3737
  private readonly timeout;
3626
3738
  private readonly retry?;
3627
3739
  private readonly metadata?;
3740
+ private readonly health?;
3628
3741
  private readonly executeFunction;
3629
3742
  /**
3630
3743
  * Creates a new LuaJob instance.
@@ -3666,6 +3779,10 @@ export declare class LuaJob {
3666
3779
  * Gets the job metadata.
3667
3780
  */
3668
3781
  getMetadata(): Record<string, any> | undefined;
3782
+ /**
3783
+ * Gets the schedule-health declaration (EM-WS10), if any.
3784
+ */
3785
+ getHealth(): ScheduleHealthConfig | undefined;
3669
3786
  /**
3670
3787
  * Executes the job with the provided job instance.
3671
3788
  * @param job - Job instance with metadata and context
@@ -3703,6 +3820,16 @@ export declare interface LuaJobConfig {
3703
3820
  * Sent to server and accessible during execution.
3704
3821
  */
3705
3822
  metadata?: Record<string, any>;
3823
+ /**
3824
+ * Schedule health — a dead-man for this job, watched by the platform. The job's owner (its creator, else the
3825
+ * org admins) gets ONE notice per incident — inbox card plus `notify` ('app' push, 'email', or 'emailApp', the
3826
+ * default) — when, while the job is active:
3827
+ * - `maxSilenceMinutes` (5..43200): no run has completed successfully for that long (needs a recurring schedule);
3828
+ * - `alertAfterConsecutiveFailures` (1..50): that many runs failed in a row;
3829
+ * and the notice resolves in place when the job is healthy again. Every transition is also an agent log line, so
3830
+ * a log drain routes it to Better Stack / Datadog. Takes effect when the version is published.
3831
+ */
3832
+ health?: ScheduleHealthConfig;
3706
3833
  }
3707
3834
 
3708
3835
  /**
@@ -3864,6 +3991,12 @@ export declare interface LuaRequest {
3864
3991
  * current speaker. Undefined on 1:1 turns and on non-chat executions.
3865
3992
  */
3866
3993
  conversation?: ConversationRef;
3994
+ /**
3995
+ * Present only when ANOTHER agent created this turn via `Agents.invoke`
3996
+ * (absent on user, channel, job, webhook and self-invoked turns, and offline in
3997
+ * `lua test`). Read it defensively — older runtimes do not set it.
3998
+ */
3999
+ invokedBy?: InvokedBy;
3867
4000
  }
3868
4001
 
3869
4002
  /**
@@ -4113,7 +4246,9 @@ export declare interface LuaTriggerConfig<T = any> {
4113
4246
  * compiler carries it into the trigger version as declared metadata.
4114
4247
  * `input` maps the trigger context to the tool's arguments and runs in the
4115
4248
  * same server-side slot sandbox (15s budget shared with verify/filter) —
4116
- * it CANNOT call platform APIs. Omit `input` to execute with `{}`.
4249
+ * it CAN call platform APIs (Data, Products, Baskets, Orders, User, AI,
4250
+ * Agents, Jobs, …), same as a tool or webhook, since all three build their
4251
+ * VM context through the same sandbox factory. Omit `input` to execute with `{}`.
4117
4252
  *
4118
4253
  * Declaring BOTH `tool` and `transform` runs the tool; the transform is
4119
4254
  * ignored (the compiler warns). Approval-gated tools are refused server-
@@ -4163,8 +4298,8 @@ export declare class LuaVoice {
4163
4298
  readonly name: string;
4164
4299
  readonly description?: string;
4165
4300
  readonly llm: LuaVoiceModelInput;
4166
- readonly stt: LuaVoiceModelInput;
4167
- readonly tts: LuaVoiceModelInput;
4301
+ readonly stt?: LuaVoiceModelInput;
4302
+ readonly tts?: LuaVoiceModelInput;
4168
4303
  readonly vad: LuaVoiceConfig_2['vad'];
4169
4304
  readonly vadOptions: LuaVoiceConfig_2['vadOptions'];
4170
4305
  readonly turnDetection: LuaVoiceConfig_2['turnDetection'];
@@ -4191,11 +4326,22 @@ export declare class LuaVoice {
4191
4326
  * pass either a string descriptor or a plugin class instance. The wire schema
4192
4327
  * (validated server-side) is the discriminated union in `@lua/shared-types`;
4193
4328
  * the compiler is what bridges the two.
4194
- */
4195
- export declare interface LuaVoiceConfig extends Omit<LuaVoiceConfig_2, 'llm' | 'stt' | 'tts'> {
4329
+ *
4330
+ * `stt`/`tts` are unconditionally optional here at the type level — a
4331
+ * realtime `llm` legitimately omits both. The realtime-vs-cascaded
4332
+ * requirement (cascaded needs both) is enforced by the compiler's zod
4333
+ * `superRefine` in `@lua/shared-types`, not by this type. `name` is
4334
+ * deliberately required here (unlike `@lua/shared-types`'s wire schema,
4335
+ * which leaves it optional for its own unrelated server-side
4336
+ * placeholder-name use case) since the `LuaVoice` constructor throws
4337
+ * without it and a nameless voice is otherwise silently dropped from the
4338
+ * compiled manifest.
4339
+ */
4340
+ export declare interface LuaVoiceConfig extends Omit<LuaVoiceConfig_2, 'llm' | 'stt' | 'tts' | 'name'> {
4341
+ name: string;
4196
4342
  llm: LuaVoiceModelInput;
4197
- stt: LuaVoiceModelInput;
4198
- tts: LuaVoiceModelInput;
4343
+ stt?: LuaVoiceModelInput;
4344
+ tts?: LuaVoiceModelInput;
4199
4345
  /** Optional human-readable description (surfaced in manifest + admin listings). */
4200
4346
  description?: string;
4201
4347
  /** Voice-only tools, in addition to skills attached to the owning agent. */
@@ -4261,14 +4407,14 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4261
4407
  */
4262
4408
  options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4263
4409
  }, "strip", z.ZodTypeAny, {
4264
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4265
4410
  provider?: "deepgram" | "elevenlabs";
4266
4411
  kind?: "plugin";
4412
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4267
4413
  options?: Record<string, unknown>;
4268
4414
  }, {
4269
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4270
4415
  provider?: "deepgram" | "elevenlabs";
4271
4416
  kind?: "plugin";
4417
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4272
4418
  options?: Record<string, unknown>;
4273
4419
  }>, z.ZodObject<{
4274
4420
  kind: z.ZodLiteral<"realtime">;
@@ -4327,14 +4473,14 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4327
4473
  */
4328
4474
  options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4329
4475
  }, "strip", z.ZodTypeAny, {
4330
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4331
4476
  provider?: "deepgram" | "elevenlabs";
4332
4477
  kind?: "plugin";
4478
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4333
4479
  options?: Record<string, unknown>;
4334
4480
  }, {
4335
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4336
4481
  provider?: "deepgram" | "elevenlabs";
4337
4482
  kind?: "plugin";
4483
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4338
4484
  options?: Record<string, unknown>;
4339
4485
  }>, z.ZodObject<{
4340
4486
  kind: z.ZodLiteral<"realtime">;
@@ -4393,14 +4539,14 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4393
4539
  */
4394
4540
  options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4395
4541
  }, "strip", z.ZodTypeAny, {
4396
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4397
4542
  provider?: "deepgram" | "elevenlabs";
4398
4543
  kind?: "plugin";
4544
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4399
4545
  options?: Record<string, unknown>;
4400
4546
  }, {
4401
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4402
4547
  provider?: "deepgram" | "elevenlabs";
4403
4548
  kind?: "plugin";
4549
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4404
4550
  options?: Record<string, unknown>;
4405
4551
  }>, z.ZodObject<{
4406
4552
  kind: z.ZodLiteral<"realtime">;
@@ -4585,9 +4731,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4585
4731
  options?: Record<string, unknown>;
4586
4732
  model?: string;
4587
4733
  } | {
4588
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4589
4734
  provider?: "deepgram" | "elevenlabs";
4590
4735
  kind?: "plugin";
4736
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4591
4737
  options?: Record<string, unknown>;
4592
4738
  } | {
4593
4739
  provider?: "google" | "xai" | "openai";
@@ -4601,9 +4747,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4601
4747
  options?: Record<string, unknown>;
4602
4748
  model?: string;
4603
4749
  } | {
4604
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4605
4750
  provider?: "deepgram" | "elevenlabs";
4606
4751
  kind?: "plugin";
4752
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4607
4753
  options?: Record<string, unknown>;
4608
4754
  } | {
4609
4755
  provider?: "google" | "xai" | "openai";
@@ -4616,9 +4762,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4616
4762
  options?: Record<string, unknown>;
4617
4763
  model?: string;
4618
4764
  } | {
4619
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4620
4765
  provider?: "deepgram" | "elevenlabs";
4621
4766
  kind?: "plugin";
4767
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4622
4768
  options?: Record<string, unknown>;
4623
4769
  } | {
4624
4770
  provider?: "google" | "xai" | "openai";
@@ -4679,9 +4825,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4679
4825
  options?: Record<string, unknown>;
4680
4826
  model?: string;
4681
4827
  } | {
4682
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4683
4828
  provider?: "deepgram" | "elevenlabs";
4684
4829
  kind?: "plugin";
4830
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4685
4831
  options?: Record<string, unknown>;
4686
4832
  } | {
4687
4833
  provider?: "google" | "xai" | "openai";
@@ -4695,9 +4841,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4695
4841
  options?: Record<string, unknown>;
4696
4842
  model?: string;
4697
4843
  } | {
4698
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4699
4844
  provider?: "deepgram" | "elevenlabs";
4700
4845
  kind?: "plugin";
4846
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4701
4847
  options?: Record<string, unknown>;
4702
4848
  } | {
4703
4849
  provider?: "google" | "xai" | "openai";
@@ -4710,9 +4856,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4710
4856
  options?: Record<string, unknown>;
4711
4857
  model?: string;
4712
4858
  } | {
4713
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4714
4859
  provider?: "deepgram" | "elevenlabs";
4715
4860
  kind?: "plugin";
4861
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4716
4862
  options?: Record<string, unknown>;
4717
4863
  } | {
4718
4864
  provider?: "google" | "xai" | "openai";
@@ -4773,9 +4919,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4773
4919
  options?: Record<string, unknown>;
4774
4920
  model?: string;
4775
4921
  } | {
4776
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4777
4922
  provider?: "deepgram" | "elevenlabs";
4778
4923
  kind?: "plugin";
4924
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4779
4925
  options?: Record<string, unknown>;
4780
4926
  } | {
4781
4927
  provider?: "google" | "xai" | "openai";
@@ -4789,9 +4935,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4789
4935
  options?: Record<string, unknown>;
4790
4936
  model?: string;
4791
4937
  } | {
4792
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4793
4938
  provider?: "deepgram" | "elevenlabs";
4794
4939
  kind?: "plugin";
4940
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4795
4941
  options?: Record<string, unknown>;
4796
4942
  } | {
4797
4943
  provider?: "google" | "xai" | "openai";
@@ -4804,9 +4950,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4804
4950
  options?: Record<string, unknown>;
4805
4951
  model?: string;
4806
4952
  } | {
4807
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4808
4953
  provider?: "deepgram" | "elevenlabs";
4809
4954
  kind?: "plugin";
4955
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4810
4956
  options?: Record<string, unknown>;
4811
4957
  } | {
4812
4958
  provider?: "google" | "xai" | "openai";
@@ -4867,9 +5013,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4867
5013
  options?: Record<string, unknown>;
4868
5014
  model?: string;
4869
5015
  } | {
4870
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4871
5016
  provider?: "deepgram" | "elevenlabs";
4872
5017
  kind?: "plugin";
5018
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4873
5019
  options?: Record<string, unknown>;
4874
5020
  } | {
4875
5021
  provider?: "google" | "xai" | "openai";
@@ -4883,9 +5029,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4883
5029
  options?: Record<string, unknown>;
4884
5030
  model?: string;
4885
5031
  } | {
4886
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4887
5032
  provider?: "deepgram" | "elevenlabs";
4888
5033
  kind?: "plugin";
5034
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4889
5035
  options?: Record<string, unknown>;
4890
5036
  } | {
4891
5037
  provider?: "google" | "xai" | "openai";
@@ -4898,9 +5044,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
4898
5044
  options?: Record<string, unknown>;
4899
5045
  model?: string;
4900
5046
  } | {
4901
- class?: "LLM" | "STT" | "STTv2" | "TTS";
4902
5047
  provider?: "deepgram" | "elevenlabs";
4903
5048
  kind?: "plugin";
5049
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
4904
5050
  options?: Record<string, unknown>;
4905
5051
  } | {
4906
5052
  provider?: "google" | "xai" | "openai";
@@ -5325,7 +5471,9 @@ export declare type LuaWorkflowBuildCode = 'duplicate-step-id' | 'unknown-step-r
5325
5471
  * verdict (deferred for an inherit child, 03 §3.1 table). Kept for one minor so a consumer switching on the union still
5326
5472
  * compiles; removed in the next.
5327
5473
  */
5328
- | 'workspace-not-declared' | 'workspace-inherit-without-parent-workspace' | 'workspace-inherit-conflict' | 'harness-requires-job-tier' | 'max-turns-requires-job-tier' | 'max-turns-invalid' | 'cap-exceeded' | 'chunk-size-invalid' | 'rate-limit-invalid' | 'backoff-invalid' | 'loop-interval-out-of-range' | 'mapping-placement' | 'container-arm-empty'
5474
+ | 'workspace-not-declared' | 'workspace-inherit-without-parent-workspace' | 'workspace-inherit-conflict' | 'harness-requires-job-tier' | 'max-turns-requires-job-tier' | 'max-turns-invalid'
5475
+ /** EM-WS3: a step's `plugins` outside the allowlist, repeated, or off the Job tier. */
5476
+ | 'plugins-invalid' | 'target-invalid' | 'lua-api-invalid' | 'cap-exceeded' | 'chunk-size-invalid' | 'rate-limit-invalid' | 'backoff-invalid' | 'loop-interval-out-of-range' | 'mapping-placement' | 'container-arm-empty'
5329
5477
  /**
5330
5478
  * @deprecated LUA-684 — the builder no longer throws it: an `approval` / `waitForSignal` IS a container arm
5331
5479
  * (`parallel(['approve', …])`). Where the engine cannot run one — a `loop` body, the step of a `[map, step]`
@@ -5431,6 +5579,18 @@ export declare interface LuaWorkflowConfig {
5431
5579
  backfillOnEnable?: {
5432
5580
  maxOccurrences?: number;
5433
5581
  };
5582
+ /**
5583
+ * Schedule health — a dead-man for this schedule, watched by the platform (no heartbeat service to wire up).
5584
+ * The agent's owner (the schedule's creator, else the org admins) gets ONE notice per incident — inbox card plus
5585
+ * `notify` ('app' push, 'email', or 'emailApp', the default) — when, while the schedule is active:
5586
+ * - `maxSilenceMinutes` (5..43200): no scheduled run has COMPLETED successfully for that long;
5587
+ * - `alertAfterConsecutiveFailures` (1..3): that many scheduled runs failed in a row (the platform turns a
5588
+ * schedule off after 3, which always alerts);
5589
+ * and the notice resolves in place when the schedule is healthy again. Every transition is also an agent log
5590
+ * line (`lua logs`), so a log drain routes it to Better Stack / Datadog. Needs `schedule`; silence needs a
5591
+ * recurring one. See docs/workflows/schedule-health.md.
5592
+ */
5593
+ health?: ScheduleHealthConfig;
5434
5594
  /** Literal JSON passed as run input on every scheduled fire; must validate against `inputSchema` (P0-5e). */
5435
5595
  scheduleInput?: Record<string, unknown>;
5436
5596
  goal?: WorkflowGoalEnvelope;
@@ -5462,6 +5622,21 @@ export declare interface LuaWorkflowStep<TIn extends ZodType = ZodType, TOut ext
5462
5622
  workspace?: WorkflowStepWorkspace;
5463
5623
  jobResources?: WorkflowJobResources;
5464
5624
  jobTools?: WorkflowJobToolId[];
5625
+ /**
5626
+ * EM-WS3 × EM-WS2: let this `tier:'job'` step run `lua` (`ctx.exec('lua', [...])`, `` ctx.$`lua push …` ``) against the
5627
+ * Lua API through the platform's staging-only proxy, with a short-lived key for ONE agent: this workflow's agent, or
5628
+ * `target`. It is the same proxy and the same deny rules as a plugin agent step: deploy, promote, publish,
5629
+ * activate, env, chat and runtime calls are refused.
5630
+ */
5631
+ luaApi?: true;
5632
+ /**
5633
+ * EM-WS3: pin the `luaApi` proxy (and its key) to ANOTHER agent. The id may be static or
5634
+ * `template('${initData.<path>}')`, rendered from the run input at dispatch. The same flag and supervision-grant
5635
+ * rules apply as on a plugin agent step.
5636
+ */
5637
+ target?: {
5638
+ agentId: string | TemplateBinding;
5639
+ };
5465
5640
  /** default { maxAttempts: 1 } */
5466
5641
  retry?: RetryPolicy;
5467
5642
  /** default 'none'; 'external' ⇒ park on platform-fault reclaim. */
@@ -5483,6 +5658,8 @@ export { MapDescriptor }
5483
5658
  export declare interface MCPServerBaseConfig {
5484
5659
  /** Unique identifier for this MCP server */
5485
5660
  name: string;
5661
+ /** Optional description of this MCP server */
5662
+ description?: string;
5486
5663
  /** Optional timeout in milliseconds (default: 60000) */
5487
5664
  timeout?: number;
5488
5665
  }
@@ -6467,6 +6644,12 @@ declare interface PushJobVersionDTO {
6467
6644
  code?: string;
6468
6645
  codeS3Hash?: string;
6469
6646
  metadata?: Record<string, any>;
6647
+ /** EM-WS10 — `LuaJob({ health })`; sent only when declared. */
6648
+ health?: {
6649
+ maxSilenceMinutes?: number;
6650
+ alertAfterConsecutiveFailures?: number;
6651
+ notify?: 'app' | 'email' | 'emailApp';
6652
+ };
6470
6653
  }
6471
6654
 
6472
6655
  /**
@@ -6583,6 +6766,24 @@ export declare const rows: (s: LuaWorkflowStep<any, any, any> | string, path: st
6583
6766
  limit: number;
6584
6767
  }) => MapDescriptor;
6585
6768
 
6769
+ /** Where an incident notice goes beyond the inbox card (which always lands). */
6770
+ declare const SCHEDULE_HEALTH_NOTIFY_CHANNELS: readonly ["app", "email", "emailApp"];
6771
+
6772
+ /** The declaration an author writes. At least one threshold is required. */
6773
+ declare interface ScheduleHealthConfig {
6774
+ /** Alert when no scheduled run has completed successfully for this many minutes (5..43200). */
6775
+ maxSilenceMinutes?: number;
6776
+ /**
6777
+ * Alert when this many scheduled runs in a row failed. Workflows and agent tasks are parked by the
6778
+ * platform after 3 consecutive failures, so for them the value is 1..3; code jobs accept 1..50.
6779
+ */
6780
+ alertAfterConsecutiveFailures?: number;
6781
+ /** Out-of-inbox routing for the notice: 'app' (push), 'email', or 'emailApp' (both). Default 'emailApp'. */
6782
+ notify?: ScheduleHealthNotify;
6783
+ }
6784
+
6785
+ declare type ScheduleHealthNotify = (typeof SCHEDULE_HEALTH_NOTIFY_CHANNELS)[number];
6786
+
6586
6787
  /**
6587
6788
  * Additive field on primitive publish responses. When the agent is under
6588
6789
  * versioning the server performs a scoped promote and returns the newly
@@ -6723,6 +6924,35 @@ export declare interface StepPathRef<TOut> {
6723
6924
  /** An inline step object, or a string naming an entry declared by an `agentStep`/`specialistStep`/`toolStep`/`map` call in the same chain (03 §3.2.0). */
6724
6925
  export declare type StepRef = LuaWorkflowStep<any, any, any> | string;
6725
6926
 
6927
+ declare interface SupervisedAgentSummary {
6928
+ agentId: string;
6929
+ name?: string;
6930
+ /** The supervision actions the CALLER holds on this agent (explicit grant rows only). */
6931
+ actions: string[];
6932
+ }
6933
+
6934
+ declare interface SupervisionLogRow {
6935
+ timestamp: string | number | Date;
6936
+ level?: string;
6937
+ /** Present only when the caller holds `supervision:observe-content` on the target. */
6938
+ message?: string;
6939
+ logSource?: string;
6940
+ primitiveName?: string;
6941
+ toolName?: string;
6942
+ }
6943
+
6944
+ declare interface SupervisionRunSummary {
6945
+ runId: string;
6946
+ workflowId?: string;
6947
+ workflowName?: string;
6948
+ status: string;
6949
+ reason?: string;
6950
+ trigger?: string;
6951
+ createdAt?: number;
6952
+ startedAt?: number;
6953
+ completedAt?: number;
6954
+ }
6955
+
6726
6956
  /**
6727
6957
  * Why an unattended run could not finish, reported by the agent itself instead
6728
6958
  * of being guessed from its prose. The platform — not the agent — writes every
@@ -7824,6 +8054,9 @@ export declare type WorkflowJobHarness = WorkflowJobHarness_2;
7824
8054
 
7825
8055
  declare type WorkflowJobHarness_2 = (typeof WORKFLOW_JOB_HARNESSES)[number];
7826
8056
 
8057
+ /** EM-WS3: the Job-tier plugin allowlist — a structural twin of the registry's id, parity-checked below. */
8058
+ declare type WorkflowJobPluginId = 'lua-agent-builder';
8059
+
7827
8060
  declare type WorkflowJobResources = (typeof WORKFLOW_JOB_RESOURCES)[number];
7828
8061
 
7829
8062
  export declare type WorkflowJobToolId = 'shell' | 'read' | 'write' | 'edit' | 'glob' | 'grep' | 'git' | 'gh' | 'fetch' | 'ripwire';