@eve-horizon/cli 0.2.55 → 0.2.56

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.
Files changed (2) hide show
  1. package/dist/index.js +173 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -51807,9 +51807,13 @@ async function handleOrg(subcommand, positionals, flags, context2) {
51807
51807
  }
51808
51808
  case "delete": {
51809
51809
  const orgId = positionals[0];
51810
- if (!orgId) throw new Error("Usage: eve org delete <org_id> [--force]");
51811
- const response = await requestJson(context2, `/orgs/${orgId}`, { method: "PATCH", body: { deleted: true } });
51812
- outputJson(response, json, `\u2713 Organization deleted: ${orgId}`);
51810
+ if (!orgId) throw new Error("Usage: eve org delete <org_id> [--hard] [--force]");
51811
+ const hard = toBoolean(flags.hard) ?? false;
51812
+ const force = toBoolean(flags.force) ?? false;
51813
+ const query = buildQuery({ hard: hard ? "true" : void 0, force: force ? "true" : void 0 });
51814
+ await requestRaw(context2, `/orgs/${orgId}${query}`, { method: "DELETE" });
51815
+ const mode = hard ? "hard-deleted" : "soft-deleted";
51816
+ outputJson({ org_id: orgId, deleted: true, mode }, json, `\u2713 Organization ${orgId} ${mode}`);
51813
51817
  return;
51814
51818
  }
51815
51819
  case "members": {
@@ -52231,10 +52235,23 @@ async function handleProject(subcommand, positionals, flags, context2) {
52231
52235
  }
52232
52236
  return;
52233
52237
  }
52238
+ case "delete": {
52239
+ const projectId = positionals[0] ?? (typeof flags.project === "string" ? flags.project : context2.projectId);
52240
+ if (!projectId) {
52241
+ throw new Error("Usage: eve project delete <project_id> [--hard] [--force]");
52242
+ }
52243
+ const hard = toBoolean(flags.hard) ?? false;
52244
+ const force = toBoolean(flags.force) ?? false;
52245
+ const query = buildQuery2({ hard: hard ? "true" : void 0, force: force ? "true" : void 0 });
52246
+ await requestRaw(context2, `/projects/${projectId}${query}`, { method: "DELETE" });
52247
+ const mode = hard ? "hard-deleted" : "soft-deleted";
52248
+ outputJson({ project_id: projectId, deleted: true, mode }, json, `\u2713 Project ${projectId} ${mode}`);
52249
+ return;
52250
+ }
52234
52251
  case "status":
52235
52252
  return handleStatus(flags, context2, json);
52236
52253
  default:
52237
- throw new Error("Usage: eve project <ensure|list|get|spend|update|sync|members|bootstrap|status>");
52254
+ throw new Error("Usage: eve project <ensure|list|get|spend|update|delete|sync|members|bootstrap|status>");
52238
52255
  }
52239
52256
  }
