@elnora-ai/cli 2.0.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -4
- package/dist/cli.js +1138 -616
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -21,14 +21,16 @@ function buildUrl(endpointKey, params, baseUrl) {
|
|
|
21
21
|
}
|
|
22
22
|
return `${baseUrl ?? BASE_URL}${resolved}`;
|
|
23
23
|
}
|
|
24
|
-
var VERSION, PRODUCTION_BASE_URL, BASE_URL, AI_SERVER_URL, ENDPOINTS, DEFAULT_HEADERS;
|
|
24
|
+
var VERSION, PRODUCTION_BASE_URL, BASE_URL, AI_SERVER_URL, PRODUCTION_MCP_URL, MCP_URL, ENDPOINTS, DEFAULT_HEADERS;
|
|
25
25
|
var init_config = __esm({
|
|
26
26
|
"src/lib/config.ts"() {
|
|
27
27
|
"use strict";
|
|
28
|
-
VERSION = true ? "2.0
|
|
28
|
+
VERSION = true ? "2.1.0" : process.env.npm_package_version ?? "0.0.0-dev";
|
|
29
29
|
PRODUCTION_BASE_URL = "https://platform.elnora.ai/api/v1";
|
|
30
30
|
BASE_URL = process.env.ELNORA_API_URL ?? PRODUCTION_BASE_URL;
|
|
31
31
|
AI_SERVER_URL = process.env.ELNORA_AI_SERVER_URL ?? "https://platform.elnora.ai/ai-server";
|
|
32
|
+
PRODUCTION_MCP_URL = "https://mcp.elnora.ai/mcp";
|
|
33
|
+
MCP_URL = process.env.ELNORA_MCP_URL ?? PRODUCTION_MCP_URL;
|
|
32
34
|
ENDPOINTS = {
|
|
33
35
|
// Projects
|
|
34
36
|
projects: "/projects",
|
|
@@ -124,6 +126,7 @@ var init_config = __esm({
|
|
|
124
126
|
});
|
|
125
127
|
|
|
126
128
|
// src/lib/errors.ts
|
|
129
|
+
import { z } from "zod";
|
|
127
130
|
function scrub(text) {
|
|
128
131
|
let result = text;
|
|
129
132
|
const envKeys = ["ELNORA_API_KEY", "ELNORA_MCP_API_KEY"];
|
|
@@ -185,7 +188,20 @@ function formatErrorForHuman(err) {
|
|
|
185
188
|
}
|
|
186
189
|
return lines.join("\n");
|
|
187
190
|
}
|
|
188
|
-
|
|
191
|
+
function toValidationError(err) {
|
|
192
|
+
if (err instanceof z.ZodError) {
|
|
193
|
+
const first = err.issues[0];
|
|
194
|
+
const field = first?.path.length ? first.path.join(".") : "input";
|
|
195
|
+
const message = first?.message ?? "Invalid input";
|
|
196
|
+
const more = err.issues.length > 1 ? ` (+${err.issues.length - 1} more)` : "";
|
|
197
|
+
return new ValidationError(
|
|
198
|
+
`${field}: ${message}${more}`,
|
|
199
|
+
"Run the command with --help to see the expected inputs."
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
return err instanceof Error ? err : new Error(String(err));
|
|
203
|
+
}
|
|
204
|
+
var ElnoraError, AuthError, NotFoundError, RateLimitError, ValidationError, ServerError, NetworkError, EXIT_CODES, SCRUB_KEY_VALUE_RE, SCRUB_LONG_TOKEN_RE;
|
|
189
205
|
var init_errors = __esm({
|
|
190
206
|
"src/lib/errors.ts"() {
|
|
191
207
|
"use strict";
|
|
@@ -241,6 +257,19 @@ var init_errors = __esm({
|
|
|
241
257
|
this.name = "ServerError";
|
|
242
258
|
}
|
|
243
259
|
};
|
|
260
|
+
NetworkError = class extends ElnoraError {
|
|
261
|
+
host;
|
|
262
|
+
constructor(host, cause) {
|
|
263
|
+
const target = host ? ` reaching ${host}` : "";
|
|
264
|
+
const reason = cause ? ` (${cause})` : "";
|
|
265
|
+
super(`Network error${target}${reason}`, {
|
|
266
|
+
code: "NETWORK_ERROR",
|
|
267
|
+
suggestion: host ? `Run 'elnora doctor' to diagnose connectivity, then confirm ${host} is reachable from this machine.` : "Run 'elnora doctor' to diagnose connectivity."
|
|
268
|
+
});
|
|
269
|
+
this.name = "NetworkError";
|
|
270
|
+
this.host = host;
|
|
271
|
+
}
|
|
272
|
+
};
|
|
244
273
|
EXIT_CODES = /* @__PURE__ */ new Map([
|
|
245
274
|
[ValidationError, 2],
|
|
246
275
|
[AuthError, 3],
|
|
@@ -624,16 +653,17 @@ var init_client = __esm({
|
|
|
624
653
|
});
|
|
625
654
|
} catch (err) {
|
|
626
655
|
if (err instanceof ElnoraError) throw err;
|
|
656
|
+
let host;
|
|
657
|
+
try {
|
|
658
|
+
host = new URL(url).hostname;
|
|
659
|
+
} catch {
|
|
660
|
+
host = void 0;
|
|
661
|
+
}
|
|
627
662
|
if (err instanceof DOMException && err.name === "TimeoutError") {
|
|
628
|
-
throw new
|
|
629
|
-
code: "TIMEOUT",
|
|
630
|
-
suggestion: "Check your internet connection and try again."
|
|
631
|
-
});
|
|
663
|
+
throw new NetworkError(host, `timed out after ${this.timeout}ms`);
|
|
632
664
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
suggestion: "Check your internet connection and try again."
|
|
636
|
-
});
|
|
665
|
+
const causeCode = err instanceof Error && err.cause && typeof err.cause === "object" && "code" in err.cause ? String(err.cause.code) : err instanceof Error ? err.message : String(err);
|
|
666
|
+
throw new NetworkError(host, scrub(causeCode));
|
|
637
667
|
}
|
|
638
668
|
}
|
|
639
669
|
throw new RateLimitError("Rate limit exceeded after retries");
|
|
@@ -883,6 +913,43 @@ import { Command } from "commander";
|
|
|
883
913
|
|
|
884
914
|
// src/lib/output.ts
|
|
885
915
|
init_errors();
|
|
916
|
+
|
|
917
|
+
// src/lib/tty.ts
|
|
918
|
+
function isTTY() {
|
|
919
|
+
return Boolean(process.stdout.isTTY);
|
|
920
|
+
}
|
|
921
|
+
function isColorEnabled() {
|
|
922
|
+
if (process.env.NO_COLOR !== void 0 && process.env.NO_COLOR !== "") return false;
|
|
923
|
+
if (process.env.FORCE_COLOR !== void 0) return true;
|
|
924
|
+
if (process.env.TERM === "dumb") return false;
|
|
925
|
+
return isTTY();
|
|
926
|
+
}
|
|
927
|
+
function resolveDefaultFormat() {
|
|
928
|
+
return isTTY() ? "table" : "json";
|
|
929
|
+
}
|
|
930
|
+
function hasControlChar(s) {
|
|
931
|
+
for (let i = 0; i < s.length; i++) {
|
|
932
|
+
const c = s.charCodeAt(i);
|
|
933
|
+
if (c < 32 || c === 127) return true;
|
|
934
|
+
}
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
function stripControlChars(s) {
|
|
938
|
+
let out = "";
|
|
939
|
+
for (let i = 0; i < s.length; i++) {
|
|
940
|
+
const c = s.charCodeAt(i);
|
|
941
|
+
if (c >= 32 && c !== 127) out += s[i];
|
|
942
|
+
}
|
|
943
|
+
return out;
|
|
944
|
+
}
|
|
945
|
+
function hyperlink(url, text) {
|
|
946
|
+
if (!url || !isColorEnabled()) return text;
|
|
947
|
+
const safeUrl = stripControlChars(url);
|
|
948
|
+
if (!safeUrl) return text;
|
|
949
|
+
return `\x1B]8;;${safeUrl}\x07${text}\x1B]8;;\x07`;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
// src/lib/output.ts
|
|
886
953
|
function filterFields(data, fields) {
|
|
887
954
|
if (Array.isArray(data)) {
|
|
888
955
|
return data.map((row) => {
|
|
@@ -938,21 +1005,147 @@ function toCsv(rows) {
|
|
|
938
1005
|
}
|
|
939
1006
|
return lines.join("\n");
|
|
940
1007
|
}
|
|
1008
|
+
var MAX_CELL_WIDTH = 120;
|
|
1009
|
+
function cellString(value) {
|
|
1010
|
+
if (value === null || value === void 0) return "";
|
|
1011
|
+
if (typeof value === "object") {
|
|
1012
|
+
try {
|
|
1013
|
+
return JSON.stringify(value);
|
|
1014
|
+
} catch {
|
|
1015
|
+
return String(value);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
return String(value);
|
|
1019
|
+
}
|
|
1020
|
+
function clipCell(value, max = MAX_CELL_WIDTH) {
|
|
1021
|
+
const oneLine = cellString(value).replace(/\r?\n/g, " ");
|
|
1022
|
+
return oneLine.length > max ? `${oneLine.slice(0, max - 1)}\u2026` : oneLine;
|
|
1023
|
+
}
|
|
1024
|
+
var URL_RE = /^https?:\/\/\S+$/;
|
|
1025
|
+
function linkifyCell(value) {
|
|
1026
|
+
const text = clipCell(value);
|
|
1027
|
+
if (typeof value === "string" && URL_RE.test(value) && !hasControlChar(value)) {
|
|
1028
|
+
return hyperlink(value, text);
|
|
1029
|
+
}
|
|
1030
|
+
return text;
|
|
1031
|
+
}
|
|
1032
|
+
function isListShape(data) {
|
|
1033
|
+
if (Array.isArray(data)) return true;
|
|
1034
|
+
if (typeof data === "object" && data !== null) {
|
|
1035
|
+
const obj = data;
|
|
1036
|
+
return "items" in obj && Array.isArray(obj.items);
|
|
1037
|
+
}
|
|
1038
|
+
return false;
|
|
1039
|
+
}
|
|
1040
|
+
function normalizedRows(data) {
|
|
1041
|
+
return toRows(data).map((r) => r !== null && typeof r === "object" && !Array.isArray(r) ? r : { value: r });
|
|
1042
|
+
}
|
|
1043
|
+
function unionKeys(rows) {
|
|
1044
|
+
const keys = [];
|
|
1045
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1046
|
+
for (const row of rows) {
|
|
1047
|
+
for (const k of Object.keys(row)) {
|
|
1048
|
+
if (!seen.has(k)) {
|
|
1049
|
+
keys.push(k);
|
|
1050
|
+
seen.add(k);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
return keys;
|
|
1055
|
+
}
|
|
1056
|
+
function listMeta(data) {
|
|
1057
|
+
if (data !== null && typeof data === "object" && !Array.isArray(data)) {
|
|
1058
|
+
const obj = data;
|
|
1059
|
+
if (Array.isArray(obj.items)) {
|
|
1060
|
+
return Object.entries(obj).filter(([k, v]) => k !== "items" && (v === null || typeof v !== "object"));
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
return [];
|
|
1064
|
+
}
|
|
1065
|
+
function toTable(data) {
|
|
1066
|
+
if (typeof data === "string") return data;
|
|
1067
|
+
if (!isListShape(data) && typeof data === "object" && data !== null) {
|
|
1068
|
+
const entries = Object.entries(data);
|
|
1069
|
+
if (entries.length === 0) return "(empty)";
|
|
1070
|
+
const keyWidth = Math.max(...entries.map(([k]) => k.length));
|
|
1071
|
+
return entries.map(([k, v]) => `${k.padEnd(keyWidth)} ${linkifyCell(v)}`).join("\n");
|
|
1072
|
+
}
|
|
1073
|
+
const rows = normalizedRows(data);
|
|
1074
|
+
if (rows.length === 0) return "No results.";
|
|
1075
|
+
const keys = unionKeys(rows);
|
|
1076
|
+
if (keys.length === 0) return "No results.";
|
|
1077
|
+
const widths = keys.map((k) => Math.max(k.length, ...rows.map((r) => clipCell(r[k]).length)));
|
|
1078
|
+
const renderRow = (vals) => vals.map((v, i) => v.padEnd(widths[i])).join(" ").replace(/\s+$/, "");
|
|
1079
|
+
const header = renderRow(keys);
|
|
1080
|
+
const sep = widths.map((w) => "-".repeat(w)).join(" ");
|
|
1081
|
+
const body = rows.map((r) => renderRow(keys.map((k) => clipCell(r[k]))));
|
|
1082
|
+
const table = [header, sep, ...body].join("\n");
|
|
1083
|
+
const meta = listMeta(data);
|
|
1084
|
+
return meta.length === 0 ? table : `${table}
|
|
1085
|
+
|
|
1086
|
+
${meta.map(([k, v]) => `${k}=${clipCell(v)}`).join(" ")}`;
|
|
1087
|
+
}
|
|
1088
|
+
function mdCell(value) {
|
|
1089
|
+
return cellString(value).replace(/\\/g, "\\\\").replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
|
|
1090
|
+
}
|
|
1091
|
+
function toMarkdown(data) {
|
|
1092
|
+
if (typeof data === "string") return data;
|
|
1093
|
+
if (!isListShape(data) && typeof data === "object" && data !== null) {
|
|
1094
|
+
const entries = Object.entries(data);
|
|
1095
|
+
if (entries.length === 0) return "_(empty)_";
|
|
1096
|
+
return entries.map(([k, v]) => `**${k}:** ${mdCell(v)}`).join("\n");
|
|
1097
|
+
}
|
|
1098
|
+
const rows = normalizedRows(data);
|
|
1099
|
+
if (rows.length === 0) return "_No results._";
|
|
1100
|
+
const keys = unionKeys(rows);
|
|
1101
|
+
if (keys.length === 0) return "_No results._";
|
|
1102
|
+
const head = `| ${keys.join(" | ")} |`;
|
|
1103
|
+
const divider = `| ${keys.map(() => "---").join(" | ")} |`;
|
|
1104
|
+
const body = rows.map((r) => `| ${keys.map((k) => mdCell(r[k])).join(" | ")} |`);
|
|
1105
|
+
const table = [head, divider, ...body].join("\n");
|
|
1106
|
+
const meta = listMeta(data);
|
|
1107
|
+
return meta.length === 0 ? table : `${table}
|
|
1108
|
+
|
|
1109
|
+
_${meta.map(([k, v]) => `${k}: ${mdCell(v)}`).join(", ")}_`;
|
|
1110
|
+
}
|
|
941
1111
|
function formatOutput(data, options) {
|
|
942
|
-
let output = scrubData(data);
|
|
1112
|
+
let output = typeof data === "string" ? data : scrubData(data);
|
|
943
1113
|
if (options.fields) {
|
|
944
1114
|
output = filterFields(output, options.fields);
|
|
945
1115
|
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
1116
|
+
switch (options.format) {
|
|
1117
|
+
case "csv":
|
|
1118
|
+
return toCsv(toRows(output));
|
|
1119
|
+
case "table":
|
|
1120
|
+
return toTable(output);
|
|
1121
|
+
case "markdown":
|
|
1122
|
+
return toMarkdown(output);
|
|
1123
|
+
default:
|
|
1124
|
+
return options.compact ? JSON.stringify(output) : JSON.stringify(output, null, 2);
|
|
951
1125
|
}
|
|
952
|
-
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
// src/lib/stdin.ts
|
|
1129
|
+
function readStdin() {
|
|
1130
|
+
return new Promise((resolve, reject) => {
|
|
1131
|
+
const { stdin } = process;
|
|
1132
|
+
if (stdin.isTTY) {
|
|
1133
|
+
resolve("");
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
let data = "";
|
|
1137
|
+
stdin.setEncoding("utf8");
|
|
1138
|
+
stdin.on("data", (chunk) => {
|
|
1139
|
+
data += chunk;
|
|
1140
|
+
});
|
|
1141
|
+
stdin.on("end", () => resolve(data));
|
|
1142
|
+
stdin.on("error", (err) => reject(err));
|
|
1143
|
+
stdin.resume();
|
|
1144
|
+
});
|
|
953
1145
|
}
|
|
954
1146
|
|
|
955
1147
|
// src/adapters/cli.ts
|
|
1148
|
+
var ALLOWED_FORMATS = /* @__PURE__ */ new Set(["json", "csv", "table", "markdown"]);
|
|
956
1149
|
function unwrapZodDef(schema) {
|
|
957
1150
|
const s = schema;
|
|
958
1151
|
const description = s.description ?? "";
|
|
@@ -1033,7 +1226,10 @@ function kebabToCamel(str) {
|
|
|
1033
1226
|
return str.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
1034
1227
|
}
|
|
1035
1228
|
function buildProgram(registry2) {
|
|
1036
|
-
const program2 = new Command().name("elnora").description("Elnora AI Platform CLI").version(VERSION).option("--compact", "Token-efficient minimal output", false).option(
|
|
1229
|
+
const program2 = new Command().name("elnora").description("Elnora AI Platform CLI").version(VERSION).option("--compact", "Token-efficient minimal output", false).option(
|
|
1230
|
+
"--output <format>",
|
|
1231
|
+
"Output format: json, csv, table, markdown (default: table on a terminal, json when piped)"
|
|
1232
|
+
).option("--md", "Markdown output (shorthand for --output markdown)", false).option("--fields <fields>", "Comma-separated fields to include").option("--profile <name>", "Named profile to use").option("--json", "Force JSON output (even on a terminal)", false).option("--quiet", "Suppress non-essential output (spinners, update notices)", false).option("--no-color", "Disable colored output");
|
|
1037
1233
|
for (const group of registry2.groups()) {
|
|
1038
1234
|
const groupCmd = new Command(group).description(`Manage ${group}`);
|
|
1039
1235
|
const commands = registry2.byGroup(group);
|
|
@@ -1041,17 +1237,22 @@ function buildProgram(registry2) {
|
|
|
1041
1237
|
const subName = camelToKebab(cmd.name.split(".").slice(1).join("-"));
|
|
1042
1238
|
const sub = new Command(subName).description(cmd.description);
|
|
1043
1239
|
const opts = zodToCommanderOptions(cmd.inputSchema);
|
|
1240
|
+
const fieldForFlags = (flags) => {
|
|
1241
|
+
const token = flags.trim().split(/\s+/)[0];
|
|
1242
|
+
return kebabToCamel(token.replace(/^--/, "").replace(/[<>[\]]/g, ""));
|
|
1243
|
+
};
|
|
1244
|
+
const describeOpt = (opt) => cmd.stdinField && fieldForFlags(opt.flags) === cmd.stdinField ? `${opt.description} (use '-' to read from stdin)` : opt.description;
|
|
1044
1245
|
for (const opt of opts) {
|
|
1045
1246
|
if (opt.isArgument) {
|
|
1046
|
-
sub.argument(opt.flags, opt
|
|
1247
|
+
sub.argument(opt.flags, describeOpt(opt));
|
|
1047
1248
|
}
|
|
1048
1249
|
}
|
|
1049
1250
|
for (const opt of opts) {
|
|
1050
1251
|
if (opt.isArgument) continue;
|
|
1051
1252
|
if (opt.choices) {
|
|
1052
|
-
sub.option(opt.flags, opt
|
|
1253
|
+
sub.option(opt.flags, describeOpt(opt), opt.defaultValue);
|
|
1053
1254
|
} else {
|
|
1054
|
-
sub.option(opt.flags, opt
|
|
1255
|
+
sub.option(opt.flags, describeOpt(opt), opt.defaultValue);
|
|
1055
1256
|
}
|
|
1056
1257
|
}
|
|
1057
1258
|
sub.action(async (...actionArgs) => {
|
|
@@ -1083,24 +1284,48 @@ function buildProgram(registry2) {
|
|
|
1083
1284
|
}
|
|
1084
1285
|
const skipAuth = cmd.name.startsWith("auth.login") || cmd.name === "auth.logout" || cmd.name === "auth.profiles";
|
|
1085
1286
|
const client = skipAuth ? new ElnoraApiClient("placeholder") : ElnoraApiClient.fromEnv(profileName);
|
|
1287
|
+
const compact = Boolean(parentOpts.compact);
|
|
1288
|
+
const explicitFormat = parentOpts.json ? "json" : parentOpts.md ? "markdown" : parentOpts.output;
|
|
1289
|
+
if (explicitFormat && !ALLOWED_FORMATS.has(explicitFormat)) {
|
|
1290
|
+
throw new ValidationError(
|
|
1291
|
+
`Unknown output format: ${explicitFormat}`,
|
|
1292
|
+
`Valid formats: ${[...ALLOWED_FORMATS].join(", ")}.`
|
|
1293
|
+
);
|
|
1294
|
+
}
|
|
1295
|
+
const resolvedFormat = explicitFormat ?? (compact ? "json" : resolveDefaultFormat());
|
|
1086
1296
|
const ctx = {
|
|
1087
1297
|
client,
|
|
1088
1298
|
profileName,
|
|
1089
1299
|
mode: "cli",
|
|
1090
1300
|
output: {
|
|
1091
|
-
format:
|
|
1092
|
-
compact
|
|
1093
|
-
fields: parentOpts.fields ? parentOpts.fields.split(",").map((f) => f.trim()) : void 0
|
|
1301
|
+
format: resolvedFormat,
|
|
1302
|
+
compact,
|
|
1303
|
+
fields: parentOpts.fields ? parentOpts.fields.split(",").map((f) => f.trim()) : void 0,
|
|
1304
|
+
quiet: Boolean(parentOpts.quiet)
|
|
1094
1305
|
}
|
|
1095
1306
|
};
|
|
1096
|
-
|
|
1307
|
+
if (cmd.stdinField && input[cmd.stdinField] === "-") {
|
|
1308
|
+
if (process.stdin.isTTY) {
|
|
1309
|
+
throw new ValidationError(
|
|
1310
|
+
`'-' reads ${camelToKebab(cmd.stdinField)} from stdin, but stdin is a terminal.`,
|
|
1311
|
+
"Pipe data in, e.g.: cat file.txt | elnora ... -"
|
|
1312
|
+
);
|
|
1313
|
+
}
|
|
1314
|
+
input[cmd.stdinField] = (await readStdin()).replace(/\r?\n$/, "");
|
|
1315
|
+
}
|
|
1316
|
+
let parsed;
|
|
1317
|
+
try {
|
|
1318
|
+
parsed = cmd.inputSchema.parse(input);
|
|
1319
|
+
} catch (e) {
|
|
1320
|
+
throw toValidationError(e);
|
|
1321
|
+
}
|
|
1097
1322
|
const result = await cmd.execute(parsed, ctx);
|
|
1098
1323
|
if (result != null) {
|
|
1099
1324
|
const isStreamed = typeof result === "object" && result.streamed === true;
|
|
1100
1325
|
if (!isStreamed) {
|
|
1101
|
-
const
|
|
1326
|
+
const useGeneric = Boolean(ctx.output.fields) || ctx.output.compact || ctx.output.format === "csv" || ctx.output.format === "table" || ctx.output.format === "markdown";
|
|
1102
1327
|
let formatted;
|
|
1103
|
-
if (cmd.formatOutput && !
|
|
1328
|
+
if (cmd.formatOutput && !useGeneric) {
|
|
1104
1329
|
formatted = cmd.formatOutput(result, ctx.output.format);
|
|
1105
1330
|
} else {
|
|
1106
1331
|
formatted = formatOutput(result, {
|
|
@@ -1259,33 +1484,155 @@ function addCompletionCommand(program2) {
|
|
|
1259
1484
|
});
|
|
1260
1485
|
}
|
|
1261
1486
|
|
|
1487
|
+
// src/commands/config.ts
|
|
1488
|
+
init_config();
|
|
1489
|
+
init_profiles();
|
|
1490
|
+
function resolveKeySource(profileName) {
|
|
1491
|
+
if (process.env.ELNORA_API_KEY !== void 0) return "env:ELNORA_API_KEY";
|
|
1492
|
+
if (process.env.ELNORA_MCP_API_KEY !== void 0) return "env:ELNORA_MCP_API_KEY";
|
|
1493
|
+
const profiles = loadProfiles();
|
|
1494
|
+
if (profiles[profileName]?.api_key) return `profile:${profileName}`;
|
|
1495
|
+
return "none";
|
|
1496
|
+
}
|
|
1497
|
+
function addConfigCommand(program2) {
|
|
1498
|
+
const config = program2.command("config").description("Inspect Elnora CLI configuration");
|
|
1499
|
+
config.command("show").description("Show resolved CLI configuration (endpoints, active profile, key source)").action(() => {
|
|
1500
|
+
const parentOpts = program2.opts();
|
|
1501
|
+
const profileName = parentOpts.profile ?? "default";
|
|
1502
|
+
const data = {
|
|
1503
|
+
base_url: BASE_URL,
|
|
1504
|
+
ai_server_url: AI_SERVER_URL,
|
|
1505
|
+
mcp_url: MCP_URL,
|
|
1506
|
+
active_profile: profileName,
|
|
1507
|
+
key_source: resolveKeySource(profileName)
|
|
1508
|
+
};
|
|
1509
|
+
if (parentOpts.json || !process.stdout.isTTY) {
|
|
1510
|
+
console.log(JSON.stringify(data, null, 2));
|
|
1511
|
+
return;
|
|
1512
|
+
}
|
|
1513
|
+
console.log(`base_url=${data.base_url}`);
|
|
1514
|
+
console.log(`ai_server_url=${data.ai_server_url}`);
|
|
1515
|
+
console.log(`mcp_url=${data.mcp_url}`);
|
|
1516
|
+
console.log(`active_profile=${data.active_profile}`);
|
|
1517
|
+
console.log(`key_source=${data.key_source}`);
|
|
1518
|
+
});
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1262
1521
|
// src/commands/doctor.ts
|
|
1263
1522
|
init_client();
|
|
1264
1523
|
init_config();
|
|
1265
|
-
|
|
1266
|
-
import {
|
|
1267
|
-
import { homedir as homedir4 } from "node:os";
|
|
1524
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4, statSync as statSync2 } from "node:fs";
|
|
1525
|
+
import { homedir as homedir5 } from "node:os";
|
|
1268
1526
|
import { delimiter, join as join4 } from "node:path";
|
|
1269
1527
|
import pc3 from "picocolors";
|
|
1270
1528
|
|
|
1271
|
-
// src/lib/
|
|
1272
|
-
import { existsSync as existsSync2,
|
|
1529
|
+
// src/lib/install-discovery.ts
|
|
1530
|
+
import { existsSync as existsSync2, realpathSync, statSync } from "node:fs";
|
|
1273
1531
|
import { homedir as homedir2 } from "node:os";
|
|
1274
|
-
import {
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1532
|
+
import { posix, win32 } from "node:path";
|
|
1533
|
+
var norm = (p) => p.replace(/\\/g, "/").toLowerCase();
|
|
1534
|
+
function safeRealPath(p) {
|
|
1535
|
+
try {
|
|
1536
|
+
return realpathSync(p);
|
|
1537
|
+
} catch {
|
|
1538
|
+
return p;
|
|
1539
|
+
}
|
|
1280
1540
|
}
|
|
1281
|
-
function
|
|
1282
|
-
if (
|
|
1283
|
-
|
|
1284
|
-
|
|
1541
|
+
function candidateNames(platform, pathExt) {
|
|
1542
|
+
if (platform !== "win32") return ["elnora"];
|
|
1543
|
+
const names = [];
|
|
1544
|
+
for (const raw of pathExt.split(";")) {
|
|
1545
|
+
const ext = raw.trim().toLowerCase();
|
|
1546
|
+
if (ext) names.push(`elnora${ext.startsWith(".") ? ext : `.${ext}`}`);
|
|
1547
|
+
}
|
|
1548
|
+
names.push("elnora");
|
|
1549
|
+
return [...new Set(names)];
|
|
1550
|
+
}
|
|
1551
|
+
function npmPrefix(p) {
|
|
1552
|
+
const n = norm(p);
|
|
1553
|
+
const idx = n.indexOf("/node_modules/");
|
|
1554
|
+
return idx > 0 ? n.slice(0, idx) : void 0;
|
|
1555
|
+
}
|
|
1556
|
+
function classify(realPath, home, pathMod, installDirOverride) {
|
|
1557
|
+
const p = norm(realPath);
|
|
1558
|
+
if (p.includes("/node_modules/")) return "npm";
|
|
1559
|
+
if (/\/npm\/elnora[^/]*$/.test(p)) return "npm";
|
|
1560
|
+
if (p.includes("/cellar/") || p.includes("/homebrew/")) return "homebrew";
|
|
1561
|
+
if (p.endsWith(".ts") || p.endsWith(".tsx") || p.includes("/tsx/")) return "dev";
|
|
1562
|
+
const binDirs = [pathMod.join(home, ".elnora", "bin"), pathMod.join(home, ".local", "bin"), installDirOverride].filter((d) => Boolean(d)).map(norm);
|
|
1563
|
+
if (binDirs.some((d) => p === d || p.startsWith(`${d}/`))) return "binary";
|
|
1564
|
+
return "unknown";
|
|
1565
|
+
}
|
|
1566
|
+
function discoverInstalls(env) {
|
|
1567
|
+
const pathMod = env.platform === "win32" ? win32 : posix;
|
|
1568
|
+
const dirs = env.pathVar.split(pathMod.delimiter).filter(Boolean);
|
|
1569
|
+
const names = candidateNames(env.platform, env.pathExt);
|
|
1570
|
+
const activeReals = /* @__PURE__ */ new Set();
|
|
1571
|
+
for (const candidate of [env.execPath, env.argv1]) {
|
|
1572
|
+
if (candidate) activeReals.add(norm(safeRealPath(candidate)));
|
|
1573
|
+
}
|
|
1574
|
+
const activePrefix = npmPrefix(env.argv1) ?? npmPrefix(safeRealPath(env.argv1));
|
|
1575
|
+
const byReal = /* @__PURE__ */ new Map();
|
|
1576
|
+
for (const dir of dirs) {
|
|
1577
|
+
let full;
|
|
1578
|
+
for (const name of names) {
|
|
1579
|
+
const candidate = pathMod.join(dir, name);
|
|
1580
|
+
try {
|
|
1581
|
+
if (existsSync2(candidate) && statSync(candidate).isFile()) {
|
|
1582
|
+
full = candidate;
|
|
1583
|
+
break;
|
|
1584
|
+
}
|
|
1585
|
+
} catch {
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
if (!full) continue;
|
|
1589
|
+
const realPath = safeRealPath(full);
|
|
1590
|
+
const key = norm(realPath);
|
|
1591
|
+
if (byReal.has(key)) continue;
|
|
1592
|
+
const active = activeReals.has(key) || activePrefix !== void 0 && norm(dir) === activePrefix;
|
|
1593
|
+
byReal.set(key, {
|
|
1594
|
+
path: full,
|
|
1595
|
+
realPath,
|
|
1596
|
+
pathDir: dir,
|
|
1597
|
+
source: classify(realPath, env.home, pathMod, env.installDirOverride),
|
|
1598
|
+
active
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
return [...byReal.values()];
|
|
1602
|
+
}
|
|
1603
|
+
function detectAllInstalls() {
|
|
1604
|
+
return discoverInstalls({
|
|
1605
|
+
pathVar: process.env.PATH ?? "",
|
|
1606
|
+
pathExt: process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD",
|
|
1607
|
+
platform: process.platform,
|
|
1608
|
+
home: homedir2(),
|
|
1609
|
+
execPath: process.execPath,
|
|
1610
|
+
argv1: process.argv[1] ?? "",
|
|
1611
|
+
installDirOverride: process.env.ELNORA_INSTALL_DIR
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1614
|
+
function uninstallCommandFor(install) {
|
|
1615
|
+
switch (install.source) {
|
|
1616
|
+
case "npm":
|
|
1617
|
+
return "npm uninstall -g @elnora-ai/cli";
|
|
1618
|
+
case "homebrew":
|
|
1619
|
+
return "brew uninstall elnora";
|
|
1620
|
+
case "dev":
|
|
1621
|
+
return null;
|
|
1622
|
+
default:
|
|
1623
|
+
return process.platform === "win32" ? `Remove-Item "${install.path}"` : `rm "${install.path}"`;
|
|
1624
|
+
}
|
|
1285
1625
|
}
|
|
1286
1626
|
|
|
1627
|
+
// src/commands/doctor.ts
|
|
1628
|
+
init_profiles();
|
|
1629
|
+
|
|
1287
1630
|
// src/lib/setup/common.ts
|
|
1288
|
-
|
|
1631
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
1632
|
+
import { homedir as homedir3 } from "node:os";
|
|
1633
|
+
import { join as join2 } from "node:path";
|
|
1634
|
+
import pc from "picocolors";
|
|
1635
|
+
var HOME = homedir3();
|
|
1289
1636
|
var ELNORA_DIR = join2(HOME, ".elnora");
|
|
1290
1637
|
var CLAUDE_DIR = join2(HOME, ".claude");
|
|
1291
1638
|
var CLAUDE_MARKETPLACES_FILE = join2(CLAUDE_DIR, "plugins", "known_marketplaces.json");
|
|
@@ -1299,7 +1646,7 @@ var MARKETPLACE_REPO = "Elnora-AI/elnora-plugins";
|
|
|
1299
1646
|
var MARKETPLACE_GITHUB_URL = `https://github.com/${MARKETPLACE_REPO}`;
|
|
1300
1647
|
var PLUGIN_ID = `elnora@${MARKETPLACE_NAME}`;
|
|
1301
1648
|
function readJsonFile(path) {
|
|
1302
|
-
if (!
|
|
1649
|
+
if (!existsSync3(path)) return {};
|
|
1303
1650
|
try {
|
|
1304
1651
|
return JSON.parse(readFileSync2(path, "utf-8"));
|
|
1305
1652
|
} catch (err) {
|
|
@@ -1324,25 +1671,53 @@ function info(msg) {
|
|
|
1324
1671
|
}
|
|
1325
1672
|
function detectPlatforms() {
|
|
1326
1673
|
return [
|
|
1327
|
-
{ name: "claude", label: "Claude Code", installed:
|
|
1328
|
-
{ name: "cursor", label: "Cursor", installed:
|
|
1329
|
-
{ name: "vscode", label: "VS Code", installed:
|
|
1330
|
-
{ name: "codex", label: "OpenAI Codex", installed:
|
|
1674
|
+
{ name: "claude", label: "Claude Code", installed: existsSync3(CLAUDE_DIR) },
|
|
1675
|
+
{ name: "cursor", label: "Cursor", installed: existsSync3(CURSOR_DIR) },
|
|
1676
|
+
{ name: "vscode", label: "VS Code", installed: existsSync3(VSCODE_DIR) },
|
|
1677
|
+
{ name: "codex", label: "OpenAI Codex", installed: existsSync3(CODEX_DIR) }
|
|
1331
1678
|
];
|
|
1332
1679
|
}
|
|
1333
1680
|
|
|
1334
1681
|
// src/lib/update-check.ts
|
|
1335
1682
|
init_config();
|
|
1336
|
-
import { existsSync as
|
|
1337
|
-
import { homedir as
|
|
1683
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "node:fs";
|
|
1684
|
+
import { homedir as homedir4 } from "node:os";
|
|
1338
1685
|
import { join as join3 } from "node:path";
|
|
1339
1686
|
import pc2 from "picocolors";
|
|
1687
|
+
|
|
1688
|
+
// src/lib/install-method.ts
|
|
1689
|
+
function detectInstallMethod() {
|
|
1690
|
+
const execPath = process.argv[1] ?? "";
|
|
1691
|
+
if (execPath.includes("node_modules")) {
|
|
1692
|
+
return "npm";
|
|
1693
|
+
}
|
|
1694
|
+
if (execPath.includes("/Cellar/") || execPath.includes("/homebrew/")) {
|
|
1695
|
+
return "homebrew";
|
|
1696
|
+
}
|
|
1697
|
+
return "binary";
|
|
1698
|
+
}
|
|
1699
|
+
function getUpdateInstruction(method) {
|
|
1700
|
+
switch (method) {
|
|
1701
|
+
case "npm":
|
|
1702
|
+
return "npm install -g @elnora-ai/cli@latest";
|
|
1703
|
+
case "homebrew":
|
|
1704
|
+
return "brew upgrade elnora";
|
|
1705
|
+
case "binary":
|
|
1706
|
+
return "elnora update --install";
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
// src/lib/update-check.ts
|
|
1340
1711
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org/@elnora-ai/cli/latest";
|
|
1341
|
-
var CACHE_DIR = join3(
|
|
1712
|
+
var CACHE_DIR = join3(homedir4(), ".elnora");
|
|
1342
1713
|
var CACHE_FILE = join3(CACHE_DIR, ".update-check");
|
|
1343
1714
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
1344
1715
|
var FETCH_TIMEOUT_MS = 3e3;
|
|
1345
|
-
|
|
1716
|
+
function sanitizeVersion(raw) {
|
|
1717
|
+
const m = /^(\d{1,9})\.(\d{1,9})\.(\d{1,9})$/.exec(raw);
|
|
1718
|
+
if (!m) return null;
|
|
1719
|
+
return `${Number(m[1])}.${Number(m[2])}.${Number(m[3])}`;
|
|
1720
|
+
}
|
|
1346
1721
|
function shouldSkipEntirely() {
|
|
1347
1722
|
if (process.env.CI || process.env.GITHUB_ACTIONS) return true;
|
|
1348
1723
|
if (process.env.ELNORA_NO_UPDATE_CHECK) return true;
|
|
@@ -1350,7 +1725,7 @@ function shouldSkipEntirely() {
|
|
|
1350
1725
|
}
|
|
1351
1726
|
function readCache() {
|
|
1352
1727
|
try {
|
|
1353
|
-
if (!
|
|
1728
|
+
if (!existsSync4(CACHE_FILE)) return null;
|
|
1354
1729
|
const raw = readFileSync3(CACHE_FILE, "utf-8");
|
|
1355
1730
|
return JSON.parse(raw);
|
|
1356
1731
|
} catch {
|
|
@@ -1366,13 +1741,15 @@ function writeCache(entry) {
|
|
|
1366
1741
|
}
|
|
1367
1742
|
function showUpdateNotice(latest) {
|
|
1368
1743
|
if (!process.stderr.isTTY) return;
|
|
1744
|
+
const command = getUpdateInstruction(detectInstallMethod());
|
|
1369
1745
|
const color2 = isColorEnabled();
|
|
1746
|
+
const head = `Update available: v${VERSION} \u2192 v${latest}`;
|
|
1370
1747
|
const msg = color2 ? `
|
|
1371
|
-
${pc2.yellow(
|
|
1372
|
-
Run:
|
|
1748
|
+
${pc2.yellow(head)}
|
|
1749
|
+
Run: ${command}
|
|
1373
1750
|
` : `
|
|
1374
|
-
|
|
1375
|
-
Run:
|
|
1751
|
+
${head}
|
|
1752
|
+
Run: ${command}
|
|
1376
1753
|
`;
|
|
1377
1754
|
process.stderr.write(msg);
|
|
1378
1755
|
}
|
|
@@ -1387,13 +1764,13 @@ function isNewerVersion(a, b) {
|
|
|
1387
1764
|
}
|
|
1388
1765
|
return false;
|
|
1389
1766
|
}
|
|
1390
|
-
function registerUpdateCheck() {
|
|
1767
|
+
function registerUpdateCheck(quiet2 = false) {
|
|
1391
1768
|
if (shouldSkipEntirely()) return;
|
|
1392
1769
|
const cached = readCache();
|
|
1393
1770
|
if (cached) {
|
|
1394
1771
|
const elapsed = Date.now() - new Date(cached.checkedAt).getTime();
|
|
1395
1772
|
if (elapsed < CHECK_INTERVAL_MS) {
|
|
1396
|
-
if (cached.latest && cached.latest !== VERSION && cached.latest !== "unknown") {
|
|
1773
|
+
if (!quiet2 && cached.latest && cached.latest !== VERSION && cached.latest !== "unknown") {
|
|
1397
1774
|
if (isNewerVersion(cached.latest, VERSION)) {
|
|
1398
1775
|
showUpdateNotice(cached.latest);
|
|
1399
1776
|
}
|
|
@@ -1410,10 +1787,10 @@ function registerUpdateCheck() {
|
|
|
1410
1787
|
});
|
|
1411
1788
|
if (!response.ok) return;
|
|
1412
1789
|
const data = await response.json();
|
|
1413
|
-
const latest = data.version
|
|
1414
|
-
if (
|
|
1790
|
+
const latest = data.version ? sanitizeVersion(data.version) : null;
|
|
1791
|
+
if (!latest) return;
|
|
1415
1792
|
writeCache({ checkedAt: (/* @__PURE__ */ new Date()).toISOString(), latest });
|
|
1416
|
-
if (
|
|
1793
|
+
if (!quiet2 && latest !== VERSION && isNewerVersion(latest, VERSION)) {
|
|
1417
1794
|
showUpdateNotice(latest);
|
|
1418
1795
|
}
|
|
1419
1796
|
} catch {
|
|
@@ -1478,10 +1855,10 @@ function checkConfigPermissions() {
|
|
|
1478
1855
|
if (process.platform === "win32") {
|
|
1479
1856
|
return { status: "pass", msg: "Config permissions (skipped on Windows)" };
|
|
1480
1857
|
}
|
|
1481
|
-
if (!
|
|
1858
|
+
if (!existsSync5(PROFILES_FILE)) {
|
|
1482
1859
|
return { status: "warn", msg: "Config permissions ~/.elnora/profiles.toml not found" };
|
|
1483
1860
|
}
|
|
1484
|
-
const mode =
|
|
1861
|
+
const mode = statSync2(PROFILES_FILE).mode & 511;
|
|
1485
1862
|
if (mode === 384) {
|
|
1486
1863
|
return { status: "pass", msg: `Config permissions ${PROFILES_FILE} (0600)` };
|
|
1487
1864
|
}
|
|
@@ -1496,7 +1873,7 @@ async function checkAiServerReachable() {
|
|
|
1496
1873
|
return { status: "fail", msg: `AI Server unreachable ${host} (HTTP ${res.status})` };
|
|
1497
1874
|
}
|
|
1498
1875
|
function checkPathConfigured() {
|
|
1499
|
-
const installDirs = [join4(
|
|
1876
|
+
const installDirs = [join4(homedir5(), ".local", "bin"), join4(homedir5(), ".elnora", "bin")];
|
|
1500
1877
|
const pathVar = process.env.PATH ?? "";
|
|
1501
1878
|
const entries = pathVar.split(delimiter).filter(Boolean);
|
|
1502
1879
|
const matched = installDirs.find((d) => entries.includes(d));
|
|
@@ -1508,33 +1885,64 @@ function checkPathConfigured() {
|
|
|
1508
1885
|
msg: "PATH configured standard install dirs not in PATH (OK if installed via npm/brew)"
|
|
1509
1886
|
};
|
|
1510
1887
|
}
|
|
1888
|
+
function checkShadowInstalls() {
|
|
1889
|
+
const installs = detectAllInstalls();
|
|
1890
|
+
const active = installs.find((i) => i.active);
|
|
1891
|
+
if (!active) {
|
|
1892
|
+
return { status: "skip", msg: "Shadow installs (running from a non-PATH/dev build)" };
|
|
1893
|
+
}
|
|
1894
|
+
const shadows = installs.filter((i) => !i.active && i.source !== "dev");
|
|
1895
|
+
if (shadows.length === 0) {
|
|
1896
|
+
return { status: "pass", msg: `No shadow installs ${active.path} (${active.source})` };
|
|
1897
|
+
}
|
|
1898
|
+
const lines = shadows.map((s) => {
|
|
1899
|
+
const cmd = uninstallCommandFor(s);
|
|
1900
|
+
return ` shadow: ${s.path} (${s.source})${cmd ? ` \u2014 ${cmd}` : " \u2014 remove manually"}`;
|
|
1901
|
+
});
|
|
1902
|
+
return {
|
|
1903
|
+
status: "warn",
|
|
1904
|
+
msg: `Shadow installs ${shadows.length} other elnora on PATH (active: ${active.path} [${active.source}])
|
|
1905
|
+
${lines.join("\n")}`
|
|
1906
|
+
};
|
|
1907
|
+
}
|
|
1908
|
+
function readEnabledPlugins(file) {
|
|
1909
|
+
if (!existsSync5(file)) return null;
|
|
1910
|
+
try {
|
|
1911
|
+
const settings = JSON.parse(readFileSync4(file, "utf-8"));
|
|
1912
|
+
const raw = settings.enabledPlugins;
|
|
1913
|
+
const enabledPlugins = typeof raw === "object" && raw !== null && !Array.isArray(raw) ? raw : {};
|
|
1914
|
+
return { enabledPlugins };
|
|
1915
|
+
} catch (e) {
|
|
1916
|
+
return { enabledPlugins: {}, unreadable: e instanceof Error ? e.message : "parse error" };
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1511
1919
|
function checkClaudePlugin() {
|
|
1512
|
-
if (!
|
|
1920
|
+
if (!existsSync5(CLAUDE_DIR)) {
|
|
1513
1921
|
return { status: "skip", msg: "Plugin enabled (Claude Code not installed)" };
|
|
1514
1922
|
}
|
|
1515
|
-
|
|
1923
|
+
const projectSettingsFile = join4(process.cwd(), ".claude", "settings.json");
|
|
1924
|
+
const user = readEnabledPlugins(CLAUDE_SETTINGS_FILE);
|
|
1925
|
+
const project = readEnabledPlugins(projectSettingsFile);
|
|
1926
|
+
if (!user && !project) {
|
|
1516
1927
|
return { status: "fail", msg: "Plugin enabled settings.json not found \u2014 run 'elnora setup claude'" };
|
|
1517
1928
|
}
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
settings = JSON.parse(readFileSync4(CLAUDE_SETTINGS_FILE, "utf-8"));
|
|
1521
|
-
} catch (e) {
|
|
1522
|
-
return {
|
|
1523
|
-
status: "fail",
|
|
1524
|
-
msg: `Plugin enabled settings.json unreadable (${e instanceof Error ? e.message : "parse error"})`
|
|
1525
|
-
};
|
|
1929
|
+
if (user?.unreadable && !project?.enabledPlugins[PLUGIN_ID]) {
|
|
1930
|
+
return { status: "fail", msg: `Plugin enabled settings.json unreadable (${user.unreadable})` };
|
|
1526
1931
|
}
|
|
1527
|
-
const
|
|
1528
|
-
const
|
|
1529
|
-
const isEnabled =
|
|
1530
|
-
const
|
|
1932
|
+
const userEnabled = user?.enabledPlugins[PLUGIN_ID] === true;
|
|
1933
|
+
const projectEnabled = project?.enabledPlugins[PLUGIN_ID] === true;
|
|
1934
|
+
const isEnabled = userEnabled || projectEnabled;
|
|
1935
|
+
const scope = projectEnabled ? userEnabled ? "user + project" : "project" : "user";
|
|
1936
|
+
const legacyKeys = [
|
|
1937
|
+
.../* @__PURE__ */ new Set([...Object.keys(user?.enabledPlugins ?? {}), ...Object.keys(project?.enabledPlugins ?? {})])
|
|
1938
|
+
].filter((k) => k.startsWith("elnora@") && k !== PLUGIN_ID);
|
|
1531
1939
|
if (isEnabled && legacyKeys.length === 0) {
|
|
1532
|
-
return { status: "pass", msg: `Plugin enabled ${PLUGIN_ID}` };
|
|
1940
|
+
return { status: "pass", msg: `Plugin enabled ${PLUGIN_ID} (${scope} scope)` };
|
|
1533
1941
|
}
|
|
1534
1942
|
if (isEnabled && legacyKeys.length > 0) {
|
|
1535
1943
|
return {
|
|
1536
1944
|
status: "warn",
|
|
1537
|
-
msg: `Plugin enabled ${PLUGIN_ID} \u2014 but stale legacy entries also present: ${legacyKeys.join(", ")}`
|
|
1945
|
+
msg: `Plugin enabled ${PLUGIN_ID} (${scope} scope) \u2014 but stale legacy entries also present: ${legacyKeys.join(", ")}`
|
|
1538
1946
|
};
|
|
1539
1947
|
}
|
|
1540
1948
|
if (legacyKeys.length > 0) {
|
|
@@ -1545,18 +1953,49 @@ function checkClaudePlugin() {
|
|
|
1545
1953
|
}
|
|
1546
1954
|
return { status: "fail", msg: "Plugin enabled not found \u2014 run 'elnora setup claude'" };
|
|
1547
1955
|
}
|
|
1956
|
+
function isMarketplaceRegistered() {
|
|
1957
|
+
for (const file of [CLAUDE_SETTINGS_FILE, join4(process.cwd(), ".claude", "settings.json")]) {
|
|
1958
|
+
if (!existsSync5(file)) continue;
|
|
1959
|
+
try {
|
|
1960
|
+
const settings = JSON.parse(readFileSync4(file, "utf-8"));
|
|
1961
|
+
const enabled = settings.enabledPlugins;
|
|
1962
|
+
if (typeof enabled === "object" && enabled !== null && enabled[PLUGIN_ID] === true) {
|
|
1963
|
+
return true;
|
|
1964
|
+
}
|
|
1965
|
+
const extra = settings.extraKnownMarketplaces;
|
|
1966
|
+
if (extra != null && JSON.stringify(extra).includes(MARKETPLACE_NAME)) return true;
|
|
1967
|
+
} catch {
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
const knownMarketplaces = join4(CLAUDE_DIR, "plugins", "known_marketplaces.json");
|
|
1971
|
+
if (existsSync5(knownMarketplaces)) {
|
|
1972
|
+
try {
|
|
1973
|
+
if (JSON.stringify(JSON.parse(readFileSync4(knownMarketplaces, "utf-8"))).includes(MARKETPLACE_NAME)) {
|
|
1974
|
+
return true;
|
|
1975
|
+
}
|
|
1976
|
+
} catch {
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
return false;
|
|
1980
|
+
}
|
|
1548
1981
|
function checkSkillsInstalled() {
|
|
1549
|
-
if (!
|
|
1982
|
+
if (!existsSync5(CLAUDE_DIR)) {
|
|
1550
1983
|
return { status: "skip", msg: "Skills installed (Claude Code not installed)" };
|
|
1551
1984
|
}
|
|
1552
1985
|
const skillsDir = join4(CLAUDE_DIR, "plugins", "marketplaces", MARKETPLACE_NAME, "elnora", "skills");
|
|
1553
|
-
if (!
|
|
1986
|
+
if (!existsSync5(skillsDir)) {
|
|
1987
|
+
if (isMarketplaceRegistered()) {
|
|
1988
|
+
return {
|
|
1989
|
+
status: "warn",
|
|
1990
|
+
msg: "Skills installed registered but not cloned yet \u2014 open this folder in Claude Code once to clone"
|
|
1991
|
+
};
|
|
1992
|
+
}
|
|
1554
1993
|
return {
|
|
1555
1994
|
status: "warn",
|
|
1556
|
-
msg: "Skills installed marketplace not
|
|
1995
|
+
msg: "Skills installed marketplace not registered \u2014 run 'elnora setup claude'"
|
|
1557
1996
|
};
|
|
1558
1997
|
}
|
|
1559
|
-
const found = EXPECTED_SKILLS.filter((s) =>
|
|
1998
|
+
const found = EXPECTED_SKILLS.filter((s) => existsSync5(join4(skillsDir, s, "SKILL.md")));
|
|
1560
1999
|
if (found.length === EXPECTED_SKILLS.length) {
|
|
1561
2000
|
return { status: "pass", msg: `Skills installed ${found.length} skills` };
|
|
1562
2001
|
}
|
|
@@ -1567,7 +2006,7 @@ function checkSkillsInstalled() {
|
|
|
1567
2006
|
};
|
|
1568
2007
|
}
|
|
1569
2008
|
function checkPluginVersion() {
|
|
1570
|
-
if (!
|
|
2009
|
+
if (!existsSync5(CLAUDE_DIR)) {
|
|
1571
2010
|
return { status: "skip", msg: "Plugin version (Claude Code not installed)" };
|
|
1572
2011
|
}
|
|
1573
2012
|
const pluginJsonPath = join4(
|
|
@@ -1579,7 +2018,7 @@ function checkPluginVersion() {
|
|
|
1579
2018
|
".claude-plugin",
|
|
1580
2019
|
"plugin.json"
|
|
1581
2020
|
);
|
|
1582
|
-
if (!
|
|
2021
|
+
if (!existsSync5(pluginJsonPath)) {
|
|
1583
2022
|
return { status: "skip", msg: "Plugin version (plugin not cloned yet)" };
|
|
1584
2023
|
}
|
|
1585
2024
|
try {
|
|
@@ -1601,20 +2040,21 @@ function checkPluginVersion() {
|
|
|
1601
2040
|
}
|
|
1602
2041
|
async function checkMcpReachable() {
|
|
1603
2042
|
const start = Date.now();
|
|
2043
|
+
const mcpHost = new URL(MCP_URL).hostname;
|
|
1604
2044
|
try {
|
|
1605
|
-
const res = await fetch(
|
|
2045
|
+
const res = await fetch(MCP_URL, {
|
|
1606
2046
|
method: "HEAD",
|
|
1607
2047
|
signal: AbortSignal.timeout(5e3)
|
|
1608
2048
|
});
|
|
1609
2049
|
const ms = Date.now() - start;
|
|
1610
2050
|
if (res.status < 500) {
|
|
1611
|
-
return { status: "pass", msg: `Server reachable
|
|
2051
|
+
return { status: "pass", msg: `Server reachable ${mcpHost} (${res.status}, ${ms}ms)` };
|
|
1612
2052
|
}
|
|
1613
|
-
return { status: "fail", msg: `Server unreachable
|
|
2053
|
+
return { status: "fail", msg: `Server unreachable ${mcpHost} (HTTP ${res.status})` };
|
|
1614
2054
|
} catch (e) {
|
|
1615
2055
|
return {
|
|
1616
2056
|
status: "fail",
|
|
1617
|
-
msg: `Server unreachable
|
|
2057
|
+
msg: `Server unreachable ${mcpHost} (${e instanceof Error ? e.message : "network error"})`
|
|
1618
2058
|
};
|
|
1619
2059
|
}
|
|
1620
2060
|
}
|
|
@@ -1642,16 +2082,25 @@ function addDoctorCommand(program2) {
|
|
|
1642
2082
|
Elnora CLI v${VERSION}
|
|
1643
2083
|
`);
|
|
1644
2084
|
let passed = 0;
|
|
2085
|
+
let skipped = 0;
|
|
1645
2086
|
let failed = 0;
|
|
1646
2087
|
let warnings = 0;
|
|
1647
|
-
let total = 0;
|
|
1648
2088
|
const tally = (r) => {
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
2089
|
+
switch (r.status) {
|
|
2090
|
+
case "pass":
|
|
2091
|
+
passed++;
|
|
2092
|
+
break;
|
|
2093
|
+
case "warn":
|
|
2094
|
+
passed++;
|
|
2095
|
+
warnings++;
|
|
2096
|
+
break;
|
|
2097
|
+
case "skip":
|
|
2098
|
+
skipped++;
|
|
2099
|
+
break;
|
|
2100
|
+
case "fail":
|
|
2101
|
+
failed++;
|
|
2102
|
+
break;
|
|
2103
|
+
}
|
|
1655
2104
|
};
|
|
1656
2105
|
console.error(section("CLI"));
|
|
1657
2106
|
const cliChecks = [
|
|
@@ -1660,7 +2109,8 @@ Elnora CLI v${VERSION}
|
|
|
1660
2109
|
await runCheck(() => checkVersionCurrent()),
|
|
1661
2110
|
await runCheck(() => checkConfigPermissions()),
|
|
1662
2111
|
await runCheck(() => checkAiServerReachable()),
|
|
1663
|
-
await runCheck(() => checkPathConfigured())
|
|
2112
|
+
await runCheck(() => checkPathConfigured()),
|
|
2113
|
+
await runCheck(() => checkShadowInstalls())
|
|
1664
2114
|
];
|
|
1665
2115
|
for (const r of cliChecks) {
|
|
1666
2116
|
console.error(render(r));
|
|
@@ -1685,14 +2135,15 @@ Elnora CLI v${VERSION}
|
|
|
1685
2135
|
tally(r);
|
|
1686
2136
|
}
|
|
1687
2137
|
console.error("");
|
|
1688
|
-
if (failed === 0 && warnings === 0) {
|
|
2138
|
+
if (failed === 0 && warnings === 0 && skipped === 0) {
|
|
1689
2139
|
console.error("All checks passed.");
|
|
1690
|
-
} else if (failed === 0) {
|
|
1691
|
-
console.error(`${passed}/${total} checks passed (${warnings} warning${warnings === 1 ? "" : "s"}).`);
|
|
1692
2140
|
} else {
|
|
1693
|
-
const
|
|
1694
|
-
|
|
1695
|
-
if (
|
|
2141
|
+
const parts = [`${passed} passed`];
|
|
2142
|
+
if (skipped > 0) parts.push(`${skipped} skipped`);
|
|
2143
|
+
if (warnings > 0) parts.push(`${warnings} warning${warnings === 1 ? "" : "s"}`);
|
|
2144
|
+
if (failed > 0) parts.push(`${failed} failed`);
|
|
2145
|
+
console.error(`${parts.join(", ")}.`);
|
|
2146
|
+
if (failed > 0 && !existsSync5(PROFILES_FILE)) console.error("\nRun: elnora auth login");
|
|
1696
2147
|
}
|
|
1697
2148
|
});
|
|
1698
2149
|
}
|
|
@@ -1761,7 +2212,7 @@ init_profiles();
|
|
|
1761
2212
|
|
|
1762
2213
|
// src/lib/setup/claude.ts
|
|
1763
2214
|
import { spawn } from "node:child_process";
|
|
1764
|
-
import { existsSync as
|
|
2215
|
+
import { existsSync as existsSync6 } from "node:fs";
|
|
1765
2216
|
function runClaudeCli(args) {
|
|
1766
2217
|
return new Promise((resolve, reject) => {
|
|
1767
2218
|
const child = spawn("claude", args, {
|
|
@@ -1781,7 +2232,7 @@ function runClaudeCli(args) {
|
|
|
1781
2232
|
});
|
|
1782
2233
|
}
|
|
1783
2234
|
async function setupClaude() {
|
|
1784
|
-
if (!
|
|
2235
|
+
if (!existsSync6(CLAUDE_DIR)) {
|
|
1785
2236
|
console.error(fail("Claude Code not found (~/.claude/ does not exist)"));
|
|
1786
2237
|
console.error("");
|
|
1787
2238
|
console.error(" Install Claude Code first: https://claude.ai/code");
|
|
@@ -1824,11 +2275,11 @@ function reportClaudeCliError(err, step) {
|
|
|
1824
2275
|
}
|
|
1825
2276
|
|
|
1826
2277
|
// src/lib/setup/codex.ts
|
|
1827
|
-
import { existsSync as
|
|
2278
|
+
import { existsSync as existsSync7 } from "node:fs";
|
|
1828
2279
|
import { join as join5 } from "node:path";
|
|
1829
2280
|
var CODEX_MCP_FILE = join5(CODEX_DIR, "mcp.json");
|
|
1830
2281
|
function setupCodex(apiKey) {
|
|
1831
|
-
if (!
|
|
2282
|
+
if (!existsSync7(CODEX_DIR)) {
|
|
1832
2283
|
console.error(fail("Codex CLI not found (~/.codex/ does not exist)"));
|
|
1833
2284
|
console.error("");
|
|
1834
2285
|
console.error(" Install Codex first: https://github.com/openai/codex");
|
|
@@ -1860,9 +2311,9 @@ function setupCodex(apiKey) {
|
|
|
1860
2311
|
}
|
|
1861
2312
|
|
|
1862
2313
|
// src/lib/setup/cursor.ts
|
|
1863
|
-
import { existsSync as
|
|
2314
|
+
import { existsSync as existsSync8 } from "node:fs";
|
|
1864
2315
|
function setupCursor(apiKey) {
|
|
1865
|
-
if (!
|
|
2316
|
+
if (!existsSync8(CURSOR_DIR)) {
|
|
1866
2317
|
console.error(fail("Cursor not found (~/.cursor/ does not exist)"));
|
|
1867
2318
|
console.error("");
|
|
1868
2319
|
console.error(" Install Cursor first: https://cursor.com");
|
|
@@ -1895,11 +2346,11 @@ function setupCursor(apiKey) {
|
|
|
1895
2346
|
}
|
|
1896
2347
|
|
|
1897
2348
|
// src/lib/setup/vscode.ts
|
|
1898
|
-
import { existsSync as
|
|
2349
|
+
import { existsSync as existsSync9 } from "node:fs";
|
|
1899
2350
|
import { join as join6 } from "node:path";
|
|
1900
2351
|
var VSCODE_MCP_GLOBAL = join6(HOME, ".vscode", "mcp.json");
|
|
1901
2352
|
function setupVscode(apiKey) {
|
|
1902
|
-
if (!
|
|
2353
|
+
if (!existsSync9(VSCODE_DIR)) {
|
|
1903
2354
|
console.error(fail("VS Code not found (~/.vscode/ does not exist)"));
|
|
1904
2355
|
console.error("");
|
|
1905
2356
|
console.error(" Install VS Code first: https://code.visualstudio.com");
|
|
@@ -2017,36 +2468,21 @@ function addSetupCommand(program2) {
|
|
|
2017
2468
|
init_config();
|
|
2018
2469
|
import { execFileSync } from "node:child_process";
|
|
2019
2470
|
import { createHash } from "node:crypto";
|
|
2020
|
-
import {
|
|
2471
|
+
import {
|
|
2472
|
+
chmodSync as chmodSync2,
|
|
2473
|
+
copyFileSync,
|
|
2474
|
+
createWriteStream,
|
|
2475
|
+
mkdirSync as mkdirSync4,
|
|
2476
|
+
readdirSync,
|
|
2477
|
+
readFileSync as readFileSync5,
|
|
2478
|
+
renameSync,
|
|
2479
|
+
rmSync
|
|
2480
|
+
} from "node:fs";
|
|
2021
2481
|
import { tmpdir } from "node:os";
|
|
2022
2482
|
import { join as join7 } from "node:path";
|
|
2023
2483
|
import { Readable } from "node:stream";
|
|
2024
2484
|
import { pipeline } from "node:stream/promises";
|
|
2025
2485
|
import pc4 from "picocolors";
|
|
2026
|
-
|
|
2027
|
-
// src/lib/install-method.ts
|
|
2028
|
-
function detectInstallMethod() {
|
|
2029
|
-
const execPath = process.argv[1] ?? "";
|
|
2030
|
-
if (execPath.includes("node_modules")) {
|
|
2031
|
-
return "npm";
|
|
2032
|
-
}
|
|
2033
|
-
if (execPath.includes("/Cellar/") || execPath.includes("/homebrew/")) {
|
|
2034
|
-
return "homebrew";
|
|
2035
|
-
}
|
|
2036
|
-
return "binary";
|
|
2037
|
-
}
|
|
2038
|
-
function getUpdateInstruction(method) {
|
|
2039
|
-
switch (method) {
|
|
2040
|
-
case "npm":
|
|
2041
|
-
return "npm install -g @elnora-ai/cli@latest";
|
|
2042
|
-
case "homebrew":
|
|
2043
|
-
return "brew upgrade elnora";
|
|
2044
|
-
case "binary":
|
|
2045
|
-
return "elnora update --install";
|
|
2046
|
-
}
|
|
2047
|
-
}
|
|
2048
|
-
|
|
2049
|
-
// src/commands/update.ts
|
|
2050
2486
|
var NPM_REGISTRY_URL2 = "https://registry.npmjs.org/@elnora-ai/cli/latest";
|
|
2051
2487
|
var GITHUB_REPO = "Elnora-AI/elnora-cli";
|
|
2052
2488
|
function getPlatformTarget() {
|
|
@@ -2074,6 +2510,25 @@ async function downloadToFile(url, dest) {
|
|
|
2074
2510
|
const nodeStream = Readable.fromWeb(res.body);
|
|
2075
2511
|
await pipeline(nodeStream, createWriteStream(dest));
|
|
2076
2512
|
}
|
|
2513
|
+
function installWindowsBinary(srcPath, installDir) {
|
|
2514
|
+
mkdirSync4(installDir, { recursive: true });
|
|
2515
|
+
const dest = join7(installDir, "elnora.exe");
|
|
2516
|
+
try {
|
|
2517
|
+
renameSync(dest, `${dest}.old-${Date.now()}`);
|
|
2518
|
+
} catch (e) {
|
|
2519
|
+
if (e.code !== "ENOENT") throw e;
|
|
2520
|
+
}
|
|
2521
|
+
copyFileSync(srcPath, dest);
|
|
2522
|
+
for (const name of readdirSync(installDir)) {
|
|
2523
|
+
if (name.startsWith("elnora.exe.old-")) {
|
|
2524
|
+
try {
|
|
2525
|
+
rmSync(join7(installDir, name), { force: true });
|
|
2526
|
+
} catch {
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
return dest;
|
|
2531
|
+
}
|
|
2077
2532
|
async function installBinaryUpdate(latest) {
|
|
2078
2533
|
const color2 = isColorEnabled();
|
|
2079
2534
|
const platformInfo = getPlatformTarget();
|
|
@@ -2121,8 +2576,7 @@ async function installBinaryUpdate(latest) {
|
|
|
2121
2576
|
`Expand-Archive -Path '${archivePath}' -DestinationPath '${extractDir}' -Force`
|
|
2122
2577
|
]);
|
|
2123
2578
|
const installDir = join7(process.env.USERPROFILE ?? process.env.HOME ?? "", ".elnora", "bin");
|
|
2124
|
-
|
|
2125
|
-
copyFileSync(join7(extractDir, target), join7(installDir, "elnora.exe"));
|
|
2579
|
+
installWindowsBinary(join7(extractDir, target), installDir);
|
|
2126
2580
|
} else {
|
|
2127
2581
|
execFileSync("tar", ["-xzf", archivePath, "-C", tmp]);
|
|
2128
2582
|
const installDir = process.env.ELNORA_INSTALL_DIR ?? join7(process.env.HOME ?? "", ".local", "bin");
|
|
@@ -2183,8 +2637,10 @@ function addUpdateCommand(program2) {
|
|
|
2183
2637
|
}
|
|
2184
2638
|
try {
|
|
2185
2639
|
await installBinaryUpdate(latest);
|
|
2186
|
-
} catch {
|
|
2187
|
-
|
|
2640
|
+
} catch (err) {
|
|
2641
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
2642
|
+
console.error(`Update failed: ${reason}`);
|
|
2643
|
+
console.error("Try manually:");
|
|
2188
2644
|
console.error(
|
|
2189
2645
|
process.platform === "win32" ? " irm https://cli.elnora.ai/install.ps1 | iex" : " curl -fsSL https://cli.elnora.ai/install.sh | bash"
|
|
2190
2646
|
);
|
|
@@ -2228,16 +2684,16 @@ Profile: ${profileName}`);
|
|
|
2228
2684
|
}
|
|
2229
2685
|
|
|
2230
2686
|
// src/commands/account/accept-terms.ts
|
|
2231
|
-
import { z } from "zod";
|
|
2232
|
-
var inputSchema =
|
|
2233
|
-
documentVersionId:
|
|
2687
|
+
import { z as z2 } from "zod";
|
|
2688
|
+
var inputSchema = z2.object({
|
|
2689
|
+
documentVersionId: z2.string().describe("Document version ID to accept")
|
|
2234
2690
|
});
|
|
2235
2691
|
var accountAcceptTerms = {
|
|
2236
2692
|
name: "account.acceptTerms",
|
|
2237
2693
|
group: "account",
|
|
2238
2694
|
description: "Accept a user agreement / terms of service",
|
|
2239
2695
|
inputSchema,
|
|
2240
|
-
outputSchema:
|
|
2696
|
+
outputSchema: z2.any(),
|
|
2241
2697
|
async execute(input, ctx) {
|
|
2242
2698
|
return ctx.client.post("user_agreement", {
|
|
2243
2699
|
documentVersionId: input.documentVersionId
|
|
@@ -2250,19 +2706,19 @@ var accountAcceptTerms = {
|
|
|
2250
2706
|
};
|
|
2251
2707
|
|
|
2252
2708
|
// src/commands/account/add-legal-doc.ts
|
|
2253
|
-
import { z as
|
|
2254
|
-
var inputSchema2 =
|
|
2255
|
-
documentType:
|
|
2256
|
-
version:
|
|
2257
|
-
content:
|
|
2258
|
-
effectiveDate:
|
|
2709
|
+
import { z as z3 } from "zod";
|
|
2710
|
+
var inputSchema2 = z3.object({
|
|
2711
|
+
documentType: z3.string().min(1).describe("Document type"),
|
|
2712
|
+
version: z3.string().min(1).describe("Document version string"),
|
|
2713
|
+
content: z3.string().min(1).describe("Document content"),
|
|
2714
|
+
effectiveDate: z3.string().optional().describe("Effective date (ISO 8601)")
|
|
2259
2715
|
});
|
|
2260
2716
|
var accountAddLegalDoc = {
|
|
2261
2717
|
name: "account.addLegalDoc",
|
|
2262
2718
|
group: "account",
|
|
2263
2719
|
description: "Add a legal document version (SystemAdmin only)",
|
|
2264
2720
|
inputSchema: inputSchema2,
|
|
2265
|
-
outputSchema:
|
|
2721
|
+
outputSchema: z3.any(),
|
|
2266
2722
|
async execute(input, ctx) {
|
|
2267
2723
|
const body = {
|
|
2268
2724
|
documentType: input.documentType,
|
|
@@ -2279,14 +2735,14 @@ var accountAddLegalDoc = {
|
|
|
2279
2735
|
};
|
|
2280
2736
|
|
|
2281
2737
|
// src/commands/account/agreements.ts
|
|
2282
|
-
import { z as
|
|
2283
|
-
var inputSchema3 =
|
|
2738
|
+
import { z as z4 } from "zod";
|
|
2739
|
+
var inputSchema3 = z4.object({});
|
|
2284
2740
|
var accountAgreements = {
|
|
2285
2741
|
name: "account.agreements",
|
|
2286
2742
|
group: "account",
|
|
2287
2743
|
description: "List user agreements",
|
|
2288
2744
|
inputSchema: inputSchema3,
|
|
2289
|
-
outputSchema:
|
|
2745
|
+
outputSchema: z4.any(),
|
|
2290
2746
|
annotations: { readOnlyHint: true },
|
|
2291
2747
|
async execute(_input, ctx) {
|
|
2292
2748
|
return ctx.client.get("user_agreements");
|
|
@@ -2298,7 +2754,7 @@ var accountAgreements = {
|
|
|
2298
2754
|
};
|
|
2299
2755
|
|
|
2300
2756
|
// src/commands/account/delete.ts
|
|
2301
|
-
import { z as
|
|
2757
|
+
import { z as z5 } from "zod";
|
|
2302
2758
|
|
|
2303
2759
|
// src/commands/_shared/confirm.ts
|
|
2304
2760
|
import { createInterface } from "node:readline/promises";
|
|
@@ -2315,15 +2771,15 @@ async function confirmDestructive(prompt, requiredInput) {
|
|
|
2315
2771
|
}
|
|
2316
2772
|
|
|
2317
2773
|
// src/commands/account/delete.ts
|
|
2318
|
-
var inputSchema4 =
|
|
2319
|
-
yes:
|
|
2774
|
+
var inputSchema4 = z5.object({
|
|
2775
|
+
yes: z5.boolean().optional().default(false).describe("Skip confirmation prompt")
|
|
2320
2776
|
});
|
|
2321
2777
|
var accountDelete = {
|
|
2322
2778
|
name: "account.delete",
|
|
2323
2779
|
group: "account",
|
|
2324
2780
|
description: "Delete your own account",
|
|
2325
2781
|
inputSchema: inputSchema4,
|
|
2326
|
-
outputSchema:
|
|
2782
|
+
outputSchema: z5.any(),
|
|
2327
2783
|
annotations: { destructiveHint: true },
|
|
2328
2784
|
async execute(input, ctx) {
|
|
2329
2785
|
if (!input.yes) {
|
|
@@ -2342,17 +2798,17 @@ var accountDelete = {
|
|
|
2342
2798
|
};
|
|
2343
2799
|
|
|
2344
2800
|
// src/commands/account/delete-legal-doc.ts
|
|
2345
|
-
import { z as
|
|
2346
|
-
var inputSchema5 =
|
|
2347
|
-
versionId:
|
|
2348
|
-
yes:
|
|
2801
|
+
import { z as z6 } from "zod";
|
|
2802
|
+
var inputSchema5 = z6.object({
|
|
2803
|
+
versionId: z6.string().describe("Legal document version ID"),
|
|
2804
|
+
yes: z6.boolean().optional().default(false).describe("Skip confirmation prompt")
|
|
2349
2805
|
});
|
|
2350
2806
|
var accountDeleteLegalDoc = {
|
|
2351
2807
|
name: "account.deleteLegalDoc",
|
|
2352
2808
|
group: "account",
|
|
2353
2809
|
description: "Delete a legal document version (SystemAdmin only)",
|
|
2354
2810
|
inputSchema: inputSchema5,
|
|
2355
|
-
outputSchema:
|
|
2811
|
+
outputSchema: z6.any(),
|
|
2356
2812
|
annotations: { destructiveHint: true },
|
|
2357
2813
|
async execute(input, ctx) {
|
|
2358
2814
|
if (!input.yes) {
|
|
@@ -2375,16 +2831,16 @@ var accountDeleteLegalDoc = {
|
|
|
2375
2831
|
};
|
|
2376
2832
|
|
|
2377
2833
|
// src/commands/account/get.ts
|
|
2378
|
-
import { z as
|
|
2379
|
-
var inputSchema6 =
|
|
2380
|
-
userId:
|
|
2834
|
+
import { z as z7 } from "zod";
|
|
2835
|
+
var inputSchema6 = z7.object({
|
|
2836
|
+
userId: z7.string().describe("User ID")
|
|
2381
2837
|
});
|
|
2382
2838
|
var accountGet = {
|
|
2383
2839
|
name: "account.get",
|
|
2384
2840
|
group: "account",
|
|
2385
2841
|
description: "Get account details for a user",
|
|
2386
2842
|
inputSchema: inputSchema6,
|
|
2387
|
-
outputSchema:
|
|
2843
|
+
outputSchema: z7.any(),
|
|
2388
2844
|
annotations: { readOnlyHint: true },
|
|
2389
2845
|
async execute(input, ctx) {
|
|
2390
2846
|
return ctx.client.get("account_user", {
|
|
@@ -2399,18 +2855,18 @@ var accountGet = {
|
|
|
2399
2855
|
|
|
2400
2856
|
// src/commands/account/update.ts
|
|
2401
2857
|
init_errors();
|
|
2402
|
-
import { z as
|
|
2403
|
-
var inputSchema7 =
|
|
2404
|
-
userId:
|
|
2405
|
-
firstName:
|
|
2406
|
-
lastName:
|
|
2858
|
+
import { z as z8 } from "zod";
|
|
2859
|
+
var inputSchema7 = z8.object({
|
|
2860
|
+
userId: z8.string().describe("User ID"),
|
|
2861
|
+
firstName: z8.string().optional().describe("First name"),
|
|
2862
|
+
lastName: z8.string().optional().describe("Last name")
|
|
2407
2863
|
});
|
|
2408
2864
|
var accountUpdate = {
|
|
2409
2865
|
name: "account.update",
|
|
2410
2866
|
group: "account",
|
|
2411
2867
|
description: "Update account details for a user",
|
|
2412
2868
|
inputSchema: inputSchema7,
|
|
2413
|
-
outputSchema:
|
|
2869
|
+
outputSchema: z8.any(),
|
|
2414
2870
|
async execute(input, ctx) {
|
|
2415
2871
|
const body = {};
|
|
2416
2872
|
if (input.firstName !== void 0) body.firstName = input.firstName;
|
|
@@ -2430,18 +2886,18 @@ var accountUpdate = {
|
|
|
2430
2886
|
|
|
2431
2887
|
// src/commands/account/update-legal-doc.ts
|
|
2432
2888
|
init_errors();
|
|
2433
|
-
import { z as
|
|
2434
|
-
var inputSchema8 =
|
|
2435
|
-
versionId:
|
|
2436
|
-
content:
|
|
2437
|
-
effectiveDate:
|
|
2889
|
+
import { z as z9 } from "zod";
|
|
2890
|
+
var inputSchema8 = z9.object({
|
|
2891
|
+
versionId: z9.string().describe("Legal document version ID"),
|
|
2892
|
+
content: z9.string().optional().describe("Updated content"),
|
|
2893
|
+
effectiveDate: z9.string().optional().describe("Updated effective date (ISO 8601)")
|
|
2438
2894
|
});
|
|
2439
2895
|
var accountUpdateLegalDoc = {
|
|
2440
2896
|
name: "account.updateLegalDoc",
|
|
2441
2897
|
group: "account",
|
|
2442
2898
|
description: "Update a legal document version (SystemAdmin only)",
|
|
2443
2899
|
inputSchema: inputSchema8,
|
|
2444
|
-
outputSchema:
|
|
2900
|
+
outputSchema: z9.any(),
|
|
2445
2901
|
async execute(input, ctx) {
|
|
2446
2902
|
const body = {};
|
|
2447
2903
|
if (input.content !== void 0) body.content = input.content;
|
|
@@ -2460,17 +2916,17 @@ var accountUpdateLegalDoc = {
|
|
|
2460
2916
|
};
|
|
2461
2917
|
|
|
2462
2918
|
// src/commands/account/users.ts
|
|
2463
|
-
import { z as
|
|
2464
|
-
var inputSchema9 =
|
|
2465
|
-
state:
|
|
2466
|
-
refCode:
|
|
2919
|
+
import { z as z10 } from "zod";
|
|
2920
|
+
var inputSchema9 = z10.object({
|
|
2921
|
+
state: z10.enum(["Active", "Pending", "Deleted"]).optional().describe("Filter by user state"),
|
|
2922
|
+
refCode: z10.string().optional().describe("Filter by referral code")
|
|
2467
2923
|
});
|
|
2468
2924
|
var accountUsers = {
|
|
2469
2925
|
name: "account.users",
|
|
2470
2926
|
group: "account",
|
|
2471
2927
|
description: "List all users (admin)",
|
|
2472
2928
|
inputSchema: inputSchema9,
|
|
2473
|
-
outputSchema:
|
|
2929
|
+
outputSchema: z10.any(),
|
|
2474
2930
|
annotations: { readOnlyHint: true },
|
|
2475
2931
|
async execute(input, ctx) {
|
|
2476
2932
|
const queryParams = {};
|
|
@@ -2502,17 +2958,17 @@ function registerAccountCommands() {
|
|
|
2502
2958
|
}
|
|
2503
2959
|
|
|
2504
2960
|
// src/commands/api-keys/create.ts
|
|
2505
|
-
import { z as
|
|
2506
|
-
var inputSchema10 =
|
|
2507
|
-
name:
|
|
2508
|
-
scopes:
|
|
2961
|
+
import { z as z11 } from "zod";
|
|
2962
|
+
var inputSchema10 = z11.object({
|
|
2963
|
+
name: z11.string().min(1).describe("API key name"),
|
|
2964
|
+
scopes: z11.string().optional().describe("Comma-separated list of scopes")
|
|
2509
2965
|
});
|
|
2510
2966
|
var keysCreate = {
|
|
2511
2967
|
name: "api-keys.create",
|
|
2512
2968
|
group: "api-keys",
|
|
2513
2969
|
description: "Create a new API key",
|
|
2514
2970
|
inputSchema: inputSchema10,
|
|
2515
|
-
outputSchema:
|
|
2971
|
+
outputSchema: z11.any(),
|
|
2516
2972
|
async execute(input, ctx) {
|
|
2517
2973
|
const parsedScopes = input.scopes ? input.scopes.split(",").map((s) => s.trim()).filter((s) => s.length > 0) : void 0;
|
|
2518
2974
|
return ctx.client.post("api_keys", { name: input.name, scopes: parsedScopes });
|
|
@@ -2524,14 +2980,14 @@ var keysCreate = {
|
|
|
2524
2980
|
};
|
|
2525
2981
|
|
|
2526
2982
|
// src/commands/api-keys/get-policy.ts
|
|
2527
|
-
import { z as
|
|
2528
|
-
var inputSchema11 =
|
|
2983
|
+
import { z as z12 } from "zod";
|
|
2984
|
+
var inputSchema11 = z12.object({});
|
|
2529
2985
|
var keysGetPolicy = {
|
|
2530
2986
|
name: "api-keys.getPolicy",
|
|
2531
2987
|
group: "api-keys",
|
|
2532
2988
|
description: "Get the API key creation policy",
|
|
2533
2989
|
inputSchema: inputSchema11,
|
|
2534
|
-
outputSchema:
|
|
2990
|
+
outputSchema: z12.any(),
|
|
2535
2991
|
annotations: { readOnlyHint: true },
|
|
2536
2992
|
async execute(_input, ctx) {
|
|
2537
2993
|
return ctx.client.get("api_key_policy");
|
|
@@ -2543,14 +2999,14 @@ var keysGetPolicy = {
|
|
|
2543
2999
|
};
|
|
2544
3000
|
|
|
2545
3001
|
// src/commands/api-keys/list.ts
|
|
2546
|
-
import { z as
|
|
2547
|
-
var inputSchema12 =
|
|
3002
|
+
import { z as z13 } from "zod";
|
|
3003
|
+
var inputSchema12 = z13.object({});
|
|
2548
3004
|
var keysList = {
|
|
2549
3005
|
name: "api-keys.list",
|
|
2550
3006
|
group: "api-keys",
|
|
2551
3007
|
description: "List all API keys",
|
|
2552
3008
|
inputSchema: inputSchema12,
|
|
2553
|
-
outputSchema:
|
|
3009
|
+
outputSchema: z13.any(),
|
|
2554
3010
|
annotations: { readOnlyHint: true },
|
|
2555
3011
|
async execute(_input, ctx) {
|
|
2556
3012
|
return ctx.client.get("api_keys");
|
|
@@ -2562,16 +3018,16 @@ var keysList = {
|
|
|
2562
3018
|
};
|
|
2563
3019
|
|
|
2564
3020
|
// src/commands/api-keys/revoke.ts
|
|
2565
|
-
import { z as
|
|
2566
|
-
var inputSchema13 =
|
|
2567
|
-
keyId:
|
|
3021
|
+
import { z as z14 } from "zod";
|
|
3022
|
+
var inputSchema13 = z14.object({
|
|
3023
|
+
keyId: z14.string().uuid().describe("API key ID to revoke")
|
|
2568
3024
|
});
|
|
2569
3025
|
var keysRevoke = {
|
|
2570
3026
|
name: "api-keys.revoke",
|
|
2571
3027
|
group: "api-keys",
|
|
2572
3028
|
description: "Revoke an API key",
|
|
2573
3029
|
inputSchema: inputSchema13,
|
|
2574
|
-
outputSchema:
|
|
3030
|
+
outputSchema: z14.any(),
|
|
2575
3031
|
annotations: { destructiveHint: true },
|
|
2576
3032
|
async execute(input, ctx) {
|
|
2577
3033
|
await ctx.client.del("api_key", {
|
|
@@ -2586,16 +3042,16 @@ var keysRevoke = {
|
|
|
2586
3042
|
};
|
|
2587
3043
|
|
|
2588
3044
|
// src/commands/api-keys/set-policy.ts
|
|
2589
|
-
import { z as
|
|
2590
|
-
var inputSchema14 =
|
|
2591
|
-
policy:
|
|
3045
|
+
import { z as z15 } from "zod";
|
|
3046
|
+
var inputSchema14 = z15.object({
|
|
3047
|
+
policy: z15.enum(["all_members", "admins_only"]).describe("API key creation policy")
|
|
2592
3048
|
});
|
|
2593
3049
|
var keysSetPolicy = {
|
|
2594
3050
|
name: "api-keys.setPolicy",
|
|
2595
3051
|
group: "api-keys",
|
|
2596
3052
|
description: "Set the API key creation policy",
|
|
2597
3053
|
inputSchema: inputSchema14,
|
|
2598
|
-
outputSchema:
|
|
3054
|
+
outputSchema: z15.any(),
|
|
2599
3055
|
async execute(input, ctx) {
|
|
2600
3056
|
return ctx.client.put("api_key_policy", { policy: input.policy });
|
|
2601
3057
|
},
|
|
@@ -2611,28 +3067,28 @@ function registerApiKeyCommands() {
|
|
|
2611
3067
|
}
|
|
2612
3068
|
|
|
2613
3069
|
// src/commands/audit/list.ts
|
|
2614
|
-
import { z as
|
|
3070
|
+
import { z as z17 } from "zod";
|
|
2615
3071
|
|
|
2616
3072
|
// src/commands/_shared/pagination.ts
|
|
2617
|
-
import { z as
|
|
3073
|
+
import { z as z16 } from "zod";
|
|
2618
3074
|
var paginationInput = {
|
|
2619
|
-
page:
|
|
2620
|
-
pageSize:
|
|
3075
|
+
page: z16.number().int().min(1).default(1).describe("Page number"),
|
|
3076
|
+
pageSize: z16.number().int().min(1).max(100).default(25).describe("Results per page")
|
|
2621
3077
|
};
|
|
2622
3078
|
|
|
2623
3079
|
// src/commands/audit/list.ts
|
|
2624
|
-
var inputSchema15 =
|
|
2625
|
-
orgId:
|
|
3080
|
+
var inputSchema15 = z17.object({
|
|
3081
|
+
orgId: z17.string().uuid().describe("Organization ID"),
|
|
2626
3082
|
...paginationInput,
|
|
2627
|
-
action:
|
|
2628
|
-
userId:
|
|
3083
|
+
action: z17.string().optional().describe("Filter by action type"),
|
|
3084
|
+
userId: z17.string().optional().describe("Filter by user ID")
|
|
2629
3085
|
});
|
|
2630
3086
|
var auditList = {
|
|
2631
3087
|
name: "audit.list",
|
|
2632
3088
|
group: "audit",
|
|
2633
3089
|
description: "List audit log entries for an organization",
|
|
2634
3090
|
inputSchema: inputSchema15,
|
|
2635
|
-
outputSchema:
|
|
3091
|
+
outputSchema: z17.any(),
|
|
2636
3092
|
annotations: { readOnlyHint: true },
|
|
2637
3093
|
async execute(input, ctx) {
|
|
2638
3094
|
const queryParams = {
|
|
@@ -2661,7 +3117,7 @@ function registerAuditCommands() {
|
|
|
2661
3117
|
init_client();
|
|
2662
3118
|
init_errors();
|
|
2663
3119
|
init_profiles();
|
|
2664
|
-
import { z as
|
|
3120
|
+
import { z as z18 } from "zod";
|
|
2665
3121
|
|
|
2666
3122
|
// src/lib/prompt.ts
|
|
2667
3123
|
import { createInterface as createInterface2 } from "node:readline";
|
|
@@ -2724,21 +3180,48 @@ function promptSecret(message) {
|
|
|
2724
3180
|
}
|
|
2725
3181
|
|
|
2726
3182
|
// src/commands/auth/login.ts
|
|
2727
|
-
var inputSchema16 =
|
|
2728
|
-
apiKey:
|
|
2729
|
-
|
|
3183
|
+
var inputSchema16 = z18.object({
|
|
3184
|
+
apiKey: z18.string().optional().describe("Elnora API key (elnora_live_...)"),
|
|
3185
|
+
apiKeyStdin: z18.boolean().default(false).describe("Read the API key from stdin instead of an argument"),
|
|
3186
|
+
profile: z18.string().default("default").describe("Profile name to save key under")
|
|
2730
3187
|
});
|
|
2731
3188
|
var authLogin = {
|
|
2732
3189
|
name: "auth.login",
|
|
2733
3190
|
group: "auth",
|
|
2734
3191
|
description: "Set up authentication by saving an API key to a profile",
|
|
2735
3192
|
inputSchema: inputSchema16,
|
|
2736
|
-
outputSchema:
|
|
3193
|
+
outputSchema: z18.any(),
|
|
2737
3194
|
annotations: { exposeInMcp: false },
|
|
2738
3195
|
async execute(input, _ctx) {
|
|
2739
3196
|
let apiKey = input.apiKey;
|
|
2740
3197
|
const profileName = input.profile;
|
|
2741
3198
|
validateProfileName(profileName);
|
|
3199
|
+
if (input.apiKeyStdin && apiKey) {
|
|
3200
|
+
throw new ValidationError(
|
|
3201
|
+
"Cannot use --api-key and --api-key-stdin together. Choose one.",
|
|
3202
|
+
'Pipe the key: printf %s "$ELNORA_API_KEY" | elnora auth login --api-key-stdin'
|
|
3203
|
+
);
|
|
3204
|
+
}
|
|
3205
|
+
if (input.apiKeyStdin) {
|
|
3206
|
+
if (process.stdin.isTTY) {
|
|
3207
|
+
throw new ValidationError(
|
|
3208
|
+
"--api-key-stdin requires the key on stdin, but stdin is a terminal.",
|
|
3209
|
+
'Example: printf %s "$ELNORA_API_KEY" | elnora auth login --api-key-stdin'
|
|
3210
|
+
);
|
|
3211
|
+
}
|
|
3212
|
+
const piped = (await readStdin()).trim();
|
|
3213
|
+
if (!piped) {
|
|
3214
|
+
throw new ValidationError(
|
|
3215
|
+
"No API key received on stdin.",
|
|
3216
|
+
'Pipe a key: printf %s "$ELNORA_API_KEY" | elnora auth login --api-key-stdin'
|
|
3217
|
+
);
|
|
3218
|
+
}
|
|
3219
|
+
apiKey = piped;
|
|
3220
|
+
}
|
|
3221
|
+
if (!apiKey) {
|
|
3222
|
+
const envKey = process.env.ELNORA_API_KEY ?? process.env.ELNORA_MCP_API_KEY;
|
|
3223
|
+
if (envKey) apiKey = envKey;
|
|
3224
|
+
}
|
|
2742
3225
|
const existing = listProfileNames();
|
|
2743
3226
|
const profileExists = existing.includes(profileName);
|
|
2744
3227
|
if (!apiKey) {
|
|
@@ -2791,7 +3274,7 @@ var authLogin = {
|
|
|
2791
3274
|
}
|
|
2792
3275
|
if (!apiKey) {
|
|
2793
3276
|
throw new ValidationError(
|
|
2794
|
-
"API key is required.
|
|
3277
|
+
"API key is required. Pass --api-key, pipe it with --api-key-stdin, set ELNORA_API_KEY, or run interactively in a terminal.",
|
|
2795
3278
|
"Get your API key from: https://platform.elnora.ai > Settings > API Keys"
|
|
2796
3279
|
);
|
|
2797
3280
|
}
|
|
@@ -2822,6 +3305,10 @@ var authLogin = {
|
|
|
2822
3305
|
process.stderr.write(` Saved to profile "${profileName}" at ${configPath}
|
|
2823
3306
|
|
|
2824
3307
|
`);
|
|
3308
|
+
process.stderr.write(" Next steps:\n");
|
|
3309
|
+
process.stderr.write(" elnora projects list See your projects\n");
|
|
3310
|
+
process.stderr.write(" elnora tasks create --project <ID> --stream Start a conversation\n");
|
|
3311
|
+
process.stderr.write(" elnora doctor Verify your setup\n\n");
|
|
2825
3312
|
}
|
|
2826
3313
|
return { profile: profileName, verified: true, configPath };
|
|
2827
3314
|
} catch (err) {
|
|
@@ -2839,31 +3326,23 @@ var authLogin = {
|
|
|
2839
3326
|
formatOutput(output, format) {
|
|
2840
3327
|
const data = output;
|
|
2841
3328
|
if (format === "compact") return data.profile ?? JSON.stringify(output);
|
|
2842
|
-
|
|
2843
|
-
`\u2713 Authenticated! API key saved to profile "${data.profile}".`,
|
|
2844
|
-
"",
|
|
2845
|
-
"Next steps:",
|
|
2846
|
-
" elnora projects list See your projects",
|
|
2847
|
-
" elnora tasks create --project <ID> --stream Start a conversation",
|
|
2848
|
-
" elnora doctor Verify your setup"
|
|
2849
|
-
];
|
|
2850
|
-
return lines.join("\n");
|
|
3329
|
+
return JSON.stringify(output, null, 2);
|
|
2851
3330
|
}
|
|
2852
3331
|
};
|
|
2853
3332
|
|
|
2854
3333
|
// src/commands/auth/logout.ts
|
|
2855
3334
|
init_profiles();
|
|
2856
|
-
import { z as
|
|
2857
|
-
var inputSchema17 =
|
|
2858
|
-
profile:
|
|
2859
|
-
all:
|
|
3335
|
+
import { z as z19 } from "zod";
|
|
3336
|
+
var inputSchema17 = z19.object({
|
|
3337
|
+
profile: z19.string().optional().describe("Profile name to remove (default: 'default')"),
|
|
3338
|
+
all: z19.boolean().default(false).describe("Remove all profiles")
|
|
2860
3339
|
});
|
|
2861
3340
|
var authLogout = {
|
|
2862
3341
|
name: "auth.logout",
|
|
2863
3342
|
group: "auth",
|
|
2864
3343
|
description: "Remove saved credentials",
|
|
2865
3344
|
inputSchema: inputSchema17,
|
|
2866
|
-
outputSchema:
|
|
3345
|
+
outputSchema: z19.any(),
|
|
2867
3346
|
annotations: { destructiveHint: true, exposeInMcp: false },
|
|
2868
3347
|
async execute(input, _ctx) {
|
|
2869
3348
|
if (input.all) {
|
|
@@ -2885,14 +3364,14 @@ var authLogout = {
|
|
|
2885
3364
|
|
|
2886
3365
|
// src/commands/auth/profiles.ts
|
|
2887
3366
|
init_profiles();
|
|
2888
|
-
import { z as
|
|
2889
|
-
var inputSchema18 =
|
|
3367
|
+
import { z as z20 } from "zod";
|
|
3368
|
+
var inputSchema18 = z20.object({});
|
|
2890
3369
|
var authProfiles = {
|
|
2891
3370
|
name: "auth.profiles",
|
|
2892
3371
|
group: "auth",
|
|
2893
3372
|
description: "List all configured profiles",
|
|
2894
3373
|
inputSchema: inputSchema18,
|
|
2895
|
-
outputSchema:
|
|
3374
|
+
outputSchema: z20.any(),
|
|
2896
3375
|
annotations: { readOnlyHint: true, exposeInMcp: false },
|
|
2897
3376
|
async execute(_input, _ctx) {
|
|
2898
3377
|
const profiles = loadProfiles();
|
|
@@ -2914,14 +3393,14 @@ var authProfiles = {
|
|
|
2914
3393
|
};
|
|
2915
3394
|
|
|
2916
3395
|
// src/commands/auth/status.ts
|
|
2917
|
-
import { z as
|
|
2918
|
-
var inputSchema19 =
|
|
3396
|
+
import { z as z21 } from "zod";
|
|
3397
|
+
var inputSchema19 = z21.object({});
|
|
2919
3398
|
var authStatus = {
|
|
2920
3399
|
name: "auth.status",
|
|
2921
3400
|
group: "auth",
|
|
2922
3401
|
description: "Verify API key and show connection info",
|
|
2923
3402
|
inputSchema: inputSchema19,
|
|
2924
|
-
outputSchema:
|
|
3403
|
+
outputSchema: z21.any(),
|
|
2925
3404
|
annotations: { readOnlyHint: true, exposeInMcp: false },
|
|
2926
3405
|
async execute(_input, ctx) {
|
|
2927
3406
|
const result = await ctx.client.get("projects", {
|
|
@@ -2938,16 +3417,16 @@ var authStatus = {
|
|
|
2938
3417
|
|
|
2939
3418
|
// src/commands/auth/validate.ts
|
|
2940
3419
|
init_profiles();
|
|
2941
|
-
import { z as
|
|
2942
|
-
var inputSchema20 =
|
|
2943
|
-
token:
|
|
3420
|
+
import { z as z22 } from "zod";
|
|
3421
|
+
var inputSchema20 = z22.object({
|
|
3422
|
+
token: z22.string().optional().describe("Token to validate (defaults to current API key)")
|
|
2944
3423
|
});
|
|
2945
3424
|
var authValidate = {
|
|
2946
3425
|
name: "auth.validate",
|
|
2947
3426
|
group: "auth",
|
|
2948
3427
|
description: "Validate a JWT or API key token",
|
|
2949
3428
|
inputSchema: inputSchema20,
|
|
2950
|
-
outputSchema:
|
|
3429
|
+
outputSchema: z22.any(),
|
|
2951
3430
|
annotations: { exposeInMcp: false },
|
|
2952
3431
|
async execute(input, ctx) {
|
|
2953
3432
|
const tokenToValidate = input.token ?? resolveApiKey();
|
|
@@ -2965,17 +3444,18 @@ function registerAuthCommands() {
|
|
|
2965
3444
|
}
|
|
2966
3445
|
|
|
2967
3446
|
// src/commands/feedback/submit.ts
|
|
2968
|
-
import { z as
|
|
2969
|
-
var inputSchema21 =
|
|
2970
|
-
title:
|
|
2971
|
-
description:
|
|
3447
|
+
import { z as z23 } from "zod";
|
|
3448
|
+
var inputSchema21 = z23.object({
|
|
3449
|
+
title: z23.string().min(1).describe("Feedback title"),
|
|
3450
|
+
description: z23.string().min(1).describe("Feedback description")
|
|
2972
3451
|
});
|
|
2973
3452
|
var feedbackSubmit = {
|
|
2974
3453
|
name: "feedback.submit",
|
|
2975
3454
|
group: "feedback",
|
|
2976
3455
|
description: "Submit feedback",
|
|
3456
|
+
stdinField: "description",
|
|
2977
3457
|
inputSchema: inputSchema21,
|
|
2978
|
-
outputSchema:
|
|
3458
|
+
outputSchema: z23.any(),
|
|
2979
3459
|
async execute(input, ctx) {
|
|
2980
3460
|
return ctx.client.post("feedback", {
|
|
2981
3461
|
title: input.title,
|
|
@@ -2994,16 +3474,16 @@ function registerFeedbackCommands() {
|
|
|
2994
3474
|
}
|
|
2995
3475
|
|
|
2996
3476
|
// src/commands/files/archive.ts
|
|
2997
|
-
import { z as
|
|
2998
|
-
var inputSchema22 =
|
|
2999
|
-
fileId:
|
|
3477
|
+
import { z as z24 } from "zod";
|
|
3478
|
+
var inputSchema22 = z24.object({
|
|
3479
|
+
fileId: z24.string().uuid().describe("File ID to archive")
|
|
3000
3480
|
});
|
|
3001
3481
|
var filesArchive = {
|
|
3002
3482
|
name: "files.archive",
|
|
3003
3483
|
group: "files",
|
|
3004
3484
|
description: "Archive (delete) a file",
|
|
3005
3485
|
inputSchema: inputSchema22,
|
|
3006
|
-
outputSchema:
|
|
3486
|
+
outputSchema: z24.any(),
|
|
3007
3487
|
annotations: { destructiveHint: true },
|
|
3008
3488
|
async execute(input, ctx) {
|
|
3009
3489
|
await ctx.client.del("file", {
|
|
@@ -3018,16 +3498,16 @@ var filesArchive = {
|
|
|
3018
3498
|
};
|
|
3019
3499
|
|
|
3020
3500
|
// src/commands/files/commit.ts
|
|
3021
|
-
import { z as
|
|
3022
|
-
var inputSchema23 =
|
|
3023
|
-
fileId:
|
|
3501
|
+
import { z as z25 } from "zod";
|
|
3502
|
+
var inputSchema23 = z25.object({
|
|
3503
|
+
fileId: z25.string().uuid().describe("File ID to commit")
|
|
3024
3504
|
});
|
|
3025
3505
|
var filesCommit = {
|
|
3026
3506
|
name: "files.commit",
|
|
3027
3507
|
group: "files",
|
|
3028
3508
|
description: "Commit a file's working copy",
|
|
3029
3509
|
inputSchema: inputSchema23,
|
|
3030
|
-
outputSchema:
|
|
3510
|
+
outputSchema: z25.any(),
|
|
3031
3511
|
async execute(input, ctx) {
|
|
3032
3512
|
return ctx.client.post("file_commit", void 0, {
|
|
3033
3513
|
pathParams: { id: input.fileId }
|
|
@@ -3040,16 +3520,16 @@ var filesCommit = {
|
|
|
3040
3520
|
};
|
|
3041
3521
|
|
|
3042
3522
|
// src/commands/files/confirm-upload.ts
|
|
3043
|
-
import { z as
|
|
3044
|
-
var inputSchema24 =
|
|
3045
|
-
fileId:
|
|
3523
|
+
import { z as z26 } from "zod";
|
|
3524
|
+
var inputSchema24 = z26.object({
|
|
3525
|
+
fileId: z26.string().uuid().describe("File ID to confirm upload")
|
|
3046
3526
|
});
|
|
3047
3527
|
var filesConfirmUpload = {
|
|
3048
3528
|
name: "files.confirmUpload",
|
|
3049
3529
|
group: "files",
|
|
3050
3530
|
description: "Confirm a file upload",
|
|
3051
3531
|
inputSchema: inputSchema24,
|
|
3052
|
-
outputSchema:
|
|
3532
|
+
outputSchema: z26.any(),
|
|
3053
3533
|
async execute(input, ctx) {
|
|
3054
3534
|
return ctx.client.post("file_upload_confirm", void 0, {
|
|
3055
3535
|
pathParams: { id: input.fileId }
|
|
@@ -3062,16 +3542,16 @@ var filesConfirmUpload = {
|
|
|
3062
3542
|
};
|
|
3063
3543
|
|
|
3064
3544
|
// src/commands/files/content.ts
|
|
3065
|
-
import { z as
|
|
3066
|
-
var inputSchema25 =
|
|
3067
|
-
fileId:
|
|
3545
|
+
import { z as z27 } from "zod";
|
|
3546
|
+
var inputSchema25 = z27.object({
|
|
3547
|
+
fileId: z27.string().uuid().describe("File ID")
|
|
3068
3548
|
});
|
|
3069
3549
|
var filesContent = {
|
|
3070
3550
|
name: "files.content",
|
|
3071
3551
|
group: "files",
|
|
3072
3552
|
description: "Get the raw content of a file",
|
|
3073
3553
|
inputSchema: inputSchema25,
|
|
3074
|
-
outputSchema:
|
|
3554
|
+
outputSchema: z27.any(),
|
|
3075
3555
|
annotations: { readOnlyHint: true },
|
|
3076
3556
|
async execute(input, ctx) {
|
|
3077
3557
|
return ctx.client.get("file_content", {
|
|
@@ -3085,19 +3565,19 @@ var filesContent = {
|
|
|
3085
3565
|
};
|
|
3086
3566
|
|
|
3087
3567
|
// src/commands/files/create.ts
|
|
3088
|
-
import { z as
|
|
3089
|
-
var inputSchema26 =
|
|
3090
|
-
project:
|
|
3091
|
-
name:
|
|
3092
|
-
type:
|
|
3093
|
-
folder:
|
|
3568
|
+
import { z as z28 } from "zod";
|
|
3569
|
+
var inputSchema26 = z28.object({
|
|
3570
|
+
project: z28.string().uuid().describe("Project ID"),
|
|
3571
|
+
name: z28.string().min(1).describe("File name"),
|
|
3572
|
+
type: z28.string().min(1).describe("File type"),
|
|
3573
|
+
folder: z28.string().uuid().optional().describe("Folder ID")
|
|
3094
3574
|
});
|
|
3095
3575
|
var filesCreate = {
|
|
3096
3576
|
name: "files.create",
|
|
3097
3577
|
group: "files",
|
|
3098
3578
|
description: "Create a new file",
|
|
3099
3579
|
inputSchema: inputSchema26,
|
|
3100
|
-
outputSchema:
|
|
3580
|
+
outputSchema: z28.any(),
|
|
3101
3581
|
async execute(input, ctx) {
|
|
3102
3582
|
return ctx.client.post("files", {
|
|
3103
3583
|
projectId: input.project,
|
|
@@ -3113,17 +3593,18 @@ var filesCreate = {
|
|
|
3113
3593
|
};
|
|
3114
3594
|
|
|
3115
3595
|
// src/commands/files/create-version.ts
|
|
3116
|
-
import { z as
|
|
3117
|
-
var inputSchema27 =
|
|
3118
|
-
fileId:
|
|
3119
|
-
content:
|
|
3596
|
+
import { z as z29 } from "zod";
|
|
3597
|
+
var inputSchema27 = z29.object({
|
|
3598
|
+
fileId: z29.string().uuid().describe("File ID"),
|
|
3599
|
+
content: z29.string().optional().describe("Version content")
|
|
3120
3600
|
});
|
|
3121
3601
|
var filesCreateVersion = {
|
|
3122
3602
|
name: "files.createVersion",
|
|
3123
3603
|
group: "files",
|
|
3124
3604
|
description: "Create a new version of a file",
|
|
3605
|
+
stdinField: "content",
|
|
3125
3606
|
inputSchema: inputSchema27,
|
|
3126
|
-
outputSchema:
|
|
3607
|
+
outputSchema: z29.any(),
|
|
3127
3608
|
async execute(input, ctx) {
|
|
3128
3609
|
const body = {};
|
|
3129
3610
|
if (input.content !== void 0) body.content = input.content;
|
|
@@ -3138,16 +3619,16 @@ var filesCreateVersion = {
|
|
|
3138
3619
|
};
|
|
3139
3620
|
|
|
3140
3621
|
// src/commands/files/download.ts
|
|
3141
|
-
import { z as
|
|
3142
|
-
var inputSchema28 =
|
|
3143
|
-
fileId:
|
|
3622
|
+
import { z as z30 } from "zod";
|
|
3623
|
+
var inputSchema28 = z30.object({
|
|
3624
|
+
fileId: z30.string().uuid().describe("File ID to download")
|
|
3144
3625
|
});
|
|
3145
3626
|
var filesDownload = {
|
|
3146
3627
|
name: "files.download",
|
|
3147
3628
|
group: "files",
|
|
3148
3629
|
description: "Download a file",
|
|
3149
3630
|
inputSchema: inputSchema28,
|
|
3150
|
-
outputSchema:
|
|
3631
|
+
outputSchema: z30.any(),
|
|
3151
3632
|
annotations: { readOnlyHint: true },
|
|
3152
3633
|
async execute(input, ctx) {
|
|
3153
3634
|
return ctx.client.get("file_download", {
|
|
@@ -3161,17 +3642,17 @@ var filesDownload = {
|
|
|
3161
3642
|
};
|
|
3162
3643
|
|
|
3163
3644
|
// src/commands/files/fork.ts
|
|
3164
|
-
import { z as
|
|
3165
|
-
var inputSchema29 =
|
|
3166
|
-
fileId:
|
|
3167
|
-
targetProject:
|
|
3645
|
+
import { z as z31 } from "zod";
|
|
3646
|
+
var inputSchema29 = z31.object({
|
|
3647
|
+
fileId: z31.string().uuid().describe("File ID to fork"),
|
|
3648
|
+
targetProject: z31.string().uuid().describe("Target project ID")
|
|
3168
3649
|
});
|
|
3169
3650
|
var filesFork = {
|
|
3170
3651
|
name: "files.fork",
|
|
3171
3652
|
group: "files",
|
|
3172
3653
|
description: "Fork a file to another project",
|
|
3173
3654
|
inputSchema: inputSchema29,
|
|
3174
|
-
outputSchema:
|
|
3655
|
+
outputSchema: z31.any(),
|
|
3175
3656
|
async execute(input, ctx) {
|
|
3176
3657
|
return ctx.client.post(
|
|
3177
3658
|
"file_fork",
|
|
@@ -3188,16 +3669,16 @@ var filesFork = {
|
|
|
3188
3669
|
};
|
|
3189
3670
|
|
|
3190
3671
|
// src/commands/files/get.ts
|
|
3191
|
-
import { z as
|
|
3192
|
-
var inputSchema30 =
|
|
3193
|
-
fileId:
|
|
3672
|
+
import { z as z32 } from "zod";
|
|
3673
|
+
var inputSchema30 = z32.object({
|
|
3674
|
+
fileId: z32.string().uuid().describe("File ID")
|
|
3194
3675
|
});
|
|
3195
3676
|
var filesGet = {
|
|
3196
3677
|
name: "files.get",
|
|
3197
3678
|
group: "files",
|
|
3198
3679
|
description: "Get details of a specific file",
|
|
3199
3680
|
inputSchema: inputSchema30,
|
|
3200
|
-
outputSchema:
|
|
3681
|
+
outputSchema: z32.any(),
|
|
3201
3682
|
annotations: { readOnlyHint: true },
|
|
3202
3683
|
async execute(input, ctx) {
|
|
3203
3684
|
return ctx.client.get("file", {
|
|
@@ -3211,9 +3692,9 @@ var filesGet = {
|
|
|
3211
3692
|
};
|
|
3212
3693
|
|
|
3213
3694
|
// src/commands/files/list.ts
|
|
3214
|
-
import { z as
|
|
3215
|
-
var inputSchema31 =
|
|
3216
|
-
project:
|
|
3695
|
+
import { z as z33 } from "zod";
|
|
3696
|
+
var inputSchema31 = z33.object({
|
|
3697
|
+
project: z33.string().uuid().describe("Project ID"),
|
|
3217
3698
|
...paginationInput
|
|
3218
3699
|
});
|
|
3219
3700
|
var filesList = {
|
|
@@ -3221,7 +3702,7 @@ var filesList = {
|
|
|
3221
3702
|
group: "files",
|
|
3222
3703
|
description: "List files in a project",
|
|
3223
3704
|
inputSchema: inputSchema31,
|
|
3224
|
-
outputSchema:
|
|
3705
|
+
outputSchema: z33.any(),
|
|
3225
3706
|
annotations: { readOnlyHint: true },
|
|
3226
3707
|
async execute(input, ctx) {
|
|
3227
3708
|
return ctx.client.get("project_files", {
|
|
@@ -3236,17 +3717,17 @@ var filesList = {
|
|
|
3236
3717
|
};
|
|
3237
3718
|
|
|
3238
3719
|
// src/commands/files/promote.ts
|
|
3239
|
-
import { z as
|
|
3240
|
-
var inputSchema32 =
|
|
3241
|
-
fileId:
|
|
3242
|
-
visibility:
|
|
3720
|
+
import { z as z34 } from "zod";
|
|
3721
|
+
var inputSchema32 = z34.object({
|
|
3722
|
+
fileId: z34.string().uuid().describe("File ID"),
|
|
3723
|
+
visibility: z34.string().min(1).describe("Visibility level")
|
|
3243
3724
|
});
|
|
3244
3725
|
var filesPromote = {
|
|
3245
3726
|
name: "files.promote",
|
|
3246
3727
|
group: "files",
|
|
3247
3728
|
description: "Promote a file to a new visibility level",
|
|
3248
3729
|
inputSchema: inputSchema32,
|
|
3249
|
-
outputSchema:
|
|
3730
|
+
outputSchema: z34.any(),
|
|
3250
3731
|
async execute(input, ctx) {
|
|
3251
3732
|
return ctx.client.post(
|
|
3252
3733
|
"file_promote",
|
|
@@ -3263,17 +3744,17 @@ var filesPromote = {
|
|
|
3263
3744
|
};
|
|
3264
3745
|
|
|
3265
3746
|
// src/commands/files/restore.ts
|
|
3266
|
-
import { z as
|
|
3267
|
-
var inputSchema33 =
|
|
3268
|
-
fileId:
|
|
3269
|
-
versionId:
|
|
3747
|
+
import { z as z35 } from "zod";
|
|
3748
|
+
var inputSchema33 = z35.object({
|
|
3749
|
+
fileId: z35.string().uuid().describe("File ID"),
|
|
3750
|
+
versionId: z35.string().uuid().describe("Version ID to restore")
|
|
3270
3751
|
});
|
|
3271
3752
|
var filesRestore = {
|
|
3272
3753
|
name: "files.restore",
|
|
3273
3754
|
group: "files",
|
|
3274
3755
|
description: "Restore a file to a specific version",
|
|
3275
3756
|
inputSchema: inputSchema33,
|
|
3276
|
-
outputSchema:
|
|
3757
|
+
outputSchema: z35.any(),
|
|
3277
3758
|
async execute(input, ctx) {
|
|
3278
3759
|
return ctx.client.post("file_version_restore", void 0, {
|
|
3279
3760
|
pathParams: { id: input.fileId, vid: input.versionId }
|
|
@@ -3286,10 +3767,10 @@ var filesRestore = {
|
|
|
3286
3767
|
};
|
|
3287
3768
|
|
|
3288
3769
|
// src/commands/files/search-content.ts
|
|
3289
|
-
import { z as
|
|
3290
|
-
var inputSchema34 =
|
|
3291
|
-
query:
|
|
3292
|
-
project:
|
|
3770
|
+
import { z as z36 } from "zod";
|
|
3771
|
+
var inputSchema34 = z36.object({
|
|
3772
|
+
query: z36.string().min(1).describe("Search query"),
|
|
3773
|
+
project: z36.string().uuid().optional().describe("Project ID to scope search"),
|
|
3293
3774
|
...paginationInput
|
|
3294
3775
|
});
|
|
3295
3776
|
var filesSearchContent = {
|
|
@@ -3297,7 +3778,7 @@ var filesSearchContent = {
|
|
|
3297
3778
|
group: "files",
|
|
3298
3779
|
description: "Search file content across projects",
|
|
3299
3780
|
inputSchema: inputSchema34,
|
|
3300
|
-
outputSchema:
|
|
3781
|
+
outputSchema: z36.any(),
|
|
3301
3782
|
annotations: { readOnlyHint: true },
|
|
3302
3783
|
async execute(input, ctx) {
|
|
3303
3784
|
const queryParams = {
|
|
@@ -3316,18 +3797,18 @@ var filesSearchContent = {
|
|
|
3316
3797
|
|
|
3317
3798
|
// src/commands/files/update.ts
|
|
3318
3799
|
init_errors();
|
|
3319
|
-
import { z as
|
|
3320
|
-
var inputSchema35 =
|
|
3321
|
-
fileId:
|
|
3322
|
-
name:
|
|
3323
|
-
folder:
|
|
3800
|
+
import { z as z37 } from "zod";
|
|
3801
|
+
var inputSchema35 = z37.object({
|
|
3802
|
+
fileId: z37.string().uuid().describe("File ID"),
|
|
3803
|
+
name: z37.string().min(1).optional().describe("New file name"),
|
|
3804
|
+
folder: z37.string().uuid().optional().describe("New folder ID")
|
|
3324
3805
|
});
|
|
3325
3806
|
var filesUpdate = {
|
|
3326
3807
|
name: "files.update",
|
|
3327
3808
|
group: "files",
|
|
3328
3809
|
description: "Update a file's metadata",
|
|
3329
3810
|
inputSchema: inputSchema35,
|
|
3330
|
-
outputSchema:
|
|
3811
|
+
outputSchema: z37.any(),
|
|
3331
3812
|
annotations: { idempotentHint: true },
|
|
3332
3813
|
async execute(input, ctx) {
|
|
3333
3814
|
const { fileId, ...fields } = input;
|
|
@@ -3352,26 +3833,26 @@ var filesUpdate = {
|
|
|
3352
3833
|
|
|
3353
3834
|
// src/commands/files/upload.ts
|
|
3354
3835
|
init_client();
|
|
3355
|
-
import { readFileSync as readFileSync6, statSync as
|
|
3836
|
+
import { readFileSync as readFileSync6, statSync as statSync3 } from "node:fs";
|
|
3356
3837
|
import { basename } from "node:path";
|
|
3357
|
-
import { z as
|
|
3358
|
-
var inputSchema36 =
|
|
3359
|
-
project:
|
|
3360
|
-
filePath:
|
|
3361
|
-
fileName:
|
|
3362
|
-
contentType:
|
|
3838
|
+
import { z as z38 } from "zod";
|
|
3839
|
+
var inputSchema36 = z38.object({
|
|
3840
|
+
project: z38.string().uuid().describe("Project ID"),
|
|
3841
|
+
filePath: z38.string().min(1).describe("Local file path to upload"),
|
|
3842
|
+
fileName: z38.string().optional().describe("Override file name"),
|
|
3843
|
+
contentType: z38.string().optional().describe("MIME content type")
|
|
3363
3844
|
});
|
|
3364
3845
|
var filesUpload = {
|
|
3365
3846
|
name: "files.upload",
|
|
3366
3847
|
group: "files",
|
|
3367
3848
|
description: "Upload a file to a project (three-stage: presign, PUT, confirm)",
|
|
3368
3849
|
inputSchema: inputSchema36,
|
|
3369
|
-
outputSchema:
|
|
3850
|
+
outputSchema: z38.any(),
|
|
3370
3851
|
async execute(input, ctx) {
|
|
3371
3852
|
const fileBuffer = readFileSync6(input.filePath);
|
|
3372
3853
|
const fileName = input.fileName ?? basename(input.filePath);
|
|
3373
3854
|
const contentType = input.contentType ?? "application/octet-stream";
|
|
3374
|
-
const fileSize =
|
|
3855
|
+
const fileSize = statSync3(input.filePath).size;
|
|
3375
3856
|
const uploadInfo = await ctx.client.post("file_upload", {
|
|
3376
3857
|
projectId: input.project,
|
|
3377
3858
|
fileName,
|
|
@@ -3399,20 +3880,20 @@ var filesUpload = {
|
|
|
3399
3880
|
// src/commands/files/upload-batch.ts
|
|
3400
3881
|
init_client();
|
|
3401
3882
|
init_errors();
|
|
3402
|
-
import { readFileSync as readFileSync7, statSync as
|
|
3883
|
+
import { readFileSync as readFileSync7, statSync as statSync4 } from "node:fs";
|
|
3403
3884
|
import { basename as basename2 } from "node:path";
|
|
3404
|
-
import { z as
|
|
3405
|
-
var inputSchema37 =
|
|
3406
|
-
project:
|
|
3407
|
-
filePaths:
|
|
3408
|
-
folder:
|
|
3885
|
+
import { z as z39 } from "zod";
|
|
3886
|
+
var inputSchema37 = z39.object({
|
|
3887
|
+
project: z39.string().uuid().describe("Project ID"),
|
|
3888
|
+
filePaths: z39.string().min(1).describe("Comma-separated local file paths to upload"),
|
|
3889
|
+
folder: z39.string().uuid().optional().describe("Folder ID")
|
|
3409
3890
|
});
|
|
3410
3891
|
var filesUploadBatch = {
|
|
3411
3892
|
name: "files.uploadBatch",
|
|
3412
3893
|
group: "files",
|
|
3413
3894
|
description: "Upload multiple files to a project (max 50)",
|
|
3414
3895
|
inputSchema: inputSchema37,
|
|
3415
|
-
outputSchema:
|
|
3896
|
+
outputSchema: z39.any(),
|
|
3416
3897
|
async execute(input, ctx) {
|
|
3417
3898
|
const paths = input.filePaths.split(",").map((p) => p.trim()).filter(Boolean);
|
|
3418
3899
|
if (paths.length === 0) {
|
|
@@ -3430,7 +3911,7 @@ var filesUploadBatch = {
|
|
|
3430
3911
|
try {
|
|
3431
3912
|
const fileBuffer = readFileSync7(filePath);
|
|
3432
3913
|
const contentType = "application/octet-stream";
|
|
3433
|
-
const fileSize =
|
|
3914
|
+
const fileSize = statSync4(filePath).size;
|
|
3434
3915
|
const uploadInfo = await ctx.client.post("file_upload", {
|
|
3435
3916
|
projectId: input.project,
|
|
3436
3917
|
fileName,
|
|
@@ -3470,17 +3951,17 @@ var filesUploadBatch = {
|
|
|
3470
3951
|
};
|
|
3471
3952
|
|
|
3472
3953
|
// src/commands/files/version-content.ts
|
|
3473
|
-
import { z as
|
|
3474
|
-
var inputSchema38 =
|
|
3475
|
-
fileId:
|
|
3476
|
-
versionId:
|
|
3954
|
+
import { z as z40 } from "zod";
|
|
3955
|
+
var inputSchema38 = z40.object({
|
|
3956
|
+
fileId: z40.string().uuid().describe("File ID"),
|
|
3957
|
+
versionId: z40.string().uuid().describe("Version ID")
|
|
3477
3958
|
});
|
|
3478
3959
|
var filesVersionContent = {
|
|
3479
3960
|
name: "files.versionContent",
|
|
3480
3961
|
group: "files",
|
|
3481
3962
|
description: "Get the raw content of a specific file version",
|
|
3482
3963
|
inputSchema: inputSchema38,
|
|
3483
|
-
outputSchema:
|
|
3964
|
+
outputSchema: z40.any(),
|
|
3484
3965
|
annotations: { readOnlyHint: true },
|
|
3485
3966
|
async execute(input, ctx) {
|
|
3486
3967
|
return ctx.client.get("file_version_content", {
|
|
@@ -3494,9 +3975,9 @@ var filesVersionContent = {
|
|
|
3494
3975
|
};
|
|
3495
3976
|
|
|
3496
3977
|
// src/commands/files/versions.ts
|
|
3497
|
-
import { z as
|
|
3498
|
-
var inputSchema39 =
|
|
3499
|
-
fileId:
|
|
3978
|
+
import { z as z41 } from "zod";
|
|
3979
|
+
var inputSchema39 = z41.object({
|
|
3980
|
+
fileId: z41.string().uuid().describe("File ID"),
|
|
3500
3981
|
...paginationInput
|
|
3501
3982
|
});
|
|
3502
3983
|
var filesVersions = {
|
|
@@ -3504,7 +3985,7 @@ var filesVersions = {
|
|
|
3504
3985
|
group: "files",
|
|
3505
3986
|
description: "List versions of a file",
|
|
3506
3987
|
inputSchema: inputSchema39,
|
|
3507
|
-
outputSchema:
|
|
3988
|
+
outputSchema: z41.any(),
|
|
3508
3989
|
annotations: { readOnlyHint: true },
|
|
3509
3990
|
async execute(input, ctx) {
|
|
3510
3991
|
return ctx.client.get("file_versions", {
|
|
@@ -3519,17 +4000,17 @@ var filesVersions = {
|
|
|
3519
4000
|
};
|
|
3520
4001
|
|
|
3521
4002
|
// src/commands/files/working-copy.ts
|
|
3522
|
-
import { z as
|
|
3523
|
-
var inputSchema40 =
|
|
3524
|
-
fileId:
|
|
3525
|
-
task:
|
|
4003
|
+
import { z as z42 } from "zod";
|
|
4004
|
+
var inputSchema40 = z42.object({
|
|
4005
|
+
fileId: z42.string().uuid().describe("File ID"),
|
|
4006
|
+
task: z42.string().uuid().optional().describe("Task ID")
|
|
3526
4007
|
});
|
|
3527
4008
|
var filesWorkingCopy = {
|
|
3528
4009
|
name: "files.workingCopy",
|
|
3529
4010
|
group: "files",
|
|
3530
4011
|
description: "Create a working copy of a file",
|
|
3531
4012
|
inputSchema: inputSchema40,
|
|
3532
|
-
outputSchema:
|
|
4013
|
+
outputSchema: z42.any(),
|
|
3533
4014
|
async execute(input, ctx) {
|
|
3534
4015
|
const body = {};
|
|
3535
4016
|
if (input.task !== void 0) body.taskId = input.task;
|
|
@@ -3569,16 +4050,16 @@ function registerFileCommands() {
|
|
|
3569
4050
|
}
|
|
3570
4051
|
|
|
3571
4052
|
// src/commands/flags/get.ts
|
|
3572
|
-
import { z as
|
|
3573
|
-
var inputSchema41 =
|
|
3574
|
-
key:
|
|
4053
|
+
import { z as z43 } from "zod";
|
|
4054
|
+
var inputSchema41 = z43.object({
|
|
4055
|
+
key: z43.string().min(1).describe("Feature flag key")
|
|
3575
4056
|
});
|
|
3576
4057
|
var flagsGet = {
|
|
3577
4058
|
name: "flags.get",
|
|
3578
4059
|
group: "flags",
|
|
3579
4060
|
description: "Get a feature flag by key",
|
|
3580
4061
|
inputSchema: inputSchema41,
|
|
3581
|
-
outputSchema:
|
|
4062
|
+
outputSchema: z43.any(),
|
|
3582
4063
|
annotations: { readOnlyHint: true },
|
|
3583
4064
|
async execute(input, ctx) {
|
|
3584
4065
|
return ctx.client.get("feature_flag", {
|
|
@@ -3592,14 +4073,14 @@ var flagsGet = {
|
|
|
3592
4073
|
};
|
|
3593
4074
|
|
|
3594
4075
|
// src/commands/flags/list.ts
|
|
3595
|
-
import { z as
|
|
3596
|
-
var inputSchema42 =
|
|
4076
|
+
import { z as z44 } from "zod";
|
|
4077
|
+
var inputSchema42 = z44.object({});
|
|
3597
4078
|
var flagsList = {
|
|
3598
4079
|
name: "flags.list",
|
|
3599
4080
|
group: "flags",
|
|
3600
4081
|
description: "List all feature flags",
|
|
3601
4082
|
inputSchema: inputSchema42,
|
|
3602
|
-
outputSchema:
|
|
4083
|
+
outputSchema: z44.any(),
|
|
3603
4084
|
annotations: { readOnlyHint: true },
|
|
3604
4085
|
async execute(_input, ctx) {
|
|
3605
4086
|
return ctx.client.get("feature_flags");
|
|
@@ -3611,18 +4092,18 @@ var flagsList = {
|
|
|
3611
4092
|
};
|
|
3612
4093
|
|
|
3613
4094
|
// src/commands/flags/set.ts
|
|
3614
|
-
import { z as
|
|
3615
|
-
var inputSchema43 =
|
|
3616
|
-
key:
|
|
3617
|
-
value:
|
|
3618
|
-
yes:
|
|
4095
|
+
import { z as z45 } from "zod";
|
|
4096
|
+
var inputSchema43 = z45.object({
|
|
4097
|
+
key: z45.string().min(1).describe("Feature flag key"),
|
|
4098
|
+
value: z45.enum(["true", "false"]).describe("Feature flag value"),
|
|
4099
|
+
yes: z45.boolean().optional().default(false).describe("Skip confirmation prompt")
|
|
3619
4100
|
});
|
|
3620
4101
|
var flagsSet = {
|
|
3621
4102
|
name: "flags.set",
|
|
3622
4103
|
group: "flags",
|
|
3623
4104
|
description: "Set a feature flag value",
|
|
3624
4105
|
inputSchema: inputSchema43,
|
|
3625
|
-
outputSchema:
|
|
4106
|
+
outputSchema: z45.any(),
|
|
3626
4107
|
async execute(input, ctx) {
|
|
3627
4108
|
if (!input.yes) {
|
|
3628
4109
|
const confirmed = await confirmDestructive(`Set feature flag "${input.key}" to ${input.value}? [y/N] `);
|
|
@@ -3651,18 +4132,18 @@ function registerFlagCommands() {
|
|
|
3651
4132
|
}
|
|
3652
4133
|
|
|
3653
4134
|
// src/commands/folders/create.ts
|
|
3654
|
-
import { z as
|
|
3655
|
-
var inputSchema44 =
|
|
3656
|
-
projectId:
|
|
3657
|
-
name:
|
|
3658
|
-
parentId:
|
|
4135
|
+
import { z as z46 } from "zod";
|
|
4136
|
+
var inputSchema44 = z46.object({
|
|
4137
|
+
projectId: z46.string().uuid().describe("Project ID"),
|
|
4138
|
+
name: z46.string().min(1).describe("Folder name"),
|
|
4139
|
+
parentId: z46.string().uuid().optional().describe("Parent folder ID")
|
|
3659
4140
|
});
|
|
3660
4141
|
var foldersCreate = {
|
|
3661
4142
|
name: "folders.create",
|
|
3662
4143
|
group: "folders",
|
|
3663
4144
|
description: "Create a new folder in a project",
|
|
3664
4145
|
inputSchema: inputSchema44,
|
|
3665
|
-
outputSchema:
|
|
4146
|
+
outputSchema: z46.any(),
|
|
3666
4147
|
async execute(input, ctx) {
|
|
3667
4148
|
const body = { name: input.name };
|
|
3668
4149
|
if (input.parentId) body.parentId = input.parentId;
|
|
@@ -3677,16 +4158,16 @@ var foldersCreate = {
|
|
|
3677
4158
|
};
|
|
3678
4159
|
|
|
3679
4160
|
// src/commands/folders/delete.ts
|
|
3680
|
-
import { z as
|
|
3681
|
-
var inputSchema45 =
|
|
3682
|
-
folderId:
|
|
4161
|
+
import { z as z47 } from "zod";
|
|
4162
|
+
var inputSchema45 = z47.object({
|
|
4163
|
+
folderId: z47.string().uuid().describe("Folder ID to delete")
|
|
3683
4164
|
});
|
|
3684
4165
|
var foldersDelete = {
|
|
3685
4166
|
name: "folders.delete",
|
|
3686
4167
|
group: "folders",
|
|
3687
4168
|
description: "Delete a folder",
|
|
3688
4169
|
inputSchema: inputSchema45,
|
|
3689
|
-
outputSchema:
|
|
4170
|
+
outputSchema: z47.any(),
|
|
3690
4171
|
annotations: { destructiveHint: true },
|
|
3691
4172
|
async execute(input, ctx) {
|
|
3692
4173
|
await ctx.client.del("folder", {
|
|
@@ -3701,16 +4182,16 @@ var foldersDelete = {
|
|
|
3701
4182
|
};
|
|
3702
4183
|
|
|
3703
4184
|
// src/commands/folders/list.ts
|
|
3704
|
-
import { z as
|
|
3705
|
-
var inputSchema46 =
|
|
3706
|
-
projectId:
|
|
4185
|
+
import { z as z48 } from "zod";
|
|
4186
|
+
var inputSchema46 = z48.object({
|
|
4187
|
+
projectId: z48.string().uuid().describe("Project ID")
|
|
3707
4188
|
});
|
|
3708
4189
|
var foldersList = {
|
|
3709
4190
|
name: "folders.list",
|
|
3710
4191
|
group: "folders",
|
|
3711
4192
|
description: "List folders in a project",
|
|
3712
4193
|
inputSchema: inputSchema46,
|
|
3713
|
-
outputSchema:
|
|
4194
|
+
outputSchema: z48.any(),
|
|
3714
4195
|
annotations: { readOnlyHint: true },
|
|
3715
4196
|
async execute(input, ctx) {
|
|
3716
4197
|
return ctx.client.get("project_folders", {
|
|
@@ -3725,18 +4206,18 @@ var foldersList = {
|
|
|
3725
4206
|
|
|
3726
4207
|
// src/commands/folders/move.ts
|
|
3727
4208
|
init_errors();
|
|
3728
|
-
import { z as
|
|
4209
|
+
import { z as z49 } from "zod";
|
|
3729
4210
|
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
3730
|
-
var inputSchema47 =
|
|
3731
|
-
folderId:
|
|
3732
|
-
parentId:
|
|
4211
|
+
var inputSchema47 = z49.object({
|
|
4212
|
+
folderId: z49.string().uuid().describe("Folder ID to move"),
|
|
4213
|
+
parentId: z49.string().min(1).describe("Target parent folder ID, or 'root' to move to project root")
|
|
3733
4214
|
});
|
|
3734
4215
|
var foldersMove = {
|
|
3735
4216
|
name: "folders.move",
|
|
3736
4217
|
group: "folders",
|
|
3737
4218
|
description: "Move a folder to a new parent (or to root)",
|
|
3738
4219
|
inputSchema: inputSchema47,
|
|
3739
|
-
outputSchema:
|
|
4220
|
+
outputSchema: z49.any(),
|
|
3740
4221
|
async execute(input, ctx) {
|
|
3741
4222
|
let parentValue;
|
|
3742
4223
|
if (input.parentId === "root") {
|
|
@@ -3764,17 +4245,17 @@ var foldersMove = {
|
|
|
3764
4245
|
};
|
|
3765
4246
|
|
|
3766
4247
|
// src/commands/folders/rename.ts
|
|
3767
|
-
import { z as
|
|
3768
|
-
var inputSchema48 =
|
|
3769
|
-
folderId:
|
|
3770
|
-
name:
|
|
4248
|
+
import { z as z50 } from "zod";
|
|
4249
|
+
var inputSchema48 = z50.object({
|
|
4250
|
+
folderId: z50.string().uuid().describe("Folder ID"),
|
|
4251
|
+
name: z50.string().min(1).describe("New folder name")
|
|
3771
4252
|
});
|
|
3772
4253
|
var foldersRename = {
|
|
3773
4254
|
name: "folders.rename",
|
|
3774
4255
|
group: "folders",
|
|
3775
4256
|
description: "Rename a folder",
|
|
3776
4257
|
inputSchema: inputSchema48,
|
|
3777
|
-
outputSchema:
|
|
4258
|
+
outputSchema: z50.any(),
|
|
3778
4259
|
annotations: { idempotentHint: true },
|
|
3779
4260
|
async execute(input, ctx) {
|
|
3780
4261
|
return ctx.client.put(
|
|
@@ -3797,11 +4278,11 @@ function registerFolderCommands() {
|
|
|
3797
4278
|
}
|
|
3798
4279
|
|
|
3799
4280
|
// src/commands/health.ts
|
|
3800
|
-
import { z as
|
|
3801
|
-
var healthInput =
|
|
3802
|
-
var healthOutput =
|
|
3803
|
-
status:
|
|
3804
|
-
timestamp:
|
|
4281
|
+
import { z as z51 } from "zod";
|
|
4282
|
+
var healthInput = z51.object({});
|
|
4283
|
+
var healthOutput = z51.object({
|
|
4284
|
+
status: z51.string(),
|
|
4285
|
+
timestamp: z51.string()
|
|
3805
4286
|
});
|
|
3806
4287
|
var healthCheck = {
|
|
3807
4288
|
name: "health.check",
|
|
@@ -3831,18 +4312,18 @@ var healthCheck = {
|
|
|
3831
4312
|
};
|
|
3832
4313
|
|
|
3833
4314
|
// src/commands/library/create-folder.ts
|
|
3834
|
-
import { z as
|
|
3835
|
-
var inputSchema49 =
|
|
3836
|
-
orgId:
|
|
3837
|
-
name:
|
|
3838
|
-
parent:
|
|
4315
|
+
import { z as z52 } from "zod";
|
|
4316
|
+
var inputSchema49 = z52.object({
|
|
4317
|
+
orgId: z52.string().uuid().describe("Organization ID"),
|
|
4318
|
+
name: z52.string().min(1).describe("Folder name"),
|
|
4319
|
+
parent: z52.string().uuid().optional().describe("Parent folder ID")
|
|
3839
4320
|
});
|
|
3840
4321
|
var libraryCreateFolder = {
|
|
3841
4322
|
name: "library.createFolder",
|
|
3842
4323
|
group: "library",
|
|
3843
4324
|
description: "Create a folder in the organization library",
|
|
3844
4325
|
inputSchema: inputSchema49,
|
|
3845
|
-
outputSchema:
|
|
4326
|
+
outputSchema: z52.any(),
|
|
3846
4327
|
async execute(input, ctx) {
|
|
3847
4328
|
const body = { name: input.name };
|
|
3848
4329
|
if (input.parent) body.parentId = input.parent;
|
|
@@ -3857,17 +4338,17 @@ var libraryCreateFolder = {
|
|
|
3857
4338
|
};
|
|
3858
4339
|
|
|
3859
4340
|
// src/commands/library/delete-folder.ts
|
|
3860
|
-
import { z as
|
|
3861
|
-
var inputSchema50 =
|
|
3862
|
-
orgId:
|
|
3863
|
-
folderId:
|
|
4341
|
+
import { z as z53 } from "zod";
|
|
4342
|
+
var inputSchema50 = z53.object({
|
|
4343
|
+
orgId: z53.string().uuid().describe("Organization ID"),
|
|
4344
|
+
folderId: z53.string().uuid().describe("Folder ID to delete")
|
|
3864
4345
|
});
|
|
3865
4346
|
var libraryDeleteFolder = {
|
|
3866
4347
|
name: "library.deleteFolder",
|
|
3867
4348
|
group: "library",
|
|
3868
4349
|
description: "Delete a folder from the organization library",
|
|
3869
4350
|
inputSchema: inputSchema50,
|
|
3870
|
-
outputSchema:
|
|
4351
|
+
outputSchema: z53.any(),
|
|
3871
4352
|
annotations: { destructiveHint: true },
|
|
3872
4353
|
async execute(input, ctx) {
|
|
3873
4354
|
await ctx.client.del("library_folder", {
|
|
@@ -3882,9 +4363,9 @@ var libraryDeleteFolder = {
|
|
|
3882
4363
|
};
|
|
3883
4364
|
|
|
3884
4365
|
// src/commands/library/files.ts
|
|
3885
|
-
import { z as
|
|
3886
|
-
var inputSchema51 =
|
|
3887
|
-
orgId:
|
|
4366
|
+
import { z as z54 } from "zod";
|
|
4367
|
+
var inputSchema51 = z54.object({
|
|
4368
|
+
orgId: z54.string().uuid().describe("Organization ID"),
|
|
3888
4369
|
...paginationInput
|
|
3889
4370
|
});
|
|
3890
4371
|
var libraryFiles = {
|
|
@@ -3892,7 +4373,7 @@ var libraryFiles = {
|
|
|
3892
4373
|
group: "library",
|
|
3893
4374
|
description: "List files in the organization library",
|
|
3894
4375
|
inputSchema: inputSchema51,
|
|
3895
|
-
outputSchema:
|
|
4376
|
+
outputSchema: z54.any(),
|
|
3896
4377
|
annotations: { readOnlyHint: true },
|
|
3897
4378
|
async execute(input, ctx) {
|
|
3898
4379
|
return ctx.client.get("library_files", {
|
|
@@ -3907,16 +4388,16 @@ var libraryFiles = {
|
|
|
3907
4388
|
};
|
|
3908
4389
|
|
|
3909
4390
|
// src/commands/library/folders.ts
|
|
3910
|
-
import { z as
|
|
3911
|
-
var inputSchema52 =
|
|
3912
|
-
orgId:
|
|
4391
|
+
import { z as z55 } from "zod";
|
|
4392
|
+
var inputSchema52 = z55.object({
|
|
4393
|
+
orgId: z55.string().uuid().describe("Organization ID")
|
|
3913
4394
|
});
|
|
3914
4395
|
var libraryFolders = {
|
|
3915
4396
|
name: "library.folders",
|
|
3916
4397
|
group: "library",
|
|
3917
4398
|
description: "List folders in the organization library",
|
|
3918
4399
|
inputSchema: inputSchema52,
|
|
3919
|
-
outputSchema:
|
|
4400
|
+
outputSchema: z55.any(),
|
|
3920
4401
|
annotations: { readOnlyHint: true },
|
|
3921
4402
|
async execute(input, ctx) {
|
|
3922
4403
|
return ctx.client.get("library_folders", {
|
|
@@ -3930,18 +4411,18 @@ var libraryFolders = {
|
|
|
3930
4411
|
};
|
|
3931
4412
|
|
|
3932
4413
|
// src/commands/library/rename-folder.ts
|
|
3933
|
-
import { z as
|
|
3934
|
-
var inputSchema53 =
|
|
3935
|
-
orgId:
|
|
3936
|
-
folderId:
|
|
3937
|
-
name:
|
|
4414
|
+
import { z as z56 } from "zod";
|
|
4415
|
+
var inputSchema53 = z56.object({
|
|
4416
|
+
orgId: z56.string().uuid().describe("Organization ID"),
|
|
4417
|
+
folderId: z56.string().uuid().describe("Folder ID to rename"),
|
|
4418
|
+
name: z56.string().min(1).describe("New folder name")
|
|
3938
4419
|
});
|
|
3939
4420
|
var libraryRenameFolder = {
|
|
3940
4421
|
name: "library.renameFolder",
|
|
3941
4422
|
group: "library",
|
|
3942
4423
|
description: "Rename a folder in the organization library",
|
|
3943
4424
|
inputSchema: inputSchema53,
|
|
3944
|
-
outputSchema:
|
|
4425
|
+
outputSchema: z56.any(),
|
|
3945
4426
|
async execute(input, ctx) {
|
|
3946
4427
|
return ctx.client.put(
|
|
3947
4428
|
"library_folder",
|
|
@@ -3963,16 +4444,16 @@ function registerLibraryCommands() {
|
|
|
3963
4444
|
}
|
|
3964
4445
|
|
|
3965
4446
|
// src/commands/orgs/accept-invite.ts
|
|
3966
|
-
import { z as
|
|
3967
|
-
var inputSchema54 =
|
|
3968
|
-
token:
|
|
4447
|
+
import { z as z57 } from "zod";
|
|
4448
|
+
var inputSchema54 = z57.object({
|
|
4449
|
+
token: z57.string().min(1).describe("Invitation token")
|
|
3969
4450
|
});
|
|
3970
4451
|
var orgsAcceptInvite = {
|
|
3971
4452
|
name: "orgs.acceptInvite",
|
|
3972
4453
|
group: "orgs",
|
|
3973
4454
|
description: "Accept an organization invitation by token",
|
|
3974
4455
|
inputSchema: inputSchema54,
|
|
3975
|
-
outputSchema:
|
|
4456
|
+
outputSchema: z57.any(),
|
|
3976
4457
|
async execute(input, ctx) {
|
|
3977
4458
|
return ctx.client.post("invitation_accept", void 0, {
|
|
3978
4459
|
pathParams: { token: input.token }
|
|
@@ -3985,16 +4466,16 @@ var orgsAcceptInvite = {
|
|
|
3985
4466
|
};
|
|
3986
4467
|
|
|
3987
4468
|
// src/commands/orgs/billing.ts
|
|
3988
|
-
import { z as
|
|
3989
|
-
var inputSchema55 =
|
|
3990
|
-
orgId:
|
|
4469
|
+
import { z as z58 } from "zod";
|
|
4470
|
+
var inputSchema55 = z58.object({
|
|
4471
|
+
orgId: z58.string().uuid().describe("Organization ID")
|
|
3991
4472
|
});
|
|
3992
4473
|
var orgsBilling = {
|
|
3993
4474
|
name: "orgs.billing",
|
|
3994
4475
|
group: "orgs",
|
|
3995
4476
|
description: "Get billing status for an organization",
|
|
3996
4477
|
inputSchema: inputSchema55,
|
|
3997
|
-
outputSchema:
|
|
4478
|
+
outputSchema: z58.any(),
|
|
3998
4479
|
annotations: { readOnlyHint: true },
|
|
3999
4480
|
async execute(input, ctx) {
|
|
4000
4481
|
return ctx.client.get("organization_billing", {
|
|
@@ -4008,17 +4489,17 @@ var orgsBilling = {
|
|
|
4008
4489
|
};
|
|
4009
4490
|
|
|
4010
4491
|
// src/commands/orgs/cancel-invite.ts
|
|
4011
|
-
import { z as
|
|
4012
|
-
var inputSchema56 =
|
|
4013
|
-
orgId:
|
|
4014
|
-
invitationId:
|
|
4492
|
+
import { z as z59 } from "zod";
|
|
4493
|
+
var inputSchema56 = z59.object({
|
|
4494
|
+
orgId: z59.string().uuid().describe("Organization ID"),
|
|
4495
|
+
invitationId: z59.string().uuid().describe("Invitation ID to cancel")
|
|
4015
4496
|
});
|
|
4016
4497
|
var orgsCancelInvite = {
|
|
4017
4498
|
name: "orgs.cancelInvite",
|
|
4018
4499
|
group: "orgs",
|
|
4019
4500
|
description: "Cancel a pending organization invitation",
|
|
4020
4501
|
inputSchema: inputSchema56,
|
|
4021
|
-
outputSchema:
|
|
4502
|
+
outputSchema: z59.any(),
|
|
4022
4503
|
annotations: { destructiveHint: true },
|
|
4023
4504
|
async execute(input, ctx) {
|
|
4024
4505
|
await ctx.client.del("org_invitation", {
|
|
@@ -4033,17 +4514,17 @@ var orgsCancelInvite = {
|
|
|
4033
4514
|
};
|
|
4034
4515
|
|
|
4035
4516
|
// src/commands/orgs/create.ts
|
|
4036
|
-
import { z as
|
|
4037
|
-
var inputSchema57 =
|
|
4038
|
-
name:
|
|
4039
|
-
description:
|
|
4517
|
+
import { z as z60 } from "zod";
|
|
4518
|
+
var inputSchema57 = z60.object({
|
|
4519
|
+
name: z60.string().min(1).describe("Organization name"),
|
|
4520
|
+
description: z60.string().optional().describe("Organization description")
|
|
4040
4521
|
});
|
|
4041
4522
|
var orgsCreate = {
|
|
4042
4523
|
name: "orgs.create",
|
|
4043
4524
|
group: "orgs",
|
|
4044
4525
|
description: "Create a new organization",
|
|
4045
4526
|
inputSchema: inputSchema57,
|
|
4046
|
-
outputSchema:
|
|
4527
|
+
outputSchema: z60.any(),
|
|
4047
4528
|
async execute(input, ctx) {
|
|
4048
4529
|
return ctx.client.post("organizations", input);
|
|
4049
4530
|
},
|
|
@@ -4054,17 +4535,17 @@ var orgsCreate = {
|
|
|
4054
4535
|
};
|
|
4055
4536
|
|
|
4056
4537
|
// src/commands/orgs/delete.ts
|
|
4057
|
-
import { z as
|
|
4058
|
-
var inputSchema58 =
|
|
4059
|
-
orgId:
|
|
4060
|
-
yes:
|
|
4538
|
+
import { z as z61 } from "zod";
|
|
4539
|
+
var inputSchema58 = z61.object({
|
|
4540
|
+
orgId: z61.string().uuid().describe("Organization ID to delete"),
|
|
4541
|
+
yes: z61.boolean().optional().default(false).describe("Skip confirmation prompt")
|
|
4061
4542
|
});
|
|
4062
4543
|
var orgsDelete = {
|
|
4063
4544
|
name: "orgs.delete",
|
|
4064
4545
|
group: "orgs",
|
|
4065
4546
|
description: "Delete an organization",
|
|
4066
4547
|
inputSchema: inputSchema58,
|
|
4067
|
-
outputSchema:
|
|
4548
|
+
outputSchema: z61.any(),
|
|
4068
4549
|
annotations: { destructiveHint: true },
|
|
4069
4550
|
async execute(input, ctx) {
|
|
4070
4551
|
if (!input.yes) {
|
|
@@ -4085,9 +4566,9 @@ var orgsDelete = {
|
|
|
4085
4566
|
};
|
|
4086
4567
|
|
|
4087
4568
|
// src/commands/orgs/files.ts
|
|
4088
|
-
import { z as
|
|
4089
|
-
var inputSchema59 =
|
|
4090
|
-
orgId:
|
|
4569
|
+
import { z as z62 } from "zod";
|
|
4570
|
+
var inputSchema59 = z62.object({
|
|
4571
|
+
orgId: z62.string().uuid().describe("Organization ID"),
|
|
4091
4572
|
...paginationInput
|
|
4092
4573
|
});
|
|
4093
4574
|
var orgsFiles = {
|
|
@@ -4095,7 +4576,7 @@ var orgsFiles = {
|
|
|
4095
4576
|
group: "orgs",
|
|
4096
4577
|
description: "List files belonging to an organization",
|
|
4097
4578
|
inputSchema: inputSchema59,
|
|
4098
|
-
outputSchema:
|
|
4579
|
+
outputSchema: z62.any(),
|
|
4099
4580
|
annotations: { readOnlyHint: true },
|
|
4100
4581
|
async execute(input, ctx) {
|
|
4101
4582
|
return ctx.client.get("org_files", {
|
|
@@ -4110,16 +4591,16 @@ var orgsFiles = {
|
|
|
4110
4591
|
};
|
|
4111
4592
|
|
|
4112
4593
|
// src/commands/orgs/get.ts
|
|
4113
|
-
import { z as
|
|
4114
|
-
var inputSchema60 =
|
|
4115
|
-
orgId:
|
|
4594
|
+
import { z as z63 } from "zod";
|
|
4595
|
+
var inputSchema60 = z63.object({
|
|
4596
|
+
orgId: z63.string().uuid().describe("Organization ID")
|
|
4116
4597
|
});
|
|
4117
4598
|
var orgsGet = {
|
|
4118
4599
|
name: "orgs.get",
|
|
4119
4600
|
group: "orgs",
|
|
4120
4601
|
description: "Get details of a specific organization",
|
|
4121
4602
|
inputSchema: inputSchema60,
|
|
4122
|
-
outputSchema:
|
|
4603
|
+
outputSchema: z63.any(),
|
|
4123
4604
|
async execute(input, ctx) {
|
|
4124
4605
|
return ctx.client.get("organization", {
|
|
4125
4606
|
pathParams: { id: input.orgId }
|
|
@@ -4132,16 +4613,16 @@ var orgsGet = {
|
|
|
4132
4613
|
};
|
|
4133
4614
|
|
|
4134
4615
|
// src/commands/orgs/invitation-info.ts
|
|
4135
|
-
import { z as
|
|
4136
|
-
var inputSchema61 =
|
|
4137
|
-
token:
|
|
4616
|
+
import { z as z64 } from "zod";
|
|
4617
|
+
var inputSchema61 = z64.object({
|
|
4618
|
+
token: z64.string().min(1).describe("Invitation token")
|
|
4138
4619
|
});
|
|
4139
4620
|
var orgsInvitationInfo = {
|
|
4140
4621
|
name: "orgs.invitationInfo",
|
|
4141
4622
|
group: "orgs",
|
|
4142
4623
|
description: "Get information about an invitation by token",
|
|
4143
4624
|
inputSchema: inputSchema61,
|
|
4144
|
-
outputSchema:
|
|
4625
|
+
outputSchema: z64.any(),
|
|
4145
4626
|
annotations: { readOnlyHint: true },
|
|
4146
4627
|
async execute(input, ctx) {
|
|
4147
4628
|
return ctx.client.get("invitation_info", {
|
|
@@ -4155,16 +4636,16 @@ var orgsInvitationInfo = {
|
|
|
4155
4636
|
};
|
|
4156
4637
|
|
|
4157
4638
|
// src/commands/orgs/invitations.ts
|
|
4158
|
-
import { z as
|
|
4159
|
-
var inputSchema62 =
|
|
4160
|
-
orgId:
|
|
4639
|
+
import { z as z65 } from "zod";
|
|
4640
|
+
var inputSchema62 = z65.object({
|
|
4641
|
+
orgId: z65.string().uuid().describe("Organization ID")
|
|
4161
4642
|
});
|
|
4162
4643
|
var orgsInvitations = {
|
|
4163
4644
|
name: "orgs.invitations",
|
|
4164
4645
|
group: "orgs",
|
|
4165
4646
|
description: "List pending invitations for an organization",
|
|
4166
4647
|
inputSchema: inputSchema62,
|
|
4167
|
-
outputSchema:
|
|
4648
|
+
outputSchema: z65.any(),
|
|
4168
4649
|
annotations: { readOnlyHint: true },
|
|
4169
4650
|
async execute(input, ctx) {
|
|
4170
4651
|
return ctx.client.get("org_invitations", {
|
|
@@ -4178,18 +4659,18 @@ var orgsInvitations = {
|
|
|
4178
4659
|
};
|
|
4179
4660
|
|
|
4180
4661
|
// src/commands/orgs/invite.ts
|
|
4181
|
-
import { z as
|
|
4182
|
-
var inputSchema63 =
|
|
4183
|
-
orgId:
|
|
4184
|
-
email:
|
|
4185
|
-
role:
|
|
4662
|
+
import { z as z66 } from "zod";
|
|
4663
|
+
var inputSchema63 = z66.object({
|
|
4664
|
+
orgId: z66.string().uuid().describe("Organization ID"),
|
|
4665
|
+
email: z66.string().email().describe("Email address to invite"),
|
|
4666
|
+
role: z66.string().optional().default("Member").describe("Role to assign (default: Member)")
|
|
4186
4667
|
});
|
|
4187
4668
|
var orgsInvite = {
|
|
4188
4669
|
name: "orgs.invite",
|
|
4189
4670
|
group: "orgs",
|
|
4190
4671
|
description: "Invite a user to an organization by email",
|
|
4191
4672
|
inputSchema: inputSchema63,
|
|
4192
|
-
outputSchema:
|
|
4673
|
+
outputSchema: z66.any(),
|
|
4193
4674
|
annotations: { idempotentHint: true },
|
|
4194
4675
|
async execute(input, ctx) {
|
|
4195
4676
|
const existing = await ctx.client.get("org_invitations", {
|
|
@@ -4217,14 +4698,14 @@ var orgsInvite = {
|
|
|
4217
4698
|
};
|
|
4218
4699
|
|
|
4219
4700
|
// src/commands/orgs/list.ts
|
|
4220
|
-
import { z as
|
|
4221
|
-
var inputSchema64 =
|
|
4701
|
+
import { z as z67 } from "zod";
|
|
4702
|
+
var inputSchema64 = z67.object({});
|
|
4222
4703
|
var orgsList = {
|
|
4223
4704
|
name: "orgs.list",
|
|
4224
4705
|
group: "orgs",
|
|
4225
4706
|
description: "List all organizations the current user belongs to",
|
|
4226
4707
|
inputSchema: inputSchema64,
|
|
4227
|
-
outputSchema:
|
|
4708
|
+
outputSchema: z67.any(),
|
|
4228
4709
|
annotations: { readOnlyHint: true },
|
|
4229
4710
|
async execute(_input, ctx) {
|
|
4230
4711
|
return ctx.client.get("organizations");
|
|
@@ -4236,14 +4717,14 @@ var orgsList = {
|
|
|
4236
4717
|
};
|
|
4237
4718
|
|
|
4238
4719
|
// src/commands/orgs/list-all.ts
|
|
4239
|
-
import { z as
|
|
4240
|
-
var inputSchema65 =
|
|
4720
|
+
import { z as z68 } from "zod";
|
|
4721
|
+
var inputSchema65 = z68.object({});
|
|
4241
4722
|
var orgsListAll = {
|
|
4242
4723
|
name: "orgs.listAll",
|
|
4243
4724
|
group: "orgs",
|
|
4244
4725
|
description: "List all organizations (admin)",
|
|
4245
4726
|
inputSchema: inputSchema65,
|
|
4246
|
-
outputSchema:
|
|
4727
|
+
outputSchema: z68.any(),
|
|
4247
4728
|
annotations: { readOnlyHint: true },
|
|
4248
4729
|
async execute(_input, ctx) {
|
|
4249
4730
|
return ctx.client.get("organizations_all");
|
|
@@ -4255,16 +4736,16 @@ var orgsListAll = {
|
|
|
4255
4736
|
};
|
|
4256
4737
|
|
|
4257
4738
|
// src/commands/orgs/members.ts
|
|
4258
|
-
import { z as
|
|
4259
|
-
var inputSchema66 =
|
|
4260
|
-
orgId:
|
|
4739
|
+
import { z as z69 } from "zod";
|
|
4740
|
+
var inputSchema66 = z69.object({
|
|
4741
|
+
orgId: z69.string().uuid().describe("Organization ID")
|
|
4261
4742
|
});
|
|
4262
4743
|
var orgsMembers = {
|
|
4263
4744
|
name: "orgs.members",
|
|
4264
4745
|
group: "orgs",
|
|
4265
4746
|
description: "List members of an organization",
|
|
4266
4747
|
inputSchema: inputSchema66,
|
|
4267
|
-
outputSchema:
|
|
4748
|
+
outputSchema: z69.any(),
|
|
4268
4749
|
annotations: { readOnlyHint: true },
|
|
4269
4750
|
async execute(input, ctx) {
|
|
4270
4751
|
return ctx.client.get("organization_members", {
|
|
@@ -4278,17 +4759,17 @@ var orgsMembers = {
|
|
|
4278
4759
|
};
|
|
4279
4760
|
|
|
4280
4761
|
// src/commands/orgs/remove-member.ts
|
|
4281
|
-
import { z as
|
|
4282
|
-
var inputSchema67 =
|
|
4283
|
-
orgId:
|
|
4284
|
-
membershipId:
|
|
4762
|
+
import { z as z70 } from "zod";
|
|
4763
|
+
var inputSchema67 = z70.object({
|
|
4764
|
+
orgId: z70.string().uuid().describe("Organization ID"),
|
|
4765
|
+
membershipId: z70.string().uuid().describe("Membership ID of the member to remove")
|
|
4285
4766
|
});
|
|
4286
4767
|
var orgsRemoveMember = {
|
|
4287
4768
|
name: "orgs.removeMember",
|
|
4288
4769
|
group: "orgs",
|
|
4289
4770
|
description: "Remove a member from an organization",
|
|
4290
4771
|
inputSchema: inputSchema67,
|
|
4291
|
-
outputSchema:
|
|
4772
|
+
outputSchema: z70.any(),
|
|
4292
4773
|
annotations: { destructiveHint: true },
|
|
4293
4774
|
async execute(input, ctx) {
|
|
4294
4775
|
await ctx.client.del("organization_member", {
|
|
@@ -4303,17 +4784,17 @@ var orgsRemoveMember = {
|
|
|
4303
4784
|
};
|
|
4304
4785
|
|
|
4305
4786
|
// src/commands/orgs/resend-invite.ts
|
|
4306
|
-
import { z as
|
|
4307
|
-
var inputSchema68 =
|
|
4308
|
-
orgId:
|
|
4309
|
-
invitationId:
|
|
4787
|
+
import { z as z71 } from "zod";
|
|
4788
|
+
var inputSchema68 = z71.object({
|
|
4789
|
+
orgId: z71.string().uuid().describe("Organization ID"),
|
|
4790
|
+
invitationId: z71.string().uuid().describe("Invitation ID to resend")
|
|
4310
4791
|
});
|
|
4311
4792
|
var orgsResendInvite = {
|
|
4312
4793
|
name: "orgs.resendInvite",
|
|
4313
4794
|
group: "orgs",
|
|
4314
4795
|
description: "Resend an organization invitation email. Regenerates the token and extends the expiry by 7 days. Works on both pending and expired invitations, preserves the invitation ID.",
|
|
4315
4796
|
inputSchema: inputSchema68,
|
|
4316
|
-
outputSchema:
|
|
4797
|
+
outputSchema: z71.any(),
|
|
4317
4798
|
annotations: { idempotentHint: true },
|
|
4318
4799
|
async execute(input, ctx) {
|
|
4319
4800
|
return ctx.client.post(
|
|
@@ -4329,16 +4810,16 @@ var orgsResendInvite = {
|
|
|
4329
4810
|
};
|
|
4330
4811
|
|
|
4331
4812
|
// src/commands/orgs/set-default.ts
|
|
4332
|
-
import { z as
|
|
4333
|
-
var inputSchema69 =
|
|
4334
|
-
orgId:
|
|
4813
|
+
import { z as z72 } from "zod";
|
|
4814
|
+
var inputSchema69 = z72.object({
|
|
4815
|
+
orgId: z72.string().uuid().describe("Organization ID to set as default")
|
|
4335
4816
|
});
|
|
4336
4817
|
var orgsSetDefault = {
|
|
4337
4818
|
name: "orgs.setDefault",
|
|
4338
4819
|
group: "orgs",
|
|
4339
4820
|
description: "Set an organization as the default",
|
|
4340
4821
|
inputSchema: inputSchema69,
|
|
4341
|
-
outputSchema:
|
|
4822
|
+
outputSchema: z72.any(),
|
|
4342
4823
|
annotations: { idempotentHint: true },
|
|
4343
4824
|
async execute(input, ctx) {
|
|
4344
4825
|
return ctx.client.put("organization_set_default", void 0, {
|
|
@@ -4352,17 +4833,17 @@ var orgsSetDefault = {
|
|
|
4352
4833
|
};
|
|
4353
4834
|
|
|
4354
4835
|
// src/commands/orgs/set-stripe.ts
|
|
4355
|
-
import { z as
|
|
4356
|
-
var inputSchema70 =
|
|
4357
|
-
orgId:
|
|
4358
|
-
stripeCustomerId:
|
|
4836
|
+
import { z as z73 } from "zod";
|
|
4837
|
+
var inputSchema70 = z73.object({
|
|
4838
|
+
orgId: z73.string().uuid().describe("Organization ID"),
|
|
4839
|
+
stripeCustomerId: z73.string().min(1).describe("Stripe customer ID (e.g. cus_xxx)")
|
|
4359
4840
|
});
|
|
4360
4841
|
var orgsSetStripe = {
|
|
4361
4842
|
name: "orgs.setStripe",
|
|
4362
4843
|
group: "orgs",
|
|
4363
4844
|
description: "Set the Stripe customer ID for an organization",
|
|
4364
4845
|
inputSchema: inputSchema70,
|
|
4365
|
-
outputSchema:
|
|
4846
|
+
outputSchema: z73.any(),
|
|
4366
4847
|
annotations: { idempotentHint: true },
|
|
4367
4848
|
async execute(input, ctx) {
|
|
4368
4849
|
return ctx.client.put(
|
|
@@ -4379,18 +4860,18 @@ var orgsSetStripe = {
|
|
|
4379
4860
|
|
|
4380
4861
|
// src/commands/orgs/update.ts
|
|
4381
4862
|
init_errors();
|
|
4382
|
-
import { z as
|
|
4383
|
-
var inputSchema71 =
|
|
4384
|
-
orgId:
|
|
4385
|
-
name:
|
|
4386
|
-
description:
|
|
4863
|
+
import { z as z74 } from "zod";
|
|
4864
|
+
var inputSchema71 = z74.object({
|
|
4865
|
+
orgId: z74.string().uuid().describe("Organization ID"),
|
|
4866
|
+
name: z74.string().min(1).optional().describe("New organization name"),
|
|
4867
|
+
description: z74.string().optional().describe("New organization description")
|
|
4387
4868
|
});
|
|
4388
4869
|
var orgsUpdate = {
|
|
4389
4870
|
name: "orgs.update",
|
|
4390
4871
|
group: "orgs",
|
|
4391
4872
|
description: "Update an existing organization",
|
|
4392
4873
|
inputSchema: inputSchema71,
|
|
4393
|
-
outputSchema:
|
|
4874
|
+
outputSchema: z74.any(),
|
|
4394
4875
|
annotations: { idempotentHint: true },
|
|
4395
4876
|
async execute(input, ctx) {
|
|
4396
4877
|
const { orgId, ...fields } = input;
|
|
@@ -4411,18 +4892,18 @@ var orgsUpdate = {
|
|
|
4411
4892
|
};
|
|
4412
4893
|
|
|
4413
4894
|
// src/commands/orgs/update-role.ts
|
|
4414
|
-
import { z as
|
|
4415
|
-
var inputSchema72 =
|
|
4416
|
-
orgId:
|
|
4417
|
-
membershipId:
|
|
4418
|
-
role:
|
|
4895
|
+
import { z as z75 } from "zod";
|
|
4896
|
+
var inputSchema72 = z75.object({
|
|
4897
|
+
orgId: z75.string().uuid().describe("Organization ID"),
|
|
4898
|
+
membershipId: z75.string().uuid().describe("Membership ID of the member"),
|
|
4899
|
+
role: z75.string().min(1).describe("New role to assign")
|
|
4419
4900
|
});
|
|
4420
4901
|
var orgsUpdateRole = {
|
|
4421
4902
|
name: "orgs.updateRole",
|
|
4422
4903
|
group: "orgs",
|
|
4423
4904
|
description: "Update an organization member's role",
|
|
4424
4905
|
inputSchema: inputSchema72,
|
|
4425
|
-
outputSchema:
|
|
4906
|
+
outputSchema: z75.any(),
|
|
4426
4907
|
annotations: { idempotentHint: true },
|
|
4427
4908
|
async execute(input, ctx) {
|
|
4428
4909
|
return ctx.client.put(
|
|
@@ -4463,18 +4944,18 @@ function registerOrgCommands() {
|
|
|
4463
4944
|
}
|
|
4464
4945
|
|
|
4465
4946
|
// src/commands/projects/add-member.ts
|
|
4466
|
-
import { z as
|
|
4467
|
-
var inputSchema73 =
|
|
4468
|
-
projectId:
|
|
4469
|
-
userId:
|
|
4470
|
-
role:
|
|
4947
|
+
import { z as z76 } from "zod";
|
|
4948
|
+
var inputSchema73 = z76.object({
|
|
4949
|
+
projectId: z76.string().uuid().describe("Project ID"),
|
|
4950
|
+
userId: z76.string().uuid().describe("User ID to add"),
|
|
4951
|
+
role: z76.string().default("Member").describe("Role to assign (default: Member)")
|
|
4471
4952
|
});
|
|
4472
4953
|
var projectsAddMember = {
|
|
4473
4954
|
name: "projects.addMember",
|
|
4474
4955
|
group: "projects",
|
|
4475
4956
|
description: "Add a member to a project",
|
|
4476
4957
|
inputSchema: inputSchema73,
|
|
4477
|
-
outputSchema:
|
|
4958
|
+
outputSchema: z76.any(),
|
|
4478
4959
|
async execute(input, ctx) {
|
|
4479
4960
|
return ctx.client.post(
|
|
4480
4961
|
"project_members",
|
|
@@ -4489,16 +4970,16 @@ var projectsAddMember = {
|
|
|
4489
4970
|
};
|
|
4490
4971
|
|
|
4491
4972
|
// src/commands/projects/archive.ts
|
|
4492
|
-
import { z as
|
|
4493
|
-
var inputSchema74 =
|
|
4494
|
-
projectId:
|
|
4973
|
+
import { z as z77 } from "zod";
|
|
4974
|
+
var inputSchema74 = z77.object({
|
|
4975
|
+
projectId: z77.string().uuid().describe("Project ID to archive")
|
|
4495
4976
|
});
|
|
4496
4977
|
var projectsArchive = {
|
|
4497
4978
|
name: "projects.archive",
|
|
4498
4979
|
group: "projects",
|
|
4499
4980
|
description: "Archive (delete) a project",
|
|
4500
4981
|
inputSchema: inputSchema74,
|
|
4501
|
-
outputSchema:
|
|
4982
|
+
outputSchema: z77.any(),
|
|
4502
4983
|
annotations: { destructiveHint: true },
|
|
4503
4984
|
async execute(input, ctx) {
|
|
4504
4985
|
await ctx.client.del("project", {
|
|
@@ -4513,18 +4994,18 @@ var projectsArchive = {
|
|
|
4513
4994
|
};
|
|
4514
4995
|
|
|
4515
4996
|
// src/commands/projects/create.ts
|
|
4516
|
-
import { z as
|
|
4517
|
-
var inputSchema75 =
|
|
4518
|
-
name:
|
|
4519
|
-
description:
|
|
4520
|
-
icon:
|
|
4997
|
+
import { z as z78 } from "zod";
|
|
4998
|
+
var inputSchema75 = z78.object({
|
|
4999
|
+
name: z78.string().min(1).describe("Project name"),
|
|
5000
|
+
description: z78.string().optional().describe("Project description"),
|
|
5001
|
+
icon: z78.string().optional().describe("Project icon")
|
|
4521
5002
|
});
|
|
4522
5003
|
var projectsCreate = {
|
|
4523
5004
|
name: "projects.create",
|
|
4524
5005
|
group: "projects",
|
|
4525
5006
|
description: "Create a new project",
|
|
4526
5007
|
inputSchema: inputSchema75,
|
|
4527
|
-
outputSchema:
|
|
5008
|
+
outputSchema: z78.any(),
|
|
4528
5009
|
async execute(input, ctx) {
|
|
4529
5010
|
return ctx.client.post("projects", input);
|
|
4530
5011
|
},
|
|
@@ -4535,16 +5016,16 @@ var projectsCreate = {
|
|
|
4535
5016
|
};
|
|
4536
5017
|
|
|
4537
5018
|
// src/commands/projects/get.ts
|
|
4538
|
-
import { z as
|
|
4539
|
-
var inputSchema76 =
|
|
4540
|
-
projectId:
|
|
5019
|
+
import { z as z79 } from "zod";
|
|
5020
|
+
var inputSchema76 = z79.object({
|
|
5021
|
+
projectId: z79.string().uuid().describe("Project ID")
|
|
4541
5022
|
});
|
|
4542
5023
|
var projectsGet = {
|
|
4543
5024
|
name: "projects.get",
|
|
4544
5025
|
group: "projects",
|
|
4545
5026
|
description: "Get details of a specific project",
|
|
4546
5027
|
inputSchema: inputSchema76,
|
|
4547
|
-
outputSchema:
|
|
5028
|
+
outputSchema: z79.any(),
|
|
4548
5029
|
annotations: { readOnlyHint: true },
|
|
4549
5030
|
async execute(input, ctx) {
|
|
4550
5031
|
return ctx.client.get("project", {
|
|
@@ -4558,16 +5039,16 @@ var projectsGet = {
|
|
|
4558
5039
|
};
|
|
4559
5040
|
|
|
4560
5041
|
// src/commands/projects/leave.ts
|
|
4561
|
-
import { z as
|
|
4562
|
-
var inputSchema77 =
|
|
4563
|
-
projectId:
|
|
5042
|
+
import { z as z80 } from "zod";
|
|
5043
|
+
var inputSchema77 = z80.object({
|
|
5044
|
+
projectId: z80.string().uuid().describe("Project ID to leave")
|
|
4564
5045
|
});
|
|
4565
5046
|
var projectsLeave = {
|
|
4566
5047
|
name: "projects.leave",
|
|
4567
5048
|
group: "projects",
|
|
4568
5049
|
description: "Leave a project",
|
|
4569
5050
|
inputSchema: inputSchema77,
|
|
4570
|
-
outputSchema:
|
|
5051
|
+
outputSchema: z80.any(),
|
|
4571
5052
|
annotations: { destructiveHint: true },
|
|
4572
5053
|
async execute(input, ctx) {
|
|
4573
5054
|
return ctx.client.post("project_leave", void 0, {
|
|
@@ -4581,8 +5062,8 @@ var projectsLeave = {
|
|
|
4581
5062
|
};
|
|
4582
5063
|
|
|
4583
5064
|
// src/commands/projects/list.ts
|
|
4584
|
-
import { z as
|
|
4585
|
-
var inputSchema78 =
|
|
5065
|
+
import { z as z81 } from "zod";
|
|
5066
|
+
var inputSchema78 = z81.object({
|
|
4586
5067
|
...paginationInput
|
|
4587
5068
|
});
|
|
4588
5069
|
var projectsList = {
|
|
@@ -4590,7 +5071,7 @@ var projectsList = {
|
|
|
4590
5071
|
group: "projects",
|
|
4591
5072
|
description: "List all projects accessible to the current user",
|
|
4592
5073
|
inputSchema: inputSchema78,
|
|
4593
|
-
outputSchema:
|
|
5074
|
+
outputSchema: z81.any(),
|
|
4594
5075
|
annotations: { readOnlyHint: true },
|
|
4595
5076
|
async execute(input, ctx) {
|
|
4596
5077
|
return ctx.client.get("projects", {
|
|
@@ -4604,16 +5085,16 @@ var projectsList = {
|
|
|
4604
5085
|
};
|
|
4605
5086
|
|
|
4606
5087
|
// src/commands/projects/members.ts
|
|
4607
|
-
import { z as
|
|
4608
|
-
var inputSchema79 =
|
|
4609
|
-
projectId:
|
|
5088
|
+
import { z as z82 } from "zod";
|
|
5089
|
+
var inputSchema79 = z82.object({
|
|
5090
|
+
projectId: z82.string().uuid().describe("Project ID")
|
|
4610
5091
|
});
|
|
4611
5092
|
var projectsMembers = {
|
|
4612
5093
|
name: "projects.members",
|
|
4613
5094
|
group: "projects",
|
|
4614
5095
|
description: "List members of a project",
|
|
4615
5096
|
inputSchema: inputSchema79,
|
|
4616
|
-
outputSchema:
|
|
5097
|
+
outputSchema: z82.any(),
|
|
4617
5098
|
annotations: { readOnlyHint: true },
|
|
4618
5099
|
async execute(input, ctx) {
|
|
4619
5100
|
return ctx.client.get("project_members", {
|
|
@@ -4627,17 +5108,17 @@ var projectsMembers = {
|
|
|
4627
5108
|
};
|
|
4628
5109
|
|
|
4629
5110
|
// src/commands/projects/remove-member.ts
|
|
4630
|
-
import { z as
|
|
4631
|
-
var inputSchema80 =
|
|
4632
|
-
projectId:
|
|
4633
|
-
userId:
|
|
5111
|
+
import { z as z83 } from "zod";
|
|
5112
|
+
var inputSchema80 = z83.object({
|
|
5113
|
+
projectId: z83.string().uuid().describe("Project ID"),
|
|
5114
|
+
userId: z83.string().uuid().describe("User ID to remove")
|
|
4634
5115
|
});
|
|
4635
5116
|
var projectsRemoveMember = {
|
|
4636
5117
|
name: "projects.removeMember",
|
|
4637
5118
|
group: "projects",
|
|
4638
5119
|
description: "Remove a member from a project",
|
|
4639
5120
|
inputSchema: inputSchema80,
|
|
4640
|
-
outputSchema:
|
|
5121
|
+
outputSchema: z83.any(),
|
|
4641
5122
|
annotations: { destructiveHint: true },
|
|
4642
5123
|
async execute(input, ctx) {
|
|
4643
5124
|
await ctx.client.del("project_member", {
|
|
@@ -4653,19 +5134,19 @@ var projectsRemoveMember = {
|
|
|
4653
5134
|
|
|
4654
5135
|
// src/commands/projects/update.ts
|
|
4655
5136
|
init_errors();
|
|
4656
|
-
import { z as
|
|
4657
|
-
var inputSchema81 =
|
|
4658
|
-
projectId:
|
|
4659
|
-
name:
|
|
4660
|
-
description:
|
|
4661
|
-
icon:
|
|
5137
|
+
import { z as z84 } from "zod";
|
|
5138
|
+
var inputSchema81 = z84.object({
|
|
5139
|
+
projectId: z84.string().uuid().describe("Project ID"),
|
|
5140
|
+
name: z84.string().min(1).optional().describe("New project name"),
|
|
5141
|
+
description: z84.string().optional().describe("New project description"),
|
|
5142
|
+
icon: z84.string().optional().describe("New project icon")
|
|
4662
5143
|
});
|
|
4663
5144
|
var projectsUpdate = {
|
|
4664
5145
|
name: "projects.update",
|
|
4665
5146
|
group: "projects",
|
|
4666
5147
|
description: "Update an existing project",
|
|
4667
5148
|
inputSchema: inputSchema81,
|
|
4668
|
-
outputSchema:
|
|
5149
|
+
outputSchema: z84.any(),
|
|
4669
5150
|
annotations: { idempotentHint: true },
|
|
4670
5151
|
async execute(input, ctx) {
|
|
4671
5152
|
const { projectId, ...fields } = input;
|
|
@@ -4686,18 +5167,18 @@ var projectsUpdate = {
|
|
|
4686
5167
|
};
|
|
4687
5168
|
|
|
4688
5169
|
// src/commands/projects/update-role.ts
|
|
4689
|
-
import { z as
|
|
4690
|
-
var inputSchema82 =
|
|
4691
|
-
projectId:
|
|
4692
|
-
userId:
|
|
4693
|
-
role:
|
|
5170
|
+
import { z as z85 } from "zod";
|
|
5171
|
+
var inputSchema82 = z85.object({
|
|
5172
|
+
projectId: z85.string().uuid().describe("Project ID"),
|
|
5173
|
+
userId: z85.string().uuid().describe("User ID of the member"),
|
|
5174
|
+
role: z85.string().min(1).describe("New role to assign")
|
|
4694
5175
|
});
|
|
4695
5176
|
var projectsUpdateRole = {
|
|
4696
5177
|
name: "projects.updateRole",
|
|
4697
5178
|
group: "projects",
|
|
4698
5179
|
description: "Update a project member's role",
|
|
4699
5180
|
inputSchema: inputSchema82,
|
|
4700
|
-
outputSchema:
|
|
5181
|
+
outputSchema: z85.any(),
|
|
4701
5182
|
annotations: { idempotentHint: true },
|
|
4702
5183
|
async execute(input, ctx) {
|
|
4703
5184
|
return ctx.client.put(
|
|
@@ -4729,18 +5210,19 @@ function registerProjectCommands() {
|
|
|
4729
5210
|
}
|
|
4730
5211
|
|
|
4731
5212
|
// src/commands/protocols/generate.ts
|
|
4732
|
-
import { z as
|
|
4733
|
-
var inputSchema83 =
|
|
4734
|
-
description:
|
|
4735
|
-
title:
|
|
4736
|
-
project:
|
|
5213
|
+
import { z as z86 } from "zod";
|
|
5214
|
+
var inputSchema83 = z86.object({
|
|
5215
|
+
description: z86.string().min(10).max(5e3).describe("Protocol description"),
|
|
5216
|
+
title: z86.string().max(200).optional().describe("Task title (defaults to first 100 chars of description)"),
|
|
5217
|
+
project: z86.string().uuid().optional().describe("Project UUID to associate with")
|
|
4737
5218
|
});
|
|
4738
5219
|
var protocolsGenerate = {
|
|
4739
5220
|
name: "protocols.generate",
|
|
4740
5221
|
group: "protocols",
|
|
4741
5222
|
description: "Generate a bioprotocol \u2014 creates a task and sends the description in one call",
|
|
5223
|
+
stdinField: "description",
|
|
4742
5224
|
inputSchema: inputSchema83,
|
|
4743
|
-
outputSchema:
|
|
5225
|
+
outputSchema: z86.any(),
|
|
4744
5226
|
annotations: { mcpScopes: ["tasks:write", "messages:write"] },
|
|
4745
5227
|
async execute(input, ctx) {
|
|
4746
5228
|
const body = { title: input.title || input.description.slice(0, 100) };
|
|
@@ -4774,17 +5256,18 @@ function registerProtocolCommands() {
|
|
|
4774
5256
|
}
|
|
4775
5257
|
|
|
4776
5258
|
// src/commands/search/all.ts
|
|
4777
|
-
import { z as
|
|
4778
|
-
var inputSchema84 =
|
|
4779
|
-
query:
|
|
5259
|
+
import { z as z87 } from "zod";
|
|
5260
|
+
var inputSchema84 = z87.object({
|
|
5261
|
+
query: z87.string().min(1).describe("Search query"),
|
|
4780
5262
|
...paginationInput
|
|
4781
5263
|
});
|
|
4782
5264
|
var searchAll = {
|
|
4783
5265
|
name: "search.all",
|
|
4784
5266
|
group: "search",
|
|
4785
5267
|
description: "Search across all entities",
|
|
5268
|
+
stdinField: "query",
|
|
4786
5269
|
inputSchema: inputSchema84,
|
|
4787
|
-
outputSchema:
|
|
5270
|
+
outputSchema: z87.any(),
|
|
4788
5271
|
annotations: { readOnlyHint: true },
|
|
4789
5272
|
async execute(input, ctx) {
|
|
4790
5273
|
return ctx.client.get("search_all", {
|
|
@@ -4798,18 +5281,19 @@ var searchAll = {
|
|
|
4798
5281
|
};
|
|
4799
5282
|
|
|
4800
5283
|
// src/commands/search/file-content.ts
|
|
4801
|
-
import { z as
|
|
4802
|
-
var inputSchema85 =
|
|
4803
|
-
query:
|
|
4804
|
-
projectId:
|
|
5284
|
+
import { z as z88 } from "zod";
|
|
5285
|
+
var inputSchema85 = z88.object({
|
|
5286
|
+
query: z88.string().min(1).describe("Search query"),
|
|
5287
|
+
projectId: z88.string().uuid().optional().describe("Filter by project ID"),
|
|
4805
5288
|
...paginationInput
|
|
4806
5289
|
});
|
|
4807
5290
|
var searchFileContent = {
|
|
4808
5291
|
name: "search.fileContent",
|
|
4809
5292
|
group: "search",
|
|
4810
5293
|
description: "Search within file contents",
|
|
5294
|
+
stdinField: "query",
|
|
4811
5295
|
inputSchema: inputSchema85,
|
|
4812
|
-
outputSchema:
|
|
5296
|
+
outputSchema: z88.any(),
|
|
4813
5297
|
annotations: { readOnlyHint: true },
|
|
4814
5298
|
async execute(input, ctx) {
|
|
4815
5299
|
const queryParams = {
|
|
@@ -4827,17 +5311,18 @@ var searchFileContent = {
|
|
|
4827
5311
|
};
|
|
4828
5312
|
|
|
4829
5313
|
// src/commands/search/files.ts
|
|
4830
|
-
import { z as
|
|
4831
|
-
var inputSchema86 =
|
|
4832
|
-
query:
|
|
5314
|
+
import { z as z89 } from "zod";
|
|
5315
|
+
var inputSchema86 = z89.object({
|
|
5316
|
+
query: z89.string().min(1).describe("Search query"),
|
|
4833
5317
|
...paginationInput
|
|
4834
5318
|
});
|
|
4835
5319
|
var searchFiles = {
|
|
4836
5320
|
name: "search.files",
|
|
4837
5321
|
group: "search",
|
|
4838
5322
|
description: "Search files by query",
|
|
5323
|
+
stdinField: "query",
|
|
4839
5324
|
inputSchema: inputSchema86,
|
|
4840
|
-
outputSchema:
|
|
5325
|
+
outputSchema: z89.any(),
|
|
4841
5326
|
annotations: { readOnlyHint: true },
|
|
4842
5327
|
async execute(input, ctx) {
|
|
4843
5328
|
return ctx.client.get("search_files", {
|
|
@@ -4851,17 +5336,18 @@ var searchFiles = {
|
|
|
4851
5336
|
};
|
|
4852
5337
|
|
|
4853
5338
|
// src/commands/search/tasks.ts
|
|
4854
|
-
import { z as
|
|
4855
|
-
var inputSchema87 =
|
|
4856
|
-
query:
|
|
5339
|
+
import { z as z90 } from "zod";
|
|
5340
|
+
var inputSchema87 = z90.object({
|
|
5341
|
+
query: z90.string().min(1).describe("Search query"),
|
|
4857
5342
|
...paginationInput
|
|
4858
5343
|
});
|
|
4859
5344
|
var searchTasks = {
|
|
4860
5345
|
name: "search.tasks",
|
|
4861
5346
|
group: "search",
|
|
4862
5347
|
description: "Search tasks by query",
|
|
5348
|
+
stdinField: "query",
|
|
4863
5349
|
inputSchema: inputSchema87,
|
|
4864
|
-
outputSchema:
|
|
5350
|
+
outputSchema: z90.any(),
|
|
4865
5351
|
annotations: { readOnlyHint: true },
|
|
4866
5352
|
async execute(input, ctx) {
|
|
4867
5353
|
return ctx.client.get("search_tasks", {
|
|
@@ -4880,16 +5366,16 @@ function registerSearchCommands() {
|
|
|
4880
5366
|
}
|
|
4881
5367
|
|
|
4882
5368
|
// src/commands/tasks/archive.ts
|
|
4883
|
-
import { z as
|
|
4884
|
-
var inputSchema88 =
|
|
4885
|
-
taskId:
|
|
5369
|
+
import { z as z91 } from "zod";
|
|
5370
|
+
var inputSchema88 = z91.object({
|
|
5371
|
+
taskId: z91.string().uuid().describe("Task ID to archive")
|
|
4886
5372
|
});
|
|
4887
5373
|
var tasksArchive = {
|
|
4888
5374
|
name: "tasks.archive",
|
|
4889
5375
|
group: "tasks",
|
|
4890
5376
|
description: "Archive (delete) a task",
|
|
4891
5377
|
inputSchema: inputSchema88,
|
|
4892
|
-
outputSchema:
|
|
5378
|
+
outputSchema: z91.any(),
|
|
4893
5379
|
annotations: { destructiveHint: true },
|
|
4894
5380
|
async execute(input, ctx) {
|
|
4895
5381
|
await ctx.client.del("task", {
|
|
@@ -4904,7 +5390,7 @@ var tasksArchive = {
|
|
|
4904
5390
|
};
|
|
4905
5391
|
|
|
4906
5392
|
// src/commands/tasks/create.ts
|
|
4907
|
-
import { z as
|
|
5393
|
+
import { z as z92 } from "zod";
|
|
4908
5394
|
|
|
4909
5395
|
// src/lib/poll.ts
|
|
4910
5396
|
init_errors();
|
|
@@ -5034,8 +5520,10 @@ var StreamRenderer = class {
|
|
|
5034
5520
|
spinnerFrame = 0;
|
|
5035
5521
|
currentLabel = "";
|
|
5036
5522
|
useColor;
|
|
5037
|
-
|
|
5523
|
+
quiet;
|
|
5524
|
+
constructor(opts) {
|
|
5038
5525
|
this.useColor = isColorEnabled();
|
|
5526
|
+
this.quiet = opts?.quiet ?? false;
|
|
5039
5527
|
}
|
|
5040
5528
|
renderEvent(event) {
|
|
5041
5529
|
switch (event.type) {
|
|
@@ -5076,6 +5564,7 @@ ${this.useColor ? pc5.yellow("Stream timed out.") : "Stream timed out."}
|
|
|
5076
5564
|
}
|
|
5077
5565
|
}
|
|
5078
5566
|
startSpinner(label) {
|
|
5567
|
+
if (this.quiet) return;
|
|
5079
5568
|
this.stopSpinner();
|
|
5080
5569
|
this.currentLabel = label;
|
|
5081
5570
|
this.spinnerFrame = 0;
|
|
@@ -5107,19 +5596,20 @@ ${this.useColor ? pc5.yellow("Stream timed out.") : "Stream timed out."}
|
|
|
5107
5596
|
};
|
|
5108
5597
|
|
|
5109
5598
|
// src/commands/tasks/create.ts
|
|
5110
|
-
var inputSchema89 =
|
|
5111
|
-
project:
|
|
5112
|
-
title:
|
|
5113
|
-
message:
|
|
5114
|
-
wait:
|
|
5115
|
-
stream:
|
|
5599
|
+
var inputSchema89 = z92.object({
|
|
5600
|
+
project: z92.string().uuid().describe("Project ID"),
|
|
5601
|
+
title: z92.string().optional().describe("Task title"),
|
|
5602
|
+
message: z92.string().optional().describe("Initial message"),
|
|
5603
|
+
wait: z92.boolean().default(false).describe("Wait for agent response (polling)"),
|
|
5604
|
+
stream: z92.boolean().default(false).describe("Stream agent response in real-time (SSE)")
|
|
5116
5605
|
});
|
|
5117
5606
|
var tasksCreate = {
|
|
5118
5607
|
name: "tasks.create",
|
|
5119
5608
|
group: "tasks",
|
|
5120
5609
|
description: "Create a new task in a project",
|
|
5610
|
+
stdinField: "message",
|
|
5121
5611
|
inputSchema: inputSchema89,
|
|
5122
|
-
outputSchema:
|
|
5612
|
+
outputSchema: z92.any(),
|
|
5123
5613
|
async execute(input, ctx) {
|
|
5124
5614
|
const result = await ctx.client.post("tasks", {
|
|
5125
5615
|
projectId: input.project,
|
|
@@ -5147,7 +5637,7 @@ var tasksCreate = {
|
|
|
5147
5637
|
if (input.stream) {
|
|
5148
5638
|
try {
|
|
5149
5639
|
const apiKey = resolveApiKey(ctx.profileName);
|
|
5150
|
-
const renderer = new StreamRenderer();
|
|
5640
|
+
const renderer = new StreamRenderer({ quiet: ctx.output.quiet });
|
|
5151
5641
|
for await (const event of streamTask(taskId, apiKey)) {
|
|
5152
5642
|
renderer.renderEvent(event);
|
|
5153
5643
|
}
|
|
@@ -5169,16 +5659,16 @@ var tasksCreate = {
|
|
|
5169
5659
|
};
|
|
5170
5660
|
|
|
5171
5661
|
// src/commands/tasks/get.ts
|
|
5172
|
-
import { z as
|
|
5173
|
-
var inputSchema90 =
|
|
5174
|
-
taskId:
|
|
5662
|
+
import { z as z93 } from "zod";
|
|
5663
|
+
var inputSchema90 = z93.object({
|
|
5664
|
+
taskId: z93.string().uuid().describe("Task ID")
|
|
5175
5665
|
});
|
|
5176
5666
|
var tasksGet = {
|
|
5177
5667
|
name: "tasks.get",
|
|
5178
5668
|
group: "tasks",
|
|
5179
5669
|
description: "Get details of a specific task",
|
|
5180
5670
|
inputSchema: inputSchema90,
|
|
5181
|
-
outputSchema:
|
|
5671
|
+
outputSchema: z93.any(),
|
|
5182
5672
|
annotations: { readOnlyHint: true },
|
|
5183
5673
|
async execute(input, ctx) {
|
|
5184
5674
|
return ctx.client.get("task", {
|
|
@@ -5192,9 +5682,9 @@ var tasksGet = {
|
|
|
5192
5682
|
};
|
|
5193
5683
|
|
|
5194
5684
|
// src/commands/tasks/list.ts
|
|
5195
|
-
import { z as
|
|
5196
|
-
var inputSchema91 =
|
|
5197
|
-
project:
|
|
5685
|
+
import { z as z94 } from "zod";
|
|
5686
|
+
var inputSchema91 = z94.object({
|
|
5687
|
+
project: z94.string().uuid().optional().describe("Project ID to filter by"),
|
|
5198
5688
|
...paginationInput
|
|
5199
5689
|
});
|
|
5200
5690
|
var tasksList = {
|
|
@@ -5202,7 +5692,7 @@ var tasksList = {
|
|
|
5202
5692
|
group: "tasks",
|
|
5203
5693
|
description: "List tasks, optionally filtered by project",
|
|
5204
5694
|
inputSchema: inputSchema91,
|
|
5205
|
-
outputSchema:
|
|
5695
|
+
outputSchema: z94.any(),
|
|
5206
5696
|
annotations: { readOnlyHint: true },
|
|
5207
5697
|
async execute(input, ctx) {
|
|
5208
5698
|
if (input.project) {
|
|
@@ -5222,18 +5712,18 @@ var tasksList = {
|
|
|
5222
5712
|
};
|
|
5223
5713
|
|
|
5224
5714
|
// src/commands/tasks/messages.ts
|
|
5225
|
-
import { z as
|
|
5226
|
-
var inputSchema92 =
|
|
5227
|
-
taskId:
|
|
5228
|
-
cursor:
|
|
5229
|
-
limit:
|
|
5715
|
+
import { z as z95 } from "zod";
|
|
5716
|
+
var inputSchema92 = z95.object({
|
|
5717
|
+
taskId: z95.string().uuid().describe("Task ID"),
|
|
5718
|
+
cursor: z95.string().optional().describe("Pagination cursor"),
|
|
5719
|
+
limit: z95.number().int().min(1).max(100).default(50).describe("Results per page")
|
|
5230
5720
|
});
|
|
5231
5721
|
var tasksMessages = {
|
|
5232
5722
|
name: "tasks.messages",
|
|
5233
5723
|
group: "tasks",
|
|
5234
5724
|
description: "List messages for a task",
|
|
5235
5725
|
inputSchema: inputSchema92,
|
|
5236
|
-
outputSchema:
|
|
5726
|
+
outputSchema: z95.any(),
|
|
5237
5727
|
annotations: { readOnlyHint: true },
|
|
5238
5728
|
async execute(input, ctx) {
|
|
5239
5729
|
const queryParams = { limit: input.limit };
|
|
@@ -5252,22 +5742,23 @@ var tasksMessages = {
|
|
|
5252
5742
|
};
|
|
5253
5743
|
|
|
5254
5744
|
// src/commands/tasks/send.ts
|
|
5255
|
-
import { z as
|
|
5745
|
+
import { z as z96 } from "zod";
|
|
5256
5746
|
init_profiles();
|
|
5257
5747
|
var UUID_RE2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
5258
|
-
var inputSchema93 =
|
|
5259
|
-
taskId:
|
|
5260
|
-
message:
|
|
5261
|
-
fileRefs:
|
|
5262
|
-
wait:
|
|
5263
|
-
stream:
|
|
5748
|
+
var inputSchema93 = z96.object({
|
|
5749
|
+
taskId: z96.string().uuid().describe("Task ID"),
|
|
5750
|
+
message: z96.string().min(1).describe("Message content"),
|
|
5751
|
+
fileRefs: z96.string().optional().describe("Comma-separated file reference UUIDs"),
|
|
5752
|
+
wait: z96.boolean().default(false).describe("Wait for agent response (polling)"),
|
|
5753
|
+
stream: z96.boolean().default(false).describe("Stream agent response in real-time (SSE)")
|
|
5264
5754
|
});
|
|
5265
5755
|
var tasksSend = {
|
|
5266
5756
|
name: "tasks.send",
|
|
5267
5757
|
group: "tasks",
|
|
5268
5758
|
description: "Send a message to a task",
|
|
5759
|
+
stdinField: "message",
|
|
5269
5760
|
inputSchema: inputSchema93,
|
|
5270
|
-
outputSchema:
|
|
5761
|
+
outputSchema: z96.any(),
|
|
5271
5762
|
async execute(input, ctx) {
|
|
5272
5763
|
let referencedFileIds;
|
|
5273
5764
|
if (input.fileRefs) {
|
|
@@ -5301,7 +5792,7 @@ var tasksSend = {
|
|
|
5301
5792
|
if (input.stream) {
|
|
5302
5793
|
try {
|
|
5303
5794
|
const apiKey = resolveApiKey(ctx.profileName);
|
|
5304
|
-
const renderer = new StreamRenderer();
|
|
5795
|
+
const renderer = new StreamRenderer({ quiet: ctx.output.quiet });
|
|
5305
5796
|
for await (const event of streamTask(input.taskId, apiKey)) {
|
|
5306
5797
|
renderer.renderEvent(event);
|
|
5307
5798
|
}
|
|
@@ -5324,18 +5815,18 @@ var tasksSend = {
|
|
|
5324
5815
|
|
|
5325
5816
|
// src/commands/tasks/update.ts
|
|
5326
5817
|
init_errors();
|
|
5327
|
-
import { z as
|
|
5328
|
-
var inputSchema94 =
|
|
5329
|
-
taskId:
|
|
5330
|
-
title:
|
|
5331
|
-
status:
|
|
5818
|
+
import { z as z97 } from "zod";
|
|
5819
|
+
var inputSchema94 = z97.object({
|
|
5820
|
+
taskId: z97.string().uuid().describe("Task ID"),
|
|
5821
|
+
title: z97.string().min(1).optional().describe("New task title"),
|
|
5822
|
+
status: z97.string().optional().describe("New task status")
|
|
5332
5823
|
});
|
|
5333
5824
|
var tasksUpdate = {
|
|
5334
5825
|
name: "tasks.update",
|
|
5335
5826
|
group: "tasks",
|
|
5336
5827
|
description: "Update an existing task",
|
|
5337
5828
|
inputSchema: inputSchema94,
|
|
5338
|
-
outputSchema:
|
|
5829
|
+
outputSchema: z97.any(),
|
|
5339
5830
|
annotations: { idempotentHint: true },
|
|
5340
5831
|
async execute(input, ctx) {
|
|
5341
5832
|
const { taskId, ...fields } = input;
|
|
@@ -5415,6 +5906,31 @@ function buildRegistry() {
|
|
|
5415
5906
|
return registry2;
|
|
5416
5907
|
}
|
|
5417
5908
|
|
|
5909
|
+
// src/lib/banner.ts
|
|
5910
|
+
init_config();
|
|
5911
|
+
import pc6 from "picocolors";
|
|
5912
|
+
function renderBanner() {
|
|
5913
|
+
const label = "ELNORA \xB7 AI Platform CLI";
|
|
5914
|
+
const inner = ` ${label} `;
|
|
5915
|
+
const bar = "\u2500".repeat(inner.length);
|
|
5916
|
+
const box = [`\u250C${bar}\u2510`, `\u2502${inner}\u2502`, `\u2514${bar}\u2518`].join("\n");
|
|
5917
|
+
const head = isColorEnabled() ? pc6.cyan(box) : box;
|
|
5918
|
+
return `${head}
|
|
5919
|
+
v${VERSION}`;
|
|
5920
|
+
}
|
|
5921
|
+
function maybePrintBanner(argv) {
|
|
5922
|
+
if (process.env.CI || process.env.GITHUB_ACTIONS) return;
|
|
5923
|
+
if (!process.stderr.isTTY) return;
|
|
5924
|
+
const args = argv.slice(2);
|
|
5925
|
+
if (args.includes("--quiet")) return;
|
|
5926
|
+
const isBare = args.length === 0;
|
|
5927
|
+
const isTopHelp = args.length === 1 && (args[0] === "--help" || args[0] === "-h");
|
|
5928
|
+
if (!isBare && !isTopHelp) return;
|
|
5929
|
+
process.stderr.write(`${renderBanner()}
|
|
5930
|
+
|
|
5931
|
+
`);
|
|
5932
|
+
}
|
|
5933
|
+
|
|
5418
5934
|
// src/cli.ts
|
|
5419
5935
|
init_errors();
|
|
5420
5936
|
process.on("uncaughtException", (err) => {
|
|
@@ -5439,13 +5955,19 @@ process.on("unhandledRejection", (reason) => {
|
|
|
5439
5955
|
process.exitCode = 1;
|
|
5440
5956
|
});
|
|
5441
5957
|
var registry = buildRegistry();
|
|
5958
|
+
if (process.argv.includes("--no-color") && !process.env.NO_COLOR) {
|
|
5959
|
+
process.env.NO_COLOR = "1";
|
|
5960
|
+
}
|
|
5961
|
+
var quiet = process.argv.includes("--quiet");
|
|
5962
|
+
maybePrintBanner(process.argv);
|
|
5442
5963
|
var program = buildProgram(registry);
|
|
5443
5964
|
addMcpCommands(program, registry);
|
|
5444
5965
|
addDoctorCommand(program);
|
|
5445
5966
|
addWhoamiCommand(program);
|
|
5967
|
+
addConfigCommand(program);
|
|
5446
5968
|
addOpenCommand(program);
|
|
5447
5969
|
addSetupCommand(program);
|
|
5448
5970
|
addUpdateCommand(program);
|
|
5449
5971
|
addCompletionCommand(program);
|
|
5450
|
-
registerUpdateCheck();
|
|
5972
|
+
registerUpdateCheck(quiet);
|
|
5451
5973
|
program.parseAsync(process.argv);
|