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/index.js
CHANGED
|
@@ -1146,6 +1146,9 @@ function isDesktopFileCommandName(value) {
|
|
|
1146
1146
|
function isDesktopFileSessionId(value) {
|
|
1147
1147
|
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);
|
|
1148
1148
|
}
|
|
1149
|
+
function isImplicitModelSelectionSource(source) {
|
|
1150
|
+
return source !== void 0 && IMPLICIT_MODEL_SELECTION_SOURCES.includes(source);
|
|
1151
|
+
}
|
|
1149
1152
|
function resolveRequireToolApproval(rules) {
|
|
1150
1153
|
const raw = rules?.requireToolApproval ?? rules?.requireApproval;
|
|
1151
1154
|
if (raw === void 0 || raw === null) return void 0;
|
|
@@ -1173,7 +1176,7 @@ function normalizeLuaJobExecutionTimeoutSeconds(timeout) {
|
|
|
1173
1176
|
}
|
|
1174
1177
|
return Math.min(Math.max(timeout, LUA_JOB_MIN_TIMEOUT_SECONDS), LUA_JOB_MAX_TIMEOUT_SECONDS);
|
|
1175
1178
|
}
|
|
1176
|
-
var __defProp2, __name2, 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, AGENT_LOG_SOURCES, 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;
|
|
1179
|
+
var __defProp2, __name2, 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, AGENT_LOG_SOURCES, 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;
|
|
1177
1180
|
var init_dist = __esm({
|
|
1178
1181
|
"../shared-types/dist/index.mjs"() {
|
|
1179
1182
|
"use strict";
|
|
@@ -1487,6 +1490,12 @@ var init_dist = __esm({
|
|
|
1487
1490
|
"high",
|
|
1488
1491
|
"max"
|
|
1489
1492
|
];
|
|
1493
|
+
IMPLICIT_MODEL_SELECTION_SOURCES = [
|
|
1494
|
+
"workspace-default",
|
|
1495
|
+
"platform-default"
|
|
1496
|
+
];
|
|
1497
|
+
__name(isImplicitModelSelectionSource, "isImplicitModelSelectionSource");
|
|
1498
|
+
__name2(isImplicitModelSelectionSource, "isImplicitModelSelectionSource");
|
|
1490
1499
|
__name(resolveRequireToolApproval, "resolveRequireToolApproval");
|
|
1491
1500
|
__name2(resolveRequireToolApproval, "resolveRequireToolApproval");
|
|
1492
1501
|
AGENT_NAME_TOKEN = "[Your Agent Name]";
|
|
@@ -7588,7 +7597,8 @@ var init_agent_plugin = __esm({
|
|
|
7588
7597
|
const isDefaultExport = classDecl.isDefaultExport();
|
|
7589
7598
|
const exportName = isDefaultExport ? "default" : className;
|
|
7590
7599
|
const name = readStringMember(classDecl, "name") ?? deriveNameFromClassName(className);
|
|
7591
|
-
const
|
|
7600
|
+
const routingDescription = readStringMember(classDecl, "description");
|
|
7601
|
+
const baseDescription = routingDescription ?? "";
|
|
7592
7602
|
const personaHit = findClassMember(classDecl, "persona", "property");
|
|
7593
7603
|
let persona = "";
|
|
7594
7604
|
if (personaHit && Node13.isPropertyDeclaration(personaHit.node)) {
|
|
@@ -7639,6 +7649,7 @@ var init_agent_plugin = __esm({
|
|
|
7639
7649
|
metadata: {
|
|
7640
7650
|
pattern: "class-definition",
|
|
7641
7651
|
persona,
|
|
7652
|
+
routingDescription,
|
|
7642
7653
|
model,
|
|
7643
7654
|
hasModelResolver,
|
|
7644
7655
|
modelSettings,
|
|
@@ -7671,6 +7682,7 @@ var init_agent_plugin = __esm({
|
|
|
7671
7682
|
"voice",
|
|
7672
7683
|
"text"
|
|
7673
7684
|
]) ?? "";
|
|
7685
|
+
const routingDescription = extractStringProperty(config, "description");
|
|
7674
7686
|
const { model, hasModelResolver } = this.extractModelInfo(config);
|
|
7675
7687
|
const modelSettings = this.extractModelSettings(config);
|
|
7676
7688
|
const batching = this.extractBatchingInfo(config);
|
|
@@ -7688,6 +7700,7 @@ var init_agent_plugin = __esm({
|
|
|
7688
7700
|
metadata: {
|
|
7689
7701
|
pattern,
|
|
7690
7702
|
persona,
|
|
7703
|
+
routingDescription,
|
|
7691
7704
|
model,
|
|
7692
7705
|
hasModelResolver,
|
|
7693
7706
|
modelSettings,
|
|
@@ -7873,6 +7886,7 @@ var init_agent_plugin = __esm({
|
|
|
7873
7886
|
return {
|
|
7874
7887
|
...this.baseManifestFields(compiled),
|
|
7875
7888
|
persona: agentMeta.persona,
|
|
7889
|
+
routingDescription: agentMeta.routingDescription,
|
|
7876
7890
|
model: agentMeta.model,
|
|
7877
7891
|
hasModelResolver: agentMeta.hasModelResolver || void 0,
|
|
7878
7892
|
modelSettings: agentMeta.modelSettings,
|
|
@@ -13678,6 +13692,31 @@ var init_channels_send_api_service = __esm({
|
|
|
13678
13692
|
}
|
|
13679
13693
|
});
|
|
13680
13694
|
|
|
13695
|
+
// src/api/inbox-push.api.service.ts
|
|
13696
|
+
var InboxPushApiService;
|
|
13697
|
+
var init_inbox_push_api_service = __esm({
|
|
13698
|
+
"src/api/inbox-push.api.service.ts"() {
|
|
13699
|
+
"use strict";
|
|
13700
|
+
init_http_client();
|
|
13701
|
+
InboxPushApiService = class extends HttpClient {
|
|
13702
|
+
static {
|
|
13703
|
+
__name(this, "InboxPushApiService");
|
|
13704
|
+
}
|
|
13705
|
+
apiKey;
|
|
13706
|
+
agentId;
|
|
13707
|
+
constructor(baseUrl, apiKey, agentId) {
|
|
13708
|
+
super(baseUrl), this.apiKey = apiKey, this.agentId = agentId;
|
|
13709
|
+
}
|
|
13710
|
+
/** POST /developer/agents/:agentId/inbox/push */
|
|
13711
|
+
async push(input) {
|
|
13712
|
+
return this.httpPost(`/developer/agents/${this.agentId}/inbox/push`, input, {
|
|
13713
|
+
Authorization: `Bearer ${this.apiKey}`
|
|
13714
|
+
});
|
|
13715
|
+
}
|
|
13716
|
+
};
|
|
13717
|
+
}
|
|
13718
|
+
});
|
|
13719
|
+
|
|
13681
13720
|
// src/api/directory.api.service.ts
|
|
13682
13721
|
var DirectoryApiService;
|
|
13683
13722
|
var init_directory_api_service = __esm({
|
|
@@ -13813,6 +13852,7 @@ __export(lazy_instances_exports, {
|
|
|
13813
13852
|
getDeveloperInstance: () => getDeveloperInstance,
|
|
13814
13853
|
getDeviceInstance: () => getDeviceInstance,
|
|
13815
13854
|
getDirectoryInstance: () => getDirectoryInstance,
|
|
13855
|
+
getInboxPushInstance: () => getInboxPushInstance,
|
|
13816
13856
|
getJobInstance: () => getJobInstance,
|
|
13817
13857
|
getOrderInstance: () => getOrderInstance,
|
|
13818
13858
|
getProductsInstance: () => getProductsInstance,
|
|
@@ -13920,6 +13960,13 @@ async function getVoiceInstance() {
|
|
|
13920
13960
|
}
|
|
13921
13961
|
return _voiceInstance;
|
|
13922
13962
|
}
|
|
13963
|
+
async function getInboxPushInstance() {
|
|
13964
|
+
if (!_inboxPushInstance) {
|
|
13965
|
+
const creds = await getCredentials();
|
|
13966
|
+
_inboxPushInstance = new InboxPushApiService(BASE_URLS.API, creds.apiKey, creds.agentId);
|
|
13967
|
+
}
|
|
13968
|
+
return _inboxPushInstance;
|
|
13969
|
+
}
|
|
13923
13970
|
async function getChannelsSendInstance() {
|
|
13924
13971
|
if (!_channelsSendInstance) {
|
|
13925
13972
|
const creds = await getCredentials();
|
|
@@ -13951,7 +13998,7 @@ function clearAllInstances() {
|
|
|
13951
13998
|
_channelsSendInstance = null;
|
|
13952
13999
|
_directoryInstance = null;
|
|
13953
14000
|
}
|
|
13954
|
-
var _userInstance, _dataInstance, _productsInstance, _basketsInstance, _orderInstance, _webhookInstance, _jobInstance, _aiInstance, _agentsInstance, _whatsAppTemplatesInstance, _cdnInstance, _developerInstance, _voiceInstance, _channelsSendInstance, _directoryInstance, _deviceInstance;
|
|
14001
|
+
var _userInstance, _dataInstance, _productsInstance, _basketsInstance, _orderInstance, _webhookInstance, _jobInstance, _aiInstance, _agentsInstance, _whatsAppTemplatesInstance, _cdnInstance, _developerInstance, _voiceInstance, _channelsSendInstance, _directoryInstance, _deviceInstance, _inboxPushInstance;
|
|
13955
14002
|
var init_lazy_instances = __esm({
|
|
13956
14003
|
"src/api/lazy-instances.ts"() {
|
|
13957
14004
|
"use strict";
|
|
@@ -13971,6 +14018,7 @@ var init_lazy_instances = __esm({
|
|
|
13971
14018
|
init_developer_api_service();
|
|
13972
14019
|
init_voice_api_service();
|
|
13973
14020
|
init_channels_send_api_service();
|
|
14021
|
+
init_inbox_push_api_service();
|
|
13974
14022
|
init_directory_api_service();
|
|
13975
14023
|
_userInstance = null;
|
|
13976
14024
|
_dataInstance = null;
|
|
@@ -14002,6 +14050,8 @@ var init_lazy_instances = __esm({
|
|
|
14002
14050
|
__name(getDeviceInstance, "getDeviceInstance");
|
|
14003
14051
|
__name(getDeveloperInstance, "getDeveloperInstance");
|
|
14004
14052
|
__name(getVoiceInstance, "getVoiceInstance");
|
|
14053
|
+
_inboxPushInstance = null;
|
|
14054
|
+
__name(getInboxPushInstance, "getInboxPushInstance");
|
|
14005
14055
|
__name(getChannelsSendInstance, "getChannelsSendInstance");
|
|
14006
14056
|
__name(getDirectoryInstance, "getDirectoryInstance");
|
|
14007
14057
|
__name(clearAllInstances, "clearAllInstances");
|
|
@@ -16969,6 +17019,29 @@ var AgentHandler = class {
|
|
|
16969
17019
|
async pushAgentConfig(apiKey, agentId, manifest) {
|
|
16970
17020
|
const result = {};
|
|
16971
17021
|
const agent = getPrimitivesByKind(manifest, PrimitiveKind.AGENT)[0];
|
|
17022
|
+
if (agent?.routingDescription !== void 0) {
|
|
17023
|
+
writeProgress("\n\u{1F9ED} Pushing routing description...");
|
|
17024
|
+
try {
|
|
17025
|
+
const success2 = await this.pushDescription({
|
|
17026
|
+
apiKey,
|
|
17027
|
+
agentId
|
|
17028
|
+
}, agent.routingDescription);
|
|
17029
|
+
result.description = {
|
|
17030
|
+
success: success2
|
|
17031
|
+
};
|
|
17032
|
+
if (success2) {
|
|
17033
|
+
writeSuccess(agent.routingDescription ? " \u2705 Routing description pushed" : " \u2705 Routing description cleared");
|
|
17034
|
+
} else {
|
|
17035
|
+
console.error(" \u274C Failed to push routing description");
|
|
17036
|
+
}
|
|
17037
|
+
} catch (error) {
|
|
17038
|
+
if (AuthenticationError.isAuthenticationError(error)) throw error;
|
|
17039
|
+
console.error(` \u274C Failed to push routing description: ${error.message}`);
|
|
17040
|
+
result.description = {
|
|
17041
|
+
success: false
|
|
17042
|
+
};
|
|
17043
|
+
}
|
|
17044
|
+
}
|
|
16972
17045
|
const persona = agent?.persona;
|
|
16973
17046
|
if (hasPersonaTextContent(persona)) {
|
|
16974
17047
|
writeProgress("\n\u{1F319} Pushing persona...");
|
|
@@ -17193,6 +17266,13 @@ var AgentHandler = class {
|
|
|
17193
17266
|
});
|
|
17194
17267
|
return result.success;
|
|
17195
17268
|
}
|
|
17269
|
+
async pushDescription(ctx, description) {
|
|
17270
|
+
const agentApi = new AgentApi(BASE_URLS.API, ctx.apiKey);
|
|
17271
|
+
const result = await agentApi.updateAgent(ctx.agentId, {
|
|
17272
|
+
description
|
|
17273
|
+
});
|
|
17274
|
+
return result.success;
|
|
17275
|
+
}
|
|
17196
17276
|
async pushPersona(ctx, persona) {
|
|
17197
17277
|
const personaApi = new PersonaApi(BASE_URLS.API, ctx.apiKey, ctx.agentId);
|
|
17198
17278
|
const result = await personaApi.createVersion(persona);
|