lua-cli 3.24.0 → 3.26.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 +195 -2
- package/dist/api-exports.js +167 -2
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +315 -9
- 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
|
@@ -51,6 +51,18 @@ declare interface AgentInvocationInput {
|
|
|
51
51
|
threadId?: string;
|
|
52
52
|
/** Channel identifier, defaults to `'agent-invocation'`. */
|
|
53
53
|
channel?: string;
|
|
54
|
+
/**
|
|
55
|
+
* T12.2.4 — retry-stable per-run identity for the `occurrence` outcome
|
|
56
|
+
* dedupe mode (jobExecution ledger's `occurrenceId ?? executionId`). Only
|
|
57
|
+
* honored server-side on internally-authenticated turns.
|
|
58
|
+
*/
|
|
59
|
+
occurrenceId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* T12.2.4 — retry-stable event identity for the `event` outcome dedupe mode
|
|
62
|
+
* (event execution ledger's stable eventId — runtime T5.5's stamp). Only
|
|
63
|
+
* honored server-side on internally-authenticated turns.
|
|
64
|
+
*/
|
|
65
|
+
eventId?: string;
|
|
54
66
|
/** Free-form request tag persisted on the stored Message record (e.g. a UUID
|
|
55
67
|
* or external trace id for correlation). Not a user identifier. Omitted
|
|
56
68
|
* by default. */
|
|
@@ -70,8 +82,23 @@ declare interface AgentInvocationInput {
|
|
|
70
82
|
* the original BAC-107 spec; wired through as part of PRO-186.
|
|
71
83
|
*/
|
|
72
84
|
webhookPayload?: unknown;
|
|
73
|
-
/**
|
|
74
|
-
*
|
|
85
|
+
/**
|
|
86
|
+
* Per-call timeout in ms. Absent ⇒ the client default (120s).
|
|
87
|
+
*
|
|
88
|
+
* Honoured on both invocation paths: in-process it becomes the loopback
|
|
89
|
+
* axios timeout, and out-of-process the sandbox runner derives its own abort
|
|
90
|
+
* deadline from it plus a hop margin (BAC-413 — it previously used a flat
|
|
91
|
+
* 125s, silently capping anything larger).
|
|
92
|
+
*
|
|
93
|
+
* The effective upper bound is the calling site's own budget, not this
|
|
94
|
+
* field: VM-executed sites (tool / job / webhook / pre- and post-processor)
|
|
95
|
+
* are walled at 180s, and the runner clamps to the wall that remains minus
|
|
96
|
+
* recovery headroom — past that the pool's SIGTERM watchdog ends the whole
|
|
97
|
+
* execution, so a larger value buys nothing. Scheduled agent jobs
|
|
98
|
+
* invoke lua-core directly, never entering the VM, and pass
|
|
99
|
+
* `normalizeLuaJobExecutionTimeoutSeconds(timeout) * 1000` — 300s by
|
|
100
|
+
* default, 600s max (`job-timeout.constants.ts`).
|
|
101
|
+
*/
|
|
75
102
|
timeoutMs?: number;
|
|
76
103
|
/** Per-request model override ("provider/model" code). Unknown codes fall back per
|
|
77
104
|
* approved-models policy server-side. */
|
|
@@ -1028,6 +1055,10 @@ export declare interface ChatHistoryMessage {
|
|
|
1028
1055
|
* to render a "Voice call" divider in the thread.
|
|
1029
1056
|
*/
|
|
1030
1057
|
source?: 'voice' | 'chat';
|
|
1058
|
+
/** Concrete model that served this assistant turn, persisted in content metadata. */
|
|
1059
|
+
model?: string;
|
|
1060
|
+
/** True when the turn reached that model through the Auto selector. */
|
|
1061
|
+
autoModelRequested?: boolean;
|
|
1031
1062
|
/**
|
|
1032
1063
|
* Permanent recording for a voice-note turn (Lua Desktop). Populated by the
|
|
1033
1064
|
* admin threads history endpoint from the row's `content.metadata.audio` — a
|
|
@@ -1831,6 +1862,144 @@ declare interface ImmutableUserProfile {
|
|
|
1831
1862
|
emailAddresses: string[];
|
|
1832
1863
|
}
|
|
1833
1864
|
|
|
1865
|
+
/**
|
|
1866
|
+
* PRO-1208 (B7) — `User.Inbox.push()`: the governed SDK door into a user's
|
|
1867
|
+
* inbox. Shared between the sandbox runtime (the SDK surface), lua-core (the
|
|
1868
|
+
* seam's `runInboxPush`) and lua-api (the lua-cli dev route) so all three
|
|
1869
|
+
* speak one wire contract.
|
|
1870
|
+
*/
|
|
1871
|
+
/** What the card offers. `approve` requires `options` (routed through the
|
|
1872
|
+
* agent-question path so answers are one click); `fix` requires
|
|
1873
|
+
* `connection`; plain notices need neither. */
|
|
1874
|
+
declare type InboxPushAction = 'approve' | 'redirect' | 'fix';
|
|
1875
|
+
|
|
1876
|
+
declare interface InboxPushInput {
|
|
1877
|
+
/** Card title — the row's first line. 1..140 chars after trim. */
|
|
1878
|
+
title: string;
|
|
1879
|
+
/** The human body — the row's context line and the detail pane's prose. */
|
|
1880
|
+
body: string;
|
|
1881
|
+
/** Optional longer detail shown only in the drill-in pane. */
|
|
1882
|
+
detail?: string;
|
|
1883
|
+
/** Primary link out (issue URL, doc permalink) — rendered as the card's
|
|
1884
|
+
* source link, never auto-opened. */
|
|
1885
|
+
deeplink?: string;
|
|
1886
|
+
/** Server-clamped: urgent is limited per day and demoted when over budget. */
|
|
1887
|
+
priority?: 'urgent' | 'high' | 'normal' | 'low';
|
|
1888
|
+
actions?: InboxPushAction[];
|
|
1889
|
+
/** One-click answers (2..4). Presence routes the push through the
|
|
1890
|
+
* agent-question path — the user's pick resolves the card. */
|
|
1891
|
+
options?: {
|
|
1892
|
+
label: string;
|
|
1893
|
+
description?: string;
|
|
1894
|
+
}[];
|
|
1895
|
+
/** For `fix`: the integration the agent needs — catalog slug + display name. */
|
|
1896
|
+
connection?: {
|
|
1897
|
+
type: string;
|
|
1898
|
+
name: string;
|
|
1899
|
+
};
|
|
1900
|
+
/** Idempotency/revision key: same key = revise the existing card in place,
|
|
1901
|
+
* never a second knock. Omit for one-shot notices. */
|
|
1902
|
+
key?: string;
|
|
1903
|
+
/** Conversation the card should hand off into when the user acts. */
|
|
1904
|
+
threadId?: string;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
declare type InboxPushOutcome = 'deposited' | 'updated' | 'exists' | 'capped';
|
|
1908
|
+
|
|
1909
|
+
declare interface InboxPushReceipt {
|
|
1910
|
+
outcome: InboxPushOutcome;
|
|
1911
|
+
/** The inbox kind the push routed to. */
|
|
1912
|
+
kind: 'input_request' | 'connection_fix' | 'agent_notice';
|
|
1913
|
+
/** Echo of the dedup key (or the generated one) — reuse it to revise. */
|
|
1914
|
+
key: string;
|
|
1915
|
+
/** Present on `capped`: what to tell the agent author. */
|
|
1916
|
+
reason?: string;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
/** HTTP methods the passthrough relay accepts. */
|
|
1920
|
+
declare const INTEGRATION_PASSTHROUGH_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD"];
|
|
1921
|
+
|
|
1922
|
+
export declare type IntegrationPassthroughMethod = (typeof INTEGRATION_PASSTHROUGH_METHODS)[number];
|
|
1923
|
+
|
|
1924
|
+
/**
|
|
1925
|
+
* One raw provider API call, relative to the provider's API base URL
|
|
1926
|
+
* (e.g. `repos/{owner}/{repo}/pulls/42/files` against GitHub).
|
|
1927
|
+
*/
|
|
1928
|
+
export declare interface IntegrationPassthroughRequest {
|
|
1929
|
+
/** HTTP method of the provider call. */
|
|
1930
|
+
method: IntegrationPassthroughMethod;
|
|
1931
|
+
/** Provider path after the provider's base URL. A leading `/` is tolerated. */
|
|
1932
|
+
path: string;
|
|
1933
|
+
/** Query-string parameters (pagination etc.). */
|
|
1934
|
+
query?: Record<string, string | number | boolean>;
|
|
1935
|
+
/**
|
|
1936
|
+
* Request body. Objects/arrays are sent as JSON; a string is sent verbatim
|
|
1937
|
+
* (set a Content-Type header for non-JSON payloads).
|
|
1938
|
+
*/
|
|
1939
|
+
data?: unknown;
|
|
1940
|
+
/**
|
|
1941
|
+
* Extra request headers forwarded to the provider (e.g.
|
|
1942
|
+
* `{ Accept: 'application/vnd.github.diff' }`). `Authorization` is managed
|
|
1943
|
+
* server-side and cannot be overridden.
|
|
1944
|
+
*/
|
|
1945
|
+
headers?: Record<string, string>;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
/**
|
|
1949
|
+
* The raw provider response. Provider error statuses (401/403/404/…) are
|
|
1950
|
+
* relayed faithfully in `status` with the provider's own body in `data` —
|
|
1951
|
+
* they are NOT converted into thrown errors.
|
|
1952
|
+
*/
|
|
1953
|
+
export declare interface IntegrationPassthroughResponse {
|
|
1954
|
+
/** Provider HTTP status code. */
|
|
1955
|
+
status: number;
|
|
1956
|
+
/** Provider response headers (lower-cased names). */
|
|
1957
|
+
headers: Record<string, string>;
|
|
1958
|
+
/**
|
|
1959
|
+
* Provider response body: parsed JSON when the response is JSON, the raw
|
|
1960
|
+
* string otherwise (e.g. a `text/plain` unified diff round-trips intact).
|
|
1961
|
+
*/
|
|
1962
|
+
data: unknown;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
export declare const Integrations: IntegrationsApi;
|
|
1966
|
+
|
|
1967
|
+
/**
|
|
1968
|
+
* Integrations API — raw provider API access through the agent's connected
|
|
1969
|
+
* integrations (Unified.to passthrough). Proxied server-side: your code never
|
|
1970
|
+
* sees provider credentials or the workspace Unified.to key.
|
|
1971
|
+
*/
|
|
1972
|
+
export declare interface IntegrationsApi {
|
|
1973
|
+
/**
|
|
1974
|
+
* Call the provider's raw API through the agent's own bound connection for
|
|
1975
|
+
* `integrationType`. Request headers are forwarded (e.g.
|
|
1976
|
+
* `Accept: application/vnd.github.diff`), query params are supported, and
|
|
1977
|
+
* JSON bodies POST through. The response envelope relays the provider's
|
|
1978
|
+
* status/headers faithfully — a provider 403 (missing OAuth scope) shows up
|
|
1979
|
+
* in `status`, not as a thrown error. `data` is parsed JSON when the
|
|
1980
|
+
* provider responded with JSON, the raw string otherwise (unified diffs
|
|
1981
|
+
* round-trip intact).
|
|
1982
|
+
*
|
|
1983
|
+
* @example
|
|
1984
|
+
* ```typescript
|
|
1985
|
+
* // Read a PR diff (non-JSON response comes back as a string)
|
|
1986
|
+
* const diff = await Integrations.passthrough('github', {
|
|
1987
|
+
* method: 'GET',
|
|
1988
|
+
* path: 'repos/acme/app/pulls/42',
|
|
1989
|
+
* headers: { Accept: 'application/vnd.github.diff' },
|
|
1990
|
+
* });
|
|
1991
|
+
*
|
|
1992
|
+
* // Approve the PR (JSON body POST)
|
|
1993
|
+
* await Integrations.passthrough('github', {
|
|
1994
|
+
* method: 'POST',
|
|
1995
|
+
* path: 'repos/acme/app/pulls/42/reviews',
|
|
1996
|
+
* data: { event: 'APPROVE' },
|
|
1997
|
+
* });
|
|
1998
|
+
* ```
|
|
1999
|
+
*/
|
|
2000
|
+
passthrough(integrationType: string, request: IntegrationPassthroughRequest): Promise<IntegrationPassthroughResponse>;
|
|
2001
|
+
}
|
|
2002
|
+
|
|
1834
2003
|
/**
|
|
1835
2004
|
* Job with versions array
|
|
1836
2005
|
* Matches JobDto and job.schema.ts
|
|
@@ -2368,6 +2537,7 @@ export declare const Lua: LuaRuntime;
|
|
|
2368
2537
|
*/
|
|
2369
2538
|
export declare class LuaAgent {
|
|
2370
2539
|
private readonly name;
|
|
2540
|
+
private readonly description?;
|
|
2371
2541
|
private readonly persona;
|
|
2372
2542
|
private readonly model?;
|
|
2373
2543
|
private readonly modelSettings?;
|
|
@@ -2402,6 +2572,8 @@ export declare class LuaAgent {
|
|
|
2402
2572
|
*/
|
|
2403
2573
|
constructor(config: LuaAgentConfig);
|
|
2404
2574
|
getName(): string;
|
|
2575
|
+
/** Capability summary consumed by Space routing. */
|
|
2576
|
+
getDescription(): string | undefined;
|
|
2405
2577
|
/** Browser switch (LuaBrowser) — `true`/config when the agent can browse. */
|
|
2406
2578
|
getBrowser(): LuaAgentConfig['browser'];
|
|
2407
2579
|
getPersona(): PersonaText;
|
|
@@ -2422,6 +2594,12 @@ export declare class LuaAgent {
|
|
|
2422
2594
|
export declare interface LuaAgentConfig {
|
|
2423
2595
|
/** Agent name (used for identification) */
|
|
2424
2596
|
name: string;
|
|
2597
|
+
/**
|
|
2598
|
+
* Short capability summary used by Spaces to decide when to delegate to
|
|
2599
|
+
* this agent. Keep this focused on what the agent can do; the persona owns
|
|
2600
|
+
* behavior, voice, and detailed instructions.
|
|
2601
|
+
*/
|
|
2602
|
+
description?: string;
|
|
2425
2603
|
/** Agent persona - defines the agent's behavior and personality */
|
|
2426
2604
|
persona: PersonaText;
|
|
2427
2605
|
/** LLM model to use — 'provider/model' string or resolver function */
|
|
@@ -5545,6 +5723,21 @@ export declare const User: {
|
|
|
5545
5723
|
* ```
|
|
5546
5724
|
*/
|
|
5547
5725
|
getChatHistory(): Promise<ChatHistoryMessage[]>;
|
|
5726
|
+
/**
|
|
5727
|
+
* PRO-1208 (B7) — push an approve/redirect/fix card to YOUR OWN inbox.
|
|
5728
|
+
* Capped (5/day per agent), urgent-clamped, same-`key` deduped (revise in
|
|
5729
|
+
* place). Cap-hit resolves to `{outcome: 'capped'}` — never throws.
|
|
5730
|
+
*
|
|
5731
|
+
* @example
|
|
5732
|
+
* const receipt = await User.Inbox.push({
|
|
5733
|
+
* title: 'Nightly digest ready',
|
|
5734
|
+
* body: 'Built and filed to the Library.',
|
|
5735
|
+
* key: 'nightly-digest',
|
|
5736
|
+
* });
|
|
5737
|
+
*/
|
|
5738
|
+
Inbox: {
|
|
5739
|
+
push(input: InboxPushInput): Promise<InboxPushReceipt>;
|
|
5740
|
+
};
|
|
5548
5741
|
};
|
|
5549
5742
|
|
|
5550
5743
|
/**
|
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;
|
|
@@ -362,6 +365,9 @@ function resolveRequireToolApproval(rules) {
|
|
|
362
365
|
function buildDefaultPersona(agentName) {
|
|
363
366
|
return DEFAULT_PERSONA_GUIDE.replace(AGENT_NAME_TOKEN, () => agentName || "My Agent");
|
|
364
367
|
}
|
|
368
|
+
function buildPersonalSpaceStartingPersona(agentName) {
|
|
369
|
+
return PERSONAL_SPACE_STARTING_PERSONA.replace(new RegExp(AGENT_NAME_TOKEN.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), () => agentName || "Your assistant");
|
|
370
|
+
}
|
|
365
371
|
function resolveLuaJobTimeoutSeconds(timeout) {
|
|
366
372
|
const resolved = timeout ?? LUA_JOB_DEFAULT_TIMEOUT_SECONDS;
|
|
367
373
|
if (!Number.isInteger(resolved)) {
|
|
@@ -378,7 +384,7 @@ function normalizeLuaJobExecutionTimeoutSeconds(timeout) {
|
|
|
378
384
|
}
|
|
379
385
|
return Math.min(Math.max(timeout, LUA_JOB_MIN_TIMEOUT_SECONDS), LUA_JOB_MAX_TIMEOUT_SECONDS);
|
|
380
386
|
}
|
|
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;
|
|
387
|
+
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, PERSONAL_SPACE_STARTING_PERSONA, 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
388
|
var init_dist = __esm({
|
|
383
389
|
"../shared-types/dist/index.mjs"() {
|
|
384
390
|
"use strict";
|
|
@@ -701,6 +707,12 @@ var init_dist = __esm({
|
|
|
701
707
|
"high",
|
|
702
708
|
"max"
|
|
703
709
|
];
|
|
710
|
+
IMPLICIT_MODEL_SELECTION_SOURCES = [
|
|
711
|
+
"workspace-default",
|
|
712
|
+
"platform-default"
|
|
713
|
+
];
|
|
714
|
+
__name(isImplicitModelSelectionSource, "isImplicitModelSelectionSource");
|
|
715
|
+
__name2(isImplicitModelSelectionSource, "isImplicitModelSelectionSource");
|
|
704
716
|
__name(resolveRequireToolApproval, "resolveRequireToolApproval");
|
|
705
717
|
__name2(resolveRequireToolApproval, "resolveRequireToolApproval");
|
|
706
718
|
AGENT_NAME_TOKEN = "[Your Agent Name]";
|
|
@@ -752,6 +764,40 @@ Feel free to add, remove, or rename sections. Your persona can be a single parag
|
|
|
752
764
|
`;
|
|
753
765
|
__name(buildDefaultPersona, "buildDefaultPersona");
|
|
754
766
|
__name2(buildDefaultPersona, "buildDefaultPersona");
|
|
767
|
+
PERSONAL_SPACE_STARTING_PERSONA = `# ${AGENT_NAME_TOKEN}
|
|
768
|
+
|
|
769
|
+
You are ${AGENT_NAME_TOKEN}, the assistant for whoever is chatting with you here. Your job is simple: help them get things done, and get better at it every day.
|
|
770
|
+
|
|
771
|
+
## You're just getting started
|
|
772
|
+
|
|
773
|
+
This workspace is new. What you already know about the person lives in your memory \u2014 the "Known about this user" notes are verified facts, so use them like you've known them all along; never say you don't know something that's written there. Beyond that, don't pretend. Pay attention instead: how they write, what they ask for, what they're working on. When something matters and you're not sure, ask. One good question beats a wrong guess.
|
|
774
|
+
|
|
775
|
+
## You have real tools
|
|
776
|
+
|
|
777
|
+
You can do a lot more than talk. Use your tools when they help, and be straight about what worked and what didn't. The more you learn, the more you can take off their plate without being asked.
|
|
778
|
+
|
|
779
|
+
## How you sound
|
|
780
|
+
|
|
781
|
+
Like a sharp, warm human who's on their side. Plain words. Short sentences when short works. React like a person would: if something's great, say so; if something's off, say that too. No corporate filler, no fake enthusiasm.
|
|
782
|
+
|
|
783
|
+
## What you hold yourself to
|
|
784
|
+
|
|
785
|
+
- Never make up facts about the person, and never claim you did something you didn't.
|
|
786
|
+
- What you learn about them serves them. Nothing else.
|
|
787
|
+
- If you can't do something, say so and offer what you can do.
|
|
788
|
+
|
|
789
|
+
## Where you come from
|
|
790
|
+
|
|
791
|
+
You live on Lua, the platform this workspace runs on. Lua gives people AI agents that do real work for them, and it lives at heylua.ai. It was founded by Lorcan (CEO) and Stefan (CTO).
|
|
792
|
+
|
|
793
|
+
If someone asks about Lua itself, have fun with it. It's your hometown, so show them around like a proud local: keep the facts straight, keep the delivery playful and a little whimsical. For anything you don't know (pricing, plans, roadmap), point them to heylua.ai instead of guessing.
|
|
794
|
+
|
|
795
|
+
## Keep this persona alive
|
|
796
|
+
|
|
797
|
+
This text is who you are for this person. As you learn them, their name, their work, what they care about, update it so tomorrow's you starts smarter than today's. Keep it about who they are and who you are for them.
|
|
798
|
+
`;
|
|
799
|
+
__name(buildPersonalSpaceStartingPersona, "buildPersonalSpaceStartingPersona");
|
|
800
|
+
__name2(buildPersonalSpaceStartingPersona, "buildPersonalSpaceStartingPersona");
|
|
755
801
|
VoiceNameSchema = z.string().regex(/^[a-zA-Z0-9_-]+$/, "Voice name must contain only alphanumeric characters, underscores, or hyphens").min(1).max(64);
|
|
756
802
|
PluginProviderSchema = z.enum([
|
|
757
803
|
"deepgram",
|
|
@@ -2426,6 +2472,7 @@ var init_files = __esm({
|
|
|
2426
2472
|
"preprocessors",
|
|
2427
2473
|
"postprocessors",
|
|
2428
2474
|
"mcpServers",
|
|
2475
|
+
"template",
|
|
2429
2476
|
"skill"
|
|
2430
2477
|
];
|
|
2431
2478
|
__name(yamlKeySorter, "yamlKeySorter");
|
|
@@ -5237,6 +5284,43 @@ var init_ai_api_service = __esm({
|
|
|
5237
5284
|
}
|
|
5238
5285
|
});
|
|
5239
5286
|
|
|
5287
|
+
// src/api/integrations.api.service.ts
|
|
5288
|
+
var IntegrationsApiService;
|
|
5289
|
+
var init_integrations_api_service = __esm({
|
|
5290
|
+
"src/api/integrations.api.service.ts"() {
|
|
5291
|
+
"use strict";
|
|
5292
|
+
init_http_client();
|
|
5293
|
+
IntegrationsApiService = class extends HttpClient {
|
|
5294
|
+
static {
|
|
5295
|
+
__name(this, "IntegrationsApiService");
|
|
5296
|
+
}
|
|
5297
|
+
apiKey;
|
|
5298
|
+
agentId;
|
|
5299
|
+
constructor(baseUrl, apiKey, agentId) {
|
|
5300
|
+
super(baseUrl), this.apiKey = apiKey, this.agentId = agentId;
|
|
5301
|
+
}
|
|
5302
|
+
async passthrough(integrationType, request) {
|
|
5303
|
+
return this.httpPost(`/developer/unifiedto/connections/${encodeURIComponent(this.agentId)}/passthrough/${encodeURIComponent(integrationType)}`, request, {
|
|
5304
|
+
Authorization: `Bearer ${this.apiKey}`
|
|
5305
|
+
});
|
|
5306
|
+
}
|
|
5307
|
+
/**
|
|
5308
|
+
* Sandbox-facing wrapper: returns the raw provider envelope
|
|
5309
|
+
* `{ status, headers, data }` (provider error statuses relayed faithfully in
|
|
5310
|
+
* `status`), and throws only on route-level failures (no connection,
|
|
5311
|
+
* passthrough disabled, rate limited, transport error).
|
|
5312
|
+
*/
|
|
5313
|
+
async passthroughForSandbox(integrationType, request) {
|
|
5314
|
+
const result = await this.passthrough(integrationType, request);
|
|
5315
|
+
if (!result.success || !result.data) {
|
|
5316
|
+
throw new Error(result.error?.message || `Integration passthrough failed for '${integrationType}'`);
|
|
5317
|
+
}
|
|
5318
|
+
return result.data;
|
|
5319
|
+
}
|
|
5320
|
+
};
|
|
5321
|
+
}
|
|
5322
|
+
});
|
|
5323
|
+
|
|
5240
5324
|
// src/api/agents.api.service.ts
|
|
5241
5325
|
var AgentsApiService;
|
|
5242
5326
|
var init_agents_api_service = __esm({
|
|
@@ -5822,6 +5906,31 @@ var init_channels_send_api_service = __esm({
|
|
|
5822
5906
|
}
|
|
5823
5907
|
});
|
|
5824
5908
|
|
|
5909
|
+
// src/api/inbox-push.api.service.ts
|
|
5910
|
+
var InboxPushApiService;
|
|
5911
|
+
var init_inbox_push_api_service = __esm({
|
|
5912
|
+
"src/api/inbox-push.api.service.ts"() {
|
|
5913
|
+
"use strict";
|
|
5914
|
+
init_http_client();
|
|
5915
|
+
InboxPushApiService = class extends HttpClient {
|
|
5916
|
+
static {
|
|
5917
|
+
__name(this, "InboxPushApiService");
|
|
5918
|
+
}
|
|
5919
|
+
apiKey;
|
|
5920
|
+
agentId;
|
|
5921
|
+
constructor(baseUrl, apiKey, agentId) {
|
|
5922
|
+
super(baseUrl), this.apiKey = apiKey, this.agentId = agentId;
|
|
5923
|
+
}
|
|
5924
|
+
/** POST /developer/agents/:agentId/inbox/push */
|
|
5925
|
+
async push(input) {
|
|
5926
|
+
return this.httpPost(`/developer/agents/${this.agentId}/inbox/push`, input, {
|
|
5927
|
+
Authorization: `Bearer ${this.apiKey}`
|
|
5928
|
+
});
|
|
5929
|
+
}
|
|
5930
|
+
};
|
|
5931
|
+
}
|
|
5932
|
+
});
|
|
5933
|
+
|
|
5825
5934
|
// src/api/directory.api.service.ts
|
|
5826
5935
|
var DirectoryApiService;
|
|
5827
5936
|
var init_directory_api_service = __esm({
|
|
@@ -5957,6 +6066,8 @@ __export(lazy_instances_exports, {
|
|
|
5957
6066
|
getDeveloperInstance: () => getDeveloperInstance,
|
|
5958
6067
|
getDeviceInstance: () => getDeviceInstance,
|
|
5959
6068
|
getDirectoryInstance: () => getDirectoryInstance,
|
|
6069
|
+
getInboxPushInstance: () => getInboxPushInstance,
|
|
6070
|
+
getIntegrationsInstance: () => getIntegrationsInstance,
|
|
5960
6071
|
getJobInstance: () => getJobInstance,
|
|
5961
6072
|
getOrderInstance: () => getOrderInstance,
|
|
5962
6073
|
getProductsInstance: () => getProductsInstance,
|
|
@@ -6021,6 +6132,13 @@ async function getAiInstance() {
|
|
|
6021
6132
|
}
|
|
6022
6133
|
return _aiInstance;
|
|
6023
6134
|
}
|
|
6135
|
+
async function getIntegrationsInstance() {
|
|
6136
|
+
if (!_integrationsInstance) {
|
|
6137
|
+
const creds = await getCredentials();
|
|
6138
|
+
_integrationsInstance = new IntegrationsApiService(BASE_URLS.API, creds.apiKey, creds.agentId);
|
|
6139
|
+
}
|
|
6140
|
+
return _integrationsInstance;
|
|
6141
|
+
}
|
|
6024
6142
|
async function getAgentsInstance() {
|
|
6025
6143
|
if (!_agentsInstance) {
|
|
6026
6144
|
const creds = await getCredentials();
|
|
@@ -6064,6 +6182,13 @@ async function getVoiceInstance() {
|
|
|
6064
6182
|
}
|
|
6065
6183
|
return _voiceInstance;
|
|
6066
6184
|
}
|
|
6185
|
+
async function getInboxPushInstance() {
|
|
6186
|
+
if (!_inboxPushInstance) {
|
|
6187
|
+
const creds = await getCredentials();
|
|
6188
|
+
_inboxPushInstance = new InboxPushApiService(BASE_URLS.API, creds.apiKey, creds.agentId);
|
|
6189
|
+
}
|
|
6190
|
+
return _inboxPushInstance;
|
|
6191
|
+
}
|
|
6067
6192
|
async function getChannelsSendInstance() {
|
|
6068
6193
|
if (!_channelsSendInstance) {
|
|
6069
6194
|
const creds = await getCredentials();
|
|
@@ -6095,7 +6220,7 @@ function clearAllInstances() {
|
|
|
6095
6220
|
_channelsSendInstance = null;
|
|
6096
6221
|
_directoryInstance = null;
|
|
6097
6222
|
}
|
|
6098
|
-
var _userInstance, _dataInstance, _productsInstance, _basketsInstance, _orderInstance, _webhookInstance, _jobInstance, _aiInstance, _agentsInstance, _whatsAppTemplatesInstance, _cdnInstance, _developerInstance, _voiceInstance, _channelsSendInstance, _directoryInstance, _deviceInstance;
|
|
6223
|
+
var _userInstance, _dataInstance, _productsInstance, _basketsInstance, _orderInstance, _webhookInstance, _jobInstance, _aiInstance, _integrationsInstance, _agentsInstance, _whatsAppTemplatesInstance, _cdnInstance, _developerInstance, _voiceInstance, _channelsSendInstance, _directoryInstance, _deviceInstance, _inboxPushInstance;
|
|
6099
6224
|
var init_lazy_instances = __esm({
|
|
6100
6225
|
"src/api/lazy-instances.ts"() {
|
|
6101
6226
|
"use strict";
|
|
@@ -6109,12 +6234,14 @@ var init_lazy_instances = __esm({
|
|
|
6109
6234
|
init_webhook_api_service();
|
|
6110
6235
|
init_job_api_service();
|
|
6111
6236
|
init_ai_api_service();
|
|
6237
|
+
init_integrations_api_service();
|
|
6112
6238
|
init_agents_api_service();
|
|
6113
6239
|
init_whatsapp_templates_api_service();
|
|
6114
6240
|
init_cdn_api_service();
|
|
6115
6241
|
init_developer_api_service();
|
|
6116
6242
|
init_voice_api_service();
|
|
6117
6243
|
init_channels_send_api_service();
|
|
6244
|
+
init_inbox_push_api_service();
|
|
6118
6245
|
init_directory_api_service();
|
|
6119
6246
|
_userInstance = null;
|
|
6120
6247
|
_dataInstance = null;
|
|
@@ -6124,6 +6251,7 @@ var init_lazy_instances = __esm({
|
|
|
6124
6251
|
_webhookInstance = null;
|
|
6125
6252
|
_jobInstance = null;
|
|
6126
6253
|
_aiInstance = null;
|
|
6254
|
+
_integrationsInstance = null;
|
|
6127
6255
|
_agentsInstance = null;
|
|
6128
6256
|
_whatsAppTemplatesInstance = null;
|
|
6129
6257
|
_cdnInstance = null;
|
|
@@ -6139,6 +6267,7 @@ var init_lazy_instances = __esm({
|
|
|
6139
6267
|
__name(getWebhookInstance, "getWebhookInstance");
|
|
6140
6268
|
__name(getJobInstance, "getJobInstance");
|
|
6141
6269
|
__name(getAiInstance, "getAiInstance");
|
|
6270
|
+
__name(getIntegrationsInstance, "getIntegrationsInstance");
|
|
6142
6271
|
__name(getAgentsInstance, "getAgentsInstance");
|
|
6143
6272
|
__name(getWhatsAppTemplatesInstance, "getWhatsAppTemplatesInstance");
|
|
6144
6273
|
__name(getCdnInstance, "getCdnInstance");
|
|
@@ -6146,6 +6275,8 @@ var init_lazy_instances = __esm({
|
|
|
6146
6275
|
__name(getDeviceInstance, "getDeviceInstance");
|
|
6147
6276
|
__name(getDeveloperInstance, "getDeveloperInstance");
|
|
6148
6277
|
__name(getVoiceInstance, "getVoiceInstance");
|
|
6278
|
+
_inboxPushInstance = null;
|
|
6279
|
+
__name(getInboxPushInstance, "getInboxPushInstance");
|
|
6149
6280
|
__name(getChannelsSendInstance, "getChannelsSendInstance");
|
|
6150
6281
|
__name(getDirectoryInstance, "getDirectoryInstance");
|
|
6151
6282
|
__name(clearAllInstances, "clearAllInstances");
|
|
@@ -6637,6 +6768,7 @@ var LuaAgent = class {
|
|
|
6637
6768
|
__name(this, "LuaAgent");
|
|
6638
6769
|
}
|
|
6639
6770
|
name;
|
|
6771
|
+
description;
|
|
6640
6772
|
persona;
|
|
6641
6773
|
model;
|
|
6642
6774
|
modelSettings;
|
|
@@ -6671,6 +6803,7 @@ var LuaAgent = class {
|
|
|
6671
6803
|
*/
|
|
6672
6804
|
constructor(config) {
|
|
6673
6805
|
this.name = config.name;
|
|
6806
|
+
this.description = config.description;
|
|
6674
6807
|
this.persona = config.persona;
|
|
6675
6808
|
this.model = config.model;
|
|
6676
6809
|
if (config.modelSettings !== void 0) {
|
|
@@ -6699,6 +6832,10 @@ var LuaAgent = class {
|
|
|
6699
6832
|
getName() {
|
|
6700
6833
|
return this.name;
|
|
6701
6834
|
}
|
|
6835
|
+
/** Capability summary consumed by Space routing. */
|
|
6836
|
+
getDescription() {
|
|
6837
|
+
return this.description;
|
|
6838
|
+
}
|
|
6702
6839
|
/** Browser switch (LuaBrowser) — `true`/config when the agent can browse. */
|
|
6703
6840
|
getBrowser() {
|
|
6704
6841
|
return this.browser;
|
|
@@ -6920,6 +7057,26 @@ var User = {
|
|
|
6920
7057
|
async getChatHistory() {
|
|
6921
7058
|
const instance = await getUserInstance();
|
|
6922
7059
|
return instance.getChatHistory();
|
|
7060
|
+
},
|
|
7061
|
+
/**
|
|
7062
|
+
* PRO-1208 (B7) — push an approve/redirect/fix card to YOUR OWN inbox.
|
|
7063
|
+
* Capped (5/day per agent), urgent-clamped, same-`key` deduped (revise in
|
|
7064
|
+
* place). Cap-hit resolves to `{outcome: 'capped'}` — never throws.
|
|
7065
|
+
*
|
|
7066
|
+
* @example
|
|
7067
|
+
* const receipt = await User.Inbox.push({
|
|
7068
|
+
* title: 'Nightly digest ready',
|
|
7069
|
+
* body: 'Built and filed to the Library.',
|
|
7070
|
+
* key: 'nightly-digest',
|
|
7071
|
+
* });
|
|
7072
|
+
*/
|
|
7073
|
+
Inbox: {
|
|
7074
|
+
async push(input) {
|
|
7075
|
+
const { getInboxPushInstance: getInboxPushInstance2 } = await Promise.resolve().then(() => (init_lazy_instances(), lazy_instances_exports));
|
|
7076
|
+
const service = await getInboxPushInstance2();
|
|
7077
|
+
const res = await service.push(input);
|
|
7078
|
+
return res.data;
|
|
7079
|
+
}
|
|
6923
7080
|
}
|
|
6924
7081
|
};
|
|
6925
7082
|
var Data = {
|
|
@@ -7374,6 +7531,13 @@ var AI = {
|
|
|
7374
7531
|
return ai.generateForSandbox(promptOrOptions, content);
|
|
7375
7532
|
}
|
|
7376
7533
|
};
|
|
7534
|
+
var Integrations = {
|
|
7535
|
+
async passthrough(integrationType, request) {
|
|
7536
|
+
const { getIntegrationsInstance: getIntegrationsInstance2 } = await Promise.resolve().then(() => (init_lazy_instances(), lazy_instances_exports));
|
|
7537
|
+
const integrations = await getIntegrationsInstance2();
|
|
7538
|
+
return integrations.passthroughForSandbox(integrationType, request);
|
|
7539
|
+
}
|
|
7540
|
+
};
|
|
7377
7541
|
var Agents = {
|
|
7378
7542
|
async invoke(targetAgentId, promptOrInput) {
|
|
7379
7543
|
const { getAgentsInstance: getAgentsInstance2 } = await Promise.resolve().then(() => (init_lazy_instances(), lazy_instances_exports));
|
|
@@ -7572,6 +7736,7 @@ export {
|
|
|
7572
7736
|
Channels,
|
|
7573
7737
|
Data,
|
|
7574
7738
|
DataEntryInstance,
|
|
7739
|
+
Integrations,
|
|
7575
7740
|
JobInstance,
|
|
7576
7741
|
Jobs,
|
|
7577
7742
|
Lua,
|