lua-cli 3.53.0 → 3.55.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 +212 -88
- package/dist/api-exports.js +682 -48
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +2840 -599
- package/dist/index.js.map +1 -1
- package/dist/voice/test/index.d.ts +97 -72
- package/dist/workflow-builder.d.ts +22 -0
- package/dist/workflow-builder.js +584 -7
- 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/Data.md +19 -4
- package/docs/api/LuaTool.md +124 -82
- package/docs/api/LuaWebhook.md +1 -1
- package/package.json +3 -2
- 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 +2 -3
- package/template-web-app/web/src/index.css +0 -2
- package/template-web-app/web/src/main.tsx +1 -9
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
|
|
@@ -2874,15 +2885,6 @@ export declare interface ChannelSendTarget {
|
|
|
2874
2885
|
identity?: UserIdentityRef;
|
|
2875
2886
|
}
|
|
2876
2887
|
|
|
2877
|
-
/**
|
|
2878
|
-
* Wire-format types for `GET /chat/history/:agentId` and the VM-sandbox
|
|
2879
|
-
* `User.getChatHistory()` API. Both paths return the same shape.
|
|
2880
|
-
*
|
|
2881
|
-
* Shared between lua-core (HTTP controller + VM devtools) and lua-cli
|
|
2882
|
-
* (HTTP client typing for `lua test`). Also shared with lua-api's
|
|
2883
|
-
* `thread.service.ts` (admin org-thread listing) so the parser never
|
|
2884
|
-
* diverges across services.
|
|
2885
|
-
*/
|
|
2886
2888
|
/**
|
|
2887
2889
|
* One content part of a chat-history message.
|
|
2888
2890
|
*
|
|
@@ -2953,6 +2955,8 @@ export declare interface ChatHistoryMessage {
|
|
|
2953
2955
|
servedModel?: string;
|
|
2954
2956
|
/** True when the turn reached that model through the Auto selector. */
|
|
2955
2957
|
autoModelRequested?: boolean;
|
|
2958
|
+
/** On an assistant message: the id the reply streamed under, which its usage and ledger rows carry. */
|
|
2959
|
+
turnId?: string;
|
|
2956
2960
|
author?: {
|
|
2957
2961
|
userId: string;
|
|
2958
2962
|
};
|
|
@@ -2962,6 +2966,8 @@ export declare interface ChatHistoryMessage {
|
|
|
2962
2966
|
};
|
|
2963
2967
|
/** On a user message: the id the client gave the turn when it sent it, so it can tell which of its sends arrived. */
|
|
2964
2968
|
clientTurnId?: string;
|
|
2969
|
+
/** Set on every message of a turn that has more than one version. */
|
|
2970
|
+
replyVersion?: ReplyVersionInfo;
|
|
2965
2971
|
/**
|
|
2966
2972
|
* Permanent recording for a voice-note turn (Lua Desktop). Populated by the
|
|
2967
2973
|
* admin threads history endpoint from the row's `content.metadata.audio` — a
|
|
@@ -3277,6 +3283,8 @@ declare interface CustomDataAPI {
|
|
|
3277
3283
|
set?: Record<string, any>;
|
|
3278
3284
|
unset?: string[];
|
|
3279
3285
|
searchText?: string | null;
|
|
3286
|
+
/** Refreshes the index declarations (same semantics as create's option). */
|
|
3287
|
+
index?: Array<string | string[]>;
|
|
3280
3288
|
}, options?: {
|
|
3281
3289
|
ifVersion?: number;
|
|
3282
3290
|
}): Promise<UpdateCustomDataResponse>;
|
|
@@ -3474,7 +3482,7 @@ export declare const Data: {
|
|
|
3474
3482
|
*
|
|
3475
3483
|
* @param collectionName - Name of the collection
|
|
3476
3484
|
* @param entryId - ID of the entry
|
|
3477
|
-
* @param mutation - `{ set?, unset?, searchText? }` (`searchText: null` clears it)
|
|
3485
|
+
* @param mutation - `{ set?, unset?, searchText?, index? }` (`searchText: null` clears it; `index` as create's option)
|
|
3478
3486
|
* @param options - `{ ifVersion? }` for compare-and-swap
|
|
3479
3487
|
* @returns Promise resolving to `{ status, message, version }` (`version` = the entry's new version)
|
|
3480
3488
|
*/
|
|
@@ -3482,6 +3490,8 @@ export declare const Data: {
|
|
|
3482
3490
|
set?: Record<string, any>;
|
|
3483
3491
|
unset?: string[];
|
|
3484
3492
|
searchText?: string | null;
|
|
3493
|
+
/** Refreshes the index declarations (same semantics as create's `index` option). */
|
|
3494
|
+
index?: Array<string | string[]>;
|
|
3485
3495
|
}, options?: PatchCustomDataOptions): Promise<UpdateCustomDataResponse>;
|
|
3486
3496
|
/**
|
|
3487
3497
|
* Atomically adds `by` (default 1; negative and fractional amounts allowed)
|
|
@@ -3546,7 +3556,9 @@ export declare const Data: {
|
|
|
3546
3556
|
* - Readers may `collections`, `get`, `getEntry`, `search`; writers may also `create`, `update`, `patch`,
|
|
3547
3557
|
* `increment`, `delete` (a writer can read). Anything else rejects with `code === 'shared_data_forbidden'`
|
|
3548
3558
|
* (403) — also when the name does not exist or belongs to another org.
|
|
3549
|
-
* - Same limits, filters, managed indexes, compare-and-swap and vector search as `Data`.
|
|
3559
|
+
* - Same limits, filters, managed indexes, compare-and-swap and vector search as `Data`. A writer declares indexes
|
|
3560
|
+
* (`{ index }` on create/update/patch); they belong to the shared collection (5 across its sub-collections) and
|
|
3561
|
+
* `collections()` reports their status to every reader. Every write is audited
|
|
3550
3562
|
* (agent, collection, entry id; never the value).
|
|
3551
3563
|
* - A test session may read but not write (`shared_data_test_session_write_refused`, 409).
|
|
3552
3564
|
* - Deployed agents only: under `lua test` every call rejects with `code === 'shared_data_unavailable_offline'`.
|
|
@@ -3590,11 +3602,11 @@ export declare class DataEntryInstance {
|
|
|
3590
3602
|
/**
|
|
3591
3603
|
* Updates the custom data entry
|
|
3592
3604
|
* @param data - The data fields to update (partial update supported)
|
|
3593
|
-
* @param
|
|
3605
|
+
* @param optionsOrSearchText - `{ searchText?, index? }` (as `Data.update`), or a bare string (legacy `searchText`)
|
|
3594
3606
|
* @returns Promise resolving to the updated data
|
|
3595
3607
|
* @throws Error if the update fails
|
|
3596
3608
|
*/
|
|
3597
|
-
update(data: Record<string, any>,
|
|
3609
|
+
update(data: Record<string, any>, optionsOrSearchText?: string | CreateCustomDataOptions): Promise<Record<string, any>>;
|
|
3598
3610
|
/**
|
|
3599
3611
|
* Atomically sets/unsets fields. `options.ifVersion` makes it a
|
|
3600
3612
|
* compare-and-swap (pass `entry._version`); a stale version rejects with
|
|
@@ -3605,6 +3617,8 @@ export declare class DataEntryInstance {
|
|
|
3605
3617
|
set?: Record<string, any>;
|
|
3606
3618
|
unset?: string[];
|
|
3607
3619
|
searchText?: string | null;
|
|
3620
|
+
/** Refreshes the index declarations (same semantics as create's option). */
|
|
3621
|
+
index?: Array<string | string[]>;
|
|
3608
3622
|
}, options?: {
|
|
3609
3623
|
ifVersion?: number;
|
|
3610
3624
|
}): Promise<Record<string, any>>;
|
|
@@ -3617,11 +3631,11 @@ export declare class DataEntryInstance {
|
|
|
3617
3631
|
delete(): Promise<boolean>;
|
|
3618
3632
|
/**
|
|
3619
3633
|
* Saves the data entry
|
|
3620
|
-
* @param
|
|
3634
|
+
* @param optionsOrSearchText - `{ searchText?, index? }` (as `Data.update`), or a bare string (legacy `searchText`)
|
|
3621
3635
|
* @returns Promise resolving to true if saving was successful
|
|
3622
3636
|
* @throws Error if the save operation fails
|
|
3623
3637
|
*/
|
|
3624
|
-
save(
|
|
3638
|
+
save(optionsOrSearchText?: string | CreateCustomDataOptions): Promise<boolean>;
|
|
3625
3639
|
}
|
|
3626
3640
|
|
|
3627
3641
|
export { DatasetRef }
|
|
@@ -3870,6 +3884,10 @@ export declare function defineVoice(config: LuaVoiceConfig): LuaVoice;
|
|
|
3870
3884
|
/**
|
|
3871
3885
|
* Define a web app on the agent.
|
|
3872
3886
|
*
|
|
3887
|
+
* `GET` routes must only read. People a view was shared with view-only (`auth.accessLevel === 'view_only'`) can call
|
|
3888
|
+
* every `GET` route with the agent's own data and connections, and nothing else; any change belongs in a
|
|
3889
|
+
* `POST`, `PUT`, `PATCH` or `DELETE` route, which only people with full access reach.
|
|
3890
|
+
*
|
|
3873
3891
|
* @example
|
|
3874
3892
|
* ```typescript
|
|
3875
3893
|
* import { defineWebApp, route, json } from 'lua-cli';
|
|
@@ -4964,6 +4982,17 @@ export declare interface IntegrationPassthroughRequest {
|
|
|
4964
4982
|
* server-side and cannot be overridden.
|
|
4965
4983
|
*/
|
|
4966
4984
|
headers?: Record<string, string>;
|
|
4985
|
+
/**
|
|
4986
|
+
* BAC-2677 — ask for the provider body as bytes. With `'base64'`, a 2xx
|
|
4987
|
+
* response body is read as raw bytes and returned base64-encoded in `data`
|
|
4988
|
+
* (and `encoding: 'base64'` is set on the response), so binary files such as
|
|
4989
|
+
* a Drive PDF (`drive/v3/files/<id>?alt=media`) survive intact. Bodies over
|
|
4990
|
+
* {@link INTEGRATION_PASSTHROUGH_MAX_BASE64_RESPONSE_BYTES} are refused with
|
|
4991
|
+
* {@link INTEGRATION_PASSTHROUGH_RESPONSE_TOO_LARGE_CODE}, never truncated.
|
|
4992
|
+
* Provider error statuses keep the normal JSON/text body. Omit for the
|
|
4993
|
+
* default JSON/text handling.
|
|
4994
|
+
*/
|
|
4995
|
+
responseType?: 'base64';
|
|
4967
4996
|
}
|
|
4968
4997
|
|
|
4969
4998
|
/**
|
|
@@ -4979,8 +5008,16 @@ export declare interface IntegrationPassthroughResponse {
|
|
|
4979
5008
|
/**
|
|
4980
5009
|
* Provider response body: parsed JSON when the response is JSON, the raw
|
|
4981
5010
|
* string otherwise (e.g. a `text/plain` unified diff round-trips intact).
|
|
5011
|
+
* A base64 string when `encoding` is `'base64'`.
|
|
4982
5012
|
*/
|
|
4983
5013
|
data: unknown;
|
|
5014
|
+
/**
|
|
5015
|
+
* BAC-2677 — `'base64'` when `data` is the provider body base64-encoded
|
|
5016
|
+
* (the request asked for `responseType: 'base64'` and the provider answered
|
|
5017
|
+
* 2xx). Absent means `data` took the normal JSON/text path, so a caller that
|
|
5018
|
+
* asked for bytes can tell when it did not get them.
|
|
5019
|
+
*/
|
|
5020
|
+
encoding?: 'base64';
|
|
4984
5021
|
}
|
|
4985
5022
|
|
|
4986
5023
|
export declare const Integrations: IntegrationsApi;
|
|
@@ -5946,7 +5983,14 @@ export declare interface LuaAgentConfig {
|
|
|
5946
5983
|
*/
|
|
5947
5984
|
export declare type LuaAgentModel = string | ((request: LuaRequest) => string | Promise<string>);
|
|
5948
5985
|
|
|
5949
|
-
/**
|
|
5986
|
+
/**
|
|
5987
|
+
* The signed-in person a route runs for (never an API key, never anonymous).
|
|
5988
|
+
*
|
|
5989
|
+
* `auth.accessLevel` says how much of the app they may use: `'full'` when they can read the app's agent, or
|
|
5990
|
+
* `'view_only'` when someone shared just this view with them (or it is org-wide in their workspace) — then only
|
|
5991
|
+
* `GET` routes reach your handlers, `roles` and `scopes` are empty, and the agent pane is off. A `GET` route must
|
|
5992
|
+
* therefore only read: never create, change or delete anything in one.
|
|
5993
|
+
*/
|
|
5950
5994
|
export declare type LuaAuth = WebRouteAuth;
|
|
5951
5995
|
|
|
5952
5996
|
export declare class LuaBrowser {
|
|
@@ -6122,6 +6166,29 @@ export declare interface LuaDeviceTriggerConfig {
|
|
|
6122
6166
|
execute: (payload: any, context: DeviceTriggerContext) => Promise<any>;
|
|
6123
6167
|
}
|
|
6124
6168
|
|
|
6169
|
+
/**
|
|
6170
|
+
* The agent's own identity, proven by the platform (ADR 0025).
|
|
6171
|
+
*/
|
|
6172
|
+
export declare interface LuaIdentity {
|
|
6173
|
+
/**
|
|
6174
|
+
* Mint a fresh agent identity assertion for `audience`. Only platform-allowlisted audiences are minted; today
|
|
6175
|
+
* that is `'lua-api:staff'` (Lua's staff API, for an agent enrolled as a staff service principal).
|
|
6176
|
+
*
|
|
6177
|
+
* Throws an `AgentIdentityError` (`err.code`):
|
|
6178
|
+
* - `agent_identity_requires_live_execution` outside a live execution (always in `lua test` / `lua dev`);
|
|
6179
|
+
* - `agent_identity_audience_not_allowed` for any other audience;
|
|
6180
|
+
* - `agent_identity_input_invalid` when `audience` is missing;
|
|
6181
|
+
* - `agent_identity_unavailable` when the platform cannot mint one right now.
|
|
6182
|
+
*
|
|
6183
|
+
* Inside a test session it throws a `TestSessionError` with `test_session_tier_unsupported` instead.
|
|
6184
|
+
*
|
|
6185
|
+
* Mint one per call. A token is single-use, so never cache or reuse it.
|
|
6186
|
+
*/
|
|
6187
|
+
assertion(input: {
|
|
6188
|
+
audience: string;
|
|
6189
|
+
}): Promise<AgentIdentityAssertion>;
|
|
6190
|
+
}
|
|
6191
|
+
|
|
6125
6192
|
/**
|
|
6126
6193
|
* Lua Job class.
|
|
6127
6194
|
* Main class for building scheduled jobs (cron jobs, one-time tasks, intervals).
|
|
@@ -6469,6 +6536,11 @@ export declare interface LuaRequest {
|
|
|
6469
6536
|
export declare interface LuaRuntime {
|
|
6470
6537
|
/** Request context information */
|
|
6471
6538
|
request: LuaRequest;
|
|
6539
|
+
/**
|
|
6540
|
+
* The agent's platform-proven identity (ADR 0025). Optional because older runtimes do not provide it, so read it
|
|
6541
|
+
* defensively: `Lua.identity?.assertion`.
|
|
6542
|
+
*/
|
|
6543
|
+
identity?: LuaIdentity;
|
|
6472
6544
|
}
|
|
6473
6545
|
|
|
6474
6546
|
/**
|
|
@@ -6584,6 +6656,22 @@ export declare interface LuaTool<TInput extends ZodType = ZodType> {
|
|
|
6584
6656
|
name: string;
|
|
6585
6657
|
/** Description of what the tool does */
|
|
6586
6658
|
description: string;
|
|
6659
|
+
/**
|
|
6660
|
+
* Optional text the chat shows to the user while this tool runs and after it
|
|
6661
|
+
* finishes, instead of the tool's name. Either one text for both moments, or
|
|
6662
|
+
* one for each:
|
|
6663
|
+
*
|
|
6664
|
+
* ```ts
|
|
6665
|
+
* label = { running: 'Creating a ticket for {subject}', done: 'Created a ticket for {subject}' };
|
|
6666
|
+
* label = 'Checked stock';
|
|
6667
|
+
* ```
|
|
6668
|
+
*
|
|
6669
|
+
* `{argName}` is replaced with that argument's value from the call (string
|
|
6670
|
+
* and number arguments only). Don't end the text with "…": the chat adds it
|
|
6671
|
+
* while the tool runs. Each text is a string literal (or a const holding one)
|
|
6672
|
+
* of at most 80 characters; `lua compile` ignores a computed label.
|
|
6673
|
+
*/
|
|
6674
|
+
label?: ToolLabel;
|
|
6587
6675
|
/** Zod schema for input validation */
|
|
6588
6676
|
inputSchema: TInput;
|
|
6589
6677
|
/**
|
|
@@ -6849,15 +6937,15 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6849
6937
|
*/
|
|
6850
6938
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
6851
6939
|
}, "strip", z.ZodTypeAny, {
|
|
6852
|
-
model: string;
|
|
6853
6940
|
kind: "inference";
|
|
6854
|
-
|
|
6941
|
+
model: string;
|
|
6855
6942
|
options?: Record<string, unknown> | undefined;
|
|
6943
|
+
voice?: string | undefined;
|
|
6856
6944
|
}, {
|
|
6857
|
-
model: string;
|
|
6858
6945
|
kind: "inference";
|
|
6859
|
-
|
|
6946
|
+
model: string;
|
|
6860
6947
|
options?: Record<string, unknown> | undefined;
|
|
6948
|
+
voice?: string | undefined;
|
|
6861
6949
|
}>, z.ZodObject<{
|
|
6862
6950
|
kind: z.ZodLiteral<"plugin">;
|
|
6863
6951
|
provider: z.ZodEnum<["deepgram", "elevenlabs"]>;
|
|
@@ -6872,13 +6960,13 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6872
6960
|
}, "strip", z.ZodTypeAny, {
|
|
6873
6961
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6874
6962
|
options: Record<string, unknown>;
|
|
6875
|
-
provider: "deepgram" | "elevenlabs";
|
|
6876
6963
|
kind: "plugin";
|
|
6964
|
+
provider: "deepgram" | "elevenlabs";
|
|
6877
6965
|
}, {
|
|
6878
6966
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6879
6967
|
options: Record<string, unknown>;
|
|
6880
|
-
provider: "deepgram" | "elevenlabs";
|
|
6881
6968
|
kind: "plugin";
|
|
6969
|
+
provider: "deepgram" | "elevenlabs";
|
|
6882
6970
|
}>, z.ZodObject<{
|
|
6883
6971
|
kind: z.ZodLiteral<"realtime">;
|
|
6884
6972
|
provider: z.ZodEnum<["openai", "google", "xai"]>;
|
|
@@ -6891,12 +6979,12 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6891
6979
|
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6892
6980
|
}, "strip", z.ZodTypeAny, {
|
|
6893
6981
|
options: Record<string, unknown>;
|
|
6894
|
-
provider: "openai" | "google" | "xai";
|
|
6895
6982
|
kind: "realtime";
|
|
6983
|
+
provider: "openai" | "google" | "xai";
|
|
6896
6984
|
}, {
|
|
6897
6985
|
options: Record<string, unknown>;
|
|
6898
|
-
provider: "openai" | "google" | "xai";
|
|
6899
6986
|
kind: "realtime";
|
|
6987
|
+
provider: "openai" | "google" | "xai";
|
|
6900
6988
|
}>]>;
|
|
6901
6989
|
stt: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
6902
6990
|
kind: z.ZodLiteral<"inference">;
|
|
@@ -6915,15 +7003,15 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6915
7003
|
*/
|
|
6916
7004
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
6917
7005
|
}, "strip", z.ZodTypeAny, {
|
|
6918
|
-
model: string;
|
|
6919
7006
|
kind: "inference";
|
|
6920
|
-
|
|
7007
|
+
model: string;
|
|
6921
7008
|
options?: Record<string, unknown> | undefined;
|
|
7009
|
+
voice?: string | undefined;
|
|
6922
7010
|
}, {
|
|
6923
|
-
model: string;
|
|
6924
7011
|
kind: "inference";
|
|
6925
|
-
|
|
7012
|
+
model: string;
|
|
6926
7013
|
options?: Record<string, unknown> | undefined;
|
|
7014
|
+
voice?: string | undefined;
|
|
6927
7015
|
}>, z.ZodObject<{
|
|
6928
7016
|
kind: z.ZodLiteral<"plugin">;
|
|
6929
7017
|
provider: z.ZodEnum<["deepgram", "elevenlabs"]>;
|
|
@@ -6938,13 +7026,13 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6938
7026
|
}, "strip", z.ZodTypeAny, {
|
|
6939
7027
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6940
7028
|
options: Record<string, unknown>;
|
|
6941
|
-
provider: "deepgram" | "elevenlabs";
|
|
6942
7029
|
kind: "plugin";
|
|
7030
|
+
provider: "deepgram" | "elevenlabs";
|
|
6943
7031
|
}, {
|
|
6944
7032
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
6945
7033
|
options: Record<string, unknown>;
|
|
6946
|
-
provider: "deepgram" | "elevenlabs";
|
|
6947
7034
|
kind: "plugin";
|
|
7035
|
+
provider: "deepgram" | "elevenlabs";
|
|
6948
7036
|
}>, z.ZodObject<{
|
|
6949
7037
|
kind: z.ZodLiteral<"realtime">;
|
|
6950
7038
|
provider: z.ZodEnum<["openai", "google", "xai"]>;
|
|
@@ -6957,12 +7045,12 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6957
7045
|
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6958
7046
|
}, "strip", z.ZodTypeAny, {
|
|
6959
7047
|
options: Record<string, unknown>;
|
|
6960
|
-
provider: "openai" | "google" | "xai";
|
|
6961
7048
|
kind: "realtime";
|
|
7049
|
+
provider: "openai" | "google" | "xai";
|
|
6962
7050
|
}, {
|
|
6963
7051
|
options: Record<string, unknown>;
|
|
6964
|
-
provider: "openai" | "google" | "xai";
|
|
6965
7052
|
kind: "realtime";
|
|
7053
|
+
provider: "openai" | "google" | "xai";
|
|
6966
7054
|
}>]>>;
|
|
6967
7055
|
tts: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
6968
7056
|
kind: z.ZodLiteral<"inference">;
|
|
@@ -6981,15 +7069,15 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
6981
7069
|
*/
|
|
6982
7070
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
6983
7071
|
}, "strip", z.ZodTypeAny, {
|
|
6984
|
-
model: string;
|
|
6985
7072
|
kind: "inference";
|
|
6986
|
-
|
|
7073
|
+
model: string;
|
|
6987
7074
|
options?: Record<string, unknown> | undefined;
|
|
7075
|
+
voice?: string | undefined;
|
|
6988
7076
|
}, {
|
|
6989
|
-
model: string;
|
|
6990
7077
|
kind: "inference";
|
|
6991
|
-
|
|
7078
|
+
model: string;
|
|
6992
7079
|
options?: Record<string, unknown> | undefined;
|
|
7080
|
+
voice?: string | undefined;
|
|
6993
7081
|
}>, z.ZodObject<{
|
|
6994
7082
|
kind: z.ZodLiteral<"plugin">;
|
|
6995
7083
|
provider: z.ZodEnum<["deepgram", "elevenlabs"]>;
|
|
@@ -7004,13 +7092,13 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7004
7092
|
}, "strip", z.ZodTypeAny, {
|
|
7005
7093
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7006
7094
|
options: Record<string, unknown>;
|
|
7007
|
-
provider: "deepgram" | "elevenlabs";
|
|
7008
7095
|
kind: "plugin";
|
|
7096
|
+
provider: "deepgram" | "elevenlabs";
|
|
7009
7097
|
}, {
|
|
7010
7098
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7011
7099
|
options: Record<string, unknown>;
|
|
7012
|
-
provider: "deepgram" | "elevenlabs";
|
|
7013
7100
|
kind: "plugin";
|
|
7101
|
+
provider: "deepgram" | "elevenlabs";
|
|
7014
7102
|
}>, z.ZodObject<{
|
|
7015
7103
|
kind: z.ZodLiteral<"realtime">;
|
|
7016
7104
|
provider: z.ZodEnum<["openai", "google", "xai"]>;
|
|
@@ -7023,12 +7111,12 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7023
7111
|
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
7024
7112
|
}, "strip", z.ZodTypeAny, {
|
|
7025
7113
|
options: Record<string, unknown>;
|
|
7026
|
-
provider: "openai" | "google" | "xai";
|
|
7027
7114
|
kind: "realtime";
|
|
7115
|
+
provider: "openai" | "google" | "xai";
|
|
7028
7116
|
}, {
|
|
7029
7117
|
options: Record<string, unknown>;
|
|
7030
|
-
provider: "openai" | "google" | "xai";
|
|
7031
7118
|
kind: "realtime";
|
|
7119
|
+
provider: "openai" | "google" | "xai";
|
|
7032
7120
|
}>]>>;
|
|
7033
7121
|
vad: z.ZodOptional<z.ZodString>;
|
|
7034
7122
|
vadOptions: z.ZodOptional<z.ZodObject<{
|
|
@@ -7187,52 +7275,52 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7187
7275
|
excludeTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7188
7276
|
}, "strip", z.ZodTypeAny, {
|
|
7189
7277
|
llm: {
|
|
7190
|
-
model: string;
|
|
7191
7278
|
kind: "inference";
|
|
7192
|
-
|
|
7279
|
+
model: string;
|
|
7193
7280
|
options?: Record<string, unknown> | undefined;
|
|
7281
|
+
voice?: string | undefined;
|
|
7194
7282
|
} | {
|
|
7195
7283
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7196
7284
|
options: Record<string, unknown>;
|
|
7197
|
-
provider: "deepgram" | "elevenlabs";
|
|
7198
7285
|
kind: "plugin";
|
|
7286
|
+
provider: "deepgram" | "elevenlabs";
|
|
7199
7287
|
} | {
|
|
7200
7288
|
options: Record<string, unknown>;
|
|
7201
|
-
provider: "openai" | "google" | "xai";
|
|
7202
7289
|
kind: "realtime";
|
|
7290
|
+
provider: "openai" | "google" | "xai";
|
|
7203
7291
|
};
|
|
7204
7292
|
name?: string | undefined;
|
|
7205
7293
|
vad?: string | undefined;
|
|
7206
7294
|
stt?: {
|
|
7207
|
-
model: string;
|
|
7208
7295
|
kind: "inference";
|
|
7209
|
-
|
|
7296
|
+
model: string;
|
|
7210
7297
|
options?: Record<string, unknown> | undefined;
|
|
7298
|
+
voice?: string | undefined;
|
|
7211
7299
|
} | {
|
|
7212
7300
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7213
7301
|
options: Record<string, unknown>;
|
|
7214
|
-
provider: "deepgram" | "elevenlabs";
|
|
7215
7302
|
kind: "plugin";
|
|
7303
|
+
provider: "deepgram" | "elevenlabs";
|
|
7216
7304
|
} | {
|
|
7217
7305
|
options: Record<string, unknown>;
|
|
7218
|
-
provider: "openai" | "google" | "xai";
|
|
7219
7306
|
kind: "realtime";
|
|
7307
|
+
provider: "openai" | "google" | "xai";
|
|
7220
7308
|
} | undefined;
|
|
7221
7309
|
volume?: number | undefined;
|
|
7222
7310
|
tts?: {
|
|
7223
|
-
model: string;
|
|
7224
7311
|
kind: "inference";
|
|
7225
|
-
|
|
7312
|
+
model: string;
|
|
7226
7313
|
options?: Record<string, unknown> | undefined;
|
|
7314
|
+
voice?: string | undefined;
|
|
7227
7315
|
} | {
|
|
7228
7316
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7229
7317
|
options: Record<string, unknown>;
|
|
7230
|
-
provider: "deepgram" | "elevenlabs";
|
|
7231
7318
|
kind: "plugin";
|
|
7319
|
+
provider: "deepgram" | "elevenlabs";
|
|
7232
7320
|
} | {
|
|
7233
7321
|
options: Record<string, unknown>;
|
|
7234
|
-
provider: "openai" | "google" | "xai";
|
|
7235
7322
|
kind: "realtime";
|
|
7323
|
+
provider: "openai" | "google" | "xai";
|
|
7236
7324
|
} | undefined;
|
|
7237
7325
|
vadOptions?: {
|
|
7238
7326
|
minSpeechDuration?: number | undefined;
|
|
@@ -7281,52 +7369,52 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7281
7369
|
excludeTools?: string[] | undefined;
|
|
7282
7370
|
}, {
|
|
7283
7371
|
llm: {
|
|
7284
|
-
model: string;
|
|
7285
7372
|
kind: "inference";
|
|
7286
|
-
|
|
7373
|
+
model: string;
|
|
7287
7374
|
options?: Record<string, unknown> | undefined;
|
|
7375
|
+
voice?: string | undefined;
|
|
7288
7376
|
} | {
|
|
7289
7377
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7290
7378
|
options: Record<string, unknown>;
|
|
7291
|
-
provider: "deepgram" | "elevenlabs";
|
|
7292
7379
|
kind: "plugin";
|
|
7380
|
+
provider: "deepgram" | "elevenlabs";
|
|
7293
7381
|
} | {
|
|
7294
7382
|
options: Record<string, unknown>;
|
|
7295
|
-
provider: "openai" | "google" | "xai";
|
|
7296
7383
|
kind: "realtime";
|
|
7384
|
+
provider: "openai" | "google" | "xai";
|
|
7297
7385
|
};
|
|
7298
7386
|
name?: string | undefined;
|
|
7299
7387
|
vad?: string | undefined;
|
|
7300
7388
|
stt?: {
|
|
7301
|
-
model: string;
|
|
7302
7389
|
kind: "inference";
|
|
7303
|
-
|
|
7390
|
+
model: string;
|
|
7304
7391
|
options?: Record<string, unknown> | undefined;
|
|
7392
|
+
voice?: string | undefined;
|
|
7305
7393
|
} | {
|
|
7306
7394
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7307
7395
|
options: Record<string, unknown>;
|
|
7308
|
-
provider: "deepgram" | "elevenlabs";
|
|
7309
7396
|
kind: "plugin";
|
|
7397
|
+
provider: "deepgram" | "elevenlabs";
|
|
7310
7398
|
} | {
|
|
7311
7399
|
options: Record<string, unknown>;
|
|
7312
|
-
provider: "openai" | "google" | "xai";
|
|
7313
7400
|
kind: "realtime";
|
|
7401
|
+
provider: "openai" | "google" | "xai";
|
|
7314
7402
|
} | undefined;
|
|
7315
7403
|
volume?: number | undefined;
|
|
7316
7404
|
tts?: {
|
|
7317
|
-
model: string;
|
|
7318
7405
|
kind: "inference";
|
|
7319
|
-
|
|
7406
|
+
model: string;
|
|
7320
7407
|
options?: Record<string, unknown> | undefined;
|
|
7408
|
+
voice?: string | undefined;
|
|
7321
7409
|
} | {
|
|
7322
7410
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7323
7411
|
options: Record<string, unknown>;
|
|
7324
|
-
provider: "deepgram" | "elevenlabs";
|
|
7325
7412
|
kind: "plugin";
|
|
7413
|
+
provider: "deepgram" | "elevenlabs";
|
|
7326
7414
|
} | {
|
|
7327
7415
|
options: Record<string, unknown>;
|
|
7328
|
-
provider: "openai" | "google" | "xai";
|
|
7329
7416
|
kind: "realtime";
|
|
7417
|
+
provider: "openai" | "google" | "xai";
|
|
7330
7418
|
} | undefined;
|
|
7331
7419
|
vadOptions?: {
|
|
7332
7420
|
minSpeechDuration?: number | undefined;
|
|
@@ -7375,52 +7463,52 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7375
7463
|
excludeTools?: string[] | undefined;
|
|
7376
7464
|
}>, {
|
|
7377
7465
|
llm: {
|
|
7378
|
-
model: string;
|
|
7379
7466
|
kind: "inference";
|
|
7380
|
-
|
|
7467
|
+
model: string;
|
|
7381
7468
|
options?: Record<string, unknown> | undefined;
|
|
7469
|
+
voice?: string | undefined;
|
|
7382
7470
|
} | {
|
|
7383
7471
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7384
7472
|
options: Record<string, unknown>;
|
|
7385
|
-
provider: "deepgram" | "elevenlabs";
|
|
7386
7473
|
kind: "plugin";
|
|
7474
|
+
provider: "deepgram" | "elevenlabs";
|
|
7387
7475
|
} | {
|
|
7388
7476
|
options: Record<string, unknown>;
|
|
7389
|
-
provider: "openai" | "google" | "xai";
|
|
7390
7477
|
kind: "realtime";
|
|
7478
|
+
provider: "openai" | "google" | "xai";
|
|
7391
7479
|
};
|
|
7392
7480
|
name?: string | undefined;
|
|
7393
7481
|
vad?: string | undefined;
|
|
7394
7482
|
stt?: {
|
|
7395
|
-
model: string;
|
|
7396
7483
|
kind: "inference";
|
|
7397
|
-
|
|
7484
|
+
model: string;
|
|
7398
7485
|
options?: Record<string, unknown> | undefined;
|
|
7486
|
+
voice?: string | undefined;
|
|
7399
7487
|
} | {
|
|
7400
7488
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7401
7489
|
options: Record<string, unknown>;
|
|
7402
|
-
provider: "deepgram" | "elevenlabs";
|
|
7403
7490
|
kind: "plugin";
|
|
7491
|
+
provider: "deepgram" | "elevenlabs";
|
|
7404
7492
|
} | {
|
|
7405
7493
|
options: Record<string, unknown>;
|
|
7406
|
-
provider: "openai" | "google" | "xai";
|
|
7407
7494
|
kind: "realtime";
|
|
7495
|
+
provider: "openai" | "google" | "xai";
|
|
7408
7496
|
} | undefined;
|
|
7409
7497
|
volume?: number | undefined;
|
|
7410
7498
|
tts?: {
|
|
7411
|
-
model: string;
|
|
7412
7499
|
kind: "inference";
|
|
7413
|
-
|
|
7500
|
+
model: string;
|
|
7414
7501
|
options?: Record<string, unknown> | undefined;
|
|
7502
|
+
voice?: string | undefined;
|
|
7415
7503
|
} | {
|
|
7416
7504
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7417
7505
|
options: Record<string, unknown>;
|
|
7418
|
-
provider: "deepgram" | "elevenlabs";
|
|
7419
7506
|
kind: "plugin";
|
|
7507
|
+
provider: "deepgram" | "elevenlabs";
|
|
7420
7508
|
} | {
|
|
7421
7509
|
options: Record<string, unknown>;
|
|
7422
|
-
provider: "openai" | "google" | "xai";
|
|
7423
7510
|
kind: "realtime";
|
|
7511
|
+
provider: "openai" | "google" | "xai";
|
|
7424
7512
|
} | undefined;
|
|
7425
7513
|
vadOptions?: {
|
|
7426
7514
|
minSpeechDuration?: number | undefined;
|
|
@@ -7469,52 +7557,52 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
7469
7557
|
excludeTools?: string[] | undefined;
|
|
7470
7558
|
}, {
|
|
7471
7559
|
llm: {
|
|
7472
|
-
model: string;
|
|
7473
7560
|
kind: "inference";
|
|
7474
|
-
|
|
7561
|
+
model: string;
|
|
7475
7562
|
options?: Record<string, unknown> | undefined;
|
|
7563
|
+
voice?: string | undefined;
|
|
7476
7564
|
} | {
|
|
7477
7565
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7478
7566
|
options: Record<string, unknown>;
|
|
7479
|
-
provider: "deepgram" | "elevenlabs";
|
|
7480
7567
|
kind: "plugin";
|
|
7568
|
+
provider: "deepgram" | "elevenlabs";
|
|
7481
7569
|
} | {
|
|
7482
7570
|
options: Record<string, unknown>;
|
|
7483
|
-
provider: "openai" | "google" | "xai";
|
|
7484
7571
|
kind: "realtime";
|
|
7572
|
+
provider: "openai" | "google" | "xai";
|
|
7485
7573
|
};
|
|
7486
7574
|
name?: string | undefined;
|
|
7487
7575
|
vad?: string | undefined;
|
|
7488
7576
|
stt?: {
|
|
7489
|
-
model: string;
|
|
7490
7577
|
kind: "inference";
|
|
7491
|
-
|
|
7578
|
+
model: string;
|
|
7492
7579
|
options?: Record<string, unknown> | undefined;
|
|
7580
|
+
voice?: string | undefined;
|
|
7493
7581
|
} | {
|
|
7494
7582
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7495
7583
|
options: Record<string, unknown>;
|
|
7496
|
-
provider: "deepgram" | "elevenlabs";
|
|
7497
7584
|
kind: "plugin";
|
|
7585
|
+
provider: "deepgram" | "elevenlabs";
|
|
7498
7586
|
} | {
|
|
7499
7587
|
options: Record<string, unknown>;
|
|
7500
|
-
provider: "openai" | "google" | "xai";
|
|
7501
7588
|
kind: "realtime";
|
|
7589
|
+
provider: "openai" | "google" | "xai";
|
|
7502
7590
|
} | undefined;
|
|
7503
7591
|
volume?: number | undefined;
|
|
7504
7592
|
tts?: {
|
|
7505
|
-
model: string;
|
|
7506
7593
|
kind: "inference";
|
|
7507
|
-
|
|
7594
|
+
model: string;
|
|
7508
7595
|
options?: Record<string, unknown> | undefined;
|
|
7596
|
+
voice?: string | undefined;
|
|
7509
7597
|
} | {
|
|
7510
7598
|
class: "LLM" | "STT" | "STTv2" | "TTS";
|
|
7511
7599
|
options: Record<string, unknown>;
|
|
7512
|
-
provider: "deepgram" | "elevenlabs";
|
|
7513
7600
|
kind: "plugin";
|
|
7601
|
+
provider: "deepgram" | "elevenlabs";
|
|
7514
7602
|
} | {
|
|
7515
7603
|
options: Record<string, unknown>;
|
|
7516
|
-
provider: "openai" | "google" | "xai";
|
|
7517
7604
|
kind: "realtime";
|
|
7605
|
+
provider: "openai" | "google" | "xai";
|
|
7518
7606
|
} | undefined;
|
|
7519
7607
|
vadOptions?: {
|
|
7520
7608
|
minSpeechDuration?: number | undefined;
|
|
@@ -7608,6 +7696,7 @@ export declare class LuaVoiceTool<TInput extends ZodType = ZodType> implements L
|
|
|
7608
7696
|
readonly inputSchema: TInput;
|
|
7609
7697
|
readonly execute: (input: any, ctx?: LuaVoiceToolCtx) => Promise<any>;
|
|
7610
7698
|
readonly condition?: () => Promise<boolean>;
|
|
7699
|
+
readonly label?: ToolLabel;
|
|
7611
7700
|
readonly voice?: {
|
|
7612
7701
|
flags?: ToolFlag[];
|
|
7613
7702
|
};
|
|
@@ -7626,6 +7715,8 @@ export declare interface LuaVoiceToolConfig<TInput extends ZodType = ZodType> {
|
|
|
7626
7715
|
execute: (input: any, ctx?: LuaVoiceToolCtx) => Promise<any>;
|
|
7627
7716
|
condition?: () => Promise<boolean>;
|
|
7628
7717
|
flags?: ToolFlag[];
|
|
7718
|
+
/** What a step shows while the tool runs and when it is done, as on `LuaTool`. */
|
|
7719
|
+
label?: ToolLabel;
|
|
7629
7720
|
}
|
|
7630
7721
|
|
|
7631
7722
|
/**
|
|
@@ -9369,6 +9460,22 @@ export declare interface RefusedAnswer {
|
|
|
9369
9460
|
|
|
9370
9461
|
export declare type ReplyChannel = 'whatsapp' | 'sms' | 'email' | 'webchat' | 'slack';
|
|
9371
9462
|
|
|
9463
|
+
/**
|
|
9464
|
+
* Reply versions on a stored conversation. A version is a block: one user row and the
|
|
9465
|
+
* rows after it up to the next user row. A re-run of the latest turn hides the current
|
|
9466
|
+
* block (`metadata.inactiveVersion`) and stamps `metadata.replyVersion` on the user row
|
|
9467
|
+
* of every block of the turn. Readers fold rich parts first, then call
|
|
9468
|
+
* `applyReplyVersions`, so a hidden reply's citations leave with it.
|
|
9469
|
+
*/
|
|
9470
|
+
declare interface ReplyVersionInfo {
|
|
9471
|
+
group: string;
|
|
9472
|
+
/** 1-based. */
|
|
9473
|
+
index: number;
|
|
9474
|
+
total: number;
|
|
9475
|
+
/** The version the agent reads; the others are hidden from it. */
|
|
9476
|
+
active: boolean;
|
|
9477
|
+
}
|
|
9478
|
+
|
|
9372
9479
|
declare interface RequestCredential {
|
|
9373
9480
|
readonly descriptor: RequestCredentialDescriptor;
|
|
9374
9481
|
bearer(): Promise<string>;
|
|
@@ -10644,6 +10751,12 @@ export declare enum ToolFlag {
|
|
|
10644
10751
|
DISALLOW_INTERRUPTION = "disallow_interruption"
|
|
10645
10752
|
}
|
|
10646
10753
|
|
|
10754
|
+
/** A tool's `label`: one text for both moments, or one while it runs and one when it is done. `{arg}` fills from the call. */
|
|
10755
|
+
declare type ToolLabel = string | {
|
|
10756
|
+
running: string;
|
|
10757
|
+
done: string;
|
|
10758
|
+
};
|
|
10759
|
+
|
|
10647
10760
|
export declare interface ToolStepOptions {
|
|
10648
10761
|
input?: LuaMapConfig;
|
|
10649
10762
|
timeoutSeconds?: number;
|
|
@@ -11251,6 +11364,9 @@ export declare interface WebhookRequest {
|
|
|
11251
11364
|
payload: any;
|
|
11252
11365
|
}
|
|
11253
11366
|
|
|
11367
|
+
/** LUA-1353 — see {@link WebRouteAuth.accessLevel}. */
|
|
11368
|
+
declare type WebRouteAccessLevel = 'full' | 'view_only';
|
|
11369
|
+
|
|
11254
11370
|
/** The app the handler belongs to, for `ctx.app` and log correlation. */
|
|
11255
11371
|
declare interface WebRouteApp {
|
|
11256
11372
|
id: string;
|
|
@@ -11281,6 +11397,14 @@ declare interface WebRouteAuth {
|
|
|
11281
11397
|
email?: string;
|
|
11282
11398
|
/** ISO timestamp the session token expires at, when known. */
|
|
11283
11399
|
expiresAt?: string;
|
|
11400
|
+
/**
|
|
11401
|
+
* LUA-1353 — how much of the app the caller may use. `full`: they can read the app's agent (every route, the
|
|
11402
|
+
* agent pane). `view_only`: the app was shared with them, or is org-wide in their workspace, without access to
|
|
11403
|
+
* the agent — only `GET` routes reach a handler, `roles` and `scopes` are empty, and the agent pane is off. A
|
|
11404
|
+
* `GET` handler must therefore never change anything. Absent only from a gateway older than LUA-1353 (read it
|
|
11405
|
+
* as `full`).
|
|
11406
|
+
*/
|
|
11407
|
+
accessLevel?: WebRouteAccessLevel;
|
|
11284
11408
|
}
|
|
11285
11409
|
|
|
11286
11410
|
declare type WebRouteMethod = (typeof WEB_ROUTE_METHODS)[number];
|