lua-cli 3.24.0 → 3.25.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 +78 -0
- package/dist/api-exports.js +73 -2
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +83 -3
- package/dist/index.js.map +1 -1
- package/docs/README.md +2 -2
- package/package.json +1 -1
- package/template/package.json +1 -1
package/dist/api-exports.d.ts
CHANGED
|
@@ -1831,6 +1831,60 @@ declare interface ImmutableUserProfile {
|
|
|
1831
1831
|
emailAddresses: string[];
|
|
1832
1832
|
}
|
|
1833
1833
|
|
|
1834
|
+
/**
|
|
1835
|
+
* PRO-1208 (B7) — `User.Inbox.push()`: the governed SDK door into a user's
|
|
1836
|
+
* inbox. Shared between the sandbox runtime (the SDK surface), lua-core (the
|
|
1837
|
+
* seam's `runInboxPush`) and lua-api (the lua-cli dev route) so all three
|
|
1838
|
+
* speak one wire contract.
|
|
1839
|
+
*/
|
|
1840
|
+
/** What the card offers. `approve` requires `options` (routed through the
|
|
1841
|
+
* agent-question path so answers are one click); `fix` requires
|
|
1842
|
+
* `connection`; plain notices need neither. */
|
|
1843
|
+
declare type InboxPushAction = 'approve' | 'redirect' | 'fix';
|
|
1844
|
+
|
|
1845
|
+
declare interface InboxPushInput {
|
|
1846
|
+
/** Card title — the row's first line. 1..140 chars after trim. */
|
|
1847
|
+
title: string;
|
|
1848
|
+
/** The human body — the row's context line and the detail pane's prose. */
|
|
1849
|
+
body: string;
|
|
1850
|
+
/** Optional longer detail shown only in the drill-in pane. */
|
|
1851
|
+
detail?: string;
|
|
1852
|
+
/** Primary link out (issue URL, doc permalink) — rendered as the card's
|
|
1853
|
+
* source link, never auto-opened. */
|
|
1854
|
+
deeplink?: string;
|
|
1855
|
+
/** Server-clamped: urgent is limited per day and demoted when over budget. */
|
|
1856
|
+
priority?: 'urgent' | 'high' | 'normal' | 'low';
|
|
1857
|
+
actions?: InboxPushAction[];
|
|
1858
|
+
/** One-click answers (2..4). Presence routes the push through the
|
|
1859
|
+
* agent-question path — the user's pick resolves the card. */
|
|
1860
|
+
options?: {
|
|
1861
|
+
label: string;
|
|
1862
|
+
description?: string;
|
|
1863
|
+
}[];
|
|
1864
|
+
/** For `fix`: the integration the agent needs — catalog slug + display name. */
|
|
1865
|
+
connection?: {
|
|
1866
|
+
type: string;
|
|
1867
|
+
name: string;
|
|
1868
|
+
};
|
|
1869
|
+
/** Idempotency/revision key: same key = revise the existing card in place,
|
|
1870
|
+
* never a second knock. Omit for one-shot notices. */
|
|
1871
|
+
key?: string;
|
|
1872
|
+
/** Conversation the card should hand off into when the user acts. */
|
|
1873
|
+
threadId?: string;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
declare type InboxPushOutcome = 'deposited' | 'updated' | 'exists' | 'capped';
|
|
1877
|
+
|
|
1878
|
+
declare interface InboxPushReceipt {
|
|
1879
|
+
outcome: InboxPushOutcome;
|
|
1880
|
+
/** The inbox kind the push routed to. */
|
|
1881
|
+
kind: 'input_request' | 'connection_fix' | 'agent_notice';
|
|
1882
|
+
/** Echo of the dedup key (or the generated one) — reuse it to revise. */
|
|
1883
|
+
key: string;
|
|
1884
|
+
/** Present on `capped`: what to tell the agent author. */
|
|
1885
|
+
reason?: string;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1834
1888
|
/**
|
|
1835
1889
|
* Job with versions array
|
|
1836
1890
|
* Matches JobDto and job.schema.ts
|
|
@@ -2368,6 +2422,7 @@ export declare const Lua: LuaRuntime;
|
|
|
2368
2422
|
*/
|
|
2369
2423
|
export declare class LuaAgent {
|
|
2370
2424
|
private readonly name;
|
|
2425
|
+
private readonly description?;
|
|
2371
2426
|
private readonly persona;
|
|
2372
2427
|
private readonly model?;
|
|
2373
2428
|
private readonly modelSettings?;
|
|
@@ -2402,6 +2457,8 @@ export declare class LuaAgent {
|
|
|
2402
2457
|
*/
|
|
2403
2458
|
constructor(config: LuaAgentConfig);
|
|
2404
2459
|
getName(): string;
|
|
2460
|
+
/** Capability summary consumed by Space routing. */
|
|
2461
|
+
getDescription(): string | undefined;
|
|
2405
2462
|
/** Browser switch (LuaBrowser) — `true`/config when the agent can browse. */
|
|
2406
2463
|
getBrowser(): LuaAgentConfig['browser'];
|
|
2407
2464
|
getPersona(): PersonaText;
|
|
@@ -2422,6 +2479,12 @@ export declare class LuaAgent {
|
|
|
2422
2479
|
export declare interface LuaAgentConfig {
|
|
2423
2480
|
/** Agent name (used for identification) */
|
|
2424
2481
|
name: string;
|
|
2482
|
+
/**
|
|
2483
|
+
* Short capability summary used by Spaces to decide when to delegate to
|
|
2484
|
+
* this agent. Keep this focused on what the agent can do; the persona owns
|
|
2485
|
+
* behavior, voice, and detailed instructions.
|
|
2486
|
+
*/
|
|
2487
|
+
description?: string;
|
|
2425
2488
|
/** Agent persona - defines the agent's behavior and personality */
|
|
2426
2489
|
persona: PersonaText;
|
|
2427
2490
|
/** LLM model to use — 'provider/model' string or resolver function */
|
|
@@ -5545,6 +5608,21 @@ export declare const User: {
|
|
|
5545
5608
|
* ```
|
|
5546
5609
|
*/
|
|
5547
5610
|
getChatHistory(): Promise<ChatHistoryMessage[]>;
|
|
5611
|
+
/**
|
|
5612
|
+
* PRO-1208 (B7) — push an approve/redirect/fix card to YOUR OWN inbox.
|
|
5613
|
+
* Capped (5/day per agent), urgent-clamped, same-`key` deduped (revise in
|
|
5614
|
+
* place). Cap-hit resolves to `{outcome: 'capped'}` — never throws.
|
|
5615
|
+
*
|
|
5616
|
+
* @example
|
|
5617
|
+
* const receipt = await User.Inbox.push({
|
|
5618
|
+
* title: 'Nightly digest ready',
|
|
5619
|
+
* body: 'Built and filed to the Library.',
|
|
5620
|
+
* key: 'nightly-digest',
|
|
5621
|
+
* });
|
|
5622
|
+
*/
|
|
5623
|
+
Inbox: {
|
|
5624
|
+
push(input: InboxPushInput): Promise<InboxPushReceipt>;
|
|
5625
|
+
};
|
|
5548
5626
|
};
|
|
5549
5627
|
|
|
5550
5628
|
/**
|
package/dist/api-exports.js
CHANGED
|
@@ -351,6 +351,9 @@ function isDesktopFileCommandName(value) {
|
|
|
351
351
|
function isDesktopFileSessionId(value) {
|
|
352
352
|
return typeof value === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
|
|
353
353
|
}
|
|
354
|
+
function isImplicitModelSelectionSource(source) {
|
|
355
|
+
return source !== void 0 && IMPLICIT_MODEL_SELECTION_SOURCES.includes(source);
|
|
356
|
+
}
|
|
354
357
|
function resolveRequireToolApproval(rules) {
|
|
355
358
|
const raw = rules?.requireToolApproval ?? rules?.requireApproval;
|
|
356
359
|
if (raw === void 0 || raw === null) return void 0;
|
|
@@ -378,7 +381,7 @@ function normalizeLuaJobExecutionTimeoutSeconds(timeout) {
|
|
|
378
381
|
}
|
|
379
382
|
return Math.min(Math.max(timeout, LUA_JOB_MIN_TIMEOUT_SECONDS), LUA_JOB_MAX_TIMEOUT_SECONDS);
|
|
380
383
|
}
|
|
381
|
-
var __defProp2, __name2, CHANNEL_SEND_CHANNELS, REVIEWABLE_ACTION_EXECUTE_TOOL_ALLOWLIST, REVIEWABLE_MCP_SEND_TOOL_SUFFIX, MCP_TOOL_READ_VERB_RE, MCP_DRAFT_CREATE_VERBS, NON_INTERACTIVE_CHANNELS, RICH_PARTS_MESSAGE_ID_PREFIX, SCREENSHOT_MESSAGE_ID_PREFIX, BROWSER_COMMANDS, BROWSER_COMMAND_NAMES, DESKTOP_FILE_COMMANDS, DESKTOP_FILE_COMMAND_SET, REASONING_EFFORT_VALUES, AGENT_NAME_TOKEN, DEFAULT_PERSONA_GUIDE, VoiceNameSchema, PluginProviderSchema, RealtimeProviderSchema, PluginClassSchema, ModelDescriptorSchema, InferenceModelSchema, PluginModelSchema, RealtimeModelSchema, LuaVoiceModelSchema, TurnDetectionSchema, InterruptionSchema, BuiltinAudioClipSchema, AudioConfigSchema, BackgroundAudioEntrySchema, BackgroundAudioSchema, LuaVoiceConfigInnerSchema, LuaVoiceConfigSchema, LuaVoiceRefSchema, LUA_JOB_DEFAULT_TIMEOUT_SECONDS, LUA_JOB_MIN_TIMEOUT_SECONDS, LUA_JOB_MAX_TIMEOUT_SECONDS;
|
|
384
|
+
var __defProp2, __name2, CHANNEL_SEND_CHANNELS, REVIEWABLE_ACTION_EXECUTE_TOOL_ALLOWLIST, REVIEWABLE_MCP_SEND_TOOL_SUFFIX, MCP_TOOL_READ_VERB_RE, MCP_DRAFT_CREATE_VERBS, NON_INTERACTIVE_CHANNELS, RICH_PARTS_MESSAGE_ID_PREFIX, SCREENSHOT_MESSAGE_ID_PREFIX, BROWSER_COMMANDS, BROWSER_COMMAND_NAMES, DESKTOP_FILE_COMMANDS, DESKTOP_FILE_COMMAND_SET, REASONING_EFFORT_VALUES, IMPLICIT_MODEL_SELECTION_SOURCES, AGENT_NAME_TOKEN, DEFAULT_PERSONA_GUIDE, VoiceNameSchema, PluginProviderSchema, RealtimeProviderSchema, PluginClassSchema, ModelDescriptorSchema, InferenceModelSchema, PluginModelSchema, RealtimeModelSchema, LuaVoiceModelSchema, TurnDetectionSchema, InterruptionSchema, BuiltinAudioClipSchema, AudioConfigSchema, BackgroundAudioEntrySchema, BackgroundAudioSchema, LuaVoiceConfigInnerSchema, LuaVoiceConfigSchema, LuaVoiceRefSchema, LUA_JOB_DEFAULT_TIMEOUT_SECONDS, LUA_JOB_MIN_TIMEOUT_SECONDS, LUA_JOB_MAX_TIMEOUT_SECONDS;
|
|
382
385
|
var init_dist = __esm({
|
|
383
386
|
"../shared-types/dist/index.mjs"() {
|
|
384
387
|
"use strict";
|
|
@@ -701,6 +704,12 @@ var init_dist = __esm({
|
|
|
701
704
|
"high",
|
|
702
705
|
"max"
|
|
703
706
|
];
|
|
707
|
+
IMPLICIT_MODEL_SELECTION_SOURCES = [
|
|
708
|
+
"workspace-default",
|
|
709
|
+
"platform-default"
|
|
710
|
+
];
|
|
711
|
+
__name(isImplicitModelSelectionSource, "isImplicitModelSelectionSource");
|
|
712
|
+
__name2(isImplicitModelSelectionSource, "isImplicitModelSelectionSource");
|
|
704
713
|
__name(resolveRequireToolApproval, "resolveRequireToolApproval");
|
|
705
714
|
__name2(resolveRequireToolApproval, "resolveRequireToolApproval");
|
|
706
715
|
AGENT_NAME_TOKEN = "[Your Agent Name]";
|
|
@@ -5822,6 +5831,31 @@ var init_channels_send_api_service = __esm({
|
|
|
5822
5831
|
}
|
|
5823
5832
|
});
|
|
5824
5833
|
|
|
5834
|
+
// src/api/inbox-push.api.service.ts
|
|
5835
|
+
var InboxPushApiService;
|
|
5836
|
+
var init_inbox_push_api_service = __esm({
|
|
5837
|
+
"src/api/inbox-push.api.service.ts"() {
|
|
5838
|
+
"use strict";
|
|
5839
|
+
init_http_client();
|
|
5840
|
+
InboxPushApiService = class extends HttpClient {
|
|
5841
|
+
static {
|
|
5842
|
+
__name(this, "InboxPushApiService");
|
|
5843
|
+
}
|
|
5844
|
+
apiKey;
|
|
5845
|
+
agentId;
|
|
5846
|
+
constructor(baseUrl, apiKey, agentId) {
|
|
5847
|
+
super(baseUrl), this.apiKey = apiKey, this.agentId = agentId;
|
|
5848
|
+
}
|
|
5849
|
+
/** POST /developer/agents/:agentId/inbox/push */
|
|
5850
|
+
async push(input) {
|
|
5851
|
+
return this.httpPost(`/developer/agents/${this.agentId}/inbox/push`, input, {
|
|
5852
|
+
Authorization: `Bearer ${this.apiKey}`
|
|
5853
|
+
});
|
|
5854
|
+
}
|
|
5855
|
+
};
|
|
5856
|
+
}
|
|
5857
|
+
});
|
|
5858
|
+
|
|
5825
5859
|
// src/api/directory.api.service.ts
|
|
5826
5860
|
var DirectoryApiService;
|
|
5827
5861
|
var init_directory_api_service = __esm({
|
|
@@ -5957,6 +5991,7 @@ __export(lazy_instances_exports, {
|
|
|
5957
5991
|
getDeveloperInstance: () => getDeveloperInstance,
|
|
5958
5992
|
getDeviceInstance: () => getDeviceInstance,
|
|
5959
5993
|
getDirectoryInstance: () => getDirectoryInstance,
|
|
5994
|
+
getInboxPushInstance: () => getInboxPushInstance,
|
|
5960
5995
|
getJobInstance: () => getJobInstance,
|
|
5961
5996
|
getOrderInstance: () => getOrderInstance,
|
|
5962
5997
|
getProductsInstance: () => getProductsInstance,
|
|
@@ -6064,6 +6099,13 @@ async function getVoiceInstance() {
|
|
|
6064
6099
|
}
|
|
6065
6100
|
return _voiceInstance;
|
|
6066
6101
|
}
|
|
6102
|
+
async function getInboxPushInstance() {
|
|
6103
|
+
if (!_inboxPushInstance) {
|
|
6104
|
+
const creds = await getCredentials();
|
|
6105
|
+
_inboxPushInstance = new InboxPushApiService(BASE_URLS.API, creds.apiKey, creds.agentId);
|
|
6106
|
+
}
|
|
6107
|
+
return _inboxPushInstance;
|
|
6108
|
+
}
|
|
6067
6109
|
async function getChannelsSendInstance() {
|
|
6068
6110
|
if (!_channelsSendInstance) {
|
|
6069
6111
|
const creds = await getCredentials();
|
|
@@ -6095,7 +6137,7 @@ function clearAllInstances() {
|
|
|
6095
6137
|
_channelsSendInstance = null;
|
|
6096
6138
|
_directoryInstance = null;
|
|
6097
6139
|
}
|
|
6098
|
-
var _userInstance, _dataInstance, _productsInstance, _basketsInstance, _orderInstance, _webhookInstance, _jobInstance, _aiInstance, _agentsInstance, _whatsAppTemplatesInstance, _cdnInstance, _developerInstance, _voiceInstance, _channelsSendInstance, _directoryInstance, _deviceInstance;
|
|
6140
|
+
var _userInstance, _dataInstance, _productsInstance, _basketsInstance, _orderInstance, _webhookInstance, _jobInstance, _aiInstance, _agentsInstance, _whatsAppTemplatesInstance, _cdnInstance, _developerInstance, _voiceInstance, _channelsSendInstance, _directoryInstance, _deviceInstance, _inboxPushInstance;
|
|
6099
6141
|
var init_lazy_instances = __esm({
|
|
6100
6142
|
"src/api/lazy-instances.ts"() {
|
|
6101
6143
|
"use strict";
|
|
@@ -6115,6 +6157,7 @@ var init_lazy_instances = __esm({
|
|
|
6115
6157
|
init_developer_api_service();
|
|
6116
6158
|
init_voice_api_service();
|
|
6117
6159
|
init_channels_send_api_service();
|
|
6160
|
+
init_inbox_push_api_service();
|
|
6118
6161
|
init_directory_api_service();
|
|
6119
6162
|
_userInstance = null;
|
|
6120
6163
|
_dataInstance = null;
|
|
@@ -6146,6 +6189,8 @@ var init_lazy_instances = __esm({
|
|
|
6146
6189
|
__name(getDeviceInstance, "getDeviceInstance");
|
|
6147
6190
|
__name(getDeveloperInstance, "getDeveloperInstance");
|
|
6148
6191
|
__name(getVoiceInstance, "getVoiceInstance");
|
|
6192
|
+
_inboxPushInstance = null;
|
|
6193
|
+
__name(getInboxPushInstance, "getInboxPushInstance");
|
|
6149
6194
|
__name(getChannelsSendInstance, "getChannelsSendInstance");
|
|
6150
6195
|
__name(getDirectoryInstance, "getDirectoryInstance");
|
|
6151
6196
|
__name(clearAllInstances, "clearAllInstances");
|
|
@@ -6637,6 +6682,7 @@ var LuaAgent = class {
|
|
|
6637
6682
|
__name(this, "LuaAgent");
|
|
6638
6683
|
}
|
|
6639
6684
|
name;
|
|
6685
|
+
description;
|
|
6640
6686
|
persona;
|
|
6641
6687
|
model;
|
|
6642
6688
|
modelSettings;
|
|
@@ -6671,6 +6717,7 @@ var LuaAgent = class {
|
|
|
6671
6717
|
*/
|
|
6672
6718
|
constructor(config) {
|
|
6673
6719
|
this.name = config.name;
|
|
6720
|
+
this.description = config.description;
|
|
6674
6721
|
this.persona = config.persona;
|
|
6675
6722
|
this.model = config.model;
|
|
6676
6723
|
if (config.modelSettings !== void 0) {
|
|
@@ -6699,6 +6746,10 @@ var LuaAgent = class {
|
|
|
6699
6746
|
getName() {
|
|
6700
6747
|
return this.name;
|
|
6701
6748
|
}
|
|
6749
|
+
/** Capability summary consumed by Space routing. */
|
|
6750
|
+
getDescription() {
|
|
6751
|
+
return this.description;
|
|
6752
|
+
}
|
|
6702
6753
|
/** Browser switch (LuaBrowser) — `true`/config when the agent can browse. */
|
|
6703
6754
|
getBrowser() {
|
|
6704
6755
|
return this.browser;
|
|
@@ -6920,6 +6971,26 @@ var User = {
|
|
|
6920
6971
|
async getChatHistory() {
|
|
6921
6972
|
const instance = await getUserInstance();
|
|
6922
6973
|
return instance.getChatHistory();
|
|
6974
|
+
},
|
|
6975
|
+
/**
|
|
6976
|
+
* PRO-1208 (B7) — push an approve/redirect/fix card to YOUR OWN inbox.
|
|
6977
|
+
* Capped (5/day per agent), urgent-clamped, same-`key` deduped (revise in
|
|
6978
|
+
* place). Cap-hit resolves to `{outcome: 'capped'}` — never throws.
|
|
6979
|
+
*
|
|
6980
|
+
* @example
|
|
6981
|
+
* const receipt = await User.Inbox.push({
|
|
6982
|
+
* title: 'Nightly digest ready',
|
|
6983
|
+
* body: 'Built and filed to the Library.',
|
|
6984
|
+
* key: 'nightly-digest',
|
|
6985
|
+
* });
|
|
6986
|
+
*/
|
|
6987
|
+
Inbox: {
|
|
6988
|
+
async push(input) {
|
|
6989
|
+
const { getInboxPushInstance: getInboxPushInstance2 } = await Promise.resolve().then(() => (init_lazy_instances(), lazy_instances_exports));
|
|
6990
|
+
const service = await getInboxPushInstance2();
|
|
6991
|
+
const res = await service.push(input);
|
|
6992
|
+
return res.data;
|
|
6993
|
+
}
|
|
6923
6994
|
}
|
|
6924
6995
|
};
|
|
6925
6996
|
var Data = {
|