lua-cli 3.42.0-beta.3 → 3.43.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/index.js +169 -135
- package/dist/index.js.map +1 -1
- package/docs/README.md +2 -2
- package/package.json +4 -4
- package/template/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38093,9 +38093,7 @@ __name(parseAgentVersionFlag, "parseAgentVersionFlag");
|
|
|
38093
38093
|
|
|
38094
38094
|
// src/commands/configure.ts
|
|
38095
38095
|
init_cli();
|
|
38096
|
-
|
|
38097
|
-
// src/utils/auth-flows.ts
|
|
38098
|
-
import inquirer from "inquirer";
|
|
38096
|
+
init_cli_error();
|
|
38099
38097
|
|
|
38100
38098
|
// src/services/auth.ts
|
|
38101
38099
|
import "dotenv/config";
|
|
@@ -38193,6 +38191,44 @@ __name(verifyOTPAndGetToken, "verifyOTPAndGetToken");
|
|
|
38193
38191
|
// src/utils/auth-flows.ts
|
|
38194
38192
|
init_credential_operational_context();
|
|
38195
38193
|
init_analytics();
|
|
38194
|
+
|
|
38195
|
+
// src/utils/prompt-handler.ts
|
|
38196
|
+
init_cli();
|
|
38197
|
+
import inquirer from "inquirer";
|
|
38198
|
+
async function safePrompt(questions) {
|
|
38199
|
+
if (isCiModeEnabled()) {
|
|
38200
|
+
throw new Error("Interactive prompt required but --ci flag is set. Provide all required flags or arguments.");
|
|
38201
|
+
}
|
|
38202
|
+
if (!process.stdin.isTTY && !isCiModeEnabled()) {
|
|
38203
|
+
console.warn("\u26A0\uFE0F Warning: stdin is not a TTY. Interactive prompts may not work correctly.");
|
|
38204
|
+
console.warn("\u{1F4A1} Tip: Use --ci flag in CI/CD environments to fail loudly on missing required flags.");
|
|
38205
|
+
}
|
|
38206
|
+
try {
|
|
38207
|
+
await new Promise((resolve7) => setTimeout(resolve7, 10));
|
|
38208
|
+
const answers = await inquirer.prompt(questions);
|
|
38209
|
+
return answers;
|
|
38210
|
+
} catch (error) {
|
|
38211
|
+
if (error.name === "ExitPromptError" || error.message?.includes("SIGINT")) {
|
|
38212
|
+
process.exit(0);
|
|
38213
|
+
}
|
|
38214
|
+
throw error;
|
|
38215
|
+
}
|
|
38216
|
+
}
|
|
38217
|
+
__name(safePrompt, "safePrompt");
|
|
38218
|
+
async function confirmAction(message) {
|
|
38219
|
+
const answer = await safePrompt([
|
|
38220
|
+
{
|
|
38221
|
+
type: "confirm",
|
|
38222
|
+
name: "confirmed",
|
|
38223
|
+
message,
|
|
38224
|
+
default: false
|
|
38225
|
+
}
|
|
38226
|
+
]);
|
|
38227
|
+
return answer?.confirmed ?? false;
|
|
38228
|
+
}
|
|
38229
|
+
__name(confirmAction, "confirmAction");
|
|
38230
|
+
|
|
38231
|
+
// src/utils/auth-flows.ts
|
|
38196
38232
|
init_cli();
|
|
38197
38233
|
init_firebase_session();
|
|
38198
38234
|
init_request_credential();
|
|
@@ -38236,7 +38272,7 @@ async function completeEmailLogin(signInToken, email) {
|
|
|
38236
38272
|
}
|
|
38237
38273
|
__name(completeEmailLogin, "completeEmailLogin");
|
|
38238
38274
|
async function handleApiKeyAuth() {
|
|
38239
|
-
const { apiKey } = await
|
|
38275
|
+
const { apiKey } = await safePrompt([
|
|
38240
38276
|
{
|
|
38241
38277
|
type: "password",
|
|
38242
38278
|
name: "apiKey",
|
|
@@ -38279,7 +38315,7 @@ async function handleEmailOtpVerify(email, otp) {
|
|
|
38279
38315
|
}
|
|
38280
38316
|
__name(handleEmailOtpVerify, "handleEmailOtpVerify");
|
|
38281
38317
|
async function handleEmailAuth() {
|
|
38282
|
-
const { email } = await
|
|
38318
|
+
const { email } = await safePrompt([
|
|
38283
38319
|
{
|
|
38284
38320
|
type: "input",
|
|
38285
38321
|
name: "email",
|
|
@@ -38295,7 +38331,7 @@ async function handleEmailAuth() {
|
|
|
38295
38331
|
__name(handleEmailAuth, "handleEmailAuth");
|
|
38296
38332
|
async function verifyOTPWithRetry(email) {
|
|
38297
38333
|
for (let attempt = 1; attempt <= OTP_CONFIG.MAX_ATTEMPTS; attempt += 1) {
|
|
38298
|
-
const { pin } = await
|
|
38334
|
+
const { pin } = await safePrompt([
|
|
38299
38335
|
{
|
|
38300
38336
|
type: "input",
|
|
38301
38337
|
name: "pin",
|
|
@@ -38315,7 +38351,7 @@ async function verifyOTPWithRetry(email) {
|
|
|
38315
38351
|
}
|
|
38316
38352
|
__name(verifyOTPWithRetry, "verifyOTPWithRetry");
|
|
38317
38353
|
async function promptAuthMethod() {
|
|
38318
|
-
const { authMethod } = await
|
|
38354
|
+
const { authMethod } = await safePrompt([
|
|
38319
38355
|
{
|
|
38320
38356
|
type: "list",
|
|
38321
38357
|
name: "authMethod",
|
|
@@ -38356,6 +38392,9 @@ async function configureCommand(options = {}) {
|
|
|
38356
38392
|
await handleEmailOtpRequest(email);
|
|
38357
38393
|
}
|
|
38358
38394
|
} else {
|
|
38395
|
+
if (isCiModeEnabled()) {
|
|
38396
|
+
throw CliError.usage("lua auth configure needs an interactive prompt and --ci is set.", "Pass --api-key <key>, or --email <email> [--otp <code>]");
|
|
38397
|
+
}
|
|
38359
38398
|
authMethod = await promptAuthMethod();
|
|
38360
38399
|
clearPromptLines(2);
|
|
38361
38400
|
if (authMethod === "api-key") {
|
|
@@ -38378,46 +38417,10 @@ init_credential_operational_context();
|
|
|
38378
38417
|
init_command_utils();
|
|
38379
38418
|
init_cli_error();
|
|
38380
38419
|
init_cli();
|
|
38381
|
-
import
|
|
38420
|
+
import inquirer3 from "inquirer";
|
|
38382
38421
|
import { writeFileSync as writeFileSync7, existsSync as existsSync8 } from "fs";
|
|
38383
38422
|
import { join as join8 } from "path";
|
|
38384
38423
|
|
|
38385
|
-
// src/utils/prompt-handler.ts
|
|
38386
|
-
init_cli();
|
|
38387
|
-
import inquirer2 from "inquirer";
|
|
38388
|
-
async function safePrompt(questions) {
|
|
38389
|
-
if (isCiModeEnabled()) {
|
|
38390
|
-
throw new Error("Interactive prompt required but --ci flag is set. Provide all required flags or arguments.");
|
|
38391
|
-
}
|
|
38392
|
-
if (!process.stdin.isTTY && !isCiModeEnabled()) {
|
|
38393
|
-
console.warn("\u26A0\uFE0F Warning: stdin is not a TTY. Interactive prompts may not work correctly.");
|
|
38394
|
-
console.warn("\u{1F4A1} Tip: Use --ci flag in CI/CD environments to fail loudly on missing required flags.");
|
|
38395
|
-
}
|
|
38396
|
-
try {
|
|
38397
|
-
await new Promise((resolve7) => setTimeout(resolve7, 10));
|
|
38398
|
-
const answers = await inquirer2.prompt(questions);
|
|
38399
|
-
return answers;
|
|
38400
|
-
} catch (error) {
|
|
38401
|
-
if (error.name === "ExitPromptError" || error.message?.includes("SIGINT")) {
|
|
38402
|
-
process.exit(0);
|
|
38403
|
-
}
|
|
38404
|
-
throw error;
|
|
38405
|
-
}
|
|
38406
|
-
}
|
|
38407
|
-
__name(safePrompt, "safePrompt");
|
|
38408
|
-
async function confirmAction(message) {
|
|
38409
|
-
const answer = await safePrompt([
|
|
38410
|
-
{
|
|
38411
|
-
type: "confirm",
|
|
38412
|
-
name: "confirmed",
|
|
38413
|
-
message,
|
|
38414
|
-
default: false
|
|
38415
|
-
}
|
|
38416
|
-
]);
|
|
38417
|
-
return answer?.confirmed ?? false;
|
|
38418
|
-
}
|
|
38419
|
-
__name(confirmAction, "confirmAction");
|
|
38420
|
-
|
|
38421
38424
|
// src/utils/governance-scaffold.ts
|
|
38422
38425
|
import { readFileSync as readFileSync8, writeFileSync as writeFileSync6, existsSync as existsSync6 } from "fs";
|
|
38423
38426
|
import { join as join6 } from "path";
|
|
@@ -38532,10 +38535,10 @@ ${src}`;
|
|
|
38532
38535
|
__name(injectGovernanceIntoAgent, "injectGovernanceIntoAgent");
|
|
38533
38536
|
|
|
38534
38537
|
// src/utils/init-prompts.ts
|
|
38535
|
-
import
|
|
38538
|
+
import inquirer2 from "inquirer";
|
|
38536
38539
|
import chalk from "chalk";
|
|
38537
38540
|
async function promptAgentChoice() {
|
|
38538
|
-
const { agentChoice } = await
|
|
38541
|
+
const { agentChoice } = await inquirer2.prompt([
|
|
38539
38542
|
{
|
|
38540
38543
|
type: "list",
|
|
38541
38544
|
name: "agentChoice",
|
|
@@ -38564,7 +38567,7 @@ async function promptOrganizationSelection(orgs) {
|
|
|
38564
38567
|
name: org.registeredName || org.name || "Unknown Organization",
|
|
38565
38568
|
value: org
|
|
38566
38569
|
}));
|
|
38567
|
-
const { selectedOrg } = await
|
|
38570
|
+
const { selectedOrg } = await inquirer2.prompt([
|
|
38568
38571
|
{
|
|
38569
38572
|
type: "list",
|
|
38570
38573
|
name: "selectedOrg",
|
|
@@ -38583,7 +38586,7 @@ async function promptAgentSelection(org) {
|
|
|
38583
38586
|
name: agent.name,
|
|
38584
38587
|
value: agent
|
|
38585
38588
|
}));
|
|
38586
|
-
const { selectedAgent } = await
|
|
38589
|
+
const { selectedAgent } = await inquirer2.prompt([
|
|
38587
38590
|
{
|
|
38588
38591
|
type: "list",
|
|
38589
38592
|
name: "selectedAgent",
|
|
@@ -38597,7 +38600,7 @@ __name(promptAgentSelection, "promptAgentSelection");
|
|
|
38597
38600
|
async function promptMetadataCollection(requiredFields) {
|
|
38598
38601
|
const metadata = {};
|
|
38599
38602
|
for (const field of requiredFields) {
|
|
38600
|
-
const { [field]: value3 } = await
|
|
38603
|
+
const { [field]: value3 } = await inquirer2.prompt([
|
|
38601
38604
|
{
|
|
38602
38605
|
type: "input",
|
|
38603
38606
|
name: field,
|
|
@@ -38611,7 +38614,7 @@ async function promptMetadataCollection(requiredFields) {
|
|
|
38611
38614
|
}
|
|
38612
38615
|
__name(promptMetadataCollection, "promptMetadataCollection");
|
|
38613
38616
|
async function promptAgentName() {
|
|
38614
|
-
const { agentName } = await
|
|
38617
|
+
const { agentName } = await inquirer2.prompt([
|
|
38615
38618
|
{
|
|
38616
38619
|
type: "input",
|
|
38617
38620
|
name: "agentName",
|
|
@@ -38638,7 +38641,7 @@ async function promptModelSelection(models) {
|
|
|
38638
38641
|
];
|
|
38639
38642
|
for (const provider of providers) {
|
|
38640
38643
|
const providerModels = models.filter((m) => m.provider === provider);
|
|
38641
|
-
choices.push(new
|
|
38644
|
+
choices.push(new inquirer2.Separator(` \u2500\u2500 ${provider} \u2500\u2500`));
|
|
38642
38645
|
for (const m of providerModels) {
|
|
38643
38646
|
choices.push({
|
|
38644
38647
|
name: `${chalk.bold(m.code)} ${chalk.gray(m.description)}`,
|
|
@@ -38647,7 +38650,7 @@ async function promptModelSelection(models) {
|
|
|
38647
38650
|
});
|
|
38648
38651
|
}
|
|
38649
38652
|
}
|
|
38650
|
-
const { selectedModel } = await
|
|
38653
|
+
const { selectedModel } = await inquirer2.prompt([
|
|
38651
38654
|
{
|
|
38652
38655
|
type: "list",
|
|
38653
38656
|
name: "selectedModel",
|
|
@@ -38680,7 +38683,7 @@ __name(displayPersonaInstructions, "displayPersonaInstructions");
|
|
|
38680
38683
|
async function promptDuplicateOptions(sourceOrg, allOrgs, sourceAgentName) {
|
|
38681
38684
|
let targetOrg = sourceOrg;
|
|
38682
38685
|
if (allOrgs.length > 1) {
|
|
38683
|
-
const { sameOrg } = await
|
|
38686
|
+
const { sameOrg } = await inquirer2.prompt([
|
|
38684
38687
|
{
|
|
38685
38688
|
type: "list",
|
|
38686
38689
|
name: "sameOrg",
|
|
@@ -38704,7 +38707,7 @@ async function promptDuplicateOptions(sourceOrg, allOrgs, sourceAgentName) {
|
|
|
38704
38707
|
}
|
|
38705
38708
|
}
|
|
38706
38709
|
const defaultName = `${sourceAgentName} (Copy)`;
|
|
38707
|
-
const { newName } = await
|
|
38710
|
+
const { newName } = await inquirer2.prompt([
|
|
38708
38711
|
{
|
|
38709
38712
|
type: "input",
|
|
38710
38713
|
name: "newName",
|
|
@@ -38713,7 +38716,7 @@ async function promptDuplicateOptions(sourceOrg, allOrgs, sourceAgentName) {
|
|
|
38713
38716
|
validate: /* @__PURE__ */ __name((input) => input.trim().length > 0 || "Name is required", "validate")
|
|
38714
38717
|
}
|
|
38715
38718
|
]);
|
|
38716
|
-
const { includedBuckets } = await
|
|
38719
|
+
const { includedBuckets } = await inquirer2.prompt([
|
|
38717
38720
|
{
|
|
38718
38721
|
type: "checkbox",
|
|
38719
38722
|
name: "includedBuckets",
|
|
@@ -38757,7 +38760,7 @@ async function promptDuplicateOptions(sourceOrg, allOrgs, sourceAgentName) {
|
|
|
38757
38760
|
console.log(chalk.white(` Including: ${includedBuckets.length > 0 ? includedBuckets.join(", ") : "core agent definition only"}`));
|
|
38758
38761
|
console.log(chalk.cyan("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"));
|
|
38759
38762
|
console.log("");
|
|
38760
|
-
const { confirmed } = await
|
|
38763
|
+
const { confirmed } = await inquirer2.prompt([
|
|
38761
38764
|
{
|
|
38762
38765
|
type: "confirm",
|
|
38763
38766
|
name: "confirmed",
|
|
@@ -41032,7 +41035,7 @@ async function initCommand(options = {}) {
|
|
|
41032
41035
|
writeError("\n\u26A0\uFE0F You don't have access to the agent in this project");
|
|
41033
41036
|
writeInfo(` Agent ID: ${existingAgentId}
|
|
41034
41037
|
`);
|
|
41035
|
-
const { action } = await
|
|
41038
|
+
const { action } = await inquirer3.prompt([
|
|
41036
41039
|
{
|
|
41037
41040
|
type: "list",
|
|
41038
41041
|
name: "action",
|
|
@@ -41069,7 +41072,7 @@ async function initCommand(options = {}) {
|
|
|
41069
41072
|
writeInfo("\n\u{1F4CB} Found existing project configuration");
|
|
41070
41073
|
writeInfo(` Current Agent ID: ${existingAgentId}
|
|
41071
41074
|
`);
|
|
41072
|
-
const { wantSwitch } = await
|
|
41075
|
+
const { wantSwitch } = await inquirer3.prompt([
|
|
41073
41076
|
{
|
|
41074
41077
|
type: "list",
|
|
41075
41078
|
name: "wantSwitch",
|
|
@@ -41356,7 +41359,7 @@ __name(createNewAgentNonInteractive, "createNewAgentNonInteractive");
|
|
|
41356
41359
|
async function createNewAgentFlow(apiKey, organizations, promoCode) {
|
|
41357
41360
|
const agentTypes = await fetchAgentTypes(apiKey);
|
|
41358
41361
|
const selectedAgentType = selectBaseAgentType(agentTypes);
|
|
41359
|
-
const { orgChoice } = await
|
|
41362
|
+
const { orgChoice } = await inquirer3.prompt([
|
|
41360
41363
|
{
|
|
41361
41364
|
type: "list",
|
|
41362
41365
|
name: "orgChoice",
|
|
@@ -41387,7 +41390,7 @@ async function createNewAgentFlow(apiKey, organizations, promoCode) {
|
|
|
41387
41390
|
}
|
|
41388
41391
|
}
|
|
41389
41392
|
if (!orgId) {
|
|
41390
|
-
const { organizationName } = await
|
|
41393
|
+
const { organizationName } = await inquirer3.prompt([
|
|
41391
41394
|
{
|
|
41392
41395
|
type: "input",
|
|
41393
41396
|
name: "organizationName",
|
|
@@ -41515,7 +41518,7 @@ async function promptPersonaReplacement(existingYaml, newPersona) {
|
|
|
41515
41518
|
}
|
|
41516
41519
|
writeInfo("\n\u{1F4DD} Persona Configuration:");
|
|
41517
41520
|
writeInfo(" Existing persona found in project");
|
|
41518
|
-
const { replacePersona } = await
|
|
41521
|
+
const { replacePersona } = await inquirer3.prompt([
|
|
41519
41522
|
{
|
|
41520
41523
|
type: "confirm",
|
|
41521
41524
|
name: "replacePersona",
|
|
@@ -41535,7 +41538,7 @@ async function checkAndRestoreBackup(apiKey, agentId, options) {
|
|
|
41535
41538
|
}
|
|
41536
41539
|
const conflicts = checkRestoreConflicts(manifest, targetDir);
|
|
41537
41540
|
if (!options.autoRestore && conflicts.existingFiles.length > 0) {
|
|
41538
|
-
const { confirm } = await
|
|
41541
|
+
const { confirm } = await inquirer3.prompt([
|
|
41539
41542
|
{
|
|
41540
41543
|
type: "confirm",
|
|
41541
41544
|
name: "confirm",
|
|
@@ -41584,7 +41587,7 @@ __name(checkAndRestoreBackup, "checkAndRestoreBackup");
|
|
|
41584
41587
|
init_request_credential();
|
|
41585
41588
|
init_cli();
|
|
41586
41589
|
init_analytics();
|
|
41587
|
-
import
|
|
41590
|
+
import inquirer4 from "inquirer";
|
|
41588
41591
|
function report(result, requested) {
|
|
41589
41592
|
const deleted = result.sessionCleared || result.apiKeyCleared;
|
|
41590
41593
|
if (!deleted) {
|
|
@@ -41618,7 +41621,7 @@ async function destroyCommand(options) {
|
|
|
41618
41621
|
});
|
|
41619
41622
|
return;
|
|
41620
41623
|
}
|
|
41621
|
-
const { confirm } = await
|
|
41624
|
+
const { confirm } = await inquirer4.prompt([
|
|
41622
41625
|
{
|
|
41623
41626
|
type: "confirm",
|
|
41624
41627
|
name: "confirm",
|
|
@@ -41767,7 +41770,7 @@ async function sessionsRevokeCommand(sessionId) {
|
|
|
41767
41770
|
__name(sessionsRevokeCommand, "sessionsRevokeCommand");
|
|
41768
41771
|
|
|
41769
41772
|
// src/commands/apiKey.ts
|
|
41770
|
-
import
|
|
41773
|
+
import inquirer5 from "inquirer";
|
|
41771
41774
|
init_request_credential();
|
|
41772
41775
|
init_cli();
|
|
41773
41776
|
init_analytics();
|
|
@@ -41793,7 +41796,7 @@ async function apiKeyCommand(options) {
|
|
|
41793
41796
|
});
|
|
41794
41797
|
return;
|
|
41795
41798
|
}
|
|
41796
|
-
const { confirm } = await
|
|
41799
|
+
const { confirm } = await inquirer5.prompt([
|
|
41797
41800
|
{
|
|
41798
41801
|
type: "confirm",
|
|
41799
41802
|
name: "confirm",
|
|
@@ -48425,7 +48428,7 @@ async function compileCommand(options) {
|
|
|
48425
48428
|
__name(compileCommand, "compileCommand");
|
|
48426
48429
|
|
|
48427
48430
|
// src/commands/test.ts
|
|
48428
|
-
import
|
|
48431
|
+
import inquirer6 from "inquirer";
|
|
48429
48432
|
|
|
48430
48433
|
// src/commands/test-output.helpers.ts
|
|
48431
48434
|
import { inspect } from "util";
|
|
@@ -51093,7 +51096,7 @@ async function promptToolSelection(tools) {
|
|
|
51093
51096
|
name: tool.skillName ? `${tool.name} (${tool.skillName}) - ${tool.description}` : `${tool.name} - ${tool.description}`,
|
|
51094
51097
|
value: tool
|
|
51095
51098
|
}));
|
|
51096
|
-
const { selectedTool } = await
|
|
51099
|
+
const { selectedTool } = await inquirer6.prompt([
|
|
51097
51100
|
{
|
|
51098
51101
|
type: "list",
|
|
51099
51102
|
name: "selectedTool",
|
|
@@ -52968,17 +52971,20 @@ function pushAllExitCode(variant) {
|
|
|
52968
52971
|
return variant === "partial" || variant === "error" ? CLI_EXIT.ERROR : void 0;
|
|
52969
52972
|
}
|
|
52970
52973
|
__name(pushAllExitCode, "pushAllExitCode");
|
|
52971
|
-
function formatPushFailureSummary(failedItems) {
|
|
52974
|
+
function formatPushFailureSummary(failedItems, opts = {}) {
|
|
52972
52975
|
if (failedItems.length === 0) return "";
|
|
52976
|
+
const includeLogsHint = opts.includeLogsHint !== false;
|
|
52973
52977
|
const lines = [];
|
|
52974
52978
|
lines.push(`
|
|
52975
52979
|
\u26A0\uFE0F ${failedItems.length} component(s) failed to push:`);
|
|
52976
52980
|
for (const item of failedItems) {
|
|
52977
52981
|
lines.push(` ${item.kind} "${item.name}": ${item.error}`);
|
|
52978
|
-
|
|
52979
|
-
|
|
52980
|
-
|
|
52981
|
-
|
|
52982
|
+
if (includeLogsHint) {
|
|
52983
|
+
lines.push(` \u{1F4A1} Diagnose: ${buildLogsCommand({
|
|
52984
|
+
primitiveType: item.kind,
|
|
52985
|
+
name: item.name
|
|
52986
|
+
})}`);
|
|
52987
|
+
}
|
|
52982
52988
|
}
|
|
52983
52989
|
return lines.join("\n");
|
|
52984
52990
|
}
|
|
@@ -53996,7 +54002,9 @@ ${icon} Pushing ${items.length} ${handler.displayName}(s)...`);
|
|
|
53996
54002
|
}
|
|
53997
54003
|
}
|
|
53998
54004
|
if (failedItems.length > 0) {
|
|
53999
|
-
console.error(formatPushFailureSummary(failedItems
|
|
54005
|
+
console.error(formatPushFailureSummary(failedItems, {
|
|
54006
|
+
includeLogsHint: false
|
|
54007
|
+
}));
|
|
54000
54008
|
}
|
|
54001
54009
|
const agentPushResult = await agentHandler.pushAgentConfig(apiKey, agentId, manifest);
|
|
54002
54010
|
if (agentPushResult.persona?.success) {
|
|
@@ -54217,7 +54225,6 @@ init_cli_error();
|
|
|
54217
54225
|
// src/utils/deploy-helpers.ts
|
|
54218
54226
|
init_cli();
|
|
54219
54227
|
init_cli_error();
|
|
54220
|
-
import inquirer8 from "inquirer";
|
|
54221
54228
|
function formatVersionChoice(version) {
|
|
54222
54229
|
const currentIndicator = version.isCurrent ? " (CURRENT)" : "";
|
|
54223
54230
|
const date = new Date(version.createdDate).toLocaleDateString();
|
|
@@ -54228,8 +54235,17 @@ function sortVersionsByDate(versions) {
|
|
|
54228
54235
|
return versions.sort((a, b) => new Date(b.createdDate).getTime() - new Date(a.createdDate).getTime());
|
|
54229
54236
|
}
|
|
54230
54237
|
__name(sortVersionsByDate, "sortVersionsByDate");
|
|
54238
|
+
function assertDeployInputsForCi(options, ci = isCiModeEnabled()) {
|
|
54239
|
+
if (!ci) return;
|
|
54240
|
+
const hints = [];
|
|
54241
|
+
if (!options.version) hints.push("Pass --set-version <version|latest>");
|
|
54242
|
+
if (!options.force) hints.push("Pass --force: --ci never auto-confirms a deploy to all users");
|
|
54243
|
+
if (hints.length === 0) return;
|
|
54244
|
+
throw CliError.usage("lua deploy cannot prompt under --ci.", hints.join("\n"));
|
|
54245
|
+
}
|
|
54246
|
+
__name(assertDeployInputsForCi, "assertDeployInputsForCi");
|
|
54231
54247
|
async function promptVersionSelection(versions) {
|
|
54232
|
-
const { selectedVersion } = await
|
|
54248
|
+
const { selectedVersion } = await safePrompt([
|
|
54233
54249
|
{
|
|
54234
54250
|
type: "list",
|
|
54235
54251
|
name: "selectedVersion",
|
|
@@ -54245,7 +54261,7 @@ async function promptVersionSelection(versions) {
|
|
|
54245
54261
|
}
|
|
54246
54262
|
__name(promptVersionSelection, "promptVersionSelection");
|
|
54247
54263
|
async function confirmDeployment() {
|
|
54248
|
-
const { confirmed } = await
|
|
54264
|
+
const { confirmed } = await safePrompt([
|
|
54249
54265
|
{
|
|
54250
54266
|
type: "confirm",
|
|
54251
54267
|
name: "confirmed",
|
|
@@ -54452,6 +54468,7 @@ async function deployCommand(type, cmdObj) {
|
|
|
54452
54468
|
}
|
|
54453
54469
|
selectedType = answer.type;
|
|
54454
54470
|
}
|
|
54471
|
+
assertDeployInputsForCi(options);
|
|
54455
54472
|
const apiKey = await requireAuthOrExit();
|
|
54456
54473
|
let personaDeployed = false;
|
|
54457
54474
|
let versionedOutcome = null;
|
|
@@ -54875,7 +54892,7 @@ __name(deployAllCommand, "deployAllCommand");
|
|
|
54875
54892
|
// src/commands/chat.ts
|
|
54876
54893
|
init_cli();
|
|
54877
54894
|
import * as readline from "readline";
|
|
54878
|
-
import
|
|
54895
|
+
import inquirer7 from "inquirer";
|
|
54879
54896
|
|
|
54880
54897
|
// src/api/chat.api.service.ts
|
|
54881
54898
|
init_http_client();
|
|
@@ -55976,7 +55993,7 @@ async function chatCommand(cmdObj) {
|
|
|
55976
55993
|
selectedEnvironment = envResolution.environment;
|
|
55977
55994
|
break;
|
|
55978
55995
|
case "prompt": {
|
|
55979
|
-
const { environment } = await
|
|
55996
|
+
const { environment } = await inquirer7.prompt([
|
|
55980
55997
|
{
|
|
55981
55998
|
type: "list",
|
|
55982
55999
|
name: "environment",
|
|
@@ -56555,7 +56572,7 @@ init_command_utils();
|
|
|
56555
56572
|
init_developer_api_service();
|
|
56556
56573
|
import fs19 from "fs";
|
|
56557
56574
|
import path27 from "path";
|
|
56558
|
-
import
|
|
56575
|
+
import inquirer8 from "inquirer";
|
|
56559
56576
|
init_analytics();
|
|
56560
56577
|
init_cli_error();
|
|
56561
56578
|
function resolveEnvironment(env, hasNonInteractiveFlags) {
|
|
@@ -56652,7 +56669,7 @@ async function envCommand(env, cmdObj) {
|
|
|
56652
56669
|
selectedEnvironment = envResolution.environment;
|
|
56653
56670
|
break;
|
|
56654
56671
|
case "prompt":
|
|
56655
|
-
const { environment } = await
|
|
56672
|
+
const { environment } = await inquirer8.prompt([
|
|
56656
56673
|
{
|
|
56657
56674
|
type: "list",
|
|
56658
56675
|
name: "environment",
|
|
@@ -56842,7 +56859,7 @@ async function manageEnvironmentVariables(context) {
|
|
|
56842
56859
|
const variables = await loadEnvironmentVariables(context);
|
|
56843
56860
|
console.log("\n" + "=".repeat(60));
|
|
56844
56861
|
displayVariables(variables, context, true);
|
|
56845
|
-
const { action } = await
|
|
56862
|
+
const { action } = await inquirer8.prompt([
|
|
56846
56863
|
{
|
|
56847
56864
|
type: "list",
|
|
56848
56865
|
name: "action",
|
|
@@ -56937,7 +56954,7 @@ async function saveProductionEnvVariables(context, variables) {
|
|
|
56937
56954
|
}
|
|
56938
56955
|
__name(saveProductionEnvVariables, "saveProductionEnvVariables");
|
|
56939
56956
|
async function addVariable(context, currentVariables) {
|
|
56940
|
-
const answers = await
|
|
56957
|
+
const answers = await inquirer8.prompt([
|
|
56941
56958
|
{
|
|
56942
56959
|
type: "input",
|
|
56943
56960
|
name: "key",
|
|
@@ -56978,7 +56995,7 @@ async function updateVariable(context, currentVariables) {
|
|
|
56978
56995
|
console.log("\n\u2139\uFE0F No variables to update.\n");
|
|
56979
56996
|
return;
|
|
56980
56997
|
}
|
|
56981
|
-
const { selectedKey } = await
|
|
56998
|
+
const { selectedKey } = await inquirer8.prompt([
|
|
56982
56999
|
{
|
|
56983
57000
|
type: "list",
|
|
56984
57001
|
name: "selectedKey",
|
|
@@ -56990,7 +57007,7 @@ async function updateVariable(context, currentVariables) {
|
|
|
56990
57007
|
}
|
|
56991
57008
|
]);
|
|
56992
57009
|
const currentVariable = currentVariables.find((v) => v.key === selectedKey);
|
|
56993
|
-
const { newValue } = await
|
|
57010
|
+
const { newValue } = await inquirer8.prompt([
|
|
56994
57011
|
{
|
|
56995
57012
|
type: "input",
|
|
56996
57013
|
name: "newValue",
|
|
@@ -57019,7 +57036,7 @@ async function deleteVariable(context, currentVariables) {
|
|
|
57019
57036
|
console.log("\n\u2139\uFE0F No variables to delete.\n");
|
|
57020
57037
|
return;
|
|
57021
57038
|
}
|
|
57022
|
-
const { selectedKey } = await
|
|
57039
|
+
const { selectedKey } = await inquirer8.prompt([
|
|
57023
57040
|
{
|
|
57024
57041
|
type: "list",
|
|
57025
57042
|
name: "selectedKey",
|
|
@@ -57030,7 +57047,7 @@ async function deleteVariable(context, currentVariables) {
|
|
|
57030
57047
|
}))
|
|
57031
57048
|
}
|
|
57032
57049
|
]);
|
|
57033
|
-
const { confirm } = await
|
|
57050
|
+
const { confirm } = await inquirer8.prompt([
|
|
57034
57051
|
{
|
|
57035
57052
|
type: "confirm",
|
|
57036
57053
|
name: "confirm",
|
|
@@ -57063,7 +57080,7 @@ async function viewVariable(currentVariables) {
|
|
|
57063
57080
|
console.log("\n\u2139\uFE0F No variables to view.\n");
|
|
57064
57081
|
return;
|
|
57065
57082
|
}
|
|
57066
|
-
const { selectedKey } = await
|
|
57083
|
+
const { selectedKey } = await inquirer8.prompt([
|
|
57067
57084
|
{
|
|
57068
57085
|
type: "list",
|
|
57069
57086
|
name: "selectedKey",
|
|
@@ -57080,7 +57097,7 @@ async function viewVariable(currentVariables) {
|
|
|
57080
57097
|
console.log("=".repeat(60));
|
|
57081
57098
|
console.log(variable.value);
|
|
57082
57099
|
console.log("=".repeat(60) + "\n");
|
|
57083
|
-
await
|
|
57100
|
+
await inquirer8.prompt([
|
|
57084
57101
|
{
|
|
57085
57102
|
type: "input",
|
|
57086
57103
|
name: "continue",
|
|
@@ -57094,7 +57111,7 @@ __name(viewVariable, "viewVariable");
|
|
|
57094
57111
|
init_dist();
|
|
57095
57112
|
init_cli();
|
|
57096
57113
|
init_constants();
|
|
57097
|
-
import
|
|
57114
|
+
import inquirer9 from "inquirer";
|
|
57098
57115
|
init_command_utils();
|
|
57099
57116
|
init_compiler2();
|
|
57100
57117
|
init_artifact_loader();
|
|
@@ -57396,7 +57413,7 @@ async function viewPersonaInteractive(persona) {
|
|
|
57396
57413
|
console.log("No persona configured.");
|
|
57397
57414
|
}
|
|
57398
57415
|
console.log("=".repeat(60) + "\n");
|
|
57399
|
-
await
|
|
57416
|
+
await inquirer9.prompt([
|
|
57400
57417
|
{
|
|
57401
57418
|
type: "input",
|
|
57402
57419
|
name: "continue",
|
|
@@ -57520,7 +57537,7 @@ async function viewVersionDetailsInteractive(version) {
|
|
|
57520
57537
|
console.log("=".repeat(60) + "\n");
|
|
57521
57538
|
console.log(version.persona);
|
|
57522
57539
|
console.log("\n" + "=".repeat(60) + "\n");
|
|
57523
|
-
await
|
|
57540
|
+
await inquirer9.prompt([
|
|
57524
57541
|
{
|
|
57525
57542
|
type: "input",
|
|
57526
57543
|
name: "continue",
|
|
@@ -59077,7 +59094,7 @@ async function docsCommand() {
|
|
|
59077
59094
|
__name(docsCommand, "docsCommand");
|
|
59078
59095
|
|
|
59079
59096
|
// src/commands/channels.ts
|
|
59080
|
-
import
|
|
59097
|
+
import inquirer10 from "inquirer";
|
|
59081
59098
|
import open5 from "open";
|
|
59082
59099
|
init_cli();
|
|
59083
59100
|
init_command_utils();
|
|
@@ -59590,7 +59607,7 @@ async function executeNonInteractive3(agentApi, agentId, action) {
|
|
|
59590
59607
|
}
|
|
59591
59608
|
__name(executeNonInteractive3, "executeNonInteractive");
|
|
59592
59609
|
async function channelsInteractive(agentApi, agentId, apiKey, config) {
|
|
59593
|
-
const { operation } = await
|
|
59610
|
+
const { operation } = await inquirer10.prompt([
|
|
59594
59611
|
{
|
|
59595
59612
|
type: "list",
|
|
59596
59613
|
name: "operation",
|
|
@@ -59676,7 +59693,7 @@ async function listChannelsInteractive(agentApi, agentId, config) {
|
|
|
59676
59693
|
name: "\u2190 Back to main menu",
|
|
59677
59694
|
value: -1
|
|
59678
59695
|
});
|
|
59679
|
-
const { selectedIndex } = await
|
|
59696
|
+
const { selectedIndex } = await inquirer10.prompt([
|
|
59680
59697
|
{
|
|
59681
59698
|
type: "list",
|
|
59682
59699
|
name: "selectedIndex",
|
|
@@ -59853,7 +59870,7 @@ function displayEmailDetails(channel) {
|
|
|
59853
59870
|
}
|
|
59854
59871
|
__name(displayEmailDetails, "displayEmailDetails");
|
|
59855
59872
|
async function createChannel(agentApi, agentId) {
|
|
59856
|
-
const { channelType } = await
|
|
59873
|
+
const { channelType } = await inquirer10.prompt([
|
|
59857
59874
|
{
|
|
59858
59875
|
type: "list",
|
|
59859
59876
|
name: "channelType",
|
|
@@ -59907,7 +59924,7 @@ async function createChannel(agentApi, agentId) {
|
|
|
59907
59924
|
__name(createChannel, "createChannel");
|
|
59908
59925
|
async function createWhatsAppChannel(agentApi, agentId) {
|
|
59909
59926
|
writeInfo("\u{1F4F1} Creating WhatsApp Channel\n");
|
|
59910
|
-
const answers = await
|
|
59927
|
+
const answers = await inquirer10.prompt([
|
|
59911
59928
|
{
|
|
59912
59929
|
type: "input",
|
|
59913
59930
|
name: "phoneNumberId",
|
|
@@ -59959,7 +59976,7 @@ async function createWhatsAppChannel(agentApi, agentId) {
|
|
|
59959
59976
|
__name(createWhatsAppChannel, "createWhatsAppChannel");
|
|
59960
59977
|
async function createFacebookChannel(agentApi, agentId) {
|
|
59961
59978
|
writeInfo("\u{1F4AC} Creating Facebook Messenger Channel\n");
|
|
59962
|
-
const answers = await
|
|
59979
|
+
const answers = await inquirer10.prompt([
|
|
59963
59980
|
{
|
|
59964
59981
|
type: "password",
|
|
59965
59982
|
name: "accessToken",
|
|
@@ -60001,7 +60018,7 @@ async function createFacebookChannel(agentApi, agentId) {
|
|
|
60001
60018
|
__name(createFacebookChannel, "createFacebookChannel");
|
|
60002
60019
|
async function createEmailChannel(agentApi, agentId) {
|
|
60003
60020
|
writeInfo("\u{1F4E7} Creating Email Channel\n");
|
|
60004
|
-
const { mode } = await
|
|
60021
|
+
const { mode } = await inquirer10.prompt([
|
|
60005
60022
|
{
|
|
60006
60023
|
type: "list",
|
|
60007
60024
|
name: "mode",
|
|
@@ -60019,7 +60036,7 @@ async function createEmailChannel(agentApi, agentId) {
|
|
|
60019
60036
|
}
|
|
60020
60037
|
]);
|
|
60021
60038
|
clearPromptLines(2);
|
|
60022
|
-
const { displayName } = await
|
|
60039
|
+
const { displayName } = await inquirer10.prompt([
|
|
60023
60040
|
{
|
|
60024
60041
|
type: "input",
|
|
60025
60042
|
name: "displayName",
|
|
@@ -60037,7 +60054,7 @@ async function createEmailChannel(agentApi, agentId) {
|
|
|
60037
60054
|
}
|
|
60038
60055
|
};
|
|
60039
60056
|
if (mode === "existing") {
|
|
60040
|
-
const { email } = await
|
|
60057
|
+
const { email } = await inquirer10.prompt([
|
|
60041
60058
|
{
|
|
60042
60059
|
type: "input",
|
|
60043
60060
|
name: "email",
|
|
@@ -60133,7 +60150,7 @@ var SLACK_AGENT_PROMPTS_MAX = 4;
|
|
|
60133
60150
|
var SLACK_AGENT_PROMPT_TITLE_MAX = 75;
|
|
60134
60151
|
var SLACK_AGENT_PROMPT_MESSAGE_MAX = 2e3;
|
|
60135
60152
|
async function promptSlackAgentMode(current) {
|
|
60136
|
-
const { enabled } = await
|
|
60153
|
+
const { enabled } = await inquirer10.prompt([
|
|
60137
60154
|
{
|
|
60138
60155
|
type: "confirm",
|
|
60139
60156
|
name: "enabled",
|
|
@@ -60142,7 +60159,7 @@ async function promptSlackAgentMode(current) {
|
|
|
60142
60159
|
}
|
|
60143
60160
|
]);
|
|
60144
60161
|
if (!enabled) return null;
|
|
60145
|
-
const { description } = await
|
|
60162
|
+
const { description } = await inquirer10.prompt([
|
|
60146
60163
|
{
|
|
60147
60164
|
type: "input",
|
|
60148
60165
|
name: "description",
|
|
@@ -60159,7 +60176,7 @@ async function promptSlackAgentMode(current) {
|
|
|
60159
60176
|
}
|
|
60160
60177
|
const prompts = [];
|
|
60161
60178
|
while (prompts.length < SLACK_AGENT_PROMPTS_MAX) {
|
|
60162
|
-
const { title } = await
|
|
60179
|
+
const { title } = await inquirer10.prompt([
|
|
60163
60180
|
{
|
|
60164
60181
|
type: "input",
|
|
60165
60182
|
name: "title",
|
|
@@ -60168,7 +60185,7 @@ async function promptSlackAgentMode(current) {
|
|
|
60168
60185
|
}
|
|
60169
60186
|
]);
|
|
60170
60187
|
if (!title.trim()) break;
|
|
60171
|
-
const { message } = await
|
|
60188
|
+
const { message } = await inquirer10.prompt([
|
|
60172
60189
|
{
|
|
60173
60190
|
type: "input",
|
|
60174
60191
|
name: "message",
|
|
@@ -60191,7 +60208,7 @@ async function promptSlackAgentMode(current) {
|
|
|
60191
60208
|
}
|
|
60192
60209
|
__name(promptSlackAgentMode, "promptSlackAgentMode");
|
|
60193
60210
|
async function offerToOpen(url, question) {
|
|
60194
|
-
const { openIt } = await
|
|
60211
|
+
const { openIt } = await inquirer10.prompt([
|
|
60195
60212
|
{
|
|
60196
60213
|
type: "confirm",
|
|
60197
60214
|
name: "openIt",
|
|
@@ -60203,7 +60220,7 @@ async function offerToOpen(url, question) {
|
|
|
60203
60220
|
}
|
|
60204
60221
|
__name(offerToOpen, "offerToOpen");
|
|
60205
60222
|
async function startSlackApp(agentApi, agentId, kind) {
|
|
60206
|
-
const { source } = await
|
|
60223
|
+
const { source } = await inquirer10.prompt([
|
|
60207
60224
|
{
|
|
60208
60225
|
type: "list",
|
|
60209
60226
|
name: "source",
|
|
@@ -60263,7 +60280,7 @@ __name(printManifestUpdate, "printManifestUpdate");
|
|
|
60263
60280
|
async function createSlackPrivateChannel(agentApi, agentId) {
|
|
60264
60281
|
writeInfo("\u{1F512} Creating Private Slack Channel\n");
|
|
60265
60282
|
const { existingApp, agentMode } = await startSlackApp(agentApi, agentId, "private");
|
|
60266
|
-
const answers = await
|
|
60283
|
+
const answers = await inquirer10.prompt([
|
|
60267
60284
|
{
|
|
60268
60285
|
type: "password",
|
|
60269
60286
|
name: "accessToken",
|
|
@@ -60308,7 +60325,7 @@ __name(createSlackPrivateChannel, "createSlackPrivateChannel");
|
|
|
60308
60325
|
async function createSlackPublicChannel(agentApi, agentId) {
|
|
60309
60326
|
writeInfo("\u{1F310} Creating Public Slack Channel\n");
|
|
60310
60327
|
const { existingApp, agentMode } = await startSlackApp(agentApi, agentId, "public");
|
|
60311
|
-
const answers = await
|
|
60328
|
+
const answers = await inquirer10.prompt([
|
|
60312
60329
|
{
|
|
60313
60330
|
type: "input",
|
|
60314
60331
|
name: "appId",
|
|
@@ -60392,7 +60409,7 @@ async function slackConnectionActions(agentApi, agentId, channel) {
|
|
|
60392
60409
|
name: "\u2190 Back",
|
|
60393
60410
|
value: "back"
|
|
60394
60411
|
});
|
|
60395
|
-
const { action } = await
|
|
60412
|
+
const { action } = await inquirer10.prompt([
|
|
60396
60413
|
{
|
|
60397
60414
|
type: "list",
|
|
60398
60415
|
name: "action",
|
|
@@ -60424,7 +60441,7 @@ async function slackConnectionActions(agentApi, agentId, channel) {
|
|
|
60424
60441
|
writeSuccess(`\u2705 Agent mode ${agentMode ? "saved" : "turned off"}. It takes effect once Slack has the new manifest:`);
|
|
60425
60442
|
printManifestUpdate(response.data.manifestUrl ?? slackManifestEditorUrl(channel.data.appId, channel.data.teamId), response.data.manifest);
|
|
60426
60443
|
} else if (action === "secret") {
|
|
60427
|
-
const { signingSecret } = await
|
|
60444
|
+
const { signingSecret } = await inquirer10.prompt([
|
|
60428
60445
|
slackSigningSecretPrompt()
|
|
60429
60446
|
]);
|
|
60430
60447
|
const response = await agentApi.saveSlackSigningSecret(agentId, channel.identifier, signingSecret.trim());
|
|
@@ -60461,7 +60478,7 @@ __name(slackConnectionActions, "slackConnectionActions");
|
|
|
60461
60478
|
// src/commands/logs.ts
|
|
60462
60479
|
init_cli();
|
|
60463
60480
|
init_command_utils();
|
|
60464
|
-
import
|
|
60481
|
+
import inquirer11 from "inquirer";
|
|
60465
60482
|
import chalk2 from "chalk";
|
|
60466
60483
|
init_device_api_service();
|
|
60467
60484
|
init_constants();
|
|
@@ -60961,7 +60978,7 @@ async function nonInteractiveLogs(logsApi, agentId, apiKey, options) {
|
|
|
60961
60978
|
}
|
|
60962
60979
|
__name(nonInteractiveLogs, "nonInteractiveLogs");
|
|
60963
60980
|
async function interactiveLogs(logsApi, agentId, apiKey) {
|
|
60964
|
-
const { viewType } = await
|
|
60981
|
+
const { viewType } = await inquirer11.prompt([
|
|
60965
60982
|
{
|
|
60966
60983
|
type: "list",
|
|
60967
60984
|
name: "viewType",
|
|
@@ -60989,7 +61006,7 @@ __name(interactiveLogs, "interactiveLogs");
|
|
|
60989
61006
|
async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
60990
61007
|
let keepFiltering = true;
|
|
60991
61008
|
while (keepFiltering) {
|
|
60992
|
-
const { filterType } = await
|
|
61009
|
+
const { filterType } = await inquirer11.prompt([
|
|
60993
61010
|
{
|
|
60994
61011
|
type: "list",
|
|
60995
61012
|
name: "filterType",
|
|
@@ -60999,7 +61016,7 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
60999
61016
|
name: "\u{1F4CB} All logs",
|
|
61000
61017
|
value: "all"
|
|
61001
61018
|
},
|
|
61002
|
-
new
|
|
61019
|
+
new inquirer11.Separator(),
|
|
61003
61020
|
{
|
|
61004
61021
|
name: "Skills",
|
|
61005
61022
|
value: "skill"
|
|
@@ -61024,7 +61041,7 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
61024
61041
|
name: "Devices",
|
|
61025
61042
|
value: "device"
|
|
61026
61043
|
},
|
|
61027
|
-
new
|
|
61044
|
+
new inquirer11.Separator(),
|
|
61028
61045
|
{
|
|
61029
61046
|
name: "\u{1F4AC} User Messages",
|
|
61030
61047
|
value: "user_message"
|
|
@@ -61057,12 +61074,12 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
61057
61074
|
name: "\u{1F4DE} Voice Calls",
|
|
61058
61075
|
value: "calls"
|
|
61059
61076
|
},
|
|
61060
|
-
new
|
|
61077
|
+
new inquirer11.Separator(),
|
|
61061
61078
|
{
|
|
61062
61079
|
name: "\u2190 Back",
|
|
61063
61080
|
value: "back"
|
|
61064
61081
|
},
|
|
61065
|
-
new
|
|
61082
|
+
new inquirer11.Separator()
|
|
61066
61083
|
]
|
|
61067
61084
|
}
|
|
61068
61085
|
]);
|
|
@@ -61095,7 +61112,7 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
61095
61112
|
`);
|
|
61096
61113
|
continue;
|
|
61097
61114
|
}
|
|
61098
|
-
const { selectedId } = await
|
|
61115
|
+
const { selectedId } = await inquirer11.prompt([
|
|
61099
61116
|
{
|
|
61100
61117
|
type: "list",
|
|
61101
61118
|
name: "selectedId",
|
|
@@ -61105,17 +61122,17 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
61105
61122
|
name: `All ${capitalizedType}s`,
|
|
61106
61123
|
value: "all"
|
|
61107
61124
|
},
|
|
61108
|
-
new
|
|
61125
|
+
new inquirer11.Separator(),
|
|
61109
61126
|
...items.map((item) => ({
|
|
61110
61127
|
name: item.name,
|
|
61111
61128
|
value: item.id
|
|
61112
61129
|
})),
|
|
61113
|
-
new
|
|
61130
|
+
new inquirer11.Separator(),
|
|
61114
61131
|
{
|
|
61115
61132
|
name: "\u2190 Back",
|
|
61116
61133
|
value: "back"
|
|
61117
61134
|
},
|
|
61118
|
-
new
|
|
61135
|
+
new inquirer11.Separator()
|
|
61119
61136
|
]
|
|
61120
61137
|
}
|
|
61121
61138
|
]);
|
|
@@ -61144,7 +61161,7 @@ async function viewAgentLogsInteractive(logsApi, agentId, filters = {}) {
|
|
|
61144
61161
|
}
|
|
61145
61162
|
const data = response.data;
|
|
61146
61163
|
displayLogsCore(data.logs, data.pagination, "All Agent Logs", true);
|
|
61147
|
-
const { action } = await
|
|
61164
|
+
const { action } = await inquirer11.prompt([
|
|
61148
61165
|
{
|
|
61149
61166
|
type: "list",
|
|
61150
61167
|
name: "action",
|
|
@@ -61199,7 +61216,7 @@ async function handleNavigation(action, pagination, setPage) {
|
|
|
61199
61216
|
if (pagination.hasNextPage) setPage(pagination.nextPage);
|
|
61200
61217
|
return true;
|
|
61201
61218
|
case "goto":
|
|
61202
|
-
const { page } = await
|
|
61219
|
+
const { page } = await inquirer11.prompt({
|
|
61203
61220
|
type: "number",
|
|
61204
61221
|
name: "page",
|
|
61205
61222
|
message: `Enter page number (1-${pagination.totalPages}):`,
|
|
@@ -73606,7 +73623,7 @@ init_skills_api_service();
|
|
|
73606
73623
|
init_developer_api_service();
|
|
73607
73624
|
init_semver();
|
|
73608
73625
|
init_analytics();
|
|
73609
|
-
import
|
|
73626
|
+
import inquirer12 from "inquirer";
|
|
73610
73627
|
|
|
73611
73628
|
// src/commands/template.ts
|
|
73612
73629
|
init_cli();
|
|
@@ -75901,7 +75918,7 @@ async function handleEnvVarConfiguration(initialEnvVars) {
|
|
|
75901
75918
|
name: "Delete a variable",
|
|
75902
75919
|
value: "delete"
|
|
75903
75920
|
},
|
|
75904
|
-
new
|
|
75921
|
+
new inquirer12.Separator(),
|
|
75905
75922
|
{
|
|
75906
75923
|
name: "Finish and continue",
|
|
75907
75924
|
value: "done"
|
|
@@ -75938,7 +75955,7 @@ async function handleEnvVarAction(action, envVars, detectedKeys) {
|
|
|
75938
75955
|
name: `From .env file: ${key}`,
|
|
75939
75956
|
value: key
|
|
75940
75957
|
})),
|
|
75941
|
-
new
|
|
75958
|
+
new inquirer12.Separator(),
|
|
75942
75959
|
{
|
|
75943
75960
|
name: "Manually enter a variable name",
|
|
75944
75961
|
value: "manual"
|
|
@@ -75983,7 +76000,7 @@ async function handleEnvVarAction(action, envVars, detectedKeys) {
|
|
|
75983
76000
|
message: "Which variable do you want to edit?",
|
|
75984
76001
|
choices: [
|
|
75985
76002
|
...keys,
|
|
75986
|
-
new
|
|
76003
|
+
new inquirer12.Separator(),
|
|
75987
76004
|
{
|
|
75988
76005
|
name: "Back",
|
|
75989
76006
|
value: "back"
|
|
@@ -76005,7 +76022,7 @@ async function handleEnvVarAction(action, envVars, detectedKeys) {
|
|
|
76005
76022
|
message: "Which variable do you want to delete?",
|
|
76006
76023
|
choices: [
|
|
76007
76024
|
...keys,
|
|
76008
|
-
new
|
|
76025
|
+
new inquirer12.Separator(),
|
|
76009
76026
|
{
|
|
76010
76027
|
name: "Back",
|
|
76011
76028
|
value: "back"
|
|
@@ -76108,7 +76125,7 @@ async function browseAndSelectSkill(marketplaceApi, purpose, publishedVersionsOn
|
|
|
76108
76125
|
}))
|
|
76109
76126
|
];
|
|
76110
76127
|
if (hasNextPage || hasPrevPage) {
|
|
76111
|
-
choices.push(new
|
|
76128
|
+
choices.push(new inquirer12.Separator());
|
|
76112
76129
|
if (hasPrevPage) {
|
|
76113
76130
|
choices.push({
|
|
76114
76131
|
name: `\u2190 Previous page (${currentPage - 1}/${totalPages})`,
|
|
@@ -76126,7 +76143,7 @@ async function browseAndSelectSkill(marketplaceApi, purpose, publishedVersionsOn
|
|
|
76126
76143
|
});
|
|
76127
76144
|
}
|
|
76128
76145
|
}
|
|
76129
|
-
choices.push(new
|
|
76146
|
+
choices.push(new inquirer12.Separator());
|
|
76130
76147
|
choices.push({
|
|
76131
76148
|
name: "\u2190 Back to menu",
|
|
76132
76149
|
value: {
|
|
@@ -82109,7 +82126,7 @@ init_command_utils();
|
|
|
82109
82126
|
init_files();
|
|
82110
82127
|
init_cli();
|
|
82111
82128
|
init_constants();
|
|
82112
|
-
import
|
|
82129
|
+
import inquirer13 from "inquirer";
|
|
82113
82130
|
init_lua_fetch();
|
|
82114
82131
|
init_request_credential();
|
|
82115
82132
|
async function sourceListCommand(opts) {
|
|
@@ -82155,7 +82172,7 @@ async function sourceRollbackCommand(opts) {
|
|
|
82155
82172
|
const dlBlobs = opts.downloadBlobs ?? downloadBlobsParallel;
|
|
82156
82173
|
const restore = opts.restoreFiles ?? defaultRestore;
|
|
82157
82174
|
if (!opts.force) {
|
|
82158
|
-
const { confirm } = await
|
|
82175
|
+
const { confirm } = await inquirer13.prompt([
|
|
82159
82176
|
{
|
|
82160
82177
|
type: "confirm",
|
|
82161
82178
|
name: "confirm",
|
|
@@ -82348,8 +82365,18 @@ function parseVersion2(arg) {
|
|
|
82348
82365
|
__name(parseVersion2, "parseVersion");
|
|
82349
82366
|
|
|
82350
82367
|
// src/commands/version.ts
|
|
82368
|
+
function parsePersonaVersionOption(raw) {
|
|
82369
|
+
if (raw === void 0) return void 0;
|
|
82370
|
+
const text = String(raw).trim().replace(/^v/i, "");
|
|
82371
|
+
if (!/^\d+$/.test(text)) {
|
|
82372
|
+
throw new Error(`--persona-version must be a persona version number (got "${raw}").`);
|
|
82373
|
+
}
|
|
82374
|
+
return Number(text);
|
|
82375
|
+
}
|
|
82376
|
+
__name(parsePersonaVersionOption, "parsePersonaVersionOption");
|
|
82351
82377
|
async function versionCreateCommand(options = {}) {
|
|
82352
82378
|
return withErrorHandling(async () => {
|
|
82379
|
+
const personaVersion = parsePersonaVersionOption(options.personaVersion);
|
|
82353
82380
|
const { apiKey, agentId } = await initializeCommand();
|
|
82354
82381
|
let config = readYamlConfig();
|
|
82355
82382
|
let backupVersion = config?.backup?.activeVersion;
|
|
@@ -82385,7 +82412,10 @@ async function versionCreateCommand(options = {}) {
|
|
|
82385
82412
|
const result = await api.createVersion({
|
|
82386
82413
|
message,
|
|
82387
82414
|
sourceManifestVersion: backupVersion,
|
|
82388
|
-
commitHash: options.commitHash
|
|
82415
|
+
commitHash: options.commitHash,
|
|
82416
|
+
...personaVersion !== void 0 ? {
|
|
82417
|
+
personaVersion
|
|
82418
|
+
} : {}
|
|
82389
82419
|
});
|
|
82390
82420
|
if (!result.success || !result.data) {
|
|
82391
82421
|
const errCode = result.error?.code;
|
|
@@ -82395,6 +82425,9 @@ async function versionCreateCommand(options = {}) {
|
|
|
82395
82425
|
}
|
|
82396
82426
|
throw new Error(result.error?.message ?? "Failed to create version");
|
|
82397
82427
|
}
|
|
82428
|
+
if (personaVersion !== void 0 && result.data.snapshot?.persona?.version !== personaVersion) {
|
|
82429
|
+
throw new Error(`v${result.data.version} was created but pins persona version ${String(result.data.snapshot?.persona?.version ?? "none")}, not ${personaVersion}: this server does not support --persona-version. Do not promote v${result.data.version}; delete it with \`lua version delete ${result.data.version}\`.`);
|
|
82430
|
+
}
|
|
82398
82431
|
writeInfo(`\u2713 Created v${result.data.version} (staged). Run \`lua version promote v${result.data.version}\` to deploy.`);
|
|
82399
82432
|
try {
|
|
82400
82433
|
const gitResult = await tryGitCommit({
|
|
@@ -84476,11 +84509,12 @@ Examples:
|
|
|
84476
84509
|
`).action(voiceTestCommand);
|
|
84477
84510
|
voice.command("list").description("List LuaVoice primitives in the compiled manifest").option("--json", "Output as JSON").action(voiceListCommand);
|
|
84478
84511
|
const versionGroup = program2.command("version").description("\u{1F3F7}\uFE0F Manage agent versions \u2014 atomic snapshots of agent state");
|
|
84479
|
-
versionGroup.command("create").description("Snapshot current staged state into a new version").option("-m, --message <message>", "Optional description for this version").option("--auto-push", "Push first if local changes are not yet staged").option("--commit-hash <hash>", "Optional git commit hash to associate with this version").addHelpText("after", `
|
|
84512
|
+
versionGroup.command("create").description("Snapshot current staged state into a new version").option("-m, --message <message>", "Optional description for this version").option("--auto-push", "Push first if local changes are not yet staged").option("--commit-hash <hash>", "Optional git commit hash to associate with this version").option("--persona-version <n>", "Pin this persona version (staged or published) instead of the newest published one").addHelpText("after", `
|
|
84480
84513
|
Examples:
|
|
84481
84514
|
$ lua version create Snapshot current state
|
|
84482
84515
|
$ lua version create -m "Add FAQ skill" Include a description
|
|
84483
84516
|
$ lua version create --auto-push Push then snapshot in one step
|
|
84517
|
+
$ lua version create --persona-version 7 Pin staged persona v7 (practice it before go-live)
|
|
84484
84518
|
`).action((opts) => versionCreateCommand(opts));
|
|
84485
84519
|
versionGroup.command("list").description("List versions of the current agent").option("--all", "Show all versions (no server-side cap)").option("--limit <n>", "Cap output to this many entries", (v) => parseInt(v, 10)).option("--status <status>", "Filter by status: active | staged | superseded | deleted | all", "all").option("--json", "Output as JSON").addHelpText("after", `
|
|
84486
84520
|
Examples:
|