52240
52257
  async function handleStatus(flags, currentContext, json) {
@@ -57306,6 +57323,7 @@ var OrgMemberListResponseSchema = external_exports.object({
57306
57323
  var EnvironmentTypeSchema = external_exports.enum(["persistent", "temporary"]);
57307
57324
  var EnvironmentKindSchema = external_exports.enum(["standard", "preview"]);
57308
57325
  var EnvironmentStatusSchema = external_exports.enum(["active", "suspended", "terminated"]);
57326
+ var DeployStatusSchema = external_exports.enum(["unknown", "deployed", "undeployed", "deploying", "undeploying", "failed"]);
57309
57327
  var EnvironmentLabelsSchema = external_exports.record(external_exports.string(), external_exports.string());
57310
57328
  var CreateEnvironmentRequestSchema = external_exports.object({
57311
57329
  name: external_exports.string().min(1),
@@ -57340,6 +57358,7 @@ var EnvironmentResponseSchema = external_exports.object({
57340
57358
  alias: external_exports.string(),
57341
57359
  service_name: external_exports.string()
57342
57360
  })).optional(),
57361
+ deploy_status: DeployStatusSchema,
57343
57362
  status: EnvironmentStatusSchema,
57344
57363
  suspended_at: external_exports.string().nullable(),
57345
57364
  suspension_reason: external_exports.string().nullable(),
@@ -57353,6 +57372,9 @@ var EnvironmentListResponseSchema = external_exports.object({
57353
57372
  var DeleteEnvironmentRequestSchema = external_exports.object({
57354
57373
  force: external_exports.boolean().optional()
57355
57374
  }).optional().default({});
57375
+ var UndeployEnvironmentRequestSchema = external_exports.object({
57376
+ force: external_exports.boolean().optional()
57377
+ }).optional().default({});
57356
57378
  var EnvLogEntrySchema = external_exports.object({
57357
57379
  timestamp: external_exports.string(),
57358
57380
  line: external_exports.string(),
@@ -62511,6 +62533,7 @@ var ALL_PERMISSIONS = [
62511
62533
  // Threads
62512
62534
  "threads:read",
62513
62535
  "threads:write",
62536
+ "threads:admin",
62514
62537
  // Projects
62515
62538
  "projects:read",
62516
62539
  "projects:create",
@@ -62538,9 +62561,19 @@ var ALL_PERMISSIONS = [
62538
62561
  // Builds
62539
62562
  "builds:read",
62540
62563
  "builds:write",
62564
+ "builds:admin",
62565
+ // Releases
62566
+ "releases:read",
62567
+ "releases:write",
62568
+ "releases:admin",
62541
62569
  // Pipelines
62542
62570
  "pipelines:read",
62543
62571
  "pipelines:write",
62572
+ "pipelines:admin",
62573
+ // Agents
62574
+ "agents:read",
62575
+ "agents:write",
62576
+ "agents:admin",
62544
62577
  // Workflows
62545
62578
  "workflows:read",
62546
62579
  "workflows:write",
@@ -68077,6 +68110,8 @@ async function handleEnv(subcommand, positionals, flags, context2) {
68077
68110
  return handleServices(positionals, flags, context2, json);
68078
68111
  case "delete":
68079
68112
  return handleDelete(positionals, flags, context2, json);
68113
+ case "undeploy":
68114
+ return handleUndeploy(positionals, flags, context2, json);
68080
68115
  case "rollback":
68081
68116
  return handleRollback(positionals, flags, context2, json);
68082
68117
  case "reset":
@@ -68089,7 +68124,7 @@ async function handleEnv(subcommand, positionals, flags, context2) {
68089
68124
  return handleResume(positionals, flags, context2, json);
68090
68125
  default:
68091
68126
  throw new Error(
68092
- 'Usage: eve env <list|show|create|deploy|logs|diagnose|services|delete|rollback|reset|recover|suspend|resume>\n list [project] - list environments for a project\n show <project> <name> - show details of an environment\n create <name> --type=<type> [options] - create an environment\n deploy <env> (--ref <sha>|--release-tag <tag>) [--direct] [--inputs <json>] [--repo-dir <path>] [--skip-preflight] - deploy to an environment\n logs <project> <env> <service> [--since <seconds>] [--tail <n>] [--grep <text>] - get service logs\n diagnose <project> <env> - diagnose deployment health and events\n services <project> <env> - show per-service pod status summary\n delete <name> [--project=<id>] [--force] [--danger-delete-production] - delete an environment\n rollback <env> --release <id|tag|previous> [--project=<id>] [--skip-preflight] - rollback to a release\n reset <env> [--release <id|tag|previous>] [--project=<id>] [--force] [--danger-reset-production] [--skip-preflight] - teardown and redeploy\n recover <project> <env> - analyze environment and suggest recovery action\n suspend <project> <env> --reason "..." - suspend an environment\n resume <project> <env> - resume a suspended environment'
68127
+ 'Usage: eve env <list|show|create|deploy|undeploy|logs|diagnose|services|delete|rollback|reset|recover|suspend|resume>\n list [project] - list environments for a project\n show <project> <name> - show details of an environment\n create <name> --type=<type> [options] - create an environment\n deploy <env> (--ref <sha>|--release-tag <tag>) [--direct] [--inputs <json>] [--repo-dir <path>] [--skip-preflight] - deploy to an environment\n undeploy <env> [--project=<id>] [--force] - tear down K8s resources, keep environment config\n logs <project> <env> <service> [--since <seconds>] [--tail <n>] [--grep <text>] - get service logs\n diagnose <project> <env> - diagnose deployment health and events\n services <project> <env> - show per-service pod status summary\n delete <name> [--project=<id>] [--force] [--danger-delete-production] - delete an environment\n rollback <env> --release <id|tag|previous> [--project=<id>] [--skip-preflight] - rollback to a release\n reset <env> [--release <id|tag|previous>] [--project=<id>] [--force] [--danger-reset-production] [--skip-preflight] - teardown and redeploy\n recover <project> <env> - analyze environment and suggest recovery action\n suspend <project> <env> --reason "..." - suspend an environment\n resume <project> <env> - resume a suspended environment'
68093
68128
  );
68094
68129
  }
68095
68130
  }
@@ -68503,6 +68538,31 @@ async function handleDelete(positionals, flags, context2, json) {
68503
68538
  }
68504
68539
  }
68505
68540
  }
68541
+ async function handleUndeploy(positionals, flags, context2, json) {
68542
+ const projectId = getStringFlag(flags, ["project"]) ?? context2.projectId;
68543
+ const envName = positionals[0] ?? getStringFlag(flags, ["name", "env"]);
68544
+ const force = Boolean(flags.force);
68545
+ if (!projectId || !envName) {
68546
+ throw new Error("Usage: eve env undeploy <env> [--project=<id>] [--force]");
68547
+ }
68548
+ const body = {};
68549
+ if (force) {
68550
+ body.force = true;
68551
+ }
68552
+ const response = await requestJson(
68553
+ context2,
68554
+ `/projects/${projectId}/envs/${envName}/undeploy`,
68555
+ {
68556
+ method: "POST",
68557
+ body
68558
+ }
68559
+ );
68560
+ if (json) {
68561
+ outputJson(response, json);
68562
+ } else {
68563
+ console.log(`\u2713 Environment "${envName}" undeployed. Redeploy with: eve env deploy ${envName} --project ${projectId} ...`);
68564
+ }
68565
+ }
68506
68566
  async function handleRollback(positionals, flags, context2, json) {
68507
68567
  const projectId = getStringFlag(flags, ["project"]) ?? context2.projectId;
68508
68568
  const envName = positionals[0] ?? getStringFlag(flags, ["name", "env"]);
@@ -69001,9 +69061,23 @@ async function handlePipeline(subcommand, positionals, flags, context2) {
69001
69061
  return handleCancel2(positionals, flags, context2, json);
69002
69062
  case "logs":
69003
69063
  return handleLogs4(positionals, flags, context2, json);
69064
+ case "delete": {
69065
+ const name = positionals[0] ?? getStringFlag(flags, ["name"]);
69066
+ const projectId = getStringFlag(flags, ["project"]) ?? context2.projectId;
69067
+ if (!name || !projectId) {
69068
+ throw new Error("Usage: eve pipeline delete <name> [--project <id>]");
69069
+ }
69070
+ await requestRaw(
69071
+ context2,
69072
+ `/projects/${projectId}/pipelines/${encodeURIComponent(name)}`,
69073
+ { method: "DELETE" }
69074
+ );
69075
+ outputJson({ name, deleted: true }, json, `Pipeline ${name} runs deleted`);
69076
+ return;
69077
+ }
69004
69078
  default:
69005
69079
  throw new Error(
69006
- "Usage: eve pipeline <list|show|run|runs|show-run|approve|cancel|logs>\n list [project] - list pipelines for a project\n show <project> <name> - show pipeline definition\n run <name> --ref <sha> - create and run a new pipeline\n Options: --env, --inputs <json>, --only <step>\n runs [project] - list recent pipeline runs\n Options: --limit, --status, --name <pipeline>\n show-run <pipeline> <run-id> - show pipeline run status and steps\n approve <run-id> - approve a blocked pipeline run\n cancel <run-id> [--reason <text>] - cancel pipeline run\n logs <pipeline> <run-id> [--step <name>] - show logs for pipeline run\n Options: --follow (-f) stream live"
69080
+ "Usage: eve pipeline <list|show|run|runs|show-run|approve|cancel|logs|delete>\n list [project] - list pipelines for a project\n show <project> <name> - show pipeline definition\n run <name> --ref <sha> - create and run a new pipeline\n Options: --env, --inputs <json>, --only <step>\n runs [project] - list recent pipeline runs\n Options: --limit, --status, --name <pipeline>\n show-run <pipeline> <run-id> - show pipeline run status and steps\n approve <run-id> - approve a blocked pipeline run\n cancel <run-id> [--reason <text>] - cancel pipeline run\n logs <pipeline> <run-id> [--step <name>] - show logs for pipeline run\n Options: --follow (-f) stream live\n delete <name> [--project <id>] - delete all pipeline runs"
69007
69081
  );
69008
69082
  }
69009
69083
  }
@@ -75267,8 +75341,38 @@ async function handleAgents(subcommand, positionals, flags, context2) {
75267
75341
  formatAgentRuntimeStatus(response, orgId);
75268
75342
  return;
75269
75343
  }
75344
+ case "delete": {
75345
+ const slug = positionals[0];
75346
+ if (!slug) {
75347
+ throw new Error("Usage: eve agents delete <slug> [--project <id>]");
75348
+ }
75349
+ const projectId = getStringFlag(flags, ["project"]) ?? context2.projectId;
75350
+ if (!projectId) {
75351
+ throw new Error("Missing project id. Provide --project or set a profile default.");
75352
+ }
75353
+ await requestRaw(context2, `/projects/${projectId}/agents/${encodeURIComponent(slug)}`, {
75354
+ method: "DELETE"
75355
+ });
75356
+ outputJson({ slug, deleted: true }, json, `Agent ${slug} deleted`);
75357
+ return;
75358
+ }
75359
+ case "delete-team": {
75360
+ const teamId = positionals[0];
75361
+ if (!teamId) {
75362
+ throw new Error("Usage: eve agents delete-team <team_id> [--project <id>]");
75363
+ }
75364
+ const projectId = getStringFlag(flags, ["project"]) ?? context2.projectId;
75365
+ if (!projectId) {
75366
+ throw new Error("Missing project id. Provide --project or set a profile default.");
75367
+ }
75368
+ await requestRaw(context2, `/projects/${projectId}/teams/${encodeURIComponent(teamId)}`, {
75369
+ method: "DELETE"
75370
+ });
75371
+ outputJson({ id: teamId, deleted: true }, json, `Team ${teamId} deleted`);
75372
+ return;
75373
+ }
75270
75374
  default:
75271
- throw new Error("Usage: eve agents <config|sync|runtime-status>");
75375
+ throw new Error("Usage: eve agents <config|sync|runtime-status|delete|delete-team>");
75272
75376
  }
75273
75377
  }
75274
75378
  function formatAgentRuntimeStatus(response, orgId) {
@@ -75602,8 +75706,39 @@ Make sure the release exists and the tag is correct.`
75602
75706
  }
75603
75707
  return;
75604
75708
  }
75709
+ case "delete": {
75710
+ const tag = positionals[0];
75711
+ if (!tag) {
75712
+ throw new Error("Usage: eve release delete <tag> [--project <id>]");
75713
+ }
75714
+ const projectId = typeof flags.project === "string" ? flags.project : context2.projectId;
75715
+ if (!projectId) {
75716
+ throw new Error("Missing project id. Provide --project or set a profile default.");
75717
+ }
75718
+ await requestRaw(
75719
+ context2,
75720
+ `/projects/${projectId}/releases/by-tag/${encodeURIComponent(tag)}`,
75721
+ { method: "DELETE" }
75722
+ );
75723
+ outputJson({ tag, deleted: true }, json, `Release ${tag} deleted`);
75724
+ return;
75725
+ }
75726
+ case "prune": {
75727
+ const projectId = typeof flags.project === "string" ? flags.project : context2.projectId;
75728
+ if (!projectId) {
75729
+ throw new Error("Usage: eve release prune [--project <id>] [--keep <n>]");
75730
+ }
75731
+ const keep = getStringFlag(flags, ["keep"]) ?? "10";
75732
+ const result = await requestJson(
75733
+ context2,
75734
+ `/projects/${projectId}/releases/prune`,
75735
+ { method: "POST", body: { keep: parseInt(keep, 10) } }
75736
+ );
75737
+ outputJson(result, json, `Pruned ${result.deleted} release(s)`);
75738
+ return;
75739
+ }
75605
75740
  default:
75606
- throw new Error("Usage: eve release <resolve>");
75741
+ throw new Error("Usage: eve release <resolve|delete|prune>");
75607
75742
  }
75608
75743
  }
75609
75744
 
@@ -75891,9 +76026,28 @@ async function handleBuild(subcommand, positionals, flags, context2) {
75891
76026
  return handleDiagnose3(positionals, flags, context2, json);
75892
76027
  case "cancel":
75893
76028
  return handleCancel3(positionals, flags, context2, json);
76029
+ case "delete": {
76030
+ const buildId = positionals[0];
76031
+ if (!buildId) throw new Error("Usage: eve build delete <build_id>");
76032
+ await requestRaw(context2, `/builds/${buildId}`, { method: "DELETE" });
76033
+ outputJson({ id: buildId, deleted: true }, json, `Build ${buildId} deleted`);
76034
+ return;
76035
+ }
76036
+ case "prune": {
76037
+ const projectId = getStringFlag(flags, ["project"]) ?? context2.projectId;
76038
+ if (!projectId) throw new Error("Usage: eve build prune [--project <id>] [--keep <n>]");
76039
+ const keep = getStringFlag(flags, ["keep"]) ?? "10";
76040
+ const result = await requestJson(
76041
+ context2,
76042
+ `/projects/${projectId}/builds/prune`,
76043
+ { method: "POST", body: { keep: parseInt(keep, 10) } }
76044
+ );
76045
+ outputJson(result, json, `Pruned ${result.deleted} build(s)`);
76046
+ return;
76047
+ }
75894
76048
  default:
75895
76049
  throw new Error(
75896
- "Usage: eve build <create|list|show|run|runs|logs|artifacts|diagnose|cancel>\n create --project <id> --ref <sha> [--services <list>] - create a build spec\n list [--project <id>] - list build specs\n show <build_id> - show build spec details\n run <build_id> - start a build run\n runs <build_id> - list runs for a build\n logs <build_id> [--run <id>] - show build logs\n artifacts <build_id> - list build artifacts\n diagnose <build_id> - show full build state\n cancel <build_id> - cancel active build run"
76050
+ "Usage: eve build <create|list|show|run|runs|logs|artifacts|diagnose|cancel|delete|prune>\n create --project <id> --ref <sha> [--services <list>] - create a build spec\n list [--project <id>] - list build specs\n show <build_id> - show build spec details\n run <build_id> - start a build run\n runs <build_id> - list runs for a build\n logs <build_id> [--run <id>] - show build logs\n artifacts <build_id> - list build artifacts\n diagnose <build_id> - show full build state\n cancel <build_id> - cancel active build run\n delete <build_id> - delete a build spec\n prune [--project <id>] [--keep <n>] - prune old builds (keep last N)"
75897
76051
  );
75898
76052
  }
75899
76053
  }
@@ -76761,9 +76915,18 @@ async function handleThread(subcommand, positionals, flags, context2) {
76761
76915
  outputJson(result, json, `Thread distilled: ${threadId}`);
76762
76916
  return;
76763
76917
  }
76918
+ case "delete": {
76919
+ const threadId = positionals[0];
76920
+ if (!threadId) {
76921
+ throw new Error("Usage: eve thread delete <thread_id>");
76922
+ }
76923
+ await requestRaw(context2, `/threads/${threadId}`, { method: "DELETE" });
76924
+ outputJson({ id: threadId, deleted: true }, json, `Thread ${threadId} deleted`);
76925
+ return;
76926
+ }
76764
76927
  default:
76765
76928
  throw new Error(
76766
- "Usage: eve thread <create|list|show|messages|post|follow|distill> [options]\n\n create --org <org> --key <key>\n list --org <org> [--scope org] [--key-prefix <prefix>]\n show <thread_id> --org <org>\n messages <thread_id> [--org <org>] [--since <duration>] [--limit <n>]\n post <thread_id> [--org <org>] --body <text> [--actor-type <type>] [--actor-id <id>]\n follow <thread_id> [--org <org>]\n distill <thread_id> --org <org> [--to <path>] [--agent <slug>] [--category <name>] [--key <key>]"
76929
+ "Usage: eve thread <create|list|show|messages|post|follow|distill|delete> [options]\n\n create --org <org> --key <key>\n list --org <org> [--scope org] [--key-prefix <prefix>]\n show <thread_id> --org <org>\n messages <thread_id> [--org <org>] [--since <duration>] [--limit <n>]\n post <thread_id> [--org <org>] --body <text> [--actor-type <type>] [--actor-id <id>]\n follow <thread_id> [--org <org>]\n distill <thread_id> --org <org> [--to <path>] [--agent <slug>] [--category <name>] [--key <key>]\n delete <thread_id>"
76767
76930
  );
76768
76931
  }
76769
76932
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eve-horizon/cli",
3
- "version": "0.2.55",
3
+ "version": "0.2.56",
4
4
  "description": "Eve Horizon CLI",
5
5
  "license": "MIT",
6
6
  "repository": {