@elnora-ai/cli 2.0.5 → 2.1.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/README.md +16 -4
- package/dist/cli.js +974 -549
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -21,14 +21,16 @@ function buildUrl(endpointKey, params, baseUrl) {
|
|
|
21
21
|
}
|
|
22
22
|
return `${baseUrl ?? BASE_URL}${resolved}`;
|
|
23
23
|
}
|
|
24
|
-
var VERSION, PRODUCTION_BASE_URL, BASE_URL, AI_SERVER_URL, ENDPOINTS, DEFAULT_HEADERS;
|
|
24
|
+
var VERSION, PRODUCTION_BASE_URL, BASE_URL, AI_SERVER_URL, PRODUCTION_MCP_URL, MCP_URL, ENDPOINTS, DEFAULT_HEADERS;
|
|
25
25
|
var init_config = __esm({
|
|
26
26
|
"src/lib/config.ts"() {
|
|
27
27
|
"use strict";
|
|
28
|
-
VERSION = true ? "2.0
|
|
28
|
+
VERSION = true ? "2.1.0" : process.env.npm_package_version ?? "0.0.0-dev";
|
|
29
29
|
PRODUCTION_BASE_URL = "https://platform.elnora.ai/api/v1";
|
|
30
30
|
BASE_URL = process.env.ELNORA_API_URL ?? PRODUCTION_BASE_URL;
|
|
31
31
|
AI_SERVER_URL = process.env.ELNORA_AI_SERVER_URL ?? "https://platform.elnora.ai/ai-server";
|
|
32
|
+
PRODUCTION_MCP_URL = "https://mcp.elnora.ai/mcp";
|
|
33
|
+
MCP_URL = process.env.ELNORA_MCP_URL ?? PRODUCTION_MCP_URL;
|
|
32
34
|
ENDPOINTS = {
|
|
33
35
|
// Projects
|
|
34
36
|
projects: "/projects",
|
|
@@ -124,6 +126,7 @@ var init_config = __esm({
|
|
|
124
126
|
});
|
|
125
127
|
|
|
126
128
|
// src/lib/errors.ts
|
|
129
|
+
import { z } from "zod";
|
|
127
130
|
function scrub(text) {
|
|
128
131
|
let result = text;
|
|
129
132
|
const envKeys = ["ELNORA_API_KEY", "ELNORA_MCP_API_KEY"];
|
|
@@ -185,6 +188,19 @@ function formatErrorForHuman(err) {
|
|
|
185
188
|
}
|
|
186
189
|
return lines.join("\n");
|
|
187
190
|
}
|
|
191
|
+
function toValidationError(err) {
|
|
192
|
+
if (err instanceof z.ZodError) {
|
|
193
|
+
const first = err.issues[0];
|
|
194
|
+
const field = first?.path.length ? first.path.join(".") : "input";
|
|
195
|
+
const message = first?.message ?? "Invalid input";
|
|
196
|
+
const more = err.issues.length > 1 ? ` (+${err.issues.length - 1} more)` : "";
|
|
197
|
+
return new ValidationError(
|
|
198
|
+
`${field}: ${message}${more}`,
|
|
199
|
+
"Run the command with --help to see the expected inputs."
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
return err instanceof Error ? err : new Error(String(err));
|
|
203
|
+
}
|
|
188
204
|
var ElnoraError, AuthError, NotFoundError, RateLimitError, ValidationError, ServerError, NetworkError, EXIT_CODES, SCRUB_KEY_VALUE_RE, SCRUB_LONG_TOKEN_RE;
|
|
189
205
|
var init_errors = __esm({
|
|
190
206
|
"src/lib/errors.ts"() {
|
|
@@ -897,6 +913,43 @@ import { Command } from "commander";
|
|
|
897
913
|
|
|
898
914
|
// src/lib/output.ts
|
|
899
915
|
init_errors();
|
|
916
|
+
|
|
917
|
+
// src/lib/tty.ts
|
|
918
|
+
function isTTY() {
|
|
919
|
+
return Boolean(process.stdout.isTTY);
|
|
920
|
+
}
|
|
921
|
+
function isColorEnabled() {
|
|
922
|
+
if (process.env.NO_COLOR !== void 0 && process.env.NO_COLOR !== "") return false;
|
|
923
|
+
if (process.env.FORCE_COLOR !== void 0) return true;
|
|
924
|
+
if (process.env.TERM === "dumb") return false;
|
|
925
|
+
return isTTY();
|
|
926
|
+
}
|
|
927
|
+
function resolveDefaultFormat() {
|
|
928
|
+
return isTTY() ? "table" : "json";
|
|
929
|
+
}
|
|
930
|
+
function hasControlChar(s) {
|
|
931
|
+
for (let i = 0; i < s.length; i++) {
|
|
932
|
+
const c = s.charCodeAt(i);
|
|
933
|
+
if (c < 32 || c === 127) return true;
|
|
934
|
+
}
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
function stripControlChars(s) {
|
|
938
|
+
let out = "";
|
|
939
|
+
for (let i = 0; i < s.length; i++) {
|
|
940
|
+
const c = s.charCodeAt(i);
|
|
941
|
+
if (c >= 32 && c !== 127) out += s[i];
|
|
942
|
+
}
|
|
943
|
+
return out;
|
|
944
|
+
}
|
|
945
|
+
function hyperlink(url, text) {
|
|
946
|
+
if (!url || !isColorEnabled()) return text;
|
|
947
|
+
const safeUrl = stripControlChars(url);
|
|
948
|
+
if (!safeUrl) return text;
|
|
949
|
+
return `\x1B]8;;${safeUrl}\x07${text}\x1B]8;;\x07`;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
// src/lib/output.ts
|
|
900
953
|
function filterFields(data, fields) {
|
|
901
954
|
if (Array.isArray(data)) {
|
|
902
955
|
return data.map((row) => {
|
|
@@ -952,21 +1005,147 @@ function toCsv(rows) {
|
|
|
952
1005
|
}
|
|
953
1006
|
return lines.join("\n");
|
|
954
1007
|
}
|
|
1008
|
+
var MAX_CELL_WIDTH = 120;
|
|
1009
|
+
function cellString(value) {
|
|
1010
|
+
if (value === null || value === void 0) return "";
|
|
1011
|
+
if (typeof value === "object") {
|
|
1012
|
+
try {
|
|
1013
|
+
return JSON.stringify(value);
|
|
1014
|
+
} catch {
|
|
1015
|
+
return String(value);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
return String(value);
|
|
1019
|
+
}
|
|
1020
|
+
function clipCell(value, max = MAX_CELL_WIDTH) {
|
|
1021
|
+
const oneLine = cellString(value).replace(/\r?\n/g, " ");
|
|
1022
|
+
return oneLine.length > max ? `${oneLine.slice(0, max - 1)}\u2026` : oneLine;
|
|
1023
|
+
}
|
|
1024
|
+
var URL_RE = /^https?:\/\/\S+$/;
|
|
1025
|
+
function linkifyCell(value) {
|
|
1026
|
+
const text = clipCell(value);
|
|
1027
|
+
if (typeof value === "string" && URL_RE.test(value) && !hasControlChar(value)) {
|
|
1028
|
+
return hyperlink(value, text);
|
|
1029
|
+
}
|
|
1030
|
+
return text;
|
|
1031
|
+
}
|
|
1032
|
+
function isListShape(data) {
|
|
1033
|
+
if (Array.isArray(data)) return true;
|
|
1034
|
+
if (typeof data === "object" && data !== null) {
|
|
1035
|
+
const obj = data;
|
|
1036
|
+
return "items" in obj && Array.isArray(obj.items);
|
|
1037
|
+
}
|
|
1038
|
+
return false;
|
|
1039
|
+
}
|
|
1040
|
+
function normalizedRows(data) {
|
|
1041
|
+
return toRows(data).map((r) => r !== null && typeof r === "object" && !Array.isArray(r) ? r : { value: r });
|
|
1042
|
+
}
|
|
1043
|
+
function unionKeys(rows) {
|
|
1044
|
+
const keys = [];
|
|
1045
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1046
|
+
for (const row of rows) {
|
|
1047
|
+
for (const k of Object.keys(row)) {
|
|
1048
|
+
if (!seen.has(k)) {
|
|
1049
|
+
keys.push(k);
|
|
1050
|
+
seen.add(k);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
return keys;
|
|
1055
|
+
}
|
|
1056
|
+
function listMeta(data) {
|
|
1057
|
+
if (data !== null && typeof data === "object" && !Array.isArray(data)) {
|
|
1058
|
+
const obj = data;
|
|
1059
|
+
if (Array.isArray(obj.items)) {
|
|
1060
|
+
return Object.entries(obj).filter(([k, v]) => k !== "items" && (v === null || typeof v !== "object"));
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
return [];
|
|
1064
|
+
}
|
|
1065
|
+
function toTable(data) {
|
|
1066
|
+
if (typeof data === "string") return data;
|
|
1067
|
+
if (!isListShape(data) && typeof data === "object" && data !== null) {
|
|
1068
|
+
const entries = Object.entries(data);
|
|
1069
|
+
if (entries.length === 0) return "(empty)";
|
|
1070
|
+
const keyWidth = Math.max(...entries.map(([k]) => k.length));
|
|
1071
|
+
return entries.map(([k, v]) => `${k.padEnd(keyWidth)} ${linkifyCell(v)}`).join("\n");
|
|
1072
|
+
}
|
|
1073
|
+
const rows = normalizedRows(data);
|
|
1074
|
+
if (rows.length === 0) return "No results.";
|
|
1075
|
+
const keys = unionKeys(rows);
|
|
1076
|
+
if (keys.length === 0) return "No results.";
|
|
1077
|
+
const widths = keys.map((k) => Math.max(k.length, ...rows.map((r) => clipCell(r[k]).length)));
|
|
1078
|
+
const renderRow = (vals) => vals.map((v, i) => v.padEnd(widths[i])).join(" ").replace(/\s+$/, "");
|
|
1079
|
+
const header = renderRow(keys);
|
|
1080
|
+
const sep = widths.map((w) => "-".repeat(w)).join(" ");
|
|
1081
|
+
const body = rows.map((r) => renderRow(keys.map((k) => clipCell(r[k]))));
|
|
1082
|
+
const table = [header, sep, ...body].join("\n");
|
|
1083
|
+
const meta = listMeta(data);
|
|
1084
|
+
return meta.length === 0 ? table : `${table}
|
|
1085
|
+
|
|
1086
|
+
${meta.map(([k, v]) => `${k}=${clipCell(v)}`).join(" ")}`;
|
|
1087
|
+
}
|
|
1088
|
+
function mdCell(value) {
|
|
1089
|
+
return cellString(value).replace(/\\/g, "\\\\").replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
|
|
1090
|
+
}
|
|
1091
|
+
function toMarkdown(data) {
|
|
1092
|
+
if (typeof data === "string") return data;
|
|
1093
|
+
if (!isListShape(data) && typeof data === "object" && data !== null) {
|
|
1094
|
+
const entries = Object.entries(data);
|
|
1095
|
+
if (entries.length === 0) return "_(empty)_";
|
|
1096
|
+
return entries.map(([k, v]) => `**${k}:** ${mdCell(v)}`).join("\n");
|
|
1097
|
+
}
|
|
1098
|
+
const rows = normalizedRows(data);
|
|
1099
|
+
if (rows.length === 0) return "_No results._";
|
|
1100
|
+
const keys = unionKeys(rows);
|
|
1101
|
+
if (keys.length === 0) return "_No results._";
|
|
1102
|
+
const head = `| ${keys.join(" | ")} |`;
|
|
1103
|
+
const divider = `| ${keys.map(() => "---").join(" | ")} |`;
|
|
1104
|
+
const body = rows.map((r) => `| ${keys.map((k) => mdCell(r[k])).join(" | ")} |`);
|
|
1105
|
+
const table = [head, divider, ...body].join("\n");
|
|
1106
|
+
const meta = listMeta(data);
|
|
1107
|
+
return meta.length === 0 ? table : `${table}
|
|
1108
|
+
|
|
1109
|
+
_${meta.map(([k, v]) => `${k}: ${mdCell(v)}`).join(", ")}_`;
|
|
1110
|
+
}
|
|
955
1111
|
function formatOutput(data, options) {
|
|
956
|
-
let output = scrubData(data);
|
|
1112
|
+
let output = typeof data === "string" ? data : scrubData(data);
|
|
957
1113
|
if (options.fields) {
|
|
958
1114
|
output = filterFields(output, options.fields);
|
|
959
1115
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1116
|
+
switch (options.format) {
|
|
1117
|
+
case "csv":
|
|
1118
|
+
return toCsv(toRows(output));
|
|
1119
|
+
case "table":
|
|
1120
|
+
return toTable(output);
|
|
1121
|
+
case "markdown":
|
|
1122
|
+
return toMarkdown(output);
|
|
1123
|
+
default:
|
|
1124
|
+
return options.compact ? JSON.stringify(output) : JSON.stringify(output, null, 2);
|
|
965
1125
|
}
|
|
966
|
-
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
// src/lib/stdin.ts
|
|
1129
|
+
function readStdin() {
|
|
1130
|
+
return new Promise((resolve, reject) => {
|
|
1131
|
+
const { stdin } = process;
|
|
1132
|
+
if (stdin.isTTY) {
|
|
1133
|
+
resolve("");
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
let data = "";
|
|
1137
|
+
stdin.setEncoding("utf8");
|
|
1138
|
+
stdin.on("data", (chunk) => {
|
|
1139
|
+
data += chunk;
|
|
1140
|
+
});
|
|
1141
|
+
stdin.on("end", () => resolve(data));
|
|
1142
|
+
stdin.on("error", (err) => reject(err));
|
|
1143
|
+
stdin.resume();
|
|
1144
|
+
});
|
|
967
1145
|
}
|
|
968
1146
|
|
|
969
1147
|
// src/adapters/cli.ts
|
|
1148
|
+
var ALLOWED_FORMATS = /* @__PURE__ */ new Set(["json", "csv", "table", "markdown"]);
|
|
970
1149
|
function unwrapZodDef(schema) {
|
|
971
1150
|
const s = schema;
|
|
972
1151
|
const description = s.description ?? "";
|
|
@@ -1047,7 +1226,10 @@ function kebabToCamel(str) {
|
|
|
1047
1226
|
return str.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
1048
1227
|
}
|
|
1049
1228
|
function buildProgram(registry2) {
|
|
1050
|
-
const program2 = new Command().name("elnora").description("Elnora AI Platform CLI").version(VERSION).option("--compact", "Token-efficient minimal output", false).option(
|
|
1229
|
+
const program2 = new Command().name("elnora").description("Elnora AI Platform CLI").version(VERSION).option("--compact", "Token-efficient minimal output", false).option(
|
|
1230
|
+
"--output <format>",
|
|
1231
|
+
"Output format: json, csv, table, markdown (default: table on a terminal, json when piped)"
|
|
1232
|
+
).option("--md", "Markdown output (shorthand for --output markdown)", false).option("--fields <fields>", "Comma-separated fields to include").option("--profile <name>", "Named profile to use").option("--json", "Force JSON output (even on a terminal)", false).option("--quiet", "Suppress non-essential output (spinners, update notices)", false).option("--no-color", "Disable colored output");
|
|
1051
1233
|
for (const group of registry2.groups()) {
|
|
1052
1234
|
const groupCmd = new Command(group).description(`Manage ${group}`);
|
|
1053
1235
|
const commands = registry2.byGroup(group);
|
|
@@ -1055,17 +1237,22 @@ function buildProgram(registry2) {
|
|
|
1055
1237
|
const subName = camelToKebab(cmd.name.split(".").slice(1).join("-"));
|
|
1056
1238
|
const sub = new Command(subName).description(cmd.description);
|
|
1057
1239
|
const opts = zodToCommanderOptions(cmd.inputSchema);
|
|
1240
|
+
const fieldForFlags = (flags) => {
|
|
1241
|
+
const token = flags.trim().split(/\s+/)[0];
|
|
1242
|
+
return kebabToCamel(token.replace(/^--/, "").replace(/[<>[\]]/g, ""));
|
|
1243
|
+
};
|
|
1244
|
+
const describeOpt = (opt) => cmd.stdinField && fieldForFlags(opt.flags) === cmd.stdinField ? `${opt.description} (use '-' to read from stdin)` : opt.description;
|
|
1058
1245
|
for (const opt of opts) {
|
|
1059
1246
|
if (opt.isArgument) {
|
|
1060
|
-
sub.argument(opt.flags, opt
|
|
1247
|
+
sub.argument(opt.flags, describeOpt(opt));
|
|
1061
1248
|
}
|
|
1062
1249
|
}
|
|
1063
1250
|
for (const opt of opts) {
|
|
1064
1251
|
if (opt.isArgument) continue;
|
|
1065
1252
|
if (opt.choices) {
|
|
1066
|
-
sub.option(opt.flags, opt
|
|
1253
|
+
sub.option(opt.flags, describeOpt(opt), opt.defaultValue);
|
|
1067
1254
|
} else {
|
|
1068
|
-
sub.option(opt.flags, opt
|
|
1255
|
+
sub.option(opt.flags, describeOpt(opt), opt.defaultValue);
|
|
1069
1256
|
}
|
|
1070
1257
|
}
|
|
1071
1258
|
sub.action(async (...actionArgs) => {
|
|
@@ -1097,24 +1284,48 @@ function buildProgram(registry2) {
|
|
|
1097
1284
|
}
|
|
1098
1285
|
const skipAuth = cmd.name.startsWith("auth.login") || cmd.name === "auth.logout" || cmd.name === "auth.profiles";
|
|
1099
1286
|
const client = skipAuth ? new ElnoraApiClient("placeholder") : ElnoraApiClient.fromEnv(profileName);
|
|
1287
|
+
const compact = Boolean(parentOpts.compact);
|
|
1288
|
+
const explicitFormat = parentOpts.json ? "json" : parentOpts.md ? "markdown" : parentOpts.output;
|
|
1289
|
+
if (explicitFormat && !ALLOWED_FORMATS.has(explicitFormat)) {
|
|
1290
|
+
throw new ValidationError(
|
|
1291
|
+
`Unknown output format: ${explicitFormat}`,
|
|
1292
|
+
`Valid formats: ${[...ALLOWED_FORMATS].join(", ")}.`
|
|
1293
|
+
);
|
|
1294
|
+
}
|
|
1295
|
+
const resolvedFormat = explicitFormat ?? (compact ? "json" : resolveDefaultFormat());
|
|
1100
1296
|
const ctx = {
|
|
1101
1297
|
client,
|
|
1102
1298
|
profileName,
|
|
1103
1299
|
mode: "cli",
|
|
1104
1300
|
output: {
|
|
1105
|
-
format:
|
|
1106
|
-
compact
|
|
1107
|
-
fields: parentOpts.fields ? parentOpts.fields.split(",").map((f) => f.trim()) : void 0
|
|
1301
|
+
format: resolvedFormat,
|
|
1302
|
+
compact,
|
|
1303
|
+
fields: parentOpts.fields ? parentOpts.fields.split(",").map((f) => f.trim()) : void 0,
|
|
1304
|
+
quiet: Boolean(parentOpts.quiet)
|
|
1108
1305
|
}
|
|
1109
1306
|
};
|
|
1110
|
-
|
|
1307
|
+
if (cmd.stdinField && input[cmd.stdinField] === "-") {
|
|
1308
|
+
if (process.stdin.isTTY) {
|
|
1309
|
+
throw new ValidationError(
|
|
1310
|
+
`'-' reads ${camelToKebab(cmd.stdinField)} from stdin, but stdin is a terminal.`,
|
|
1311
|
+
"Pipe data in, e.g.: cat file.txt | elnora ... -"
|
|
1312
|
+
);
|
|
1313
|
+
}
|
|
1314
|
+
input[cmd.stdinField] = (await readStdin()).replace(/\r?\n$/, "");
|
|
1315
|
+
}
|
|
1316
|
+
let parsed;
|
|
1317
|
+
try {
|
|
1318
|
+
parsed = cmd.inputSchema.parse(input);
|
|
1319
|
+
} catch (e) {
|
|
1320
|
+
throw toValidationError(e);
|
|
1321
|
+
}
|
|
1111
1322
|
const result = await cmd.execute(parsed, ctx);
|
|
1112
1323
|
if (result != null) {
|
|
1113
1324
|
const isStreamed = typeof result === "object" && result.streamed === true;
|
|
1114
1325
|
if (!isStreamed) {
|
|
1115
|
-
const
|
|
1326
|
+
const useGeneric = Boolean(ctx.output.fields) || ctx.output.compact || ctx.output.format === "csv" || ctx.output.format === "table" || ctx.output.format === "markdown";
|
|
1116
1327
|
let formatted;
|
|
1117
|
-
if (cmd.formatOutput && !
|
|
1328
|
+
if (cmd.formatOutput && !useGeneric) {
|
|
1118
1329
|
formatted = cmd.formatOutput(result, ctx.output.format);
|
|
1119
1330
|
} else {
|
|
1120
1331
|
formatted = formatOutput(result, {
|
|
@@ -1273,33 +1484,155 @@ function addCompletionCommand(program2) {
|
|
|
1273
1484
|
});
|
|
1274
1485
|
}
|
|
1275
1486
|
|
|
1487
|
+
// src/commands/config.ts
|
|
1488
|
+
init_config();
|
|
1489
|
+
init_profiles();
|
|
1490
|
+
function resolveKeySource(profileName) {
|
|
1491
|
+
if (process.env.ELNORA_API_KEY !== void 0) return "env:ELNORA_API_KEY";
|
|
1492
|
+
if (process.env.ELNORA_MCP_API_KEY !== void 0) return "env:ELNORA_MCP_API_KEY";
|
|
1493
|
+
const profiles = loadProfiles();
|
|
1494
|
+
if (profiles[profileName]?.api_key) return `profile:${profileName}`;
|
|
1495
|
+
return "none";
|
|
1496
|
+
}
|
|
1497
|
+
function addConfigCommand(program2) {
|
|
1498
|
+
const config = program2.command("config").description("Inspect Elnora CLI configuration");
|
|
1499
|
+
config.command("show").description("Show resolved CLI configuration (endpoints, active profile, key source)").action(() => {
|
|
1500
|
+
const parentOpts = program2.opts();
|
|
1501
|
+
const profileName = parentOpts.profile ?? "default";
|
|
1502
|
+
const data = {
|
|
1503
|
+
base_url: BASE_URL,
|
|
1504
|
+
ai_server_url: AI_SERVER_URL,
|
|
1505
|
+
mcp_url: MCP_URL,
|
|
1506
|
+
active_profile: profileName,
|
|
1507
|
+
key_source: resolveKeySource(profileName)
|
|
1508
|
+
};
|
|
1509
|
+
if (parentOpts.json || !process.stdout.isTTY) {
|
|
1510
|
+
console.log(JSON.stringify(data, null, 2));
|
|
1511
|
+
return;
|
|
1512
|
+
}
|
|
1513
|
+
console.log(`base_url=${data.base_url}`);
|
|
1514
|
+
console.log(`ai_server_url=${data.ai_server_url}`);
|
|
1515
|
+
console.log(`mcp_url=${data.mcp_url}`);
|
|
1516
|
+
console.log(`active_profile=${data.active_profile}`);
|
|
1517
|
+
console.log(`key_source=${data.key_source}`);
|
|
1518
|
+
});
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1276
1521
|
// src/commands/doctor.ts
|
|
1277
1522
|
init_client();
|
|
1278
1523
|
init_config();
|
|
1279
|
-
|
|
1280
|
-
import {
|
|
1281
|
-
import { homedir as homedir4 } from "node:os";
|
|
1524
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4, statSync as statSync2 } from "node:fs";
|
|
1525
|
+
import { homedir as homedir5 } from "node:os";
|
|
1282
1526
|
import { delimiter, join as join4 } from "node:path";
|
|
1283
1527
|
import pc3 from "picocolors";
|
|
1284
1528
|
|
|
1285
|
-
// src/lib/
|
|
1286
|
-
import { existsSync as existsSync2,
|
|
1529
|
+
// src/lib/install-discovery.ts
|
|
1530
|
+
import { existsSync as existsSync2, realpathSync, statSync } from "node:fs";
|
|
1287
1531
|
import { homedir as homedir2 } from "node:os";
|
|
1288
|
-
import {
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1532
|
+
import { posix, win32 } from "node:path";
|
|
1533
|
+
var norm = (p) => p.replace(/\\/g, "/").toLowerCase();
|
|
1534
|
+
function safeRealPath(p) {
|
|
1535
|
+
try {
|
|
1536
|
+
return realpathSync(p);
|
|
1537
|
+
} catch {
|
|
1538
|
+
return p;
|
|
1539
|
+
}
|
|
1294
1540
|
}
|
|
1295
|
-
function
|
|
1296
|
-
if (
|
|
1297
|
-
|
|
1298
|
-
|
|
1541
|
+
function candidateNames(platform, pathExt) {
|
|
1542
|
+
if (platform !== "win32") return ["elnora"];
|
|
1543
|
+
const names = [];
|
|
1544
|
+
for (const raw of pathExt.split(";")) {
|
|
1545
|
+
const ext = raw.trim().toLowerCase();
|
|
1546
|
+
if (ext) names.push(`elnora${ext.startsWith(".") ? ext : `.${ext}`}`);
|
|
1547
|
+
}
|
|
1548
|
+
names.push("elnora");
|
|
1549
|
+
return [...new Set(names)];
|
|
1550
|
+
}
|
|
1551
|
+
function npmPrefix(p) {
|
|
1552
|
+
const n = norm(p);
|
|
1553
|
+
const idx = n.indexOf("/node_modules/");
|
|
1554
|
+
return idx > 0 ? n.slice(0, idx) : void 0;
|
|
1555
|
+
}
|
|
1556
|
+
function classify(realPath, home, pathMod, installDirOverride) {
|
|
1557
|
+
const p = norm(realPath);
|
|
1558
|
+
if (p.includes("/node_modules/")) return "npm";
|
|
1559
|
+
if (/\/npm\/elnora[^/]*$/.test(p)) return "npm";
|
|
1560
|
+
if (p.includes("/cellar/") || p.includes("/homebrew/")) return "homebrew";
|
|
1561
|
+
if (p.endsWith(".ts") || p.endsWith(".tsx") || p.includes("/tsx/")) return "dev";
|
|
1562
|
+
const binDirs = [pathMod.join(home, ".elnora", "bin"), pathMod.join(home, ".local", "bin"), installDirOverride].filter((d) => Boolean(d)).map(norm);
|
|
1563
|
+
if (binDirs.some((d) => p === d || p.startsWith(`${d}/`))) return "binary";
|
|
1564
|
+
return "unknown";
|
|
1565
|
+
}
|
|
1566
|
+
function discoverInstalls(env) {
|
|
1567
|
+
const pathMod = env.platform === "win32" ? win32 : posix;
|
|
1568
|
+
const dirs = env.pathVar.split(pathMod.delimiter).filter(Boolean);
|
|
1569
|
+
const names = candidateNames(env.platform, env.pathExt);
|
|
1570
|
+
const activeReals = /* @__PURE__ */ new Set();
|
|
1571
|
+
for (const candidate of [env.execPath, env.argv1]) {
|
|
1572
|
+
if (candidate) activeReals.add(norm(safeRealPath(candidate)));
|
|
1573
|
+
}
|
|
1574
|
+
const activePrefix = npmPrefix(env.argv1) ?? npmPrefix(safeRealPath(env.argv1));
|
|
1575
|
+
const byReal = /* @__PURE__ */ new Map();
|
|
1576
|
+
for (const dir of dirs) {
|
|
1577
|
+
let full;
|
|
1578
|
+
for (const name of names) {
|
|
1579
|
+
const candidate = pathMod.join(dir, name);
|
|
1580
|
+
try {
|
|
1581
|
+
if (existsSync2(candidate) && statSync(candidate).isFile()) {
|
|
1582
|
+
full = candidate;
|
|
1583
|
+
break;
|
|
1584
|
+
}
|
|
1585
|
+
} catch {
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
if (!full) continue;
|
|
1589
|
+
const realPath = safeRealPath(full);
|
|
1590
|
+
const key = norm(realPath);
|
|
1591
|
+
if (byReal.has(key)) continue;
|
|
1592
|
+
const active = activeReals.has(key) || activePrefix !== void 0 && norm(dir) === activePrefix;
|
|
1593
|
+
byReal.set(key, {
|
|
1594
|
+
path: full,
|
|
1595
|
+
realPath,
|
|
1596
|
+
pathDir: dir,
|
|
1597
|
+
source: classify(realPath, env.home, pathMod, env.installDirOverride),
|
|
1598
|
+
active
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
return [...byReal.values()];
|
|
1602
|
+
}
|
|
1603
|
+
function detectAllInstalls() {
|
|
1604
|
+
return discoverInstalls({
|
|
1605
|
+
pathVar: process.env.PATH ?? "",
|
|
1606
|
+
pathExt: process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD",
|
|
1607
|
+
platform: process.platform,
|
|
1608
|
+
home: homedir2(),
|
|
1609
|
+
execPath: process.execPath,
|
|
1610
|
+
argv1: process.argv[1] ?? "",
|
|
1611
|
+
installDirOverride: process.env.ELNORA_INSTALL_DIR
|
|
1612
|
+
});
|
|
1299
1613
|
}
|
|
1614
|
+
function uninstallCommandFor(install) {
|
|
1615
|
+
switch (install.source) {
|
|
1616
|
+
case "npm":
|
|
1617
|
+
return "npm uninstall -g @elnora-ai/cli";
|
|
1618
|
+
case "homebrew":
|
|
1619
|
+
return "brew uninstall elnora";
|
|
1620
|
+
case "dev":
|
|
1621
|
+
return null;
|
|
1622
|
+
default:
|
|
1623
|
+
return process.platform === "win32" ? `Remove-Item "${install.path}"` : `rm "${install.path}"`;
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
// src/commands/doctor.ts
|
|
1628
|
+
init_profiles();
|
|
1300
1629
|
|
|
1301
1630
|
// src/lib/setup/common.ts
|
|
1302
|
-
|
|
1631
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
1632
|
+
import { homedir as homedir3 } from "node:os";
|
|
1633
|
+
import { join as join2 } from "node:path";
|
|
1634
|
+
import pc from "picocolors";
|
|
1635
|
+
var HOME = homedir3();
|
|
1303
1636
|
var ELNORA_DIR = join2(HOME, ".elnora");
|
|
1304
1637
|
var CLAUDE_DIR = join2(HOME, ".claude");
|
|
1305
1638
|
var CLAUDE_MARKETPLACES_FILE = join2(CLAUDE_DIR, "plugins", "known_marketplaces.json");
|
|
@@ -1313,7 +1646,7 @@ var MARKETPLACE_REPO = "Elnora-AI/elnora-plugins";
|
|
|
1313
1646
|
var MARKETPLACE_GITHUB_URL = `https://github.com/${MARKETPLACE_REPO}`;
|
|
1314
1647
|
var PLUGIN_ID = `elnora@${MARKETPLACE_NAME}`;
|
|
1315
1648
|
function readJsonFile(path) {
|
|
1316
|
-
if (!
|
|
1649
|
+
if (!existsSync3(path)) return {};
|
|
1317
1650
|
try {
|
|
1318
1651
|
return JSON.parse(readFileSync2(path, "utf-8"));
|
|
1319
1652
|
} catch (err) {
|
|
@@ -1338,17 +1671,17 @@ function info(msg) {
|
|
|
1338
1671
|
}
|
|
1339
1672
|
function detectPlatforms() {
|
|
1340
1673
|
return [
|
|
1341
|
-
{ name: "claude", label: "Claude Code", installed:
|
|
1342
|
-
{ name: "cursor", label: "Cursor", installed:
|
|
1343
|
-
{ name: "vscode", label: "VS Code", installed:
|
|
1344
|
-
{ name: "codex", label: "OpenAI Codex", installed:
|
|
1674
|
+
{ name: "claude", label: "Claude Code", installed: existsSync3(CLAUDE_DIR) },
|
|
1675
|
+
{ name: "cursor", label: "Cursor", installed: existsSync3(CURSOR_DIR) },
|
|
1676
|
+
{ name: "vscode", label: "VS Code", installed: existsSync3(VSCODE_DIR) },
|
|
1677
|
+
{ name: "codex", label: "OpenAI Codex", installed: existsSync3(CODEX_DIR) }
|
|
1345
1678
|
];
|
|
1346
1679
|
}
|
|
1347
1680
|
|
|
1348
1681
|
// src/lib/update-check.ts
|
|
1349
1682
|
init_config();
|
|
1350
|
-
import { existsSync as
|
|
1351
|
-
import { homedir as
|
|
1683
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "node:fs";
|
|
1684
|
+
import { homedir as homedir4 } from "node:os";
|
|
1352
1685
|
import { join as join3 } from "node:path";
|
|
1353
1686
|
import pc2 from "picocolors";
|
|
1354
1687
|
|
|
@@ -1376,11 +1709,15 @@ function getUpdateInstruction(method) {
|
|
|
1376
1709
|
|
|
1377
1710
|
// src/lib/update-check.ts
|
|
1378
1711
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org/@elnora-ai/cli/latest";
|
|
1379
|
-
var CACHE_DIR = join3(
|
|
1712
|
+
var CACHE_DIR = join3(homedir4(), ".elnora");
|
|
1380
1713
|
var CACHE_FILE = join3(CACHE_DIR, ".update-check");
|
|
1381
1714
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
1382
1715
|
var FETCH_TIMEOUT_MS = 3e3;
|
|
1383
|
-
|
|
1716
|
+
function sanitizeVersion(raw) {
|
|
1717
|
+
const m = /^(\d{1,9})\.(\d{1,9})\.(\d{1,9})$/.exec(raw);
|
|
1718
|
+
if (!m) return null;
|
|
1719
|
+
return `${Number(m[1])}.${Number(m[2])}.${Number(m[3])}`;
|
|
1720
|
+
}
|
|
1384
1721
|
function shouldSkipEntirely() {
|
|
1385
1722
|
if (process.env.CI || process.env.GITHUB_ACTIONS) return true;
|
|
1386
1723
|
if (process.env.ELNORA_NO_UPDATE_CHECK) return true;
|
|
@@ -1388,7 +1725,7 @@ function shouldSkipEntirely() {
|
|
|
1388
1725
|
}
|
|
1389
1726
|
function readCache() {
|
|
1390
1727
|
try {
|
|
1391
|
-
if (!
|
|
1728
|
+
if (!existsSync4(CACHE_FILE)) return null;
|
|
1392
1729
|
const raw = readFileSync3(CACHE_FILE, "utf-8");
|
|
1393
1730
|
return JSON.parse(raw);
|
|
1394
1731
|
} catch {
|
|
@@ -1427,13 +1764,13 @@ function isNewerVersion(a, b) {
|
|
|
1427
1764
|
}
|
|
1428
1765
|
return false;
|
|
1429
1766
|
}
|
|
1430
|
-
function registerUpdateCheck() {
|
|
1767
|
+
function registerUpdateCheck(quiet2 = false) {
|
|
1431
1768
|
if (shouldSkipEntirely()) return;
|
|
1432
1769
|
const cached = readCache();
|
|
1433
1770
|
if (cached) {
|
|
1434
1771
|
const elapsed = Date.now() - new Date(cached.checkedAt).getTime();
|
|
1435
1772
|
if (elapsed < CHECK_INTERVAL_MS) {
|
|
1436
|
-
if (cached.latest && cached.latest !== VERSION && cached.latest !== "unknown") {
|
|
1773
|
+
if (!quiet2 && cached.latest && cached.latest !== VERSION && cached.latest !== "unknown") {
|
|
1437
1774
|
if (isNewerVersion(cached.latest, VERSION)) {
|
|
1438
1775
|
showUpdateNotice(cached.latest);
|
|
1439
1776
|
}
|
|
@@ -1450,10 +1787,10 @@ function registerUpdateCheck() {
|
|
|
1450
1787
|
});
|
|
1451
1788
|
if (!response.ok) return;
|
|
1452
1789
|
const data = await response.json();
|
|
1453
|
-
const latest = data.version
|
|
1454
|
-
if (
|
|
1790
|
+
const latest = data.version ? sanitizeVersion(data.version) : null;
|
|
1791
|
+
if (!latest) return;
|
|
1455
1792
|
writeCache({ checkedAt: (/* @__PURE__ */ new Date()).toISOString(), latest });
|
|
1456
|
-
if (
|
|
1793
|
+
if (!quiet2 && latest !== VERSION && isNewerVersion(latest, VERSION)) {
|
|
1457
1794
|
showUpdateNotice(latest);
|
|
1458
1795
|
}
|
|
1459
1796
|
} catch {
|
|
@@ -1518,10 +1855,10 @@ function checkConfigPermissions() {
|
|
|
1518
1855
|
if (process.platform === "win32") {
|
|
1519
1856
|
return { status: "pass", msg: "Config permissions (skipped on Windows)" };
|
|
1520
1857
|
}
|
|
1521
|
-
if (!
|
|
1858
|
+
if (!existsSync5(PROFILES_FILE)) {
|
|
1522
1859
|
return { status: "warn", msg: "Config permissions ~/.elnora/profiles.toml not found" };
|
|
1523
1860
|
}
|
|
1524
|
-
const mode =
|
|
1861
|
+
const mode = statSync2(PROFILES_FILE).mode & 511;
|
|
1525
1862
|
if (mode === 384) {
|
|
1526
1863
|
return { status: "pass", msg: `Config permissions ${PROFILES_FILE} (0600)` };
|
|
1527
1864
|
}
|
|
@@ -1536,7 +1873,7 @@ async function checkAiServerReachable() {
|
|
|
1536
1873
|
return { status: "fail", msg: `AI Server unreachable ${host} (HTTP ${res.status})` };
|
|
1537
1874
|
}
|
|
1538
1875
|
function checkPathConfigured() {
|
|
1539
|
-
const installDirs = [join4(
|
|
1876
|
+
const installDirs = [join4(homedir5(), ".local", "bin"), join4(homedir5(), ".elnora", "bin")];
|
|
1540
1877
|
const pathVar = process.env.PATH ?? "";
|
|
1541
1878
|
const entries = pathVar.split(delimiter).filter(Boolean);
|
|
1542
1879
|
const matched = installDirs.find((d) => entries.includes(d));
|
|
@@ -1548,8 +1885,28 @@ function checkPathConfigured() {
|
|
|
1548
1885
|
msg: "PATH configured standard install dirs not in PATH (OK if installed via npm/brew)"
|
|
1549
1886
|
};
|
|
1550
1887
|
}
|
|
1888
|
+
function checkShadowInstalls() {
|
|
1889
|
+
const installs = detectAllInstalls();
|
|
1890
|
+
const active = installs.find((i) => i.active);
|
|
1891
|
+
if (!active) {
|
|
1892
|
+
return { status: "skip", msg: "Shadow installs (running from a non-PATH/dev build)" };
|
|
1893
|
+
}
|
|
1894
|
+
const shadows = installs.filter((i) => !i.active && i.source !== "dev");
|
|
1895
|
+
if (shadows.length === 0) {
|
|
1896
|
+
return { status: "pass", msg: `No shadow installs ${active.path} (${active.source})` };
|
|
1897
|
+
}
|
|
1898
|
+
const lines = shadows.map((s) => {
|
|
1899
|
+
const cmd = uninstallCommandFor(s);
|
|
1900
|
+
return ` shadow: ${s.path} (${s.source})${cmd ? ` \u2014 ${cmd}` : " \u2014 remove manually"}`;
|
|
1901
|
+
});
|
|
1902
|
+
return {
|
|
1903
|
+
status: "warn",
|
|
1904
|
+
msg: `Shadow installs ${shadows.length} other elnora on PATH (active: ${active.path} [${active.source}])
|
|
1905
|
+
${lines.join("\n")}`
|
|
1906
|
+
};
|
|
1907
|
+
}
|
|
1551
1908
|
function readEnabledPlugins(file) {
|
|
1552
|
-
if (!
|
|
1909
|
+
if (!existsSync5(file)) return null;
|
|
1553
1910
|
try {
|
|
1554
1911
|
const settings = JSON.parse(readFileSync4(file, "utf-8"));
|
|
1555
1912
|
const raw = settings.enabledPlugins;
|
|
@@ -1560,7 +1917,7 @@ function readEnabledPlugins(file) {
|
|
|
1560
1917
|
}
|
|
1561
1918
|
}
|
|
1562
1919
|
function checkClaudePlugin() {
|
|
1563
|
-
if (!
|
|
1920
|
+
if (!existsSync5(CLAUDE_DIR)) {
|
|
1564
1921
|
return { status: "skip", msg: "Plugin enabled (Claude Code not installed)" };
|
|
1565
1922
|
}
|
|
1566
1923
|
const projectSettingsFile = join4(process.cwd(), ".claude", "settings.json");
|
|
@@ -1598,7 +1955,7 @@ function checkClaudePlugin() {
|
|
|
1598
1955
|
}
|
|
1599
1956
|
function isMarketplaceRegistered() {
|
|
1600
1957
|
for (const file of [CLAUDE_SETTINGS_FILE, join4(process.cwd(), ".claude", "settings.json")]) {
|
|
1601
|
-
if (!
|
|
1958
|
+
if (!existsSync5(file)) continue;
|
|
1602
1959
|
try {
|
|
1603
1960
|
const settings = JSON.parse(readFileSync4(file, "utf-8"));
|
|
1604
1961
|
const enabled = settings.enabledPlugins;
|
|
@@ -1611,7 +1968,7 @@ function isMarketplaceRegistered() {
|
|
|
1611
1968
|
}
|
|
1612
1969
|
}
|
|
1613
1970
|
const knownMarketplaces = join4(CLAUDE_DIR, "plugins", "known_marketplaces.json");
|
|
1614
|
-
if (
|
|
1971
|
+
if (existsSync5(knownMarketplaces)) {
|
|
1615
1972
|
try {
|
|
1616
1973
|
if (JSON.stringify(JSON.parse(readFileSync4(knownMarketplaces, "utf-8"))).includes(MARKETPLACE_NAME)) {
|
|
1617
1974
|
return true;
|
|
@@ -1622,11 +1979,11 @@ function isMarketplaceRegistered() {
|
|
|
1622
1979
|
return false;
|
|
1623
1980
|
}
|
|
1624
1981
|
function checkSkillsInstalled() {
|
|
1625
|
-
if (!
|
|
1982
|
+
if (!existsSync5(CLAUDE_DIR)) {
|
|
1626
1983
|
return { status: "skip", msg: "Skills installed (Claude Code not installed)" };
|
|
1627
1984
|
}
|
|
1628
1985
|
const skillsDir = join4(CLAUDE_DIR, "plugins", "marketplaces", MARKETPLACE_NAME, "elnora", "skills");
|
|
1629
|
-
if (!
|
|
1986
|
+
if (!existsSync5(skillsDir)) {
|
|
1630
1987
|
if (isMarketplaceRegistered()) {
|
|
1631
1988
|
return {
|
|
1632
1989
|
status: "warn",
|
|
@@ -1638,7 +1995,7 @@ function checkSkillsInstalled() {
|
|
|
1638
1995
|
msg: "Skills installed marketplace not registered \u2014 run 'elnora setup claude'"
|
|
1639
1996
|
};
|
|
1640
1997
|
}
|
|
1641
|
-
const found = EXPECTED_SKILLS.filter((s) =>
|
|
1998
|
+
const found = EXPECTED_SKILLS.filter((s) => existsSync5(join4(skillsDir, s, "SKILL.md")));
|
|
1642
1999
|
if (found.length === EXPECTED_SKILLS.length) {
|
|
1643
2000
|
return { status: "pass", msg: `Skills installed ${found.length} skills` };
|
|
1644
2001
|
}
|
|
@@ -1649,7 +2006,7 @@ function checkSkillsInstalled() {
|
|
|
1649
2006
|
};
|
|
1650
2007
|
}
|
|
1651
2008
|
function checkPluginVersion() {
|
|
1652
|
-
if (!
|
|
2009
|
+
if (!existsSync5(CLAUDE_DIR)) {
|
|
1653
2010
|
return { status: "skip", msg: "Plugin version (Claude Code not installed)" };
|
|
1654
2011
|
}
|
|
1655
2012
|
const pluginJsonPath = join4(
|
|
@@ -1661,7 +2018,7 @@ function checkPluginVersion() {
|
|
|
1661
2018
|
".claude-plugin",
|
|
1662
2019
|
"plugin.json"
|
|
1663
2020
|
);
|
|
1664
|
-
if (!
|
|
2021
|
+
if (!existsSync5(pluginJsonPath)) {
|
|
1665
2022
|
return { status: "skip", msg: "Plugin version (plugin not cloned yet)" };
|
|
1666
2023
|
}
|
|
1667
2024
|
try {
|
|
@@ -1683,20 +2040,21 @@ function checkPluginVersion() {
|
|
|
1683
2040
|
}
|
|
1684
2041
|
async function checkMcpReachable() {
|
|
1685
2042
|
const start = Date.now();
|
|
2043
|
+
const mcpHost = new URL(MCP_URL).hostname;
|
|
1686
2044
|
try {
|
|
1687
|
-
const res = await fetch(
|
|
2045
|
+
const res = await fetch(MCP_URL, {
|
|
1688
2046
|
method: "HEAD",
|
|
1689
2047
|
signal: AbortSignal.timeout(5e3)
|
|
1690
2048
|
});
|
|
1691
2049
|
const ms = Date.now() - start;
|
|
1692
2050
|
if (res.status < 500) {
|
|
1693
|
-
return { status: "pass", msg: `Server reachable
|
|
2051
|
+
return { status: "pass", msg: `Server reachable ${mcpHost} (${res.status}, ${ms}ms)` };
|
|
1694
2052
|
}
|
|
1695
|
-
return { status: "fail", msg: `Server unreachable
|
|
2053
|
+
return { status: "fail", msg: `Server unreachable ${mcpHost} (HTTP ${res.status})` };
|
|
1696
2054
|
} catch (e) {
|
|
1697
2055
|
return {
|
|
1698
2056
|
status: "fail",
|
|
1699
|
-
msg: `Server unreachable
|
|
2057
|
+
msg: `Server unreachable ${mcpHost} (${e instanceof Error ? e.message : "network error"})`
|
|
1700
2058
|
};
|
|
1701
2059
|
}
|
|
1702
2060
|
}
|
|
@@ -1751,7 +2109,8 @@ Elnora CLI v${VERSION}
|
|
|
1751
2109
|
await runCheck(() => checkVersionCurrent()),
|
|
1752
2110
|
await runCheck(() => checkConfigPermissions()),
|
|
1753
2111
|
await runCheck(() => checkAiServerReachable()),
|
|
1754
|
-
await runCheck(() => checkPathConfigured())
|
|
2112
|
+
await runCheck(() => checkPathConfigured()),
|
|
2113
|
+
await runCheck(() => checkShadowInstalls())
|
|
1755
2114
|
];
|
|
1756
2115
|
for (const r of cliChecks) {
|
|
1757
2116
|
console.error(render(r));
|
|
@@ -1784,7 +2143,7 @@ Elnora CLI v${VERSION}
|
|
|
1784
2143
|
if (warnings > 0) parts.push(`${warnings} warning${warnings === 1 ? "" : "s"}`);
|
|
1785
2144
|
if (failed > 0) parts.push(`${failed} failed`);
|
|
1786
2145
|
console.error(`${parts.join(", ")}.`);
|
|
1787
|
-
if (failed > 0 && !
|
|
2146
|
+
if (failed > 0 && !existsSync5(PROFILES_FILE)) console.error("\nRun: elnora auth login");
|
|
1788
2147
|
}
|
|
1789
2148
|
});
|
|
1790
2149
|
}
|
|
@@ -1853,7 +2212,7 @@ init_profiles();
|
|
|
1853
2212
|
|
|
1854
2213
|
// src/lib/setup/claude.ts
|
|
1855
2214
|
import { spawn } from "node:child_process";
|
|
1856
|
-
import { existsSync as
|
|
2215
|
+
import { existsSync as existsSync6 } from "node:fs";
|
|
1857
2216
|
function runClaudeCli(args) {
|
|
1858
2217
|
return new Promise((resolve, reject) => {
|
|
1859
2218
|
const child = spawn("claude", args, {
|
|
@@ -1873,7 +2232,7 @@ function runClaudeCli(args) {
|
|
|
1873
2232
|
});
|
|
1874
2233
|
}
|
|
1875
2234
|
async function setupClaude() {
|
|
1876
|
-
if (!
|
|
2235
|
+
if (!existsSync6(CLAUDE_DIR)) {
|
|
1877
2236
|
console.error(fail("Claude Code not found (~/.claude/ does not exist)"));
|
|
1878
2237
|
console.error("");
|
|
1879
2238
|
console.error(" Install Claude Code first: https://claude.ai/code");
|
|
@@ -1916,11 +2275,11 @@ function reportClaudeCliError(err, step) {
|
|
|
1916
2275
|
}
|
|
1917
2276
|
|
|
1918
2277
|
// src/lib/setup/codex.ts
|
|
1919
|
-
import { existsSync as
|
|
2278
|
+
import { existsSync as existsSync7 } from "node:fs";
|
|
1920
2279
|
import { join as join5 } from "node:path";
|
|
1921
2280
|
var CODEX_MCP_FILE = join5(CODEX_DIR, "mcp.json");
|
|
1922
2281
|
function setupCodex(apiKey) {
|
|
1923
|
-
if (!
|
|
2282
|
+
if (!existsSync7(CODEX_DIR)) {
|
|
1924
2283
|
console.error(fail("Codex CLI not found (~/.codex/ does not exist)"));
|
|
1925
2284
|
console.error("");
|
|
1926
2285
|
console.error(" Install Codex first: https://github.com/openai/codex");
|
|
@@ -1952,9 +2311,9 @@ function setupCodex(apiKey) {
|
|
|
1952
2311
|
}
|
|
1953
2312
|
|
|
1954
2313
|
// src/lib/setup/cursor.ts
|
|
1955
|
-
import { existsSync as
|
|
2314
|
+
import { existsSync as existsSync8 } from "node:fs";
|
|
1956
2315
|
function setupCursor(apiKey) {
|
|
1957
|
-
if (!
|
|
2316
|
+
if (!existsSync8(CURSOR_DIR)) {
|
|
1958
2317
|
console.error(fail("Cursor not found (~/.cursor/ does not exist)"));
|
|
1959
2318
|
console.error("");
|
|
1960
2319
|
console.error(" Install Cursor first: https://cursor.com");
|
|
@@ -1987,11 +2346,11 @@ function setupCursor(apiKey) {
|
|
|
1987
2346
|
}
|
|
1988
2347
|
|
|
1989
2348
|
// src/lib/setup/vscode.ts
|
|
1990
|
-
import { existsSync as
|
|
2349
|
+
import { existsSync as existsSync9 } from "node:fs";
|
|
1991
2350
|
import { join as join6 } from "node:path";
|
|
1992
2351
|
var VSCODE_MCP_GLOBAL = join6(HOME, ".vscode", "mcp.json");
|
|
1993
2352
|
function setupVscode(apiKey) {
|
|
1994
|
-
if (!
|
|
2353
|
+
if (!existsSync9(VSCODE_DIR)) {
|
|
1995
2354
|
console.error(fail("VS Code not found (~/.vscode/ does not exist)"));
|
|
1996
2355
|
console.error("");
|
|
1997
2356
|
console.error(" Install VS Code first: https://code.visualstudio.com");
|
|
@@ -2325,16 +2684,16 @@ Profile: ${profileName}`);
|
|
|
2325
2684
|
}
|
|
2326
2685
|
|
|
2327
2686
|
// src/commands/account/accept-terms.ts
|
|
2328
|
-
import { z } from "zod";
|
|
2329
|
-
var inputSchema =
|
|
2330
|
-
documentVersionId:
|
|
2687
|
+
import { z as z2 } from "zod";
|
|
2688
|
+
var inputSchema = z2.object({
|
|
2689
|
+
documentVersionId: z2.string().describe("Document version ID to accept")
|
|
2331
2690
|
});
|
|
2332
2691
|
var accountAcceptTerms = {
|
|
2333
2692
|
name: "account.acceptTerms",
|
|
2334
2693
|
group: "account",
|
|
2335
2694
|
description: "Accept a user agreement / terms of service",
|
|
2336
2695
|
inputSchema,
|
|
2337
|
-
outputSchema:
|
|
2696
|
+
outputSchema: z2.any(),
|
|
2338
2697
|
async execute(input, ctx) {
|
|
2339
2698
|
return ctx.client.post("user_agreement", {
|
|
2340
2699
|
documentVersionId: input.documentVersionId
|
|
@@ -2347,19 +2706,19 @@ var accountAcceptTerms = {
|
|
|
2347
2706
|
};
|
|
2348
2707
|
|
|
2349
2708
|
// src/commands/account/add-legal-doc.ts
|
|
2350
|
-
import { z as
|
|
2351
|
-
var inputSchema2 =
|
|
2352
|
-
documentType:
|
|
2353
|
-
version:
|
|
2354
|
-
content:
|
|
2355
|
-
effectiveDate:
|
|
2709
|
+
import { z as z3 } from "zod";
|
|
2710
|
+
var inputSchema2 = z3.object({
|
|
2711
|
+
documentType: z3.string().min(1).describe("Document type"),
|
|
2712
|
+
version: z3.string().min(1).describe("Document version string"),
|
|
2713
|
+
content: z3.string().min(1).describe("Document content"),
|
|
2714
|
+
effectiveDate: z3.string().optional().describe("Effective date (ISO 8601)")
|
|
2356
2715
|
});
|
|
2357
2716
|
var accountAddLegalDoc = {
|
|
2358
2717
|
name: "account.addLegalDoc",
|
|
2359
2718
|
group: "account",
|
|
2360
2719
|
description: "Add a legal document version (SystemAdmin only)",
|
|
2361
2720
|
inputSchema: inputSchema2,
|
|
2362
|
-
outputSchema:
|
|
2721
|
+
outputSchema: z3.any(),
|
|
2363
2722
|
async execute(input, ctx) {
|
|
2364
2723
|
const body = {
|
|
2365
2724
|
documentType: input.documentType,
|
|
@@ -2376,14 +2735,14 @@ var accountAddLegalDoc = {
|
|
|
2376
2735
|
};
|
|
2377
2736
|
|
|
2378
2737
|
// src/commands/account/agreements.ts
|
|
2379
|
-
import { z as
|
|
2380
|
-
var inputSchema3 =
|
|
2738
|
+
import { z as z4 } from "zod";
|
|
2739
|
+
var inputSchema3 = z4.object({});
|
|
2381
2740
|
var accountAgreements = {
|
|
2382
2741
|
name: "account.agreements",
|
|
2383
2742
|
group: "account",
|
|
2384
2743
|
description: "List user agreements",
|
|
2385
2744
|
inputSchema: inputSchema3,
|
|
2386
|
-
outputSchema:
|
|
2745
|
+
outputSchema: z4.any(),
|
|
2387
2746
|
annotations: { readOnlyHint: true },
|
|
2388
2747
|
async execute(_input, ctx) {
|
|
2389
2748
|
return ctx.client.get("user_agreements");
|
|
@@ -2395,7 +2754,7 @@ var accountAgreements = {
|
|
|
2395
2754
|
};
|
|
2396
2755
|
|
|
2397
2756
|
// src/commands/account/delete.ts
|
|
2398
|
-
import { z as
|
|
2757
|
+
import { z as z5 } from "zod";
|
|
2399
2758
|
|
|
2400
2759
|
// src/commands/_shared/confirm.ts
|
|
2401
2760
|
import { createInterface } from "node:readline/promises";
|
|
@@ -2412,15 +2771,15 @@ async function confirmDestructive(prompt, requiredInput) {
|
|
|
2412
2771
|
}
|
|
2413
2772
|
|
|
2414
2773
|
// src/commands/account/delete.ts
|
|
2415
|
-
var inputSchema4 =
|
|
2416
|
-
yes:
|
|
2774
|
+
var inputSchema4 = z5.object({
|
|
2775
|
+
yes: z5.boolean().optional().default(false).describe("Skip confirmation prompt")
|
|
2417
2776
|
});
|
|
2418
2777
|
var accountDelete = {
|
|
2419
2778
|
name: "account.delete",
|
|
2420
2779
|
group: "account",
|
|
2421
2780
|
description: "Delete your own account",
|
|
2422
2781
|
inputSchema: inputSchema4,
|
|
2423
|
-
outputSchema:
|
|
2782
|
+
outputSchema: z5.any(),
|
|
2424
2783
|
annotations: { destructiveHint: true },
|
|
2425
2784
|
async execute(input, ctx) {
|
|
2426
2785
|
if (!input.yes) {
|
|
@@ -2439,17 +2798,17 @@ var accountDelete = {
|
|
|
2439
2798
|
};
|
|
2440
2799
|
|
|
2441
2800
|
// src/commands/account/delete-legal-doc.ts
|
|
2442
|
-
import { z as
|
|
2443
|
-
var inputSchema5 =
|
|
2444
|
-
versionId:
|
|
2445
|
-
yes:
|
|
2801
|
+
import { z as z6 } from "zod";
|
|
2802
|
+
var inputSchema5 = z6.object({
|
|
2803
|
+
versionId: z6.string().describe("Legal document version ID"),
|
|
2804
|
+
yes: z6.boolean().optional().default(false).describe("Skip confirmation prompt")
|
|
2446
2805
|
});
|
|
2447
2806
|
var accountDeleteLegalDoc = {
|
|
2448
2807
|
name: "account.deleteLegalDoc",
|
|
2449
2808
|
group: "account",
|
|
2450
2809
|
description: "Delete a legal document version (SystemAdmin only)",
|
|
2451
2810
|
inputSchema: inputSchema5,
|
|
2452
|
-
outputSchema:
|
|
2811
|
+
outputSchema: z6.any(),
|
|
2453
2812
|
annotations: { destructiveHint: true },
|
|
2454
2813
|
async execute(input, ctx) {
|
|
2455
2814
|
if (!input.yes) {
|
|
@@ -2472,16 +2831,16 @@ var accountDeleteLegalDoc = {
|
|
|
2472
2831
|
};
|
|
2473
2832
|
|
|
2474
2833
|
// src/commands/account/get.ts
|
|
2475
|
-
import { z as
|
|
2476
|
-
var inputSchema6 =
|
|
2477
|
-
userId:
|
|
2834
|
+
import { z as z7 } from "zod";
|
|
2835
|
+
var inputSchema6 = z7.object({
|
|
2836
|
+
userId: z7.string().describe("User ID")
|
|
2478
2837
|
});
|
|
2479
2838
|
var accountGet = {
|
|
2480
2839
|
name: "account.get",
|
|
2481
2840
|
group: "account",
|
|
2482
2841
|
description: "Get account details for a user",
|
|
2483
2842
|
inputSchema: inputSchema6,
|
|
2484
|
-
outputSchema:
|
|
2843
|
+
outputSchema: z7.any(),
|
|
2485
2844
|
annotations: { readOnlyHint: true },
|
|
2486
2845
|
async execute(input, ctx) {
|
|
2487
2846
|
return ctx.client.get("account_user", {
|
|
@@ -2496,18 +2855,18 @@ var accountGet = {
|
|
|
2496
2855
|
|
|
2497
2856
|
// src/commands/account/update.ts
|
|
2498
2857
|
init_errors();
|
|
2499
|
-
import { z as
|
|
2500
|
-
var inputSchema7 =
|
|
2501
|
-
userId:
|
|
2502
|
-
firstName:
|
|
2503
|
-
lastName:
|
|
2858
|
+
import { z as z8 } from "zod";
|
|
2859
|
+
var inputSchema7 = z8.object({
|
|
2860
|
+
userId: z8.string().describe("User ID"),
|
|
2861
|
+
firstName: z8.string().optional().describe("First name"),
|
|
2862
|
+
lastName: z8.string().optional().describe("Last name")
|
|
2504
2863
|
});
|
|
2505
2864
|
var accountUpdate = {
|
|
2506
2865
|
name: "account.update",
|
|
2507
2866
|
group: "account",
|
|
2508
2867
|
description: "Update account details for a user",
|
|
2509
2868
|
inputSchema: inputSchema7,
|
|
2510
|
-
outputSchema:
|
|
2869
|
+
outputSchema: z8.any(),
|
|
2511
2870
|
async execute(input, ctx) {
|
|
2512
2871
|
const body = {};
|
|
2513
2872
|
if (input.firstName !== void 0) body.firstName = input.firstName;
|
|
@@ -2527,18 +2886,18 @@ var accountUpdate = {
|
|
|
2527
2886
|
|
|
2528
2887
|
// src/commands/account/update-legal-doc.ts
|
|
2529
2888
|
init_errors();
|
|
2530
|
-
import { z as
|
|
2531
|
-
var inputSchema8 =
|
|
2532
|
-
versionId:
|
|
2533
|
-
content:
|
|
2534
|
-
effectiveDate:
|
|
2889
|
+
import { z as z9 } from "zod";
|
|
2890
|
+
var inputSchema8 = z9.object({
|
|
2891
|
+
versionId: z9.string().describe("Legal document version ID"),
|
|
2892
|
+
content: z9.string().optional().describe("Updated content"),
|
|
2893
|
+
effectiveDate: z9.string().optional().describe("Updated effective date (ISO 8601)")
|
|
2535
2894
|
});
|
|
2536
2895
|
var accountUpdateLegalDoc = {
|
|
2537
2896
|
name: "account.updateLegalDoc",
|
|
2538
2897
|
group: "account",
|
|
2539
2898
|
description: "Update a legal document version (SystemAdmin only)",
|
|
2540
2899
|
inputSchema: inputSchema8,
|
|
2541
|
-
outputSchema:
|
|
2900
|
+
outputSchema: z9.any(),
|
|
2542
2901
|
async execute(input, ctx) {
|
|
2543
2902
|
const body = {};
|
|
2544
2903
|
if (input.content !== void 0) body.content = input.content;
|
|
@@ -2557,17 +2916,17 @@ var accountUpdateLegalDoc = {
|
|
|
2557
2916
|
};
|
|
2558
2917
|
|
|
2559
2918
|
// src/commands/account/users.ts
|
|
2560
|
-
import { z as
|
|
2561
|
-
var inputSchema9 =
|
|
2562
|
-
state:
|
|
2563
|
-
refCode:
|
|
2919
|
+
import { z as z10 } from "zod";
|
|
2920
|
+
var inputSchema9 = z10.object({
|
|
2921
|
+
state: z10.enum(["Active", "Pending", "Deleted"]).optional().describe("Filter by user state"),
|
|
2922
|
+
refCode: z10.string().optional().describe("Filter by referral code")
|
|
2564
2923
|
});
|
|
2565
2924
|
var accountUsers = {
|
|
2566
2925
|
name: "account.users",
|
|
2567
2926
|
group: "account",
|
|
2568
2927
|
description: "List all users (admin)",
|
|
2569
2928
|
inputSchema: inputSchema9,
|
|
2570
|
-
outputSchema:
|
|
2929
|
+
outputSchema: z10.any(),
|
|
2571
2930
|
annotations: { readOnlyHint: true },
|
|
2572
2931
|
async execute(input, ctx) {
|
|
2573
2932
|
const queryParams = {};
|
|
@@ -2599,17 +2958,17 @@ function registerAccountCommands() {
|
|
|
2599
2958
|
}
|
|
2600
2959
|
|
|
2601
2960
|
// src/commands/api-keys/create.ts
|
|
2602
|
-
import { z as
|
|
2603
|
-
var inputSchema10 =
|
|
2604
|
-
name:
|
|
2605
|
-
scopes:
|
|
2961
|
+
import { z as z11 } from "zod";
|
|
2962
|
+
var inputSchema10 = z11.object({
|
|
2963
|
+
name: z11.string().min(1).describe("API key name"),
|
|
2964
|
+
scopes: z11.string().optional().describe("Comma-separated list of scopes")
|
|
2606
2965
|
});
|
|
2607
2966
|
var keysCreate = {
|
|
2608
2967
|
name: "api-keys.create",
|
|
2609
2968
|
group: "api-keys",
|
|
2610
2969
|
description: "Create a new API key",
|
|
2611
2970
|
inputSchema: inputSchema10,
|
|
2612
|
-
outputSchema:
|
|
2971
|
+
outputSchema: z11.any(),
|
|
2613
2972
|
async execute(input, ctx) {
|
|
2614
2973
|
const parsedScopes = input.scopes ? input.scopes.split(",").map((s) => s.trim()).filter((s) => s.length > 0) : void 0;
|
|
2615
2974
|
return ctx.client.post("api_keys", { name: input.name, scopes: parsedScopes });
|
|
@@ -2621,14 +2980,14 @@ var keysCreate = {
|
|
|
2621
2980
|
};
|
|
2622
2981
|
|
|
2623
2982
|
// src/commands/api-keys/get-policy.ts
|
|
2624
|
-
import { z as
|
|
2625
|
-
var inputSchema11 =
|
|
2983
|
+
import { z as z12 } from "zod";
|
|
2984
|
+
var inputSchema11 = z12.object({});
|
|
2626
2985
|
var keysGetPolicy = {
|
|
2627
2986
|
name: "api-keys.getPolicy",
|
|
2628
2987
|
group: "api-keys",
|
|
2629
2988
|
description: "Get the API key creation policy",
|
|
2630
2989
|
inputSchema: inputSchema11,
|
|
2631
|
-
outputSchema:
|
|
2990
|
+
outputSchema: z12.any(),
|
|
2632
2991
|
annotations: { readOnlyHint: true },
|
|
2633
2992
|
async execute(_input, ctx) {
|
|
2634
2993
|
return ctx.client.get("api_key_policy");
|
|
@@ -2640,14 +2999,14 @@ var keysGetPolicy = {
|
|
|
2640
2999
|
};
|
|
2641
3000
|
|
|
2642
3001
|
// src/commands/api-keys/list.ts
|
|
2643
|
-
import { z as
|
|
2644
|
-
var inputSchema12 =
|
|
3002
|
+
import { z as z13 } from "zod";
|
|
3003
|
+
var inputSchema12 = z13.object({});
|
|
2645
3004
|
var keysList = {
|
|
2646
3005
|
name: "api-keys.list",
|
|
2647
3006
|
group: "api-keys",
|
|
2648
3007
|
description: "List all API keys",
|
|
2649
3008
|
inputSchema: inputSchema12,
|
|
2650
|
-
outputSchema:
|
|
3009
|
+
outputSchema: z13.any(),
|
|
2651
3010
|
annotations: { readOnlyHint: true },
|
|
2652
3011
|
async execute(_input, ctx) {
|
|
2653
3012
|
return ctx.client.get("api_keys");
|
|
@@ -2659,16 +3018,16 @@ var keysList = {
|
|
|
2659
3018
|
};
|
|
2660
3019
|
|
|
2661
3020
|
// src/commands/api-keys/revoke.ts
|
|
2662
|
-
import { z as
|
|
2663
|
-
var inputSchema13 =
|
|
2664
|
-
keyId:
|
|
3021
|
+
import { z as z14 } from "zod";
|
|
3022
|
+
var inputSchema13 = z14.object({
|
|
3023
|
+
keyId: z14.string().uuid().describe("API key ID to revoke")
|
|
2665
3024
|
});
|
|
2666
3025
|
var keysRevoke = {
|
|
2667
3026
|
name: "api-keys.revoke",
|
|
2668
3027
|
group: "api-keys",
|
|
2669
3028
|
description: "Revoke an API key",
|
|
2670
3029
|
inputSchema: inputSchema13,
|
|
2671
|
-
outputSchema:
|
|
3030
|
+
outputSchema: z14.any(),
|
|
2672
3031
|
annotations: { destructiveHint: true },
|
|
2673
3032
|
async execute(input, ctx) {
|
|
2674
3033
|
await ctx.client.del("api_key", {
|
|
@@ -2683,16 +3042,16 @@ var keysRevoke = {
|
|
|
2683
3042
|
};
|
|
2684
3043
|
|
|
2685
3044
|
// src/commands/api-keys/set-policy.ts
|
|
2686
|
-
import { z as
|
|
2687
|
-
var inputSchema14 =
|
|
2688
|
-
policy:
|
|
3045
|
+
import { z as z15 } from "zod";
|
|
3046
|
+
var inputSchema14 = z15.object({
|
|
3047
|
+
policy: z15.enum(["all_members", "admins_only"]).describe("API key creation policy")
|
|
2689
3048
|
});
|
|
2690
3049
|
var keysSetPolicy = {
|
|
2691
3050
|
name: "api-keys.setPolicy",
|
|
2692
3051
|
group: "api-keys",
|
|
2693
3052
|
description: "Set the API key creation policy",
|
|
2694
3053
|
inputSchema: inputSchema14,
|
|
2695
|
-
outputSchema:
|
|
3054
|
+
outputSchema: z15.any(),
|
|
2696
3055
|
async execute(input, ctx) {
|
|
2697
3056
|
return ctx.client.put("api_key_policy", { policy: input.policy });
|
|
2698
3057
|
},
|
|
@@ -2708,28 +3067,28 @@ function registerApiKeyCommands() {
|
|
|
2708
3067
|
}
|
|
2709
3068
|
|
|
2710
3069
|
// src/commands/audit/list.ts
|
|
2711
|
-
import { z as
|
|
3070
|
+
import { z as z17 } from "zod";
|
|
2712
3071
|
|
|
2713
3072
|
// src/commands/_shared/pagination.ts
|
|
2714
|
-
import { z as
|
|
3073
|
+
import { z as z16 } from "zod";
|
|
2715
3074
|
var paginationInput = {
|
|
2716
|
-
page:
|
|
2717
|
-
pageSize:
|
|
3075
|
+
page: z16.number().int().min(1).default(1).describe("Page number"),
|
|
3076
|
+
pageSize: z16.number().int().min(1).max(100).default(25).describe("Results per page")
|
|
2718
3077
|
};
|
|
2719
3078
|
|
|
2720
3079
|
// src/commands/audit/list.ts
|
|
2721
|
-
var inputSchema15 =
|
|
2722
|
-
orgId:
|
|
3080
|
+
var inputSchema15 = z17.object({
|
|
3081
|
+
orgId: z17.string().uuid().describe("Organization ID"),
|
|
2723
3082
|
...paginationInput,
|
|
2724
|
-
action:
|
|
2725
|
-
userId:
|
|
3083
|
+
action: z17.string().optional().describe("Filter by action type"),
|
|
3084
|
+
userId: z17.string().optional().describe("Filter by user ID")
|
|
2726
3085
|
});
|
|
2727
3086
|
var auditList = {
|
|
2728
3087
|
name: "audit.list",
|
|
2729
3088
|
group: "audit",
|
|
2730
3089
|
description: "List audit log entries for an organization",
|
|
2731
3090
|
inputSchema: inputSchema15,
|
|
2732
|
-
outputSchema:
|
|
3091
|
+
outputSchema: z17.any(),
|
|
2733
3092
|
annotations: { readOnlyHint: true },
|
|
2734
3093
|
async execute(input, ctx) {
|
|
2735
3094
|
const queryParams = {
|
|
@@ -2758,7 +3117,7 @@ function registerAuditCommands() {
|
|
|
2758
3117
|
init_client();
|
|
2759
3118
|
init_errors();
|
|
2760
3119
|
init_profiles();
|
|
2761
|
-
import { z as
|
|
3120
|
+
import { z as z18 } from "zod";
|
|
2762
3121
|
|
|
2763
3122
|
// src/lib/prompt.ts
|
|
2764
3123
|
import { createInterface as createInterface2 } from "node:readline";
|
|
@@ -2821,21 +3180,48 @@ function promptSecret(message) {
|
|
|
2821
3180
|
}
|
|
2822
3181
|
|
|
2823
3182
|
// src/commands/auth/login.ts
|
|
2824
|
-
var inputSchema16 =
|
|
2825
|
-
apiKey:
|
|
2826
|
-
|
|
3183
|
+
var inputSchema16 = z18.object({
|
|
3184
|
+
apiKey: z18.string().optional().describe("Elnora API key (elnora_live_...)"),
|
|
3185
|
+
apiKeyStdin: z18.boolean().default(false).describe("Read the API key from stdin instead of an argument"),
|
|
3186
|
+
profile: z18.string().default("default").describe("Profile name to save key under")
|
|
2827
3187
|
});
|
|
2828
3188
|
var authLogin = {
|
|
2829
3189
|
name: "auth.login",
|
|
2830
3190
|
group: "auth",
|
|
2831
3191
|
description: "Set up authentication by saving an API key to a profile",
|
|
2832
3192
|
inputSchema: inputSchema16,
|
|
2833
|
-
outputSchema:
|
|
3193
|
+
outputSchema: z18.any(),
|
|
2834
3194
|
annotations: { exposeInMcp: false },
|
|
2835
3195
|
async execute(input, _ctx) {
|
|
2836
3196
|
let apiKey = input.apiKey;
|
|
2837
3197
|
const profileName = input.profile;
|
|
2838
3198
|
validateProfileName(profileName);
|
|
3199
|
+
if (input.apiKeyStdin && apiKey) {
|
|
3200
|
+
throw new ValidationError(
|
|
3201
|
+
"Cannot use --api-key and --api-key-stdin together. Choose one.",
|
|
3202
|
+
'Pipe the key: printf %s "$ELNORA_API_KEY" | elnora auth login --api-key-stdin'
|
|
3203
|
+
);
|
|
3204
|
+
}
|
|
3205
|
+
if (input.apiKeyStdin) {
|
|
3206
|
+
if (process.stdin.isTTY) {
|
|
3207
|
+
throw new ValidationError(
|
|
3208
|
+
"--api-key-stdin requires the key on stdin, but stdin is a terminal.",
|
|
3209
|
+
'Example: printf %s "$ELNORA_API_KEY" | elnora auth login --api-key-stdin'
|
|
3210
|
+
);
|
|
3211
|
+
}
|
|
3212
|
+
const piped = (await readStdin()).trim();
|
|
3213
|
+
if (!piped) {
|
|
3214
|
+
throw new ValidationError(
|
|
3215
|
+
"No API key received on stdin.",
|
|
3216
|
+
'Pipe a key: printf %s "$ELNORA_API_KEY" | elnora auth login --api-key-stdin'
|
|
3217
|
+
);
|
|
3218
|
+
}
|
|
3219
|
+
apiKey = piped;
|
|
3220
|
+
}
|
|
3221
|
+
if (!apiKey) {
|
|
3222
|
+
const envKey = process.env.ELNORA_API_KEY ?? process.env.ELNORA_MCP_API_KEY;
|
|
3223
|
+
if (envKey) apiKey = envKey;
|
|
3224
|
+
}
|
|
2839
3225
|
const existing = listProfileNames();
|
|
2840
3226
|
const profileExists = existing.includes(profileName);
|
|
2841
3227
|
if (!apiKey) {
|
|
@@ -2888,7 +3274,7 @@ var authLogin = {
|
|
|
2888
3274
|
}
|
|
2889
3275
|
if (!apiKey) {
|
|
2890
3276
|
throw new ValidationError(
|
|
2891
|
-
"API key is required.
|
|
3277
|
+
"API key is required. Pass --api-key, pipe it with --api-key-stdin, set ELNORA_API_KEY, or run interactively in a terminal.",
|
|
2892
3278
|
"Get your API key from: https://platform.elnora.ai > Settings > API Keys"
|
|
2893
3279
|
);
|
|
2894
3280
|
}
|
|
@@ -2919,6 +3305,10 @@ var authLogin = {
|
|
|
2919
3305
|
process.stderr.write(` Saved to profile "${profileName}" at ${configPath}
|
|
2920
3306
|
|
|
2921
3307
|
`);
|
|
3308
|
+
process.stderr.write(" Next steps:\n");
|
|
3309
|
+
process.stderr.write(" elnora projects list See your projects\n");
|
|
3310
|
+
process.stderr.write(" elnora tasks create --project <ID> --stream Start a conversation\n");
|
|
3311
|
+
process.stderr.write(" elnora doctor Verify your setup\n\n");
|
|
2922
3312
|
}
|
|
2923
3313
|
return { profile: profileName, verified: true, configPath };
|
|
2924
3314
|
} catch (err) {
|
|
@@ -2936,31 +3326,23 @@ var authLogin = {
|
|
|
2936
3326
|
formatOutput(output, format) {
|
|
2937
3327
|
const data = output;
|
|
2938
3328
|
if (format === "compact") return data.profile ?? JSON.stringify(output);
|
|
2939
|
-
|
|
2940
|
-
`\u2713 Authenticated! API key saved to profile "${data.profile}".`,
|
|
2941
|
-
"",
|
|
2942
|
-
"Next steps:",
|
|
2943
|
-
" elnora projects list See your projects",
|
|
2944
|
-
" elnora tasks create --project <ID> --stream Start a conversation",
|
|
2945
|
-
" elnora doctor Verify your setup"
|
|
2946
|
-
];
|
|
2947
|
-
return lines.join("\n");
|
|
3329
|
+
return JSON.stringify(output, null, 2);
|
|
2948
3330
|
}
|
|
2949
3331
|
};
|
|
2950
3332
|
|
|
2951
3333
|
// src/commands/auth/logout.ts
|
|
2952
3334
|
init_profiles();
|
|
2953
|
-
import { z as
|
|
2954
|
-
var inputSchema17 =
|
|
2955
|
-
profile:
|
|
2956
|
-
all:
|
|
3335
|
+
import { z as z19 } from "zod";
|
|
3336
|
+
var inputSchema17 = z19.object({
|
|
3337
|
+
profile: z19.string().optional().describe("Profile name to remove (default: 'default')"),
|
|
3338
|
+
all: z19.boolean().default(false).describe("Remove all profiles")
|
|
2957
3339
|
});
|
|
2958
3340
|
var authLogout = {
|
|
2959
3341
|
name: "auth.logout",
|
|
2960
3342
|
group: "auth",
|
|
2961
3343
|
description: "Remove saved credentials",
|
|
2962
3344
|
inputSchema: inputSchema17,
|
|
2963
|
-
outputSchema:
|
|
3345
|
+
outputSchema: z19.any(),
|
|
2964
3346
|
annotations: { destructiveHint: true, exposeInMcp: false },
|
|
2965
3347
|
async execute(input, _ctx) {
|
|
2966
3348
|
if (input.all) {
|
|
@@ -2982,14 +3364,14 @@ var authLogout = {
|
|
|
2982
3364
|
|
|
2983
3365
|
// src/commands/auth/profiles.ts
|
|
2984
3366
|
init_profiles();
|
|
2985
|
-
import { z as
|
|
2986
|
-
var inputSchema18 =
|
|
3367
|
+
import { z as z20 } from "zod";
|
|
3368
|
+
var inputSchema18 = z20.object({});
|
|
2987
3369
|
var authProfiles = {
|
|
2988
3370
|
name: "auth.profiles",
|
|
2989
3371
|
group: "auth",
|
|
2990
3372
|
description: "List all configured profiles",
|
|
2991
3373
|
inputSchema: inputSchema18,
|
|
2992
|
-
outputSchema:
|
|
3374
|
+
outputSchema: z20.any(),
|
|
2993
3375
|
annotations: { readOnlyHint: true, exposeInMcp: false },
|
|
2994
3376
|
async execute(_input, _ctx) {
|
|
2995
3377
|
const profiles = loadProfiles();
|
|
@@ -3011,14 +3393,14 @@ var authProfiles = {
|
|
|
3011
3393
|
};
|
|
3012
3394
|
|
|
3013
3395
|
// src/commands/auth/status.ts
|
|
3014
|
-
import { z as
|
|
3015
|
-
var inputSchema19 =
|
|
3396
|
+
import { z as z21 } from "zod";
|
|
3397
|
+
var inputSchema19 = z21.object({});
|
|
3016
3398
|
var authStatus = {
|
|
3017
3399
|
name: "auth.status",
|
|
3018
3400
|
group: "auth",
|
|
3019
3401
|
description: "Verify API key and show connection info",
|
|
3020
3402
|
inputSchema: inputSchema19,
|
|
3021
|
-
outputSchema:
|
|
3403
|
+
outputSchema: z21.any(),
|
|
3022
3404
|
annotations: { readOnlyHint: true, exposeInMcp: false },
|
|
3023
3405
|
async execute(_input, ctx) {
|
|
3024
3406
|
const result = await ctx.client.get("projects", {
|
|
@@ -3035,16 +3417,16 @@ var authStatus = {
|
|
|
3035
3417
|
|
|
3036
3418
|
// src/commands/auth/validate.ts
|
|
3037
3419
|
init_profiles();
|
|
3038
|
-
import { z as
|
|
3039
|
-
var inputSchema20 =
|
|
3040
|
-
token:
|
|
3420
|
+
import { z as z22 } from "zod";
|
|
3421
|
+
var inputSchema20 = z22.object({
|
|
3422
|
+
token: z22.string().optional().describe("Token to validate (defaults to current API key)")
|
|
3041
3423
|
});
|
|
3042
3424
|
var authValidate = {
|
|
3043
3425
|
name: "auth.validate",
|
|
3044
3426
|
group: "auth",
|
|
3045
3427
|
description: "Validate a JWT or API key token",
|
|
3046
3428
|
inputSchema: inputSchema20,
|
|
3047
|
-
outputSchema:
|
|
3429
|
+
outputSchema: z22.any(),
|
|
3048
3430
|
annotations: { exposeInMcp: false },
|
|
3049
3431
|
async execute(input, ctx) {
|
|
3050
3432
|
const tokenToValidate = input.token ?? resolveApiKey();
|
|
@@ -3062,17 +3444,18 @@ function registerAuthCommands() {
|
|
|
3062
3444
|
}
|
|
3063
3445
|
|
|
3064
3446
|
// src/commands/feedback/submit.ts
|
|
3065
|
-
import { z as
|
|
3066
|
-
var inputSchema21 =
|
|
3067
|
-
title:
|
|
3068
|
-
description:
|
|
3447
|
+
import { z as z23 } from "zod";
|
|
3448
|
+
var inputSchema21 = z23.object({
|
|
3449
|
+
title: z23.string().min(1).describe("Feedback title"),
|
|
3450
|
+
description: z23.string().min(1).describe("Feedback description")
|
|
3069
3451
|
});
|
|
3070
3452
|
var feedbackSubmit = {
|
|
3071
3453
|
name: "feedback.submit",
|
|
3072
3454
|
group: "feedback",
|
|
3073
3455
|
description: "Submit feedback",
|
|
3456
|
+
stdinField: "description",
|
|
3074
3457
|
inputSchema: inputSchema21,
|
|
3075
|
-
outputSchema:
|
|
3458
|
+
outputSchema: z23.any(),
|
|
3076
3459
|
async execute(input, ctx) {
|
|
3077
3460
|
return ctx.client.post("feedback", {
|
|
3078
3461
|
title: input.title,
|
|
@@ -3091,16 +3474,16 @@ function registerFeedbackCommands() {
|
|
|
3091
3474
|
}
|
|
3092
3475
|
|
|
3093
3476
|
// src/commands/files/archive.ts
|
|
3094
|
-
import { z as
|
|
3095
|
-
var inputSchema22 =
|
|
3096
|
-
fileId:
|
|
3477
|
+
import { z as z24 } from "zod";
|
|
3478
|
+
var inputSchema22 = z24.object({
|
|
3479
|
+
fileId: z24.string().uuid().describe("File ID to archive")
|
|
3097
3480
|
});
|
|
3098
3481
|
var filesArchive = {
|
|
3099
3482
|
name: "files.archive",
|
|
3100
3483
|
group: "files",
|
|
3101
3484
|
description: "Archive (delete) a file",
|
|
3102
3485
|
inputSchema: inputSchema22,
|
|
3103
|
-
outputSchema:
|
|
3486
|
+
outputSchema: z24.any(),
|
|
3104
3487
|
annotations: { destructiveHint: true },
|
|
3105
3488
|
async execute(input, ctx) {
|
|
3106
3489
|
await ctx.client.del("file", {
|
|
@@ -3115,16 +3498,16 @@ var filesArchive = {
|
|
|
3115
3498
|
};
|
|
3116
3499
|
|
|
3117
3500
|
// src/commands/files/commit.ts
|
|
3118
|
-
import { z as
|
|
3119
|
-
var inputSchema23 =
|
|
3120
|
-
fileId:
|
|
3501
|
+
import { z as z25 } from "zod";
|
|
3502
|
+
var inputSchema23 = z25.object({
|
|
3503
|
+
fileId: z25.string().uuid().describe("File ID to commit")
|
|
3121
3504
|
});
|
|
3122
3505
|
var filesCommit = {
|
|
3123
3506
|
name: "files.commit",
|
|
3124
3507
|
group: "files",
|
|
3125
3508
|
description: "Commit a file's working copy",
|
|
3126
3509
|
inputSchema: inputSchema23,
|
|
3127
|
-
outputSchema:
|
|
3510
|
+
outputSchema: z25.any(),
|
|
3128
3511
|
async execute(input, ctx) {
|
|
3129
3512
|
return ctx.client.post("file_commit", void 0, {
|
|
3130
3513
|
pathParams: { id: input.fileId }
|
|
@@ -3137,16 +3520,16 @@ var filesCommit = {
|
|
|
3137
3520
|
};
|
|
3138
3521
|
|
|
3139
3522
|
// src/commands/files/confirm-upload.ts
|
|
3140
|
-
import { z as
|
|
3141
|
-
var inputSchema24 =
|
|
3142
|
-
fileId:
|
|
3523
|
+
import { z as z26 } from "zod";
|
|
3524
|
+
var inputSchema24 = z26.object({
|
|
3525
|
+
fileId: z26.string().uuid().describe("File ID to confirm upload")
|
|
3143
3526
|
});
|
|
3144
3527
|
var filesConfirmUpload = {
|
|
3145
3528
|
name: "files.confirmUpload",
|
|
3146
3529
|
group: "files",
|
|
3147
3530
|
description: "Confirm a file upload",
|
|
3148
3531
|
inputSchema: inputSchema24,
|
|
3149
|
-
outputSchema:
|
|
3532
|
+
outputSchema: z26.any(),
|
|
3150
3533
|
async execute(input, ctx) {
|
|
3151
3534
|
return ctx.client.post("file_upload_confirm", void 0, {
|
|
3152
3535
|
pathParams: { id: input.fileId }
|
|
@@ -3159,16 +3542,16 @@ var filesConfirmUpload = {
|
|
|
3159
3542
|
};
|
|
3160
3543
|
|
|
3161
3544
|
// src/commands/files/content.ts
|
|
3162
|
-
import { z as
|
|
3163
|
-
var inputSchema25 =
|
|
3164
|
-
fileId:
|
|
3545
|
+
import { z as z27 } from "zod";
|
|
3546
|
+
var inputSchema25 = z27.object({
|
|
3547
|
+
fileId: z27.string().uuid().describe("File ID")
|
|
3165
3548
|
});
|
|
3166
3549
|
var filesContent = {
|
|
3167
3550
|
name: "files.content",
|
|
3168
3551
|
group: "files",
|
|
3169
3552
|
description: "Get the raw content of a file",
|
|
3170
3553
|
inputSchema: inputSchema25,
|
|
3171
|
-
outputSchema:
|
|
3554
|
+
outputSchema: z27.any(),
|
|
3172
3555
|
annotations: { readOnlyHint: true },
|
|
3173
3556
|
async execute(input, ctx) {
|
|
3174
3557
|
return ctx.client.get("file_content", {
|
|
@@ -3182,19 +3565,19 @@ var filesContent = {
|
|
|
3182
3565
|
};
|
|
3183
3566
|
|
|
3184
3567
|
// src/commands/files/create.ts
|
|
3185
|
-
import { z as
|
|
3186
|
-
var inputSchema26 =
|
|
3187
|
-
project:
|
|
3188
|
-
name:
|
|
3189
|
-
type:
|
|
3190
|
-
folder:
|
|
3568
|
+
import { z as z28 } from "zod";
|
|
3569
|
+
var inputSchema26 = z28.object({
|
|
3570
|
+
project: z28.string().uuid().describe("Project ID"),
|
|
3571
|
+
name: z28.string().min(1).describe("File name"),
|
|
3572
|
+
type: z28.string().min(1).describe("File type"),
|
|
3573
|
+
folder: z28.string().uuid().optional().describe("Folder ID")
|
|
3191
3574
|
});
|
|
3192
3575
|
var filesCreate = {
|
|
3193
3576
|
name: "files.create",
|
|
3194
3577
|
group: "files",
|
|
3195
3578
|
description: "Create a new file",
|
|
3196
3579
|
inputSchema: inputSchema26,
|
|
3197
|
-
outputSchema:
|
|
3580
|
+
outputSchema: z28.any(),
|
|
3198
3581
|
async execute(input, ctx) {
|
|
3199
3582
|
return ctx.client.post("files", {
|
|
3200
3583
|
projectId: input.project,
|
|
@@ -3210,17 +3593,18 @@ var filesCreate = {
|
|
|
3210
3593
|
};
|
|
3211
3594
|
|
|
3212
3595
|
// src/commands/files/create-version.ts
|
|
3213
|
-
import { z as
|
|
3214
|
-
var inputSchema27 =
|
|
3215
|
-
fileId:
|
|
3216
|
-
content:
|
|
3596
|
+
import { z as z29 } from "zod";
|
|
3597
|
+
var inputSchema27 = z29.object({
|
|
3598
|
+
fileId: z29.string().uuid().describe("File ID"),
|
|
3599
|
+
content: z29.string().optional().describe("Version content")
|
|
3217
3600
|
});
|
|
3218
3601
|
var filesCreateVersion = {
|
|
3219
3602
|
name: "files.createVersion",
|
|
3220
3603
|
group: "files",
|
|
3221
3604
|
description: "Create a new version of a file",
|
|
3605
|
+
stdinField: "content",
|
|
3222
3606
|
inputSchema: inputSchema27,
|
|
3223
|
-
outputSchema:
|
|
3607
|
+
outputSchema: z29.any(),
|
|
3224
3608
|
async execute(input, ctx) {
|
|
3225
3609
|
const body = {};
|
|
3226
3610
|
if (input.content !== void 0) body.content = input.content;
|
|
@@ -3235,16 +3619,16 @@ var filesCreateVersion = {
|
|
|
3235
3619
|
};
|
|
3236
3620
|
|
|
3237
3621
|
// src/commands/files/download.ts
|
|
3238
|
-
import { z as
|
|
3239
|
-
var inputSchema28 =
|
|
3240
|
-
fileId:
|
|
3622
|
+
import { z as z30 } from "zod";
|
|
3623
|
+
var inputSchema28 = z30.object({
|
|
3624
|
+
fileId: z30.string().uuid().describe("File ID to download")
|
|
3241
3625
|
});
|
|
3242
3626
|
var filesDownload = {
|
|
3243
3627
|
name: "files.download",
|
|
3244
3628
|
group: "files",
|
|
3245
3629
|
description: "Download a file",
|
|
3246
3630
|
inputSchema: inputSchema28,
|
|
3247
|
-
outputSchema:
|
|
3631
|
+
outputSchema: z30.any(),
|
|
3248
3632
|
annotations: { readOnlyHint: true },
|
|
3249
3633
|
async execute(input, ctx) {
|
|
3250
3634
|
return ctx.client.get("file_download", {
|
|
@@ -3258,17 +3642,17 @@ var filesDownload = {
|
|
|
3258
3642
|
};
|
|
3259
3643
|
|
|
3260
3644
|
// src/commands/files/fork.ts
|
|
3261
|
-
import { z as
|
|
3262
|
-
var inputSchema29 =
|
|
3263
|
-
fileId:
|
|
3264
|
-
targetProject:
|
|
3645
|
+
import { z as z31 } from "zod";
|
|
3646
|
+
var inputSchema29 = z31.object({
|
|
3647
|
+
fileId: z31.string().uuid().describe("File ID to fork"),
|
|
3648
|
+
targetProject: z31.string().uuid().describe("Target project ID")
|
|
3265
3649
|
});
|
|
3266
3650
|
var filesFork = {
|
|
3267
3651
|
name: "files.fork",
|
|
3268
3652
|
group: "files",
|
|
3269
3653
|
description: "Fork a file to another project",
|
|
3270
3654
|
inputSchema: inputSchema29,
|
|
3271
|
-
outputSchema:
|
|
3655
|
+
outputSchema: z31.any(),
|
|
3272
3656
|
async execute(input, ctx) {
|
|
3273
3657
|
return ctx.client.post(
|
|
3274
3658
|
"file_fork",
|
|
@@ -3285,16 +3669,16 @@ var filesFork = {
|
|
|
3285
3669
|
};
|
|
3286
3670
|
|
|
3287
3671
|
// src/commands/files/get.ts
|
|
3288
|
-
import { z as
|
|
3289
|
-
var inputSchema30 =
|
|
3290
|
-
fileId:
|
|
3672
|
+
import { z as z32 } from "zod";
|
|
3673
|
+
var inputSchema30 = z32.object({
|
|
3674
|
+
fileId: z32.string().uuid().describe("File ID")
|
|
3291
3675
|
});
|
|
3292
3676
|
var filesGet = {
|
|
3293
3677
|
name: "files.get",
|
|
3294
3678
|
group: "files",
|
|
3295
3679
|
description: "Get details of a specific file",
|
|
3296
3680
|
inputSchema: inputSchema30,
|
|
3297
|
-
outputSchema:
|
|
3681
|
+
outputSchema: z32.any(),
|
|
3298
3682
|
annotations: { readOnlyHint: true },
|
|
3299
3683
|
async execute(input, ctx) {
|
|
3300
3684
|
return ctx.client.get("file", {
|
|
@@ -3308,9 +3692,9 @@ var filesGet = {
|
|
|
3308
3692
|
};
|
|
3309
3693
|
|
|
3310
3694
|
// src/commands/files/list.ts
|
|
3311
|
-
import { z as
|
|
3312
|
-
var inputSchema31 =
|
|
3313
|
-
project:
|
|
3695
|
+
import { z as z33 } from "zod";
|
|
3696
|
+
var inputSchema31 = z33.object({
|
|
3697
|
+
project: z33.string().uuid().describe("Project ID"),
|
|
3314
3698
|
...paginationInput
|
|
3315
3699
|
});
|
|
3316
3700
|
var filesList = {
|
|
@@ -3318,7 +3702,7 @@ var filesList = {
|
|
|
3318
3702
|
group: "files",
|
|
3319
3703
|
description: "List files in a project",
|
|
3320
3704
|
inputSchema: inputSchema31,
|
|
3321
|
-
outputSchema:
|
|
3705
|
+
outputSchema: z33.any(),
|
|
3322
3706
|
annotations: { readOnlyHint: true },
|
|
3323
3707
|
async execute(input, ctx) {
|
|
3324
3708
|
return ctx.client.get("project_files", {
|
|
@@ -3333,17 +3717,17 @@ var filesList = {
|
|
|
3333
3717
|
};
|
|
3334
3718
|
|
|
3335
3719
|
// src/commands/files/promote.ts
|
|
3336
|
-
import { z as
|
|
3337
|
-
var inputSchema32 =
|
|
3338
|
-
fileId:
|
|
3339
|
-
visibility:
|
|
3720
|
+
import { z as z34 } from "zod";
|
|
3721
|
+
var inputSchema32 = z34.object({
|
|
3722
|
+
fileId: z34.string().uuid().describe("File ID"),
|
|
3723
|
+
visibility: z34.string().min(1).describe("Visibility level")
|
|
3340
3724
|
});
|
|
3341
3725
|
var filesPromote = {
|
|
3342
3726
|
name: "files.promote",
|
|
3343
3727
|
group: "files",
|
|
3344
3728
|
description: "Promote a file to a new visibility level",
|
|
3345
3729
|
inputSchema: inputSchema32,
|
|
3346
|
-
outputSchema:
|
|
3730
|
+
outputSchema: z34.any(),
|
|
3347
3731
|
async execute(input, ctx) {
|
|
3348
3732
|
return ctx.client.post(
|
|
3349
3733
|
"file_promote",
|
|
@@ -3360,17 +3744,17 @@ var filesPromote = {
|
|
|
3360
3744
|
};
|
|
3361
3745
|
|
|
3362
3746
|
// src/commands/files/restore.ts
|
|
3363
|
-
import { z as
|
|
3364
|
-
var inputSchema33 =
|
|
3365
|
-
fileId:
|
|
3366
|
-
versionId:
|
|
3747
|
+
import { z as z35 } from "zod";
|
|
3748
|
+
var inputSchema33 = z35.object({
|
|
3749
|
+
fileId: z35.string().uuid().describe("File ID"),
|
|
3750
|
+
versionId: z35.string().uuid().describe("Version ID to restore")
|
|
3367
3751
|
});
|
|
3368
3752
|
var filesRestore = {
|
|
3369
3753
|
name: "files.restore",
|
|
3370
3754
|
group: "files",
|
|
3371
3755
|
description: "Restore a file to a specific version",
|
|
3372
3756
|
inputSchema: inputSchema33,
|
|
3373
|
-
outputSchema:
|
|
3757
|
+
outputSchema: z35.any(),
|
|
3374
3758
|
async execute(input, ctx) {
|
|
3375
3759
|
return ctx.client.post("file_version_restore", void 0, {
|
|
3376
3760
|
pathParams: { id: input.fileId, vid: input.versionId }
|
|
@@ -3383,10 +3767,10 @@ var filesRestore = {
|
|
|
3383
3767
|
};
|
|
3384
3768
|
|
|
3385
3769
|
// src/commands/files/search-content.ts
|
|
3386
|
-
import { z as
|
|
3387
|
-
var inputSchema34 =
|
|
3388
|
-
query:
|
|
3389
|
-
project:
|
|
3770
|
+
import { z as z36 } from "zod";
|
|
3771
|
+
var inputSchema34 = z36.object({
|
|
3772
|
+
query: z36.string().min(1).describe("Search query"),
|
|
3773
|
+
project: z36.string().uuid().optional().describe("Project ID to scope search"),
|
|
3390
3774
|
...paginationInput
|
|
3391
3775
|
});
|
|
3392
3776
|
var filesSearchContent = {
|
|
@@ -3394,7 +3778,7 @@ var filesSearchContent = {
|
|
|
3394
3778
|
group: "files",
|
|
3395
3779
|
description: "Search file content across projects",
|
|
3396
3780
|
inputSchema: inputSchema34,
|
|
3397
|
-
outputSchema:
|
|
3781
|
+
outputSchema: z36.any(),
|
|
3398
3782
|
annotations: { readOnlyHint: true },
|
|
3399
3783
|
async execute(input, ctx) {
|
|
3400
3784
|
const queryParams = {
|
|
@@ -3413,18 +3797,18 @@ var filesSearchContent = {
|
|
|
3413
3797
|
|
|
3414
3798
|
// src/commands/files/update.ts
|
|
3415
3799
|
init_errors();
|
|
3416
|
-
import { z as
|
|
3417
|
-
var inputSchema35 =
|
|
3418
|
-
fileId:
|
|
3419
|
-
name:
|
|
3420
|
-
folder:
|
|
3800
|
+
import { z as z37 } from "zod";
|
|
3801
|
+
var inputSchema35 = z37.object({
|
|
3802
|
+
fileId: z37.string().uuid().describe("File ID"),
|
|
3803
|
+
name: z37.string().min(1).optional().describe("New file name"),
|
|
3804
|
+
folder: z37.string().uuid().optional().describe("New folder ID")
|
|
3421
3805
|
});
|
|
3422
3806
|
var filesUpdate = {
|
|
3423
3807
|
name: "files.update",
|
|
3424
3808
|
group: "files",
|
|
3425
3809
|
description: "Update a file's metadata",
|
|
3426
3810
|
inputSchema: inputSchema35,
|
|
3427
|
-
outputSchema:
|
|
3811
|
+
outputSchema: z37.any(),
|
|
3428
3812
|
annotations: { idempotentHint: true },
|
|
3429
3813
|
async execute(input, ctx) {
|
|
3430
3814
|
const { fileId, ...fields } = input;
|
|
@@ -3449,26 +3833,26 @@ var filesUpdate = {
|
|
|
3449
3833
|
|
|
3450
3834
|
// src/commands/files/upload.ts
|
|
3451
3835
|
init_client();
|
|
3452
|
-
import { readFileSync as readFileSync6, statSync as
|
|
3836
|
+
import { readFileSync as readFileSync6, statSync as statSync3 } from "node:fs";
|
|
3453
3837
|
import { basename } from "node:path";
|
|
3454
|
-
import { z as
|
|
3455
|
-
var inputSchema36 =
|
|
3456
|
-
project:
|
|
3457
|
-
filePath:
|
|
3458
|
-
fileName:
|
|
3459
|
-
contentType:
|
|
3838
|
+
import { z as z38 } from "zod";
|
|
3839
|
+
var inputSchema36 = z38.object({
|
|
3840
|
+
project: z38.string().uuid().describe("Project ID"),
|
|
3841
|
+
filePath: z38.string().min(1).describe("Local file path to upload"),
|
|
3842
|
+
fileName: z38.string().optional().describe("Override file name"),
|
|
3843
|
+
contentType: z38.string().optional().describe("MIME content type")
|
|
3460
3844
|
});
|
|
3461
3845
|
var filesUpload = {
|
|
3462
3846
|
name: "files.upload",
|
|
3463
3847
|
group: "files",
|
|
3464
3848
|
description: "Upload a file to a project (three-stage: presign, PUT, confirm)",
|
|
3465
3849
|
inputSchema: inputSchema36,
|
|
3466
|
-
outputSchema:
|
|
3850
|
+
outputSchema: z38.any(),
|
|
3467
3851
|
async execute(input, ctx) {
|
|
3468
3852
|
const fileBuffer = readFileSync6(input.filePath);
|
|
3469
3853
|
const fileName = input.fileName ?? basename(input.filePath);
|
|
3470
3854
|
const contentType = input.contentType ?? "application/octet-stream";
|
|
3471
|
-
const fileSize =
|
|
3855
|
+
const fileSize = statSync3(input.filePath).size;
|
|
3472
3856
|
const uploadInfo = await ctx.client.post("file_upload", {
|
|
3473
3857
|
projectId: input.project,
|
|
3474
3858
|
fileName,
|
|
@@ -3496,20 +3880,20 @@ var filesUpload = {
|
|
|
3496
3880
|
// src/commands/files/upload-batch.ts
|
|
3497
3881
|
init_client();
|
|
3498
3882
|
init_errors();
|
|
3499
|
-
import { readFileSync as readFileSync7, statSync as
|
|
3883
|
+
import { readFileSync as readFileSync7, statSync as statSync4 } from "node:fs";
|
|
3500
3884
|
import { basename as basename2 } from "node:path";
|
|
3501
|
-
import { z as
|
|
3502
|
-
var inputSchema37 =
|
|
3503
|
-
project:
|
|
3504
|
-
filePaths:
|
|
3505
|
-
folder:
|
|
3885
|
+
import { z as z39 } from "zod";
|
|
3886
|
+
var inputSchema37 = z39.object({
|
|
3887
|
+
project: z39.string().uuid().describe("Project ID"),
|
|
3888
|
+
filePaths: z39.string().min(1).describe("Comma-separated local file paths to upload"),
|
|
3889
|
+
folder: z39.string().uuid().optional().describe("Folder ID")
|
|
3506
3890
|
});
|
|
3507
3891
|
var filesUploadBatch = {
|
|
3508
3892
|
name: "files.uploadBatch",
|
|
3509
3893
|
group: "files",
|
|
3510
3894
|
description: "Upload multiple files to a project (max 50)",
|
|
3511
3895
|
inputSchema: inputSchema37,
|
|
3512
|
-
outputSchema:
|
|
3896
|
+
outputSchema: z39.any(),
|
|
3513
3897
|
async execute(input, ctx) {
|
|
3514
3898
|
const paths = input.filePaths.split(",").map((p) => p.trim()).filter(Boolean);
|
|
3515
3899
|
if (paths.length === 0) {
|
|
@@ -3527,7 +3911,7 @@ var filesUploadBatch = {
|
|
|
3527
3911
|
try {
|
|
3528
3912
|
const fileBuffer = readFileSync7(filePath);
|
|
3529
3913
|
const contentType = "application/octet-stream";
|
|
3530
|
-
const fileSize =
|
|
3914
|
+
const fileSize = statSync4(filePath).size;
|
|
3531
3915
|
const uploadInfo = await ctx.client.post("file_upload", {
|
|
3532
3916
|
projectId: input.project,
|
|
3533
3917
|
fileName,
|
|
@@ -3567,17 +3951,17 @@ var filesUploadBatch = {
|
|
|
3567
3951
|
};
|
|
3568
3952
|
|
|
3569
3953
|
// src/commands/files/version-content.ts
|
|
3570
|
-
import { z as
|
|
3571
|
-
var inputSchema38 =
|
|
3572
|
-
fileId:
|
|
3573
|
-
versionId:
|
|
3954
|
+
import { z as z40 } from "zod";
|
|
3955
|
+
var inputSchema38 = z40.object({
|
|
3956
|
+
fileId: z40.string().uuid().describe("File ID"),
|
|
3957
|
+
versionId: z40.string().uuid().describe("Version ID")
|
|
3574
3958
|
});
|
|
3575
3959
|
var filesVersionContent = {
|
|
3576
3960
|
name: "files.versionContent",
|
|
3577
3961
|
group: "files",
|
|
3578
3962
|
description: "Get the raw content of a specific file version",
|
|
3579
3963
|
inputSchema: inputSchema38,
|
|
3580
|
-
outputSchema:
|
|
3964
|
+
outputSchema: z40.any(),
|
|
3581
3965
|
annotations: { readOnlyHint: true },
|
|
3582
3966
|
async execute(input, ctx) {
|
|
3583
3967
|
return ctx.client.get("file_version_content", {
|
|
@@ -3591,9 +3975,9 @@ var filesVersionContent = {
|
|
|
3591
3975
|
};
|
|
3592
3976
|
|
|
3593
3977
|
// src/commands/files/versions.ts
|
|
3594
|
-
import { z as
|
|
3595
|
-
var inputSchema39 =
|
|
3596
|
-
fileId:
|
|
3978
|
+
import { z as z41 } from "zod";
|
|
3979
|
+
var inputSchema39 = z41.object({
|
|
3980
|
+
fileId: z41.string().uuid().describe("File ID"),
|
|
3597
3981
|
...paginationInput
|
|
3598
3982
|
});
|
|
3599
3983
|
var filesVersions = {
|
|
@@ -3601,7 +3985,7 @@ var filesVersions = {
|
|
|
3601
3985
|
group: "files",
|
|
3602
3986
|
description: "List versions of a file",
|
|
3603
3987
|
inputSchema: inputSchema39,
|
|
3604
|
-
outputSchema:
|
|
3988
|
+
outputSchema: z41.any(),
|
|
3605
3989
|
annotations: { readOnlyHint: true },
|
|
3606
3990
|
async execute(input, ctx) {
|
|
3607
3991
|
return ctx.client.get("file_versions", {
|
|
@@ -3616,17 +4000,17 @@ var filesVersions = {
|
|
|
3616
4000
|
};
|
|
3617
4001
|
|
|
3618
4002
|
// src/commands/files/working-copy.ts
|
|
3619
|
-
import { z as
|
|
3620
|
-
var inputSchema40 =
|
|
3621
|
-
fileId:
|
|
3622
|
-
task:
|
|
4003
|
+
import { z as z42 } from "zod";
|
|
4004
|
+
var inputSchema40 = z42.object({
|
|
4005
|
+
fileId: z42.string().uuid().describe("File ID"),
|
|
4006
|
+
task: z42.string().uuid().optional().describe("Task ID")
|
|
3623
4007
|
});
|
|
3624
4008
|
var filesWorkingCopy = {
|
|
3625
4009
|
name: "files.workingCopy",
|
|
3626
4010
|
group: "files",
|
|
3627
4011
|
description: "Create a working copy of a file",
|
|
3628
4012
|
inputSchema: inputSchema40,
|
|
3629
|
-
outputSchema:
|
|
4013
|
+
outputSchema: z42.any(),
|
|
3630
4014
|
async execute(input, ctx) {
|
|
3631
4015
|
const body = {};
|
|
3632
4016
|
if (input.task !== void 0) body.taskId = input.task;
|
|
@@ -3666,16 +4050,16 @@ function registerFileCommands() {
|
|
|
3666
4050
|
}
|
|
3667
4051
|
|
|
3668
4052
|
// src/commands/flags/get.ts
|
|
3669
|
-
import { z as
|
|
3670
|
-
var inputSchema41 =
|
|
3671
|
-
key:
|
|
4053
|
+
import { z as z43 } from "zod";
|
|
4054
|
+
var inputSchema41 = z43.object({
|
|
4055
|
+
key: z43.string().min(1).describe("Feature flag key")
|
|
3672
4056
|
});
|
|
3673
4057
|
var flagsGet = {
|
|
3674
4058
|
name: "flags.get",
|
|
3675
4059
|
group: "flags",
|
|
3676
4060
|
description: "Get a feature flag by key",
|
|
3677
4061
|
inputSchema: inputSchema41,
|
|
3678
|
-
outputSchema:
|
|
4062
|
+
outputSchema: z43.any(),
|
|
3679
4063
|
annotations: { readOnlyHint: true },
|
|
3680
4064
|
async execute(input, ctx) {
|
|
3681
4065
|
return ctx.client.get("feature_flag", {
|
|
@@ -3689,14 +4073,14 @@ var flagsGet = {
|
|
|
3689
4073
|
};
|
|
3690
4074
|
|
|
3691
4075
|
// src/commands/flags/list.ts
|
|
3692
|
-
import { z as
|
|
3693
|
-
var inputSchema42 =
|
|
4076
|
+
import { z as z44 } from "zod";
|
|
4077
|
+
var inputSchema42 = z44.object({});
|
|
3694
4078
|
var flagsList = {
|
|
3695
4079
|
name: "flags.list",
|
|
3696
4080
|
group: "flags",
|
|
3697
4081
|
description: "List all feature flags",
|
|
3698
4082
|
inputSchema: inputSchema42,
|
|
3699
|
-
outputSchema:
|
|
4083
|
+
outputSchema: z44.any(),
|
|
3700
4084
|
annotations: { readOnlyHint: true },
|
|
3701
4085
|
async execute(_input, ctx) {
|
|
3702
4086
|
return ctx.client.get("feature_flags");
|
|
@@ -3708,18 +4092,18 @@ var flagsList = {
|
|
|
3708
4092
|
};
|
|
3709
4093
|
|
|
3710
4094
|
// src/commands/flags/set.ts
|
|
3711
|
-
import { z as
|
|
3712
|
-
var inputSchema43 =
|
|
3713
|
-
key:
|
|
3714
|
-
value:
|
|
3715
|
-
yes:
|
|
4095
|
+
import { z as z45 } from "zod";
|
|
4096
|
+
var inputSchema43 = z45.object({
|
|
4097
|
+
key: z45.string().min(1).describe("Feature flag key"),
|
|
4098
|
+
value: z45.enum(["true", "false"]).describe("Feature flag value"),
|
|
4099
|
+
yes: z45.boolean().optional().default(false).describe("Skip confirmation prompt")
|
|
3716
4100
|
});
|
|
3717
4101
|
var flagsSet = {
|
|
3718
4102
|
name: "flags.set",
|
|
3719
4103
|
group: "flags",
|
|
3720
4104
|
description: "Set a feature flag value",
|
|
3721
4105
|
inputSchema: inputSchema43,
|
|
3722
|
-
outputSchema:
|
|
4106
|
+
outputSchema: z45.any(),
|
|
3723
4107
|
async execute(input, ctx) {
|
|
3724
4108
|
if (!input.yes) {
|
|
3725
4109
|
const confirmed = await confirmDestructive(`Set feature flag "${input.key}" to ${input.value}? [y/N] `);
|
|
@@ -3748,18 +4132,18 @@ function registerFlagCommands() {
|
|
|
3748
4132
|
}
|
|
3749
4133
|
|
|
3750
4134
|
// src/commands/folders/create.ts
|
|
3751
|
-
import { z as
|
|
3752
|
-
var inputSchema44 =
|
|
3753
|
-
projectId:
|
|
3754
|
-
name:
|
|
3755
|
-
parentId:
|
|
4135
|
+
import { z as z46 } from "zod";
|
|
4136
|
+
var inputSchema44 = z46.object({
|
|
4137
|
+
projectId: z46.string().uuid().describe("Project ID"),
|
|
4138
|
+
name: z46.string().min(1).describe("Folder name"),
|
|
4139
|
+
parentId: z46.string().uuid().optional().describe("Parent folder ID")
|
|
3756
4140
|
});
|
|
3757
4141
|
var foldersCreate = {
|
|
3758
4142
|
name: "folders.create",
|
|
3759
4143
|
group: "folders",
|
|
3760
4144
|
description: "Create a new folder in a project",
|
|
3761
4145
|
inputSchema: inputSchema44,
|
|
3762
|
-
outputSchema:
|
|
4146
|
+
outputSchema: z46.any(),
|
|
3763
4147
|
async execute(input, ctx) {
|
|
3764
4148
|
const body = { name: input.name };
|
|
3765
4149
|
if (input.parentId) body.parentId = input.parentId;
|
|
@@ -3774,16 +4158,16 @@ var foldersCreate = {
|
|
|
3774
4158
|
};
|
|
3775
4159
|
|
|
3776
4160
|
// src/commands/folders/delete.ts
|
|
3777
|
-
import { z as
|
|
3778
|
-
var inputSchema45 =
|
|
3779
|
-
folderId:
|
|
4161
|
+
import { z as z47 } from "zod";
|
|
4162
|
+
var inputSchema45 = z47.object({
|
|
4163
|
+
folderId: z47.string().uuid().describe("Folder ID to delete")
|
|
3780
4164
|
});
|
|
3781
4165
|
var foldersDelete = {
|
|
3782
4166
|
name: "folders.delete",
|
|
3783
4167
|
group: "folders",
|
|
3784
4168
|
description: "Delete a folder",
|
|
3785
4169
|
inputSchema: inputSchema45,
|
|
3786
|
-
outputSchema:
|
|
4170
|
+
outputSchema: z47.any(),
|
|
3787
4171
|
annotations: { destructiveHint: true },
|
|
3788
4172
|
async execute(input, ctx) {
|
|
3789
4173
|
await ctx.client.del("folder", {
|
|
@@ -3798,16 +4182,16 @@ var foldersDelete = {
|
|
|
3798
4182
|
};
|
|
3799
4183
|
|
|
3800
4184
|
// src/commands/folders/list.ts
|
|
3801
|
-
import { z as
|
|
3802
|
-
var inputSchema46 =
|
|
3803
|
-
projectId:
|
|
4185
|
+
import { z as z48 } from "zod";
|
|
4186
|
+
var inputSchema46 = z48.object({
|
|
4187
|
+
projectId: z48.string().uuid().describe("Project ID")
|
|
3804
4188
|
});
|
|
3805
4189
|
var foldersList = {
|
|
3806
4190
|
name: "folders.list",
|
|
3807
4191
|
group: "folders",
|
|
3808
4192
|
description: "List folders in a project",
|
|
3809
4193
|
inputSchema: inputSchema46,
|
|
3810
|
-
outputSchema:
|
|
4194
|
+
outputSchema: z48.any(),
|
|
3811
4195
|
annotations: { readOnlyHint: true },
|
|
3812
4196
|
async execute(input, ctx) {
|
|
3813
4197
|
return ctx.client.get("project_folders", {
|
|
@@ -3822,18 +4206,18 @@ var foldersList = {
|
|
|
3822
4206
|
|
|
3823
4207
|
// src/commands/folders/move.ts
|
|
3824
4208
|
init_errors();
|
|
3825
|
-
import { z as
|
|
4209
|
+
import { z as z49 } from "zod";
|
|
3826
4210
|
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
3827
|
-
var inputSchema47 =
|
|
3828
|
-
folderId:
|
|
3829
|
-
parentId:
|
|
4211
|
+
var inputSchema47 = z49.object({
|
|
4212
|
+
folderId: z49.string().uuid().describe("Folder ID to move"),
|
|
4213
|
+
parentId: z49.string().min(1).describe("Target parent folder ID, or 'root' to move to project root")
|
|
3830
4214
|
});
|
|
3831
4215
|
var foldersMove = {
|
|
3832
4216
|
name: "folders.move",
|
|
3833
4217
|
group: "folders",
|
|
3834
4218
|
description: "Move a folder to a new parent (or to root)",
|
|
3835
4219
|
inputSchema: inputSchema47,
|
|
3836
|
-
outputSchema:
|
|
4220
|
+
outputSchema: z49.any(),
|
|
3837
4221
|
async execute(input, ctx) {
|
|
3838
4222
|
let parentValue;
|
|
3839
4223
|
if (input.parentId === "root") {
|
|
@@ -3861,17 +4245,17 @@ var foldersMove = {
|
|
|
3861
4245
|
};
|
|
3862
4246
|
|
|
3863
4247
|
// src/commands/folders/rename.ts
|
|
3864
|
-
import { z as
|
|
3865
|
-
var inputSchema48 =
|
|
3866
|
-
folderId:
|
|
3867
|
-
name:
|
|
4248
|
+
import { z as z50 } from "zod";
|
|
4249
|
+
var inputSchema48 = z50.object({
|
|
4250
|
+
folderId: z50.string().uuid().describe("Folder ID"),
|
|
4251
|
+
name: z50.string().min(1).describe("New folder name")
|
|
3868
4252
|
});
|
|
3869
4253
|
var foldersRename = {
|
|
3870
4254
|
name: "folders.rename",
|
|
3871
4255
|
group: "folders",
|
|
3872
4256
|
description: "Rename a folder",
|
|
3873
4257
|
inputSchema: inputSchema48,
|
|
3874
|
-
outputSchema:
|
|
4258
|
+
outputSchema: z50.any(),
|
|
3875
4259
|
annotations: { idempotentHint: true },
|
|
3876
4260
|
async execute(input, ctx) {
|
|
3877
4261
|
return ctx.client.put(
|
|
@@ -3894,11 +4278,11 @@ function registerFolderCommands() {
|
|
|
3894
4278
|
}
|
|
3895
4279
|
|
|
3896
4280
|
// src/commands/health.ts
|
|
3897
|
-
import { z as
|
|
3898
|
-
var healthInput =
|
|
3899
|
-
var healthOutput =
|
|
3900
|
-
status:
|
|
3901
|
-
timestamp:
|
|
4281
|
+
import { z as z51 } from "zod";
|
|
4282
|
+
var healthInput = z51.object({});
|
|
4283
|
+
var healthOutput = z51.object({
|
|
4284
|
+
status: z51.string(),
|
|
4285
|
+
timestamp: z51.string()
|
|
3902
4286
|
});
|
|
3903
4287
|
var healthCheck = {
|
|
3904
4288
|
name: "health.check",
|
|
@@ -3928,18 +4312,18 @@ var healthCheck = {
|
|
|
3928
4312
|
};
|
|
3929
4313
|
|
|
3930
4314
|
// src/commands/library/create-folder.ts
|
|
3931
|
-
import { z as
|
|
3932
|
-
var inputSchema49 =
|
|
3933
|
-
orgId:
|
|
3934
|
-
name:
|
|
3935
|
-
parent:
|
|
4315
|
+
import { z as z52 } from "zod";
|
|
4316
|
+
var inputSchema49 = z52.object({
|
|
4317
|
+
orgId: z52.string().uuid().describe("Organization ID"),
|
|
4318
|
+
name: z52.string().min(1).describe("Folder name"),
|
|
4319
|
+
parent: z52.string().uuid().optional().describe("Parent folder ID")
|
|
3936
4320
|
});
|
|
3937
4321
|
var libraryCreateFolder = {
|
|
3938
4322
|
name: "library.createFolder",
|
|
3939
4323
|
group: "library",
|
|
3940
4324
|
description: "Create a folder in the organization library",
|
|
3941
4325
|
inputSchema: inputSchema49,
|
|
3942
|
-
outputSchema:
|
|
4326
|
+
outputSchema: z52.any(),
|
|
3943
4327
|
async execute(input, ctx) {
|
|
3944
4328
|
const body = { name: input.name };
|
|
3945
4329
|
if (input.parent) body.parentId = input.parent;
|
|
@@ -3954,17 +4338,17 @@ var libraryCreateFolder = {
|
|
|
3954
4338
|
};
|
|
3955
4339
|
|
|
3956
4340
|
// src/commands/library/delete-folder.ts
|
|
3957
|
-
import { z as
|
|
3958
|
-
var inputSchema50 =
|
|
3959
|
-
orgId:
|
|
3960
|
-
folderId:
|
|
4341
|
+
import { z as z53 } from "zod";
|
|
4342
|
+
var inputSchema50 = z53.object({
|
|
4343
|
+
orgId: z53.string().uuid().describe("Organization ID"),
|
|
4344
|
+
folderId: z53.string().uuid().describe("Folder ID to delete")
|
|
3961
4345
|
});
|
|
3962
4346
|
var libraryDeleteFolder = {
|
|
3963
4347
|
name: "library.deleteFolder",
|
|
3964
4348
|
group: "library",
|
|
3965
4349
|
description: "Delete a folder from the organization library",
|
|
3966
4350
|
inputSchema: inputSchema50,
|
|
3967
|
-
outputSchema:
|
|
4351
|
+
outputSchema: z53.any(),
|
|
3968
4352
|
annotations: { destructiveHint: true },
|
|
3969
4353
|
async execute(input, ctx) {
|
|
3970
4354
|
await ctx.client.del("library_folder", {
|
|
@@ -3979,9 +4363,9 @@ var libraryDeleteFolder = {
|
|
|
3979
4363
|
};
|
|
3980
4364
|
|
|
3981
4365
|
// src/commands/library/files.ts
|
|
3982
|
-
import { z as
|
|
3983
|
-
var inputSchema51 =
|
|
3984
|
-
orgId:
|
|
4366
|
+
import { z as z54 } from "zod";
|
|
4367
|
+
var inputSchema51 = z54.object({
|
|
4368
|
+
orgId: z54.string().uuid().describe("Organization ID"),
|
|
3985
4369
|
...paginationInput
|
|
3986
4370
|
});
|
|
3987
4371
|
var libraryFiles = {
|
|
@@ -3989,7 +4373,7 @@ var libraryFiles = {
|
|
|
3989
4373
|
group: "library",
|
|
3990
4374
|
description: "List files in the organization library",
|
|
3991
4375
|
inputSchema: inputSchema51,
|
|
3992
|
-
outputSchema:
|
|
4376
|
+
outputSchema: z54.any(),
|
|
3993
4377
|
annotations: { readOnlyHint: true },
|
|
3994
4378
|
async execute(input, ctx) {
|
|
3995
4379
|
return ctx.client.get("library_files", {
|
|
@@ -4004,16 +4388,16 @@ var libraryFiles = {
|
|
|
4004
4388
|
};
|
|
4005
4389
|
|
|
4006
4390
|
// src/commands/library/folders.ts
|
|
4007
|
-
import { z as
|
|
4008
|
-
var inputSchema52 =
|
|
4009
|
-
orgId:
|
|
4391
|
+
import { z as z55 } from "zod";
|
|
4392
|
+
var inputSchema52 = z55.object({
|
|
4393
|
+
orgId: z55.string().uuid().describe("Organization ID")
|
|
4010
4394
|
});
|
|
4011
4395
|
var libraryFolders = {
|
|
4012
4396
|
name: "library.folders",
|
|
4013
4397
|
group: "library",
|
|
4014
4398
|
description: "List folders in the organization library",
|
|
4015
4399
|
inputSchema: inputSchema52,
|
|
4016
|
-
outputSchema:
|
|
4400
|
+
outputSchema: z55.any(),
|
|
4017
4401
|
annotations: { readOnlyHint: true },
|
|
4018
4402
|
async execute(input, ctx) {
|
|
4019
4403
|
return ctx.client.get("library_folders", {
|
|
@@ -4027,18 +4411,18 @@ var libraryFolders = {
|
|
|
4027
4411
|
};
|
|
4028
4412
|
|
|
4029
4413
|
// src/commands/library/rename-folder.ts
|
|
4030
|
-
import { z as
|
|
4031
|
-
var inputSchema53 =
|
|
4032
|
-
orgId:
|
|
4033
|
-
folderId:
|
|
4034
|
-
name:
|
|
4414
|
+
import { z as z56 } from "zod";
|
|
4415
|
+
var inputSchema53 = z56.object({
|
|
4416
|
+
orgId: z56.string().uuid().describe("Organization ID"),
|
|
4417
|
+
folderId: z56.string().uuid().describe("Folder ID to rename"),
|
|
4418
|
+
name: z56.string().min(1).describe("New folder name")
|
|
4035
4419
|
});
|
|
4036
4420
|
var libraryRenameFolder = {
|
|
4037
4421
|
name: "library.renameFolder",
|
|
4038
4422
|
group: "library",
|
|
4039
4423
|
description: "Rename a folder in the organization library",
|
|
4040
4424
|
inputSchema: inputSchema53,
|
|
4041
|
-
outputSchema:
|
|
4425
|
+
outputSchema: z56.any(),
|
|
4042
4426
|
async execute(input, ctx) {
|
|
4043
4427
|
return ctx.client.put(
|
|
4044
4428
|
"library_folder",
|
|
@@ -4060,16 +4444,16 @@ function registerLibraryCommands() {
|
|
|
4060
4444
|
}
|
|
4061
4445
|
|
|
4062
4446
|
// src/commands/orgs/accept-invite.ts
|
|
4063
|
-
import { z as
|
|
4064
|
-
var inputSchema54 =
|
|
4065
|
-
token:
|
|
4447
|
+
import { z as z57 } from "zod";
|
|
4448
|
+
var inputSchema54 = z57.object({
|
|
4449
|
+
token: z57.string().min(1).describe("Invitation token")
|
|
4066
4450
|
});
|
|
4067
4451
|
var orgsAcceptInvite = {
|
|
4068
4452
|
name: "orgs.acceptInvite",
|
|
4069
4453
|
group: "orgs",
|
|
4070
4454
|
description: "Accept an organization invitation by token",
|
|
4071
4455
|
inputSchema: inputSchema54,
|
|
4072
|
-
outputSchema:
|
|
4456
|
+
outputSchema: z57.any(),
|
|
4073
4457
|
async execute(input, ctx) {
|
|
4074
4458
|
return ctx.client.post("invitation_accept", void 0, {
|
|
4075
4459
|
pathParams: { token: input.token }
|
|
@@ -4082,16 +4466,16 @@ var orgsAcceptInvite = {
|
|
|
4082
4466
|
};
|
|
4083
4467
|
|
|
4084
4468
|
// src/commands/orgs/billing.ts
|
|
4085
|
-
import { z as
|
|
4086
|
-
var inputSchema55 =
|
|
4087
|
-
orgId:
|
|
4469
|
+
import { z as z58 } from "zod";
|
|
4470
|
+
var inputSchema55 = z58.object({
|
|
4471
|
+
orgId: z58.string().uuid().describe("Organization ID")
|
|
4088
4472
|
});
|
|
4089
4473
|
var orgsBilling = {
|
|
4090
4474
|
name: "orgs.billing",
|
|
4091
4475
|
group: "orgs",
|
|
4092
4476
|
description: "Get billing status for an organization",
|
|
4093
4477
|
inputSchema: inputSchema55,
|
|
4094
|
-
outputSchema:
|
|
4478
|
+
outputSchema: z58.any(),
|
|
4095
4479
|
annotations: { readOnlyHint: true },
|
|
4096
4480
|
async execute(input, ctx) {
|
|
4097
4481
|
return ctx.client.get("organization_billing", {
|
|
@@ -4105,17 +4489,17 @@ var orgsBilling = {
|
|
|
4105
4489
|
};
|
|
4106
4490
|
|
|
4107
4491
|
// src/commands/orgs/cancel-invite.ts
|
|
4108
|
-
import { z as
|
|
4109
|
-
var inputSchema56 =
|
|
4110
|
-
orgId:
|
|
4111
|
-
invitationId:
|
|
4492
|
+
import { z as z59 } from "zod";
|
|
4493
|
+
var inputSchema56 = z59.object({
|
|
4494
|
+
orgId: z59.string().uuid().describe("Organization ID"),
|
|
4495
|
+
invitationId: z59.string().uuid().describe("Invitation ID to cancel")
|
|
4112
4496
|
});
|
|
4113
4497
|
var orgsCancelInvite = {
|
|
4114
4498
|
name: "orgs.cancelInvite",
|
|
4115
4499
|
group: "orgs",
|
|
4116
4500
|
description: "Cancel a pending organization invitation",
|
|
4117
4501
|
inputSchema: inputSchema56,
|
|
4118
|
-
outputSchema:
|
|
4502
|
+
outputSchema: z59.any(),
|
|
4119
4503
|
annotations: { destructiveHint: true },
|
|
4120
4504
|
async execute(input, ctx) {
|
|
4121
4505
|
await ctx.client.del("org_invitation", {
|
|
@@ -4130,17 +4514,17 @@ var orgsCancelInvite = {
|
|
|
4130
4514
|
};
|
|
4131
4515
|
|
|
4132
4516
|
// src/commands/orgs/create.ts
|
|
4133
|
-
import { z as
|
|
4134
|
-
var inputSchema57 =
|
|
4135
|
-
name:
|
|
4136
|
-
description:
|
|
4517
|
+
import { z as z60 } from "zod";
|
|
4518
|
+
var inputSchema57 = z60.object({
|
|
4519
|
+
name: z60.string().min(1).describe("Organization name"),
|
|
4520
|
+
description: z60.string().optional().describe("Organization description")
|
|
4137
4521
|
});
|
|
4138
4522
|
var orgsCreate = {
|
|
4139
4523
|
name: "orgs.create",
|
|
4140
4524
|
group: "orgs",
|
|
4141
4525
|
description: "Create a new organization",
|
|
4142
4526
|
inputSchema: inputSchema57,
|
|
4143
|
-
outputSchema:
|
|
4527
|
+
outputSchema: z60.any(),
|
|
4144
4528
|
async execute(input, ctx) {
|
|
4145
4529
|
return ctx.client.post("organizations", input);
|
|
4146
4530
|
},
|
|
@@ -4151,17 +4535,17 @@ var orgsCreate = {
|
|
|
4151
4535
|
};
|
|
4152
4536
|
|
|
4153
4537
|
// src/commands/orgs/delete.ts
|
|
4154
|
-
import { z as
|
|
4155
|
-
var inputSchema58 =
|
|
4156
|
-
orgId:
|
|
4157
|
-
yes:
|
|
4538
|
+
import { z as z61 } from "zod";
|
|
4539
|
+
var inputSchema58 = z61.object({
|
|
4540
|
+
orgId: z61.string().uuid().describe("Organization ID to delete"),
|
|
4541
|
+
yes: z61.boolean().optional().default(false).describe("Skip confirmation prompt")
|
|
4158
4542
|
});
|
|
4159
4543
|
var orgsDelete = {
|
|
4160
4544
|
name: "orgs.delete",
|
|
4161
4545
|
group: "orgs",
|
|
4162
4546
|
description: "Delete an organization",
|
|
4163
4547
|
inputSchema: inputSchema58,
|
|
4164
|
-
outputSchema:
|
|
4548
|
+
outputSchema: z61.any(),
|
|
4165
4549
|
annotations: { destructiveHint: true },
|
|
4166
4550
|
async execute(input, ctx) {
|
|
4167
4551
|
if (!input.yes) {
|
|
@@ -4182,9 +4566,9 @@ var orgsDelete = {
|
|
|
4182
4566
|
};
|
|
4183
4567
|
|
|
4184
4568
|
// src/commands/orgs/files.ts
|
|
4185
|
-
import { z as
|
|
4186
|
-
var inputSchema59 =
|
|
4187
|
-
orgId:
|
|
4569
|
+
import { z as z62 } from "zod";
|
|
4570
|
+
var inputSchema59 = z62.object({
|
|
4571
|
+
orgId: z62.string().uuid().describe("Organization ID"),
|
|
4188
4572
|
...paginationInput
|
|
4189
4573
|
});
|
|
4190
4574
|
var orgsFiles = {
|
|
@@ -4192,7 +4576,7 @@ var orgsFiles = {
|
|
|
4192
4576
|
group: "orgs",
|
|
4193
4577
|
description: "List files belonging to an organization",
|
|
4194
4578
|
inputSchema: inputSchema59,
|
|
4195
|
-
outputSchema:
|
|
4579
|
+
outputSchema: z62.any(),
|
|
4196
4580
|
annotations: { readOnlyHint: true },
|
|
4197
4581
|
async execute(input, ctx) {
|
|
4198
4582
|
return ctx.client.get("org_files", {
|
|
@@ -4207,16 +4591,16 @@ var orgsFiles = {
|
|
|
4207
4591
|
};
|
|
4208
4592
|
|
|
4209
4593
|
// src/commands/orgs/get.ts
|
|
4210
|
-
import { z as
|
|
4211
|
-
var inputSchema60 =
|
|
4212
|
-
orgId:
|
|
4594
|
+
import { z as z63 } from "zod";
|
|
4595
|
+
var inputSchema60 = z63.object({
|
|
4596
|
+
orgId: z63.string().uuid().describe("Organization ID")
|
|
4213
4597
|
});
|
|
4214
4598
|
var orgsGet = {
|
|
4215
4599
|
name: "orgs.get",
|
|
4216
4600
|
group: "orgs",
|
|
4217
4601
|
description: "Get details of a specific organization",
|
|
4218
4602
|
inputSchema: inputSchema60,
|
|
4219
|
-
outputSchema:
|
|
4603
|
+
outputSchema: z63.any(),
|
|
4220
4604
|
async execute(input, ctx) {
|
|
4221
4605
|
return ctx.client.get("organization", {
|
|
4222
4606
|
pathParams: { id: input.orgId }
|
|
@@ -4229,16 +4613,16 @@ var orgsGet = {
|
|
|
4229
4613
|
};
|
|
4230
4614
|
|
|
4231
4615
|
// src/commands/orgs/invitation-info.ts
|
|
4232
|
-
import { z as
|
|
4233
|
-
var inputSchema61 =
|
|
4234
|
-
token:
|
|
4616
|
+
import { z as z64 } from "zod";
|
|
4617
|
+
var inputSchema61 = z64.object({
|
|
4618
|
+
token: z64.string().min(1).describe("Invitation token")
|
|
4235
4619
|
});
|
|
4236
4620
|
var orgsInvitationInfo = {
|
|
4237
4621
|
name: "orgs.invitationInfo",
|
|
4238
4622
|
group: "orgs",
|
|
4239
4623
|
description: "Get information about an invitation by token",
|
|
4240
4624
|
inputSchema: inputSchema61,
|
|
4241
|
-
outputSchema:
|
|
4625
|
+
outputSchema: z64.any(),
|
|
4242
4626
|
annotations: { readOnlyHint: true },
|
|
4243
4627
|
async execute(input, ctx) {
|
|
4244
4628
|
return ctx.client.get("invitation_info", {
|
|
@@ -4252,16 +4636,16 @@ var orgsInvitationInfo = {
|
|
|
4252
4636
|
};
|
|
4253
4637
|
|
|
4254
4638
|
// src/commands/orgs/invitations.ts
|
|
4255
|
-
import { z as
|
|
4256
|
-
var inputSchema62 =
|
|
4257
|
-
orgId:
|
|
4639
|
+
import { z as z65 } from "zod";
|
|
4640
|
+
var inputSchema62 = z65.object({
|
|
4641
|
+
orgId: z65.string().uuid().describe("Organization ID")
|
|
4258
4642
|
});
|
|
4259
4643
|
var orgsInvitations = {
|
|
4260
4644
|
name: "orgs.invitations",
|
|
4261
4645
|
group: "orgs",
|
|
4262
4646
|
description: "List pending invitations for an organization",
|
|
4263
4647
|
inputSchema: inputSchema62,
|
|
4264
|
-
outputSchema:
|
|
4648
|
+
outputSchema: z65.any(),
|
|
4265
4649
|
annotations: { readOnlyHint: true },
|
|
4266
4650
|
async execute(input, ctx) {
|
|
4267
4651
|
return ctx.client.get("org_invitations", {
|
|
@@ -4275,18 +4659,18 @@ var orgsInvitations = {
|
|
|
4275
4659
|
};
|
|
4276
4660
|
|
|
4277
4661
|
// src/commands/orgs/invite.ts
|
|
4278
|
-
import { z as
|
|
4279
|
-
var inputSchema63 =
|
|
4280
|
-
orgId:
|
|
4281
|
-
email:
|
|
4282
|
-
role:
|
|
4662
|
+
import { z as z66 } from "zod";
|
|
4663
|
+
var inputSchema63 = z66.object({
|
|
4664
|
+
orgId: z66.string().uuid().describe("Organization ID"),
|
|
4665
|
+
email: z66.string().email().describe("Email address to invite"),
|
|
4666
|
+
role: z66.string().optional().default("Member").describe("Role to assign (default: Member)")
|
|
4283
4667
|
});
|
|
4284
4668
|
var orgsInvite = {
|
|
4285
4669
|
name: "orgs.invite",
|
|
4286
4670
|
group: "orgs",
|
|
4287
4671
|
description: "Invite a user to an organization by email",
|
|
4288
4672
|
inputSchema: inputSchema63,
|
|
4289
|
-
outputSchema:
|
|
4673
|
+
outputSchema: z66.any(),
|
|
4290
4674
|
annotations: { idempotentHint: true },
|
|
4291
4675
|
async execute(input, ctx) {
|
|
4292
4676
|
const existing = await ctx.client.get("org_invitations", {
|
|
@@ -4314,14 +4698,14 @@ var orgsInvite = {
|
|
|
4314
4698
|
};
|
|
4315
4699
|
|
|
4316
4700
|
// src/commands/orgs/list.ts
|
|
4317
|
-
import { z as
|
|
4318
|
-
var inputSchema64 =
|
|
4701
|
+
import { z as z67 } from "zod";
|
|
4702
|
+
var inputSchema64 = z67.object({});
|
|
4319
4703
|
var orgsList = {
|
|
4320
4704
|
name: "orgs.list",
|
|
4321
4705
|
group: "orgs",
|
|
4322
4706
|
description: "List all organizations the current user belongs to",
|
|
4323
4707
|
inputSchema: inputSchema64,
|
|
4324
|
-
outputSchema:
|
|
4708
|
+
outputSchema: z67.any(),
|
|
4325
4709
|
annotations: { readOnlyHint: true },
|
|
4326
4710
|
async execute(_input, ctx) {
|
|
4327
4711
|
return ctx.client.get("organizations");
|
|
@@ -4333,14 +4717,14 @@ var orgsList = {
|
|
|
4333
4717
|
};
|
|
4334
4718
|
|
|
4335
4719
|
// src/commands/orgs/list-all.ts
|
|
4336
|
-
import { z as
|
|
4337
|
-
var inputSchema65 =
|
|
4720
|
+
import { z as z68 } from "zod";
|
|
4721
|
+
var inputSchema65 = z68.object({});
|
|
4338
4722
|
var orgsListAll = {
|
|
4339
4723
|
name: "orgs.listAll",
|
|
4340
4724
|
group: "orgs",
|
|
4341
4725
|
description: "List all organizations (admin)",
|
|
4342
4726
|
inputSchema: inputSchema65,
|
|
4343
|
-
outputSchema:
|
|
4727
|
+
outputSchema: z68.any(),
|
|
4344
4728
|
annotations: { readOnlyHint: true },
|
|
4345
4729
|
async execute(_input, ctx) {
|
|
4346
4730
|
return ctx.client.get("organizations_all");
|
|
@@ -4352,16 +4736,16 @@ var orgsListAll = {
|
|
|
4352
4736
|
};
|
|
4353
4737
|
|
|
4354
4738
|
// src/commands/orgs/members.ts
|
|
4355
|
-
import { z as
|
|
4356
|
-
var inputSchema66 =
|
|
4357
|
-
orgId:
|
|
4739
|
+
import { z as z69 } from "zod";
|
|
4740
|
+
var inputSchema66 = z69.object({
|
|
4741
|
+
orgId: z69.string().uuid().describe("Organization ID")
|
|
4358
4742
|
});
|
|
4359
4743
|
var orgsMembers = {
|
|
4360
4744
|
name: "orgs.members",
|
|
4361
4745
|
group: "orgs",
|
|
4362
4746
|
description: "List members of an organization",
|
|
4363
4747
|
inputSchema: inputSchema66,
|
|
4364
|
-
outputSchema:
|
|
4748
|
+
outputSchema: z69.any(),
|
|
4365
4749
|
annotations: { readOnlyHint: true },
|
|
4366
4750
|
async execute(input, ctx) {
|
|
4367
4751
|
return ctx.client.get("organization_members", {
|
|
@@ -4375,17 +4759,17 @@ var orgsMembers = {
|
|
|
4375
4759
|
};
|
|
4376
4760
|
|
|
4377
4761
|
// src/commands/orgs/remove-member.ts
|
|
4378
|
-
import { z as
|
|
4379
|
-
var inputSchema67 =
|
|
4380
|
-
orgId:
|
|
4381
|
-
membershipId:
|
|
4762
|
+
import { z as z70 } from "zod";
|
|
4763
|
+
var inputSchema67 = z70.object({
|
|
4764
|
+
orgId: z70.string().uuid().describe("Organization ID"),
|
|
4765
|
+
membershipId: z70.string().uuid().describe("Membership ID of the member to remove")
|
|
4382
4766
|
});
|
|
4383
4767
|
var orgsRemoveMember = {
|
|
4384
4768
|
name: "orgs.removeMember",
|
|
4385
4769
|
group: "orgs",
|
|
4386
4770
|
description: "Remove a member from an organization",
|
|
4387
4771
|
inputSchema: inputSchema67,
|
|
4388
|
-
outputSchema:
|
|
4772
|
+
outputSchema: z70.any(),
|
|
4389
4773
|
annotations: { destructiveHint: true },
|
|
4390
4774
|
async execute(input, ctx) {
|
|
4391
4775
|
await ctx.client.del("organization_member", {
|
|
@@ -4400,17 +4784,17 @@ var orgsRemoveMember = {
|
|
|
4400
4784
|
};
|
|
4401
4785
|
|
|
4402
4786
|
// src/commands/orgs/resend-invite.ts
|
|
4403
|
-
import { z as
|
|
4404
|
-
var inputSchema68 =
|
|
4405
|
-
orgId:
|
|
4406
|
-
invitationId:
|
|
4787
|
+
import { z as z71 } from "zod";
|
|
4788
|
+
var inputSchema68 = z71.object({
|
|
4789
|
+
orgId: z71.string().uuid().describe("Organization ID"),
|
|
4790
|
+
invitationId: z71.string().uuid().describe("Invitation ID to resend")
|
|
4407
4791
|
});
|
|
4408
4792
|
var orgsResendInvite = {
|
|
4409
4793
|
name: "orgs.resendInvite",
|
|
4410
4794
|
group: "orgs",
|
|
4411
4795
|
description: "Resend an organization invitation email. Regenerates the token and extends the expiry by 7 days. Works on both pending and expired invitations, preserves the invitation ID.",
|
|
4412
4796
|
inputSchema: inputSchema68,
|
|
4413
|
-
outputSchema:
|
|
4797
|
+
outputSchema: z71.any(),
|
|
4414
4798
|
annotations: { idempotentHint: true },
|
|
4415
4799
|
async execute(input, ctx) {
|
|
4416
4800
|
return ctx.client.post(
|
|
@@ -4426,16 +4810,16 @@ var orgsResendInvite = {
|
|
|
4426
4810
|
};
|
|
4427
4811
|
|
|
4428
4812
|
// src/commands/orgs/set-default.ts
|
|
4429
|
-
import { z as
|
|
4430
|
-
var inputSchema69 =
|
|
4431
|
-
orgId:
|
|
4813
|
+
import { z as z72 } from "zod";
|
|
4814
|
+
var inputSchema69 = z72.object({
|
|
4815
|
+
orgId: z72.string().uuid().describe("Organization ID to set as default")
|
|
4432
4816
|
});
|
|
4433
4817
|
var orgsSetDefault = {
|
|
4434
4818
|
name: "orgs.setDefault",
|
|
4435
4819
|
group: "orgs",
|
|
4436
4820
|
description: "Set an organization as the default",
|
|
4437
4821
|
inputSchema: inputSchema69,
|
|
4438
|
-
outputSchema:
|
|
4822
|
+
outputSchema: z72.any(),
|
|
4439
4823
|
annotations: { idempotentHint: true },
|
|
4440
4824
|
async execute(input, ctx) {
|
|
4441
4825
|
return ctx.client.put("organization_set_default", void 0, {
|
|
@@ -4449,17 +4833,17 @@ var orgsSetDefault = {
|
|
|
4449
4833
|
};
|
|
4450
4834
|
|
|
4451
4835
|
// src/commands/orgs/set-stripe.ts
|
|
4452
|
-
import { z as
|
|
4453
|
-
var inputSchema70 =
|
|
4454
|
-
orgId:
|
|
4455
|
-
stripeCustomerId:
|
|
4836
|
+
import { z as z73 } from "zod";
|
|
4837
|
+
var inputSchema70 = z73.object({
|
|
4838
|
+
orgId: z73.string().uuid().describe("Organization ID"),
|
|
4839
|
+
stripeCustomerId: z73.string().min(1).describe("Stripe customer ID (e.g. cus_xxx)")
|
|
4456
4840
|
});
|
|
4457
4841
|
var orgsSetStripe = {
|
|
4458
4842
|
name: "orgs.setStripe",
|
|
4459
4843
|
group: "orgs",
|
|
4460
4844
|
description: "Set the Stripe customer ID for an organization",
|
|
4461
4845
|
inputSchema: inputSchema70,
|
|
4462
|
-
outputSchema:
|
|
4846
|
+
outputSchema: z73.any(),
|
|
4463
4847
|
annotations: { idempotentHint: true },
|
|
4464
4848
|
async execute(input, ctx) {
|
|
4465
4849
|
return ctx.client.put(
|
|
@@ -4476,18 +4860,18 @@ var orgsSetStripe = {
|
|
|
4476
4860
|
|
|
4477
4861
|
// src/commands/orgs/update.ts
|
|
4478
4862
|
init_errors();
|
|
4479
|
-
import { z as
|
|
4480
|
-
var inputSchema71 =
|
|
4481
|
-
orgId:
|
|
4482
|
-
name:
|
|
4483
|
-
description:
|
|
4863
|
+
import { z as z74 } from "zod";
|
|
4864
|
+
var inputSchema71 = z74.object({
|
|
4865
|
+
orgId: z74.string().uuid().describe("Organization ID"),
|
|
4866
|
+
name: z74.string().min(1).optional().describe("New organization name"),
|
|
4867
|
+
description: z74.string().optional().describe("New organization description")
|
|
4484
4868
|
});
|
|
4485
4869
|
var orgsUpdate = {
|
|
4486
4870
|
name: "orgs.update",
|
|
4487
4871
|
group: "orgs",
|
|
4488
4872
|
description: "Update an existing organization",
|
|
4489
4873
|
inputSchema: inputSchema71,
|
|
4490
|
-
outputSchema:
|
|
4874
|
+
outputSchema: z74.any(),
|
|
4491
4875
|
annotations: { idempotentHint: true },
|
|
4492
4876
|
async execute(input, ctx) {
|
|
4493
4877
|
const { orgId, ...fields } = input;
|
|
@@ -4508,18 +4892,18 @@ var orgsUpdate = {
|
|
|
4508
4892
|
};
|
|
4509
4893
|
|
|
4510
4894
|
// src/commands/orgs/update-role.ts
|
|
4511
|
-
import { z as
|
|
4512
|
-
var inputSchema72 =
|
|
4513
|
-
orgId:
|
|
4514
|
-
membershipId:
|
|
4515
|
-
role:
|
|
4895
|
+
import { z as z75 } from "zod";
|
|
4896
|
+
var inputSchema72 = z75.object({
|
|
4897
|
+
orgId: z75.string().uuid().describe("Organization ID"),
|
|
4898
|
+
membershipId: z75.string().uuid().describe("Membership ID of the member"),
|
|
4899
|
+
role: z75.string().min(1).describe("New role to assign")
|
|
4516
4900
|
});
|
|
4517
4901
|
var orgsUpdateRole = {
|
|
4518
4902
|
name: "orgs.updateRole",
|
|
4519
4903
|
group: "orgs",
|
|
4520
4904
|
description: "Update an organization member's role",
|
|
4521
4905
|
inputSchema: inputSchema72,
|
|
4522
|
-
outputSchema:
|
|
4906
|
+
outputSchema: z75.any(),
|
|
4523
4907
|
annotations: { idempotentHint: true },
|
|
4524
4908
|
async execute(input, ctx) {
|
|
4525
4909
|
return ctx.client.put(
|
|
@@ -4560,18 +4944,18 @@ function registerOrgCommands() {
|
|
|
4560
4944
|
}
|
|
4561
4945
|
|
|
4562
4946
|
// src/commands/projects/add-member.ts
|
|
4563
|
-
import { z as
|
|
4564
|
-
var inputSchema73 =
|
|
4565
|
-
projectId:
|
|
4566
|
-
userId:
|
|
4567
|
-
role:
|
|
4947
|
+
import { z as z76 } from "zod";
|
|
4948
|
+
var inputSchema73 = z76.object({
|
|
4949
|
+
projectId: z76.string().uuid().describe("Project ID"),
|
|
4950
|
+
userId: z76.string().uuid().describe("User ID to add"),
|
|
4951
|
+
role: z76.string().default("Member").describe("Role to assign (default: Member)")
|
|
4568
4952
|
});
|
|
4569
4953
|
var projectsAddMember = {
|
|
4570
4954
|
name: "projects.addMember",
|
|
4571
4955
|
group: "projects",
|
|
4572
4956
|
description: "Add a member to a project",
|
|
4573
4957
|
inputSchema: inputSchema73,
|
|
4574
|
-
outputSchema:
|
|
4958
|
+
outputSchema: z76.any(),
|
|
4575
4959
|
async execute(input, ctx) {
|
|
4576
4960
|
return ctx.client.post(
|
|
4577
4961
|
"project_members",
|
|
@@ -4586,16 +4970,16 @@ var projectsAddMember = {
|
|
|
4586
4970
|
};
|
|
4587
4971
|
|
|
4588
4972
|
// src/commands/projects/archive.ts
|
|
4589
|
-
import { z as
|
|
4590
|
-
var inputSchema74 =
|
|
4591
|
-
projectId:
|
|
4973
|
+
import { z as z77 } from "zod";
|
|
4974
|
+
var inputSchema74 = z77.object({
|
|
4975
|
+
projectId: z77.string().uuid().describe("Project ID to archive")
|
|
4592
4976
|
});
|
|
4593
4977
|
var projectsArchive = {
|
|
4594
4978
|
name: "projects.archive",
|
|
4595
4979
|
group: "projects",
|
|
4596
4980
|
description: "Archive (delete) a project",
|
|
4597
4981
|
inputSchema: inputSchema74,
|
|
4598
|
-
outputSchema:
|
|
4982
|
+
outputSchema: z77.any(),
|
|
4599
4983
|
annotations: { destructiveHint: true },
|
|
4600
4984
|
async execute(input, ctx) {
|
|
4601
4985
|
await ctx.client.del("project", {
|
|
@@ -4610,18 +4994,18 @@ var projectsArchive = {
|
|
|
4610
4994
|
};
|
|
4611
4995
|
|
|
4612
4996
|
// src/commands/projects/create.ts
|
|
4613
|
-
import { z as
|
|
4614
|
-
var inputSchema75 =
|
|
4615
|
-
name:
|
|
4616
|
-
description:
|
|
4617
|
-
icon:
|
|
4997
|
+
import { z as z78 } from "zod";
|
|
4998
|
+
var inputSchema75 = z78.object({
|
|
4999
|
+
name: z78.string().min(1).describe("Project name"),
|
|
5000
|
+
description: z78.string().optional().describe("Project description"),
|
|
5001
|
+
icon: z78.string().optional().describe("Project icon")
|
|
4618
5002
|
});
|
|
4619
5003
|
var projectsCreate = {
|
|
4620
5004
|
name: "projects.create",
|
|
4621
5005
|
group: "projects",
|
|
4622
5006
|
description: "Create a new project",
|
|
4623
5007
|
inputSchema: inputSchema75,
|
|
4624
|
-
outputSchema:
|
|
5008
|
+
outputSchema: z78.any(),
|
|
4625
5009
|
async execute(input, ctx) {
|
|
4626
5010
|
return ctx.client.post("projects", input);
|
|
4627
5011
|
},
|
|
@@ -4632,16 +5016,16 @@ var projectsCreate = {
|
|
|
4632
5016
|
};
|
|
4633
5017
|
|
|
4634
5018
|
// src/commands/projects/get.ts
|
|
4635
|
-
import { z as
|
|
4636
|
-
var inputSchema76 =
|
|
4637
|
-
projectId:
|
|
5019
|
+
import { z as z79 } from "zod";
|
|
5020
|
+
var inputSchema76 = z79.object({
|
|
5021
|
+
projectId: z79.string().uuid().describe("Project ID")
|
|
4638
5022
|
});
|
|
4639
5023
|
var projectsGet = {
|
|
4640
5024
|
name: "projects.get",
|
|
4641
5025
|
group: "projects",
|
|
4642
5026
|
description: "Get details of a specific project",
|
|
4643
5027
|
inputSchema: inputSchema76,
|
|
4644
|
-
outputSchema:
|
|
5028
|
+
outputSchema: z79.any(),
|
|
4645
5029
|
annotations: { readOnlyHint: true },
|
|
4646
5030
|
async execute(input, ctx) {
|
|
4647
5031
|
return ctx.client.get("project", {
|
|
@@ -4655,16 +5039,16 @@ var projectsGet = {
|
|
|
4655
5039
|
};
|
|
4656
5040
|
|
|
4657
5041
|
// src/commands/projects/leave.ts
|
|
4658
|
-
import { z as
|
|
4659
|
-
var inputSchema77 =
|
|
4660
|
-
projectId:
|
|
5042
|
+
import { z as z80 } from "zod";
|
|
5043
|
+
var inputSchema77 = z80.object({
|
|
5044
|
+
projectId: z80.string().uuid().describe("Project ID to leave")
|
|
4661
5045
|
});
|
|
4662
5046
|
var projectsLeave = {
|
|
4663
5047
|
name: "projects.leave",
|
|
4664
5048
|
group: "projects",
|
|
4665
5049
|
description: "Leave a project",
|
|
4666
5050
|
inputSchema: inputSchema77,
|
|
4667
|
-
outputSchema:
|
|
5051
|
+
outputSchema: z80.any(),
|
|
4668
5052
|
annotations: { destructiveHint: true },
|
|
4669
5053
|
async execute(input, ctx) {
|
|
4670
5054
|
return ctx.client.post("project_leave", void 0, {
|
|
@@ -4678,8 +5062,8 @@ var projectsLeave = {
|
|
|
4678
5062
|
};
|
|
4679
5063
|
|
|
4680
5064
|
// src/commands/projects/list.ts
|
|
4681
|
-
import { z as
|
|
4682
|
-
var inputSchema78 =
|
|
5065
|
+
import { z as z81 } from "zod";
|
|
5066
|
+
var inputSchema78 = z81.object({
|
|
4683
5067
|
...paginationInput
|
|
4684
5068
|
});
|
|
4685
5069
|
var projectsList = {
|
|
@@ -4687,7 +5071,7 @@ var projectsList = {
|
|
|
4687
5071
|
group: "projects",
|
|
4688
5072
|
description: "List all projects accessible to the current user",
|
|
4689
5073
|
inputSchema: inputSchema78,
|
|
4690
|
-
outputSchema:
|
|
5074
|
+
outputSchema: z81.any(),
|
|
4691
5075
|
annotations: { readOnlyHint: true },
|
|
4692
5076
|
async execute(input, ctx) {
|
|
4693
5077
|
return ctx.client.get("projects", {
|
|
@@ -4701,16 +5085,16 @@ var projectsList = {
|
|
|
4701
5085
|
};
|
|
4702
5086
|
|
|
4703
5087
|
// src/commands/projects/members.ts
|
|
4704
|
-
import { z as
|
|
4705
|
-
var inputSchema79 =
|
|
4706
|
-
projectId:
|
|
5088
|
+
import { z as z82 } from "zod";
|
|
5089
|
+
var inputSchema79 = z82.object({
|
|
5090
|
+
projectId: z82.string().uuid().describe("Project ID")
|
|
4707
5091
|
});
|
|
4708
5092
|
var projectsMembers = {
|
|
4709
5093
|
name: "projects.members",
|
|
4710
5094
|
group: "projects",
|
|
4711
5095
|
description: "List members of a project",
|
|
4712
5096
|
inputSchema: inputSchema79,
|
|
4713
|
-
outputSchema:
|
|
5097
|
+
outputSchema: z82.any(),
|
|
4714
5098
|
annotations: { readOnlyHint: true },
|
|
4715
5099
|
async execute(input, ctx) {
|
|
4716
5100
|
return ctx.client.get("project_members", {
|
|
@@ -4724,17 +5108,17 @@ var projectsMembers = {
|
|
|
4724
5108
|
};
|
|
4725
5109
|
|
|
4726
5110
|
// src/commands/projects/remove-member.ts
|
|
4727
|
-
import { z as
|
|
4728
|
-
var inputSchema80 =
|
|
4729
|
-
projectId:
|
|
4730
|
-
userId:
|
|
5111
|
+
import { z as z83 } from "zod";
|
|
5112
|
+
var inputSchema80 = z83.object({
|
|
5113
|
+
projectId: z83.string().uuid().describe("Project ID"),
|
|
5114
|
+
userId: z83.string().uuid().describe("User ID to remove")
|
|
4731
5115
|
});
|
|
4732
5116
|
var projectsRemoveMember = {
|
|
4733
5117
|
name: "projects.removeMember",
|
|
4734
5118
|
group: "projects",
|
|
4735
5119
|
description: "Remove a member from a project",
|
|
4736
5120
|
inputSchema: inputSchema80,
|
|
4737
|
-
outputSchema:
|
|
5121
|
+
outputSchema: z83.any(),
|
|
4738
5122
|
annotations: { destructiveHint: true },
|
|
4739
5123
|
async execute(input, ctx) {
|
|
4740
5124
|
await ctx.client.del("project_member", {
|
|
@@ -4750,19 +5134,19 @@ var projectsRemoveMember = {
|
|
|
4750
5134
|
|
|
4751
5135
|
// src/commands/projects/update.ts
|
|
4752
5136
|
init_errors();
|
|
4753
|
-
import { z as
|
|
4754
|
-
var inputSchema81 =
|
|
4755
|
-
projectId:
|
|
4756
|
-
name:
|
|
4757
|
-
description:
|
|
4758
|
-
icon:
|
|
5137
|
+
import { z as z84 } from "zod";
|
|
5138
|
+
var inputSchema81 = z84.object({
|
|
5139
|
+
projectId: z84.string().uuid().describe("Project ID"),
|
|
5140
|
+
name: z84.string().min(1).optional().describe("New project name"),
|
|
5141
|
+
description: z84.string().optional().describe("New project description"),
|
|
5142
|
+
icon: z84.string().optional().describe("New project icon")
|
|
4759
5143
|
});
|
|
4760
5144
|
var projectsUpdate = {
|
|
4761
5145
|
name: "projects.update",
|
|
4762
5146
|
group: "projects",
|
|
4763
5147
|
description: "Update an existing project",
|
|
4764
5148
|
inputSchema: inputSchema81,
|
|
4765
|
-
outputSchema:
|
|
5149
|
+
outputSchema: z84.any(),
|
|
4766
5150
|
annotations: { idempotentHint: true },
|
|
4767
5151
|
async execute(input, ctx) {
|
|
4768
5152
|
const { projectId, ...fields } = input;
|
|
@@ -4783,18 +5167,18 @@ var projectsUpdate = {
|
|
|
4783
5167
|
};
|
|
4784
5168
|
|
|
4785
5169
|
// src/commands/projects/update-role.ts
|
|
4786
|
-
import { z as
|
|
4787
|
-
var inputSchema82 =
|
|
4788
|
-
projectId:
|
|
4789
|
-
userId:
|
|
4790
|
-
role:
|
|
5170
|
+
import { z as z85 } from "zod";
|
|
5171
|
+
var inputSchema82 = z85.object({
|
|
5172
|
+
projectId: z85.string().uuid().describe("Project ID"),
|
|
5173
|
+
userId: z85.string().uuid().describe("User ID of the member"),
|
|
5174
|
+
role: z85.string().min(1).describe("New role to assign")
|
|
4791
5175
|
});
|
|
4792
5176
|
var projectsUpdateRole = {
|
|
4793
5177
|
name: "projects.updateRole",
|
|
4794
5178
|
group: "projects",
|
|
4795
5179
|
description: "Update a project member's role",
|
|
4796
5180
|
inputSchema: inputSchema82,
|
|
4797
|
-
outputSchema:
|
|
5181
|
+
outputSchema: z85.any(),
|
|
4798
5182
|
annotations: { idempotentHint: true },
|
|
4799
5183
|
async execute(input, ctx) {
|
|
4800
5184
|
return ctx.client.put(
|
|
@@ -4826,18 +5210,19 @@ function registerProjectCommands() {
|
|
|
4826
5210
|
}
|
|
4827
5211
|
|
|
4828
5212
|
// src/commands/protocols/generate.ts
|
|
4829
|
-
import { z as
|
|
4830
|
-
var inputSchema83 =
|
|
4831
|
-
description:
|
|
4832
|
-
title:
|
|
4833
|
-
project:
|
|
5213
|
+
import { z as z86 } from "zod";
|
|
5214
|
+
var inputSchema83 = z86.object({
|
|
5215
|
+
description: z86.string().min(10).max(5e3).describe("Protocol description"),
|
|
5216
|
+
title: z86.string().max(200).optional().describe("Task title (defaults to first 100 chars of description)"),
|
|
5217
|
+
project: z86.string().uuid().optional().describe("Project UUID to associate with")
|
|
4834
5218
|
});
|
|
4835
5219
|
var protocolsGenerate = {
|
|
4836
5220
|
name: "protocols.generate",
|
|
4837
5221
|
group: "protocols",
|
|
4838
5222
|
description: "Generate a bioprotocol \u2014 creates a task and sends the description in one call",
|
|
5223
|
+
stdinField: "description",
|
|
4839
5224
|
inputSchema: inputSchema83,
|
|
4840
|
-
outputSchema:
|
|
5225
|
+
outputSchema: z86.any(),
|
|
4841
5226
|
annotations: { mcpScopes: ["tasks:write", "messages:write"] },
|
|
4842
5227
|
async execute(input, ctx) {
|
|
4843
5228
|
const body = { title: input.title || input.description.slice(0, 100) };
|
|
@@ -4871,17 +5256,18 @@ function registerProtocolCommands() {
|
|
|
4871
5256
|
}
|
|
4872
5257
|
|
|
4873
5258
|
// src/commands/search/all.ts
|
|
4874
|
-
import { z as
|
|
4875
|
-
var inputSchema84 =
|
|
4876
|
-
query:
|
|
5259
|
+
import { z as z87 } from "zod";
|
|
5260
|
+
var inputSchema84 = z87.object({
|
|
5261
|
+
query: z87.string().min(1).describe("Search query"),
|
|
4877
5262
|
...paginationInput
|
|
4878
5263
|
});
|
|
4879
5264
|
var searchAll = {
|
|
4880
5265
|
name: "search.all",
|
|
4881
5266
|
group: "search",
|
|
4882
5267
|
description: "Search across all entities",
|
|
5268
|
+
stdinField: "query",
|
|
4883
5269
|
inputSchema: inputSchema84,
|
|
4884
|
-
outputSchema:
|
|
5270
|
+
outputSchema: z87.any(),
|
|
4885
5271
|
annotations: { readOnlyHint: true },
|
|
4886
5272
|
async execute(input, ctx) {
|
|
4887
5273
|
return ctx.client.get("search_all", {
|
|
@@ -4895,18 +5281,19 @@ var searchAll = {
|
|
|
4895
5281
|
};
|
|
4896
5282
|
|
|
4897
5283
|
// src/commands/search/file-content.ts
|
|
4898
|
-
import { z as
|
|
4899
|
-
var inputSchema85 =
|
|
4900
|
-
query:
|
|
4901
|
-
projectId:
|
|
5284
|
+
import { z as z88 } from "zod";
|
|
5285
|
+
var inputSchema85 = z88.object({
|
|
5286
|
+
query: z88.string().min(1).describe("Search query"),
|
|
5287
|
+
projectId: z88.string().uuid().optional().describe("Filter by project ID"),
|
|
4902
5288
|
...paginationInput
|
|
4903
5289
|
});
|
|
4904
5290
|
var searchFileContent = {
|
|
4905
5291
|
name: "search.fileContent",
|
|
4906
5292
|
group: "search",
|
|
4907
5293
|
description: "Search within file contents",
|
|
5294
|
+
stdinField: "query",
|
|
4908
5295
|
inputSchema: inputSchema85,
|
|
4909
|
-
outputSchema:
|
|
5296
|
+
outputSchema: z88.any(),
|
|
4910
5297
|
annotations: { readOnlyHint: true },
|
|
4911
5298
|
async execute(input, ctx) {
|
|
4912
5299
|
const queryParams = {
|
|
@@ -4924,17 +5311,18 @@ var searchFileContent = {
|
|
|
4924
5311
|
};
|
|
4925
5312
|
|
|
4926
5313
|
// src/commands/search/files.ts
|
|
4927
|
-
import { z as
|
|
4928
|
-
var inputSchema86 =
|
|
4929
|
-
query:
|
|
5314
|
+
import { z as z89 } from "zod";
|
|
5315
|
+
var inputSchema86 = z89.object({
|
|
5316
|
+
query: z89.string().min(1).describe("Search query"),
|
|
4930
5317
|
...paginationInput
|
|
4931
5318
|
});
|
|
4932
5319
|
var searchFiles = {
|
|
4933
5320
|
name: "search.files",
|
|
4934
5321
|
group: "search",
|
|
4935
5322
|
description: "Search files by query",
|
|
5323
|
+
stdinField: "query",
|
|
4936
5324
|
inputSchema: inputSchema86,
|
|
4937
|
-
outputSchema:
|
|
5325
|
+
outputSchema: z89.any(),
|
|
4938
5326
|
annotations: { readOnlyHint: true },
|
|
4939
5327
|
async execute(input, ctx) {
|
|
4940
5328
|
return ctx.client.get("search_files", {
|
|
@@ -4948,17 +5336,18 @@ var searchFiles = {
|
|
|
4948
5336
|
};
|
|
4949
5337
|
|
|
4950
5338
|
// src/commands/search/tasks.ts
|
|
4951
|
-
import { z as
|
|
4952
|
-
var inputSchema87 =
|
|
4953
|
-
query:
|
|
5339
|
+
import { z as z90 } from "zod";
|
|
5340
|
+
var inputSchema87 = z90.object({
|
|
5341
|
+
query: z90.string().min(1).describe("Search query"),
|
|
4954
5342
|
...paginationInput
|
|
4955
5343
|
});
|
|
4956
5344
|
var searchTasks = {
|
|
4957
5345
|
name: "search.tasks",
|
|
4958
5346
|
group: "search",
|
|
4959
5347
|
description: "Search tasks by query",
|
|
5348
|
+
stdinField: "query",
|
|
4960
5349
|
inputSchema: inputSchema87,
|
|
4961
|
-
outputSchema:
|
|
5350
|
+
outputSchema: z90.any(),
|
|
4962
5351
|
annotations: { readOnlyHint: true },
|
|
4963
5352
|
async execute(input, ctx) {
|
|
4964
5353
|
return ctx.client.get("search_tasks", {
|
|
@@ -4977,16 +5366,16 @@ function registerSearchCommands() {
|
|
|
4977
5366
|
}
|
|
4978
5367
|
|
|
4979
5368
|
// src/commands/tasks/archive.ts
|
|
4980
|
-
import { z as
|
|
4981
|
-
var inputSchema88 =
|
|
4982
|
-
taskId:
|
|
5369
|
+
import { z as z91 } from "zod";
|
|
5370
|
+
var inputSchema88 = z91.object({
|
|
5371
|
+
taskId: z91.string().uuid().describe("Task ID to archive")
|
|
4983
5372
|
});
|
|
4984
5373
|
var tasksArchive = {
|
|
4985
5374
|
name: "tasks.archive",
|
|
4986
5375
|
group: "tasks",
|
|
4987
5376
|
description: "Archive (delete) a task",
|
|
4988
5377
|
inputSchema: inputSchema88,
|
|
4989
|
-
outputSchema:
|
|
5378
|
+
outputSchema: z91.any(),
|
|
4990
5379
|
annotations: { destructiveHint: true },
|
|
4991
5380
|
async execute(input, ctx) {
|
|
4992
5381
|
await ctx.client.del("task", {
|
|
@@ -5001,7 +5390,7 @@ var tasksArchive = {
|
|
|
5001
5390
|
};
|
|
5002
5391
|
|
|
5003
5392
|
// src/commands/tasks/create.ts
|
|
5004
|
-
import { z as
|
|
5393
|
+
import { z as z92 } from "zod";
|
|
5005
5394
|
|
|
5006
5395
|
// src/lib/poll.ts
|
|
5007
5396
|
init_errors();
|
|
@@ -5131,8 +5520,10 @@ var StreamRenderer = class {
|
|
|
5131
5520
|
spinnerFrame = 0;
|
|
5132
5521
|
currentLabel = "";
|
|
5133
5522
|
useColor;
|
|
5134
|
-
|
|
5523
|
+
quiet;
|
|
5524
|
+
constructor(opts) {
|
|
5135
5525
|
this.useColor = isColorEnabled();
|
|
5526
|
+
this.quiet = opts?.quiet ?? false;
|
|
5136
5527
|
}
|
|
5137
5528
|
renderEvent(event) {
|
|
5138
5529
|
switch (event.type) {
|
|
@@ -5173,6 +5564,7 @@ ${this.useColor ? pc5.yellow("Stream timed out.") : "Stream timed out."}
|
|
|
5173
5564
|
}
|
|
5174
5565
|
}
|
|
5175
5566
|
startSpinner(label) {
|
|
5567
|
+
if (this.quiet) return;
|
|
5176
5568
|
this.stopSpinner();
|
|
5177
5569
|
this.currentLabel = label;
|
|
5178
5570
|
this.spinnerFrame = 0;
|
|
@@ -5204,19 +5596,20 @@ ${this.useColor ? pc5.yellow("Stream timed out.") : "Stream timed out."}
|
|
|
5204
5596
|
};
|
|
5205
5597
|
|
|
5206
5598
|
// src/commands/tasks/create.ts
|
|
5207
|
-
var inputSchema89 =
|
|
5208
|
-
project:
|
|
5209
|
-
title:
|
|
5210
|
-
message:
|
|
5211
|
-
wait:
|
|
5212
|
-
stream:
|
|
5599
|
+
var inputSchema89 = z92.object({
|
|
5600
|
+
project: z92.string().uuid().describe("Project ID"),
|
|
5601
|
+
title: z92.string().optional().describe("Task title"),
|
|
5602
|
+
message: z92.string().optional().describe("Initial message"),
|
|
5603
|
+
wait: z92.boolean().default(false).describe("Wait for agent response (polling)"),
|
|
5604
|
+
stream: z92.boolean().default(false).describe("Stream agent response in real-time (SSE)")
|
|
5213
5605
|
});
|
|
5214
5606
|
var tasksCreate = {
|
|
5215
5607
|
name: "tasks.create",
|
|
5216
5608
|
group: "tasks",
|
|
5217
5609
|
description: "Create a new task in a project",
|
|
5610
|
+
stdinField: "message",
|
|
5218
5611
|
inputSchema: inputSchema89,
|
|
5219
|
-
outputSchema:
|
|
5612
|
+
outputSchema: z92.any(),
|
|
5220
5613
|
async execute(input, ctx) {
|
|
5221
5614
|
const result = await ctx.client.post("tasks", {
|
|
5222
5615
|
projectId: input.project,
|
|
@@ -5244,7 +5637,7 @@ var tasksCreate = {
|
|
|
5244
5637
|
if (input.stream) {
|
|
5245
5638
|
try {
|
|
5246
5639
|
const apiKey = resolveApiKey(ctx.profileName);
|
|
5247
|
-
const renderer = new StreamRenderer();
|
|
5640
|
+
const renderer = new StreamRenderer({ quiet: ctx.output.quiet });
|
|
5248
5641
|
for await (const event of streamTask(taskId, apiKey)) {
|
|
5249
5642
|
renderer.renderEvent(event);
|
|
5250
5643
|
}
|
|
@@ -5266,16 +5659,16 @@ var tasksCreate = {
|
|
|
5266
5659
|
};
|
|
5267
5660
|
|
|
5268
5661
|
// src/commands/tasks/get.ts
|
|
5269
|
-
import { z as
|
|
5270
|
-
var inputSchema90 =
|
|
5271
|
-
taskId:
|
|
5662
|
+
import { z as z93 } from "zod";
|
|
5663
|
+
var inputSchema90 = z93.object({
|
|
5664
|
+
taskId: z93.string().uuid().describe("Task ID")
|
|
5272
5665
|
});
|
|
5273
5666
|
var tasksGet = {
|
|
5274
5667
|
name: "tasks.get",
|
|
5275
5668
|
group: "tasks",
|
|
5276
5669
|
description: "Get details of a specific task",
|
|
5277
5670
|
inputSchema: inputSchema90,
|
|
5278
|
-
outputSchema:
|
|
5671
|
+
outputSchema: z93.any(),
|
|
5279
5672
|
annotations: { readOnlyHint: true },
|
|
5280
5673
|
async execute(input, ctx) {
|
|
5281
5674
|
return ctx.client.get("task", {
|
|
@@ -5289,9 +5682,9 @@ var tasksGet = {
|
|
|
5289
5682
|
};
|
|
5290
5683
|
|
|
5291
5684
|
// src/commands/tasks/list.ts
|
|
5292
|
-
import { z as
|
|
5293
|
-
var inputSchema91 =
|
|
5294
|
-
project:
|
|
5685
|
+
import { z as z94 } from "zod";
|
|
5686
|
+
var inputSchema91 = z94.object({
|
|
5687
|
+
project: z94.string().uuid().optional().describe("Project ID to filter by"),
|
|
5295
5688
|
...paginationInput
|
|
5296
5689
|
});
|
|
5297
5690
|
var tasksList = {
|
|
@@ -5299,7 +5692,7 @@ var tasksList = {
|
|
|
5299
5692
|
group: "tasks",
|
|
5300
5693
|
description: "List tasks, optionally filtered by project",
|
|
5301
5694
|
inputSchema: inputSchema91,
|
|
5302
|
-
outputSchema:
|
|
5695
|
+
outputSchema: z94.any(),
|
|
5303
5696
|
annotations: { readOnlyHint: true },
|
|
5304
5697
|
async execute(input, ctx) {
|
|
5305
5698
|
if (input.project) {
|
|
@@ -5319,18 +5712,18 @@ var tasksList = {
|
|
|
5319
5712
|
};
|
|
5320
5713
|
|
|
5321
5714
|
// src/commands/tasks/messages.ts
|
|
5322
|
-
import { z as
|
|
5323
|
-
var inputSchema92 =
|
|
5324
|
-
taskId:
|
|
5325
|
-
cursor:
|
|
5326
|
-
limit:
|
|
5715
|
+
import { z as z95 } from "zod";
|
|
5716
|
+
var inputSchema92 = z95.object({
|
|
5717
|
+
taskId: z95.string().uuid().describe("Task ID"),
|
|
5718
|
+
cursor: z95.string().optional().describe("Pagination cursor"),
|
|
5719
|
+
limit: z95.number().int().min(1).max(100).default(50).describe("Results per page")
|
|
5327
5720
|
});
|
|
5328
5721
|
var tasksMessages = {
|
|
5329
5722
|
name: "tasks.messages",
|
|
5330
5723
|
group: "tasks",
|
|
5331
5724
|
description: "List messages for a task",
|
|
5332
5725
|
inputSchema: inputSchema92,
|
|
5333
|
-
outputSchema:
|
|
5726
|
+
outputSchema: z95.any(),
|
|
5334
5727
|
annotations: { readOnlyHint: true },
|
|
5335
5728
|
async execute(input, ctx) {
|
|
5336
5729
|
const queryParams = { limit: input.limit };
|
|
@@ -5349,22 +5742,23 @@ var tasksMessages = {
|
|
|
5349
5742
|
};
|
|
5350
5743
|
|
|
5351
5744
|
// src/commands/tasks/send.ts
|
|
5352
|
-
import { z as
|
|
5745
|
+
import { z as z96 } from "zod";
|
|
5353
5746
|
init_profiles();
|
|
5354
5747
|
var UUID_RE2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
5355
|
-
var inputSchema93 =
|
|
5356
|
-
taskId:
|
|
5357
|
-
message:
|
|
5358
|
-
fileRefs:
|
|
5359
|
-
wait:
|
|
5360
|
-
stream:
|
|
5748
|
+
var inputSchema93 = z96.object({
|
|
5749
|
+
taskId: z96.string().uuid().describe("Task ID"),
|
|
5750
|
+
message: z96.string().min(1).describe("Message content"),
|
|
5751
|
+
fileRefs: z96.string().optional().describe("Comma-separated file reference UUIDs"),
|
|
5752
|
+
wait: z96.boolean().default(false).describe("Wait for agent response (polling)"),
|
|
5753
|
+
stream: z96.boolean().default(false).describe("Stream agent response in real-time (SSE)")
|
|
5361
5754
|
});
|
|
5362
5755
|
var tasksSend = {
|
|
5363
5756
|
name: "tasks.send",
|
|
5364
5757
|
group: "tasks",
|
|
5365
5758
|
description: "Send a message to a task",
|
|
5759
|
+
stdinField: "message",
|
|
5366
5760
|
inputSchema: inputSchema93,
|
|
5367
|
-
outputSchema:
|
|
5761
|
+
outputSchema: z96.any(),
|
|
5368
5762
|
async execute(input, ctx) {
|
|
5369
5763
|
let referencedFileIds;
|
|
5370
5764
|
if (input.fileRefs) {
|
|
@@ -5398,7 +5792,7 @@ var tasksSend = {
|
|
|
5398
5792
|
if (input.stream) {
|
|
5399
5793
|
try {
|
|
5400
5794
|
const apiKey = resolveApiKey(ctx.profileName);
|
|
5401
|
-
const renderer = new StreamRenderer();
|
|
5795
|
+
const renderer = new StreamRenderer({ quiet: ctx.output.quiet });
|
|
5402
5796
|
for await (const event of streamTask(input.taskId, apiKey)) {
|
|
5403
5797
|
renderer.renderEvent(event);
|
|
5404
5798
|
}
|
|
@@ -5421,18 +5815,18 @@ var tasksSend = {
|
|
|
5421
5815
|
|
|
5422
5816
|
// src/commands/tasks/update.ts
|
|
5423
5817
|
init_errors();
|
|
5424
|
-
import { z as
|
|
5425
|
-
var inputSchema94 =
|
|
5426
|
-
taskId:
|
|
5427
|
-
title:
|
|
5428
|
-
status:
|
|
5818
|
+
import { z as z97 } from "zod";
|
|
5819
|
+
var inputSchema94 = z97.object({
|
|
5820
|
+
taskId: z97.string().uuid().describe("Task ID"),
|
|
5821
|
+
title: z97.string().min(1).optional().describe("New task title"),
|
|
5822
|
+
status: z97.string().optional().describe("New task status")
|
|
5429
5823
|
});
|
|
5430
5824
|
var tasksUpdate = {
|
|
5431
5825
|
name: "tasks.update",
|
|
5432
5826
|
group: "tasks",
|
|
5433
5827
|
description: "Update an existing task",
|
|
5434
5828
|
inputSchema: inputSchema94,
|
|
5435
|
-
outputSchema:
|
|
5829
|
+
outputSchema: z97.any(),
|
|
5436
5830
|
annotations: { idempotentHint: true },
|
|
5437
5831
|
async execute(input, ctx) {
|
|
5438
5832
|
const { taskId, ...fields } = input;
|
|
@@ -5512,6 +5906,31 @@ function buildRegistry() {
|
|
|
5512
5906
|
return registry2;
|
|
5513
5907
|
}
|
|
5514
5908
|
|
|
5909
|
+
// src/lib/banner.ts
|
|
5910
|
+
init_config();
|
|
5911
|
+
import pc6 from "picocolors";
|
|
5912
|
+
function renderBanner() {
|
|
5913
|
+
const label = "ELNORA \xB7 AI Platform CLI";
|
|
5914
|
+
const inner = ` ${label} `;
|
|
5915
|
+
const bar = "\u2500".repeat(inner.length);
|
|
5916
|
+
const box = [`\u250C${bar}\u2510`, `\u2502${inner}\u2502`, `\u2514${bar}\u2518`].join("\n");
|
|
5917
|
+
const head = isColorEnabled() ? pc6.cyan(box) : box;
|
|
5918
|
+
return `${head}
|
|
5919
|
+
v${VERSION}`;
|
|
5920
|
+
}
|
|
5921
|
+
function maybePrintBanner(argv) {
|
|
5922
|
+
if (process.env.CI || process.env.GITHUB_ACTIONS) return;
|
|
5923
|
+
if (!process.stderr.isTTY) return;
|
|
5924
|
+
const args = argv.slice(2);
|
|
5925
|
+
if (args.includes("--quiet")) return;
|
|
5926
|
+
const isBare = args.length === 0;
|
|
5927
|
+
const isTopHelp = args.length === 1 && (args[0] === "--help" || args[0] === "-h");
|
|
5928
|
+
if (!isBare && !isTopHelp) return;
|
|
5929
|
+
process.stderr.write(`${renderBanner()}
|
|
5930
|
+
|
|
5931
|
+
`);
|
|
5932
|
+
}
|
|
5933
|
+
|
|
5515
5934
|
// src/cli.ts
|
|
5516
5935
|
init_errors();
|
|
5517
5936
|
process.on("uncaughtException", (err) => {
|
|
@@ -5536,13 +5955,19 @@ process.on("unhandledRejection", (reason) => {
|
|
|
5536
5955
|
process.exitCode = 1;
|
|
5537
5956
|
});
|
|
5538
5957
|
var registry = buildRegistry();
|
|
5958
|
+
if (process.argv.includes("--no-color") && !process.env.NO_COLOR) {
|
|
5959
|
+
process.env.NO_COLOR = "1";
|
|
5960
|
+
}
|
|
5961
|
+
var quiet = process.argv.includes("--quiet");
|
|
5962
|
+
maybePrintBanner(process.argv);
|
|
5539
5963
|
var program = buildProgram(registry);
|
|
5540
5964
|
addMcpCommands(program, registry);
|
|
5541
5965
|
addDoctorCommand(program);
|
|
5542
5966
|
addWhoamiCommand(program);
|
|
5967
|
+
addConfigCommand(program);
|
|
5543
5968
|
addOpenCommand(program);
|
|
5544
5969
|
addSetupCommand(program);
|
|
5545
5970
|
addUpdateCommand(program);
|
|
5546
5971
|
addCompletionCommand(program);
|
|
5547
|
-
registerUpdateCheck();
|
|
5972
|
+
registerUpdateCheck(quiet);
|
|
5548
5973
|
program.parseAsync(process.argv);
|