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