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.
@@ -146,8 +146,8 @@ declare class LuaVoice {
146
146
  readonly name: string;
147
147
  readonly description?: string;
148
148
  readonly llm: LuaVoiceModelInput;
149
- readonly stt: LuaVoiceModelInput;
150
- readonly tts: LuaVoiceModelInput;
149
+ readonly stt?: LuaVoiceModelInput;
150
+ readonly tts?: LuaVoiceModelInput;
151
151
  readonly vad: LuaVoiceConfig['vad'];
152
152
  readonly vadOptions: LuaVoiceConfig['vadOptions'];
153
153
  readonly turnDetection: LuaVoiceConfig['turnDetection'];
@@ -176,11 +176,22 @@ declare type LuaVoiceConfig = z.infer<typeof LuaVoiceConfigSchema>;
176
176
  * pass either a string descriptor or a plugin class instance. The wire schema
177
177
  * (validated server-side) is the discriminated union in `@lua/shared-types`;
178
178
  * the compiler is what bridges the two.
179
+ *
180
+ * `stt`/`tts` are unconditionally optional here at the type level — a
181
+ * realtime `llm` legitimately omits both. The realtime-vs-cascaded
182
+ * requirement (cascaded needs both) is enforced by the compiler's zod
183
+ * `superRefine` in `@lua/shared-types`, not by this type. `name` is
184
+ * deliberately required here (unlike `@lua/shared-types`'s wire schema,
185
+ * which leaves it optional for its own unrelated server-side
186
+ * placeholder-name use case) since the `LuaVoice` constructor throws
187
+ * without it and a nameless voice is otherwise silently dropped from the
188
+ * compiled manifest.
179
189
  */
180
- declare interface LuaVoiceConfig_2 extends Omit<LuaVoiceConfig, 'llm' | 'stt' | 'tts'> {
190
+ declare interface LuaVoiceConfig_2 extends Omit<LuaVoiceConfig, 'llm' | 'stt' | 'tts' | 'name'> {
191
+ name: string;
181
192
  llm: LuaVoiceModelInput;
182
- stt: LuaVoiceModelInput;
183
- tts: LuaVoiceModelInput;
193
+ stt?: LuaVoiceModelInput;
194
+ tts?: LuaVoiceModelInput;
184
195
  /** Optional human-readable description (surfaced in manifest + admin listings). */
185
196
  description?: string;
186
197
  /** Voice-only tools, in addition to skills attached to the owning agent. */
@@ -244,14 +255,14 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
244
255
  */
245
256
  options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
246
257
  }, "strip", z.ZodTypeAny, {
247
- class?: "LLM" | "STT" | "STTv2" | "TTS";
248
258
  provider?: "deepgram" | "elevenlabs";
249
259
  kind?: "plugin";
260
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
250
261
  options?: Record<string, unknown>;
251
262
  }, {
252
- class?: "LLM" | "STT" | "STTv2" | "TTS";
253
263
  provider?: "deepgram" | "elevenlabs";
254
264
  kind?: "plugin";
265
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
255
266
  options?: Record<string, unknown>;
256
267
  }>, z.ZodObject<{
257
268
  kind: z.ZodLiteral<"realtime">;
@@ -310,14 +321,14 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
310
321
  */
311
322
  options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
312
323
  }, "strip", z.ZodTypeAny, {
313
- class?: "LLM" | "STT" | "STTv2" | "TTS";
314
324
  provider?: "deepgram" | "elevenlabs";
315
325
  kind?: "plugin";
326
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
316
327
  options?: Record<string, unknown>;
317
328
  }, {
318
- class?: "LLM" | "STT" | "STTv2" | "TTS";
319
329
  provider?: "deepgram" | "elevenlabs";
320
330
  kind?: "plugin";
331
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
321
332
  options?: Record<string, unknown>;
322
333
  }>, z.ZodObject<{
323
334
  kind: z.ZodLiteral<"realtime">;
@@ -376,14 +387,14 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
376
387
  */
377
388
  options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
378
389
  }, "strip", z.ZodTypeAny, {
379
- class?: "LLM" | "STT" | "STTv2" | "TTS";
380
390
  provider?: "deepgram" | "elevenlabs";
381
391
  kind?: "plugin";
392
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
382
393
  options?: Record<string, unknown>;
383
394
  }, {
384
- class?: "LLM" | "STT" | "STTv2" | "TTS";
385
395
  provider?: "deepgram" | "elevenlabs";
386
396
  kind?: "plugin";
397
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
387
398
  options?: Record<string, unknown>;
388
399
  }>, z.ZodObject<{
389
400
  kind: z.ZodLiteral<"realtime">;
@@ -568,9 +579,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
568
579
  options?: Record<string, unknown>;
569
580
  model?: string;
570
581
  } | {
571
- class?: "LLM" | "STT" | "STTv2" | "TTS";
572
582
  provider?: "deepgram" | "elevenlabs";
573
583
  kind?: "plugin";
584
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
574
585
  options?: Record<string, unknown>;
575
586
  } | {
576
587
  provider?: "google" | "xai" | "openai";
@@ -584,9 +595,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
584
595
  options?: Record<string, unknown>;
585
596
  model?: string;
586
597
  } | {
587
- class?: "LLM" | "STT" | "STTv2" | "TTS";
588
598
  provider?: "deepgram" | "elevenlabs";
589
599
  kind?: "plugin";
600
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
590
601
  options?: Record<string, unknown>;
591
602
  } | {
592
603
  provider?: "google" | "xai" | "openai";
@@ -599,9 +610,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
599
610
  options?: Record<string, unknown>;
600
611
  model?: string;
601
612
  } | {
602
- class?: "LLM" | "STT" | "STTv2" | "TTS";
603
613
  provider?: "deepgram" | "elevenlabs";
604
614
  kind?: "plugin";
615
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
605
616
  options?: Record<string, unknown>;
606
617
  } | {
607
618
  provider?: "google" | "xai" | "openai";
@@ -662,9 +673,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
662
673
  options?: Record<string, unknown>;
663
674
  model?: string;
664
675
  } | {
665
- class?: "LLM" | "STT" | "STTv2" | "TTS";
666
676
  provider?: "deepgram" | "elevenlabs";
667
677
  kind?: "plugin";
678
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
668
679
  options?: Record<string, unknown>;
669
680
  } | {
670
681
  provider?: "google" | "xai" | "openai";
@@ -678,9 +689,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
678
689
  options?: Record<string, unknown>;
679
690
  model?: string;
680
691
  } | {
681
- class?: "LLM" | "STT" | "STTv2" | "TTS";
682
692
  provider?: "deepgram" | "elevenlabs";
683
693
  kind?: "plugin";
694
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
684
695
  options?: Record<string, unknown>;
685
696
  } | {
686
697
  provider?: "google" | "xai" | "openai";
@@ -693,9 +704,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
693
704
  options?: Record<string, unknown>;
694
705
  model?: string;
695
706
  } | {
696
- class?: "LLM" | "STT" | "STTv2" | "TTS";
697
707
  provider?: "deepgram" | "elevenlabs";
698
708
  kind?: "plugin";
709
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
699
710
  options?: Record<string, unknown>;
700
711
  } | {
701
712
  provider?: "google" | "xai" | "openai";
@@ -756,9 +767,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
756
767
  options?: Record<string, unknown>;
757
768
  model?: string;
758
769
  } | {
759
- class?: "LLM" | "STT" | "STTv2" | "TTS";
760
770
  provider?: "deepgram" | "elevenlabs";
761
771
  kind?: "plugin";
772
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
762
773
  options?: Record<string, unknown>;
763
774
  } | {
764
775
  provider?: "google" | "xai" | "openai";
@@ -772,9 +783,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
772
783
  options?: Record<string, unknown>;
773
784
  model?: string;
774
785
  } | {
775
- class?: "LLM" | "STT" | "STTv2" | "TTS";
776
786
  provider?: "deepgram" | "elevenlabs";
777
787
  kind?: "plugin";
788
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
778
789
  options?: Record<string, unknown>;
779
790
  } | {
780
791
  provider?: "google" | "xai" | "openai";
@@ -787,9 +798,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
787
798
  options?: Record<string, unknown>;
788
799
  model?: string;
789
800
  } | {
790
- class?: "LLM" | "STT" | "STTv2" | "TTS";
791
801
  provider?: "deepgram" | "elevenlabs";
792
802
  kind?: "plugin";
803
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
793
804
  options?: Record<string, unknown>;
794
805
  } | {
795
806
  provider?: "google" | "xai" | "openai";
@@ -850,9 +861,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
850
861
  options?: Record<string, unknown>;
851
862
  model?: string;
852
863
  } | {
853
- class?: "LLM" | "STT" | "STTv2" | "TTS";
854
864
  provider?: "deepgram" | "elevenlabs";
855
865
  kind?: "plugin";
866
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
856
867
  options?: Record<string, unknown>;
857
868
  } | {
858
869
  provider?: "google" | "xai" | "openai";
@@ -866,9 +877,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
866
877
  options?: Record<string, unknown>;
867
878
  model?: string;
868
879
  } | {
869
- class?: "LLM" | "STT" | "STTv2" | "TTS";
870
880
  provider?: "deepgram" | "elevenlabs";
871
881
  kind?: "plugin";
882
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
872
883
  options?: Record<string, unknown>;
873
884
  } | {
874
885
  provider?: "google" | "xai" | "openai";
@@ -881,9 +892,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
881
892
  options?: Record<string, unknown>;
882
893
  model?: string;
883
894
  } | {
884
- class?: "LLM" | "STT" | "STTv2" | "TTS";
885
895
  provider?: "deepgram" | "elevenlabs";
886
896
  kind?: "plugin";
897
+ class?: "LLM" | "STT" | "STTv2" | "TTS";
887
898
  options?: Record<string, unknown>;
888
899
  } | {
889
900
  provider?: "google" | "xai" | "openai";
@@ -48,6 +48,23 @@ export declare interface AgentStepOptions {
48
48
  */
49
49
  maxMessages?: number;
50
50
  maxInputTokens?: number;
51
+ /**
52
+ * Claude Code plugins a tier:'job' coding turn loads (EM-WS3). Platform allowlist only — today
53
+ * `'lua-agent-builder'` (the lua-cli playbooks). Needs the claude-code harness (an Anthropic model) and the `shell`
54
+ * job tool; the turn then reaches the Lua API through a platform proxy pinned to THIS workflow's agent that allows
55
+ * staging only (compile, push of skills/jobs/webhooks/triggers/processors/backup, `version create`, status, logs)
56
+ * and refuses every deploy, promote, publish, activate, env, chat and runtime call.
57
+ */
58
+ plugins?: WorkflowJobPluginId[];
59
+ /**
60
+ * EM-WS3: pin a plugin step's Lua-API proxy (and its key) to ANOTHER agent instead of this workflow's own. Legal only
61
+ * beside `plugins`. Refused at run time (`target_not_granted`) unless the platform's plugin-target switch is on AND
62
+ * this workflow's agent holds a `supervision:act` or `supervision:release` grant on the target. EM-WS3 × EM-WS2: the
63
+ * id may be `template('${initData.<path>}')`, rendered from the run input at dispatch (a per-run target).
64
+ */
65
+ target?: {
66
+ agentId: string | TemplateBinding;
67
+ };
51
68
  /**
52
69
  * What this step DOES: `classify` | `extract` | `transform` | `draft` | `research` | `reason` | `code` |
53
70
  * `judge`. On a PUSHED definition it must come with a `model` — a static `taskClass` with none is refused
@@ -321,7 +338,9 @@ export declare type LuaWorkflowBuildCode = 'duplicate-step-id' | 'unknown-step-r
321
338
  * verdict (deferred for an inherit child, 03 §3.1 table). Kept for one minor so a consumer switching on the union still
322
339
  * compiles; removed in the next.
323
340
  */
324
- | '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'
341
+ | 'workspace-not-declared' | 'workspace-inherit-without-parent-workspace' | 'workspace-inherit-conflict' | 'harness-requires-job-tier' | 'max-turns-requires-job-tier' | 'max-turns-invalid'
342
+ /** EM-WS3: a step's `plugins` outside the allowlist, repeated, or off the Job tier. */
343
+ | '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'
325
344
  /**
326
345
  * @deprecated LUA-684 — the builder no longer throws it: an `approval` / `waitForSignal` IS a container arm
327
346
  * (`parallel(['approve', …])`). Where the engine cannot run one — a `loop` body, the step of a `[map, step]`
@@ -427,6 +446,18 @@ export declare interface LuaWorkflowConfig {
427
446
  backfillOnEnable?: {
428
447
  maxOccurrences?: number;
429
448
  };
449
+ /**
450
+ * Schedule health — a dead-man for this schedule, watched by the platform (no heartbeat service to wire up).
451
+ * The agent's owner (the schedule's creator, else the org admins) gets ONE notice per incident — inbox card plus
452
+ * `notify` ('app' push, 'email', or 'emailApp', the default) — when, while the schedule is active:
453
+ * - `maxSilenceMinutes` (5..43200): no scheduled run has COMPLETED successfully for that long;
454
+ * - `alertAfterConsecutiveFailures` (1..3): that many scheduled runs failed in a row (the platform turns a
455
+ * schedule off after 3, which always alerts);
456
+ * and the notice resolves in place when the schedule is healthy again. Every transition is also an agent log
457
+ * line (`lua logs`), so a log drain routes it to Better Stack / Datadog. Needs `schedule`; silence needs a
458
+ * recurring one. See docs/workflows/schedule-health.md.
459
+ */
460
+ health?: ScheduleHealthConfig;
430
461
  /** Literal JSON passed as run input on every scheduled fire; must validate against `inputSchema` (P0-5e). */
431
462
  scheduleInput?: Record<string, unknown>;
432
463
  goal?: WorkflowGoalEnvelope;
@@ -458,6 +489,21 @@ export declare interface LuaWorkflowStep<TIn extends ZodType = ZodType, TOut ext
458
489
  workspace?: WorkflowStepWorkspace;
459
490
  jobResources?: WorkflowJobResources;
460
491
  jobTools?: WorkflowJobToolId[];
492
+ /**
493
+ * EM-WS3 × EM-WS2: let this `tier:'job'` step run `lua` (`ctx.exec('lua', [...])`, `` ctx.$`lua push …` ``) against the
494
+ * Lua API through the platform's staging-only proxy, with a short-lived key for ONE agent: this workflow's agent, or
495
+ * `target`. It is the same proxy and the same deny rules as a plugin agent step: deploy, promote, publish,
496
+ * activate, env, chat and runtime calls are refused.
497
+ */
498
+ luaApi?: true;
499
+ /**
500
+ * EM-WS3: pin the `luaApi` proxy (and its key) to ANOTHER agent. The id may be static or
501
+ * `template('${initData.<path>}')`, rendered from the run input at dispatch. The same flag and supervision-grant
502
+ * rules apply as on a plugin agent step.
503
+ */
504
+ target?: {
505
+ agentId: string | TemplateBinding;
506
+ };
461
507
  /** default { maxAttempts: 1 } */
462
508
  retry?: RetryPolicy;
463
509
  /** default 'none'; 'external' ⇒ park on platform-fault reclaim. */
@@ -512,6 +558,24 @@ export declare const rows: (s: LuaWorkflowStep<any, any, any> | string, path: st
512
558
  limit: number;
513
559
  }) => MapDescriptor;
514
560
 
561
+ /** Where an incident notice goes beyond the inbox card (which always lands). */
562
+ declare const SCHEDULE_HEALTH_NOTIFY_CHANNELS: readonly ["app", "email", "emailApp"];
563
+
564
+ /** The declaration an author writes. At least one threshold is required. */
565
+ declare interface ScheduleHealthConfig {
566
+ /** Alert when no scheduled run has completed successfully for this many minutes (5..43200). */
567
+ maxSilenceMinutes?: number;
568
+ /**
569
+ * Alert when this many scheduled runs in a row failed. Workflows and agent tasks are parked by the
570
+ * platform after 3 consecutive failures, so for them the value is 1..3; code jobs accept 1..50.
571
+ */
572
+ alertAfterConsecutiveFailures?: number;
573
+ /** Out-of-inbox routing for the notice: 'app' (push), 'email', or 'emailApp' (both). Default 'emailApp'. */
574
+ notify?: ScheduleHealthNotify;
575
+ }
576
+
577
+ declare type ScheduleHealthNotify = (typeof SCHEDULE_HEALTH_NOTIFY_CHANNELS)[number];
578
+
515
579
  export { SerializedWorkflowGraph }
516
580
 
517
581
  export declare interface SpecialistStepOptions {
@@ -784,6 +848,9 @@ export declare type WorkflowJobHarness = WorkflowJobHarness_2;
784
848
 
785
849
  declare type WorkflowJobHarness_2 = (typeof WORKFLOW_JOB_HARNESSES)[number];
786
850
 
851
+ /** EM-WS3: the Job-tier plugin allowlist — a structural twin of the registry's id, parity-checked below. */
852
+ declare type WorkflowJobPluginId = 'lua-agent-builder';
853
+
787
854
  declare type WorkflowJobResources = (typeof WORKFLOW_JOB_RESOURCES)[number];
788
855
 
789
856
  export declare type WorkflowJobToolId = 'shell' | 'read' | 'write' | 'edit' | 'glob' | 'grep' | 'git' | 'gh' | 'fetch' | 'ripwire';