lua-cli 3.17.4 → 3.17.6
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 +10 -4
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +220 -128
- package/dist/index.js.map +1 -1
- package/docs/api/Templates.md +21 -3
- package/package.json +3 -3
- package/template/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2991,10 +2991,14 @@ var init_analytics = __esm({
|
|
|
2991
2991
|
function writeInfo(message) {
|
|
2992
2992
|
process.stdout.write("\r\x1B[K" + message + "\n");
|
|
2993
2993
|
}
|
|
2994
|
+
function writeProgress(message) {
|
|
2995
|
+
process.stderr.write("\r\x1B[K" + message);
|
|
2996
|
+
}
|
|
2994
2997
|
var init_write_info = __esm({
|
|
2995
2998
|
"src/utils/write-info.ts"() {
|
|
2996
2999
|
"use strict";
|
|
2997
3000
|
__name(writeInfo, "writeInfo");
|
|
3001
|
+
__name(writeProgress, "writeProgress");
|
|
2998
3002
|
}
|
|
2999
3003
|
});
|
|
3000
3004
|
|
|
@@ -3134,9 +3138,6 @@ function clearPromptLines(count = 1) {
|
|
|
3134
3138
|
process.stdout.write("\x1B[1A\x1B[2K");
|
|
3135
3139
|
}
|
|
3136
3140
|
}
|
|
3137
|
-
function writeProgress(message) {
|
|
3138
|
-
process.stdout.write("\r\x1B[K" + message);
|
|
3139
|
-
}
|
|
3140
3141
|
function writeSuccess(message) {
|
|
3141
3142
|
process.stdout.write("\r\x1B[K" + message + "\n");
|
|
3142
3143
|
}
|
|
@@ -3159,7 +3160,6 @@ var init_cli = __esm({
|
|
|
3159
3160
|
__name(showUpdateWarningIfNeeded, "showUpdateWarningIfNeeded");
|
|
3160
3161
|
__name(withErrorHandling, "withErrorHandling");
|
|
3161
3162
|
__name(clearPromptLines, "clearPromptLines");
|
|
3162
|
-
__name(writeProgress, "writeProgress");
|
|
3163
3163
|
__name(writeSuccess, "writeSuccess");
|
|
3164
3164
|
__name(writeError, "writeError");
|
|
3165
3165
|
}
|
|
@@ -13628,6 +13628,16 @@ var init_mcp_server_handler = __esm({
|
|
|
13628
13628
|
// src/index.ts
|
|
13629
13629
|
import { Command } from "commander";
|
|
13630
13630
|
|
|
13631
|
+
// src/cli/parse-agent-version.ts
|
|
13632
|
+
import { InvalidArgumentError } from "commander";
|
|
13633
|
+
function parseAgentVersionFlag(value) {
|
|
13634
|
+
if (!/^\d+$/.test(value) || Number(value) < 1) {
|
|
13635
|
+
throw new InvalidArgumentError("--agent-version must be a positive integer (the version number to preview).");
|
|
13636
|
+
}
|
|
13637
|
+
return Number(value);
|
|
13638
|
+
}
|
|
13639
|
+
__name(parseAgentVersionFlag, "parseAgentVersionFlag");
|
|
13640
|
+
|
|
13631
13641
|
// src/commands/configure.ts
|
|
13632
13642
|
init_cli();
|
|
13633
13643
|
|
|
@@ -24863,6 +24873,74 @@ async function pushProcessorsToSandbox(apiKey, agentId, manifest, yamlConfig, is
|
|
|
24863
24873
|
}
|
|
24864
24874
|
__name(pushProcessorsToSandbox, "pushProcessorsToSandbox");
|
|
24865
24875
|
|
|
24876
|
+
// src/api/agent-version.api.service.ts
|
|
24877
|
+
init_http_client();
|
|
24878
|
+
var AgentVersionApi = class extends HttpClient {
|
|
24879
|
+
static {
|
|
24880
|
+
__name(this, "AgentVersionApi");
|
|
24881
|
+
}
|
|
24882
|
+
apiKey;
|
|
24883
|
+
agentId;
|
|
24884
|
+
constructor(baseUrl, apiKey, agentId) {
|
|
24885
|
+
super(baseUrl);
|
|
24886
|
+
this.apiKey = apiKey;
|
|
24887
|
+
this.agentId = agentId;
|
|
24888
|
+
}
|
|
24889
|
+
get basePath() {
|
|
24890
|
+
return `/developer/agents/${encodeURIComponent(this.agentId)}`;
|
|
24891
|
+
}
|
|
24892
|
+
get authHeader() {
|
|
24893
|
+
return {
|
|
24894
|
+
Authorization: `Bearer ${this.apiKey}`
|
|
24895
|
+
};
|
|
24896
|
+
}
|
|
24897
|
+
// ---------------------------------------------------------------------------
|
|
24898
|
+
// Version CRUD
|
|
24899
|
+
// ---------------------------------------------------------------------------
|
|
24900
|
+
async createVersion(body) {
|
|
24901
|
+
return this.httpPost(`${this.basePath}/versions`, body, this.authHeader);
|
|
24902
|
+
}
|
|
24903
|
+
async listVersions(query) {
|
|
24904
|
+
const params = new URLSearchParams();
|
|
24905
|
+
if (query?.all !== void 0) params.append("all", String(query.all));
|
|
24906
|
+
if (query?.limit !== void 0) params.append("limit", String(query.limit));
|
|
24907
|
+
if (query?.status !== void 0) params.append("status", query.status);
|
|
24908
|
+
const qs = params.toString();
|
|
24909
|
+
const url = qs ? `${this.basePath}/versions?${qs}` : `${this.basePath}/versions`;
|
|
24910
|
+
return this.httpGet(url, this.authHeader);
|
|
24911
|
+
}
|
|
24912
|
+
async getVersion(version) {
|
|
24913
|
+
return this.httpGet(`${this.basePath}/versions/${version}`, this.authHeader);
|
|
24914
|
+
}
|
|
24915
|
+
async deleteVersion(version) {
|
|
24916
|
+
return this.httpDelete(`${this.basePath}/versions/${version}`, this.authHeader);
|
|
24917
|
+
}
|
|
24918
|
+
// ---------------------------------------------------------------------------
|
|
24919
|
+
// Diff
|
|
24920
|
+
// ---------------------------------------------------------------------------
|
|
24921
|
+
async diffVersions(from, to) {
|
|
24922
|
+
const url = `${this.basePath}/versions/diff?from=${from}&to=${to}`;
|
|
24923
|
+
return this.httpGet(url, this.authHeader);
|
|
24924
|
+
}
|
|
24925
|
+
// ---------------------------------------------------------------------------
|
|
24926
|
+
// Promote
|
|
24927
|
+
// ---------------------------------------------------------------------------
|
|
24928
|
+
async promoteVersion(version) {
|
|
24929
|
+
return this.httpPost(`${this.basePath}/versions/${version}/promote`, {}, this.authHeader);
|
|
24930
|
+
}
|
|
24931
|
+
// ---------------------------------------------------------------------------
|
|
24932
|
+
// Patch commit hash — called by `lua version create` after a successful git
|
|
24933
|
+
// commit + tag to propagate the SHA to the backend AgentVersion record.
|
|
24934
|
+
// Failure is non-fatal; the version snapshot is valid whether or not this
|
|
24935
|
+
// PATCH lands.
|
|
24936
|
+
// ---------------------------------------------------------------------------
|
|
24937
|
+
async patchCommitHash(version, commitHash) {
|
|
24938
|
+
return this.httpPatch(`${this.basePath}/versions/${version}/commit-hash`, {
|
|
24939
|
+
commitHash
|
|
24940
|
+
}, this.authHeader);
|
|
24941
|
+
}
|
|
24942
|
+
};
|
|
24943
|
+
|
|
24866
24944
|
// src/commands/chat.ts
|
|
24867
24945
|
init_constants();
|
|
24868
24946
|
|
|
@@ -25162,6 +25240,14 @@ async function chatCommand(cmdObj) {
|
|
|
25162
25240
|
const delay = parseInt(cmdObj?.delay || "100", 10);
|
|
25163
25241
|
const env = cmdObj?.env || null;
|
|
25164
25242
|
const autoClear = !!cmdObj?.clear || !!cmdObj?.clearThread;
|
|
25243
|
+
const rawVersion = cmdObj?.agentVersion;
|
|
25244
|
+
let previewVersion;
|
|
25245
|
+
if (rawVersion != null) {
|
|
25246
|
+
if (!Number.isInteger(rawVersion) || rawVersion < 1) {
|
|
25247
|
+
throw new Error("--agent-version must be a positive integer (the version number to preview).");
|
|
25248
|
+
}
|
|
25249
|
+
previewVersion = rawVersion;
|
|
25250
|
+
}
|
|
25165
25251
|
const rawThread = cmdObj?.thread;
|
|
25166
25252
|
let threadId;
|
|
25167
25253
|
if (rawThread === true) {
|
|
@@ -25170,48 +25256,68 @@ async function chatCommand(cmdObj) {
|
|
|
25170
25256
|
threadId = rawThread;
|
|
25171
25257
|
}
|
|
25172
25258
|
const { config, agentId, apiKey } = await initializeCommand();
|
|
25259
|
+
if (previewVersion != null) {
|
|
25260
|
+
const versionApi = new AgentVersionApi(BASE_URLS.API, apiKey, agentId);
|
|
25261
|
+
const versionResponse = await versionApi.getVersion(previewVersion);
|
|
25262
|
+
if (!versionResponse.success) {
|
|
25263
|
+
throw new Error(`Agent version v${previewVersion} not found.`);
|
|
25264
|
+
}
|
|
25265
|
+
writeInfo(`\u{1F50E} Previewing agent version v${previewVersion} in an isolated thread (not promoted) \u2026`);
|
|
25266
|
+
}
|
|
25173
25267
|
let selectedEnvironment;
|
|
25174
|
-
|
|
25175
|
-
|
|
25176
|
-
|
|
25177
|
-
|
|
25178
|
-
|
|
25179
|
-
|
|
25180
|
-
|
|
25268
|
+
let envResolutionType;
|
|
25269
|
+
if (previewVersion != null) {
|
|
25270
|
+
if (env != null && env !== "production") {
|
|
25271
|
+
throw new Error(`--agent-version previews a server-stored version and only runs against production (got --env ${env}). Remove --env or pass --env production.`);
|
|
25272
|
+
}
|
|
25273
|
+
selectedEnvironment = "production";
|
|
25274
|
+
envResolutionType = "preview_forced_production";
|
|
25275
|
+
} else {
|
|
25276
|
+
const envResolution = resolveChatEnvironment(env, !!(message || batch));
|
|
25277
|
+
envResolutionType = envResolution.type;
|
|
25278
|
+
switch (envResolution.type) {
|
|
25279
|
+
case "resolved":
|
|
25280
|
+
selectedEnvironment = envResolution.environment;
|
|
25281
|
+
break;
|
|
25282
|
+
case "default_sandbox":
|
|
25283
|
+
console.log(`
|
|
25181
25284
|
\u2139\uFE0F No --env provided, defaulting to sandbox. Use --env production for production.
|
|
25182
25285
|
`);
|
|
25183
|
-
|
|
25184
|
-
|
|
25185
|
-
|
|
25186
|
-
|
|
25187
|
-
|
|
25188
|
-
|
|
25189
|
-
|
|
25190
|
-
|
|
25191
|
-
|
|
25192
|
-
|
|
25193
|
-
|
|
25194
|
-
|
|
25195
|
-
|
|
25196
|
-
|
|
25197
|
-
|
|
25198
|
-
|
|
25199
|
-
|
|
25200
|
-
|
|
25201
|
-
|
|
25202
|
-
|
|
25203
|
-
|
|
25204
|
-
|
|
25205
|
-
|
|
25206
|
-
|
|
25207
|
-
|
|
25286
|
+
selectedEnvironment = envResolution.environment;
|
|
25287
|
+
break;
|
|
25288
|
+
case "prompt": {
|
|
25289
|
+
const { environment } = await inquirer9.prompt([
|
|
25290
|
+
{
|
|
25291
|
+
type: "list",
|
|
25292
|
+
name: "environment",
|
|
25293
|
+
message: "Select environment:",
|
|
25294
|
+
choices: [
|
|
25295
|
+
{
|
|
25296
|
+
name: "\u{1F527} Sandbox (Agent will execute skills etc from your local machine)",
|
|
25297
|
+
value: "sandbox"
|
|
25298
|
+
},
|
|
25299
|
+
{
|
|
25300
|
+
name: "\u{1F680} Production (Agent will execute latest version of skills etc)",
|
|
25301
|
+
value: "production"
|
|
25302
|
+
}
|
|
25303
|
+
]
|
|
25304
|
+
}
|
|
25305
|
+
]);
|
|
25306
|
+
selectedEnvironment = environment;
|
|
25307
|
+
break;
|
|
25308
|
+
}
|
|
25309
|
+
case "error":
|
|
25310
|
+
console.log(`\u274C ${envResolution.message}`);
|
|
25311
|
+
throw new Error(`${envResolution.message}`);
|
|
25312
|
+
}
|
|
25208
25313
|
}
|
|
25209
25314
|
let chatEnv = {
|
|
25210
25315
|
type: selectedEnvironment,
|
|
25211
25316
|
agentId,
|
|
25212
25317
|
apiKey,
|
|
25213
25318
|
threadId,
|
|
25214
|
-
autoClear
|
|
25319
|
+
autoClear,
|
|
25320
|
+
previewVersion
|
|
25215
25321
|
};
|
|
25216
25322
|
if (selectedEnvironment === "sandbox") {
|
|
25217
25323
|
writeInfo("\u{1F4A1} Sandbox mode: uses your locally compiled code \u2014 no lua push needed.");
|
|
@@ -25224,11 +25330,12 @@ async function chatCommand(cmdObj) {
|
|
|
25224
25330
|
trackEvent("cli_chat_started", {
|
|
25225
25331
|
environment: selectedEnvironment,
|
|
25226
25332
|
non_interactive_message: !!message,
|
|
25227
|
-
env_resolution_type:
|
|
25333
|
+
env_resolution_type: envResolutionType,
|
|
25228
25334
|
has_preprocessor_overrides: (chatEnv.preprocessorOverrides?.length || 0) > 0,
|
|
25229
25335
|
has_postprocessor_overrides: (chatEnv.postprocessorOverrides?.length || 0) > 0,
|
|
25230
25336
|
has_thread_id: !!chatEnv.threadId,
|
|
25231
|
-
auto_clear: chatEnv.autoClear || false
|
|
25337
|
+
auto_clear: chatEnv.autoClear || false,
|
|
25338
|
+
preview_version: chatEnv.previewVersion ?? null
|
|
25232
25339
|
});
|
|
25233
25340
|
const probeWindow = {
|
|
25234
25341
|
value: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -25477,6 +25584,9 @@ async function sendSandboxMessageStream(chatEnv, messages, callbacks) {
|
|
|
25477
25584
|
if (chatEnv.threadId) {
|
|
25478
25585
|
chatRequest.threadId = chatEnv.threadId;
|
|
25479
25586
|
}
|
|
25587
|
+
if (chatEnv.previewVersion != null) {
|
|
25588
|
+
chatRequest.version = chatEnv.previewVersion;
|
|
25589
|
+
}
|
|
25480
25590
|
const chatApi = new ChatApi(BASE_URLS.CHAT, chatEnv.apiKey);
|
|
25481
25591
|
await chatApi.sendMessageStream(chatEnv.agentId, chatRequest, callbacks.onChunk, callbacks.onPostprocessComplete, callbacks.onPreprocessorBlocked, callbacks.onBatchAbort, callbacks.onBatchHandled);
|
|
25482
25592
|
}
|
|
@@ -25492,6 +25602,9 @@ async function sendProductionMessageStream(chatEnv, messages, callbacks) {
|
|
|
25492
25602
|
if (chatEnv.threadId) {
|
|
25493
25603
|
chatRequest.threadId = chatEnv.threadId;
|
|
25494
25604
|
}
|
|
25605
|
+
if (chatEnv.previewVersion != null) {
|
|
25606
|
+
chatRequest.version = chatEnv.previewVersion;
|
|
25607
|
+
}
|
|
25495
25608
|
const chatApi = new ChatApi(BASE_URLS.CHAT, chatEnv.apiKey);
|
|
25496
25609
|
await chatApi.sendMessageStream(chatEnv.agentId, chatRequest, callbacks.onChunk, callbacks.onPostprocessComplete, callbacks.onPreprocessorBlocked, callbacks.onBatchAbort, callbacks.onBatchHandled);
|
|
25497
25610
|
}
|
|
@@ -41706,76 +41819,6 @@ __name(defaultRestore, "defaultRestore");
|
|
|
41706
41819
|
init_cli();
|
|
41707
41820
|
init_command_utils();
|
|
41708
41821
|
init_analytics();
|
|
41709
|
-
|
|
41710
|
-
// src/api/agent-version.api.service.ts
|
|
41711
|
-
init_http_client();
|
|
41712
|
-
var AgentVersionApi = class extends HttpClient {
|
|
41713
|
-
static {
|
|
41714
|
-
__name(this, "AgentVersionApi");
|
|
41715
|
-
}
|
|
41716
|
-
apiKey;
|
|
41717
|
-
agentId;
|
|
41718
|
-
constructor(baseUrl, apiKey, agentId) {
|
|
41719
|
-
super(baseUrl);
|
|
41720
|
-
this.apiKey = apiKey;
|
|
41721
|
-
this.agentId = agentId;
|
|
41722
|
-
}
|
|
41723
|
-
get basePath() {
|
|
41724
|
-
return `/developer/agents/${encodeURIComponent(this.agentId)}`;
|
|
41725
|
-
}
|
|
41726
|
-
get authHeader() {
|
|
41727
|
-
return {
|
|
41728
|
-
Authorization: `Bearer ${this.apiKey}`
|
|
41729
|
-
};
|
|
41730
|
-
}
|
|
41731
|
-
// ---------------------------------------------------------------------------
|
|
41732
|
-
// Version CRUD
|
|
41733
|
-
// ---------------------------------------------------------------------------
|
|
41734
|
-
async createVersion(body) {
|
|
41735
|
-
return this.httpPost(`${this.basePath}/versions`, body, this.authHeader);
|
|
41736
|
-
}
|
|
41737
|
-
async listVersions(query) {
|
|
41738
|
-
const params = new URLSearchParams();
|
|
41739
|
-
if (query?.all !== void 0) params.append("all", String(query.all));
|
|
41740
|
-
if (query?.limit !== void 0) params.append("limit", String(query.limit));
|
|
41741
|
-
if (query?.status !== void 0) params.append("status", query.status);
|
|
41742
|
-
const qs = params.toString();
|
|
41743
|
-
const url = qs ? `${this.basePath}/versions?${qs}` : `${this.basePath}/versions`;
|
|
41744
|
-
return this.httpGet(url, this.authHeader);
|
|
41745
|
-
}
|
|
41746
|
-
async getVersion(version) {
|
|
41747
|
-
return this.httpGet(`${this.basePath}/versions/${version}`, this.authHeader);
|
|
41748
|
-
}
|
|
41749
|
-
async deleteVersion(version) {
|
|
41750
|
-
return this.httpDelete(`${this.basePath}/versions/${version}`, this.authHeader);
|
|
41751
|
-
}
|
|
41752
|
-
// ---------------------------------------------------------------------------
|
|
41753
|
-
// Diff
|
|
41754
|
-
// ---------------------------------------------------------------------------
|
|
41755
|
-
async diffVersions(from, to) {
|
|
41756
|
-
const url = `${this.basePath}/versions/diff?from=${from}&to=${to}`;
|
|
41757
|
-
return this.httpGet(url, this.authHeader);
|
|
41758
|
-
}
|
|
41759
|
-
// ---------------------------------------------------------------------------
|
|
41760
|
-
// Promote
|
|
41761
|
-
// ---------------------------------------------------------------------------
|
|
41762
|
-
async promoteVersion(version) {
|
|
41763
|
-
return this.httpPost(`${this.basePath}/versions/${version}/promote`, {}, this.authHeader);
|
|
41764
|
-
}
|
|
41765
|
-
// ---------------------------------------------------------------------------
|
|
41766
|
-
// Patch commit hash — called by `lua version create` after a successful git
|
|
41767
|
-
// commit + tag to propagate the SHA to the backend AgentVersion record.
|
|
41768
|
-
// Failure is non-fatal; the version snapshot is valid whether or not this
|
|
41769
|
-
// PATCH lands.
|
|
41770
|
-
// ---------------------------------------------------------------------------
|
|
41771
|
-
async patchCommitHash(version, commitHash) {
|
|
41772
|
-
return this.httpPatch(`${this.basePath}/versions/${version}/commit-hash`, {
|
|
41773
|
-
commitHash
|
|
41774
|
-
}, this.authHeader);
|
|
41775
|
-
}
|
|
41776
|
-
};
|
|
41777
|
-
|
|
41778
|
-
// src/commands/version.ts
|
|
41779
41822
|
init_files();
|
|
41780
41823
|
init_constants();
|
|
41781
41824
|
|
|
@@ -41855,8 +41898,37 @@ async function versionCreateCommand(options = {}) {
|
|
|
41855
41898
|
}, "version create");
|
|
41856
41899
|
}
|
|
41857
41900
|
__name(versionCreateCommand, "versionCreateCommand");
|
|
41901
|
+
function formatVersionTable(rows) {
|
|
41902
|
+
const header = {
|
|
41903
|
+
version: "VERSION",
|
|
41904
|
+
status: "STATUS",
|
|
41905
|
+
created: "CREATED",
|
|
41906
|
+
by: "BY",
|
|
41907
|
+
message: "MESSAGE"
|
|
41908
|
+
};
|
|
41909
|
+
const cols = [
|
|
41910
|
+
"version",
|
|
41911
|
+
"status",
|
|
41912
|
+
"created",
|
|
41913
|
+
"by",
|
|
41914
|
+
"message"
|
|
41915
|
+
];
|
|
41916
|
+
const widths = {};
|
|
41917
|
+
for (const c of cols) {
|
|
41918
|
+
widths[c] = Math.max(header[c].length, ...rows.map((r) => r[c].length));
|
|
41919
|
+
}
|
|
41920
|
+
const fmt = /* @__PURE__ */ __name((r) => cols.map((c) => r[c].padEnd(widths[c])).join(" ").trimEnd(), "fmt");
|
|
41921
|
+
return [
|
|
41922
|
+
fmt(header),
|
|
41923
|
+
...rows.map(fmt)
|
|
41924
|
+
];
|
|
41925
|
+
}
|
|
41926
|
+
__name(formatVersionTable, "formatVersionTable");
|
|
41858
41927
|
async function versionListCommand(options = {}) {
|
|
41859
41928
|
return withErrorHandling(async () => {
|
|
41929
|
+
if (options.limit != null && (!Number.isInteger(options.limit) || options.limit < 1)) {
|
|
41930
|
+
throw new Error(`--limit must be a positive integer (got ${options.limit}).`);
|
|
41931
|
+
}
|
|
41860
41932
|
const { apiKey, agentId } = await initializeCommand();
|
|
41861
41933
|
const query = {};
|
|
41862
41934
|
if (options.all) query.all = true;
|
|
@@ -41869,18 +41941,29 @@ async function versionListCommand(options = {}) {
|
|
|
41869
41941
|
}
|
|
41870
41942
|
const versions = response.data;
|
|
41871
41943
|
if (options.json) {
|
|
41872
|
-
|
|
41944
|
+
const summary = versions.map((v) => ({
|
|
41945
|
+
version: v.version,
|
|
41946
|
+
status: v.status,
|
|
41947
|
+
message: v.message,
|
|
41948
|
+
createdBy: v.createdBy,
|
|
41949
|
+
createdByEmail: v.createdByEmail,
|
|
41950
|
+
createdAt: v.createdAt,
|
|
41951
|
+
commitHash: v.commitHash,
|
|
41952
|
+
sourceManifestVersion: v.sourceManifestVersion
|
|
41953
|
+
}));
|
|
41954
|
+
console.log(JSON.stringify(summary, null, 2));
|
|
41873
41955
|
} else if (versions.length === 0) {
|
|
41874
41956
|
writeInfo("(no versions yet \u2014 run `lua version create` to make one)");
|
|
41875
41957
|
} else {
|
|
41876
|
-
|
|
41877
|
-
|
|
41878
|
-
|
|
41879
|
-
|
|
41880
|
-
|
|
41881
|
-
|
|
41882
|
-
|
|
41883
|
-
|
|
41958
|
+
const rows = versions.map((v) => ({
|
|
41959
|
+
version: `v${v.version}${v.status === "active" ? "*" : ""}`,
|
|
41960
|
+
status: v.status,
|
|
41961
|
+
created: new Date(v.createdAt).toISOString().slice(0, 16).replace("T", " "),
|
|
41962
|
+
by: v.createdByEmail || (v.createdBy ? `${v.createdBy.slice(0, 8)}\u2026` : ""),
|
|
41963
|
+
message: (v.message || "").slice(0, 60)
|
|
41964
|
+
}));
|
|
41965
|
+
for (const line of formatVersionTable(rows)) {
|
|
41966
|
+
console.log(line);
|
|
41884
41967
|
}
|
|
41885
41968
|
}
|
|
41886
41969
|
trackEvent("cli_version_list_completed", {
|
|
@@ -41915,7 +41998,8 @@ async function versionShowCommand(versionArg, options = {}) {
|
|
|
41915
41998
|
console.log(` Preprocessors: ${v.snapshot.preprocessors.length}`);
|
|
41916
41999
|
console.log(` Postprocessors: ${v.snapshot.postprocessors.length}`);
|
|
41917
42000
|
console.log(` MCP servers: ${v.snapshot.mcpServers.length}`);
|
|
41918
|
-
|
|
42001
|
+
const personaLabel = v.snapshot.persona.version != null ? `v${v.snapshot.persona.version}` : v.snapshot.persona.versionId || "(none)";
|
|
42002
|
+
console.log(` Persona: ${personaLabel}`);
|
|
41919
42003
|
}
|
|
41920
42004
|
trackEvent("cli_version_show_completed", {
|
|
41921
42005
|
version,
|
|
@@ -41939,6 +42023,7 @@ async function versionDiffCommand(fromArg, toArg, options = {}) {
|
|
|
41939
42023
|
console.log(JSON.stringify(diff, null, 2));
|
|
41940
42024
|
} else {
|
|
41941
42025
|
console.log(`Diff v${from} \u2192 v${to}`);
|
|
42026
|
+
const label = /* @__PURE__ */ __name((item, fallback) => item.name ?? fallback, "label");
|
|
41942
42027
|
const sections = [
|
|
41943
42028
|
{
|
|
41944
42029
|
name: "Skills",
|
|
@@ -41974,25 +42059,31 @@ async function versionDiffCommand(fromArg, toArg, options = {}) {
|
|
|
41974
42059
|
}
|
|
41975
42060
|
console.log(`${name}:`);
|
|
41976
42061
|
for (const a of entry.added) {
|
|
41977
|
-
console.log(` + ${a[key]}@${a.version} (added)`);
|
|
42062
|
+
console.log(` + ${label(a, a[key])}@${a.version} (added)`);
|
|
41978
42063
|
}
|
|
41979
42064
|
for (const r of entry.removed) {
|
|
41980
|
-
console.log(` - ${r[key]}@${r.version} (removed)`);
|
|
42065
|
+
console.log(` - ${label(r, r[key])}@${r.version} (removed)`);
|
|
41981
42066
|
}
|
|
41982
42067
|
for (const c of entry.changed) {
|
|
41983
|
-
console.log(` ~ ${c[key]} ${c.from.version} \u2192 ${c.to.version}`);
|
|
42068
|
+
console.log(` ~ ${label(c, c[key])} ${c.from.version} \u2192 ${c.to.version}`);
|
|
41984
42069
|
}
|
|
41985
42070
|
}
|
|
41986
42071
|
const mcp = diff.mcpServers;
|
|
41987
42072
|
if (mcp.added.length || mcp.removed.length || mcp.changed.length) {
|
|
41988
42073
|
console.log("MCP servers:");
|
|
41989
|
-
mcp.added.forEach((m) => console.log(` + ${m.id} (added)`));
|
|
41990
|
-
mcp.removed.forEach((m) => console.log(` - ${m.id} (removed)`));
|
|
41991
|
-
mcp.changed.forEach((m) => console.log(` ~ ${m.id} (config changed)`));
|
|
42074
|
+
mcp.added.forEach((m) => console.log(` + ${label(m, m.id)} (added)`));
|
|
42075
|
+
mcp.removed.forEach((m) => console.log(` - ${label(m, m.id)} (removed)`));
|
|
42076
|
+
mcp.changed.forEach((m) => console.log(` ~ ${label(m, m.id)} (config changed${m.changedFields?.length ? `: ${m.changedFields.join(", ")}` : ""})`));
|
|
41992
42077
|
} else {
|
|
41993
42078
|
console.log("MCP servers: (no changes)");
|
|
41994
42079
|
}
|
|
41995
|
-
|
|
42080
|
+
if (!diff.persona) {
|
|
42081
|
+
console.log("Persona: (unchanged)");
|
|
42082
|
+
} else if (diff.persona.fromVersion != null && diff.persona.toVersion != null) {
|
|
42083
|
+
console.log(`Persona: v${diff.persona.fromVersion} \u2192 v${diff.persona.toVersion}`);
|
|
42084
|
+
} else {
|
|
42085
|
+
console.log(`Persona: ${diff.persona.from} \u2192 ${diff.persona.to}`);
|
|
42086
|
+
}
|
|
41996
42087
|
console.log(`Model: ${diff.model ? `${diff.model.from} \u2192 ${diff.model.to}` : "(unchanged)"}`);
|
|
41997
42088
|
}
|
|
41998
42089
|
trackEvent("cli_version_diff_completed", {
|
|
@@ -42594,7 +42685,7 @@ Examples:
|
|
|
42594
42685
|
$ lua deploy skill --name mySkill --set-version 1.0.5 --force Deploy specific version
|
|
42595
42686
|
$ lua deploy webhook --name myWebhook --set-version latest --force Deploy latest webhook version
|
|
42596
42687
|
`).action(deployCommand);
|
|
42597
|
-
const chatCmd = program2.command("chat").description("\u{1F4AC} Interactive chat with your agent").option("-e, --env <environment>", "Environment: sandbox or production").option("-m, --message <text>", "Message to send (non-interactive mode)").option("-b, --batch <messages...>", "Send multiple messages concurrently to test batching").option("-d, --delay <ms>", "Delay between batch messages in ms (default: 100)").option("-t, --thread [id]", "Thread ID for conversation scoping. If no ID is provided, a UUID is auto-generated. Displayed at session start so you can reuse it later.").option("--clear", "Automatically clear chat history when session ends (clears thread if -t is used, otherwise clears all history)").option("--clear-thread", "Alias for --clear").addHelpText("after", `
|
|
42688
|
+
const chatCmd = program2.command("chat").description("\u{1F4AC} Interactive chat with your agent").option("-e, --env <environment>", "Environment: sandbox or production").option("-m, --message <text>", "Message to send (non-interactive mode)").option("-b, --batch <messages...>", "Send multiple messages concurrently to test batching").option("-d, --delay <ms>", "Delay between batch messages in ms (default: 100)").option("-t, --thread [id]", "Thread ID for conversation scoping. If no ID is provided, a UUID is auto-generated. Displayed at session start so you can reuse it later.").option("--clear", "Automatically clear chat history when session ends (clears thread if -t is used, otherwise clears all history)").option("--clear-thread", "Alias for --clear").option("--agent-version <n>", "Preview a specific (unpromoted) agent version in an isolated thread", parseAgentVersionFlag).addHelpText("after", `
|
|
42598
42689
|
Examples:
|
|
42599
42690
|
$ lua chat Start interactive chat session
|
|
42600
42691
|
$ lua chat clear Clear all conversation history
|
|
@@ -42607,6 +42698,7 @@ Examples:
|
|
|
42607
42698
|
$ lua chat -t my-test --clear Chat in "my-test" thread, clear on exit
|
|
42608
42699
|
$ lua chat -m "test" -t my-test --clear Non-interactive: isolated thread, clear after
|
|
42609
42700
|
$ lua chat -b "Hello" "What is the weather?" "Tell me a joke" -d 2000 -e sandbox Batch test
|
|
42701
|
+
$ lua chat --agent-version 3 -m "test" Preview agent version 3 in an isolated thread
|
|
42610
42702
|
`).action(chatCommand);
|
|
42611
42703
|
chatCmd.command("clear").description("Clear conversation history").option("--user <identifier>", "User ID, email, or mobile number of the user whose history to clear").option("-t, --thread <id>", "Clear a specific thread's history instead of all history").option("--force", "Skip confirmation prompt").addHelpText("after", `
|
|
42612
42704
|
Examples:
|
|
@@ -43038,7 +43130,7 @@ Examples:
|
|
|
43038
43130
|
$ lua version create -m "Add FAQ skill" Include a description
|
|
43039
43131
|
$ lua version create --auto-push Push then snapshot in one step
|
|
43040
43132
|
`).action((opts) => versionCreateCommand(opts));
|
|
43041
|
-
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 | all", "all").option("--json", "Output as JSON").addHelpText("after", `
|
|
43133
|
+
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", `
|
|
43042
43134
|
Examples:
|
|
43043
43135
|
$ lua version list List all versions (default)
|
|
43044
43136
|
$ lua version list --status active Show only active versions
|