lua-cli 3.43.0 → 3.44.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 +117 -25
- package/dist/api-exports.js +129 -8
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +330 -113
- package/dist/index.js.map +1 -1
- package/dist/voice/test/index.d.ts +18 -18
- package/dist/workflow-builder.d.ts +4 -1
- package/dist/workflow-builder.js.map +1 -1
- package/docs/api/Agents.md +7 -0
- package/docs/api/LuaJob.md +117 -87
- package/docs/api/PostProcessor.md +73 -42
- package/docs/api/User.md +104 -74
- package/docs/workflows/workspaces-and-long-steps.md +1 -1
- package/package.json +4 -4
- package/template/examples/postprocessors/modifyResponse.ts +4 -3
- package/template/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17839,6 +17839,19 @@ var init_types = __esm({
|
|
|
17839
17839
|
|
|
17840
17840
|
// src/api/http.client.ts
|
|
17841
17841
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
17842
|
+
function abortedResponse() {
|
|
17843
|
+
return {
|
|
17844
|
+
success: false,
|
|
17845
|
+
error: {
|
|
17846
|
+
message: "Request aborted",
|
|
17847
|
+
code: REQUEST_ABORTED_CODE,
|
|
17848
|
+
statusCode: 0
|
|
17849
|
+
}
|
|
17850
|
+
};
|
|
17851
|
+
}
|
|
17852
|
+
function isAborted(signal) {
|
|
17853
|
+
return !!signal && signal.aborted === true;
|
|
17854
|
+
}
|
|
17842
17855
|
async function classifyErrorResponse(response) {
|
|
17843
17856
|
let errorData;
|
|
17844
17857
|
try {
|
|
@@ -17994,7 +18007,7 @@ function coreDrainApiRetryDelayMs(error) {
|
|
|
17994
18007
|
const delayMs = retryAfterSeconds * 1e3;
|
|
17995
18008
|
return Math.min(Math.max(0, delayMs), CORE_DRAINING_MAX_RETRY_MS);
|
|
17996
18009
|
}
|
|
17997
|
-
var DEFAULT_REQUEST_TIMEOUT_MS, HttpClient;
|
|
18010
|
+
var DEFAULT_REQUEST_TIMEOUT_MS, REQUEST_ABORTED_CODE, HttpClient;
|
|
17998
18011
|
var init_http_client = __esm({
|
|
17999
18012
|
"src/api/http.client.ts"() {
|
|
18000
18013
|
"use strict";
|
|
@@ -18005,6 +18018,9 @@ var init_http_client = __esm({
|
|
|
18005
18018
|
init_lua_fetch();
|
|
18006
18019
|
init_request_credential();
|
|
18007
18020
|
DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
|
|
18021
|
+
REQUEST_ABORTED_CODE = "REQUEST_ABORTED";
|
|
18022
|
+
__name(abortedResponse, "abortedResponse");
|
|
18023
|
+
__name(isAborted, "isAborted");
|
|
18008
18024
|
HttpClient = class {
|
|
18009
18025
|
static {
|
|
18010
18026
|
__name(this, "HttpClient");
|
|
@@ -18027,9 +18043,17 @@ var init_http_client = __esm({
|
|
|
18027
18043
|
* @private
|
|
18028
18044
|
*/
|
|
18029
18045
|
async request(url, options = {}, overrides) {
|
|
18046
|
+
const callerSignal = overrides?.signal;
|
|
18047
|
+
if (isAborted(callerSignal)) return abortedResponse();
|
|
18030
18048
|
const controller = new AbortController();
|
|
18031
18049
|
const timeoutMs = overrides?.timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
|
|
18032
18050
|
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
18051
|
+
const onCallerAbort = /* @__PURE__ */ __name(() => controller.abort(), "onCallerAbort");
|
|
18052
|
+
if (typeof callerSignal?.addEventListener === "function") {
|
|
18053
|
+
callerSignal.addEventListener("abort", onCallerAbort, {
|
|
18054
|
+
once: true
|
|
18055
|
+
});
|
|
18056
|
+
}
|
|
18033
18057
|
try {
|
|
18034
18058
|
const authorization = this.requestCredential ? `Bearer ${await bearerFor(this.requestCredential)}` : void 0;
|
|
18035
18059
|
const response = await luaFetch(url, {
|
|
@@ -18051,6 +18075,7 @@ var init_http_client = __esm({
|
|
|
18051
18075
|
try {
|
|
18052
18076
|
data = await response.json();
|
|
18053
18077
|
} catch (jsonError) {
|
|
18078
|
+
if (isAborted(callerSignal)) throw jsonError;
|
|
18054
18079
|
data = {};
|
|
18055
18080
|
}
|
|
18056
18081
|
if (typeof data === "object" && data !== null && "success" in data) {
|
|
@@ -18068,6 +18093,9 @@ var init_http_client = __esm({
|
|
|
18068
18093
|
if (isAccessDeniedError(error)) {
|
|
18069
18094
|
throw error;
|
|
18070
18095
|
}
|
|
18096
|
+
if (isAborted(callerSignal)) {
|
|
18097
|
+
return abortedResponse();
|
|
18098
|
+
}
|
|
18071
18099
|
if (error instanceof DOMException && error.name === "AbortError") {
|
|
18072
18100
|
return {
|
|
18073
18101
|
success: false,
|
|
@@ -18084,9 +18112,36 @@ var init_http_client = __esm({
|
|
|
18084
18112
|
statusCode: 0
|
|
18085
18113
|
}
|
|
18086
18114
|
};
|
|
18115
|
+
} finally {
|
|
18116
|
+
clearTimeout(timeoutId);
|
|
18117
|
+
if (typeof callerSignal?.removeEventListener === "function") {
|
|
18118
|
+
callerSignal.removeEventListener("abort", onCallerAbort);
|
|
18119
|
+
}
|
|
18087
18120
|
}
|
|
18088
18121
|
}
|
|
18089
18122
|
/**
|
|
18123
|
+
* A backoff wait the caller's signal can cut short (BAC-1097): resolves at `ms` or on abort, whichever is
|
|
18124
|
+
* first, and never leaves the timer or the listener behind. The caller re-checks `signal.aborted` afterwards.
|
|
18125
|
+
* @private
|
|
18126
|
+
*/
|
|
18127
|
+
sleep(ms, signal) {
|
|
18128
|
+
if (isAborted(signal)) return Promise.resolve();
|
|
18129
|
+
const listenable = typeof signal?.addEventListener === "function";
|
|
18130
|
+
return new Promise((resolve7) => {
|
|
18131
|
+
const onAbort = /* @__PURE__ */ __name(() => {
|
|
18132
|
+
clearTimeout(timer);
|
|
18133
|
+
resolve7();
|
|
18134
|
+
}, "onAbort");
|
|
18135
|
+
const timer = setTimeout(() => {
|
|
18136
|
+
if (listenable) signal.removeEventListener("abort", onAbort);
|
|
18137
|
+
resolve7();
|
|
18138
|
+
}, ms);
|
|
18139
|
+
if (listenable) signal.addEventListener("abort", onAbort, {
|
|
18140
|
+
once: true
|
|
18141
|
+
});
|
|
18142
|
+
});
|
|
18143
|
+
}
|
|
18144
|
+
/**
|
|
18090
18145
|
* Non-2xx classification shared by `request` and `httpStream` (WF-204): 401s become
|
|
18091
18146
|
* `AuthenticationError` (ownership vs credential), 403s throw, everything else returns the
|
|
18092
18147
|
* `{ success:false, error }` envelope with the server body spread in.
|
|
@@ -18154,19 +18209,22 @@ var init_http_client = __esm({
|
|
|
18154
18209
|
}
|
|
18155
18210
|
}
|
|
18156
18211
|
let lastResult = null;
|
|
18212
|
+
const signal = overrides?.signal;
|
|
18157
18213
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
18214
|
+
if (isAborted(signal)) return abortedResponse();
|
|
18158
18215
|
try {
|
|
18159
18216
|
const result = await this.request(url, options, overrides);
|
|
18160
18217
|
if (result.success || !result.error || !this.isRetryableStatus(result.error.statusCode || 0)) {
|
|
18161
18218
|
return result;
|
|
18162
18219
|
}
|
|
18220
|
+
if (isAborted(signal)) return result;
|
|
18163
18221
|
lastResult = result;
|
|
18164
18222
|
} catch (error) {
|
|
18165
18223
|
throw error;
|
|
18166
18224
|
}
|
|
18167
18225
|
if (attempt < maxRetries) {
|
|
18168
18226
|
const backoff = this.retryDelayMs(attempt, lastResult?.error, options.method);
|
|
18169
|
-
await
|
|
18227
|
+
await this.sleep(backoff, signal);
|
|
18170
18228
|
}
|
|
18171
18229
|
}
|
|
18172
18230
|
return lastResult;
|
|
@@ -18215,7 +18273,8 @@ var init_http_client = __esm({
|
|
|
18215
18273
|
async httpPostCoreDrainRetry(url, data, headers, overrides) {
|
|
18216
18274
|
const first = await this.httpPostOnce(url, data, headers, overrides);
|
|
18217
18275
|
if (!isCoreDrainApiError(first.error)) return first;
|
|
18218
|
-
await
|
|
18276
|
+
await this.sleep(coreDrainApiRetryDelayMs(first.error), overrides?.signal);
|
|
18277
|
+
if (isAborted(overrides?.signal)) return abortedResponse();
|
|
18219
18278
|
return this.httpPostOnce(url, data, headers, overrides);
|
|
18220
18279
|
}
|
|
18221
18280
|
/**
|
|
@@ -20702,6 +20761,23 @@ function setCiMode(enabled) {
|
|
|
20702
20761
|
function isCiModeEnabled() {
|
|
20703
20762
|
return isCiMode;
|
|
20704
20763
|
}
|
|
20764
|
+
function setJsonOutputRequested(enabled) {
|
|
20765
|
+
jsonOutputRequested = enabled;
|
|
20766
|
+
}
|
|
20767
|
+
function isJsonOutputRequested() {
|
|
20768
|
+
return jsonOutputRequested;
|
|
20769
|
+
}
|
|
20770
|
+
function commandRequestedJson(command) {
|
|
20771
|
+
for (let current = command; current; current = current.parent) {
|
|
20772
|
+
if (current.getOptionValueSource("json") === "cli" && current.getOptionValue("json")) return true;
|
|
20773
|
+
}
|
|
20774
|
+
return false;
|
|
20775
|
+
}
|
|
20776
|
+
function registerJsonErrorEnvelope(program2) {
|
|
20777
|
+
program2.hook("preAction", (_thisCommand, actionCommand) => {
|
|
20778
|
+
setJsonOutputRequested(commandRequestedJson(actionCommand));
|
|
20779
|
+
});
|
|
20780
|
+
}
|
|
20705
20781
|
async function showUpdateWarningIfNeeded(versionCheckPromise) {
|
|
20706
20782
|
try {
|
|
20707
20783
|
const result = await versionCheckPromise;
|
|
@@ -20777,7 +20853,8 @@ async function withErrorHandling(commandFn, commandName, opts) {
|
|
|
20777
20853
|
}
|
|
20778
20854
|
let json2 = false;
|
|
20779
20855
|
try {
|
|
20780
|
-
|
|
20856
|
+
if (opts?.json === void 0) json2 = isJsonOutputRequested();
|
|
20857
|
+
else json2 = typeof opts.json === "function" ? !!opts.json() : !!opts.json;
|
|
20781
20858
|
} catch {
|
|
20782
20859
|
}
|
|
20783
20860
|
const reported = reportCliError(error, {
|
|
@@ -20801,7 +20878,7 @@ function writeSuccess(message) {
|
|
|
20801
20878
|
function writeError(message) {
|
|
20802
20879
|
process.stderr.write("\r\x1B[K" + message + "\n");
|
|
20803
20880
|
}
|
|
20804
|
-
var isCiMode;
|
|
20881
|
+
var isCiMode, jsonOutputRequested;
|
|
20805
20882
|
var init_cli = __esm({
|
|
20806
20883
|
"src/utils/cli.ts"() {
|
|
20807
20884
|
"use strict";
|
|
@@ -20815,6 +20892,11 @@ var init_cli = __esm({
|
|
|
20815
20892
|
isCiMode = false;
|
|
20816
20893
|
__name(setCiMode, "setCiMode");
|
|
20817
20894
|
__name(isCiModeEnabled, "isCiModeEnabled");
|
|
20895
|
+
jsonOutputRequested = false;
|
|
20896
|
+
__name(setJsonOutputRequested, "setJsonOutputRequested");
|
|
20897
|
+
__name(isJsonOutputRequested, "isJsonOutputRequested");
|
|
20898
|
+
__name(commandRequestedJson, "commandRequestedJson");
|
|
20899
|
+
__name(registerJsonErrorEnvelope, "registerJsonErrorEnvelope");
|
|
20818
20900
|
__name(showUpdateWarningIfNeeded, "showUpdateWarningIfNeeded");
|
|
20819
20901
|
__name(withErrorHandling, "withErrorHandling");
|
|
20820
20902
|
__name(clearPromptLines, "clearPromptLines");
|
|
@@ -32961,10 +33043,15 @@ var init_webhook_api_service = __esm({
|
|
|
32961
33043
|
});
|
|
32962
33044
|
|
|
32963
33045
|
// src/instances/user.instance.ts
|
|
33046
|
+
function omit(source, key) {
|
|
33047
|
+
const { [key]: _dropped, ...rest } = source;
|
|
33048
|
+
return rest;
|
|
33049
|
+
}
|
|
32964
33050
|
var UserDataInstance;
|
|
32965
33051
|
var init_user_instance = __esm({
|
|
32966
33052
|
"src/instances/user.instance.ts"() {
|
|
32967
33053
|
"use strict";
|
|
33054
|
+
__name(omit, "omit");
|
|
32968
33055
|
UserDataInstance = class {
|
|
32969
33056
|
static {
|
|
32970
33057
|
__name(this, "UserDataInstance");
|
|
@@ -32980,7 +33067,12 @@ var init_user_instance = __esm({
|
|
|
32980
33067
|
* @returns Proxied instance that allows direct access to data properties
|
|
32981
33068
|
*/
|
|
32982
33069
|
constructor(api, data, profile) {
|
|
32983
|
-
this
|
|
33070
|
+
Object.defineProperty(this, "data", {
|
|
33071
|
+
value: data && typeof data === "object" ? data : {},
|
|
33072
|
+
writable: true,
|
|
33073
|
+
enumerable: false,
|
|
33074
|
+
configurable: true
|
|
33075
|
+
});
|
|
32984
33076
|
Object.defineProperty(this, "userAPI", {
|
|
32985
33077
|
value: api,
|
|
32986
33078
|
writable: true,
|
|
@@ -33092,7 +33184,8 @@ var init_user_instance = __esm({
|
|
|
33092
33184
|
*/
|
|
33093
33185
|
async update(data) {
|
|
33094
33186
|
try {
|
|
33095
|
-
const
|
|
33187
|
+
const payload = data && data.data === this.data ? omit(data, "data") : data;
|
|
33188
|
+
const response = await this.userAPI.update(payload);
|
|
33096
33189
|
this.data = response;
|
|
33097
33190
|
return this.data;
|
|
33098
33191
|
} catch (error) {
|
|
@@ -34993,6 +35086,29 @@ var init_ai_api_service = __esm({
|
|
|
34993
35086
|
}
|
|
34994
35087
|
return result.data;
|
|
34995
35088
|
}
|
|
35089
|
+
async image(body) {
|
|
35090
|
+
return this.httpPost(`/developer/ai/${this.agentId}/image`, body, {});
|
|
35091
|
+
}
|
|
35092
|
+
/**
|
|
35093
|
+
* Handles the simplified-vs-full-options branching for `AI.image`.
|
|
35094
|
+
* Simplified (`AI.image(prompt, options?)`) returns the hosted CDN url string; the options overload
|
|
35095
|
+
* (`AI.image({ prompt, ... })`) returns the full `{ url, model, provider }`.
|
|
35096
|
+
*/
|
|
35097
|
+
async imageForSandbox(promptOrOptions, options) {
|
|
35098
|
+
const simplified = typeof promptOrOptions === "string";
|
|
35099
|
+
const body = simplified ? {
|
|
35100
|
+
prompt: promptOrOptions,
|
|
35101
|
+
...options
|
|
35102
|
+
} : promptOrOptions;
|
|
35103
|
+
const result = await this.image(body);
|
|
35104
|
+
if (!result.success) {
|
|
35105
|
+
throw new Error(result.error?.message || "AI image generation failed");
|
|
35106
|
+
}
|
|
35107
|
+
if (!result.data) {
|
|
35108
|
+
throw new Error("AI image generation failed: empty response");
|
|
35109
|
+
}
|
|
35110
|
+
return simplified ? result.data.url : result.data;
|
|
35111
|
+
}
|
|
34996
35112
|
};
|
|
34997
35113
|
}
|
|
34998
35114
|
});
|
|
@@ -35379,6 +35495,12 @@ var init_connection_requests_api_service = __esm({
|
|
|
35379
35495
|
});
|
|
35380
35496
|
|
|
35381
35497
|
// src/api/agents.api.service.ts
|
|
35498
|
+
function isAborted2(signal) {
|
|
35499
|
+
return !!signal && signal.aborted === true;
|
|
35500
|
+
}
|
|
35501
|
+
function abortReason2(signal) {
|
|
35502
|
+
return signal.reason ?? new DOMException("The operation was aborted", "AbortError");
|
|
35503
|
+
}
|
|
35382
35504
|
function toInvocationOutput(data, callerThreadId) {
|
|
35383
35505
|
const toolNames = /* @__PURE__ */ new Set();
|
|
35384
35506
|
for (const step3 of Array.isArray(data.steps) ? data.steps : []) {
|
|
@@ -35464,9 +35586,15 @@ var init_agents_api_service = __esm({
|
|
|
35464
35586
|
});
|
|
35465
35587
|
if (body.identifier) query.set("identifier", body.identifier);
|
|
35466
35588
|
const chatBody = this.toChatGenerateBody(body);
|
|
35467
|
-
|
|
35468
|
-
|
|
35469
|
-
|
|
35589
|
+
const overrides = {
|
|
35590
|
+
...typeof body.timeoutMs === "number" ? {
|
|
35591
|
+
timeoutMs: body.timeoutMs
|
|
35592
|
+
} : {},
|
|
35593
|
+
...body.signal ? {
|
|
35594
|
+
signal: body.signal
|
|
35595
|
+
} : {}
|
|
35596
|
+
};
|
|
35597
|
+
return this.httpPostCoreDrainRetry(`/chat/generate/${targetAgentId}?${query.toString()}`, chatBody, {}, Object.keys(overrides).length > 0 ? overrides : void 0);
|
|
35470
35598
|
}
|
|
35471
35599
|
/**
|
|
35472
35600
|
* Sandbox overload: mirrors the `AI.generate` pattern where the simplified
|
|
@@ -35477,8 +35605,10 @@ var init_agents_api_service = __esm({
|
|
|
35477
35605
|
const input = typeof promptOrInput === "string" ? {
|
|
35478
35606
|
prompt: promptOrInput
|
|
35479
35607
|
} : promptOrInput;
|
|
35608
|
+
if (isAborted2(input.signal)) throw abortReason2(input.signal);
|
|
35480
35609
|
const result = await this.invoke(targetAgentId, input);
|
|
35481
35610
|
if (!result.success) {
|
|
35611
|
+
if (isAborted2(input.signal)) throw abortReason2(input.signal);
|
|
35482
35612
|
throw new Error(result.error?.message || "Agent invocation failed");
|
|
35483
35613
|
}
|
|
35484
35614
|
if (!result.data) {
|
|
@@ -35724,6 +35854,8 @@ var init_agents_api_service = __esm({
|
|
|
35724
35854
|
};
|
|
35725
35855
|
}
|
|
35726
35856
|
};
|
|
35857
|
+
__name(isAborted2, "isAborted");
|
|
35858
|
+
__name(abortReason2, "abortReason");
|
|
35727
35859
|
__name(toInvocationOutput, "toInvocationOutput");
|
|
35728
35860
|
__name(runSummary, "runSummary");
|
|
35729
35861
|
__name(supervisedCheck, "supervisedCheck");
|
|
@@ -38417,7 +38549,6 @@ init_credential_operational_context();
|
|
|
38417
38549
|
init_command_utils();
|
|
38418
38550
|
init_cli_error();
|
|
38419
38551
|
init_cli();
|
|
38420
|
-
import inquirer3 from "inquirer";
|
|
38421
38552
|
import { writeFileSync as writeFileSync7, existsSync as existsSync8 } from "fs";
|
|
38422
38553
|
import { join as join8 } from "path";
|
|
38423
38554
|
|
|
@@ -38538,7 +38669,7 @@ __name(injectGovernanceIntoAgent, "injectGovernanceIntoAgent");
|
|
|
38538
38669
|
import inquirer2 from "inquirer";
|
|
38539
38670
|
import chalk from "chalk";
|
|
38540
38671
|
async function promptAgentChoice() {
|
|
38541
|
-
const { agentChoice } = await
|
|
38672
|
+
const { agentChoice } = await safePrompt([
|
|
38542
38673
|
{
|
|
38543
38674
|
type: "list",
|
|
38544
38675
|
name: "agentChoice",
|
|
@@ -38567,7 +38698,7 @@ async function promptOrganizationSelection(orgs) {
|
|
|
38567
38698
|
name: org.registeredName || org.name || "Unknown Organization",
|
|
38568
38699
|
value: org
|
|
38569
38700
|
}));
|
|
38570
|
-
const { selectedOrg } = await
|
|
38701
|
+
const { selectedOrg } = await safePrompt([
|
|
38571
38702
|
{
|
|
38572
38703
|
type: "list",
|
|
38573
38704
|
name: "selectedOrg",
|
|
@@ -38586,7 +38717,7 @@ async function promptAgentSelection(org) {
|
|
|
38586
38717
|
name: agent.name,
|
|
38587
38718
|
value: agent
|
|
38588
38719
|
}));
|
|
38589
|
-
const { selectedAgent } = await
|
|
38720
|
+
const { selectedAgent } = await safePrompt([
|
|
38590
38721
|
{
|
|
38591
38722
|
type: "list",
|
|
38592
38723
|
name: "selectedAgent",
|
|
@@ -38600,7 +38731,7 @@ __name(promptAgentSelection, "promptAgentSelection");
|
|
|
38600
38731
|
async function promptMetadataCollection(requiredFields) {
|
|
38601
38732
|
const metadata = {};
|
|
38602
38733
|
for (const field of requiredFields) {
|
|
38603
|
-
const { [field]: value3 } = await
|
|
38734
|
+
const { [field]: value3 } = await safePrompt([
|
|
38604
38735
|
{
|
|
38605
38736
|
type: "input",
|
|
38606
38737
|
name: field,
|
|
@@ -38614,7 +38745,7 @@ async function promptMetadataCollection(requiredFields) {
|
|
|
38614
38745
|
}
|
|
38615
38746
|
__name(promptMetadataCollection, "promptMetadataCollection");
|
|
38616
38747
|
async function promptAgentName() {
|
|
38617
|
-
const { agentName } = await
|
|
38748
|
+
const { agentName } = await safePrompt([
|
|
38618
38749
|
{
|
|
38619
38750
|
type: "input",
|
|
38620
38751
|
name: "agentName",
|
|
@@ -38650,7 +38781,7 @@ async function promptModelSelection(models) {
|
|
|
38650
38781
|
});
|
|
38651
38782
|
}
|
|
38652
38783
|
}
|
|
38653
|
-
const { selectedModel } = await
|
|
38784
|
+
const { selectedModel } = await safePrompt([
|
|
38654
38785
|
{
|
|
38655
38786
|
type: "list",
|
|
38656
38787
|
name: "selectedModel",
|
|
@@ -38683,7 +38814,7 @@ __name(displayPersonaInstructions, "displayPersonaInstructions");
|
|
|
38683
38814
|
async function promptDuplicateOptions(sourceOrg, allOrgs, sourceAgentName) {
|
|
38684
38815
|
let targetOrg = sourceOrg;
|
|
38685
38816
|
if (allOrgs.length > 1) {
|
|
38686
|
-
const { sameOrg } = await
|
|
38817
|
+
const { sameOrg } = await safePrompt([
|
|
38687
38818
|
{
|
|
38688
38819
|
type: "list",
|
|
38689
38820
|
name: "sameOrg",
|
|
@@ -38707,7 +38838,7 @@ async function promptDuplicateOptions(sourceOrg, allOrgs, sourceAgentName) {
|
|
|
38707
38838
|
}
|
|
38708
38839
|
}
|
|
38709
38840
|
const defaultName = `${sourceAgentName} (Copy)`;
|
|
38710
|
-
const { newName } = await
|
|
38841
|
+
const { newName } = await safePrompt([
|
|
38711
38842
|
{
|
|
38712
38843
|
type: "input",
|
|
38713
38844
|
name: "newName",
|
|
@@ -38716,7 +38847,7 @@ async function promptDuplicateOptions(sourceOrg, allOrgs, sourceAgentName) {
|
|
|
38716
38847
|
validate: /* @__PURE__ */ __name((input) => input.trim().length > 0 || "Name is required", "validate")
|
|
38717
38848
|
}
|
|
38718
38849
|
]);
|
|
38719
|
-
const { includedBuckets } = await
|
|
38850
|
+
const { includedBuckets } = await safePrompt([
|
|
38720
38851
|
{
|
|
38721
38852
|
type: "checkbox",
|
|
38722
38853
|
name: "includedBuckets",
|
|
@@ -38760,7 +38891,7 @@ async function promptDuplicateOptions(sourceOrg, allOrgs, sourceAgentName) {
|
|
|
38760
38891
|
console.log(chalk.white(` Including: ${includedBuckets.length > 0 ? includedBuckets.join(", ") : "core agent definition only"}`));
|
|
38761
38892
|
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"));
|
|
38762
38893
|
console.log("");
|
|
38763
|
-
const { confirmed } = await
|
|
38894
|
+
const { confirmed } = await safePrompt([
|
|
38764
38895
|
{
|
|
38765
38896
|
type: "confirm",
|
|
38766
38897
|
name: "confirmed",
|
|
@@ -41035,7 +41166,7 @@ async function initCommand(options = {}) {
|
|
|
41035
41166
|
writeError("\n\u26A0\uFE0F You don't have access to the agent in this project");
|
|
41036
41167
|
writeInfo(` Agent ID: ${existingAgentId}
|
|
41037
41168
|
`);
|
|
41038
|
-
const { action } = await
|
|
41169
|
+
const { action } = await safePrompt([
|
|
41039
41170
|
{
|
|
41040
41171
|
type: "list",
|
|
41041
41172
|
name: "action",
|
|
@@ -41072,7 +41203,7 @@ async function initCommand(options = {}) {
|
|
|
41072
41203
|
writeInfo("\n\u{1F4CB} Found existing project configuration");
|
|
41073
41204
|
writeInfo(` Current Agent ID: ${existingAgentId}
|
|
41074
41205
|
`);
|
|
41075
|
-
const { wantSwitch } = await
|
|
41206
|
+
const { wantSwitch } = await safePrompt([
|
|
41076
41207
|
{
|
|
41077
41208
|
type: "list",
|
|
41078
41209
|
name: "wantSwitch",
|
|
@@ -41359,7 +41490,7 @@ __name(createNewAgentNonInteractive, "createNewAgentNonInteractive");
|
|
|
41359
41490
|
async function createNewAgentFlow(apiKey, organizations, promoCode) {
|
|
41360
41491
|
const agentTypes = await fetchAgentTypes(apiKey);
|
|
41361
41492
|
const selectedAgentType = selectBaseAgentType(agentTypes);
|
|
41362
|
-
const { orgChoice } = await
|
|
41493
|
+
const { orgChoice } = await safePrompt([
|
|
41363
41494
|
{
|
|
41364
41495
|
type: "list",
|
|
41365
41496
|
name: "orgChoice",
|
|
@@ -41390,7 +41521,7 @@ async function createNewAgentFlow(apiKey, organizations, promoCode) {
|
|
|
41390
41521
|
}
|
|
41391
41522
|
}
|
|
41392
41523
|
if (!orgId) {
|
|
41393
|
-
const { organizationName } = await
|
|
41524
|
+
const { organizationName } = await safePrompt([
|
|
41394
41525
|
{
|
|
41395
41526
|
type: "input",
|
|
41396
41527
|
name: "organizationName",
|
|
@@ -41518,7 +41649,7 @@ async function promptPersonaReplacement(existingYaml, newPersona) {
|
|
|
41518
41649
|
}
|
|
41519
41650
|
writeInfo("\n\u{1F4DD} Persona Configuration:");
|
|
41520
41651
|
writeInfo(" Existing persona found in project");
|
|
41521
|
-
const { replacePersona } = await
|
|
41652
|
+
const { replacePersona } = await safePrompt([
|
|
41522
41653
|
{
|
|
41523
41654
|
type: "confirm",
|
|
41524
41655
|
name: "replacePersona",
|
|
@@ -41538,7 +41669,7 @@ async function checkAndRestoreBackup(apiKey, agentId, options) {
|
|
|
41538
41669
|
}
|
|
41539
41670
|
const conflicts = checkRestoreConflicts(manifest, targetDir);
|
|
41540
41671
|
if (!options.autoRestore && conflicts.existingFiles.length > 0) {
|
|
41541
|
-
const { confirm } = await
|
|
41672
|
+
const { confirm } = await safePrompt([
|
|
41542
41673
|
{
|
|
41543
41674
|
type: "confirm",
|
|
41544
41675
|
name: "confirm",
|
|
@@ -41587,7 +41718,7 @@ __name(checkAndRestoreBackup, "checkAndRestoreBackup");
|
|
|
41587
41718
|
init_request_credential();
|
|
41588
41719
|
init_cli();
|
|
41589
41720
|
init_analytics();
|
|
41590
|
-
import
|
|
41721
|
+
import inquirer3 from "inquirer";
|
|
41591
41722
|
function report(result, requested) {
|
|
41592
41723
|
const deleted = result.sessionCleared || result.apiKeyCleared;
|
|
41593
41724
|
if (!deleted) {
|
|
@@ -41621,7 +41752,7 @@ async function destroyCommand(options) {
|
|
|
41621
41752
|
});
|
|
41622
41753
|
return;
|
|
41623
41754
|
}
|
|
41624
|
-
const { confirm } = await
|
|
41755
|
+
const { confirm } = await inquirer3.prompt([
|
|
41625
41756
|
{
|
|
41626
41757
|
type: "confirm",
|
|
41627
41758
|
name: "confirm",
|
|
@@ -41770,7 +41901,7 @@ async function sessionsRevokeCommand(sessionId) {
|
|
|
41770
41901
|
__name(sessionsRevokeCommand, "sessionsRevokeCommand");
|
|
41771
41902
|
|
|
41772
41903
|
// src/commands/apiKey.ts
|
|
41773
|
-
import
|
|
41904
|
+
import inquirer4 from "inquirer";
|
|
41774
41905
|
init_request_credential();
|
|
41775
41906
|
init_cli();
|
|
41776
41907
|
init_analytics();
|
|
@@ -41796,7 +41927,7 @@ async function apiKeyCommand(options) {
|
|
|
41796
41927
|
});
|
|
41797
41928
|
return;
|
|
41798
41929
|
}
|
|
41799
|
-
const { confirm } = await
|
|
41930
|
+
const { confirm } = await inquirer4.prompt([
|
|
41800
41931
|
{
|
|
41801
41932
|
type: "confirm",
|
|
41802
41933
|
name: "confirm",
|
|
@@ -48428,7 +48559,7 @@ async function compileCommand(options) {
|
|
|
48428
48559
|
__name(compileCommand, "compileCommand");
|
|
48429
48560
|
|
|
48430
48561
|
// src/commands/test.ts
|
|
48431
|
-
import
|
|
48562
|
+
import inquirer5 from "inquirer";
|
|
48432
48563
|
|
|
48433
48564
|
// src/commands/test-output.helpers.ts
|
|
48434
48565
|
import { inspect } from "util";
|
|
@@ -51096,7 +51227,7 @@ async function promptToolSelection(tools) {
|
|
|
51096
51227
|
name: tool.skillName ? `${tool.name} (${tool.skillName}) - ${tool.description}` : `${tool.name} - ${tool.description}`,
|
|
51097
51228
|
value: tool
|
|
51098
51229
|
}));
|
|
51099
|
-
const { selectedTool } = await
|
|
51230
|
+
const { selectedTool } = await inquirer5.prompt([
|
|
51100
51231
|
{
|
|
51101
51232
|
type: "list",
|
|
51102
51233
|
name: "selectedTool",
|
|
@@ -54892,7 +55023,7 @@ __name(deployAllCommand, "deployAllCommand");
|
|
|
54892
55023
|
// src/commands/chat.ts
|
|
54893
55024
|
init_cli();
|
|
54894
55025
|
import * as readline from "readline";
|
|
54895
|
-
import
|
|
55026
|
+
import inquirer6 from "inquirer";
|
|
54896
55027
|
|
|
54897
55028
|
// src/api/chat.api.service.ts
|
|
54898
55029
|
init_http_client();
|
|
@@ -55993,7 +56124,7 @@ async function chatCommand(cmdObj) {
|
|
|
55993
56124
|
selectedEnvironment = envResolution.environment;
|
|
55994
56125
|
break;
|
|
55995
56126
|
case "prompt": {
|
|
55996
|
-
const { environment } = await
|
|
56127
|
+
const { environment } = await inquirer6.prompt([
|
|
55997
56128
|
{
|
|
55998
56129
|
type: "list",
|
|
55999
56130
|
name: "environment",
|
|
@@ -56572,7 +56703,7 @@ init_command_utils();
|
|
|
56572
56703
|
init_developer_api_service();
|
|
56573
56704
|
import fs19 from "fs";
|
|
56574
56705
|
import path27 from "path";
|
|
56575
|
-
import
|
|
56706
|
+
import inquirer7 from "inquirer";
|
|
56576
56707
|
init_analytics();
|
|
56577
56708
|
init_cli_error();
|
|
56578
56709
|
function resolveEnvironment(env, hasNonInteractiveFlags) {
|
|
@@ -56669,7 +56800,7 @@ async function envCommand(env, cmdObj) {
|
|
|
56669
56800
|
selectedEnvironment = envResolution.environment;
|
|
56670
56801
|
break;
|
|
56671
56802
|
case "prompt":
|
|
56672
|
-
const { environment } = await
|
|
56803
|
+
const { environment } = await inquirer7.prompt([
|
|
56673
56804
|
{
|
|
56674
56805
|
type: "list",
|
|
56675
56806
|
name: "environment",
|
|
@@ -56859,7 +56990,7 @@ async function manageEnvironmentVariables(context) {
|
|
|
56859
56990
|
const variables = await loadEnvironmentVariables(context);
|
|
56860
56991
|
console.log("\n" + "=".repeat(60));
|
|
56861
56992
|
displayVariables(variables, context, true);
|
|
56862
|
-
const { action } = await
|
|
56993
|
+
const { action } = await inquirer7.prompt([
|
|
56863
56994
|
{
|
|
56864
56995
|
type: "list",
|
|
56865
56996
|
name: "action",
|
|
@@ -56954,7 +57085,7 @@ async function saveProductionEnvVariables(context, variables) {
|
|
|
56954
57085
|
}
|
|
56955
57086
|
__name(saveProductionEnvVariables, "saveProductionEnvVariables");
|
|
56956
57087
|
async function addVariable(context, currentVariables) {
|
|
56957
|
-
const answers = await
|
|
57088
|
+
const answers = await inquirer7.prompt([
|
|
56958
57089
|
{
|
|
56959
57090
|
type: "input",
|
|
56960
57091
|
name: "key",
|
|
@@ -56995,7 +57126,7 @@ async function updateVariable(context, currentVariables) {
|
|
|
56995
57126
|
console.log("\n\u2139\uFE0F No variables to update.\n");
|
|
56996
57127
|
return;
|
|
56997
57128
|
}
|
|
56998
|
-
const { selectedKey } = await
|
|
57129
|
+
const { selectedKey } = await inquirer7.prompt([
|
|
56999
57130
|
{
|
|
57000
57131
|
type: "list",
|
|
57001
57132
|
name: "selectedKey",
|
|
@@ -57007,7 +57138,7 @@ async function updateVariable(context, currentVariables) {
|
|
|
57007
57138
|
}
|
|
57008
57139
|
]);
|
|
57009
57140
|
const currentVariable = currentVariables.find((v) => v.key === selectedKey);
|
|
57010
|
-
const { newValue } = await
|
|
57141
|
+
const { newValue } = await inquirer7.prompt([
|
|
57011
57142
|
{
|
|
57012
57143
|
type: "input",
|
|
57013
57144
|
name: "newValue",
|
|
@@ -57036,7 +57167,7 @@ async function deleteVariable(context, currentVariables) {
|
|
|
57036
57167
|
console.log("\n\u2139\uFE0F No variables to delete.\n");
|
|
57037
57168
|
return;
|
|
57038
57169
|
}
|
|
57039
|
-
const { selectedKey } = await
|
|
57170
|
+
const { selectedKey } = await inquirer7.prompt([
|
|
57040
57171
|
{
|
|
57041
57172
|
type: "list",
|
|
57042
57173
|
name: "selectedKey",
|
|
@@ -57047,7 +57178,7 @@ async function deleteVariable(context, currentVariables) {
|
|
|
57047
57178
|
}))
|
|
57048
57179
|
}
|
|
57049
57180
|
]);
|
|
57050
|
-
const { confirm } = await
|
|
57181
|
+
const { confirm } = await inquirer7.prompt([
|
|
57051
57182
|
{
|
|
57052
57183
|
type: "confirm",
|
|
57053
57184
|
name: "confirm",
|
|
@@ -57080,7 +57211,7 @@ async function viewVariable(currentVariables) {
|
|
|
57080
57211
|
console.log("\n\u2139\uFE0F No variables to view.\n");
|
|
57081
57212
|
return;
|
|
57082
57213
|
}
|
|
57083
|
-
const { selectedKey } = await
|
|
57214
|
+
const { selectedKey } = await inquirer7.prompt([
|
|
57084
57215
|
{
|
|
57085
57216
|
type: "list",
|
|
57086
57217
|
name: "selectedKey",
|
|
@@ -57097,7 +57228,7 @@ async function viewVariable(currentVariables) {
|
|
|
57097
57228
|
console.log("=".repeat(60));
|
|
57098
57229
|
console.log(variable.value);
|
|
57099
57230
|
console.log("=".repeat(60) + "\n");
|
|
57100
|
-
await
|
|
57231
|
+
await inquirer7.prompt([
|
|
57101
57232
|
{
|
|
57102
57233
|
type: "input",
|
|
57103
57234
|
name: "continue",
|
|
@@ -57111,7 +57242,6 @@ __name(viewVariable, "viewVariable");
|
|
|
57111
57242
|
init_dist();
|
|
57112
57243
|
init_cli();
|
|
57113
57244
|
init_constants();
|
|
57114
|
-
import inquirer9 from "inquirer";
|
|
57115
57245
|
init_command_utils();
|
|
57116
57246
|
init_compiler2();
|
|
57117
57247
|
init_artifact_loader();
|
|
@@ -57413,7 +57543,7 @@ async function viewPersonaInteractive(persona) {
|
|
|
57413
57543
|
console.log("No persona configured.");
|
|
57414
57544
|
}
|
|
57415
57545
|
console.log("=".repeat(60) + "\n");
|
|
57416
|
-
await
|
|
57546
|
+
await safePrompt([
|
|
57417
57547
|
{
|
|
57418
57548
|
type: "input",
|
|
57419
57549
|
name: "continue",
|
|
@@ -57537,7 +57667,7 @@ async function viewVersionDetailsInteractive(version) {
|
|
|
57537
57667
|
console.log("=".repeat(60) + "\n");
|
|
57538
57668
|
console.log(version.persona);
|
|
57539
57669
|
console.log("\n" + "=".repeat(60) + "\n");
|
|
57540
|
-
await
|
|
57670
|
+
await safePrompt([
|
|
57541
57671
|
{
|
|
57542
57672
|
type: "input",
|
|
57543
57673
|
name: "continue",
|
|
@@ -59094,7 +59224,7 @@ async function docsCommand() {
|
|
|
59094
59224
|
__name(docsCommand, "docsCommand");
|
|
59095
59225
|
|
|
59096
59226
|
// src/commands/channels.ts
|
|
59097
|
-
import
|
|
59227
|
+
import inquirer8 from "inquirer";
|
|
59098
59228
|
import open5 from "open";
|
|
59099
59229
|
init_cli();
|
|
59100
59230
|
init_command_utils();
|
|
@@ -59607,7 +59737,7 @@ async function executeNonInteractive3(agentApi, agentId, action) {
|
|
|
59607
59737
|
}
|
|
59608
59738
|
__name(executeNonInteractive3, "executeNonInteractive");
|
|
59609
59739
|
async function channelsInteractive(agentApi, agentId, apiKey, config) {
|
|
59610
|
-
const { operation } = await
|
|
59740
|
+
const { operation } = await inquirer8.prompt([
|
|
59611
59741
|
{
|
|
59612
59742
|
type: "list",
|
|
59613
59743
|
name: "operation",
|
|
@@ -59693,7 +59823,7 @@ async function listChannelsInteractive(agentApi, agentId, config) {
|
|
|
59693
59823
|
name: "\u2190 Back to main menu",
|
|
59694
59824
|
value: -1
|
|
59695
59825
|
});
|
|
59696
|
-
const { selectedIndex } = await
|
|
59826
|
+
const { selectedIndex } = await inquirer8.prompt([
|
|
59697
59827
|
{
|
|
59698
59828
|
type: "list",
|
|
59699
59829
|
name: "selectedIndex",
|
|
@@ -59870,7 +60000,7 @@ function displayEmailDetails(channel) {
|
|
|
59870
60000
|
}
|
|
59871
60001
|
__name(displayEmailDetails, "displayEmailDetails");
|
|
59872
60002
|
async function createChannel(agentApi, agentId) {
|
|
59873
|
-
const { channelType } = await
|
|
60003
|
+
const { channelType } = await inquirer8.prompt([
|
|
59874
60004
|
{
|
|
59875
60005
|
type: "list",
|
|
59876
60006
|
name: "channelType",
|
|
@@ -59924,7 +60054,7 @@ async function createChannel(agentApi, agentId) {
|
|
|
59924
60054
|
__name(createChannel, "createChannel");
|
|
59925
60055
|
async function createWhatsAppChannel(agentApi, agentId) {
|
|
59926
60056
|
writeInfo("\u{1F4F1} Creating WhatsApp Channel\n");
|
|
59927
|
-
const answers = await
|
|
60057
|
+
const answers = await inquirer8.prompt([
|
|
59928
60058
|
{
|
|
59929
60059
|
type: "input",
|
|
59930
60060
|
name: "phoneNumberId",
|
|
@@ -59976,7 +60106,7 @@ async function createWhatsAppChannel(agentApi, agentId) {
|
|
|
59976
60106
|
__name(createWhatsAppChannel, "createWhatsAppChannel");
|
|
59977
60107
|
async function createFacebookChannel(agentApi, agentId) {
|
|
59978
60108
|
writeInfo("\u{1F4AC} Creating Facebook Messenger Channel\n");
|
|
59979
|
-
const answers = await
|
|
60109
|
+
const answers = await inquirer8.prompt([
|
|
59980
60110
|
{
|
|
59981
60111
|
type: "password",
|
|
59982
60112
|
name: "accessToken",
|
|
@@ -60018,7 +60148,7 @@ async function createFacebookChannel(agentApi, agentId) {
|
|
|
60018
60148
|
__name(createFacebookChannel, "createFacebookChannel");
|
|
60019
60149
|
async function createEmailChannel(agentApi, agentId) {
|
|
60020
60150
|
writeInfo("\u{1F4E7} Creating Email Channel\n");
|
|
60021
|
-
const { mode } = await
|
|
60151
|
+
const { mode } = await inquirer8.prompt([
|
|
60022
60152
|
{
|
|
60023
60153
|
type: "list",
|
|
60024
60154
|
name: "mode",
|
|
@@ -60036,7 +60166,7 @@ async function createEmailChannel(agentApi, agentId) {
|
|
|
60036
60166
|
}
|
|
60037
60167
|
]);
|
|
60038
60168
|
clearPromptLines(2);
|
|
60039
|
-
const { displayName } = await
|
|
60169
|
+
const { displayName } = await inquirer8.prompt([
|
|
60040
60170
|
{
|
|
60041
60171
|
type: "input",
|
|
60042
60172
|
name: "displayName",
|
|
@@ -60054,7 +60184,7 @@ async function createEmailChannel(agentApi, agentId) {
|
|
|
60054
60184
|
}
|
|
60055
60185
|
};
|
|
60056
60186
|
if (mode === "existing") {
|
|
60057
|
-
const { email } = await
|
|
60187
|
+
const { email } = await inquirer8.prompt([
|
|
60058
60188
|
{
|
|
60059
60189
|
type: "input",
|
|
60060
60190
|
name: "email",
|
|
@@ -60150,7 +60280,7 @@ var SLACK_AGENT_PROMPTS_MAX = 4;
|
|
|
60150
60280
|
var SLACK_AGENT_PROMPT_TITLE_MAX = 75;
|
|
60151
60281
|
var SLACK_AGENT_PROMPT_MESSAGE_MAX = 2e3;
|
|
60152
60282
|
async function promptSlackAgentMode(current) {
|
|
60153
|
-
const { enabled } = await
|
|
60283
|
+
const { enabled } = await inquirer8.prompt([
|
|
60154
60284
|
{
|
|
60155
60285
|
type: "confirm",
|
|
60156
60286
|
name: "enabled",
|
|
@@ -60159,7 +60289,7 @@ async function promptSlackAgentMode(current) {
|
|
|
60159
60289
|
}
|
|
60160
60290
|
]);
|
|
60161
60291
|
if (!enabled) return null;
|
|
60162
|
-
const { description } = await
|
|
60292
|
+
const { description } = await inquirer8.prompt([
|
|
60163
60293
|
{
|
|
60164
60294
|
type: "input",
|
|
60165
60295
|
name: "description",
|
|
@@ -60176,7 +60306,7 @@ async function promptSlackAgentMode(current) {
|
|
|
60176
60306
|
}
|
|
60177
60307
|
const prompts = [];
|
|
60178
60308
|
while (prompts.length < SLACK_AGENT_PROMPTS_MAX) {
|
|
60179
|
-
const { title } = await
|
|
60309
|
+
const { title } = await inquirer8.prompt([
|
|
60180
60310
|
{
|
|
60181
60311
|
type: "input",
|
|
60182
60312
|
name: "title",
|
|
@@ -60185,7 +60315,7 @@ async function promptSlackAgentMode(current) {
|
|
|
60185
60315
|
}
|
|
60186
60316
|
]);
|
|
60187
60317
|
if (!title.trim()) break;
|
|
60188
|
-
const { message } = await
|
|
60318
|
+
const { message } = await inquirer8.prompt([
|
|
60189
60319
|
{
|
|
60190
60320
|
type: "input",
|
|
60191
60321
|
name: "message",
|
|
@@ -60208,7 +60338,7 @@ async function promptSlackAgentMode(current) {
|
|
|
60208
60338
|
}
|
|
60209
60339
|
__name(promptSlackAgentMode, "promptSlackAgentMode");
|
|
60210
60340
|
async function offerToOpen(url, question) {
|
|
60211
|
-
const { openIt } = await
|
|
60341
|
+
const { openIt } = await inquirer8.prompt([
|
|
60212
60342
|
{
|
|
60213
60343
|
type: "confirm",
|
|
60214
60344
|
name: "openIt",
|
|
@@ -60220,7 +60350,7 @@ async function offerToOpen(url, question) {
|
|
|
60220
60350
|
}
|
|
60221
60351
|
__name(offerToOpen, "offerToOpen");
|
|
60222
60352
|
async function startSlackApp(agentApi, agentId, kind) {
|
|
60223
|
-
const { source } = await
|
|
60353
|
+
const { source } = await inquirer8.prompt([
|
|
60224
60354
|
{
|
|
60225
60355
|
type: "list",
|
|
60226
60356
|
name: "source",
|
|
@@ -60280,7 +60410,7 @@ __name(printManifestUpdate, "printManifestUpdate");
|
|
|
60280
60410
|
async function createSlackPrivateChannel(agentApi, agentId) {
|
|
60281
60411
|
writeInfo("\u{1F512} Creating Private Slack Channel\n");
|
|
60282
60412
|
const { existingApp, agentMode } = await startSlackApp(agentApi, agentId, "private");
|
|
60283
|
-
const answers = await
|
|
60413
|
+
const answers = await inquirer8.prompt([
|
|
60284
60414
|
{
|
|
60285
60415
|
type: "password",
|
|
60286
60416
|
name: "accessToken",
|
|
@@ -60325,7 +60455,7 @@ __name(createSlackPrivateChannel, "createSlackPrivateChannel");
|
|
|
60325
60455
|
async function createSlackPublicChannel(agentApi, agentId) {
|
|
60326
60456
|
writeInfo("\u{1F310} Creating Public Slack Channel\n");
|
|
60327
60457
|
const { existingApp, agentMode } = await startSlackApp(agentApi, agentId, "public");
|
|
60328
|
-
const answers = await
|
|
60458
|
+
const answers = await inquirer8.prompt([
|
|
60329
60459
|
{
|
|
60330
60460
|
type: "input",
|
|
60331
60461
|
name: "appId",
|
|
@@ -60409,7 +60539,7 @@ async function slackConnectionActions(agentApi, agentId, channel) {
|
|
|
60409
60539
|
name: "\u2190 Back",
|
|
60410
60540
|
value: "back"
|
|
60411
60541
|
});
|
|
60412
|
-
const { action } = await
|
|
60542
|
+
const { action } = await inquirer8.prompt([
|
|
60413
60543
|
{
|
|
60414
60544
|
type: "list",
|
|
60415
60545
|
name: "action",
|
|
@@ -60441,7 +60571,7 @@ async function slackConnectionActions(agentApi, agentId, channel) {
|
|
|
60441
60571
|
writeSuccess(`\u2705 Agent mode ${agentMode ? "saved" : "turned off"}. It takes effect once Slack has the new manifest:`);
|
|
60442
60572
|
printManifestUpdate(response.data.manifestUrl ?? slackManifestEditorUrl(channel.data.appId, channel.data.teamId), response.data.manifest);
|
|
60443
60573
|
} else if (action === "secret") {
|
|
60444
|
-
const { signingSecret } = await
|
|
60574
|
+
const { signingSecret } = await inquirer8.prompt([
|
|
60445
60575
|
slackSigningSecretPrompt()
|
|
60446
60576
|
]);
|
|
60447
60577
|
const response = await agentApi.saveSlackSigningSecret(agentId, channel.identifier, signingSecret.trim());
|
|
@@ -60478,7 +60608,7 @@ __name(slackConnectionActions, "slackConnectionActions");
|
|
|
60478
60608
|
// src/commands/logs.ts
|
|
60479
60609
|
init_cli();
|
|
60480
60610
|
init_command_utils();
|
|
60481
|
-
import
|
|
60611
|
+
import inquirer9 from "inquirer";
|
|
60482
60612
|
import chalk2 from "chalk";
|
|
60483
60613
|
init_device_api_service();
|
|
60484
60614
|
init_constants();
|
|
@@ -60978,7 +61108,7 @@ async function nonInteractiveLogs(logsApi, agentId, apiKey, options) {
|
|
|
60978
61108
|
}
|
|
60979
61109
|
__name(nonInteractiveLogs, "nonInteractiveLogs");
|
|
60980
61110
|
async function interactiveLogs(logsApi, agentId, apiKey) {
|
|
60981
|
-
const { viewType } = await
|
|
61111
|
+
const { viewType } = await inquirer9.prompt([
|
|
60982
61112
|
{
|
|
60983
61113
|
type: "list",
|
|
60984
61114
|
name: "viewType",
|
|
@@ -61006,7 +61136,7 @@ __name(interactiveLogs, "interactiveLogs");
|
|
|
61006
61136
|
async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
61007
61137
|
let keepFiltering = true;
|
|
61008
61138
|
while (keepFiltering) {
|
|
61009
|
-
const { filterType } = await
|
|
61139
|
+
const { filterType } = await inquirer9.prompt([
|
|
61010
61140
|
{
|
|
61011
61141
|
type: "list",
|
|
61012
61142
|
name: "filterType",
|
|
@@ -61016,7 +61146,7 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
61016
61146
|
name: "\u{1F4CB} All logs",
|
|
61017
61147
|
value: "all"
|
|
61018
61148
|
},
|
|
61019
|
-
new
|
|
61149
|
+
new inquirer9.Separator(),
|
|
61020
61150
|
{
|
|
61021
61151
|
name: "Skills",
|
|
61022
61152
|
value: "skill"
|
|
@@ -61041,7 +61171,7 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
61041
61171
|
name: "Devices",
|
|
61042
61172
|
value: "device"
|
|
61043
61173
|
},
|
|
61044
|
-
new
|
|
61174
|
+
new inquirer9.Separator(),
|
|
61045
61175
|
{
|
|
61046
61176
|
name: "\u{1F4AC} User Messages",
|
|
61047
61177
|
value: "user_message"
|
|
@@ -61074,12 +61204,12 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
61074
61204
|
name: "\u{1F4DE} Voice Calls",
|
|
61075
61205
|
value: "calls"
|
|
61076
61206
|
},
|
|
61077
|
-
new
|
|
61207
|
+
new inquirer9.Separator(),
|
|
61078
61208
|
{
|
|
61079
61209
|
name: "\u2190 Back",
|
|
61080
61210
|
value: "back"
|
|
61081
61211
|
},
|
|
61082
|
-
new
|
|
61212
|
+
new inquirer9.Separator()
|
|
61083
61213
|
]
|
|
61084
61214
|
}
|
|
61085
61215
|
]);
|
|
@@ -61112,7 +61242,7 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
61112
61242
|
`);
|
|
61113
61243
|
continue;
|
|
61114
61244
|
}
|
|
61115
|
-
const { selectedId } = await
|
|
61245
|
+
const { selectedId } = await inquirer9.prompt([
|
|
61116
61246
|
{
|
|
61117
61247
|
type: "list",
|
|
61118
61248
|
name: "selectedId",
|
|
@@ -61122,17 +61252,17 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
61122
61252
|
name: `All ${capitalizedType}s`,
|
|
61123
61253
|
value: "all"
|
|
61124
61254
|
},
|
|
61125
|
-
new
|
|
61255
|
+
new inquirer9.Separator(),
|
|
61126
61256
|
...items.map((item) => ({
|
|
61127
61257
|
name: item.name,
|
|
61128
61258
|
value: item.id
|
|
61129
61259
|
})),
|
|
61130
|
-
new
|
|
61260
|
+
new inquirer9.Separator(),
|
|
61131
61261
|
{
|
|
61132
61262
|
name: "\u2190 Back",
|
|
61133
61263
|
value: "back"
|
|
61134
61264
|
},
|
|
61135
|
-
new
|
|
61265
|
+
new inquirer9.Separator()
|
|
61136
61266
|
]
|
|
61137
61267
|
}
|
|
61138
61268
|
]);
|
|
@@ -61161,7 +61291,7 @@ async function viewAgentLogsInteractive(logsApi, agentId, filters = {}) {
|
|
|
61161
61291
|
}
|
|
61162
61292
|
const data = response.data;
|
|
61163
61293
|
displayLogsCore(data.logs, data.pagination, "All Agent Logs", true);
|
|
61164
|
-
const { action } = await
|
|
61294
|
+
const { action } = await inquirer9.prompt([
|
|
61165
61295
|
{
|
|
61166
61296
|
type: "list",
|
|
61167
61297
|
name: "action",
|
|
@@ -61216,7 +61346,7 @@ async function handleNavigation(action, pagination, setPage) {
|
|
|
61216
61346
|
if (pagination.hasNextPage) setPage(pagination.nextPage);
|
|
61217
61347
|
return true;
|
|
61218
61348
|
case "goto":
|
|
61219
|
-
const { page } = await
|
|
61349
|
+
const { page } = await inquirer9.prompt({
|
|
61220
61350
|
type: "number",
|
|
61221
61351
|
name: "page",
|
|
61222
61352
|
message: `Enter page number (1-${pagination.totalPages}):`,
|
|
@@ -68846,6 +68976,21 @@ function priorAttemptTail(a) {
|
|
|
68846
68976
|
return `${parts.length ? ` \u2014 ${parts.join(" \xB7 ")}` : ""}${e?.providerMessage ? ` \u2014 ${e.providerMessage}` : ""}`;
|
|
68847
68977
|
}
|
|
68848
68978
|
__name(priorAttemptTail, "priorAttemptTail");
|
|
68979
|
+
function budgetTokensParts(b) {
|
|
68980
|
+
const n2 = /* @__PURE__ */ __name((v) => v.toLocaleString("en-US"), "n");
|
|
68981
|
+
const split = [
|
|
68982
|
+
typeof b.uncachedInputTokens === "number" ? `${n2(b.uncachedInputTokens)} uncached` : void 0,
|
|
68983
|
+
typeof b.cachedInputTokens === "number" ? `${n2(b.cachedInputTokens)} cached` : void 0
|
|
68984
|
+
].filter((p) => !!p);
|
|
68985
|
+
const input = `${n2(b.inputTokens)}${b.maxInputTokens !== void 0 ? ` of ${n2(b.maxInputTokens)}` : ""} input tokens${split.length ? ` (${split.join(" / ")})` : ""}`;
|
|
68986
|
+
return typeof b.outputTokens === "number" ? [
|
|
68987
|
+
input,
|
|
68988
|
+
`${n2(b.outputTokens)} output tokens`
|
|
68989
|
+
] : [
|
|
68990
|
+
input
|
|
68991
|
+
];
|
|
68992
|
+
}
|
|
68993
|
+
__name(budgetTokensParts, "budgetTokensParts");
|
|
68849
68994
|
function stepFailureLine(e) {
|
|
68850
68995
|
if (!e || !e.reason && e.providerStatus === void 0 && !e.providerMessage) return void 0;
|
|
68851
68996
|
const b = e.budget;
|
|
@@ -68854,7 +68999,7 @@ function stepFailureLine(e) {
|
|
|
68854
68999
|
e.providerStatus !== void 0 ? `HTTP ${e.providerStatus}` : void 0,
|
|
68855
69000
|
e.model ? `model ${e.model}` : void 0,
|
|
68856
69001
|
e.turnIndex !== void 0 ? `message ${e.turnIndex}${e.assistantTurns !== void 0 ? ` (${e.assistantTurns} replies)` : ""}${b?.maxMessages !== void 0 ? ` of ${b.maxMessages}` : ""}` : void 0,
|
|
68857
|
-
b ?
|
|
69002
|
+
...b ? budgetTokensParts(b) : [],
|
|
68858
69003
|
e.providerRetries ? `${e.providerRetries} provider ${e.providerRetries === 1 ? "retry" : "retries"}` : void 0
|
|
68859
69004
|
].filter((p) => !!p);
|
|
68860
69005
|
return `${parts.join(" \xB7 ")}${e.providerMessage ? `${parts.length ? " \u2014 " : ""}${e.providerMessage}` : ""}`;
|
|
@@ -68867,7 +69012,7 @@ function attemptCountersLine(c) {
|
|
|
68867
69012
|
const replies = c.assistantTurns ?? b?.assistantTurns;
|
|
68868
69013
|
const parts = [
|
|
68869
69014
|
messages !== void 0 ? `message ${messages}${replies !== void 0 ? ` (${replies} replies)` : ""}${b?.maxMessages !== void 0 ? ` of ${b.maxMessages}` : ""}` : void 0,
|
|
68870
|
-
b ?
|
|
69015
|
+
...b ? budgetTokensParts(b) : [],
|
|
68871
69016
|
c.repairRounds ? `${c.repairRounds} repair ${c.repairRounds === 1 ? "round" : "rounds"}` : void 0,
|
|
68872
69017
|
c.providerRetries ? `${c.providerRetries} provider ${c.providerRetries === 1 ? "retry" : "retries"}` : void 0
|
|
68873
69018
|
].filter((p) => !!p);
|
|
@@ -71810,12 +71955,13 @@ async function recomposeCore(ctx, name, _o) {
|
|
|
71810
71955
|
return WORKFLOW_EXIT.OK;
|
|
71811
71956
|
}
|
|
71812
71957
|
const saved = d.composed?.saved;
|
|
71813
|
-
const
|
|
71958
|
+
const savedVersion = saved?.version ?? saved?.versionId;
|
|
71959
|
+
const version = savedVersion ?? "(new)";
|
|
71814
71960
|
writeSuccess(`\u2705 ${wf.name} recomposed \u2192 version ${version} \xB7 ${rewrittenCount} agent step${rewrittenCount === 1 ? "" : "s"} rewritten`);
|
|
71815
71961
|
if (saved?.supersededBy) {
|
|
71816
71962
|
writeInfo(`\u2139\uFE0F a concurrent recompose already holds the pin at version ${saved.supersededBy} \u2014 that is what runs.`);
|
|
71817
71963
|
}
|
|
71818
|
-
for (const line of recomposeNextSteps(wf,
|
|
71964
|
+
for (const line of recomposeNextSteps(wf, savedVersion)) console.log(line);
|
|
71819
71965
|
return WORKFLOW_EXIT.OK;
|
|
71820
71966
|
}
|
|
71821
71967
|
__name(recomposeCore, "recomposeCore");
|
|
@@ -73623,7 +73769,7 @@ init_skills_api_service();
|
|
|
73623
73769
|
init_developer_api_service();
|
|
73624
73770
|
init_semver();
|
|
73625
73771
|
init_analytics();
|
|
73626
|
-
import
|
|
73772
|
+
import inquirer10 from "inquirer";
|
|
73627
73773
|
|
|
73628
73774
|
// src/commands/template.ts
|
|
73629
73775
|
init_cli();
|
|
@@ -73751,6 +73897,54 @@ init_command_utils();
|
|
|
73751
73897
|
init_analytics();
|
|
73752
73898
|
init_files();
|
|
73753
73899
|
init_cli_error();
|
|
73900
|
+
|
|
73901
|
+
// src/commands/template-install-flags.ts
|
|
73902
|
+
init_cli_error();
|
|
73903
|
+
var PERSONA_HINT = "Use --persona-vars NAME=value[,NAME=value...] (repeatable)";
|
|
73904
|
+
var ACCEPT_HINT = "e.g. skills/refund-skill (the primitives named in the 409 MODIFIED_SINCE_INSTALL response)";
|
|
73905
|
+
function parsePersonaVars(raw) {
|
|
73906
|
+
if (!raw || raw.length === 0) return void 0;
|
|
73907
|
+
const result = {};
|
|
73908
|
+
for (const entry of raw) {
|
|
73909
|
+
for (const pair of entry.split(/,(?=\s*[A-Za-z_][A-Za-z0-9_]*\s*=)/)) {
|
|
73910
|
+
const trimmed2 = pair.trim();
|
|
73911
|
+
if (!trimmed2) continue;
|
|
73912
|
+
const eqIdx = trimmed2.indexOf("=");
|
|
73913
|
+
if (eqIdx === -1) {
|
|
73914
|
+
throw CliError.usage(`Invalid --persona-vars entry "${trimmed2}": expected KEY=value`, PERSONA_HINT);
|
|
73915
|
+
}
|
|
73916
|
+
const key = trimmed2.slice(0, eqIdx).trim();
|
|
73917
|
+
if (!key) {
|
|
73918
|
+
throw CliError.usage(`Invalid --persona-vars entry "${trimmed2}": the variable name is empty`, PERSONA_HINT);
|
|
73919
|
+
}
|
|
73920
|
+
if (Object.prototype.hasOwnProperty.call(result, key)) {
|
|
73921
|
+
throw CliError.usage(`Duplicate --persona-vars key "${key}"`, PERSONA_HINT);
|
|
73922
|
+
}
|
|
73923
|
+
result[key] = trimmed2.slice(eqIdx + 1).trim();
|
|
73924
|
+
}
|
|
73925
|
+
}
|
|
73926
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
73927
|
+
}
|
|
73928
|
+
__name(parsePersonaVars, "parsePersonaVars");
|
|
73929
|
+
function parseAcceptModified(raw) {
|
|
73930
|
+
if (!raw || raw.length === 0) return void 0;
|
|
73931
|
+
const result = [];
|
|
73932
|
+
for (const entry of raw) {
|
|
73933
|
+
for (const part of entry.split(",")) {
|
|
73934
|
+
const trimmed2 = part.trim();
|
|
73935
|
+
if (!trimmed2) continue;
|
|
73936
|
+
const slash = trimmed2.indexOf("/");
|
|
73937
|
+
if (slash <= 0 || slash === trimmed2.length - 1) {
|
|
73938
|
+
throw CliError.usage(`Invalid --accept-modified entry "${trimmed2}": expected kind/key`, ACCEPT_HINT);
|
|
73939
|
+
}
|
|
73940
|
+
if (!result.includes(trimmed2)) result.push(trimmed2);
|
|
73941
|
+
}
|
|
73942
|
+
}
|
|
73943
|
+
return result.length > 0 ? result : void 0;
|
|
73944
|
+
}
|
|
73945
|
+
__name(parseAcceptModified, "parseAcceptModified");
|
|
73946
|
+
|
|
73947
|
+
// src/commands/template.ts
|
|
73754
73948
|
function showTemplateUsage() {
|
|
73755
73949
|
console.log("\nUsage:");
|
|
73756
73950
|
console.log(" lua marketplace template Interactive mode");
|
|
@@ -73761,7 +73955,7 @@ function showTemplateUsage() {
|
|
|
73761
73955
|
console.log(" publish --template-id <id> [--source-version <n>] [--changelog <text>] [--env-contract KEY=desc,...] [--skip-auto-apply]");
|
|
73762
73956
|
console.log(" view --template-id <id> [--version <n>] [--json]");
|
|
73763
73957
|
console.log(" versions --template-id <id> [--json]");
|
|
73764
|
-
console.log(" install --template-id <id> [--version <n>] [--env-vars k=v,...] --force");
|
|
73958
|
+
console.log(" install --template-id <id> [--version <n>] [--env-vars k=v,...] [--persona-vars K=v,...] [--accept-modified kind/key,...] --force");
|
|
73765
73959
|
console.log(" apply --template-id <id> [--version <n>] (--agents a,b | --file <path> | --all-installed) --force [--no-wait]");
|
|
73766
73960
|
console.log(" status --template-id <id> [--json]");
|
|
73767
73961
|
console.log(" health --template-id <id> [--window-days <n>] [--json] Fleet workflow health per install (R46)");
|
|
@@ -74377,6 +74571,8 @@ async function templateInstallAction(templateApi, config, options) {
|
|
|
74377
74571
|
const templateId = await resolveTemplateId(templateApi, options, "Which template would you like to install?", false);
|
|
74378
74572
|
const version = options.version ? Number.parseInt(options.version, 10) : void 0;
|
|
74379
74573
|
const envValues = options.envVars ? parseKeyValuePairs(options.envVars) : void 0;
|
|
74574
|
+
const personaVars = parsePersonaVars(options.personaVars);
|
|
74575
|
+
const acceptModifiedPrimitives = parseAcceptModified(options.acceptModified);
|
|
74380
74576
|
if (!options.force) {
|
|
74381
74577
|
writeInfo("\n\u{1F4CB} Install Summary:");
|
|
74382
74578
|
writeInfo(` Template: ${templateId}`);
|
|
@@ -74385,6 +74581,12 @@ async function templateInstallAction(templateApi, config, options) {
|
|
|
74385
74581
|
if (envValues && Object.keys(envValues).length > 0) {
|
|
74386
74582
|
writeInfo(` Env values: ${Object.keys(envValues).length} configured`);
|
|
74387
74583
|
}
|
|
74584
|
+
if (personaVars) {
|
|
74585
|
+
writeInfo(` Persona vars: ${Object.keys(personaVars).length} configured`);
|
|
74586
|
+
}
|
|
74587
|
+
if (acceptModifiedPrimitives) {
|
|
74588
|
+
writeInfo(` Accepting modified: ${acceptModifiedPrimitives.join(", ")}`);
|
|
74589
|
+
}
|
|
74388
74590
|
throw CliError.usage("This action requires --force to confirm", "Use --force to confirm installation");
|
|
74389
74591
|
}
|
|
74390
74592
|
if (options.skipEnvCheck) {
|
|
@@ -74394,7 +74596,9 @@ async function templateInstallAction(templateApi, config, options) {
|
|
|
74394
74596
|
const install = await templateApi.install(templateId, agentId, {
|
|
74395
74597
|
version,
|
|
74396
74598
|
envValues,
|
|
74397
|
-
allowCreatorUpdates: options.allowCreatorUpdates
|
|
74599
|
+
allowCreatorUpdates: options.allowCreatorUpdates,
|
|
74600
|
+
personaVars,
|
|
74601
|
+
acceptModifiedPrimitives
|
|
74398
74602
|
});
|
|
74399
74603
|
if (options.json) {
|
|
74400
74604
|
console.log(JSON.stringify(install, null, 2));
|
|
@@ -75076,12 +75280,12 @@ __name(transferOwnershipNonInteractive, "transferOwnershipNonInteractive");
|
|
|
75076
75280
|
async function viewListedSkillsNonInteractive(marketplaceApi, options, mode) {
|
|
75077
75281
|
writeProgress(mode === "authored" ? "\u{1F504} Loading skills you authored..." : "\u{1F504} Loading this organization's skills...");
|
|
75078
75282
|
const skills = mode === "authored" ? await marketplaceApi.getCreatorSkills() : await marketplaceApi.getOrgSkills();
|
|
75079
|
-
if (
|
|
75080
|
-
|
|
75283
|
+
if (options.json) {
|
|
75284
|
+
console.log(JSON.stringify(skills ?? [], null, 2));
|
|
75081
75285
|
return;
|
|
75082
75286
|
}
|
|
75083
|
-
if (
|
|
75084
|
-
|
|
75287
|
+
if (!skills || skills.length === 0) {
|
|
75288
|
+
writeInfo(mode === "authored" ? "\u{1F4E6} You haven't authored any marketplace skills yet." : "\u{1F4E6} This organization doesn't own any marketplace skills yet.");
|
|
75085
75289
|
return;
|
|
75086
75290
|
}
|
|
75087
75291
|
console.log(mode === "authored" ? `
|
|
@@ -75310,12 +75514,12 @@ async function listInstalledSkillsNonInteractive(marketplaceApi, config, options
|
|
|
75310
75514
|
}
|
|
75311
75515
|
writeProgress("\u{1F504} Loading installed marketplace skills...");
|
|
75312
75516
|
const skills = await marketplaceApi.getInstalledSkills(agentId);
|
|
75313
|
-
if (
|
|
75314
|
-
|
|
75517
|
+
if (options.json) {
|
|
75518
|
+
console.log(JSON.stringify(skills ?? [], null, 2));
|
|
75315
75519
|
return;
|
|
75316
75520
|
}
|
|
75317
|
-
if (
|
|
75318
|
-
|
|
75521
|
+
if (!skills || skills.length === 0) {
|
|
75522
|
+
writeInfo("\u{1F4E6} No marketplace skills installed on this agent.");
|
|
75319
75523
|
return;
|
|
75320
75524
|
}
|
|
75321
75525
|
console.log(`
|
|
@@ -75918,7 +76122,7 @@ async function handleEnvVarConfiguration(initialEnvVars) {
|
|
|
75918
76122
|
name: "Delete a variable",
|
|
75919
76123
|
value: "delete"
|
|
75920
76124
|
},
|
|
75921
|
-
new
|
|
76125
|
+
new inquirer10.Separator(),
|
|
75922
76126
|
{
|
|
75923
76127
|
name: "Finish and continue",
|
|
75924
76128
|
value: "done"
|
|
@@ -75955,7 +76159,7 @@ async function handleEnvVarAction(action, envVars, detectedKeys) {
|
|
|
75955
76159
|
name: `From .env file: ${key}`,
|
|
75956
76160
|
value: key
|
|
75957
76161
|
})),
|
|
75958
|
-
new
|
|
76162
|
+
new inquirer10.Separator(),
|
|
75959
76163
|
{
|
|
75960
76164
|
name: "Manually enter a variable name",
|
|
75961
76165
|
value: "manual"
|
|
@@ -76000,7 +76204,7 @@ async function handleEnvVarAction(action, envVars, detectedKeys) {
|
|
|
76000
76204
|
message: "Which variable do you want to edit?",
|
|
76001
76205
|
choices: [
|
|
76002
76206
|
...keys,
|
|
76003
|
-
new
|
|
76207
|
+
new inquirer10.Separator(),
|
|
76004
76208
|
{
|
|
76005
76209
|
name: "Back",
|
|
76006
76210
|
value: "back"
|
|
@@ -76022,7 +76226,7 @@ async function handleEnvVarAction(action, envVars, detectedKeys) {
|
|
|
76022
76226
|
message: "Which variable do you want to delete?",
|
|
76023
76227
|
choices: [
|
|
76024
76228
|
...keys,
|
|
76025
|
-
new
|
|
76229
|
+
new inquirer10.Separator(),
|
|
76026
76230
|
{
|
|
76027
76231
|
name: "Back",
|
|
76028
76232
|
value: "back"
|
|
@@ -76125,7 +76329,7 @@ async function browseAndSelectSkill(marketplaceApi, purpose, publishedVersionsOn
|
|
|
76125
76329
|
}))
|
|
76126
76330
|
];
|
|
76127
76331
|
if (hasNextPage || hasPrevPage) {
|
|
76128
|
-
choices.push(new
|
|
76332
|
+
choices.push(new inquirer10.Separator());
|
|
76129
76333
|
if (hasPrevPage) {
|
|
76130
76334
|
choices.push({
|
|
76131
76335
|
name: `\u2190 Previous page (${currentPage - 1}/${totalPages})`,
|
|
@@ -76143,7 +76347,7 @@ async function browseAndSelectSkill(marketplaceApi, purpose, publishedVersionsOn
|
|
|
76143
76347
|
});
|
|
76144
76348
|
}
|
|
76145
76349
|
}
|
|
76146
|
-
choices.push(new
|
|
76350
|
+
choices.push(new inquirer10.Separator());
|
|
76147
76351
|
choices.push({
|
|
76148
76352
|
name: "\u2190 Back to menu",
|
|
76149
76353
|
value: {
|
|
@@ -77493,6 +77697,11 @@ var CALLBACK_PORT = 19837;
|
|
|
77493
77697
|
var CALLBACK_HOST = "127.0.0.1";
|
|
77494
77698
|
var CALLBACK_URL = `http://${CALLBACK_HOST}:${CALLBACK_PORT}/callback`;
|
|
77495
77699
|
var AGENT_WEBHOOK_URL = `${BASE_URLS.API}/webhook/unifiedto/data`;
|
|
77700
|
+
var DEFAULT_HIDE_SENSITIVE = false;
|
|
77701
|
+
function coerceHideSensitive(raw) {
|
|
77702
|
+
return raw === "true";
|
|
77703
|
+
}
|
|
77704
|
+
__name(coerceHideSensitive, "coerceHideSensitive");
|
|
77496
77705
|
var DEFAULT_VIRTUAL_WEBHOOK_INTERVAL = 1;
|
|
77497
77706
|
var VIRTUAL_WEBHOOK_INTERVAL_CHOICES = [
|
|
77498
77707
|
{
|
|
@@ -77719,7 +77928,7 @@ async function executeNonInteractive12(context, action, cmdOptions) {
|
|
|
77719
77928
|
connectionId: cmdOptions?.connectionId,
|
|
77720
77929
|
authMethod: cmdOptions?.authMethod,
|
|
77721
77930
|
scopes: cmdOptions?.scopes,
|
|
77722
|
-
hideSensitive: cmdOptions?.hideSensitive
|
|
77931
|
+
hideSensitive: coerceHideSensitive(cmdOptions?.hideSensitive),
|
|
77723
77932
|
hideSensitiveProvided: cmdOptions?.hideSensitive !== void 0,
|
|
77724
77933
|
accountLabel: cmdOptions?.accountLabel,
|
|
77725
77934
|
scope: cmdOptions?.scope,
|
|
@@ -78325,7 +78534,7 @@ async function connectIntegrationFlow(context, options = {}) {
|
|
|
78325
78534
|
});
|
|
78326
78535
|
console.log("\nYou will enter these on the Unified.to authorization page.\n");
|
|
78327
78536
|
}
|
|
78328
|
-
let hideSensitive =
|
|
78537
|
+
let hideSensitive = DEFAULT_HIDE_SENSITIVE;
|
|
78329
78538
|
if (userScope) {
|
|
78330
78539
|
} else if (options.hideSensitive !== void 0) {
|
|
78331
78540
|
hideSensitive = options.hideSensitive;
|
|
@@ -78335,7 +78544,7 @@ async function connectIntegrationFlow(context, options = {}) {
|
|
|
78335
78544
|
type: "confirm",
|
|
78336
78545
|
name: "hide",
|
|
78337
78546
|
message: "Hide sensitive data (PII) from MCP tools?",
|
|
78338
|
-
default:
|
|
78547
|
+
default: DEFAULT_HIDE_SENSITIVE
|
|
78339
78548
|
}
|
|
78340
78549
|
]);
|
|
78341
78550
|
if (sensitiveAnswer) {
|
|
@@ -78550,7 +78759,7 @@ Integration: ${selectedIntegration.name}`);
|
|
|
78550
78759
|
}
|
|
78551
78760
|
}
|
|
78552
78761
|
__name(connectIntegrationFlow, "connectIntegrationFlow");
|
|
78553
|
-
async function finalizeConnection(context, integration, connectionId, scopes, hideSensitive =
|
|
78762
|
+
async function finalizeConnection(context, integration, connectionId, scopes, hideSensitive = DEFAULT_HIDE_SENSITIVE, webhookConfig = {
|
|
78554
78763
|
triggers: [],
|
|
78555
78764
|
webhookUrl: "",
|
|
78556
78765
|
isCustomWebhook: false
|
|
@@ -79134,7 +79343,7 @@ async function updateConnectionFlow(context, options = {}) {
|
|
|
79134
79343
|
console.log(`
|
|
79135
79344
|
\u2713 Will request ${selectedScopes.length} scope(s)`);
|
|
79136
79345
|
}
|
|
79137
|
-
let hideSensitive =
|
|
79346
|
+
let hideSensitive = DEFAULT_HIDE_SENSITIVE;
|
|
79138
79347
|
if (options.hideSensitive !== void 0) {
|
|
79139
79348
|
hideSensitive = options.hideSensitive;
|
|
79140
79349
|
} else {
|
|
@@ -79143,7 +79352,7 @@ async function updateConnectionFlow(context, options = {}) {
|
|
|
79143
79352
|
type: "confirm",
|
|
79144
79353
|
name: "hide",
|
|
79145
79354
|
message: "Hide sensitive data (PII) from MCP tools?",
|
|
79146
|
-
default:
|
|
79355
|
+
default: DEFAULT_HIDE_SENSITIVE
|
|
79147
79356
|
}
|
|
79148
79357
|
]);
|
|
79149
79358
|
if (sensitiveAnswer) {
|
|
@@ -82126,7 +82335,7 @@ init_command_utils();
|
|
|
82126
82335
|
init_files();
|
|
82127
82336
|
init_cli();
|
|
82128
82337
|
init_constants();
|
|
82129
|
-
import
|
|
82338
|
+
import inquirer11 from "inquirer";
|
|
82130
82339
|
init_lua_fetch();
|
|
82131
82340
|
init_request_credential();
|
|
82132
82341
|
async function sourceListCommand(opts) {
|
|
@@ -82172,7 +82381,7 @@ async function sourceRollbackCommand(opts) {
|
|
|
82172
82381
|
const dlBlobs = opts.downloadBlobs ?? downloadBlobsParallel;
|
|
82173
82382
|
const restore = opts.restoreFiles ?? defaultRestore;
|
|
82174
82383
|
if (!opts.force) {
|
|
82175
|
-
const { confirm } = await
|
|
82384
|
+
const { confirm } = await inquirer11.prompt([
|
|
82176
82385
|
{
|
|
82177
82386
|
type: "confirm",
|
|
82178
82387
|
name: "confirm",
|
|
@@ -83681,7 +83890,13 @@ function setupMarketplaceCommands(program2) {
|
|
|
83681
83890
|
program2.command("marketplace [noun] [action]").description("\u{1F6CD}\uFE0F Browse, install, and manage marketplace skills and agent templates").option("--skill-name <name>", "Skill name (for skill list/update/uninstall)").option("--marketplace-id <id>", "Marketplace skill ID").option("--new-org-id <id>", "Destination organization ID (for skill transfer)").option("--version-id <id>", "Version ID (for skill publish/install)").option("--env-vars-json <json>", "JSON string with env var metadata (for skill publish)").option("--query <text>", "Search query (for skill search)").option("--page <n>", "Page number (for skill search)").option("--limit <n>", "Results per page (for skill search)").option("--name <name>", "Template name, an internal identifier (for template create)").option("--description <text>", "Description (for template create)").option("--template-id <id>", "Template ID").option("--window-days <n>", "Fleet-health window in days (template health, R46)").option("--source-version <n>", "Agent version to freeze into this template version (default: active) (for template publish)").option("--env-contract <pair>", "KEY=description env contract entry, repeatable; use KEY?=description for optional (for template publish)", (val, previous) => [
|
|
83682
83891
|
...previous,
|
|
83683
83892
|
val
|
|
83684
|
-
], []).option("--skip-auto-apply", "Publish without auto-updating the installs that consented to creator updates (for template publish)").option("--version <n>", "Template version (for template view/install/apply)").option("--allow-creator-updates", "Allow the template creator to push future updates onto this install").option("--
|
|
83893
|
+
], []).option("--skip-auto-apply", "Publish without auto-updating the installs that consented to creator updates (for template publish)").option("--version <n>", "Template version (for template view/install/apply)").option("--allow-creator-updates", "Allow the template creator to push future updates onto this install").option("--persona-vars <pairs>", "Comma-separated KEY=value answers for the template's persona {{vars}}; repeatable, put a value containing ',KEY=' in its own occurrence (for template install)", (val, previous) => [
|
|
83894
|
+
...previous ?? [],
|
|
83895
|
+
val
|
|
83896
|
+
]).option("--accept-modified <entries>", "Comma-separated kind/key primitives you allow the install to overwrite after a 409 MODIFIED_SINCE_INSTALL; repeatable (for template install)", (val, previous) => [
|
|
83897
|
+
...previous ?? [],
|
|
83898
|
+
val
|
|
83899
|
+
]).option("--skip-env-check", "Deprecated no-op: the env-contract check is server-enforced; use `lua env` to satisfy the contract (for template install/apply)").option("--agents <ids>", "Comma-separated target agent IDs (for template apply)").option("--file <path>", "Path to a file with one target agent ID per line (for template apply)").option("--all-installed", "Target every agent that already has this template installed (for template apply)").option("--no-wait", "Print the apply runId immediately instead of polling for completion (for template apply)").option("--display-name <name>", "Display name (for skill list/edit, template create)").option("--visibility <visibility>", "Who can see and install it: public or private (for skill list, template create)").option("--changelog <text>", "Changelog for this version (for skill/template publish)").option("--env-vars <pairs>", "Comma-separated key=value pairs (for skill/template install/update)").option("--json", "Output as JSON").option("--force", "Skip confirmation prompts").option("--yes", "Auto-confirm ONLY the template-publish consequence prompt (section clear/narrow); unlike --force it skips no other confirmation").addHelpText("after", `
|
|
83685
83900
|
Arguments:
|
|
83686
83901
|
noun Optional: 'skill' or 'template' (prompts if not provided)
|
|
83687
83902
|
action Optional: specific action for non-interactive mode
|
|
@@ -83707,7 +83922,7 @@ Template Actions:
|
|
|
83707
83922
|
publish --template-id <id> [--source-version <n>] [--changelog <text>] [--env-contract KEY=desc,...]
|
|
83708
83923
|
view --template-id <id> [--version <n>] [--json]
|
|
83709
83924
|
versions --template-id <id> [--json]
|
|
83710
|
-
install --template-id <id> [--version <n>] [--env-vars <k=v,...>] --force
|
|
83925
|
+
install --template-id <id> [--version <n>] [--env-vars <k=v,...>] [--persona-vars <K=v,...>] [--accept-modified <kind/key,...>] --force
|
|
83711
83926
|
apply --template-id <id> [--version <n>] (--agents <a,b,c> | --file <path> | --all-installed) --force [--no-wait]
|
|
83712
83927
|
status --template-id <id> [--json]
|
|
83713
83928
|
installed [--json]
|
|
@@ -83729,6 +83944,7 @@ Examples:
|
|
|
83729
83944
|
$ lua marketplace template Template action menu
|
|
83730
83945
|
$ lua marketplace template create --name support-bot --display-name "Support Bot"
|
|
83731
83946
|
$ lua marketplace template publish --template-id xyz --changelog "Add refund skill"
|
|
83947
|
+
$ lua marketplace template install --template-id xyz --persona-vars COMPANY_NAME=Acme,TONE=warm --force
|
|
83732
83948
|
$ lua marketplace template apply --template-id xyz --all-installed --force
|
|
83733
83949
|
`).action(marketplaceCommand);
|
|
83734
83950
|
}
|
|
@@ -84303,7 +84519,7 @@ Examples:
|
|
|
84303
84519
|
$ lua mcp deactivate --server-name api-server Deactivate a server
|
|
84304
84520
|
$ lua mcp delete --server-name old-server Delete a server
|
|
84305
84521
|
`).action(mcpCommand);
|
|
84306
|
-
program2.command("integrations [action] [subaction]").description("\u{1F517} Connect third-party integrations via Unified.to").option("--integration <type>", "Integration type (e.g., linear, googlecalendar)").option("--auth-method <method>", "Authentication method: 'oauth' or 'token'").option("--scopes <scopes>", "Comma-separated OAuth scopes (or 'all' for all scopes)").option("--hide-sensitive <bool>", "Hide sensitive data from MCP tools (default: true)").option("--account-label <label>", "Account label used to distinguish multiple connected accounts").option("--scope <scope>", "Who owns the connection: 'agent' (default) or 'user'").option("--force", "Skip the confirmation prompt (for convert)").option("--forget", "Also forget what a personal connection (--scope user) added to memory on disconnect (default: false, memories kept)").option("--connection-id <id>", "Exact connection ID to update, disconnect, convert or pause/resume").option("--connection <id>", "Connection ID for trigger").option("--webhook-id <id>", "Trigger ID to delete/pause/resume").option("--object <type>", "Object type for webhook (e.g., task_task, calendar_event)").option("--event <type>", "Event type for webhook: created, updated, or deleted").option("--hook-url <url>", "Custom webhook URL (default: agent trigger)").option("--interval <minutes>", "Polling interval in minutes for virtual webhooks, 1-2880 (default 1; e.g. 1, 5, 15, 60, 1440, 2880)").option("--triggers <events>", "Comma-separated triggers (e.g., task_task.created,task_task.updated)").option("--custom-webhook", "Use custom webhook URL instead of agent trigger").option("--json", "Output as JSON (for list, info, requests and webhooks list/events commands)").option("--reason <text>", "Optional reason for pausing a trigger").addHelpText("after", `
|
|
84522
|
+
program2.command("integrations [action] [subaction]").description("\u{1F517} Connect third-party integrations via Unified.to").option("--integration <type>", "Integration type (e.g., linear, googlecalendar)").option("--auth-method <method>", "Authentication method: 'oauth' or 'token'").option("--scopes <scopes>", "Comma-separated OAuth scopes (or 'all' for all scopes)").option("--hide-sensitive <bool>", "Hide sensitive data from MCP tools (default: false; pass 'true' to hide)").option("--account-label <label>", "Account label used to distinguish multiple connected accounts").option("--scope <scope>", "Who owns the connection: 'agent' (default) or 'user'").option("--force", "Skip the confirmation prompt (for convert)").option("--forget", "Also forget what a personal connection (--scope user) added to memory on disconnect (default: false, memories kept)").option("--connection-id <id>", "Exact connection ID to update, disconnect, convert or pause/resume").option("--connection <id>", "Connection ID for trigger").option("--webhook-id <id>", "Trigger ID to delete/pause/resume").option("--object <type>", "Object type for webhook (e.g., task_task, calendar_event)").option("--event <type>", "Event type for webhook: created, updated, or deleted").option("--hook-url <url>", "Custom webhook URL (default: agent trigger)").option("--interval <minutes>", "Polling interval in minutes for virtual webhooks, 1-2880 (default 1; e.g. 1, 5, 15, 60, 1440, 2880)").option("--triggers <events>", "Comma-separated triggers (e.g., task_task.created,task_task.updated)").option("--custom-webhook", "Use custom webhook URL instead of agent trigger").option("--json", "Output as JSON (for list, info, requests and webhooks list/events commands)").option("--reason <text>", "Optional reason for pausing a trigger").addHelpText("after", `
|
|
84307
84523
|
Arguments:
|
|
84308
84524
|
action Optional: 'connect', 'update', 'list', 'available', 'info', 'disconnect',
|
|
84309
84525
|
'convert', 'webhooks' (alias: 'triggers'), or 'mcp'
|
|
@@ -84318,7 +84534,7 @@ Options:
|
|
|
84318
84534
|
create later. Publishing an agent removes its access.
|
|
84319
84535
|
--auth-method <method> Authentication method: 'oauth' or 'token'
|
|
84320
84536
|
--scopes <scopes> Comma-separated OAuth scopes, or 'all' for all available scopes
|
|
84321
|
-
--hide-sensitive <bool> Hide sensitive data from MCP tools (default:
|
|
84537
|
+
--hide-sensitive <bool> Hide sensitive data from MCP tools (default: false, use 'true' to hide)
|
|
84322
84538
|
--triggers <events> Comma-separated triggers to enable (e.g., task_task.created,task_task.updated)
|
|
84323
84539
|
--custom-webhook Use custom webhook URL instead of agent trigger
|
|
84324
84540
|
--hook-url <url> Custom webhook URL (use with --custom-webhook)
|
|
@@ -84711,6 +84927,7 @@ program.hook("preAction", (thisCommand) => {
|
|
|
84711
84927
|
setCiMode(true);
|
|
84712
84928
|
}
|
|
84713
84929
|
});
|
|
84930
|
+
registerJsonErrorEnvelope(program);
|
|
84714
84931
|
setupAuthCommands(program);
|
|
84715
84932
|
setupSkillCommands(program);
|
|
84716
84933
|
setupMarketplaceCommands(program);
|