@elevasis/sdk 1.53.0 → 1.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -34,12 +34,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  ));
35
35
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
36
 
37
- // ../../node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/package.json
37
+ // ../../node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json
38
38
  var require_package = __commonJS({
39
- "../../node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/package.json"(exports2, module2) {
39
+ "../../node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json"(exports2, module2) {
40
40
  module2.exports = {
41
41
  name: "dotenv",
42
- version: "16.6.1",
42
+ version: "17.2.3",
43
43
  description: "Loads environment variables from .env file",
44
44
  main: "lib/main.js",
45
45
  types: "lib/main.d.ts",
@@ -61,8 +61,8 @@ var require_package = __commonJS({
61
61
  "dts-check": "tsc --project tests/types/tsconfig.json",
62
62
  lint: "standard",
63
63
  pretest: "npm run lint && npm run dts-check",
64
- test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
65
- "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
64
+ test: "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000",
65
+ "test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
66
66
  prerelease: "npm test",
67
67
  release: "standard-version"
68
68
  },
@@ -102,15 +102,48 @@ var require_package = __commonJS({
102
102
  }
103
103
  });
104
104
 
105
- // ../../node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js
105
+ // ../../node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js
106
106
  var require_main = __commonJS({
107
- "../../node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js"(exports2, module2) {
107
+ "../../node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js"(exports2, module2) {
108
108
  var fs2 = require("fs");
109
109
  var path3 = require("path");
110
110
  var os3 = require("os");
111
111
  var crypto = require("crypto");
112
112
  var packageJson = require_package();
113
113
  var version2 = packageJson.version;
114
+ var TIPS = [
115
+ "\u{1F510} encrypt with Dotenvx: https://dotenvx.com",
116
+ "\u{1F510} prevent committing .env to code: https://dotenvx.com/precommit",
117
+ "\u{1F510} prevent building .env in docker: https://dotenvx.com/prebuild",
118
+ "\u{1F4E1} add observability to secrets: https://dotenvx.com/ops",
119
+ "\u{1F465} sync secrets across teammates & machines: https://dotenvx.com/ops",
120
+ "\u{1F5C2}\uFE0F backup and recover secrets: https://dotenvx.com/ops",
121
+ "\u2705 audit secrets and track compliance: https://dotenvx.com/ops",
122
+ "\u{1F504} add secrets lifecycle management: https://dotenvx.com/ops",
123
+ "\u{1F511} add access controls to secrets: https://dotenvx.com/ops",
124
+ "\u{1F6E0}\uFE0F run anywhere with `dotenvx run -- yourcommand`",
125
+ "\u2699\uFE0F specify custom .env file path with { path: '/custom/path/.env' }",
126
+ "\u2699\uFE0F enable debug logging with { debug: true }",
127
+ "\u2699\uFE0F override existing env vars with { override: true }",
128
+ "\u2699\uFE0F suppress all logs with { quiet: true }",
129
+ "\u2699\uFE0F write to custom object with { processEnv: myObject }",
130
+ "\u2699\uFE0F load multiple .env files with { path: ['.env.local', '.env'] }"
131
+ ];
132
+ function _getRandomTip() {
133
+ return TIPS[Math.floor(Math.random() * TIPS.length)];
134
+ }
135
+ function parseBoolean(value) {
136
+ if (typeof value === "string") {
137
+ return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
138
+ }
139
+ return Boolean(value);
140
+ }
141
+ function supportsAnsi() {
142
+ return process.stdout.isTTY;
143
+ }
144
+ function dim(text) {
145
+ return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
146
+ }
114
147
  var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
115
148
  function parse3(src) {
116
149
  const obj = {};
@@ -159,7 +192,7 @@ var require_main = __commonJS({
159
192
  return DotenvModule.parse(decrypted);
160
193
  }
161
194
  function _warn(message) {
162
- console.log(`[dotenv@${version2}][WARN] ${message}`);
195
+ console.error(`[dotenv@${version2}][WARN] ${message}`);
163
196
  }
164
197
  function _debug(message) {
165
198
  console.log(`[dotenv@${version2}][DEBUG] ${message}`);
@@ -233,8 +266,8 @@ var require_main = __commonJS({
233
266
  return envPath2[0] === "~" ? path3.join(os3.homedir(), envPath2.slice(1)) : envPath2;
234
267
  }
235
268
  function _configVault(options) {
236
- const debug = Boolean(options && options.debug);
237
- const quiet = options && "quiet" in options ? options.quiet : true;
269
+ const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
270
+ const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
238
271
  if (debug || !quiet) {
239
272
  _log("Loading env from encrypted .env.vault");
240
273
  }
@@ -249,8 +282,12 @@ var require_main = __commonJS({
249
282
  function configDotenv(options) {
250
283
  const dotenvPath = path3.resolve(process.cwd(), ".env");
251
284
  let encoding = "utf8";
252
- const debug = Boolean(options && options.debug);
253
- const quiet = options && "quiet" in options ? options.quiet : true;
285
+ let processEnv = process.env;
286
+ if (options && options.processEnv != null) {
287
+ processEnv = options.processEnv;
288
+ }
289
+ let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
290
+ let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
254
291
  if (options && options.encoding) {
255
292
  encoding = options.encoding;
256
293
  } else {
@@ -282,13 +319,11 @@ var require_main = __commonJS({
282
319
  lastError = e;
283
320
  }
284
321
  }
285
- let processEnv = process.env;
286
- if (options && options.processEnv != null) {
287
- processEnv = options.processEnv;
288
- }
289
- DotenvModule.populate(processEnv, parsedAll, options);
322
+ const populated = DotenvModule.populate(processEnv, parsedAll, options);
323
+ debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
324
+ quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
290
325
  if (debug || !quiet) {
291
- const keysCount = Object.keys(parsedAll).length;
326
+ const keysCount = Object.keys(populated).length;
292
327
  const shortPaths = [];
293
328
  for (const filePath of optionPaths) {
294
329
  try {
@@ -301,7 +336,7 @@ var require_main = __commonJS({
301
336
  lastError = e;
302
337
  }
303
338
  }
304
- _log(`injecting env (${keysCount}) from ${shortPaths.join(",")}`);
339
+ _log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`);
305
340
  }
306
341
  if (lastError) {
307
342
  return { parsed: parsedAll, error: lastError };
@@ -350,6 +385,7 @@ var require_main = __commonJS({
350
385
  function populate(processEnv, parsed, options = {}) {
351
386
  const debug = Boolean(options && options.debug);
352
387
  const override = Boolean(options && options.override);
388
+ const populated = {};
353
389
  if (typeof parsed !== "object") {
354
390
  const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
355
391
  err.code = "OBJECT_REQUIRED";
@@ -359,6 +395,7 @@ var require_main = __commonJS({
359
395
  if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
360
396
  if (override === true) {
361
397
  processEnv[key] = parsed[key];
398
+ populated[key] = parsed[key];
362
399
  }
363
400
  if (debug) {
364
401
  if (override === true) {
@@ -369,8 +406,10 @@ var require_main = __commonJS({
369
406
  }
370
407
  } else {
371
408
  processEnv[key] = parsed[key];
409
+ populated[key] = parsed[key];
372
410
  }
373
411
  }
412
+ return populated;
374
413
  }
375
414
  var DotenvModule = {
376
415
  configDotenv,
@@ -22369,16 +22408,9 @@ var init_define_contract = __esm({
22369
22408
  }
22370
22409
  });
22371
22410
 
22372
- // src/define-step.ts
22373
- var init_define_step = __esm({
22374
- "src/define-step.ts"() {
22375
- "use strict";
22376
- }
22377
- });
22378
-
22379
- // src/define-workflow.ts
22380
- var init_define_workflow = __esm({
22381
- "src/define-workflow.ts"() {
22411
+ // src/define-single-step-workflow.ts
22412
+ var init_define_single_step_workflow = __esm({
22413
+ "src/define-single-step-workflow.ts"() {
22382
22414
  "use strict";
22383
22415
  }
22384
22416
  });
@@ -26861,7 +26893,7 @@ function createPayloadSizeValidator(maxSizeBytes, options) {
26861
26893
  }
26862
26894
  });
26863
26895
  }
26864
- var UuidSchema, NonEmptyStringSchema, ResourceTypeSchema, OriginResourceTypeSchema, CredentialNameSchema, OAuthProviderSchema, OAuthCodeSchema, OAuthStateParamSchema, SanitizedStringSchema, EmailSchema, UrlSchema, PaginationSchema, TimestampSchema, DateRangeSchema;
26896
+ var UuidSchema, NonEmptyStringSchema, ResourceTypeSchema, OriginResourceTypeSchema, CredentialNameSchema, OAuthProviderSchema, OAuthCodeSchema, OAuthStateParamSchema, SanitizedStringSchema, EmailSchema, UrlSchema, PaginationSchema, DEFAULT_PAGE_LIMIT, MAX_PAGE_LIMIT, PageLimitSchema, PageOffsetSchema, PaginationQuerySchema, TimestampSchema, DateRangeSchema;
26865
26897
  var init_validation = __esm({
26866
26898
  "../core/src/platform/utils/validation.ts"() {
26867
26899
  "use strict";
@@ -26884,6 +26916,14 @@ var init_validation = __esm({
26884
26916
  limit: external_exports.coerce.number().int().min(1).max(100).default(20),
26885
26917
  offset: external_exports.coerce.number().int().min(0).default(0)
26886
26918
  });
26919
+ DEFAULT_PAGE_LIMIT = 50;
26920
+ MAX_PAGE_LIMIT = 100;
26921
+ PageLimitSchema = external_exports.coerce.number().int().min(1).max(MAX_PAGE_LIMIT);
26922
+ PageOffsetSchema = external_exports.coerce.number().int().min(0).default(0);
26923
+ PaginationQuerySchema = external_exports.object({
26924
+ limit: PageLimitSchema.default(DEFAULT_PAGE_LIMIT),
26925
+ offset: PageOffsetSchema
26926
+ });
26887
26927
  TimestampSchema = external_exports.string().datetime();
26888
26928
  DateRangeSchema = external_exports.object({
26889
26929
  startDate: external_exports.string().datetime(),
@@ -47464,7 +47504,7 @@ var init_api_schemas = __esm({
47464
47504
  }).strict();
47465
47505
  ListCommandQueueTasksSchema = external_exports.object({
47466
47506
  status: external_exports.enum(["pending", "approved", "rejected", "expired"]).optional(),
47467
- limit: external_exports.coerce.number().int().min(1).max(100).default(20)
47507
+ limit: PageLimitSchema.default(20)
47468
47508
  }).strict();
47469
47509
  ListExecutionsSchema = external_exports.object({
47470
47510
  resourceStatus: external_exports.enum(["dev", "prod", "all"]).default("all")
@@ -48027,8 +48067,7 @@ var init_api_schemas2 = __esm({
48027
48067
  init_validation();
48028
48068
  NotificationCategorySchema = external_exports.enum(["info", "queue", "alert", "error", "system"]);
48029
48069
  GetNotificationsQuerySchema = external_exports.object({
48030
- limit: external_exports.coerce.number().int().min(1).max(100).default(50),
48031
- offset: external_exports.coerce.number().int().min(0).default(0)
48070
+ ...PaginationQuerySchema.shape
48032
48071
  });
48033
48072
  MarkAsReadParamsSchema = external_exports.object({
48034
48073
  id: UuidSchema
@@ -48187,8 +48226,7 @@ var init_api_schemas3 = __esm({
48187
48226
  endDate: external_exports.string().datetime().optional()
48188
48227
  }).strict();
48189
48228
  ListActivitiesQuerySchema = external_exports.object({
48190
- limit: external_exports.coerce.number().int().min(1).max(100).default(50),
48191
- offset: external_exports.coerce.number().int().min(0).default(0),
48229
+ ...PaginationQuerySchema.shape,
48192
48230
  activityType: ActivityTypeSchema.optional(),
48193
48231
  entityType: external_exports.string().max(100).optional(),
48194
48232
  entityId: external_exports.string().max(255).optional(),
@@ -48665,8 +48703,7 @@ var init_api_schemas4 = __esm({
48665
48703
  status: ClientStatusSchema.optional(),
48666
48704
  source: ClientSourceSchema.optional(),
48667
48705
  search: external_exports.string().trim().min(1).max(255).optional(),
48668
- limit: external_exports.coerce.number().int().min(1).max(100).default(50),
48669
- offset: external_exports.coerce.number().int().min(0).default(0)
48706
+ ...PaginationQuerySchema.shape
48670
48707
  }).strict();
48671
48708
  ClientRefSchema = external_exports.object({
48672
48709
  id: external_exports.string(),
@@ -49062,8 +49099,7 @@ var init_index = __esm({
49062
49099
  init_types();
49063
49100
  init_config();
49064
49101
  init_define_contract();
49065
- init_define_step();
49066
- init_define_workflow();
49102
+ init_define_single_step_workflow();
49067
49103
  init_contract_ref();
49068
49104
  init_utils();
49069
49105
  init_runtime();
@@ -49096,6 +49132,12 @@ function resolveApiKey(prod) {
49096
49132
  function isProdApiUrl(apiUrl) {
49097
49133
  return !apiUrl.includes("localhost");
49098
49134
  }
49135
+ function withTarget(command, options = {}) {
49136
+ return command.option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", options.apiUrlDescription ?? "API base URL");
49137
+ }
49138
+ function printJson(value) {
49139
+ console.log(JSON.stringify(value, null, 2));
49140
+ }
49099
49141
  function resolveApiKeyForUrl(apiUrl) {
49100
49142
  return resolveApiKey(isProdApiUrl(apiUrl));
49101
49143
  }
@@ -49397,7 +49439,7 @@ var init_package = __esm({
49397
49439
  "package.json"() {
49398
49440
  package_default = {
49399
49441
  name: "@elevasis/sdk",
49400
- version: "1.53.0",
49442
+ version: "1.54.0",
49401
49443
  description: "SDK for building Elevasis organization resources",
49402
49444
  type: "module",
49403
49445
  bin: {
@@ -49436,14 +49478,14 @@ var init_package = __esm({
49436
49478
  scripts: {
49437
49479
  lint: "eslint src --max-warnings 0",
49438
49480
  build: `node -e "require('fs').rmSync('dist',{recursive:true,force:true})" && tsc -p tsconfig.core-dts.json && tsc -p tsconfig.build.json && tsup && rollup -c rollup.dts.config.mjs && esbuild src/cli/index.ts --bundle --platform=node --outfile=dist/cli.cjs --format=cjs --external:esbuild --banner:js="#!/usr/bin/env node" && node scripts/verify-skill-coverage.mjs && node scripts/copy-reference-docs.mjs && node ../../scripts/monorepo/generate-reference-artifacts.js`,
49439
- "type-check": "tsc --noEmit",
49440
- "check-types": "pnpm type-check",
49481
+ "check-types": "tsc --noEmit",
49441
49482
  test: "pnpm test:bundle",
49442
49483
  "test:source": "vitest run --config vitest.config.ts",
49443
49484
  "test:dist": "pnpm build && node ../../scripts/monorepo/validate-reference-artifacts.js && vitest run --config vitest.bundle.config.ts",
49444
49485
  "test:bundle": "pnpm test:source && pnpm test:dist"
49445
49486
  },
49446
49487
  dependencies: {
49488
+ "@alcyone-labs/zod-to-json-schema": "^4.0.10",
49447
49489
  "@mdx-js/mdx": "^3.1.1",
49448
49490
  esbuild: "^0.25.0",
49449
49491
  "remark-gfm": "^4.0.1"
@@ -49464,8 +49506,7 @@ var init_package = __esm({
49464
49506
  "@types/node": "^22.0.0",
49465
49507
  chalk: "^5.3.0",
49466
49508
  commander: "^11.0.0",
49467
- dotenv: "^16.0.0",
49468
- "gray-matter": "^4.0.3",
49509
+ dotenv: "^17.2.3",
49469
49510
  ora: "^7.0.1",
49470
49511
  rollup: "^4.59.0",
49471
49512
  "rollup-plugin-dts": "^6.3.0",
@@ -49473,6 +49514,15 @@ var init_package = __esm({
49473
49514
  typescript: "5.9.2",
49474
49515
  vitest: "^3.2.4",
49475
49516
  zod: "^4.1.0"
49517
+ },
49518
+ license: "MIT",
49519
+ engines: {
49520
+ node: ">=22"
49521
+ },
49522
+ repository: {
49523
+ type: "git",
49524
+ url: "git+https://github.com/Elevasis/elevasis-monorepo.git",
49525
+ directory: "packages/sdk"
49476
49526
  }
49477
49527
  };
49478
49528
  }
@@ -51224,12 +51274,7 @@ function formatRuntimeArguments(args) {
51224
51274
  }).join(" ");
51225
51275
  }
51226
51276
  function renderCliCatalogMarkdown(catalog) {
51227
- const lines = [
51228
- "# elevasis-sdk CLI Catalog",
51229
- "",
51230
- `Source: \`${catalog.sourceRoot}\``,
51231
- ""
51232
- ];
51277
+ const lines = ["# elevasis-sdk CLI Catalog", "", `Source: \`${catalog.sourceRoot}\``, ""];
51233
51278
  if (catalog.domains.length === 0) {
51234
51279
  lines.push("No commands found.");
51235
51280
  return lines.join("\n");
@@ -51534,11 +51579,11 @@ async function pollForCompletion(resourceId, executionId, apiUrl) {
51534
51579
  }
51535
51580
  }
51536
51581
  function registerExecCommand(program3) {
51537
- program3.command("exec <resourceId>").description(`Execute a deployed resource
51582
+ withTarget(program3.command("exec <resourceId>").description(`Execute a deployed resource
51538
51583
  Example: elevasis-sdk exec my-workflow -i '{"key":"value"}'`).option("-i, --input <json>", "Input data as JSON string").option(
51539
51584
  "-f, --input-file <path>",
51540
51585
  "Read input from a JSON file (avoids shell escaping issues). Relative paths resolve against the project root."
51541
- ).option("--async", "Execute asynchronously with polling").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option(
51586
+ ).option("--async", "Execute asynchronously with polling"), { apiUrlDescription: "API URL" }).option(
51542
51587
  "--cleanup-input",
51543
51588
  "Delete the input file after a successful execution (only files under <projectRoot>/tmp/ are eligible; files outside tmp/ produce a warning and are left untouched)"
51544
51589
  ).action(
@@ -51636,7 +51681,7 @@ function getResourceType(resource) {
51636
51681
  return resource.type ?? resource.resourceType;
51637
51682
  }
51638
51683
  function registerResourcesCommand(program3) {
51639
- program3.command("resources").description("List deployed resources for your organization").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output as JSON").action(wrapAction("resources", async (options) => {
51684
+ withTarget(program3.command("resources").description("List deployed resources for your organization"), { apiUrlDescription: "API URL" }).option("--json", "Output as JSON").action(wrapAction("resources", async (options) => {
51640
51685
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
51641
51686
  const spinner = ora("Fetching resources...").start();
51642
51687
  const data = await apiGet(
@@ -51687,7 +51732,7 @@ init_api_client();
51687
51732
  init_config2();
51688
51733
  init_wrap_action();
51689
51734
  function registerExecutionsCommand(program3) {
51690
- program3.command("executions <resourceId>").description("List execution history for a resource\n Example: elevasis-sdk executions my-workflow --limit 10").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output as JSON").option("--limit <number>", "Limit number of results (default: 50)").option("--status <status>", "Filter by status (running|completed|failed)").action(wrapAction("executions", async (resourceId, options) => {
51735
+ withTarget(program3.command("executions <resourceId>").description("List execution history for a resource\n Example: elevasis-sdk executions my-workflow --limit 10"), { apiUrlDescription: "API URL" }).option("--json", "Output as JSON").option("--limit <number>", "Limit number of results (default: 50)").option("--status <status>", "Filter by status (running|completed|failed)").action(wrapAction("executions", async (resourceId, options) => {
51691
51736
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
51692
51737
  const spinner = ora(`Fetching executions for ${resourceId}...`).start();
51693
51738
  const params = new URLSearchParams();
@@ -51750,7 +51795,7 @@ init_api_client();
51750
51795
  init_config2();
51751
51796
  init_wrap_action();
51752
51797
  function registerExecutionCommand(program3) {
51753
- program3.command("execution <resourceId> <executionId>").description("Get detailed information about a specific execution\n Example: elevasis-sdk execution my-workflow abc-123-uuid --logs-only").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output raw JSON response").option("--logs-only", "Show only execution logs").option("--input", "Include input data in output").option("--result", "Include result data in output").action(wrapAction("execution", async (resourceId, executionId, options) => {
51798
+ withTarget(program3.command("execution <resourceId> <executionId>").description("Get detailed information about a specific execution\n Example: elevasis-sdk execution my-workflow abc-123-uuid --logs-only"), { apiUrlDescription: "API URL" }).option("--json", "Output raw JSON response").option("--logs-only", "Show only execution logs").option("--input", "Include input data in output").option("--result", "Include result data in output").action(wrapAction("execution", async (resourceId, executionId, options) => {
51754
51799
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
51755
51800
  const spinner = ora("Fetching execution details...").start();
51756
51801
  const execution = await apiGet(
@@ -51857,9 +51902,9 @@ init_api_client();
51857
51902
  init_config2();
51858
51903
  init_wrap_action();
51859
51904
  function registerExecutionCancelCommand(program3) {
51860
- program3.command("execution:cancel <resourceId> <executionId>").description(
51905
+ withTarget(program3.command("execution:cancel <resourceId> <executionId>").description(
51861
51906
  "Cancel a running execution\n Example: elevasis-sdk execution:cancel my-workflow 9c47c944-67eb-4c84-98cb-bb951d05ede3"
51862
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output raw JSON response").action(
51907
+ )).option("--json", "Output raw JSON response").action(
51863
51908
  wrapAction("execution:cancel", async (resourceId, executionId, options) => {
51864
51909
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
51865
51910
  const spinner = options.json ? void 0 : ora("Cancelling execution...").start();
@@ -51900,9 +51945,9 @@ init_api_client();
51900
51945
  init_config2();
51901
51946
  init_wrap_action();
51902
51947
  function registerExecutionsDeleteCommand(program3) {
51903
- program3.command("executions:delete <resourceId>").description(
51948
+ withTarget(program3.command("executions:delete <resourceId>").description(
51904
51949
  "Delete a resource\u2019s execution history (destructive)\n Example: elevasis-sdk executions:delete my-workflow --force"
51905
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--resource-status <status>", "Only delete runs from this deployment lane (dev|prod)").option("--force", "Skip the typed confirmation prompt").option("--json", "Output raw JSON response").action(
51950
+ )).option("--resource-status <status>", "Only delete runs from this deployment lane (dev|prod)").option("--force", "Skip the typed confirmation prompt").option("--json", "Output raw JSON response").action(
51906
51951
  wrapAction("executions:delete", async (resourceId, options) => {
51907
51952
  if (options.resourceStatus && options.resourceStatus !== "dev" && options.resourceStatus !== "prod") {
51908
51953
  throw new Error('--resource-status must be "dev" or "prod"');
@@ -51950,7 +51995,7 @@ init_api_client();
51950
51995
  init_config2();
51951
51996
  init_wrap_action();
51952
51997
  function registerDeploymentsCommand(program3) {
51953
- program3.command("deployments").description("List deployments for your organization").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output as JSON").action(wrapAction("deployments", async (options) => {
51998
+ withTarget(program3.command("deployments").description("List deployments for your organization"), { apiUrlDescription: "API URL" }).option("--json", "Output as JSON").action(wrapAction("deployments", async (options) => {
51954
51999
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
51955
52000
  const spinner = ora("Fetching deployments...").start();
51956
52001
  const data = await apiGet(
@@ -52034,7 +52079,7 @@ function formatJsonSchema(schema, indent = 2) {
52034
52079
  return JSON.stringify(schema, null, 2);
52035
52080
  }
52036
52081
  function registerDescribeCommand(program3) {
52037
- program3.command("describe <resourceId>").description("Show resource definition (metadata + schemas)\n Example: elevasis-sdk describe my-workflow").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output raw JSON response").action(
52082
+ withTarget(program3.command("describe <resourceId>").description("Show resource definition (metadata + schemas)\n Example: elevasis-sdk describe my-workflow"), { apiUrlDescription: "API URL" }).option("--json", "Output raw JSON response").action(
52038
52083
  wrapAction("describe", async (resourceId, options) => {
52039
52084
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
52040
52085
  const spinner = ora("Fetching resource definition...").start();
@@ -52295,27 +52340,27 @@ Credential '${name}' deleted successfully.`));
52295
52340
  // src/cli/commands/creds/creds.ts
52296
52341
  function registerCredsCommand(program3) {
52297
52342
  const creds = program3.command("creds").description("Manage organization credentials");
52298
- creds.command("list").description("List all credentials (metadata only, no secrets)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output as JSON").action(
52343
+ withTarget(creds.command("list").description("List all credentials (metadata only, no secrets)"), { apiUrlDescription: "API URL" }).option("--json", "Output as JSON").action(
52299
52344
  wrapAction("creds list", async (options) => {
52300
52345
  await listCreds(resolveApiUrl(options.apiUrl, options.prod), options.json);
52301
52346
  })
52302
52347
  );
52303
- creds.command("create").description("Create a new credential").requiredOption("--name <name>", "Credential name (lowercase, digits, hyphens)").requiredOption("--type <type>", "Credential type (api-key, webhook-secret, api-key-secret, clickup, instagram)").option("--value <json>", "Credential value as JSON string (or @json:<path> to read it from a file)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(
52348
+ withTarget(creds.command("create").description("Create a new credential").requiredOption("--name <name>", "Credential name (lowercase, digits, hyphens)").requiredOption("--type <type>", "Credential type (api-key, webhook-secret, api-key-secret, clickup, instagram)").option("--value <json>", "Credential value as JSON string (or @json:<path> to read it from a file)"), { apiUrlDescription: "API URL" }).action(
52304
52349
  wrapAction("creds create", async (options) => {
52305
52350
  await createCreds(resolveApiUrl(options.apiUrl, options.prod), options.name, options.type, options.value);
52306
52351
  })
52307
52352
  );
52308
- creds.command("update <name>").description("Update a credential value").requiredOption("--value <json>", "New credential value as JSON string (or @json:<path> to read it from a file)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(
52353
+ withTarget(creds.command("update <name>").description("Update a credential value").requiredOption("--value <json>", "New credential value as JSON string (or @json:<path> to read it from a file)"), { apiUrlDescription: "API URL" }).action(
52309
52354
  wrapAction("creds update", async (name, options) => {
52310
52355
  await updateCreds(resolveApiUrl(options.apiUrl, options.prod), name, options.value);
52311
52356
  })
52312
52357
  );
52313
- creds.command("rename <name>").description("Rename a credential").requiredOption("--to <newName>", "New credential name").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(
52358
+ withTarget(creds.command("rename <name>").description("Rename a credential").requiredOption("--to <newName>", "New credential name"), { apiUrlDescription: "API URL" }).action(
52314
52359
  wrapAction("creds rename", async (name, options) => {
52315
52360
  await renameCreds(resolveApiUrl(options.apiUrl, options.prod), name, options.to);
52316
52361
  })
52317
52362
  );
52318
- creds.command("delete <name>").description("Delete a credential").option("--force", "Skip confirmation prompt").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(
52363
+ withTarget(creds.command("delete <name>").description("Delete a credential").option("--force", "Skip confirmation prompt"), { apiUrlDescription: "API URL" }).action(
52319
52364
  wrapAction("creds delete", async (name, options) => {
52320
52365
  await deleteCreds(resolveApiUrl(options.apiUrl, options.prod), name, options.force);
52321
52366
  })
@@ -52352,12 +52397,12 @@ ${result.count} error(s) resolved for execution '${executionId}'.`));
52352
52397
  // src/cli/commands/error/error.ts
52353
52398
  function registerErrorCommand(program3) {
52354
52399
  const error46 = program3.command("error").description("Manage execution errors");
52355
- error46.command("resolve <errorId>").description("Mark a specific execution error as resolved").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(
52400
+ withTarget(error46.command("resolve <errorId>").description("Mark a specific execution error as resolved"), { apiUrlDescription: "API URL" }).action(
52356
52401
  wrapAction("error resolve", async (errorId, options) => {
52357
52402
  await resolveError(resolveApiUrl(options.apiUrl, options.prod), errorId);
52358
52403
  })
52359
52404
  );
52360
- error46.command("resolve-execution <executionId>").description("Mark all errors for an execution as resolved").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(
52405
+ withTarget(error46.command("resolve-execution <executionId>").description("Mark all errors for an execution as resolved"), { apiUrlDescription: "API URL" }).action(
52361
52406
  wrapAction("error resolve-execution", async (executionId, options) => {
52362
52407
  await resolveErrorsByExecution(resolveApiUrl(options.apiUrl, options.prod), executionId);
52363
52408
  })
@@ -52371,7 +52416,7 @@ init_api_client();
52371
52416
  init_config2();
52372
52417
  init_wrap_action();
52373
52418
  function registerRenameCommand(program3) {
52374
- program3.command("rename <oldResourceId>").description("Rename a resource ID across all platform tables (dry run by default)").requiredOption("--to <newResourceId>", "New resource ID").option("--execute", "Apply the rename (default: dry run preview only)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(
52419
+ withTarget(program3.command("rename <oldResourceId>").description("Rename a resource ID across all platform tables (dry run by default)").requiredOption("--to <newResourceId>", "New resource ID").option("--execute", "Apply the rename (default: dry run preview only)"), { apiUrlDescription: "API URL" }).action(
52375
52420
  wrapAction("rename", async (oldResourceId, options) => {
52376
52421
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
52377
52422
  const dryRun = !options.execute;
@@ -52701,9 +52746,6 @@ async function resolveClient(query, apiUrl) {
52701
52746
  }
52702
52747
  throw new Error(`Multiple clients matched "${trimmedQuery}": ${formatClientCandidates(clients)}`);
52703
52748
  }
52704
- function printJson(value) {
52705
- console.log(JSON.stringify(value, null, 2));
52706
- }
52707
52749
  function appendQuery(params, key, value) {
52708
52750
  if (value === void 0 || value === null || value === "") return;
52709
52751
  params.set(key, String(value));
@@ -52713,7 +52755,7 @@ function endpointWithQuery(endpoint, params) {
52713
52755
  return query ? `${endpoint}?${query}` : endpoint;
52714
52756
  }
52715
52757
  function registerClientList(program3) {
52716
- program3.command("client:list").description("List clients\n Example: elevasis-sdk client:list --status active").option("--status <status>", "Filter by status: active | onboarding | paused | completed | churned").option("--search <query>", "Search by client name").option("--limit <limit>", "Maximum number of clients to return").option("--offset <offset>", "Number of clients to skip").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
52758
+ withTarget(program3.command("client:list").description("List clients\n Example: elevasis-sdk client:list --status active").option("--status <status>", "Filter by status: active | onboarding | paused | completed | churned").option("--search <query>", "Search by client name").option("--limit <limit>", "Maximum number of clients to return").option("--offset <offset>", "Number of clients to skip")).option("--pretty", "Render human-readable output instead of raw JSON").action(
52717
52759
  wrapAction(
52718
52760
  "client:list",
52719
52761
  async (options) => {
@@ -52746,7 +52788,7 @@ Clients (${result.data.length} of ${result.total}):
52746
52788
  );
52747
52789
  }
52748
52790
  function registerClientGet(program3) {
52749
- program3.command("client:get <id>").description("Get a client by ID\n Example: elevasis-sdk client:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
52791
+ withTarget(program3.command("client:get <id>").description("Get a client by ID\n Example: elevasis-sdk client:get <uuid>")).option("--pretty", "Render human-readable output instead of raw JSON").action(
52750
52792
  wrapAction("client:get", async (id, options) => {
52751
52793
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
52752
52794
  const result = await apiGet(`/api/external/clients/${id}`, apiUrl);
@@ -52765,7 +52807,7 @@ Client: ${result.name}`));
52765
52807
  );
52766
52808
  }
52767
52809
  function registerClientStatus(program3) {
52768
- program3.command("client:status").description("Show client portfolio status").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
52810
+ withTarget(program3.command("client:status").description("Show client portfolio status")).option("--pretty", "Render human-readable output instead of raw JSON").action(
52769
52811
  wrapAction("client:status", async (options) => {
52770
52812
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
52771
52813
  const result = await apiGet("/api/external/clients/status", apiUrl);
@@ -52790,9 +52832,9 @@ function registerClientStatus(program3) {
52790
52832
  );
52791
52833
  }
52792
52834
  function registerClientResolve(program3) {
52793
- program3.command("client:resolve <query>").description(
52835
+ withTarget(program3.command("client:resolve <query>").description(
52794
52836
  'Resolve a client ID from a name, UUID, or search query\n Example: elevasis-sdk client:resolve "Acme"'
52795
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render client details instead of only the resolved ID").action(
52837
+ )).option("--pretty", "Render client details instead of only the resolved ID").action(
52796
52838
  wrapAction("client:resolve", async (query, options) => {
52797
52839
  const client = await resolveClient(query, resolveApiUrl(options.apiUrl, options.prod));
52798
52840
  if (options.pretty) {
@@ -52809,11 +52851,10 @@ Resolved client: ${client.name}`));
52809
52851
  }
52810
52852
 
52811
52853
  // src/cli/commands/project/projects.ts
52812
- function printJson2(value) {
52813
- console.log(JSON.stringify(value, null, 2));
52814
- }
52815
52854
  function registerProjectList(program3) {
52816
- program3.command("project:list").description("List projects\n Example: elevasis-sdk project:list --search alpha").option("--kind <kind>", "Filter by kind: client_engagement | internal | research | other").option("--status <status>", "Filter by status: active | on_track | at_risk | blocked | completed | paused").option("--search <query>", "Search by project name or description").option("--client <id-or-name>", "Filter by client hub record (UUID or fuzzy name)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
52855
+ withTarget(
52856
+ program3.command("project:list").description("List projects\n Example: elevasis-sdk project:list --search alpha").option("--kind <kind>", "Filter by kind: client_engagement | internal | research | other").option("--status <status>", "Filter by status: active | on_track | at_risk | blocked | completed | paused").option("--search <query>", "Search by project name or description").option("--client <id-or-name>", "Filter by client hub record (UUID or fuzzy name)")
52857
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
52817
52858
  wrapAction(
52818
52859
  "project:list",
52819
52860
  async (options) => {
@@ -52831,10 +52872,6 @@ function registerProjectList(program3) {
52831
52872
  const qs = params.toString();
52832
52873
  const endpoint = `/api/external/projects${qs ? `?${qs}` : ""}`;
52833
52874
  const result = await apiGet(endpoint, apiUrl);
52834
- if (options.json) {
52835
- printJson2(result);
52836
- return;
52837
- }
52838
52875
  if (options.pretty) {
52839
52876
  const projects = result.projects;
52840
52877
  if (projects.length === 0) {
@@ -52858,13 +52895,15 @@ Projects (${projects.length}):
52858
52895
  );
52859
52896
  }
52860
52897
  function registerProjectResolve(program3) {
52861
- program3.command("project:resolve <query>").description(
52862
- 'Resolve a project ID from a name, UUID, or search query\n Example: elevasis-sdk project:resolve "Alpha"'
52863
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render project details instead of only the resolved ID").option("--json", "Output as JSON").action(
52898
+ withTarget(
52899
+ program3.command("project:resolve <query>").description(
52900
+ 'Resolve a project ID from a name, UUID, or search query\n Example: elevasis-sdk project:resolve "Alpha"'
52901
+ )
52902
+ ).option("--pretty", "Render project details instead of only the resolved ID").option("--json", "Output as JSON").action(
52864
52903
  wrapAction("project:resolve", async (query, options) => {
52865
52904
  const project = await resolveProject(query, resolveApiUrl(options.apiUrl, options.prod));
52866
52905
  if (options.json) {
52867
- printJson2(project);
52906
+ printJson(project);
52868
52907
  return;
52869
52908
  }
52870
52909
  if (options.pretty) {
@@ -52882,9 +52921,11 @@ Resolved project: ${project.name}`));
52882
52921
  );
52883
52922
  }
52884
52923
  function registerProjectWork(program3) {
52885
- program3.command("project:work <query>").alias("project:open").description(
52886
- 'Resolve a project and print a lifecycle-aware work brief\n Example: elevasis-sdk project:work "Alpha"'
52887
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Render the structured work brief as JSON").action(
52924
+ withTarget(
52925
+ program3.command("project:work <query>").alias("project:open").description(
52926
+ 'Resolve a project and print a lifecycle-aware work brief\n Example: elevasis-sdk project:work "Alpha"'
52927
+ )
52928
+ ).option("--json", "Render the structured work brief as JSON").action(
52888
52929
  wrapAction("project:work", async (query, options) => {
52889
52930
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
52890
52931
  const resolved = await resolveProject(query, apiUrl);
@@ -52904,14 +52945,12 @@ ${renderProjectWorkBrief(brief)}
52904
52945
  );
52905
52946
  }
52906
52947
  function registerProjectGet(program3) {
52907
- program3.command("project:get <id>").description("Get a project by ID\n Example: elevasis-sdk project:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
52948
+ withTarget(
52949
+ program3.command("project:get <id>").description("Get a project by ID\n Example: elevasis-sdk project:get <uuid>")
52950
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
52908
52951
  wrapAction("project:get", async (id, options) => {
52909
52952
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
52910
52953
  const result = await apiGet(`/api/external/projects/${id}`, apiUrl);
52911
- if (options.json) {
52912
- printJson2(result);
52913
- return;
52914
- }
52915
52954
  if (options.pretty) {
52916
52955
  const p = result.project;
52917
52956
  console.log(source_default.cyan(`
@@ -52928,7 +52967,9 @@ Project: ${p.name}`));
52928
52967
  );
52929
52968
  }
52930
52969
  function registerProjectCreate(program3) {
52931
- program3.command("project:create").description('Create a new project\n Example: elevasis-sdk project:create --name "My Project" --kind internal').requiredOption("--name <name>", "Project name").requiredOption("--kind <kind>", "Project kind: client_engagement | internal | research | other").option("--status <status>", "Project status: active | on_track | at_risk | blocked | completed | paused").option("--description <description>", "Project description").option("--deal-id <uuid>", "Link to a deal (UUID)").option("--client <id-or-name>", "Link to a client hub record (UUID or fuzzy name)").option("--client-company-id <uuid>", "Link to a client company (UUID)").option("--start-date <date>", "Start date (ISO 8601, e.g. 2026-06-01)").option("--target-end-date <date>", "Target end date (ISO 8601, e.g. 2026-12-31)").option("--contract-value <amount>", "Contract value (number)", parseFloat).option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
52970
+ withTarget(
52971
+ program3.command("project:create").description('Create a new project\n Example: elevasis-sdk project:create --name "My Project" --kind internal').requiredOption("--name <name>", "Project name").requiredOption("--kind <kind>", "Project kind: client_engagement | internal | research | other").option("--status <status>", "Project status: active | on_track | at_risk | blocked | completed | paused").option("--description <description>", "Project description").option("--deal-id <uuid>", "Link to a deal (UUID)").option("--client <id-or-name>", "Link to a client hub record (UUID or fuzzy name)").option("--client-company-id <uuid>", "Link to a client company (UUID)").option("--start-date <date>", "Start date (ISO 8601, e.g. 2026-06-01)").option("--target-end-date <date>", "Target end date (ISO 8601, e.g. 2026-12-31)").option("--contract-value <amount>", "Contract value (number)", parseFloat).option("--metadata <json>", "Arbitrary metadata (JSON string)")
52972
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
52932
52973
  wrapAction(
52933
52974
  "project:create",
52934
52975
  async (options) => {
@@ -52952,10 +52993,6 @@ function registerProjectCreate(program3) {
52952
52993
  if (options.contractValue !== void 0) body.contract_value = options.contractValue;
52953
52994
  if (options.metadata) body.metadata = JSON.parse(options.metadata);
52954
52995
  const result = await apiPost("/api/external/projects", body, apiUrl);
52955
- if (options.json) {
52956
- printJson2(result);
52957
- return;
52958
- }
52959
52996
  if (options.pretty) {
52960
52997
  const p = result.project;
52961
52998
  console.log(source_default.green(`
@@ -52972,7 +53009,9 @@ Project created: ${p.name}`));
52972
53009
  );
52973
53010
  }
52974
53011
  function registerProjectUpdate(program3) {
52975
- program3.command("project:update <id>").description("Update a project\n Example: elevasis-sdk project:update <uuid> --status completed").option("--name <name>", "New project name").option("--status <status>", "New status: active | on_track | at_risk | blocked | completed | paused").option("--description <description>", "New description").option("--deal-id <uuid>", "Link to a deal (UUID)").option("--client <id-or-name>", "Link to a client hub record (UUID or fuzzy name)").option("--clear-client", "Remove the client hub link (sets client_id to null)").option("--client-company-id <uuid>", "Link to a client company (UUID)").option("--start-date <date>", "Start date (ISO 8601, e.g. 2026-06-01)").option("--target-end-date <date>", "Target end date (ISO 8601, e.g. 2026-12-31)").option("--actual-end-date <date>", "Actual end date (ISO 8601)").option("--contract-value <amount>", "Contract value (number)", parseFloat).option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53012
+ withTarget(
53013
+ program3.command("project:update <id>").description("Update a project\n Example: elevasis-sdk project:update <uuid> --status completed").option("--name <name>", "New project name").option("--status <status>", "New status: active | on_track | at_risk | blocked | completed | paused").option("--description <description>", "New description").option("--deal-id <uuid>", "Link to a deal (UUID)").option("--client <id-or-name>", "Link to a client hub record (UUID or fuzzy name)").option("--clear-client", "Remove the client hub link (sets client_id to null)").option("--client-company-id <uuid>", "Link to a client company (UUID)").option("--start-date <date>", "Start date (ISO 8601, e.g. 2026-06-01)").option("--target-end-date <date>", "Target end date (ISO 8601, e.g. 2026-12-31)").option("--actual-end-date <date>", "Actual end date (ISO 8601)").option("--contract-value <amount>", "Contract value (number)", parseFloat).option("--metadata <json>", "Arbitrary metadata (JSON string)")
53014
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
52976
53015
  wrapAction(
52977
53016
  "project:update",
52978
53017
  async (id, options) => {
@@ -53015,10 +53054,6 @@ function registerProjectUpdate(program3) {
53015
53054
  process.exit(1);
53016
53055
  }
53017
53056
  const result = await apiPatch(`/api/external/projects/${id}`, body, apiUrl);
53018
- if (options.json) {
53019
- printJson2(result);
53020
- return;
53021
- }
53022
53057
  if (options.pretty) {
53023
53058
  const p = result.project;
53024
53059
  console.log(source_default.green(`
@@ -53033,14 +53068,12 @@ Project updated: ${p.name}`));
53033
53068
  );
53034
53069
  }
53035
53070
  function registerProjectDelete(program3) {
53036
- program3.command("project:delete <id>").description("Delete a project\n Example: elevasis-sdk project:delete <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53071
+ withTarget(
53072
+ program3.command("project:delete <id>").description("Delete a project\n Example: elevasis-sdk project:delete <uuid>")
53073
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53037
53074
  wrapAction("project:delete", async (id, options) => {
53038
53075
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53039
53076
  const result = await apiDelete(`/api/external/projects/${id}`, apiUrl);
53040
- if (options.json) {
53041
- printJson2(result);
53042
- return;
53043
- }
53044
53077
  if (options.pretty) {
53045
53078
  console.log(source_default.green(`
53046
53079
  Project ${id} deleted.`));
@@ -53058,9 +53091,6 @@ init_source();
53058
53091
  init_wrap_action();
53059
53092
  init_config2();
53060
53093
  init_api_client();
53061
- function printJson3(value) {
53062
- console.log(JSON.stringify(value, null, 2));
53063
- }
53064
53094
  function parseSequenceOption(value) {
53065
53095
  const parsed = Number(value);
53066
53096
  if (!Number.isInteger(parsed) || parsed < 0) {
@@ -53091,14 +53121,12 @@ function parseChecklistOption(options) {
53091
53121
  }
53092
53122
  }
53093
53123
  function registerMilestoneList(program3) {
53094
- program3.command("project:milestone:list").description("List milestones for a project\n Example: elevasis-sdk project:milestone:list --project <uuid>").requiredOption("--project <project-id>", "Project ID (UUID)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53124
+ withTarget(
53125
+ program3.command("project:milestone:list").description("List milestones for a project\n Example: elevasis-sdk project:milestone:list --project <uuid>").requiredOption("--project <project-id>", "Project ID (UUID)")
53126
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53095
53127
  wrapAction("project:milestone:list", async (options) => {
53096
53128
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53097
53129
  const result = await apiGet(`/api/external/projects/${options.project}/milestones`, apiUrl);
53098
- if (options.json) {
53099
- printJson3(result);
53100
- return;
53101
- }
53102
53130
  if (options.pretty) {
53103
53131
  const milestones = result.milestones;
53104
53132
  if (milestones.length === 0) {
@@ -53121,9 +53149,11 @@ Milestones (${milestones.length}):
53121
53149
  );
53122
53150
  }
53123
53151
  function registerMilestoneCreate(program3) {
53124
- program3.command("project:milestone:create").description(
53125
- 'Create a milestone\n Example: elevasis-sdk project:milestone:create --project <uuid> --name "Phase 1"'
53126
- ).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--name <name>", "Milestone name").option("--status <status>", "Status: upcoming | in_progress | completed | overdue | blocked").option("--due-date <date>", "Due date (ISO 8601, e.g. 2026-06-01)").option("--sequence <n>", "Display order within the project (non-negative integer)", parseSequenceOption).option("--description <description>", "Milestone description").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53152
+ withTarget(
53153
+ program3.command("project:milestone:create").description(
53154
+ 'Create a milestone\n Example: elevasis-sdk project:milestone:create --project <uuid> --name "Phase 1"'
53155
+ ).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--name <name>", "Milestone name").option("--status <status>", "Status: upcoming | in_progress | completed | overdue | blocked").option("--due-date <date>", "Due date (ISO 8601, e.g. 2026-06-01)").option("--sequence <n>", "Display order within the project (non-negative integer)", parseSequenceOption).option("--description <description>", "Milestone description")
53156
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53127
53157
  wrapAction(
53128
53158
  "project:milestone:create",
53129
53159
  async (options) => {
@@ -53138,10 +53168,6 @@ function registerMilestoneCreate(program3) {
53138
53168
  body,
53139
53169
  apiUrl
53140
53170
  );
53141
- if (options.json) {
53142
- printJson3(result);
53143
- return;
53144
- }
53145
53171
  if (options.pretty) {
53146
53172
  const m = result.milestone;
53147
53173
  console.log(source_default.green(`
@@ -53158,10 +53184,12 @@ Milestone created: ${m.name}`));
53158
53184
  );
53159
53185
  }
53160
53186
  function registerMilestoneUpdate(program3) {
53161
- program3.command("project:milestone:update <id>").description("Update a milestone\n Example: elevasis-sdk project:milestone:update <uuid> --status completed").option("--name <name>", "New milestone name").option("--status <status>", "New status: upcoming | in_progress | completed | overdue | blocked").option("--description <description>", "New description").option("--due-date <date>", "New due date (ISO 8601)").option("--sequence <n>", "New display order within the project (non-negative integer)", parseSequenceOption).option("--checklist <json>", `Replace checklist (full array): '[{"id":"1","label":"Step","completed":false}]'`).option(
53162
- "--checklist-file <path>",
53163
- "Read replacement checklist from a JSON file. Relative paths resolve against the project root."
53164
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53187
+ withTarget(
53188
+ program3.command("project:milestone:update <id>").description("Update a milestone\n Example: elevasis-sdk project:milestone:update <uuid> --status completed").option("--name <name>", "New milestone name").option("--status <status>", "New status: upcoming | in_progress | completed | overdue | blocked").option("--description <description>", "New description").option("--due-date <date>", "New due date (ISO 8601)").option("--sequence <n>", "New display order within the project (non-negative integer)", parseSequenceOption).option("--checklist <json>", `Replace checklist (full array): '[{"id":"1","label":"Step","completed":false}]'`).option(
53189
+ "--checklist-file <path>",
53190
+ "Read replacement checklist from a JSON file. Relative paths resolve against the project root."
53191
+ )
53192
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53165
53193
  wrapAction(
53166
53194
  "project:milestone:update",
53167
53195
  async (id, options) => {
@@ -53184,10 +53212,6 @@ function registerMilestoneUpdate(program3) {
53184
53212
  }
53185
53213
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53186
53214
  const result = await apiPatch(`/api/external/milestones/${id}`, body, apiUrl);
53187
- if (options.json) {
53188
- printJson3(result);
53189
- return;
53190
- }
53191
53215
  if (options.pretty) {
53192
53216
  const m = result.milestone;
53193
53217
  console.log(source_default.green(`
@@ -53202,14 +53226,12 @@ Milestone updated: ${m.name}`));
53202
53226
  );
53203
53227
  }
53204
53228
  function registerMilestoneDelete(program3) {
53205
- program3.command("project:milestone:delete <id>").description("Delete a milestone\n Example: elevasis-sdk project:milestone:delete <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53229
+ withTarget(
53230
+ program3.command("project:milestone:delete <id>").description("Delete a milestone\n Example: elevasis-sdk project:milestone:delete <uuid>")
53231
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53206
53232
  wrapAction("project:milestone:delete", async (id, options) => {
53207
53233
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53208
53234
  const result = await apiDelete(`/api/external/milestones/${id}`, apiUrl);
53209
- if (options.json) {
53210
- printJson3(result);
53211
- return;
53212
- }
53213
53235
  if (options.pretty) {
53214
53236
  console.log(source_default.green(`
53215
53237
  Milestone ${id} deleted.`));
@@ -53227,9 +53249,6 @@ init_source();
53227
53249
  init_wrap_action();
53228
53250
  init_config2();
53229
53251
  init_api_client();
53230
- function printJson4(value) {
53231
- console.log(JSON.stringify(value, null, 2));
53232
- }
53233
53252
  function failConflictingFlags(message) {
53234
53253
  process.stderr.write(JSON.stringify({ error: message, code: "CONFLICTING_FLAGS" }) + "\n");
53235
53254
  process.exit(1);
@@ -53248,12 +53267,14 @@ function parseChecklistOption2(options) {
53248
53267
  }
53249
53268
  }
53250
53269
  function registerTaskList(program3) {
53251
- program3.command("project:task:list").description(
53252
- "List tasks for a project\n Example: elevasis-sdk project:task:list --project <uuid> --status in_progress"
53253
- ).requiredOption("--project <project-id>", "Project ID (UUID)").option(
53254
- "--status <status>",
53255
- "Filter by status: planned | in_progress | blocked | completed | cancelled | submitted | approved | rejected | revision_requested"
53256
- ).option("--milestone <milestone-id>", "Filter by milestone ID (UUID)").option("--parent <parent-task-id>", "Filter by parent task ID (UUID)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53270
+ withTarget(
53271
+ program3.command("project:task:list").description(
53272
+ "List tasks for a project\n Example: elevasis-sdk project:task:list --project <uuid> --status in_progress"
53273
+ ).requiredOption("--project <project-id>", "Project ID (UUID)").option(
53274
+ "--status <status>",
53275
+ "Filter by status: planned | in_progress | blocked | completed | cancelled | submitted | approved | rejected | revision_requested"
53276
+ ).option("--milestone <milestone-id>", "Filter by milestone ID (UUID)").option("--parent <parent-task-id>", "Filter by parent task ID (UUID)")
53277
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53257
53278
  wrapAction(
53258
53279
  "project:task:list",
53259
53280
  async (options) => {
@@ -53265,10 +53286,6 @@ function registerTaskList(program3) {
53265
53286
  const qs = params.toString();
53266
53287
  const endpoint = `/api/external/projects/${options.project}/tasks${qs ? `?${qs}` : ""}`;
53267
53288
  const result = await apiGet(endpoint, apiUrl);
53268
- if (options.json) {
53269
- printJson4(result);
53270
- return;
53271
- }
53272
53289
  if (options.pretty) {
53273
53290
  const tasks = result.tasks;
53274
53291
  if (tasks.length === 0) {
@@ -53292,14 +53309,12 @@ Tasks (${tasks.length}):
53292
53309
  );
53293
53310
  }
53294
53311
  function registerTaskGet(program3) {
53295
- program3.command("project:task:get <id>").description("Get a task by ID\n Example: elevasis-sdk project:task:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53312
+ withTarget(
53313
+ program3.command("project:task:get <id>").description("Get a task by ID\n Example: elevasis-sdk project:task:get <uuid>")
53314
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53296
53315
  wrapAction("project:task:get", async (id, options) => {
53297
53316
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53298
53317
  const result = await apiGet(`/api/external/project-tasks/${id}`, apiUrl);
53299
- if (options.json) {
53300
- printJson4(result);
53301
- return;
53302
- }
53303
53318
  if (options.pretty) {
53304
53319
  const t = result.task;
53305
53320
  console.log(source_default.cyan(`
@@ -53317,15 +53332,17 @@ Task: ${t.name}`));
53317
53332
  );
53318
53333
  }
53319
53334
  function registerTaskCreate(program3) {
53320
- program3.command("project:task:create").description(
53321
- 'Create a task\n Example: elevasis-sdk project:task:create --project <uuid> --title "Implement feature"'
53322
- ).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--title <title>", "Task title / name").option("--status <status>", "Status: planned | in_progress | blocked | completed | cancelled").option(
53323
- "--type <type>",
53324
- "Type: documentation | code | report | design | refactor | feature | bug | research | other"
53325
- ).option("--milestone <milestone-id>", "Milestone ID (UUID)").option("--parent <parent-task-id>", "Parent task ID (UUID) for subtasks").option("--due-date <date>", "Due date (ISO 8601, e.g. 2026-06-01)").option("--description <description>", "Task description").option("--checklist <json>", `Checklist items as JSON array: '[{"id":"1","label":"Step","completed":false}]'`).option(
53326
- "--checklist-file <path>",
53327
- "Read checklist items from a JSON file. Relative paths resolve against the project root."
53328
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53335
+ withTarget(
53336
+ program3.command("project:task:create").description(
53337
+ 'Create a task\n Example: elevasis-sdk project:task:create --project <uuid> --title "Implement feature"'
53338
+ ).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--title <title>", "Task title / name").option("--status <status>", "Status: planned | in_progress | blocked | completed | cancelled").option(
53339
+ "--type <type>",
53340
+ "Type: documentation | code | report | design | refactor | feature | bug | research | other"
53341
+ ).option("--milestone <milestone-id>", "Milestone ID (UUID)").option("--parent <parent-task-id>", "Parent task ID (UUID) for subtasks").option("--due-date <date>", "Due date (ISO 8601, e.g. 2026-06-01)").option("--description <description>", "Task description").option("--checklist <json>", `Checklist items as JSON array: '[{"id":"1","label":"Step","completed":false}]'`).option(
53342
+ "--checklist-file <path>",
53343
+ "Read checklist items from a JSON file. Relative paths resolve against the project root."
53344
+ )
53345
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53329
53346
  wrapAction(
53330
53347
  "project:task:create",
53331
53348
  async (options) => {
@@ -53350,10 +53367,6 @@ function registerTaskCreate(program3) {
53350
53367
  )
53351
53368
  );
53352
53369
  }
53353
- if (options.json) {
53354
- printJson4(result);
53355
- return;
53356
- }
53357
53370
  if (options.pretty) {
53358
53371
  const t = result.task;
53359
53372
  console.log(source_default.green(`
@@ -53369,16 +53382,18 @@ Task created: ${t.name}`));
53369
53382
  );
53370
53383
  }
53371
53384
  function registerTaskUpdate(program3) {
53372
- program3.command("project:task:update <id>").description("Update a task\n Example: elevasis-sdk project:task:update <uuid> --status completed").option("--title <title>", "New task title").option(
53373
- "--status <status>",
53374
- "New status: planned | in_progress | blocked | completed | cancelled | submitted | approved | rejected | revision_requested"
53375
- ).option(
53376
- "--type <type>",
53377
- "New type: documentation | code | report | design | refactor | feature | bug | research | other"
53378
- ).option("--milestone <milestone-id>", "New milestone ID (UUID)").option("--clear-milestone", "Detach from its milestone (sets milestone_id to null)").option("--parent <parent-task-id>", "New parent task ID (UUID) \u2014 re-parents this task as a subtask").option("--clear-parent", "Detach from its parent task (sets parent_task_id to null)").option("--due-date <date>", "New due date (ISO 8601, e.g. 2026-06-01)").option("--description <description>", "New description").option("--file-url <url>", "Link to a deliverable file").option("--checklist <json>", `Replace checklist (full array): '[{"id":"1","label":"Step","completed":false}]'`).option(
53379
- "--checklist-file <path>",
53380
- "Read replacement checklist from a JSON file. Relative paths resolve against the project root."
53381
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53385
+ withTarget(
53386
+ program3.command("project:task:update <id>").description("Update a task\n Example: elevasis-sdk project:task:update <uuid> --status completed").option("--title <title>", "New task title").option(
53387
+ "--status <status>",
53388
+ "New status: planned | in_progress | blocked | completed | cancelled | submitted | approved | rejected | revision_requested"
53389
+ ).option(
53390
+ "--type <type>",
53391
+ "New type: documentation | code | report | design | refactor | feature | bug | research | other"
53392
+ ).option("--milestone <milestone-id>", "New milestone ID (UUID)").option("--clear-milestone", "Detach from its milestone (sets milestone_id to null)").option("--parent <parent-task-id>", "New parent task ID (UUID) \u2014 re-parents this task as a subtask").option("--clear-parent", "Detach from its parent task (sets parent_task_id to null)").option("--due-date <date>", "New due date (ISO 8601, e.g. 2026-06-01)").option("--description <description>", "New description").option("--file-url <url>", "Link to a deliverable file").option("--checklist <json>", `Replace checklist (full array): '[{"id":"1","label":"Step","completed":false}]'`).option(
53393
+ "--checklist-file <path>",
53394
+ "Read replacement checklist from a JSON file. Relative paths resolve against the project root."
53395
+ )
53396
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53382
53397
  wrapAction(
53383
53398
  "project:task:update",
53384
53399
  async (id, options) => {
@@ -53412,10 +53427,6 @@ function registerTaskUpdate(program3) {
53412
53427
  }
53413
53428
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53414
53429
  const result = await apiPatch(`/api/external/project-tasks/${id}`, body, apiUrl);
53415
- if (options.json) {
53416
- printJson4(result);
53417
- return;
53418
- }
53419
53430
  if (options.pretty) {
53420
53431
  const t = result.task;
53421
53432
  console.log(source_default.green(`
@@ -53430,14 +53441,12 @@ Task updated: ${t.name}`));
53430
53441
  );
53431
53442
  }
53432
53443
  function registerTaskDelete(program3) {
53433
- program3.command("project:task:delete <id>").description("Delete a task\n Example: elevasis-sdk project:task:delete <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53444
+ withTarget(
53445
+ program3.command("project:task:delete <id>").description("Delete a task\n Example: elevasis-sdk project:task:delete <uuid>")
53446
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53434
53447
  wrapAction("project:task:delete", async (id, options) => {
53435
53448
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53436
53449
  const result = await apiDelete(`/api/external/project-tasks/${id}`, apiUrl);
53437
- if (options.json) {
53438
- printJson4(result);
53439
- return;
53440
- }
53441
53450
  if (options.pretty) {
53442
53451
  console.log(source_default.green(`
53443
53452
  Task ${id} deleted.`));
@@ -53449,18 +53458,16 @@ Task ${id} deleted.`));
53449
53458
  );
53450
53459
  }
53451
53460
  function registerTaskResume(program3) {
53452
- program3.command("project:task:resume <id>").description(
53453
- "Fetch the resume_context JSONB for a task (used by /work resume)\n Example: elevasis-sdk project:task:resume <uuid>"
53454
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render a human-readable resume briefing instead of raw JSON").option("--json", "Output as JSON").action(
53461
+ withTarget(
53462
+ program3.command("project:task:resume <id>").description(
53463
+ "Fetch the resume_context JSONB for a task (used by /work resume)\n Example: elevasis-sdk project:task:resume <uuid>"
53464
+ )
53465
+ ).option("--pretty", "Render a human-readable resume briefing instead of raw JSON").action(
53455
53466
  wrapAction("project:task:resume", async (id, options) => {
53456
53467
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53457
53468
  const result = await apiGet(`/api/external/project-tasks/${id}`, apiUrl);
53458
53469
  const task = result.task;
53459
53470
  const ctx = task.resume_context ?? {};
53460
- if (options.json) {
53461
- printJson4(ctx);
53462
- return;
53463
- }
53464
53471
  if (options.pretty) {
53465
53472
  console.log(source_default.cyan(`
53466
53473
  Resume briefing for task: ${task.name}`));
@@ -53501,10 +53508,12 @@ Resume briefing for task: ${task.name}`));
53501
53508
  );
53502
53509
  }
53503
53510
  function registerTaskSave(program3) {
53504
- program3.command("project:task:save <id>").description(
53505
- `Merge fields into resume_context for a task (used by /work save)
53511
+ withTarget(
53512
+ program3.command("project:task:save <id>").description(
53513
+ `Merge fields into resume_context for a task (used by /work save)
53506
53514
  Example: elevasis-sdk project:task:save <uuid> --current-state "Implemented X" --files-modified '["src/foo.ts"]'`
53507
- ).requiredOption("--current-state <text>", "Current state description").option("--files-modified <json>", "JSON array of modified file paths").option("--next-steps <text>", "Next steps description").option("--key-docs <json>", "JSON array of key doc paths").option("--tools <json>", "JSON array of tool names used").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53515
+ ).requiredOption("--current-state <text>", "Current state description").option("--files-modified <json>", "JSON array of modified file paths").option("--next-steps <text>", "Next steps description").option("--key-docs <json>", "JSON array of key doc paths").option("--tools <json>", "JSON array of tool names used")
53516
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53508
53517
  wrapAction(
53509
53518
  "project:task:save",
53510
53519
  async (id, options) => {
@@ -53546,10 +53555,6 @@ function registerTaskSave(program3) {
53546
53555
  }
53547
53556
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53548
53557
  const result = await apiPatch(`/api/external/project-tasks/${id}/resume-context`, body, apiUrl);
53549
- if (options.json) {
53550
- printJson4(result);
53551
- return;
53552
- }
53553
53558
  if (options.pretty) {
53554
53559
  console.log(source_default.green(`
53555
53560
  Resume context saved for task ${id}`));
@@ -53832,19 +53837,14 @@ var DeleteSuccessResponseSchema = external_exports.object({ success: external_ex
53832
53837
  init_wrap_action();
53833
53838
  init_config2();
53834
53839
  init_api_client();
53835
- function printJson5(value) {
53836
- console.log(JSON.stringify(value, null, 2));
53837
- }
53838
53840
  var NOTE_TYPE_HELP = NoteTypeSchema.options.join(" | ");
53839
53841
  function registerNoteList(program3) {
53840
- program3.command("project:note:list").description("List notes for a project\n Example: elevasis-sdk project:note:list --project <uuid>").requiredOption("--project <project-id>", "Project ID (UUID)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53842
+ withTarget(
53843
+ program3.command("project:note:list").description("List notes for a project\n Example: elevasis-sdk project:note:list --project <uuid>").requiredOption("--project <project-id>", "Project ID (UUID)")
53844
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53841
53845
  wrapAction("project:note:list", async (options) => {
53842
53846
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53843
53847
  const result = await apiGet(`/api/external/projects/${options.project}/notes`, apiUrl);
53844
- if (options.json) {
53845
- printJson5(result);
53846
- return;
53847
- }
53848
53848
  if (options.pretty) {
53849
53849
  const notes = result.notes;
53850
53850
  if (notes.length === 0) {
@@ -53867,9 +53867,11 @@ Notes (${notes.length}):
53867
53867
  );
53868
53868
  }
53869
53869
  function registerNoteCreate(program3) {
53870
- program3.command("project:note:create").description(
53871
- 'Create a note\n Example: elevasis-sdk project:note:create --project <uuid> --content "Status update"'
53872
- ).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--content <content>", "Note content").option("--task <task-id>", "Attach to a task (UUID)").option("--milestone <milestone-id>", "Attach to a milestone (UUID)").option("--type <type>", `Note type: ${NOTE_TYPE_HELP}`).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53870
+ withTarget(
53871
+ program3.command("project:note:create").description(
53872
+ 'Create a note\n Example: elevasis-sdk project:note:create --project <uuid> --content "Status update"'
53873
+ ).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--content <content>", "Note content").option("--task <task-id>", "Attach to a task (UUID)").option("--milestone <milestone-id>", "Attach to a milestone (UUID)").option("--type <type>", `Note type: ${NOTE_TYPE_HELP}`)
53874
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53873
53875
  wrapAction(
53874
53876
  "project:note:create",
53875
53877
  async (options) => {
@@ -53882,10 +53884,6 @@ function registerNoteCreate(program3) {
53882
53884
  if (options.type) body.type = options.type;
53883
53885
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53884
53886
  const result = await apiPost("/api/external/project-notes", body, apiUrl);
53885
- if (options.json) {
53886
- printJson5(result);
53887
- return;
53888
- }
53889
53887
  if (options.pretty) {
53890
53888
  const n = result.note;
53891
53889
  console.log(source_default.green(`
@@ -53901,7 +53899,9 @@ Note created`));
53901
53899
  );
53902
53900
  }
53903
53901
  function registerNoteUpdate(program3) {
53904
- program3.command("project:note:update <id>").description('Update a note\n Example: elevasis-sdk project:note:update <uuid> --content "Updated content"').requiredOption("--content <content>", "New note content").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53902
+ withTarget(
53903
+ program3.command("project:note:update <id>").description('Update a note\n Example: elevasis-sdk project:note:update <uuid> --content "Updated content"').requiredOption("--content <content>", "New note content")
53904
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53905
53905
  wrapAction("project:note:update", async (id, options) => {
53906
53906
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53907
53907
  const result = await apiPatch(
@@ -53909,10 +53909,6 @@ function registerNoteUpdate(program3) {
53909
53909
  { content: options.content },
53910
53910
  apiUrl
53911
53911
  );
53912
- if (options.json) {
53913
- printJson5(result);
53914
- return;
53915
- }
53916
53912
  if (options.pretty) {
53917
53913
  console.log(source_default.green(`
53918
53914
  Note ${id} updated.`));
@@ -53924,14 +53920,12 @@ Note ${id} updated.`));
53924
53920
  );
53925
53921
  }
53926
53922
  function registerNoteDelete(program3) {
53927
- program3.command("project:note:delete <id>").description("Delete a note\n Example: elevasis-sdk project:note:delete <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
53923
+ withTarget(
53924
+ program3.command("project:note:delete <id>").description("Delete a note\n Example: elevasis-sdk project:note:delete <uuid>")
53925
+ ).option("--pretty", "Render human-readable output instead of raw JSON").action(
53928
53926
  wrapAction("project:note:delete", async (id, options) => {
53929
53927
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
53930
53928
  const result = await apiDelete(`/api/external/project-notes/${id}`, apiUrl);
53931
- if (options.json) {
53932
- printJson5(result);
53933
- return;
53934
- }
53935
53929
  if (options.pretty) {
53936
53930
  console.log(source_default.green(`
53937
53931
  Note ${id} deleted.`));
@@ -55797,7 +55791,7 @@ var REQUEST_CATEGORY_HELP = RequestCategoryEnum.options.join(" | ");
55797
55791
  var REQUEST_SEVERITY_HELP = RequestSeverityEnum.options.join(" | ");
55798
55792
  var REQUEST_STATUS_HELP = RequestStatusEnum.options.join(" | ");
55799
55793
  function registerRequestCommands(program3) {
55800
- program3.command("request:submit").description(
55794
+ withTarget(program3.command("request:submit").description(
55801
55795
  `Submit a structured request report via POST /api/external/requests
55802
55796
  Example: elevasis-sdk request:submit -f ./request-report.json
55803
55797
  type: ${REQUEST_TYPE_HELP}
@@ -55806,7 +55800,7 @@ function registerRequestCommands(program3) {
55806
55800
  ).option("-i, --input <json>", "Request body as JSON string").option(
55807
55801
  "-f, --input-file <path>",
55808
55802
  "Read request body from a JSON file (e.g. request-report.json, avoids shell escaping). Relative paths resolve against the project root."
55809
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option(
55803
+ )).option("--pretty", "Render human-readable output instead of raw JSON").option(
55810
55804
  "--cleanup-input",
55811
55805
  "Delete the input file after a successful submission (only files under <projectRoot>/tmp/ are eligible; files outside tmp/ produce a warning and are left untouched)"
55812
55806
  ).action(
@@ -55851,12 +55845,12 @@ ${issues}`);
55851
55845
  }
55852
55846
  })
55853
55847
  );
55854
- program3.command("request:list").description(
55848
+ withTarget(program3.command("request:list").description(
55855
55849
  `List reported requests via GET /api/external/requests
55856
55850
  Example: elevasis-sdk request:list --status open --severity critical
55857
55851
  status: ${REQUEST_STATUS_HELP}
55858
55852
  severity: ${REQUEST_SEVERITY_HELP}`
55859
- ).option("--status <status>", `Filter by status (${REQUEST_STATUS_HELP})`).option("--severity <severity>", `Filter by severity (${REQUEST_SEVERITY_HELP})`).option("--project-id <uuid>", "Filter by project id").option("--limit <n>", "Max rows to return (1-200, default 50)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
55853
+ ).option("--status <status>", `Filter by status (${REQUEST_STATUS_HELP})`).option("--severity <severity>", `Filter by severity (${REQUEST_SEVERITY_HELP})`).option("--project-id <uuid>", "Filter by project id").option("--limit <n>", "Max rows to return (1-200, default 50)")).option("--pretty", "Render human-readable output instead of raw JSON").action(
55860
55854
  wrapAction("request:list", async (options) => {
55861
55855
  const params = new URLSearchParams();
55862
55856
  if (options.status) params.set("status", options.status);
@@ -55883,9 +55877,9 @@ ${rows.length} request${rows.length === 1 ? "" : "s"}`));
55883
55877
  }
55884
55878
  })
55885
55879
  );
55886
- program3.command("request:get <id>").description(
55880
+ withTarget(program3.command("request:get <id>").description(
55887
55881
  "Get a reported request by id via GET /api/external/requests/:id\n Example: elevasis-sdk request:get 1a2b3c4d-5e6f-7890-abcd-ef1234567890"
55888
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
55882
+ )).option("--pretty", "Render human-readable output instead of raw JSON").action(
55889
55883
  wrapAction("request:get", async (id, options) => {
55890
55884
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
55891
55885
  const result = await apiGet(`/api/external/requests/${encodeURIComponent(id)}`, apiUrl);
@@ -55904,7 +55898,7 @@ ${rows.length} request${rows.length === 1 ? "" : "s"}`));
55904
55898
  }
55905
55899
  })
55906
55900
  );
55907
- program3.command("request:update <id>").description(
55901
+ withTarget(program3.command("request:update <id>").description(
55908
55902
  `Amend a request you filed via PATCH /api/external/requests/:id
55909
55903
  Example: elevasis-sdk request:update <uuid> -i '{"project_id":"<uuid>"}'
55910
55904
  Backfills project_id / task_id on rows filed before those were populated.
@@ -55915,7 +55909,7 @@ ${rows.length} request${rows.length === 1 ? "" : "s"}`));
55915
55909
  ).option("-i, --input <json>", "Fields to change, as a JSON object").option(
55916
55910
  "-f, --input-file <path>",
55917
55911
  "Read the changed fields from a JSON file (avoids shell escaping). Relative paths resolve against the project root."
55918
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
55912
+ )).option("--pretty", "Render human-readable output instead of raw JSON").action(
55919
55913
  wrapAction("request:update", async (id, options) => {
55920
55914
  if (!options.input && !options.inputFile) {
55921
55915
  throw new Error("Provide --input <json> or --input-file <path>");
@@ -55948,9 +55942,9 @@ ${issues}`);
55948
55942
  }
55949
55943
  })
55950
55944
  );
55951
- program3.command("request:delete <id>").description(
55945
+ withTarget(program3.command("request:delete <id>").description(
55952
55946
  "Withdraw a request you filed via DELETE /api/external/requests/:id\n Example: elevasis-sdk request:delete <uuid>\n Permanent - the row is removed, not archived. Use request:update to amend instead."
55953
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
55947
+ )).option("--pretty", "Render human-readable output instead of raw JSON").action(
55954
55948
  wrapAction("request:delete", async (id, options) => {
55955
55949
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
55956
55950
  const result = await apiDelete(`/api/external/requests/${encodeURIComponent(id)}`, apiUrl);
@@ -56130,7 +56124,11 @@ function listDeployedReadinessTargets(model) {
56130
56124
  const targets = SYSTEM_INTERFACE_PROFILES.map((profile) => ({
56131
56125
  systemPath: profile.systemPath,
56132
56126
  interfaceKey: profile.interfaceKey,
56133
- declaredLocally: declared.has(profile.systemPath)
56127
+ // `declared` is built from apiInterface declarations, which are statements about
56128
+ // the `api` interface only. A System can carry several catalog profiles (sales.lead-gen
56129
+ // has both `api` and the derived `crm-handoff`), so matching on systemPath alone marked
56130
+ // a tenant as having declared a bridge it cannot author, and cost it the not-adopted opt-out.
56131
+ declaredLocally: profile.interfaceKey === "api" && declared.has(profile.systemPath)
56134
56132
  }));
56135
56133
  const covered = new Set(targets.map((target) => `${target.systemPath}::${target.interfaceKey}`));
56136
56134
  for (const systemPath of declared) {
@@ -56427,9 +56425,6 @@ function endpointWithQuery2(endpoint, params) {
56427
56425
  const query = params.toString();
56428
56426
  return query ? `${endpoint}?${query}` : endpoint;
56429
56427
  }
56430
- function printJson6(value) {
56431
- console.log(JSON.stringify(value, null, 2));
56432
- }
56433
56428
  function dealEmail(deal) {
56434
56429
  return deal.contactEmail ?? deal.contact_email ?? "unknown contact";
56435
56430
  }
@@ -56443,7 +56438,7 @@ function dealListId(deal) {
56443
56438
  return deal.sourceListId ?? deal.source_list_id ?? null;
56444
56439
  }
56445
56440
  function registerAcquisitionDealList(program3) {
56446
- program3.command("acquisition:deal:list").description("List acquisition deals\n Example: elevasis-sdk acquisition:deal:list --stage discovery").option("--stage <stage>", "Filter by CRM stage").option("--list <id>", "Filter by source acquisition list ID").option("--batch <batch>", "Filter by source batch ID").option("--stale-since <datetime>", "Filter to deals stale since an ISO datetime").option("--search <query>", "Search by contact, company, or deal label").option("--limit <limit>", "Maximum number of deals to return").option("--offset <offset>", "Number of deals to skip").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56441
+ withTarget(program3.command("acquisition:deal:list").description("List acquisition deals\n Example: elevasis-sdk acquisition:deal:list --stage discovery").option("--stage <stage>", "Filter by CRM stage").option("--list <id>", "Filter by source acquisition list ID").option("--batch <batch>", "Filter by source batch ID").option("--stale-since <datetime>", "Filter to deals stale since an ISO datetime").option("--search <query>", "Search by contact, company, or deal label").option("--limit <limit>", "Maximum number of deals to return").option("--offset <offset>", "Number of deals to skip")).option("--pretty", "Render human-readable output instead of raw JSON").action(
56447
56442
  wrapAction(
56448
56443
  "acquisition:deal:list",
56449
56444
  async (options) => {
@@ -56458,7 +56453,7 @@ function registerAcquisitionDealList(program3) {
56458
56453
  appendQuery2(params, "offset", options.offset);
56459
56454
  const result = await apiGet(endpointWithQuery2("/api/external/deals", params), apiUrl);
56460
56455
  if (!options.pretty) {
56461
- printJson6(result);
56456
+ printJson(result);
56462
56457
  return;
56463
56458
  }
56464
56459
  if (result.data.length === 0) {
@@ -56481,12 +56476,12 @@ Acquisition deals (${result.data.length} of ${result.total}):
56481
56476
  );
56482
56477
  }
56483
56478
  function registerAcquisitionDealGet(program3) {
56484
- program3.command("acquisition:deal:get <id>").description("Get an acquisition deal by ID\n Example: elevasis-sdk acquisition:deal:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56479
+ withTarget(program3.command("acquisition:deal:get <id>").description("Get an acquisition deal by ID\n Example: elevasis-sdk acquisition:deal:get <uuid>")).option("--pretty", "Render human-readable output instead of raw JSON").action(
56485
56480
  wrapAction("acquisition:deal:get", async (id, options) => {
56486
56481
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
56487
56482
  const result = await apiGet("/api/external/deals/" + id, apiUrl);
56488
56483
  if (!options.pretty) {
56489
- printJson6(result);
56484
+ printJson(result);
56490
56485
  return;
56491
56486
  }
56492
56487
  console.log(source_default.cyan(`
@@ -56503,12 +56498,12 @@ Acquisition deal: ${dealEmail(result)}`));
56503
56498
  );
56504
56499
  }
56505
56500
  function registerAcquisitionDealStatus(program3) {
56506
- program3.command("acquisition:deal:status").description("Show CRM funnel status for acquisition deals").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56501
+ withTarget(program3.command("acquisition:deal:status").description("Show CRM funnel status for acquisition deals")).option("--pretty", "Render human-readable output instead of raw JSON").action(
56507
56502
  wrapAction("acquisition:deal:status", async (options) => {
56508
56503
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
56509
56504
  const result = await apiGet("/api/external/deals/summary", apiUrl);
56510
56505
  if (!options.pretty) {
56511
- printJson6(result);
56506
+ printJson(result);
56512
56507
  return;
56513
56508
  }
56514
56509
  console.log(source_default.cyan("\nAcquisition deal status"));
@@ -56540,9 +56535,6 @@ function endpointWithQuery3(endpoint, params) {
56540
56535
  const query = params.toString();
56541
56536
  return query ? `${endpoint}?${query}` : endpoint;
56542
56537
  }
56543
- function printJson7(value) {
56544
- console.log(JSON.stringify(value, null, 2));
56545
- }
56546
56538
  function renderListSummary(list) {
56547
56539
  const batches = list.batchIds?.length ? `${list.batchIds.length} batch(es)` : "no batches";
56548
56540
  const vertical = typeof list.scrapingConfig?.vertical === "string" ? ` ${list.scrapingConfig.vertical}` : "";
@@ -56552,7 +56544,7 @@ function renderListSummary(list) {
56552
56544
  if (list.description) console.log(source_default.gray(` ${list.description}`));
56553
56545
  }
56554
56546
  function registerAcquisitionListList(program3) {
56555
- program3.command("acquisition:list:list").description("List acquisition lists\n Example: elevasis-sdk acquisition:list:list --status launched").option("--status <status>", "Filter by status: draft | enriching | launched | closing | archived").option("--batch <batch>", "Filter by batch ID").option("--vertical <vertical>", "Filter by scraping vertical").option("--limit <limit>", "Maximum number of lists to return").option("--offset <offset>", "Number of lists to skip").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56547
+ withTarget(program3.command("acquisition:list:list").description("List acquisition lists\n Example: elevasis-sdk acquisition:list:list --status launched").option("--status <status>", "Filter by status: draft | enriching | launched | closing | archived").option("--batch <batch>", "Filter by batch ID").option("--vertical <vertical>", "Filter by scraping vertical").option("--limit <limit>", "Maximum number of lists to return").option("--offset <offset>", "Number of lists to skip")).option("--pretty", "Render human-readable output instead of raw JSON").action(
56556
56548
  wrapAction(
56557
56549
  "acquisition:list:list",
56558
56550
  async (options) => {
@@ -56568,7 +56560,7 @@ function registerAcquisitionListList(program3) {
56568
56560
  apiUrl
56569
56561
  );
56570
56562
  if (!options.pretty) {
56571
- printJson7(result);
56563
+ printJson(result);
56572
56564
  return;
56573
56565
  }
56574
56566
  if (result.length === 0) {
@@ -56585,7 +56577,7 @@ Acquisition lists (${result.length}):
56585
56577
  );
56586
56578
  }
56587
56579
  function registerAcquisitionListGet(program3) {
56588
- program3.command("acquisition:list:get <id>").description("Get an acquisition list by ID\n Example: elevasis-sdk acquisition:list:get <uuid>").option("--no-include-deals", "Exclude thin deal lineage refs").option("--deal-limit <limit>", "Maximum number of thin deal refs to include").option("--include-progress", "Include processing progress aggregates").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56580
+ withTarget(program3.command("acquisition:list:get <id>").description("Get an acquisition list by ID\n Example: elevasis-sdk acquisition:list:get <uuid>").option("--no-include-deals", "Exclude thin deal lineage refs").option("--deal-limit <limit>", "Maximum number of thin deal refs to include").option("--include-progress", "Include processing progress aggregates")).option("--pretty", "Render human-readable output instead of raw JSON").action(
56589
56581
  wrapAction(
56590
56582
  "acquisition:list:get",
56591
56583
  async (id, options) => {
@@ -56599,7 +56591,7 @@ function registerAcquisitionListGet(program3) {
56599
56591
  apiUrl
56600
56592
  );
56601
56593
  if (!options.pretty) {
56602
- printJson7(result);
56594
+ printJson(result);
56603
56595
  return;
56604
56596
  }
56605
56597
  console.log(source_default.cyan(`
@@ -56616,12 +56608,12 @@ Acquisition list: ${result.name}`));
56616
56608
  );
56617
56609
  }
56618
56610
  function registerAcquisitionListStatus(program3) {
56619
- program3.command("acquisition:list:status").description("Show portfolio status across acquisition lists").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56611
+ withTarget(program3.command("acquisition:list:status").description("Show portfolio status across acquisition lists")).option("--pretty", "Render human-readable output instead of raw JSON").action(
56620
56612
  wrapAction("acquisition:list:status", async (options) => {
56621
56613
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
56622
56614
  const result = await apiGet("/api/external/acquisition/lists/status", apiUrl);
56623
56615
  if (!options.pretty) {
56624
- printJson7(result);
56616
+ printJson(result);
56625
56617
  return;
56626
56618
  }
56627
56619
  console.log(source_default.cyan("\nAcquisition list status"));
@@ -56654,7 +56646,7 @@ init_wrap_action();
56654
56646
  init_config2();
56655
56647
  init_api_client();
56656
56648
  function registerClientCreate(program3) {
56657
- program3.command("client:create").description('Create a new client\n Example: elevasis-sdk client:create --name "Acme Corp"').requiredOption("--name <name>", "Client name").option("--status <status>", "Client status: active | onboarding | paused | completed | churned").option("--source <source>", "Client source (for example: acquisition | word_of_mouth)").option("--source-deal-id <uuid>", "UUID of the source deal").option("--primary-company-id <uuid>", "UUID of the primary company").option("--primary-contact-id <uuid>", "UUID of the primary contact").option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56649
+ withTarget(program3.command("client:create").description('Create a new client\n Example: elevasis-sdk client:create --name "Acme Corp"').requiredOption("--name <name>", "Client name").option("--status <status>", "Client status: active | onboarding | paused | completed | churned").option("--source <source>", "Client source (for example: acquisition | word_of_mouth)").option("--source-deal-id <uuid>", "UUID of the source deal").option("--primary-company-id <uuid>", "UUID of the primary company").option("--primary-contact-id <uuid>", "UUID of the primary contact").option("--metadata <json>", "Arbitrary metadata (JSON string)")).option("--pretty", "Render human-readable output instead of raw JSON").action(
56658
56650
  wrapAction(
56659
56651
  "client:create",
56660
56652
  async (options) => {
@@ -56681,7 +56673,7 @@ Client created: ${result.name}`));
56681
56673
  );
56682
56674
  }
56683
56675
  function registerClientUpdate(program3) {
56684
- program3.command("client:update <id>").description("Update a client\n Example: elevasis-sdk client:update <uuid> --status active").option("--name <name>", "New client name").option("--status <status>", "New status: active | onboarding | paused | completed | churned").option("--source <source>", "Set client source (for example: acquisition | word_of_mouth)").option("--source-deal-id <uuid>", "Set source deal (UUID)").option("--clear-source-deal", "Remove the source deal link (sets sourceDealId to null)").option("--primary-company-id <uuid>", "Set primary company (UUID)").option("--clear-primary-company", "Remove the primary company link (sets primaryCompanyId to null)").option("--primary-contact-id <uuid>", "Set primary contact (UUID)").option("--clear-primary-contact", "Remove the primary contact link (sets primaryContactId to null)").option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56676
+ withTarget(program3.command("client:update <id>").description("Update a client\n Example: elevasis-sdk client:update <uuid> --status active").option("--name <name>", "New client name").option("--status <status>", "New status: active | onboarding | paused | completed | churned").option("--source <source>", "Set client source (for example: acquisition | word_of_mouth)").option("--source-deal-id <uuid>", "Set source deal (UUID)").option("--clear-source-deal", "Remove the source deal link (sets sourceDealId to null)").option("--primary-company-id <uuid>", "Set primary company (UUID)").option("--clear-primary-company", "Remove the primary company link (sets primaryCompanyId to null)").option("--primary-contact-id <uuid>", "Set primary contact (UUID)").option("--clear-primary-contact", "Remove the primary contact link (sets primaryContactId to null)").option("--metadata <json>", "Arbitrary metadata (JSON string)")).option("--pretty", "Render human-readable output instead of raw JSON").action(
56685
56677
  wrapAction(
56686
56678
  "client:update",
56687
56679
  async (id, options) => {
@@ -56758,7 +56750,7 @@ Client updated: ${result.name}`));
56758
56750
  );
56759
56751
  }
56760
56752
  function registerClientDelete(program3) {
56761
- program3.command("client:delete <id>").description("Delete a client\n Example: elevasis-sdk client:delete <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56753
+ withTarget(program3.command("client:delete <id>").description("Delete a client\n Example: elevasis-sdk client:delete <uuid>")).option("--pretty", "Render human-readable output instead of raw JSON").action(
56762
56754
  wrapAction("client:delete", async (id, options) => {
56763
56755
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
56764
56756
  const client = await resolveClient(id, apiUrl);
@@ -56795,9 +56787,9 @@ function appendQuery4(params, key, value) {
56795
56787
  params.set(key, String(value));
56796
56788
  }
56797
56789
  function registerContentList(program3) {
56798
- program3.command("content:list").description(
56790
+ withTarget(program3.command("content:list").description(
56799
56791
  'List content pipeline items\n Example: elevasis-sdk content:list --status <status> --pipeline-id <pipelineId>\n Note: both values come from the org model this project declares, not a platform enum --\n read them from the content:catalog/status catalog and content:pipeline.\n Note: "awaiting review" is not a status -- that read is content:queue.'
56800
- ).option("--status <status>", "Filter by content item status").option("--pillar <pillar>", "Filter by content pillar").option("--pipeline-id <id>", "Filter by pipeline template id").option("--client-id <id>", "Filter by client id").option("--reviewed-by <id>", "Filter by reviewer user id").option("--search <query>", "Search by title").option("--limit <n>", "Maximum number of results").option("--offset <n>", "Pagination offset").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56792
+ ).option("--status <status>", "Filter by content item status").option("--pillar <pillar>", "Filter by content pillar").option("--pipeline-id <id>", "Filter by pipeline template id").option("--client-id <id>", "Filter by client id").option("--reviewed-by <id>", "Filter by reviewer user id").option("--search <query>", "Search by title").option("--limit <n>", "Maximum number of results").option("--offset <n>", "Pagination offset")).option("--pretty", "Render human-readable output instead of raw JSON").action(
56801
56793
  wrapAction("content:list", async (options) => {
56802
56794
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
56803
56795
  const params = new URLSearchParams();
@@ -56840,9 +56832,9 @@ init_api_client();
56840
56832
  init_config2();
56841
56833
  init_wrap_action();
56842
56834
  function registerContentGet(program3) {
56843
- program3.command("content:get <itemId>").description(
56835
+ withTarget(program3.command("content:get <itemId>").description(
56844
56836
  "Get a content item, its attempts, and its distributions in one call\n Example: elevasis-sdk content:get <uuid>"
56845
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
56837
+ )).option("--pretty", "Render human-readable output instead of raw JSON").action(
56846
56838
  wrapAction("content:get", async (itemId, options) => {
56847
56839
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
56848
56840
  const result = await apiGet(`/api/external/content/items/${itemId}`, apiUrl);
@@ -57033,9 +57025,9 @@ function printCards(cards, stepsByKey) {
57033
57025
  }
57034
57026
  }
57035
57027
  function registerContentBoard(program3) {
57036
- program3.command("content:board <pipelineId>").description(
57028
+ withTarget(program3.command("content:board <pipelineId>").description(
57037
57029
  "Render one pipeline as a board -- columns, review gates, and waiting counts\n Example: elevasis-sdk content:board <pipelineId> --pretty\n Note: pipeline ids come from the org model this project declares -- list them with content:pipeline."
57038
- ).option("--limit <n>", `Items to pull before deriving (default and API maximum ${DEFAULT_ITEM_LIMIT})`).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57030
+ ).option("--limit <n>", `Items to pull before deriving (default and API maximum ${DEFAULT_ITEM_LIMIT})`)).option("--pretty", "Render human-readable output instead of raw JSON").action(
57039
57031
  wrapAction("content:board", async (pipelineId, options) => {
57040
57032
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57041
57033
  const limit = options.limit ?? String(DEFAULT_ITEM_LIMIT);
@@ -57092,7 +57084,7 @@ init_api_client();
57092
57084
  init_config2();
57093
57085
  init_wrap_action();
57094
57086
  function registerContentQueue(program3) {
57095
- program3.command("content:queue").description("List content items awaiting a `queued`-gate review\n Example: elevasis-sdk content:queue --pretty").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57087
+ withTarget(program3.command("content:queue").description("List content items awaiting a `queued`-gate review\n Example: elevasis-sdk content:queue --pretty")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57096
57088
  wrapAction("content:queue", async (options) => {
57097
57089
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57098
57090
  const result = await apiGet("/api/external/content/queue", apiUrl);
@@ -57134,9 +57126,9 @@ Pipeline: ${pipeline.id}`));
57134
57126
  console.log();
57135
57127
  }
57136
57128
  function registerContentPipeline(program3) {
57137
- program3.command("content:pipeline [id]").description(
57129
+ withTarget(program3.command("content:pipeline [id]").description(
57138
57130
  "List content pipeline templates, or show one pipeline's step contract\n Example: elevasis-sdk content:pipeline <pipelineId>\n Note: run without an id to list the pipeline ids this project declares in its org model."
57139
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57131
+ )).option("--pretty", "Render human-readable output instead of raw JSON").action(
57140
57132
  wrapAction("content:pipeline", async (id, options) => {
57141
57133
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57142
57134
  if (!id) {
@@ -57179,9 +57171,9 @@ function appendQuery5(params, key, value) {
57179
57171
  params.set(key, String(value));
57180
57172
  }
57181
57173
  function registerContentDistributions(program3) {
57182
- program3.command("content:distributions").description(
57174
+ withTarget(program3.command("content:distributions").description(
57183
57175
  "List content distributions\n Example: elevasis-sdk content:distributions --pipeline-id <pipelineId>\n Note: pipeline ids come from the org model this project declares -- list them with content:pipeline."
57184
- ).option("--content-item-id <id>", "Filter by content item id").option("--pipeline-id <id>", "Filter by pipeline template id").option("--platform <platform>", "Filter by distribution platform").option("--status <status>", "Filter by distribution status").option("--limit <n>", "Maximum number of results").option("--offset <n>", "Pagination offset").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57176
+ ).option("--content-item-id <id>", "Filter by content item id").option("--pipeline-id <id>", "Filter by pipeline template id").option("--platform <platform>", "Filter by distribution platform").option("--status <status>", "Filter by distribution status").option("--limit <n>", "Maximum number of results").option("--offset <n>", "Pagination offset")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57185
57177
  wrapAction("content:distributions", async (options) => {
57186
57178
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57187
57179
  const params = new URLSearchParams();
@@ -57223,12 +57215,12 @@ init_api_client();
57223
57215
  init_config2();
57224
57216
  init_wrap_action();
57225
57217
  function registerContentReview(program3) {
57226
- program3.command("content:review <itemId>").description(
57218
+ withTarget(program3.command("content:review <itemId>").description(
57227
57219
  "Clear a queued review gate on a content item\n Example: elevasis-sdk content:review <uuid> --step draft-review --approve --user reviewer@example.com"
57228
57220
  ).requiredOption("--step <key>", "The stepKey of the queued gate to clear (from `content:queue`)").requiredOption(
57229
57221
  "--user <email>",
57230
57222
  "The acting reviewer\u2019s email -- must be an active member of the API key\u2019s organization"
57231
- ).option("--approve", "Approve the item at this step").option("--reject", "Reject the item at this step (requires --reason)").option("--feedback <text>", "Optional reviewer feedback (1..5000 chars)").option("--reason <text>", "Reason for rejection -- required when --reject is set").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57223
+ ).option("--approve", "Approve the item at this step").option("--reject", "Reject the item at this step (requires --reason)").option("--feedback <text>", "Optional reviewer feedback (1..5000 chars)").option("--reason <text>", "Reason for rejection -- required when --reject is set")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57232
57224
  wrapAction("content:review", async (itemId, options) => {
57233
57225
  if (options.approve && options.reject) {
57234
57226
  throw new Error("Pass exactly one of --approve or --reject, not both");
@@ -57276,9 +57268,9 @@ function appendQuery6(params, key, value) {
57276
57268
  params.set(key, String(value));
57277
57269
  }
57278
57270
  function registerContentSourceAssets(program3) {
57279
- program3.command("content:source-assets").description(
57271
+ withTarget(program3.command("content:source-assets").description(
57280
57272
  "List content source assets (raw material)\n Example: elevasis-sdk content:source-assets --kind transcript --limit 10"
57281
- ).option("--kind <kind>", "Filter by source asset kind (e.g. transcript)").option("--limit <n>", "Maximum number of results").option("--offset <n>", "Pagination offset").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57273
+ ).option("--kind <kind>", "Filter by source asset kind (e.g. transcript)").option("--limit <n>", "Maximum number of results").option("--offset <n>", "Pagination offset")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57282
57274
  wrapAction("content:source-assets", async (options) => {
57283
57275
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57284
57276
  const params = new URLSearchParams();
@@ -57316,9 +57308,9 @@ init_api_client();
57316
57308
  init_config2();
57317
57309
  init_wrap_action();
57318
57310
  function registerContentSourceAsset(program3) {
57319
- program3.command("content:source-asset <sourceAssetId>").description(
57311
+ withTarget(program3.command("content:source-asset <sourceAssetId>").description(
57320
57312
  "Get one content source asset, including its payload\n Example: elevasis-sdk content:source-asset <uuid>"
57321
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57313
+ )).option("--pretty", "Render human-readable output instead of raw JSON").action(
57322
57314
  wrapAction("content:source-asset", async (sourceAssetId, options) => {
57323
57315
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57324
57316
  const asset = await apiGet(`/api/external/content/source-assets/${sourceAssetId}`, apiUrl);
@@ -57395,7 +57387,7 @@ function resolveMetadataOption(options) {
57395
57387
  return parsed;
57396
57388
  }
57397
57389
  function registerContentSourceAssetCreate(program3) {
57398
- program3.command("content:source-asset:create").description(
57390
+ withTarget(program3.command("content:source-asset:create").description(
57399
57391
  'Create a content source asset from inline text or a URL, optionally linking it to an item\n Example: elevasis-sdk content:source-asset:create --kind transcript --title "Episode 12" --text @transcript.txt --item <uuid>'
57400
57392
  ).requiredOption("--kind <kind>", "Source asset kind (e.g. transcript) -- validated against the org model catalog").requiredOption("--title <title>", "Human-readable title (1..500 chars)").option("--text <value>", "Inline text, or @path to read a local file. Mutually exclusive with --url").option(
57401
57393
  "--field <key>",
@@ -57403,7 +57395,7 @@ function registerContentSourceAssetCreate(program3) {
57403
57395
  ).option("--url <url>", "External URL the asset references. Mutually exclusive with --text").option("--duration <seconds>", "Duration in seconds, for time-based referenced media").option("--storage-path <path>", "Storage path the asset references (1..2000 chars)").option("--metadata <json>", "Arbitrary metadata as a JSON object string. Mutually exclusive with --metadata-file").option(
57404
57396
  "--metadata-file <path>",
57405
57397
  "Path to a JSON file containing metadata (project-relative unless absolute). Mutually exclusive with --metadata"
57406
- ).option("--item <itemId>", "Link the new asset to this content item after creating it").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57398
+ ).option("--item <itemId>", "Link the new asset to this content item after creating it")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57407
57399
  wrapAction("content:source-asset:create", async (options) => {
57408
57400
  if (options.text !== void 0 && options.url !== void 0) {
57409
57401
  throw new Error("Pass exactly one of --text or --url, not both");
@@ -57482,9 +57474,6 @@ init_source();
57482
57474
  init_api_client();
57483
57475
  init_config2();
57484
57476
  init_wrap_action();
57485
- function printJson8(value) {
57486
- console.log(JSON.stringify(value, null, 2));
57487
- }
57488
57477
  function appendQuery7(params, key, value) {
57489
57478
  if (value === void 0 || value === null || value === "") return;
57490
57479
  params.set(key, String(value));
@@ -57505,7 +57494,7 @@ function taskTitle(task) {
57505
57494
  return task.description || task.humanCheckpoint || task.id;
57506
57495
  }
57507
57496
  function registerQueueList(program3) {
57508
- program3.command("queue:list").description("List HITL command queue tasks\n Example: elevasis-sdk queue:list --status pending --pretty").option("--status <status>", "Filter by status: pending | processing | completed | failed | expired").option("--human-checkpoint <id>", 'Filter by checkpoint ID, or "ungrouped" for tasks without a checkpoint').option("--time-range <range>", "Filter by created time range: 1h | 24h | 7d | 30d").option("--priority-min <number>", "Minimum priority, 1-10").option("--priority-max <number>", "Maximum priority, 1-10").option("--limit <limit>", "Maximum number of tasks to return").option("--offset <offset>", "Number of tasks to skip").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57497
+ withTarget(program3.command("queue:list").description("List HITL command queue tasks\n Example: elevasis-sdk queue:list --status pending --pretty").option("--status <status>", "Filter by status: pending | processing | completed | failed | expired").option("--human-checkpoint <id>", 'Filter by checkpoint ID, or "ungrouped" for tasks without a checkpoint').option("--time-range <range>", "Filter by created time range: 1h | 24h | 7d | 30d").option("--priority-min <number>", "Minimum priority, 1-10").option("--priority-max <number>", "Maximum priority, 1-10").option("--limit <limit>", "Maximum number of tasks to return").option("--offset <offset>", "Number of tasks to skip")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57509
57498
  wrapAction(
57510
57499
  "queue:list",
57511
57500
  async (options) => {
@@ -57523,7 +57512,7 @@ function registerQueueList(program3) {
57523
57512
  apiUrl
57524
57513
  );
57525
57514
  if (!options.pretty) {
57526
- printJson8(result);
57515
+ printJson(result);
57527
57516
  return;
57528
57517
  }
57529
57518
  if (result.tasks.length === 0) {
@@ -57546,12 +57535,12 @@ Queue tasks (${result.tasks.length} of ${result.total}):
57546
57535
  );
57547
57536
  }
57548
57537
  function registerQueueGet(program3) {
57549
- program3.command("queue:get <id>").description("Get a HITL command queue task\n Example: elevasis-sdk queue:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57538
+ withTarget(program3.command("queue:get <id>").description("Get a HITL command queue task\n Example: elevasis-sdk queue:get <uuid>")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57550
57539
  wrapAction("queue:get", async (id, options) => {
57551
57540
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57552
57541
  const result = await apiGet(`/api/external/command-queue/${id}`, apiUrl);
57553
57542
  if (!options.pretty) {
57554
- printJson8(result);
57543
+ printJson(result);
57555
57544
  return;
57556
57545
  }
57557
57546
  const task = result.task;
@@ -57567,9 +57556,9 @@ Queue task: ${taskTitle(task)}`));
57567
57556
  );
57568
57557
  }
57569
57558
  function registerQueueSelect(program3) {
57570
- program3.command("queue:select <id>").description(
57559
+ withTarget(program3.command("queue:select <id>").description(
57571
57560
  "Select and execute a HITL queue action\n Example: elevasis-sdk queue:select <uuid> --action-id approve"
57572
- ).requiredOption("--action-id <id>", "Action ID to select").option("--payload <json>", "Optional action payload as JSON").option("--notes <notes>", "Optional human decision notes").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57561
+ ).requiredOption("--action-id <id>", "Action ID to select").option("--payload <json>", "Optional action payload as JSON").option("--notes <notes>", "Optional human decision notes")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57573
57562
  wrapAction(
57574
57563
  "queue:select",
57575
57564
  async (id, options) => {
@@ -57584,7 +57573,7 @@ function registerQueueSelect(program3) {
57584
57573
  apiUrl
57585
57574
  );
57586
57575
  if (!options.pretty) {
57587
- printJson8(result);
57576
+ printJson(result);
57588
57577
  return;
57589
57578
  }
57590
57579
  console.log(source_default.green(`
@@ -57596,7 +57585,7 @@ Selected action ${options.actionId} for queue task ${id}.`));
57596
57585
  );
57597
57586
  }
57598
57587
  function registerQueueExpire(program3) {
57599
- program3.command("queue:expire <id>").description("Mark a HITL queue task as expired\n Example: elevasis-sdk queue:expire <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57588
+ withTarget(program3.command("queue:expire <id>").description("Mark a HITL queue task as expired\n Example: elevasis-sdk queue:expire <uuid>")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57600
57589
  wrapAction("queue:expire", async (id, options) => {
57601
57590
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57602
57591
  const result = await apiPatch(
@@ -57605,7 +57594,7 @@ function registerQueueExpire(program3) {
57605
57594
  apiUrl
57606
57595
  );
57607
57596
  if (!options.pretty) {
57608
- printJson8(result);
57597
+ printJson(result);
57609
57598
  return;
57610
57599
  }
57611
57600
  console.log(source_default.green(`
@@ -57616,7 +57605,7 @@ Expired queue task ${id}.`));
57616
57605
  );
57617
57606
  }
57618
57607
  function registerQueueStatus(program3) {
57619
- program3.command("queue:status").description("Show HITL queue checkpoint and status counts").option("--time-range <range>", "Filter by created time range: 1h | 24h | 7d | 30d").option("--priority-min <number>", "Minimum priority, 1-10").option("--priority-max <number>", "Maximum priority, 1-10").option("--status <status>", "Filter checkpoint totals by status: pending | completed | expired").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57608
+ withTarget(program3.command("queue:status").description("Show HITL queue checkpoint and status counts").option("--time-range <range>", "Filter by created time range: 1h | 24h | 7d | 30d").option("--priority-min <number>", "Minimum priority, 1-10").option("--priority-max <number>", "Maximum priority, 1-10").option("--status <status>", "Filter checkpoint totals by status: pending | completed | expired")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57620
57609
  wrapAction(
57621
57610
  "queue:status",
57622
57611
  async (options) => {
@@ -57631,7 +57620,7 @@ function registerQueueStatus(program3) {
57631
57620
  apiUrl
57632
57621
  );
57633
57622
  if (!options.pretty) {
57634
- printJson8(result);
57623
+ printJson(result);
57635
57624
  return;
57636
57625
  }
57637
57626
  console.log(source_default.cyan("\nQueue status"));
@@ -57671,9 +57660,6 @@ init_source();
57671
57660
  init_api_client();
57672
57661
  init_config2();
57673
57662
  init_wrap_action();
57674
- function printJson9(value) {
57675
- console.log(JSON.stringify(value, null, 2));
57676
- }
57677
57663
  function appendQuery8(params, key, value) {
57678
57664
  if (value === void 0 || value === null || value === "") return;
57679
57665
  params.set(key, String(value));
@@ -57697,7 +57683,7 @@ function printSchedule(schedule) {
57697
57683
  if (schedule.nextRunAt) console.log(source_default.gray(` Next: ${new Date(schedule.nextRunAt).toLocaleString()}`));
57698
57684
  }
57699
57685
  function registerScheduleList(program3) {
57700
- program3.command("schedule:list").description("List task schedules\n Example: elevasis-sdk schedule:list --status active --pretty").option("--status <status>", "Filter by status: active | paused | completed | cancelled").option("--target-resource-type <type>", "Filter by target resource type: agent | workflow").option("--target-resource-id <id>", "Filter by target resource ID").option("--limit <limit>", "Maximum number of schedules to return").option("--offset <offset>", "Number of schedules to skip").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57686
+ withTarget(program3.command("schedule:list").description("List task schedules\n Example: elevasis-sdk schedule:list --status active --pretty").option("--status <status>", "Filter by status: active | paused | completed | cancelled").option("--target-resource-type <type>", "Filter by target resource type: agent | workflow").option("--target-resource-id <id>", "Filter by target resource ID").option("--limit <limit>", "Maximum number of schedules to return").option("--offset <offset>", "Number of schedules to skip")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57701
57687
  wrapAction(
57702
57688
  "schedule:list",
57703
57689
  async (options) => {
@@ -57713,7 +57699,7 @@ function registerScheduleList(program3) {
57713
57699
  apiUrl
57714
57700
  );
57715
57701
  if (!options.pretty) {
57716
- printJson9(result);
57702
+ printJson(result);
57717
57703
  return;
57718
57704
  }
57719
57705
  if (result.schedules.length === 0) {
@@ -57732,7 +57718,7 @@ Schedules (${result.schedules.length} of ${result.total}):
57732
57718
  );
57733
57719
  }
57734
57720
  function registerScheduleGet(program3) {
57735
- program3.command("schedule:get <id>").description("Get a task schedule\n Example: elevasis-sdk schedule:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57721
+ withTarget(program3.command("schedule:get <id>").description("Get a task schedule\n Example: elevasis-sdk schedule:get <uuid>")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57736
57722
  wrapAction("schedule:get", async (id, options) => {
57737
57723
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57738
57724
  const result = await apiGet(
@@ -57740,7 +57726,7 @@ function registerScheduleGet(program3) {
57740
57726
  apiUrl
57741
57727
  );
57742
57728
  if (!options.pretty) {
57743
- printJson9(result);
57729
+ printJson(result);
57744
57730
  return;
57745
57731
  }
57746
57732
  console.log(source_default.cyan(`
@@ -57758,10 +57744,10 @@ Schedule: ${result.schedule.name}`));
57758
57744
  );
57759
57745
  }
57760
57746
  function registerScheduleCreate(program3) {
57761
- program3.command("schedule:create").description(
57747
+ withTarget(program3.command("schedule:create").description(
57762
57748
  `Create a task schedule
57763
57749
  Example: elevasis-sdk schedule:create --name "Weekly report" --target-resource-type workflow --target-resource-id weekly-report --schedule-config '{"type":"recurring","interval":"weekly","time":"09:00","timezone":"America/New_York","payload":{}}'`
57764
- ).requiredOption("--name <name>", "Schedule name").option("--description <description>", "Schedule description").requiredOption("--target-resource-type <type>", "Target resource type: agent | workflow").requiredOption("--target-resource-id <id>", "Target resource ID").requiredOption("--schedule-config <json>", "Schedule config JSON").option("--max-retries <number>", "Maximum retry attempts, 0-10").option("--idempotency-key <key>", "Idempotency key").option("--origin-execution-id <uuid>", "Origin execution UUID").option("--origin-resource-type <type>", "Origin resource type").option("--origin-resource-id <id>", "Origin resource ID").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57750
+ ).requiredOption("--name <name>", "Schedule name").option("--description <description>", "Schedule description").requiredOption("--target-resource-type <type>", "Target resource type: agent | workflow").requiredOption("--target-resource-id <id>", "Target resource ID").requiredOption("--schedule-config <json>", "Schedule config JSON").option("--max-retries <number>", "Maximum retry attempts, 0-10").option("--idempotency-key <key>", "Idempotency key").option("--origin-execution-id <uuid>", "Origin execution UUID").option("--origin-resource-type <type>", "Origin resource type").option("--origin-resource-id <id>", "Origin resource ID")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57765
57751
  wrapAction(
57766
57752
  "schedule:create",
57767
57753
  async (options) => {
@@ -57790,7 +57776,7 @@ function registerScheduleCreate(program3) {
57790
57776
  apiUrl
57791
57777
  );
57792
57778
  if (!options.pretty) {
57793
- printJson9(result);
57779
+ printJson(result);
57794
57780
  return;
57795
57781
  }
57796
57782
  console.log(source_default.green(`
@@ -57803,7 +57789,7 @@ Schedule created: ${result.schedule.name}`));
57803
57789
  );
57804
57790
  }
57805
57791
  function registerScheduleUpdate(program3) {
57806
- program3.command("schedule:update <id>").description('Update a task schedule\n Example: elevasis-sdk schedule:update <uuid> --name "New name"').option("--name <name>", "New schedule name").option("--description <description>", "New schedule description").option("--clear-description", "Remove the schedule description").option("--schedule-config <json>", "Replacement schedule config JSON").option("--max-retries <number>", "Maximum retry attempts, 0-10").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57792
+ withTarget(program3.command("schedule:update <id>").description('Update a task schedule\n Example: elevasis-sdk schedule:update <uuid> --name "New name"').option("--name <name>", "New schedule name").option("--description <description>", "New schedule description").option("--clear-description", "Remove the schedule description").option("--schedule-config <json>", "Replacement schedule config JSON").option("--max-retries <number>", "Maximum retry attempts, 0-10")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57807
57793
  wrapAction(
57808
57794
  "schedule:update",
57809
57795
  async (id, options) => {
@@ -57842,7 +57828,7 @@ function registerScheduleUpdate(program3) {
57842
57828
  apiUrl
57843
57829
  );
57844
57830
  if (!options.pretty) {
57845
- printJson9(result);
57831
+ printJson(result);
57846
57832
  return;
57847
57833
  }
57848
57834
  console.log(source_default.green(`
@@ -57855,8 +57841,8 @@ Schedule updated: ${result.schedule.name}`));
57855
57841
  );
57856
57842
  }
57857
57843
  function registerScheduleStatusMutation(program3, commandName, description) {
57858
- program3.command(`schedule:${commandName} <id>`).description(`${description}
57859
- Example: elevasis-sdk schedule:${commandName} <uuid>`).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57844
+ withTarget(program3.command(`schedule:${commandName} <id>`).description(`${description}
57845
+ Example: elevasis-sdk schedule:${commandName} <uuid>`)).option("--pretty", "Render human-readable output instead of raw JSON").action(
57860
57846
  wrapAction(`schedule:${commandName}`, async (id, options) => {
57861
57847
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57862
57848
  const result = await apiPost(
@@ -57865,7 +57851,7 @@ function registerScheduleStatusMutation(program3, commandName, description) {
57865
57851
  apiUrl
57866
57852
  );
57867
57853
  if (!options.pretty) {
57868
- printJson9(result);
57854
+ printJson(result);
57869
57855
  return;
57870
57856
  }
57871
57857
  const verb = commandName === "pause" ? "paused" : commandName === "resume" ? "resumed" : "cancelled";
@@ -57905,9 +57891,9 @@ init_config2();
57905
57891
  init_api_client();
57906
57892
  var PRIORITY_HELP = "low | normal | high | urgent";
57907
57893
  function registerNoteCreate2(program3) {
57908
- program3.command("note:create").description(
57894
+ withTarget(program3.command("note:create").description(
57909
57895
  'Create a personal note for a user\n Example: elevasis-sdk note:create --content "Deal X stalled" --user agent@example.com'
57910
- ).requiredOption("--content <text>", "Note content").option("--user <email>", "Target user email (required -- the API rejects the call without it)").option("--title <text>", "Optional note title").option("--priority <priority>", `Priority: ${PRIORITY_HELP}`).option("--pinned", "Pin the note to the top of the panel").option("--source <id>", "Source identifier (e.g. workflow or agent ID)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57896
+ ).requiredOption("--content <text>", "Note content").option("--user <email>", "Target user email (required -- the API rejects the call without it)").option("--title <text>", "Optional note title").option("--priority <priority>", `Priority: ${PRIORITY_HELP}`).option("--pinned", "Pin the note to the top of the panel").option("--source <id>", "Source identifier (e.g. workflow or agent ID)")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57911
57897
  wrapAction(
57912
57898
  "note:create",
57913
57899
  async (options) => {
@@ -57937,7 +57923,7 @@ Note created`));
57937
57923
  );
57938
57924
  }
57939
57925
  function registerNoteList2(program3) {
57940
- program3.command("note:list").description("List notes for a user\n Example: elevasis-sdk note:list --user agent@example.com").requiredOption("--user <email>", "User email to list notes for (required by the external API)").option("--priority <priority>", `Filter by priority: ${PRIORITY_HELP}`).option("--pinned", "Return only pinned notes").option("--limit <n>", "Maximum number of results").option("--offset <n>", "Pagination offset").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
57926
+ withTarget(program3.command("note:list").description("List notes for a user\n Example: elevasis-sdk note:list --user agent@example.com").requiredOption("--user <email>", "User email to list notes for (required by the external API)").option("--priority <priority>", `Filter by priority: ${PRIORITY_HELP}`).option("--pinned", "Return only pinned notes").option("--limit <n>", "Maximum number of results").option("--offset <n>", "Pagination offset")).option("--pretty", "Render human-readable output instead of raw JSON").action(
57941
57927
  wrapAction(
57942
57928
  "note:list",
57943
57929
  async (options) => {
@@ -57986,17 +57972,14 @@ init_wrap_action();
57986
57972
  function getResourceType2(resource) {
57987
57973
  return resource.type ?? resource.resourceType;
57988
57974
  }
57989
- function printJson10(value) {
57990
- console.log(JSON.stringify(value, null, 2));
57991
- }
57992
57975
  function registerAgentList(program3) {
57993
- program3.command("agent:list").description("List deployed agents for your organization").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
57976
+ withTarget(program3.command("agent:list").description("List deployed agents for your organization")).option("--json", "Output as JSON").action(
57994
57977
  wrapAction("agent:list", async (options) => {
57995
57978
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
57996
57979
  const result = await apiGet("/api/external/resources", apiUrl);
57997
57980
  const agents = result.resources.filter((resource) => getResourceType2(resource) === "agent");
57998
57981
  if (options.json) {
57999
- printJson10({ agents, total: agents.length });
57982
+ printJson({ agents, total: agents.length });
58000
57983
  return;
58001
57984
  }
58002
57985
  if (agents.length === 0) {
@@ -58019,12 +58002,12 @@ function registerAgentList(program3) {
58019
58002
  );
58020
58003
  }
58021
58004
  function registerAgentGet(program3) {
58022
- program3.command("agent:get <id>").description("Get full agent metadata and organization model linkage").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58005
+ withTarget(program3.command("agent:get <id>").description("Get full agent metadata and organization model linkage")).option("--json", "Output as JSON").action(
58023
58006
  wrapAction("agent:get", async (id, options) => {
58024
58007
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
58025
58008
  const definition = await apiGet(`/api/external/resources/${id}/definition`, apiUrl);
58026
58009
  if (options.json) {
58027
- printJson10(definition);
58010
+ printJson(definition);
58028
58011
  return;
58029
58012
  }
58030
58013
  const config3 = definition.config ?? {};
@@ -58060,9 +58043,6 @@ init_source();
58060
58043
  init_api_client();
58061
58044
  init_config2();
58062
58045
  init_wrap_action();
58063
- function printJson11(value) {
58064
- console.log(JSON.stringify(value, null, 2));
58065
- }
58066
58046
  function appendQuery9(params, key, value) {
58067
58047
  if (value === void 0 || value === null || value === "") return;
58068
58048
  params.set(key, String(value));
@@ -58160,7 +58140,7 @@ function printMessage(message) {
58160
58140
  }
58161
58141
  }
58162
58142
  function registerSessionCreate(program3) {
58163
- program3.command("session:create <resourceId>").description("Create a multi-turn agent session").option("--user-id <id>", "User ID for the session").option("--metadata <json>", "Session metadata as JSON").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58143
+ withTarget(program3.command("session:create <resourceId>").description("Create a multi-turn agent session").option("--user-id <id>", "User ID for the session").option("--metadata <json>", "Session metadata as JSON")).option("--json", "Output as JSON").action(
58164
58144
  wrapAction("session:create", async (resourceId, options) => {
58165
58145
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
58166
58146
  const body = { resourceId };
@@ -58168,7 +58148,7 @@ function registerSessionCreate(program3) {
58168
58148
  if (options.metadata) body.metadata = parseJson(options.metadata, "--metadata");
58169
58149
  const session = await apiPost("/api/external/sessions", body, apiUrl);
58170
58150
  if (options.json) {
58171
- printJson11(session);
58151
+ printJson(session);
58172
58152
  return;
58173
58153
  }
58174
58154
  console.log(source_default.green(`Created session ${session.sessionId}.`));
@@ -58179,7 +58159,7 @@ function registerSessionCreate(program3) {
58179
58159
  );
58180
58160
  }
58181
58161
  function registerSessionList(program3) {
58182
- program3.command("session:list").description("List multi-turn agent sessions").option("--resource-id <id>", "Filter by agent resource ID").option("--user-id <id>", "Filter by user ID").option("--limit <limit>", "Maximum number of sessions to return").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58162
+ withTarget(program3.command("session:list").description("List multi-turn agent sessions").option("--resource-id <id>", "Filter by agent resource ID").option("--user-id <id>", "Filter by user ID").option("--limit <limit>", "Maximum number of sessions to return")).option("--json", "Output as JSON").action(
58183
58163
  wrapAction("session:list", async (options) => {
58184
58164
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
58185
58165
  const params = new URLSearchParams();
@@ -58188,7 +58168,7 @@ function registerSessionList(program3) {
58188
58168
  appendQuery9(params, "limit", options.limit);
58189
58169
  const result = await apiGet(endpointWithQuery6("/api/external/sessions", params), apiUrl);
58190
58170
  if (options.json) {
58191
- printJson11(result);
58171
+ printJson(result);
58192
58172
  return;
58193
58173
  }
58194
58174
  if (result.sessions.length === 0) {
@@ -58209,12 +58189,12 @@ function registerSessionList(program3) {
58209
58189
  );
58210
58190
  }
58211
58191
  function registerSessionGet(program3) {
58212
- program3.command("session:get <id>").description("Get session details").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58192
+ withTarget(program3.command("session:get <id>").description("Get session details")).option("--json", "Output as JSON").action(
58213
58193
  wrapAction("session:get", async (id, options) => {
58214
58194
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
58215
58195
  const session = await apiGet(`/api/external/sessions/${id}`, apiUrl);
58216
58196
  if (options.json) {
58217
- printJson11(session);
58197
+ printJson(session);
58218
58198
  return;
58219
58199
  }
58220
58200
  console.log(source_default.cyan(`Session: ${session.title ?? session.sessionId}`));
@@ -58230,13 +58210,13 @@ function registerSessionGet(program3) {
58230
58210
  );
58231
58211
  }
58232
58212
  function registerSessionTurn(program3) {
58233
- program3.command("session:turn <id>").description("Execute a turn in an active agent session").option("-i, --input <json>", "Turn input as JSON").option("-f, --input-file <path>", "Read turn input from a JSON file").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58213
+ withTarget(program3.command("session:turn <id>").description("Execute a turn in an active agent session").option("-i, --input <json>", "Turn input as JSON").option("-f, --input-file <path>", "Read turn input from a JSON file")).option("--json", "Output as JSON").action(
58234
58214
  wrapAction("session:turn", async (id, options) => {
58235
58215
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
58236
58216
  const input = resolveTurnInput(options);
58237
58217
  const result = await apiPost(`/api/external/sessions/${id}/turns`, { input }, apiUrl);
58238
58218
  if (options.json) {
58239
- printJson11(result);
58219
+ printJson(result);
58240
58220
  return;
58241
58221
  }
58242
58222
  console.log(source_default.green(`Turn ${result.turnNumber} complete.`));
@@ -58263,12 +58243,12 @@ function registerSessionTurn(program3) {
58263
58243
  );
58264
58244
  }
58265
58245
  function registerSessionMessages(program3) {
58266
- program3.command("session:messages <id>").description("Export session transcript messages").option("--limit <limit>", "Messages per API page").option("--cursor <cursor>", "Message_index cursor to start after").option("--page", "Fetch one API page instead of the full transcript").option("--all", "Fetch all pages (default)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58246
+ withTarget(program3.command("session:messages <id>").description("Export session transcript messages").option("--limit <limit>", "Messages per API page").option("--cursor <cursor>", "Message_index cursor to start after").option("--page", "Fetch one API page instead of the full transcript").option("--all", "Fetch all pages (default)")).option("--json", "Output as JSON").action(
58267
58247
  wrapAction("session:messages", async (id, options) => {
58268
58248
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
58269
58249
  const result = await fetchSessionMessages(id, apiUrl, options);
58270
58250
  if (options.json) {
58271
- printJson11(result);
58251
+ printJson(result);
58272
58252
  return;
58273
58253
  }
58274
58254
  const total = result.total === void 0 ? result.messages.length : result.total;
@@ -58285,7 +58265,7 @@ function registerSessionMessages(program3) {
58285
58265
  );
58286
58266
  }
58287
58267
  function registerSessionEnd(program3) {
58288
- program3.command("session:end <id>").description("End an active agent session").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58268
+ withTarget(program3.command("session:end <id>").description("End an active agent session")).option("--json", "Output as JSON").action(
58289
58269
  wrapAction("session:end", async (id, options) => {
58290
58270
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
58291
58271
  const result = await apiPost(
@@ -58294,7 +58274,7 @@ function registerSessionEnd(program3) {
58294
58274
  apiUrl
58295
58275
  );
58296
58276
  if (options.json) {
58297
- printJson11(result);
58277
+ printJson(result);
58298
58278
  return;
58299
58279
  }
58300
58280
  console.log(source_default.green(`Ended session ${result.sessionId ?? id}.`));
@@ -58317,9 +58297,6 @@ init_source();
58317
58297
  init_api_client();
58318
58298
  init_config2();
58319
58299
  init_wrap_action();
58320
- function printJson12(value) {
58321
- console.log(JSON.stringify(value, null, 2));
58322
- }
58323
58300
  function appendQuery10(params, key, value) {
58324
58301
  if (value === void 0 || value === null || value === "" || value === false) return;
58325
58302
  params.set(key, String(value));
@@ -58381,7 +58358,7 @@ function printGrant(grant) {
58381
58358
  if (grant.disabledAt) console.log(source_default.gray(` Disabled: ${new Date(grant.disabledAt).toLocaleString()}`));
58382
58359
  }
58383
58360
  function registerGrantList(program3) {
58384
- program3.command("grant:list").description("List public/code-gated agent access grants").option("--resource-id <id>", "Filter by agent resource ID").option("--include-disabled", "Include disabled grants").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58361
+ withTarget(program3.command("grant:list").description("List public/code-gated agent access grants").option("--resource-id <id>", "Filter by agent resource ID").option("--include-disabled", "Include disabled grants")).option("--json", "Output as JSON").action(
58385
58362
  wrapAction("grant:list", async (options) => {
58386
58363
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
58387
58364
  const params = new URLSearchParams();
@@ -58392,7 +58369,7 @@ function registerGrantList(program3) {
58392
58369
  apiUrl
58393
58370
  );
58394
58371
  if (options.json) {
58395
- printJson12(result);
58372
+ printJson(result);
58396
58373
  return;
58397
58374
  }
58398
58375
  if (result.grants.length === 0) {
@@ -58408,7 +58385,7 @@ function registerGrantList(program3) {
58408
58385
  );
58409
58386
  }
58410
58387
  function registerGrantCreate(program3) {
58411
- program3.command("grant:create").description("Create a public/code-gated agent access grant").requiredOption("--resource <id>", "Agent resource ID to expose").option("--slug <slug>", "Public slug; defaults to normalized --resource").option("--mode <mode>", "Access mode: public | code", "public").option("--code <code>", "Access code for --mode code").option("--origins <origins>", "Comma-separated allowed origins; omit for any origin").option("--expires-at <iso>", "ISO timestamp when the grant expires").option("--max-turns <number>", "Maximum turns per public session").option("--max-sessions <number>", "Maximum sessions per visitor").option("--branding <json>", "Branding metadata JSON object").option("--capture-fields <json>", "Capture fields JSON array").option("--tool-policy <json>", "Tool policy JSON object").option("--public-base-url <url>", "Client public app base URL for printed public URL").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58388
+ withTarget(program3.command("grant:create").description("Create a public/code-gated agent access grant").requiredOption("--resource <id>", "Agent resource ID to expose").option("--slug <slug>", "Public slug; defaults to normalized --resource").option("--mode <mode>", "Access mode: public | code", "public").option("--code <code>", "Access code for --mode code").option("--origins <origins>", "Comma-separated allowed origins; omit for any origin").option("--expires-at <iso>", "ISO timestamp when the grant expires").option("--max-turns <number>", "Maximum turns per public session").option("--max-sessions <number>", "Maximum sessions per visitor").option("--branding <json>", "Branding metadata JSON object").option("--capture-fields <json>", "Capture fields JSON array").option("--tool-policy <json>", "Tool policy JSON object").option("--public-base-url <url>", "Client public app base URL for printed public URL")).option("--json", "Output as JSON").action(
58412
58389
  wrapAction("grant:create", async (options) => {
58413
58390
  const mode = options.mode ?? "public";
58414
58391
  if (mode !== "public" && mode !== "code") {
@@ -58440,7 +58417,7 @@ function registerGrantCreate(program3) {
58440
58417
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
58441
58418
  const result = await apiPost("/api/external/agent-access-grants", body, apiUrl);
58442
58419
  if (options.json) {
58443
- printJson12(result.grant);
58420
+ printJson(result.grant);
58444
58421
  return;
58445
58422
  }
58446
58423
  console.log(source_default.green(`Created agent access grant ${result.grant.slug}.`));
@@ -58450,7 +58427,7 @@ function registerGrantCreate(program3) {
58450
58427
  );
58451
58428
  }
58452
58429
  function registerGrantUpdate(program3) {
58453
- program3.command("grant:update <slug>").description("Update mutable fields on an existing agent access grant (branding, limits, mode, origins)").option("--mode <mode>", "Access mode: public | code").option("--code <code>", "Access code; required when switching --mode code without an existing code").option("--origins <origins>", "Comma-separated allowed origins (replaces existing)").option("--expires-at <iso>", "ISO timestamp when the grant expires").option("--max-turns <number>", "Maximum turns per public session").option("--max-sessions <number>", "Maximum sessions per visitor").option("--branding <json>", "Branding metadata JSON object (full replace)").option("--capture-fields <json>", "Capture fields JSON array (full replace)").option("--tool-policy <json>", "Tool policy JSON object (full replace)").option("--public-base-url <url>", "Client public app base URL for printed public URL").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58430
+ withTarget(program3.command("grant:update <slug>").description("Update mutable fields on an existing agent access grant (branding, limits, mode, origins)").option("--mode <mode>", "Access mode: public | code").option("--code <code>", "Access code; required when switching --mode code without an existing code").option("--origins <origins>", "Comma-separated allowed origins (replaces existing)").option("--expires-at <iso>", "ISO timestamp when the grant expires").option("--max-turns <number>", "Maximum turns per public session").option("--max-sessions <number>", "Maximum sessions per visitor").option("--branding <json>", "Branding metadata JSON object (full replace)").option("--capture-fields <json>", "Capture fields JSON array (full replace)").option("--tool-policy <json>", "Tool policy JSON object (full replace)").option("--public-base-url <url>", "Client public app base URL for printed public URL")).option("--json", "Output as JSON").action(
58454
58431
  wrapAction("grant:update", async (slug, options) => {
58455
58432
  const body = {};
58456
58433
  if (options.mode !== void 0) {
@@ -58483,7 +58460,7 @@ function registerGrantUpdate(program3) {
58483
58460
  apiUrl
58484
58461
  );
58485
58462
  if (options.json) {
58486
- printJson12(result.grant);
58463
+ printJson(result.grant);
58487
58464
  return;
58488
58465
  }
58489
58466
  console.log(source_default.green(`Updated agent access grant ${result.grant.slug}.`));
@@ -58493,7 +58470,7 @@ function registerGrantUpdate(program3) {
58493
58470
  );
58494
58471
  }
58495
58472
  function registerGrantDisable(program3) {
58496
- program3.command("grant:disable <slug>").description("Disable an agent access grant without deleting it").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
58473
+ withTarget(program3.command("grant:disable <slug>").description("Disable an agent access grant without deleting it")).option("--json", "Output as JSON").action(
58497
58474
  wrapAction("grant:disable", async (slug, options) => {
58498
58475
  const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
58499
58476
  const result = await apiPost(
@@ -58502,7 +58479,7 @@ function registerGrantDisable(program3) {
58502
58479
  apiUrl
58503
58480
  );
58504
58481
  if (options.json) {
58505
- printJson12(result.grant);
58482
+ printJson(result.grant);
58506
58483
  return;
58507
58484
  }
58508
58485
  console.log(source_default.green(`Disabled agent access grant ${result.grant.slug}.`));
@@ -58842,12 +58819,12 @@ function formatOmDoctorReport(report) {
58842
58819
 
58843
58820
  // src/cli/commands/om/doctor.ts
58844
58821
  function registerOmDoctorCommand(program3) {
58845
- program3.command("om:doctor").description(
58822
+ withTarget(program3.command("om:doctor").description(
58846
58823
  "Reduced model doctor \u2014 runs 3 of the platform's 5 checks, plus deployed readiness\n Checks: ontology references, knowledge links, rename-orphan hints\n NOT run (monorepo-only): UI-manifest consistency, contract-ref resolution\n Readiness is read from the deployed snapshot; it reports NOT RUN when offline\n Example: elevasis-sdk om:doctor\n Example: elevasis-sdk om:doctor --scope sales.crm\n Example: elevasis-sdk om:doctor --skip-deployed\n Example: elevasis-sdk om:doctor --require-deployed\n Example: elevasis-sdk om:doctor --json"
58847
58824
  ).option("--json", "Output as grouped JSON envelope").option("--scope <systemPath>", "Limit diagnostics to a system path and descendants").option("--skip-deployed", "Structural checks only \u2014 do not ask the API about readiness").option(
58848
58825
  "--require-deployed",
58849
58826
  "Fail (non-zero exit) if the deployed-snapshot readiness check is unavailable \u2014 API unreachable or no platform key \u2014 instead of the default degraded pass. Opt-in: default behavior is unchanged, and this is rejected together with --skip-deployed."
58850
- ).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(
58827
+ ), { apiUrlDescription: "API URL" }).action(
58851
58828
  wrapAction("om:doctor", async (options) => {
58852
58829
  if (options.requireDeployed && options.skipDeployed) {
58853
58830
  throw new Error("--require-deployed and --skip-deployed are mutually exclusive");
@@ -59659,7 +59636,7 @@ function runPreflight() {
59659
59636
  }
59660
59637
  var envPath = findEnvFile();
59661
59638
  if (envPath) {
59662
- const result = (0, import_dotenv.config)({ path: envPath, override: true });
59639
+ const result = (0, import_dotenv.config)({ path: envPath, override: true, quiet: true });
59663
59640
  if (result.error) {
59664
59641
  console.error(source_default.yellow(`\u26A0 Found .env at ${envPath} but failed to load it: ${result.error.message}`));
59665
59642
  }