lua-cli 3.52.0 → 3.54.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.
- package/dist/api-exports.d.ts +99 -19
- package/dist/api-exports.js +543 -83
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +2650 -795
- package/dist/index.js.map +1 -1
- package/dist/voice/test/index.d.ts +37 -18
- package/dist/workflow-builder.d.ts +19 -0
- package/dist/workflow-builder.js +491 -58
- package/dist/workflow-builder.js.map +1 -1
- package/docs/API_REFERENCE.md +23 -0
- package/docs/CLI_REFERENCE.md +14 -0
- package/docs/README.md +3 -3
- package/docs/api/LuaTool.md +124 -82
- package/docs/api/LuaWebhook.md +1 -1
- package/package.json +1 -1
- package/template/README.md +2 -0
- package/template/package.json +1 -1
- package/template-web-app/app.ts +5 -0
- package/template-web-app/web/package.json +3 -2
- package/template-web-app/web/src/index.css +2 -0
- package/template-web-app/web/src/main.tsx +5 -1
package/dist/api-exports.d.ts
CHANGED
|
@@ -189,6 +189,17 @@ declare interface AgentDirectoryEntry {
|
|
|
189
189
|
callerActions: string[];
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
/**
|
|
193
|
+
* A fresh agent identity assertion (ADR 0025): a 60-second, single-use, platform-signed proof that the call comes
|
|
194
|
+
* from a live execution of this agent.
|
|
195
|
+
*/
|
|
196
|
+
export declare interface AgentIdentityAssertion {
|
|
197
|
+
/** Send as the `X-Lua-Agent-Assertion` header on ONE call to the system named by `audience`. */
|
|
198
|
+
token: string;
|
|
199
|
+
/** ISO-8601 instant the token expires (60 s after it was minted). */
|
|
200
|
+
expiresAt: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
192
203
|
/**
|
|
193
204
|
* Narrowed, wire-safe output for `Agents.invoke`. A slice of the internal
|
|
194
205
|
* `FullOutput` shape — raw Mastra steps / tripwire payloads are intentionally
|
|
@@ -3870,6 +3881,10 @@ export declare function defineVoice(config: LuaVoiceConfig): LuaVoice;
|
|
|
3870
3881
|
/**
|
|
3871
3882
|
* Define a web app on the agent.
|
|
3872
3883
|
*
|
|
3884
|
+
* `GET` routes must only read. People a view was shared with view-only (`auth.accessLevel === 'view_only'`) can call
|
|
3885
|
+
* every `GET` route with the agent's own data and connections, and nothing else; any change belongs in a
|
|
3886
|
+
* `POST`, `PUT`, `PATCH` or `DELETE` route, which only people with full access reach.
|
|
3887
|
+
*
|
|
3873
3888
|
* @example
|
|
3874
3889
|
* ```typescript
|
|
3875
3890
|
* import { defineWebApp, route, json } from 'lua-cli';
|
|
@@ -5946,7 +5961,14 @@ export declare interface LuaAgentConfig {
|
|
|
5946
5961
|
*/
|
|
5947
5962
|
export declare type LuaAgentModel = string | ((request: LuaRequest) => string | Promise<string>);
|
|
5948
5963
|
|
|
5949
|
-
/**
|
|
5964
|
+
/**
|
|
5965
|
+
* The signed-in person a route runs for (never an API key, never anonymous).
|
|
5966
|
+
*
|
|
5967
|
+
* `auth.accessLevel` says how much of the app they may use: `'full'` when they can read the app's agent, or
|
|
5968
|
+
* `'view_only'` when someone shared just this view with them (or it is org-wide in their workspace) — then only
|
|
5969
|
+
* `GET` routes reach your handlers, `roles` and `scopes` are empty, and the agent pane is off. A `GET` route must
|
|
5970
|
+
* therefore only read: never create, change or delete anything in one.
|
|
5971
|
+
*/
|
|
5950
5972
|
export declare type LuaAuth = WebRouteAuth;
|
|
5951
5973
|
|
|
5952
5974
|
export declare class LuaBrowser {
|
|
@@ -6122,6 +6144,29 @@ export declare interface LuaDeviceTriggerConfig {
|
|
|
6122
6144
|
execute: (payload: any, context: DeviceTriggerContext) => Promise<any>;
|
|
6123
6145
|
}
|
|
6124
6146
|
|
|
6147
|
+
/**
|
|
6148
|
+
* The agent's own identity, proven by the platform (ADR 0025).
|
|
6149
|
+
*/
|
|
6150
|
+
export declare interface LuaIdentity {
|
|
6151
|
+
/**
|
|
6152
|
+
* Mint a fresh agent identity assertion for `audience`. Only platform-allowlisted audiences are minted; today
|
|
6153
|
+
* that is `'lua-api:staff'` (Lua's staff API, for an agent enrolled as a staff service principal).
|
|
6154
|
+
*
|
|
6155
|
+
* Throws an `AgentIdentityError` (`err.code`):
|
|
6156
|
+
* - `agent_identity_requires_live_execution` outside a live execution (always in `lua test` / `lua dev`);
|
|
6157
|
+
* - `agent_identity_audience_not_allowed` for any other audience;
|
|
6158
|
+
* - `agent_identity_input_invalid` when `audience` is missing;
|
|
6159
|
+
* - `agent_identity_unavailable` when the platform cannot mint one right now.
|
|
6160
|
+
*
|
|
6161
|
+
* Inside a test session it throws a `TestSessionError` with `test_session_tier_unsupported` instead.
|
|
6162
|
+
*
|
|
6163
|
+
* Mint one per call. A token is single-use, so never cache or reuse it.
|
|
6164
|
+
*/
|
|
6165
|
+
assertion(input: {
|
|
6166
|
+
audience: string;
|
|
6167
|
+
}): Promise<AgentIdentityAssertion>;
|
|
6168
|
+
}
|
|
6169
|
+
|
|
6125
6170
|
/**
|
|
6126
6171
|
* Lua Job class.
|
|
6127
6172
|
* Main class for building scheduled jobs (cron jobs, one-time tasks, intervals).
|
|
@@ -6469,6 +6514,11 @@ export declare interface LuaRequest {
|
|
|
6469
6514
|
export declare interface LuaRuntime {
|
|
6470
6515
|
/** Request context information */
|
|
6471
6516
|
request: LuaRequest;
|
|
6517
|
+
/**
|
|
6518
|
+
* The agent's platform-proven identity (ADR 0025). Optional because older runtimes do not provide it, so read it
|
|
6519
|
+
* defensively: `Lua.identity?.assertion`.
|
|
6520
|
+
*/
|
|
6521
|
+
identity?: LuaIdentity;
|
|
6472
6522
|
}
|
|
6473
6523
|
|
|
6474
6524
|
/**
|
|
@@ -6584,6 +6634,25 @@ export declare interface LuaTool<TInput extends ZodType = ZodType> {
|
|
|
6584
6634
|
name: string;
|
|
6585
6635
|
/** Description of what the tool does */
|
|
6586
6636
|
description: string;
|
|
6637
|
+
/**
|
|
6638
|
+
* Optional text the chat shows to the user while this tool runs and after it
|
|
6639
|
+
* finishes, instead of the tool's name. Either one text for both moments, or
|
|
6640
|
+
* one for each:
|
|
6641
|
+
*
|
|
6642
|
+
* ```ts
|
|
6643
|
+
* label = { running: 'Creating a ticket for {subject}', done: 'Created a ticket for {subject}' };
|
|
6644
|
+
* label = 'Checked stock';
|
|
6645
|
+
* ```
|
|
6646
|
+
*
|
|
6647
|
+
* `{argName}` is replaced with that argument's value from the call (string
|
|
6648
|
+
* and number arguments only). Don't end the text with "…": the chat adds it
|
|
6649
|
+
* while the tool runs. Each text is a string literal (or a const holding one)
|
|
6650
|
+
* of at most 80 characters; `lua compile` ignores a computed label.
|
|
6651
|
+
*/
|
|
6652
|
+
label?: string | {
|
|
6653
|
+
running: string;
|
|
6654
|
+
done: string;
|
|
6655
|
+
};
|
|
6587
6656
|
/** Zod schema for input validation */
|
|
6588
6657
|
inputSchema: TInput;
|
|
6589
6658
|
/**
|
|
@@ -6870,15 +6939,15 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6870
6939
|
*/
|
|
6871
6940
|
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6872
6941
|
}, "strip", z.ZodTypeAny, {
|
|
6942
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6873
6943
|
options: Record<string, unknown>;
|
|
6874
6944
|
provider: "deepgram" | "elevenlabs";
|
|
6875
6945
|
kind: "plugin";
|
|
6876
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6877
6946
|
}, {
|
|
6947
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6878
6948
|
options: Record<string, unknown>;
|
|
6879
6949
|
provider: "deepgram" | "elevenlabs";
|
|
6880
6950
|
kind: "plugin";
|
|
6881
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6882
6951
|
}>, z.ZodObject<{
|
|
6883
6952
|
kind: z.ZodLiteral<"realtime">;
|
|
6884
6953
|
provider: z.ZodEnum<["openai", "google", "xai"]>;
|
|
@@ -6936,15 +7005,15 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6936
7005
|
*/
|
|
6937
7006
|
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6938
7007
|
}, "strip", z.ZodTypeAny, {
|
|
7008
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6939
7009
|
options: Record<string, unknown>;
|
|
6940
7010
|
provider: "deepgram" | "elevenlabs";
|
|
6941
7011
|
kind: "plugin";
|
|
6942
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6943
7012
|
}, {
|
|
7013
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6944
7014
|
options: Record<string, unknown>;
|
|
6945
7015
|
provider: "deepgram" | "elevenlabs";
|
|
6946
7016
|
kind: "plugin";
|
|
6947
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6948
7017
|
}>, z.ZodObject<{
|
|
6949
7018
|
kind: z.ZodLiteral<"realtime">;
|
|
6950
7019
|
provider: z.ZodEnum<["openai", "google", "xai"]>;
|
|
@@ -7002,15 +7071,15 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7002
7071
|
*/
|
|
7003
7072
|
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
7004
7073
|
}, "strip", z.ZodTypeAny, {
|
|
7074
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7005
7075
|
options: Record<string, unknown>;
|
|
7006
7076
|
provider: "deepgram" | "elevenlabs";
|
|
7007
7077
|
kind: "plugin";
|
|
7008
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7009
7078
|
}, {
|
|
7079
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7010
7080
|
options: Record<string, unknown>;
|
|
7011
7081
|
provider: "deepgram" | "elevenlabs";
|
|
7012
7082
|
kind: "plugin";
|
|
7013
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7014
7083
|
}>, z.ZodObject<{
|
|
7015
7084
|
kind: z.ZodLiteral<"realtime">;
|
|
7016
7085
|
provider: z.ZodEnum<["openai", "google", "xai"]>;
|
|
@@ -7192,10 +7261,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7192
7261
|
voice?: string | undefined;
|
|
7193
7262
|
options?: Record<string, unknown> | undefined;
|
|
7194
7263
|
} | {
|
|
7264
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7195
7265
|
options: Record<string, unknown>;
|
|
7196
7266
|
provider: "deepgram" | "elevenlabs";
|
|
7197
7267
|
kind: "plugin";
|
|
7198
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7199
7268
|
} | {
|
|
7200
7269
|
options: Record<string, unknown>;
|
|
7201
7270
|
provider: "openai" | "google" | "xai";
|
|
@@ -7209,10 +7278,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7209
7278
|
voice?: string | undefined;
|
|
7210
7279
|
options?: Record<string, unknown> | undefined;
|
|
7211
7280
|
} | {
|
|
7281
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7212
7282
|
options: Record<string, unknown>;
|
|
7213
7283
|
provider: "deepgram" | "elevenlabs";
|
|
7214
7284
|
kind: "plugin";
|
|
7215
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7216
7285
|
} | {
|
|
7217
7286
|
options: Record<string, unknown>;
|
|
7218
7287
|
provider: "openai" | "google" | "xai";
|
|
@@ -7225,10 +7294,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7225
7294
|
voice?: string | undefined;
|
|
7226
7295
|
options?: Record<string, unknown> | undefined;
|
|
7227
7296
|
} | {
|
|
7297
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7228
7298
|
options: Record<string, unknown>;
|
|
7229
7299
|
provider: "deepgram" | "elevenlabs";
|
|
7230
7300
|
kind: "plugin";
|
|
7231
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7232
7301
|
} | {
|
|
7233
7302
|
options: Record<string, unknown>;
|
|
7234
7303
|
provider: "openai" | "google" | "xai";
|
|
@@ -7286,10 +7355,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7286
7355
|
voice?: string | undefined;
|
|
7287
7356
|
options?: Record<string, unknown> | undefined;
|
|
7288
7357
|
} | {
|
|
7358
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7289
7359
|
options: Record<string, unknown>;
|
|
7290
7360
|
provider: "deepgram" | "elevenlabs";
|
|
7291
7361
|
kind: "plugin";
|
|
7292
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7293
7362
|
} | {
|
|
7294
7363
|
options: Record<string, unknown>;
|
|
7295
7364
|
provider: "openai" | "google" | "xai";
|
|
@@ -7303,10 +7372,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7303
7372
|
voice?: string | undefined;
|
|
7304
7373
|
options?: Record<string, unknown> | undefined;
|
|
7305
7374
|
} | {
|
|
7375
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7306
7376
|
options: Record<string, unknown>;
|
|
7307
7377
|
provider: "deepgram" | "elevenlabs";
|
|
7308
7378
|
kind: "plugin";
|
|
7309
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7310
7379
|
} | {
|
|
7311
7380
|
options: Record<string, unknown>;
|
|
7312
7381
|
provider: "openai" | "google" | "xai";
|
|
@@ -7319,10 +7388,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7319
7388
|
voice?: string | undefined;
|
|
7320
7389
|
options?: Record<string, unknown> | undefined;
|
|
7321
7390
|
} | {
|
|
7391
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7322
7392
|
options: Record<string, unknown>;
|
|
7323
7393
|
provider: "deepgram" | "elevenlabs";
|
|
7324
7394
|
kind: "plugin";
|
|
7325
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7326
7395
|
} | {
|
|
7327
7396
|
options: Record<string, unknown>;
|
|
7328
7397
|
provider: "openai" | "google" | "xai";
|
|
@@ -7380,10 +7449,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7380
7449
|
voice?: string | undefined;
|
|
7381
7450
|
options?: Record<string, unknown> | undefined;
|
|
7382
7451
|
} | {
|
|
7452
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7383
7453
|
options: Record<string, unknown>;
|
|
7384
7454
|
provider: "deepgram" | "elevenlabs";
|
|
7385
7455
|
kind: "plugin";
|
|
7386
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7387
7456
|
} | {
|
|
7388
7457
|
options: Record<string, unknown>;
|
|
7389
7458
|
provider: "openai" | "google" | "xai";
|
|
@@ -7397,10 +7466,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7397
7466
|
voice?: string | undefined;
|
|
7398
7467
|
options?: Record<string, unknown> | undefined;
|
|
7399
7468
|
} | {
|
|
7469
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7400
7470
|
options: Record<string, unknown>;
|
|
7401
7471
|
provider: "deepgram" | "elevenlabs";
|
|
7402
7472
|
kind: "plugin";
|
|
7403
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7404
7473
|
} | {
|
|
7405
7474
|
options: Record<string, unknown>;
|
|
7406
7475
|
provider: "openai" | "google" | "xai";
|
|
@@ -7413,10 +7482,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7413
7482
|
voice?: string | undefined;
|
|
7414
7483
|
options?: Record<string, unknown> | undefined;
|
|
7415
7484
|
} | {
|
|
7485
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7416
7486
|
options: Record<string, unknown>;
|
|
7417
7487
|
provider: "deepgram" | "elevenlabs";
|
|
7418
7488
|
kind: "plugin";
|
|
7419
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7420
7489
|
} | {
|
|
7421
7490
|
options: Record<string, unknown>;
|
|
7422
7491
|
provider: "openai" | "google" | "xai";
|
|
@@ -7474,10 +7543,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7474
7543
|
voice?: string | undefined;
|
|
7475
7544
|
options?: Record<string, unknown> | undefined;
|
|
7476
7545
|
} | {
|
|
7546
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7477
7547
|
options: Record<string, unknown>;
|
|
7478
7548
|
provider: "deepgram" | "elevenlabs";
|
|
7479
7549
|
kind: "plugin";
|
|
7480
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7481
7550
|
} | {
|
|
7482
7551
|
options: Record<string, unknown>;
|
|
7483
7552
|
provider: "openai" | "google" | "xai";
|
|
@@ -7491,10 +7560,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7491
7560
|
voice?: string | undefined;
|
|
7492
7561
|
options?: Record<string, unknown> | undefined;
|
|
7493
7562
|
} | {
|
|
7563
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7494
7564
|
options: Record<string, unknown>;
|
|
7495
7565
|
provider: "deepgram" | "elevenlabs";
|
|
7496
7566
|
kind: "plugin";
|
|
7497
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7498
7567
|
} | {
|
|
7499
7568
|
options: Record<string, unknown>;
|
|
7500
7569
|
provider: "openai" | "google" | "xai";
|
|
@@ -7507,10 +7576,10 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7507
7576
|
voice?: string | undefined;
|
|
7508
7577
|
options?: Record<string, unknown> | undefined;
|
|
7509
7578
|
} | {
|
|
7579
|
+
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7510
7580
|
options: Record<string, unknown>;
|
|
7511
7581
|
provider: "deepgram" | "elevenlabs";
|
|
7512
7582
|
kind: "plugin";
|
|
7513
|
-
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7514
7583
|
} | {
|
|
7515
7584
|
options: Record<string, unknown>;
|
|
7516
7585
|
provider: "openai" | "google" | "xai";
|
|
@@ -11251,6 +11320,9 @@ export declare interface WebhookRequest {
|
|
|
11251
11320
|
payload: any;
|
|
11252
11321
|
}
|
|
11253
11322
|
|
|
11323
|
+
/** LUA-1353 — see {@link WebRouteAuth.accessLevel}. */
|
|
11324
|
+
declare type WebRouteAccessLevel = 'full' | 'view_only';
|
|
11325
|
+
|
|
11254
11326
|
/** The app the handler belongs to, for `ctx.app` and log correlation. */
|
|
11255
11327
|
declare interface WebRouteApp {
|
|
11256
11328
|
id: string;
|
|
@@ -11281,6 +11353,14 @@ declare interface WebRouteAuth {
|
|
|
11281
11353
|
email?: string;
|
|
11282
11354
|
/** ISO timestamp the session token expires at, when known. */
|
|
11283
11355
|
expiresAt?: string;
|
|
11356
|
+
/**
|
|
11357
|
+
* LUA-1353 — how much of the app the caller may use. `full`: they can read the app's agent (every route, the
|
|
11358
|
+
* agent pane). `view_only`: the app was shared with them, or is org-wide in their workspace, without access to
|
|
11359
|
+
* the agent — only `GET` routes reach a handler, `roles` and `scopes` are empty, and the agent pane is off. A
|
|
11360
|
+
* `GET` handler must therefore never change anything. Absent only from a gateway older than LUA-1353 (read it
|
|
11361
|
+
* as `full`).
|
|
11362
|
+
*/
|
|
11363
|
+
accessLevel?: WebRouteAccessLevel;
|
|
11284
11364
|
}
|
|
11285
11365
|
|
|
11286
11366
|
declare type WebRouteMethod = (typeof WEB_ROUTE_METHODS)[number];
|