@elevasis/sdk 1.33.1 → 1.34.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
@@ -7142,14 +7142,14 @@ var require_async_iterator = __commonJS({
7142
7142
  };
7143
7143
  }
7144
7144
  function readAndResolve(iter) {
7145
- var resolve5 = iter[kLastResolve];
7146
- if (resolve5 !== null) {
7145
+ var resolve6 = iter[kLastResolve];
7146
+ if (resolve6 !== null) {
7147
7147
  var data = iter[kStream].read();
7148
7148
  if (data !== null) {
7149
7149
  iter[kLastPromise] = null;
7150
7150
  iter[kLastResolve] = null;
7151
7151
  iter[kLastReject] = null;
7152
- resolve5(createIterResult(data, false));
7152
+ resolve6(createIterResult(data, false));
7153
7153
  }
7154
7154
  }
7155
7155
  }
@@ -7157,13 +7157,13 @@ var require_async_iterator = __commonJS({
7157
7157
  process.nextTick(readAndResolve, iter);
7158
7158
  }
7159
7159
  function wrapForNext(lastPromise, iter) {
7160
- return function(resolve5, reject) {
7160
+ return function(resolve6, reject) {
7161
7161
  lastPromise.then(function() {
7162
7162
  if (iter[kEnded]) {
7163
- resolve5(createIterResult(void 0, true));
7163
+ resolve6(createIterResult(void 0, true));
7164
7164
  return;
7165
7165
  }
7166
- iter[kHandlePromise](resolve5, reject);
7166
+ iter[kHandlePromise](resolve6, reject);
7167
7167
  }, reject);
7168
7168
  };
7169
7169
  }
@@ -7183,12 +7183,12 @@ var require_async_iterator = __commonJS({
7183
7183
  return Promise.resolve(createIterResult(void 0, true));
7184
7184
  }
7185
7185
  if (this[kStream].destroyed) {
7186
- return new Promise(function(resolve5, reject) {
7186
+ return new Promise(function(resolve6, reject) {
7187
7187
  process.nextTick(function() {
7188
7188
  if (_this[kError]) {
7189
7189
  reject(_this[kError]);
7190
7190
  } else {
7191
- resolve5(createIterResult(void 0, true));
7191
+ resolve6(createIterResult(void 0, true));
7192
7192
  }
7193
7193
  });
7194
7194
  });
@@ -7211,13 +7211,13 @@ var require_async_iterator = __commonJS({
7211
7211
  return this;
7212
7212
  }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
7213
7213
  var _this2 = this;
7214
- return new Promise(function(resolve5, reject) {
7214
+ return new Promise(function(resolve6, reject) {
7215
7215
  _this2[kStream].destroy(null, function(err) {
7216
7216
  if (err) {
7217
7217
  reject(err);
7218
7218
  return;
7219
7219
  }
7220
- resolve5(createIterResult(void 0, true));
7220
+ resolve6(createIterResult(void 0, true));
7221
7221
  });
7222
7222
  });
7223
7223
  }), _Object$setPrototypeO), AsyncIteratorPrototype);
@@ -7239,15 +7239,15 @@ var require_async_iterator = __commonJS({
7239
7239
  value: stream._readableState.endEmitted,
7240
7240
  writable: true
7241
7241
  }), _defineProperty(_Object$create, kHandlePromise, {
7242
- value: function value(resolve5, reject) {
7242
+ value: function value(resolve6, reject) {
7243
7243
  var data = iterator[kStream].read();
7244
7244
  if (data) {
7245
7245
  iterator[kLastPromise] = null;
7246
7246
  iterator[kLastResolve] = null;
7247
7247
  iterator[kLastReject] = null;
7248
- resolve5(createIterResult(data, false));
7248
+ resolve6(createIterResult(data, false));
7249
7249
  } else {
7250
- iterator[kLastResolve] = resolve5;
7250
+ iterator[kLastResolve] = resolve6;
7251
7251
  iterator[kLastReject] = reject;
7252
7252
  }
7253
7253
  },
@@ -7266,12 +7266,12 @@ var require_async_iterator = __commonJS({
7266
7266
  iterator[kError] = err;
7267
7267
  return;
7268
7268
  }
7269
- var resolve5 = iterator[kLastResolve];
7270
- if (resolve5 !== null) {
7269
+ var resolve6 = iterator[kLastResolve];
7270
+ if (resolve6 !== null) {
7271
7271
  iterator[kLastPromise] = null;
7272
7272
  iterator[kLastResolve] = null;
7273
7273
  iterator[kLastReject] = null;
7274
- resolve5(createIterResult(void 0, true));
7274
+ resolve6(createIterResult(void 0, true));
7275
7275
  }
7276
7276
  iterator[kEnded] = true;
7277
7277
  });
@@ -7286,7 +7286,7 @@ var require_async_iterator = __commonJS({
7286
7286
  var require_from = __commonJS({
7287
7287
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from.js"(exports2, module2) {
7288
7288
  "use strict";
7289
- function asyncGeneratorStep(gen, resolve5, reject, _next, _throw, key, arg) {
7289
+ function asyncGeneratorStep(gen, resolve6, reject, _next, _throw, key, arg) {
7290
7290
  try {
7291
7291
  var info = gen[key](arg);
7292
7292
  var value = info.value;
@@ -7295,7 +7295,7 @@ var require_from = __commonJS({
7295
7295
  return;
7296
7296
  }
7297
7297
  if (info.done) {
7298
- resolve5(value);
7298
+ resolve6(value);
7299
7299
  } else {
7300
7300
  Promise.resolve(value).then(_next, _throw);
7301
7301
  }
@@ -7303,13 +7303,13 @@ var require_from = __commonJS({
7303
7303
  function _asyncToGenerator(fn) {
7304
7304
  return function() {
7305
7305
  var self2 = this, args = arguments;
7306
- return new Promise(function(resolve5, reject) {
7306
+ return new Promise(function(resolve6, reject) {
7307
7307
  var gen = fn.apply(self2, args);
7308
7308
  function _next(value) {
7309
- asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "next", value);
7309
+ asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "next", value);
7310
7310
  }
7311
7311
  function _throw(err) {
7312
- asyncGeneratorStep(gen, resolve5, reject, _next, _throw, "throw", err);
7312
+ asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "throw", err);
7313
7313
  }
7314
7314
  _next(void 0);
7315
7315
  });
@@ -23629,18 +23629,18 @@ var init_config = __esm({
23629
23629
  // src/cli/commands/om/project-layout.ts
23630
23630
  function assertSplitLayout(projectDir) {
23631
23631
  const omDir = (0, import_node_path9.join)(projectDir, "core", "config", "organization-model");
23632
- const missing = REQUIRED_FILES.filter((f) => !(0, import_node_fs8.existsSync)((0, import_node_path9.join)(omDir, f)));
23632
+ const missing = REQUIRED_FILES.filter((f) => !(0, import_node_fs10.existsSync)((0, import_node_path9.join)(omDir, f)));
23633
23633
  if (missing.length > 0) {
23634
23634
  throw new Error(
23635
23635
  "Legacy single-file OM layout detected. Split into `core/config/organization-model/{profile.ts, systems.ts, navigation.ts}` before scaffolding."
23636
23636
  );
23637
23637
  }
23638
23638
  }
23639
- var import_node_fs8, import_node_path9, REQUIRED_FILES;
23639
+ var import_node_fs10, import_node_path9, REQUIRED_FILES;
23640
23640
  var init_project_layout = __esm({
23641
23641
  "src/cli/commands/om/project-layout.ts"() {
23642
23642
  "use strict";
23643
- import_node_fs8 = require("node:fs");
23643
+ import_node_fs10 = require("node:fs");
23644
23644
  import_node_path9 = require("node:path");
23645
23645
  REQUIRED_FILES = ["profile.ts", "systems.ts", "navigation.ts"];
23646
23646
  }
@@ -23656,11 +23656,11 @@ async function promptIfAbsent(value, question, options) {
23656
23656
  input: process.stdin,
23657
23657
  output: process.stdout
23658
23658
  });
23659
- return new Promise((resolve5) => {
23659
+ return new Promise((resolve6) => {
23660
23660
  const prompt = options?.default ? `${question} [${options.default}]: ` : `${question}: `;
23661
23661
  rl.question(prompt, (answer) => {
23662
23662
  rl.close();
23663
- resolve5(answer.trim() || (options?.default ?? ""));
23663
+ resolve6(answer.trim() || (options?.default ?? ""));
23664
23664
  });
23665
23665
  });
23666
23666
  }
@@ -23741,7 +23741,7 @@ async function withSnapshotRollback(filePaths, op) {
23741
23741
  const snapshots = /* @__PURE__ */ new Map();
23742
23742
  for (const filePath of filePaths) {
23743
23743
  try {
23744
- snapshots.set(filePath, (0, import_node_fs9.readFileSync)(filePath, "utf8"));
23744
+ snapshots.set(filePath, (0, import_node_fs11.readFileSync)(filePath, "utf8"));
23745
23745
  } catch {
23746
23746
  snapshots.set(filePath, null);
23747
23747
  }
@@ -23752,7 +23752,7 @@ async function withSnapshotRollback(filePaths, op) {
23752
23752
  for (const [filePath, snapshot] of snapshots) {
23753
23753
  if (snapshot !== null) {
23754
23754
  try {
23755
- (0, import_node_fs9.writeFileSync)(filePath, snapshot, "utf8");
23755
+ (0, import_node_fs11.writeFileSync)(filePath, snapshot, "utf8");
23756
23756
  } catch {
23757
23757
  }
23758
23758
  }
@@ -23773,14 +23773,14 @@ function insertBeforeAnchorInContent(content, code, anchor) {
23773
23773
  return lines.join("\n");
23774
23774
  }
23775
23775
  async function appendBeforeAnchor(filePath, code, anchor) {
23776
- const content = (0, import_node_fs9.readFileSync)(filePath, "utf8");
23776
+ const content = (0, import_node_fs11.readFileSync)(filePath, "utf8");
23777
23777
  const updated = insertBeforeAnchorInContent(content, code, anchor);
23778
- (0, import_node_fs9.writeFileSync)(filePath, updated, "utf8");
23778
+ (0, import_node_fs11.writeFileSync)(filePath, updated, "utf8");
23779
23779
  }
23780
23780
  async function applyConstImport(systemsFilePath, importLine, fieldLine, importAnchor, fieldAnchor, newConstFilePath, newConstFileCode) {
23781
- (0, import_node_fs9.mkdirSync)((0, import_node_path10.dirname)(newConstFilePath), { recursive: true });
23782
- (0, import_node_fs9.writeFileSync)(newConstFilePath, newConstFileCode, "utf8");
23783
- const systemsContent = (0, import_node_fs9.readFileSync)(systemsFilePath, "utf8");
23781
+ (0, import_node_fs11.mkdirSync)((0, import_node_path10.dirname)(newConstFilePath), { recursive: true });
23782
+ (0, import_node_fs11.writeFileSync)(newConstFilePath, newConstFileCode, "utf8");
23783
+ const systemsContent = (0, import_node_fs11.readFileSync)(systemsFilePath, "utf8");
23784
23784
  const afterImport = insertBeforeAnchorInContent(systemsContent, importLine + "\n", importAnchor);
23785
23785
  const lines = afterImport.split("\n");
23786
23786
  const fieldAnchorIndex = lines.findIndex((line) => fieldAnchor.test(line));
@@ -23790,13 +23790,13 @@ async function applyConstImport(systemsFilePath, importLine, fieldLine, importAn
23790
23790
  );
23791
23791
  }
23792
23792
  lines.splice(fieldAnchorIndex + 1, 0, fieldLine);
23793
- (0, import_node_fs9.writeFileSync)(systemsFilePath, lines.join("\n"), "utf8");
23793
+ (0, import_node_fs11.writeFileSync)(systemsFilePath, lines.join("\n"), "utf8");
23794
23794
  }
23795
- var import_node_fs9, import_node_path10;
23795
+ var import_node_fs11, import_node_path10;
23796
23796
  var init_splice = __esm({
23797
23797
  "src/cli/commands/om/splice.ts"() {
23798
23798
  "use strict";
23799
- import_node_fs9 = require("node:fs");
23799
+ import_node_fs11 = require("node:fs");
23800
23800
  import_node_path10 = require("node:path");
23801
23801
  }
23802
23802
  });
@@ -24168,24 +24168,24 @@ async function scaffoldKnowledge(opts) {
24168
24168
  return;
24169
24169
  }
24170
24170
  const absoluteFilePath = (0, import_node_path14.join)(projectDir, relativeFilePath);
24171
- if ((0, import_node_fs10.existsSync)(absoluteFilePath)) {
24171
+ if ((0, import_node_fs12.existsSync)(absoluteFilePath)) {
24172
24172
  process.stderr.write(
24173
24173
  source_default.red(`Knowledge node file already exists at \`${relativeFilePath}\`. Choose a different id.
24174
24174
  `)
24175
24175
  );
24176
24176
  process.exit(1);
24177
24177
  }
24178
- (0, import_node_fs10.mkdirSync)((0, import_node_path14.join)(projectDir, "core", "config", "knowledge", "nodes"), { recursive: true });
24179
- (0, import_node_fs10.writeFileSync)(absoluteFilePath, content, "utf8");
24178
+ (0, import_node_fs12.mkdirSync)((0, import_node_path14.join)(projectDir, "core", "config", "knowledge", "nodes"), { recursive: true });
24179
+ (0, import_node_fs12.writeFileSync)(absoluteFilePath, content, "utf8");
24180
24180
  console.log(source_default.green(`Knowledge node \`${id}\` written to \`${relativeFilePath}\``));
24181
24181
  console.log(source_default.yellow("Run `elevasis-sdk om:generate` to register this node."));
24182
24182
  }
24183
- var import_node_path14, import_node_fs10, VALID_KINDS;
24183
+ var import_node_path14, import_node_fs12, VALID_KINDS;
24184
24184
  var init_scaffold_knowledge = __esm({
24185
24185
  "src/cli/commands/om/scaffold-knowledge.ts"() {
24186
24186
  "use strict";
24187
24187
  import_node_path14 = require("node:path");
24188
- import_node_fs10 = require("node:fs");
24188
+ import_node_fs12 = require("node:fs");
24189
24189
  init_source();
24190
24190
  init_config();
24191
24191
  init_project_layout();
@@ -24261,7 +24261,7 @@ async function scaffoldFill(opts) {
24261
24261
  process.stderr.write(source_default.red("Missing gaps file. Pass --gaps <path> pointing to a conformance gap JSON file.\n"));
24262
24262
  process.exit(1);
24263
24263
  }
24264
- if (!(0, import_node_fs11.existsSync)(options.gaps)) {
24264
+ if (!(0, import_node_fs13.existsSync)(options.gaps)) {
24265
24265
  process.stderr.write(
24266
24266
  source_default.red(
24267
24267
  `Missing gaps file. Pass --gaps <path> pointing to a conformance gap JSON file.
@@ -24273,7 +24273,7 @@ async function scaffoldFill(opts) {
24273
24273
  }
24274
24274
  let payload;
24275
24275
  try {
24276
- const raw = (0, import_node_fs11.readFileSync)(options.gaps, "utf8");
24276
+ const raw = (0, import_node_fs13.readFileSync)(options.gaps, "utf8");
24277
24277
  payload = JSON.parse(raw);
24278
24278
  } catch {
24279
24279
  process.stderr.write(
@@ -24394,7 +24394,7 @@ async function scaffoldFill(opts) {
24394
24394
  }
24395
24395
  if (skippedGaps.length > 0) {
24396
24396
  const skippedPath = options.skipped ?? (0, import_node_path15.join)(os2.tmpdir(), `elevasis-fill-skipped-${systemPath}-${Date.now()}.json`);
24397
- (0, import_node_fs11.writeFileSync)(skippedPath, JSON.stringify({ systemPath, skipped: skippedGaps }, null, 2), "utf8");
24397
+ (0, import_node_fs13.writeFileSync)(skippedPath, JSON.stringify({ systemPath, skipped: skippedGaps }, null, 2), "utf8");
24398
24398
  console.log(
24399
24399
  source_default.yellow(
24400
24400
  `Partial fill: ${appliedGaps.length} gap(s) applied, ${skippedGaps.length} skipped \u2014 see \`${skippedPath}\` for fields requiring manual input.`
@@ -24408,13 +24408,13 @@ async function scaffoldFill(opts) {
24408
24408
  )
24409
24409
  );
24410
24410
  }
24411
- var import_node_path15, os2, import_node_fs11, import_node_child_process5;
24411
+ var import_node_path15, os2, import_node_fs13, import_node_child_process5;
24412
24412
  var init_scaffold_fill = __esm({
24413
24413
  "src/cli/commands/om/scaffold-fill.ts"() {
24414
24414
  "use strict";
24415
24415
  import_node_path15 = require("node:path");
24416
24416
  os2 = __toESM(require("node:os"), 1);
24417
- import_node_fs11 = require("node:fs");
24417
+ import_node_fs13 = require("node:fs");
24418
24418
  import_node_child_process5 = require("node:child_process");
24419
24419
  init_source();
24420
24420
  init_config();
@@ -37533,16 +37533,13 @@ var OntologyKindSchema = external_exports.enum([
37533
37533
  "value-type",
37534
37534
  "property",
37535
37535
  "group",
37536
- "surface"
37536
+ "endpoint"
37537
37537
  ]);
37538
37538
  var SYSTEM_PATH_PATTERN = "[a-z0-9][a-z0-9-]*(?:\\.[a-z0-9][a-z0-9-]*)*";
37539
37539
  var LOCAL_ID_PATTERN = "[a-z0-9][a-z0-9._-]*";
37540
37540
  var ONTOLOGY_ID_PATTERN = `^(global|${SYSTEM_PATH_PATTERN}):(${OntologyKindSchema.options.join("|")})\\/(${LOCAL_ID_PATTERN})$`;
37541
37541
  var ONTOLOGY_ID_REGEX = new RegExp(ONTOLOGY_ID_PATTERN);
37542
- var OntologyIdSchema = external_exports.string().trim().min(1).max(300).regex(
37543
- ONTOLOGY_ID_REGEX,
37544
- "Ontology IDs must use <system-path>:<kind>/<local-id> or global:<kind>/<local-id>"
37545
- );
37542
+ var OntologyIdSchema = external_exports.string().trim().min(1).max(300).regex(ONTOLOGY_ID_REGEX, "Ontology IDs must use <system-path>:<kind>/<local-id> or global:<kind>/<local-id>");
37546
37543
  function parseOntologyId(id) {
37547
37544
  const normalized = OntologyIdSchema.parse(id);
37548
37545
  const match = ONTOLOGY_ID_REGEX.exec(normalized);
@@ -37605,7 +37602,7 @@ var OntologySharedPropertySchema = OntologyRecordBaseSchema.extend({
37605
37602
  var OntologyGroupSchema = OntologyRecordBaseSchema.extend({
37606
37603
  members: OntologyReferenceListSchema
37607
37604
  });
37608
- var OntologySurfaceTypeSchema = OntologyRecordBaseSchema.extend({
37605
+ var OntologyEndpointTypeSchema = OntologyRecordBaseSchema.extend({
37609
37606
  route: external_exports.string().trim().min(1).max(500).optional()
37610
37607
  });
37611
37608
  var OntologyScopeSchema = external_exports.object({
@@ -37618,7 +37615,7 @@ var OntologyScopeSchema = external_exports.object({
37618
37615
  valueTypes: external_exports.record(OntologyIdSchema, OntologyValueTypeSchema).default({}).optional(),
37619
37616
  sharedProperties: external_exports.record(OntologyIdSchema, OntologySharedPropertySchema).default({}).optional(),
37620
37617
  groups: external_exports.record(OntologyIdSchema, OntologyGroupSchema).default({}).optional(),
37621
- surfaces: external_exports.record(OntologyIdSchema, OntologySurfaceTypeSchema).default({}).optional()
37618
+ endpoints: external_exports.record(OntologyIdSchema, OntologyEndpointTypeSchema).default({}).optional()
37622
37619
  }).default({});
37623
37620
  var DEFAULT_ONTOLOGY_SCOPE = {
37624
37621
  valueTypes: {
@@ -37654,7 +37651,7 @@ var SCOPE_KIND = {
37654
37651
  valueTypes: "value-type",
37655
37652
  sharedProperties: "property",
37656
37653
  groups: "group",
37657
- surfaces: "surface"
37654
+ endpoints: "endpoint"
37658
37655
  };
37659
37656
  var SCOPE_KEYS = Object.keys(SCOPE_KIND);
37660
37657
  function ontologyGraphNodeId(id) {
@@ -37690,7 +37687,7 @@ function createEmptyIndex() {
37690
37687
  valueTypes: {},
37691
37688
  sharedProperties: {},
37692
37689
  groups: {},
37693
- surfaces: {}
37690
+ endpoints: {}
37694
37691
  };
37695
37692
  }
37696
37693
  function sortResolvedOntologyIndex(index) {
@@ -37923,7 +37920,7 @@ var ONTOLOGY_REFERENCE_KEY_KINDS = {
37923
37920
  interfaceType: "interface",
37924
37921
  propertyType: "property",
37925
37922
  groupType: "group",
37926
- surfaceType: "surface",
37923
+ endpointType: "endpoint",
37927
37924
  stepCatalog: "catalog"
37928
37925
  };
37929
37926
  var omCompilationContextCache = /* @__PURE__ */ new WeakMap();
@@ -37951,7 +37948,7 @@ function buildOmCrossRefIndexFromOntology(model, ontologyCompilation) {
37951
37948
  "value-type": ontologyCompilation.ontology.valueTypes,
37952
37949
  property: ontologyCompilation.ontology.sharedProperties,
37953
37950
  group: ontologyCompilation.ontology.groups,
37954
- surface: ontologyCompilation.ontology.surfaces
37951
+ endpoint: ontologyCompilation.ontology.endpoints
37955
37952
  };
37956
37953
  const ontologyIds = new Set(Object.values(ontologyIndexByKind).flatMap((index) => Object.keys(index)));
37957
37954
  const stageIds = /* @__PURE__ */ new Set();
@@ -41873,8 +41870,8 @@ function ontologyIndexForKind(index, kind) {
41873
41870
  return index.sharedProperties;
41874
41871
  case "group":
41875
41872
  return index.groups;
41876
- case "surface":
41877
- return index.surfaces;
41873
+ case "endpoint":
41874
+ return index.endpoints;
41878
41875
  }
41879
41876
  }
41880
41877
  function sameJson(left, right) {
@@ -45734,7 +45731,7 @@ function wrapAction(commandName, fn) {
45734
45731
  // package.json
45735
45732
  var package_default = {
45736
45733
  name: "@elevasis/sdk",
45737
- version: "1.33.1",
45734
+ version: "1.34.0",
45738
45735
  description: "SDK for building Elevasis organization resources",
45739
45736
  type: "module",
45740
45737
  bin: {
@@ -46577,7 +46574,7 @@ async function pollForCompletion(resourceId, executionId, apiUrl) {
46577
46574
  if (interrupted) {
46578
46575
  return;
46579
46576
  }
46580
- await new Promise((resolve5) => setTimeout(resolve5, POLL_INTERVAL_MS));
46577
+ await new Promise((resolve6) => setTimeout(resolve6, POLL_INTERVAL_MS));
46581
46578
  if (interrupted) {
46582
46579
  return;
46583
46580
  }
@@ -47213,10 +47210,10 @@ init_source();
47213
47210
  var import_readline = require("readline");
47214
47211
  function confirm(message) {
47215
47212
  const rl = (0, import_readline.createInterface)({ input: process.stdin, output: process.stdout });
47216
- return new Promise((resolve5) => {
47213
+ return new Promise((resolve6) => {
47217
47214
  rl.question(message, (answer) => {
47218
47215
  rl.close();
47219
- resolve5(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
47216
+ resolve6(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
47220
47217
  });
47221
47218
  });
47222
47219
  }
@@ -47970,8 +47967,28 @@ Project ${id} deleted.`));
47970
47967
  }
47971
47968
 
47972
47969
  // src/cli/commands/project/milestones.ts
47970
+ var import_node_fs3 = require("node:fs");
47973
47971
  init_source();
47974
47972
  init_config();
47973
+ function parseChecklistOption(options) {
47974
+ if (options.checklist !== void 0 && options.checklistFile !== void 0) {
47975
+ process.stderr.write(
47976
+ JSON.stringify({
47977
+ error: "Provide only one of --checklist or --checklist-file",
47978
+ code: "CONFLICTING_FLAGS"
47979
+ }) + "\n"
47980
+ );
47981
+ process.exit(1);
47982
+ }
47983
+ const raw = options.checklistFile !== void 0 ? (0, import_node_fs3.readFileSync)(resolveProjectRelative(options.checklistFile), "utf8") : options.checklist;
47984
+ if (raw === void 0) return void 0;
47985
+ try {
47986
+ return JSON.parse(raw);
47987
+ } catch {
47988
+ process.stderr.write(JSON.stringify({ error: "Checklist must be valid JSON", code: "INVALID_JSON" }) + "\n");
47989
+ process.exit(1);
47990
+ }
47991
+ }
47975
47992
  function registerMilestoneList(program3) {
47976
47993
  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("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
47977
47994
  wrapAction("project:milestone:list", async (options) => {
@@ -48031,7 +48048,10 @@ Milestone created: ${m.name}`));
48031
48048
  );
48032
48049
  }
48033
48050
  function registerMilestoneUpdate(program3) {
48034
- 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("--checklist <json>", `Replace checklist (full array): '[{"id":"1","label":"Step","completed":false}]'`).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
48051
+ 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("--checklist <json>", `Replace checklist (full array): '[{"id":"1","label":"Step","completed":false}]'`).option(
48052
+ "--checklist-file <path>",
48053
+ "Read replacement checklist from a JSON file. Relative paths resolve against the project root."
48054
+ ).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
48035
48055
  wrapAction(
48036
48056
  "project:milestone:update",
48037
48057
  async (id, options) => {
@@ -48040,20 +48060,12 @@ function registerMilestoneUpdate(program3) {
48040
48060
  if (options.status !== void 0) body.status = options.status;
48041
48061
  if (options.description !== void 0) body.description = options.description;
48042
48062
  if (options.dueDate !== void 0) body.due_date = options.dueDate;
48043
- if (options.checklist !== void 0) {
48044
- try {
48045
- body.checklist = JSON.parse(options.checklist);
48046
- } catch {
48047
- process.stderr.write(
48048
- JSON.stringify({ error: "--checklist must be valid JSON", code: "INVALID_JSON" }) + "\n"
48049
- );
48050
- process.exit(1);
48051
- }
48052
- }
48063
+ const checklist = parseChecklistOption(options);
48064
+ if (checklist !== void 0) body.checklist = checklist;
48053
48065
  if (Object.keys(body).length === 0) {
48054
48066
  process.stderr.write(
48055
48067
  JSON.stringify({
48056
- error: "At least one field must be provided (--name, --status, --description, --due-date, --checklist)",
48068
+ error: "At least one field must be provided (--name, --status, --description, --due-date, --checklist, --checklist-file)",
48057
48069
  code: "MISSING_FIELDS"
48058
48070
  }) + "\n"
48059
48071
  );
@@ -48091,8 +48103,28 @@ Milestone ${id} deleted.`));
48091
48103
  }
48092
48104
 
48093
48105
  // src/cli/commands/project/tasks.ts
48106
+ var import_node_fs4 = require("node:fs");
48094
48107
  init_source();
48095
48108
  init_config();
48109
+ function parseChecklistOption2(options) {
48110
+ if (options.checklist !== void 0 && options.checklistFile !== void 0) {
48111
+ process.stderr.write(
48112
+ JSON.stringify({
48113
+ error: "Provide only one of --checklist or --checklist-file",
48114
+ code: "CONFLICTING_FLAGS"
48115
+ }) + "\n"
48116
+ );
48117
+ process.exit(1);
48118
+ }
48119
+ const raw = options.checklistFile !== void 0 ? (0, import_node_fs4.readFileSync)(resolveProjectRelative(options.checklistFile), "utf8") : options.checklist;
48120
+ if (raw === void 0) return void 0;
48121
+ try {
48122
+ return JSON.parse(raw);
48123
+ } catch {
48124
+ process.stderr.write(JSON.stringify({ error: "Checklist must be valid JSON", code: "INVALID_JSON" }) + "\n");
48125
+ process.exit(1);
48126
+ }
48127
+ }
48096
48128
  function registerTaskList(program3) {
48097
48129
  program3.command("project:task:list").description(
48098
48130
  "List tasks for a project\n Example: elevasis-sdk project:task:list --project <uuid> --status in_progress"
@@ -48160,7 +48192,10 @@ function registerTaskCreate(program3) {
48160
48192
  ).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--title <title>", "Task title / name").option("--status <status>", "Status: planned | in_progress | blocked | completed | cancelled").option(
48161
48193
  "--type <type>",
48162
48194
  "Type: documentation | code | report | design | refactor | feature | bug | research | other"
48163
- ).option("--milestone <milestone-id>", "Milestone ID (UUID)").option("--parent <parent-task-id>", "Parent task ID (UUID) for subtasks").option("--description <description>", "Task description").option("--checklist <json>", `Checklist items as JSON array: '[{"id":"1","label":"Step","completed":false}]'`).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
48195
+ ).option("--milestone <milestone-id>", "Milestone ID (UUID)").option("--parent <parent-task-id>", "Parent task ID (UUID) for subtasks").option("--description <description>", "Task description").option("--checklist <json>", `Checklist items as JSON array: '[{"id":"1","label":"Step","completed":false}]'`).option(
48196
+ "--checklist-file <path>",
48197
+ "Read checklist items from a JSON file. Relative paths resolve against the project root."
48198
+ ).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
48164
48199
  wrapAction(
48165
48200
  "project:task:create",
48166
48201
  async (options) => {
@@ -48173,16 +48208,8 @@ function registerTaskCreate(program3) {
48173
48208
  if (options.milestone) body.milestone_id = options.milestone;
48174
48209
  if (options.parent) body.parent_task_id = options.parent;
48175
48210
  if (options.description) body.description = options.description;
48176
- if (options.checklist) {
48177
- try {
48178
- body.checklist = JSON.parse(options.checklist);
48179
- } catch {
48180
- process.stderr.write(
48181
- JSON.stringify({ error: "--checklist must be valid JSON", code: "INVALID_JSON" }) + "\n"
48182
- );
48183
- process.exit(1);
48184
- }
48185
- }
48211
+ const checklist = parseChecklistOption2(options);
48212
+ if (checklist !== void 0) body.checklist = checklist;
48186
48213
  const apiUrl = resolveApiUrl(options.apiUrl);
48187
48214
  const result = await apiPost("/api/external/project-tasks", body, apiUrl);
48188
48215
  if (options.pretty) {
@@ -48203,7 +48230,10 @@ function registerTaskUpdate(program3) {
48203
48230
  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(
48204
48231
  "--status <status>",
48205
48232
  "New status: planned | in_progress | blocked | completed | cancelled | submitted | approved | rejected | revision_requested"
48206
- ).option("--milestone <milestone-id>", "New milestone ID (UUID)").option("--description <description>", "New description").option("--checklist <json>", `Replace checklist (full array): '[{"id":"1","label":"Step","completed":false}]'`).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
48233
+ ).option("--milestone <milestone-id>", "New milestone ID (UUID)").option("--description <description>", "New description").option("--checklist <json>", `Replace checklist (full array): '[{"id":"1","label":"Step","completed":false}]'`).option(
48234
+ "--checklist-file <path>",
48235
+ "Read replacement checklist from a JSON file. Relative paths resolve against the project root."
48236
+ ).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
48207
48237
  wrapAction(
48208
48238
  "project:task:update",
48209
48239
  async (id, options) => {
@@ -48212,20 +48242,12 @@ function registerTaskUpdate(program3) {
48212
48242
  if (options.status !== void 0) body.status = options.status;
48213
48243
  if (options.milestone !== void 0) body.milestone_id = options.milestone;
48214
48244
  if (options.description !== void 0) body.description = options.description;
48215
- if (options.checklist !== void 0) {
48216
- try {
48217
- body.checklist = JSON.parse(options.checklist);
48218
- } catch {
48219
- process.stderr.write(
48220
- JSON.stringify({ error: "--checklist must be valid JSON", code: "INVALID_JSON" }) + "\n"
48221
- );
48222
- process.exit(1);
48223
- }
48224
- }
48245
+ const checklist = parseChecklistOption2(options);
48246
+ if (checklist !== void 0) body.checklist = checklist;
48225
48247
  if (Object.keys(body).length === 0) {
48226
48248
  process.stderr.write(
48227
48249
  JSON.stringify({
48228
- error: "At least one field must be provided (--title, --status, --milestone, --description, --checklist)",
48250
+ error: "At least one field must be provided (--title, --status, --milestone, --description, --checklist, --checklist-file)",
48229
48251
  code: "MISSING_FIELDS"
48230
48252
  }) + "\n"
48231
48253
  );
@@ -48652,6 +48674,15 @@ function registerProjectCommands(program3) {
48652
48674
  }
48653
48675
 
48654
48676
  // ../core/src/knowledge/queries.ts
48677
+ var DOMAIN_ITEM_KINDS = ["clients", "roles", "policies", "customers", "offerings", "goals"];
48678
+ var BARE_PREFIX_TO_DOMAIN = {
48679
+ client: "clients",
48680
+ role: "roles",
48681
+ policy: "policies",
48682
+ customer: "customers",
48683
+ offering: "offerings",
48684
+ goal: "goals"
48685
+ };
48655
48686
  function toGraphNodeId(omNodeId) {
48656
48687
  return `knowledge:${omNodeId}`;
48657
48688
  }
@@ -48800,11 +48831,32 @@ function parsePath(pathString) {
48800
48831
  if (first === "all-roles" && rest.length === 0) {
48801
48832
  return { mount: "all-roles", args: [] };
48802
48833
  }
48834
+ if (first === "by-domain") {
48835
+ if (rest.length === 0) {
48836
+ throw new Error(`parsePath: /by-domain requires a domain argument, got: "${pathString}"`);
48837
+ }
48838
+ const domain2 = rest[0];
48839
+ if (!DOMAIN_ITEM_KINDS.includes(domain2)) {
48840
+ throw new Error(`parsePath: /by-domain unknown domain "${domain2}". Supported: ${DOMAIN_ITEM_KINDS.join(", ")}`);
48841
+ }
48842
+ return { mount: "by-domain", args: [domain2] };
48843
+ }
48844
+ if (first === "by-item") {
48845
+ if (rest.length < 2) {
48846
+ throw new Error(`parsePath: /by-item requires <domain>/<itemId>, got: "${pathString}"`);
48847
+ }
48848
+ const domain2 = rest[0];
48849
+ if (!DOMAIN_ITEM_KINDS.includes(domain2)) {
48850
+ throw new Error(`parsePath: /by-item unknown domain "${domain2}". Supported: ${DOMAIN_ITEM_KINDS.join(", ")}`);
48851
+ }
48852
+ const itemId = rest.slice(1).join("/");
48853
+ return { mount: "by-item", args: [domain2, itemId] };
48854
+ }
48803
48855
  if (segments.length === 1) {
48804
48856
  return { mount: "node", args: [first] };
48805
48857
  }
48806
48858
  throw new Error(
48807
- `parsePath: unrecognized path pattern "${pathString}". Supported: /by-system/<id>, /by-kind/<kind>, /by-owner/<id>, /graph/<nodeId>/governs, /graph/<nodeId>/governed-by, /<nodeId>, /all-systems, /all-resources, /all-roles`
48859
+ `parsePath: unrecognized path pattern "${pathString}". Supported: /by-system/<id>, /by-kind/<kind>, /by-owner/<id>, /by-domain/<domain>, /by-item/<domain>/<itemId>, /graph/<nodeId>/governs, /graph/<nodeId>/governed-by, /<nodeId>, /all-systems, /all-resources, /all-roles`
48808
48860
  );
48809
48861
  }
48810
48862
  function omSearch(model, query, options = {}) {
@@ -48989,7 +49041,7 @@ function collectOntologyEntries(scope) {
48989
49041
  ["value-type", scope.valueTypes],
48990
49042
  ["property", scope.sharedProperties],
48991
49043
  ["group", scope.groups],
48992
- ["surface", scope.surfaces]
49044
+ ["endpoint", scope.endpoints]
48993
49045
  ];
48994
49046
  for (const [subKind, records] of buckets) {
48995
49047
  if (!records) continue;
@@ -49013,12 +49065,26 @@ function collectOntologyEntries(scope) {
49013
49065
  return entries;
49014
49066
  }
49015
49067
  function detectKind(model, id) {
49016
- if (/:(object|action|event|catalog|link|interface|value-type|property|group|surface)\//.test(id)) {
49068
+ if (/:(object|action|event|catalog|link|interface|value-type|property|group|endpoint)\//.test(id)) {
49017
49069
  return "ontology";
49018
49070
  }
49019
49071
  if (id.startsWith("knowledge.")) return "knowledge";
49020
49072
  if (id.startsWith("role.")) return "role";
49021
49073
  if (id.startsWith("policy.")) return "policy";
49074
+ if (id.startsWith("item:")) {
49075
+ const afterItem = id.slice("item:".length);
49076
+ const colonIdx = afterItem.indexOf(":");
49077
+ if (colonIdx > 0) {
49078
+ const domain2 = afterItem.slice(0, colonIdx);
49079
+ if (DOMAIN_ITEM_KINDS.includes(domain2)) return "domain-item";
49080
+ }
49081
+ return void 0;
49082
+ }
49083
+ const firstColon = id.indexOf(":");
49084
+ if (firstColon > 0) {
49085
+ const prefix = id.slice(0, firstColon);
49086
+ if (prefix in BARE_PREFIX_TO_DOMAIN) return "domain-item";
49087
+ }
49022
49088
  if (model.systems && getSystemByPath(model.systems, id)) return "system";
49023
49089
  if (model.resources?.[id]) return "resource";
49024
49090
  return void 0;
@@ -49051,6 +49117,8 @@ function omDescribe(model, id) {
49051
49117
  return describeRole(model, id);
49052
49118
  case "policy":
49053
49119
  return describePolicy(model, id);
49120
+ case "domain-item":
49121
+ return describeDomainItem(model, id);
49054
49122
  }
49055
49123
  }
49056
49124
  function describeSystem(model, path3) {
@@ -49087,7 +49155,7 @@ function describeSystem(model, path3) {
49087
49155
  ["value-type", ontology.valueTypes],
49088
49156
  ["property", ontology.sharedProperties],
49089
49157
  ["group", ontology.groups],
49090
- ["surface", ontology.surfaces]
49158
+ ["endpoint", ontology.endpoints]
49091
49159
  ];
49092
49160
  for (const [k, records] of buckets) {
49093
49161
  const count = records ? Object.keys(records).length : 0;
@@ -49165,7 +49233,7 @@ function describeOntology(model, id) {
49165
49233
  ["value-type", "valueTypes"],
49166
49234
  ["property", "sharedProperties"],
49167
49235
  ["group", "groups"],
49168
- ["surface", "surfaces"]
49236
+ ["endpoint", "endpoints"]
49169
49237
  ];
49170
49238
  const bucketKey = buckets.find((b) => b[0] === ontologyKind)?.[1];
49171
49239
  if (!bucketKey) return void 0;
@@ -49226,6 +49294,77 @@ function describePolicy(model, id) {
49226
49294
  effectKinds: (policy.actions ?? []).map((a) => a.kind)
49227
49295
  };
49228
49296
  }
49297
+ var DOMAIN_LABEL = {
49298
+ clients: "Clients",
49299
+ roles: "Roles",
49300
+ policies: "Policies",
49301
+ customers: "Customers",
49302
+ offerings: "Offerings",
49303
+ goals: "Goals"
49304
+ };
49305
+ var DOMAIN_GRAPH_PREFIX = {
49306
+ clients: "client",
49307
+ roles: "role",
49308
+ policies: "policy",
49309
+ customers: "customer-segment",
49310
+ offerings: "offering",
49311
+ goals: "goal"
49312
+ };
49313
+ function parseDomainItemRef(id) {
49314
+ if (id.startsWith("item:")) {
49315
+ const afterItem = id.slice("item:".length);
49316
+ const colonIdx = afterItem.indexOf(":");
49317
+ if (colonIdx <= 0) return void 0;
49318
+ const domain3 = afterItem.slice(0, colonIdx);
49319
+ const itemId2 = afterItem.slice(colonIdx + 1);
49320
+ if (!DOMAIN_ITEM_KINDS.includes(domain3) || !itemId2) return void 0;
49321
+ return { domain: domain3, itemId: itemId2 };
49322
+ }
49323
+ const firstColon = id.indexOf(":");
49324
+ if (firstColon <= 0) return void 0;
49325
+ const prefix = id.slice(0, firstColon);
49326
+ const domain2 = BARE_PREFIX_TO_DOMAIN[prefix];
49327
+ if (!domain2) return void 0;
49328
+ const itemId = id.slice(firstColon + 1);
49329
+ if (!itemId) return void 0;
49330
+ return { domain: domain2, itemId };
49331
+ }
49332
+ function describeDomainItem(model, id) {
49333
+ const parsed = parseDomainItemRef(id);
49334
+ if (!parsed) return void 0;
49335
+ const { domain: domain2, itemId } = parsed;
49336
+ const collection = model[domain2];
49337
+ const record2 = collection?.[itemId];
49338
+ if (!record2) return void 0;
49339
+ const name = domain2 === "clients" ? String(record2["name"] ?? itemId) : domain2 === "roles" ? String(record2["title"] ?? itemId) : domain2 === "policies" ? String(record2["label"] ?? itemId) : domain2 === "goals" ? String(record2["description"] ?? itemId) : String(record2["name"] ?? itemId);
49340
+ const graphNodeId = `${DOMAIN_GRAPH_PREFIX[domain2]}:${itemId}`;
49341
+ const containsParentIds = ["organization-model"];
49342
+ const governingKnowledge = [];
49343
+ for (const node of Object.values(model.knowledge ?? {})) {
49344
+ const governs2 = (node.links ?? []).some((link) => link.nodeId === graphNodeId);
49345
+ if (governs2) {
49346
+ governingKnowledge.push({
49347
+ id: node.id,
49348
+ title: node.title,
49349
+ knowledgeKind: node.kind
49350
+ });
49351
+ }
49352
+ }
49353
+ const canonicalId = `item:${domain2}:${itemId}`;
49354
+ return {
49355
+ kind: "domain-item",
49356
+ id: canonicalId,
49357
+ domain: domain2,
49358
+ name,
49359
+ location: {
49360
+ domainLabel: DOMAIN_LABEL[domain2],
49361
+ graphNodeId,
49362
+ containsParentIds
49363
+ },
49364
+ record: record2,
49365
+ governingKnowledge
49366
+ };
49367
+ }
49229
49368
 
49230
49369
  // ../core/src/knowledge/format.ts
49231
49370
  function formatText(results) {
@@ -49287,6 +49426,8 @@ function formatOmDescribe(result) {
49287
49426
  return formatRoleDescribe(result);
49288
49427
  case "policy":
49289
49428
  return formatPolicyDescribe(result);
49429
+ case "domain-item":
49430
+ return formatDomainItemDescribe(result);
49290
49431
  }
49291
49432
  }
49292
49433
  function section(title, body) {
@@ -49409,6 +49550,31 @@ function formatPolicyDescribe(r) {
49409
49550
  ${appliesLines.join("\n")}` : "";
49410
49551
  return join5([header, effectSection, appliesSection]);
49411
49552
  }
49553
+ function formatDomainItemDescribe(r) {
49554
+ const header = join5([
49555
+ `Domain Item: ${r.id}`,
49556
+ [
49557
+ field("Domain", r.location.domainLabel),
49558
+ field("Name", r.name),
49559
+ field("Graph node", r.location.graphNodeId),
49560
+ field("Parent nodes", r.location.containsParentIds.join(", "))
49561
+ ].filter((s) => s.length > 0).join("\n")
49562
+ ]);
49563
+ const recordLines = [];
49564
+ for (const [k, v] of Object.entries(r.record)) {
49565
+ if (v === void 0 || v === null) continue;
49566
+ if (typeof v === "object" && !Array.isArray(v) && Object.keys(v).length === 0) continue;
49567
+ const display = Array.isArray(v) ? v.length === 0 ? null : `[${v.slice(0, 5).join(", ")}${v.length > 5 ? `, ...+${v.length - 5}` : ""}]` : typeof v === "object" ? JSON.stringify(v).slice(0, 120) : String(v);
49568
+ if (display === null) continue;
49569
+ recordLines.push(` ${k}: ${display}`);
49570
+ }
49571
+ const recordSection = recordLines.length ? `Record:
49572
+ ${recordLines.join("\n")}` : "";
49573
+ const govLines = r.governingKnowledge.map((g) => ` - ${g.id} [${g.knowledgeKind}] ${g.title}`);
49574
+ const govSection = govLines.length ? `Governing knowledge:
49575
+ ${govLines.join("\n")}` : "Governing knowledge:\n (none)";
49576
+ return join5([header, recordSection, govSection]);
49577
+ }
49412
49578
 
49413
49579
  // ../core/src/knowledge/cli-helpers.ts
49414
49580
  var OM_SEARCH_HIT_KINDS = ["system", "resource", "knowledge", "ontology", "role", "policy"];
@@ -49619,7 +49785,7 @@ async function loadOrgModel(projectRoot) {
49619
49785
  // src/cli/commands/knowledge/ls.ts
49620
49786
  function registerKnowledgeLs(program3) {
49621
49787
  program3.command("knowledge:ls <path>").alias("om:ls").description(
49622
- "List knowledge nodes for a Knowledge Map path\n Examples:\n elevasis-sdk om:ls /by-kind/playbook\n elevasis-sdk om:ls /by-system/sales.crm\n elevasis-sdk om:ls /by-ontology/sales.crm:object/deal\n elevasis-sdk om:ls /by-owner/role.ops-lead\n elevasis-sdk om:ls /graph/knowledge.outreach-playbook/governs\n elevasis-sdk om:ls /graph/system:sales.crm/governed-by\n elevasis-sdk om:ls /all-systems\n elevasis-sdk om:ls /all-resources\n elevasis-sdk om:ls /all-roles"
49788
+ "List knowledge nodes for a Knowledge Map path\n Examples:\n elevasis-sdk om:ls /by-kind/playbook\n elevasis-sdk om:ls /by-system/sales.crm\n elevasis-sdk om:ls /by-ontology/sales.crm:object/deal\n elevasis-sdk om:ls /by-owner/role.ops-lead\n elevasis-sdk om:ls /graph/knowledge.outreach-playbook/governs\n elevasis-sdk om:ls /graph/system:sales.crm/governed-by\n elevasis-sdk om:ls /all-systems\n elevasis-sdk om:ls /all-resources\n elevasis-sdk om:ls /all-roles\n elevasis-sdk om:ls /by-domain/clients\n elevasis-sdk om:ls /by-item/clients/<uuid>"
49623
49789
  ).option("--json", "Print wrapped JSON envelope { path, mount, args, results }").option("--ids-only", "Print one ID per line (for piping)").action(
49624
49790
  wrapAction("knowledge:ls", async (pathArg, options) => {
49625
49791
  let parsed;
@@ -49668,6 +49834,49 @@ function registerKnowledgeLs(program3) {
49668
49834
  }
49669
49835
  return;
49670
49836
  }
49837
+ if (parsed.mount === "by-domain") {
49838
+ const domain2 = parsed.args[0];
49839
+ const collection = model[domain2] ?? {};
49840
+ const ids = Object.keys(collection).map((id) => `item:${domain2}:${id}`);
49841
+ if (options.json) {
49842
+ process.stdout.write(formatJson({ path: pathArg, parsed, results: ids }) + "\n");
49843
+ } else if (options.idsOnly) {
49844
+ if (ids.length > 0) process.stdout.write(ids.join("\n") + "\n");
49845
+ } else {
49846
+ if (ids.length === 0) {
49847
+ process.stdout.write(`(no items in domain "${domain2}")
49848
+ `);
49849
+ } else {
49850
+ process.stdout.write(`Domain: ${domain2} (${ids.length} item${ids.length === 1 ? "" : "s"})
49851
+ `);
49852
+ for (const id of ids) process.stdout.write(` ${id}
49853
+ `);
49854
+ }
49855
+ }
49856
+ return;
49857
+ }
49858
+ if (parsed.mount === "by-item") {
49859
+ const domain2 = parsed.args[0];
49860
+ const itemId = parsed.args[1];
49861
+ const canonicalId = `item:${domain2}:${itemId}`;
49862
+ const result = omDescribe(model, canonicalId);
49863
+ if (!result) {
49864
+ process.stderr.write(
49865
+ `knowledge:ls: no item found for "${canonicalId}".
49866
+ Use om:ls /by-domain/${domain2} to list all items in this domain.
49867
+ `
49868
+ );
49869
+ process.exit(1);
49870
+ }
49871
+ if (options.json) {
49872
+ process.stdout.write(JSON.stringify(result, null, 2) + "\n");
49873
+ } else if (options.idsOnly) {
49874
+ process.stdout.write(result.id + "\n");
49875
+ } else {
49876
+ process.stdout.write(formatOmDescribe(result) + "\n");
49877
+ }
49878
+ return;
49879
+ }
49671
49880
  const graph = buildOrganizationGraph({ organizationModel: model });
49672
49881
  const knowledgeNodes = Object.values(model.knowledge);
49673
49882
  let results;
@@ -49841,11 +50050,11 @@ function registerKnowledgeSkills(program3) {
49841
50050
  }
49842
50051
 
49843
50052
  // src/cli/commands/knowledge/generate.ts
49844
- var import_node_fs4 = require("node:fs");
50053
+ var import_node_fs6 = require("node:fs");
49845
50054
  var import_node_path5 = require("node:path");
49846
50055
 
49847
50056
  // src/knowledge-codegen.ts
49848
- var import_node_fs3 = require("node:fs");
50057
+ var import_node_fs5 = require("node:fs");
49849
50058
  var import_node_path4 = require("node:path");
49850
50059
  function targetFromNodeId2(nodeId2) {
49851
50060
  const [kind, ...idParts] = nodeId2.split(":");
@@ -49864,7 +50073,7 @@ function canonicalizeKnowledgeNodeLinks(node) {
49864
50073
  };
49865
50074
  }
49866
50075
  function listMdxFiles(directory) {
49867
- return (0, import_node_fs3.readdirSync)(directory, { withFileTypes: true }).flatMap((entry) => {
50076
+ return (0, import_node_fs5.readdirSync)(directory, { withFileTypes: true }).flatMap((entry) => {
49868
50077
  const path3 = (0, import_node_path4.join)(directory, entry.name);
49869
50078
  if (entry.isDirectory()) return listMdxFiles(path3);
49870
50079
  return entry.isFile() && (0, import_node_path4.extname)(entry.name) === ".mdx" ? [path3] : [];
@@ -50062,7 +50271,7 @@ function readCommandForNode(node, cliCommand = "elevasis") {
50062
50271
  ];
50063
50272
  }
50064
50273
  function readKnowledgeNodeMdx(filePath) {
50065
- const raw = (0, import_node_fs3.readFileSync)(filePath, "utf8");
50274
+ const raw = (0, import_node_fs5.readFileSync)(filePath, "utf8");
50066
50275
  const { frontmatter, body } = parseFrontmatter(raw, filePath);
50067
50276
  return {
50068
50277
  id: assertString(frontmatter, "id", filePath),
@@ -50177,8 +50386,8 @@ function generateKnowledgeNodes(options) {
50177
50386
  if (ids.has(node.id)) throw new Error(`[knowledge-node-codegen] Duplicate knowledge node id: ${node.id}`);
50178
50387
  ids.add(node.id);
50179
50388
  }
50180
- (0, import_node_fs3.mkdirSync)((0, import_node_path4.dirname)(options.outputPath), { recursive: true });
50181
- (0, import_node_fs3.writeFileSync)(
50389
+ (0, import_node_fs5.mkdirSync)((0, import_node_path4.dirname)(options.outputPath), { recursive: true });
50390
+ (0, import_node_fs5.writeFileSync)(
50182
50391
  options.outputPath,
50183
50392
  generateKnowledgeNodesTs({
50184
50393
  nodes,
@@ -50189,8 +50398,8 @@ function generateKnowledgeNodes(options) {
50189
50398
  "utf8"
50190
50399
  );
50191
50400
  if (options.knowledgeFlagsOutputPath) {
50192
- (0, import_node_fs3.mkdirSync)((0, import_node_path4.dirname)(options.knowledgeFlagsOutputPath), { recursive: true });
50193
- (0, import_node_fs3.writeFileSync)(
50401
+ (0, import_node_fs5.mkdirSync)((0, import_node_path4.dirname)(options.knowledgeFlagsOutputPath), { recursive: true });
50402
+ (0, import_node_fs5.writeFileSync)(
50194
50403
  options.knowledgeFlagsOutputPath,
50195
50404
  `${JSON.stringify(
50196
50405
  generateKnowledgeFlagRegistry(nodes, sourcePaths, {
@@ -50228,7 +50437,7 @@ function registerKnowledgeGenerate(program3) {
50228
50437
  projectRoot,
50229
50438
  options.flagsOutput ?? ".claude/registries/knowledge-flags.json"
50230
50439
  );
50231
- if (!(0, import_node_fs4.existsSync)(sourceDir)) {
50440
+ if (!(0, import_node_fs6.existsSync)(sourceDir)) {
50232
50441
  process.stderr.write(`knowledge:generate: source directory not found: ${sourceDir}
50233
50442
  `);
50234
50443
  process.exitCode = 1;
@@ -50280,7 +50489,7 @@ function registerKnowledgeSearch(program3) {
50280
50489
  init_config();
50281
50490
  function registerKnowledgeDescribe(program3) {
50282
50491
  program3.command("knowledge:describe <nodeId>").alias("om:describe").description(
50283
- "Show a structured neighborhood view for any OM node id\n (system, resource, knowledge, ontology, role, policy \u2014 auto-detected from id shape)\n Example: elevasis-sdk om:describe sales.lead-gen\n Example: elevasis-sdk om:describe knowledge.outreach-playbook"
50492
+ "Show a structured neighborhood view for any OM node id\n (system, resource, knowledge, ontology, role, policy, domain-item \u2014 auto-detected)\n Domain items: item:<domain>:<id> OR bare client:<uuid>, role:<id>, etc.\n Example: elevasis-sdk om:describe sales.lead-gen\n Example: elevasis-sdk om:describe knowledge.outreach-playbook\n Example: elevasis-sdk om:describe item:clients:<uuid>\n Example: elevasis-sdk om:describe client:<uuid> (back-compat bare form)\n Note: for portfolio/DB data (deals, lineage) use client:get <id> instead."
50284
50493
  ).option("--json", "Print as JSON").action(
50285
50494
  wrapAction("knowledge:describe", async (nodeId2, options) => {
50286
50495
  const projectRoot = getProjectRoot();
@@ -50288,7 +50497,11 @@ function registerKnowledgeDescribe(program3) {
50288
50497
  const result = omDescribe(model, nodeId2);
50289
50498
  if (!result) {
50290
50499
  process.stderr.write(
50291
- `knowledge:describe: no OM node found for id "${nodeId2}". Use knowledge:search (alias: om:search) to discover nodes by keyword.
50500
+ `knowledge:describe: no OM node found for id "${nodeId2}".
50501
+ - For domain items use: om:describe item:<domain>:<id> (domains: clients, roles, policies, customers, offerings, goals)
50502
+ - Bare forms also work: om:describe client:<uuid>, om:describe role:<id>, etc.
50503
+ - To find nodes by keyword: om:search <keyword>
50504
+ - To list all items in a domain: om:ls /by-domain/<domain>
50292
50505
  `
50293
50506
  );
50294
50507
  process.exit(1);
@@ -50314,7 +50527,7 @@ function registerKnowledgeCommands(program3) {
50314
50527
  }
50315
50528
 
50316
50529
  // src/cli/commands/request/request.ts
50317
- var import_node_fs5 = require("node:fs");
50530
+ var import_node_fs7 = require("node:fs");
50318
50531
  var import_node_path6 = require("node:path");
50319
50532
  init_source();
50320
50533
  init_config();
@@ -50379,7 +50592,7 @@ function registerRequestCommands(program3) {
50379
50592
  throw new Error("Provide --input <json> or --input-file <path>");
50380
50593
  }
50381
50594
  const resolvedInputFile = options.inputFile ? resolveProjectRelative(options.inputFile) : void 0;
50382
- const raw = resolvedInputFile ? JSON.parse((0, import_node_fs5.readFileSync)(resolvedInputFile, "utf8")) : JSON.parse(options.input);
50595
+ const raw = resolvedInputFile ? JSON.parse((0, import_node_fs7.readFileSync)(resolvedInputFile, "utf8")) : JSON.parse(options.input);
50383
50596
  const parsed = CreateRequestInputSchema.safeParse(raw);
50384
50597
  if (!parsed.success) {
50385
50598
  const issues = parsed.error.issues.map((i) => ` - ${i.path.join(".") || "(root)"}: ${i.message}`).join("\n");
@@ -50403,7 +50616,7 @@ ${issues}`);
50403
50616
  const tmpDir = (0, import_node_path6.join)(getProjectRoot(), "tmp");
50404
50617
  if (resolvedInputFile.startsWith(tmpDir + "/") || resolvedInputFile.startsWith(tmpDir + "\\")) {
50405
50618
  try {
50406
- (0, import_node_fs5.unlinkSync)(resolvedInputFile);
50619
+ (0, import_node_fs7.unlinkSync)(resolvedInputFile);
50407
50620
  } catch {
50408
50621
  }
50409
50622
  } else {
@@ -50472,7 +50685,7 @@ ${rows.length} request${rows.length === 1 ? "" : "s"}`));
50472
50685
 
50473
50686
  // src/cli/commands/ui/ui-switcher.ts
50474
50687
  var import_node_child_process = require("node:child_process");
50475
- var import_node_fs6 = __toESM(require("node:fs"), 1);
50688
+ var import_node_fs8 = __toESM(require("node:fs"), 1);
50476
50689
  var import_node_path7 = __toESM(require("node:path"), 1);
50477
50690
  init_config();
50478
50691
  function run(command, args, cwd) {
@@ -50483,10 +50696,10 @@ function run(command, args, cwd) {
50483
50696
  });
50484
50697
  }
50485
50698
  function readJson(filePath) {
50486
- return JSON.parse(import_node_fs6.default.readFileSync(filePath, "utf8"));
50699
+ return JSON.parse(import_node_fs8.default.readFileSync(filePath, "utf8"));
50487
50700
  }
50488
50701
  function writeJson(filePath, value) {
50489
- import_node_fs6.default.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}
50702
+ import_node_fs8.default.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}
50490
50703
  `);
50491
50704
  }
50492
50705
  function requireDependencies(packageJson, filePath) {
@@ -50497,7 +50710,7 @@ function requireDependencies(packageJson, filePath) {
50497
50710
  }
50498
50711
  function resolveExistingDir(label, dir) {
50499
50712
  const resolved = import_node_path7.default.resolve(dir);
50500
- if (!import_node_fs6.default.existsSync(resolved) || !import_node_fs6.default.statSync(resolved).isDirectory()) {
50713
+ if (!import_node_fs8.default.existsSync(resolved) || !import_node_fs8.default.statSync(resolved).isDirectory()) {
50501
50714
  throw new Error(`${label} not found: ${resolved}`);
50502
50715
  }
50503
50716
  return resolved;
@@ -50505,7 +50718,7 @@ function resolveExistingDir(label, dir) {
50505
50718
  function findRepoRootFromProject(projectRoot) {
50506
50719
  let dir = projectRoot;
50507
50720
  while (true) {
50508
- if (import_node_fs6.default.existsSync(import_node_path7.default.join(dir, "packages", "ui", "package.json"))) return dir;
50721
+ if (import_node_fs8.default.existsSync(import_node_path7.default.join(dir, "packages", "ui", "package.json"))) return dir;
50509
50722
  const parent = import_node_path7.default.dirname(dir);
50510
50723
  if (parent === dir) return null;
50511
50724
  dir = parent;
@@ -50522,10 +50735,10 @@ function resolveUiPackageRoot(projectRoot, explicitRoot) {
50522
50735
  return import_node_path7.default.join(repoRoot, "packages", "ui");
50523
50736
  }
50524
50737
  function removeLocalUiTarballs(templateTmpDir) {
50525
- if (!import_node_fs6.default.existsSync(templateTmpDir)) return;
50526
- for (const entry of import_node_fs6.default.readdirSync(templateTmpDir)) {
50738
+ if (!import_node_fs8.default.existsSync(templateTmpDir)) return;
50739
+ for (const entry of import_node_fs8.default.readdirSync(templateTmpDir)) {
50527
50740
  if (entry.startsWith("elevasis-ui-") && entry.endsWith(".tgz")) {
50528
- import_node_fs6.default.rmSync(import_node_path7.default.join(templateTmpDir, entry), { force: true });
50741
+ import_node_fs8.default.rmSync(import_node_path7.default.join(templateTmpDir, entry), { force: true });
50529
50742
  }
50530
50743
  }
50531
50744
  }
@@ -50550,24 +50763,24 @@ function useLocalUi(options = {}) {
50550
50763
  const templateTmpDir = import_node_path7.default.join(projectRoot, "tmp");
50551
50764
  const uiPackageJsonPath = import_node_path7.default.join(uiPackageRoot, "package.json");
50552
50765
  const uiPackageBackupPath = import_node_path7.default.join(uiPackageRoot, "package.json.local-pack.bak");
50553
- if (!import_node_fs6.default.existsSync(templateUiPackageJsonPath)) {
50766
+ if (!import_node_fs8.default.existsSync(templateUiPackageJsonPath)) {
50554
50767
  throw new Error(`Template UI package.json not found: ${templateUiPackageJsonPath}`);
50555
50768
  }
50556
- import_node_fs6.default.mkdirSync(templateTmpDir, { recursive: true });
50769
+ import_node_fs8.default.mkdirSync(templateTmpDir, { recursive: true });
50557
50770
  removeLocalUiTarballs(templateTmpDir);
50558
50771
  run("pnpm", ["--filter", "@repo/ui", "build:publish"], commandRoot);
50559
50772
  try {
50560
- const raw = import_node_fs6.default.readFileSync(uiPackageJsonPath, "utf8");
50561
- import_node_fs6.default.writeFileSync(uiPackageBackupPath, raw);
50773
+ const raw = import_node_fs8.default.readFileSync(uiPackageJsonPath, "utf8");
50774
+ import_node_fs8.default.writeFileSync(uiPackageBackupPath, raw);
50562
50775
  writeJson(uiPackageJsonPath, prepareUiPackageForPack(JSON.parse(raw)));
50563
50776
  run("pnpm", ["-C", uiPackageRoot, "pack", "--pack-destination", templateTmpDir], commandRoot);
50564
50777
  } finally {
50565
- if (import_node_fs6.default.existsSync(uiPackageBackupPath)) {
50566
- import_node_fs6.default.copyFileSync(uiPackageBackupPath, uiPackageJsonPath);
50567
- import_node_fs6.default.rmSync(uiPackageBackupPath, { force: true });
50778
+ if (import_node_fs8.default.existsSync(uiPackageBackupPath)) {
50779
+ import_node_fs8.default.copyFileSync(uiPackageBackupPath, uiPackageJsonPath);
50780
+ import_node_fs8.default.rmSync(uiPackageBackupPath, { force: true });
50568
50781
  }
50569
50782
  }
50570
- const tarballName = import_node_fs6.default.readdirSync(templateTmpDir).find((entry) => entry.startsWith("elevasis-ui-") && entry.endsWith(".tgz"));
50783
+ const tarballName = import_node_fs8.default.readdirSync(templateTmpDir).find((entry) => entry.startsWith("elevasis-ui-") && entry.endsWith(".tgz"));
50571
50784
  if (!tarballName) {
50572
50785
  throw new Error(`Failed to create local @elevasis/ui tarball in ${templateTmpDir}`);
50573
50786
  }
@@ -50588,7 +50801,7 @@ function usePublishedUi(options = {}) {
50588
50801
  if (!uiVersion) {
50589
50802
  throw new Error("Could not determine @elevasis/ui version. Pass --version <version>.");
50590
50803
  }
50591
- if (!import_node_fs6.default.existsSync(templateUiPackageJsonPath)) {
50804
+ if (!import_node_fs8.default.existsSync(templateUiPackageJsonPath)) {
50592
50805
  throw new Error(`Template UI package.json not found: ${templateUiPackageJsonPath}`);
50593
50806
  }
50594
50807
  const templateUiPackageJson = readJson(templateUiPackageJsonPath);
@@ -50614,7 +50827,7 @@ function registerUiCommands(program3) {
50614
50827
  }
50615
50828
 
50616
50829
  // src/cli/commands/doctor.ts
50617
- var import_node_fs7 = require("node:fs");
50830
+ var import_node_fs9 = require("node:fs");
50618
50831
  var import_node_path8 = __toESM(require("node:path"), 1);
50619
50832
  init_source();
50620
50833
  init_config();
@@ -50654,7 +50867,7 @@ function registerDoctorCommand(program3) {
50654
50867
  process.exit(1);
50655
50868
  }
50656
50869
  const envPath2 = import_node_path8.default.join(projectRoot, ".env");
50657
- const envExists = (0, import_node_fs7.existsSync)(envPath2);
50870
+ const envExists = (0, import_node_fs9.existsSync)(envPath2);
50658
50871
  if (!envExists) {
50659
50872
  fail(".env", `Not found at ${envPath2}. Create it from .env.example and fill in ELEVASIS_PLATFORM_KEY.`);
50660
50873
  if (isVerbose) verbose(`Checked: ${envPath2}`);
@@ -51877,6 +52090,52 @@ function registerSkillScaffoldCommand(program3) {
51877
52090
  );
51878
52091
  }
51879
52092
 
52093
+ // src/cli/json-file-argv.ts
52094
+ var import_node_fs14 = require("node:fs");
52095
+ var import_node_path16 = require("node:path");
52096
+ init_config();
52097
+ var JSON_FILE_PREFIX = "@json:";
52098
+ var JsonFileArgError = class extends Error {
52099
+ constructor(message, code) {
52100
+ super(message);
52101
+ this.code = code;
52102
+ this.name = "JsonFileArgError";
52103
+ }
52104
+ };
52105
+ function resolveJsonFilePath(path3, options) {
52106
+ if (path3.trim() === "") {
52107
+ throw new JsonFileArgError("@json: requires a file path", "EMPTY_JSON_FILE_REF");
52108
+ }
52109
+ if ((0, import_node_path16.isAbsolute)(path3)) return path3;
52110
+ const cwd = options.cwd ?? process.cwd();
52111
+ const projectRoot = (options.findProjectRoot ?? tryFindProjectRoot)(cwd);
52112
+ return (0, import_node_path16.resolve)(projectRoot ?? cwd, path3);
52113
+ }
52114
+ function readJsonFileReference(ref, options) {
52115
+ const relativeOrAbsolutePath = ref.slice(JSON_FILE_PREFIX.length);
52116
+ const resolvedPath = resolveJsonFilePath(relativeOrAbsolutePath, options);
52117
+ const raw = (options.readFile ?? ((path3) => (0, import_node_fs14.readFileSync)(path3, "utf8")))(resolvedPath);
52118
+ try {
52119
+ JSON.parse(raw);
52120
+ } catch {
52121
+ throw new JsonFileArgError(`@json file must contain valid JSON: ${relativeOrAbsolutePath}`, "INVALID_JSON_FILE");
52122
+ }
52123
+ return raw;
52124
+ }
52125
+ function expandArg(arg, options) {
52126
+ if (arg.startsWith(JSON_FILE_PREFIX)) {
52127
+ return readJsonFileReference(arg, options);
52128
+ }
52129
+ const equalsRefIndex = arg.indexOf(`=${JSON_FILE_PREFIX}`);
52130
+ if (equalsRefIndex === -1) return arg;
52131
+ const prefix = arg.slice(0, equalsRefIndex + 1);
52132
+ const ref = arg.slice(equalsRefIndex + 1);
52133
+ return `${prefix}${readJsonFileReference(ref, options)}`;
52134
+ }
52135
+ function expandJsonFileArgs(args, options = {}) {
52136
+ return args.map((arg) => expandArg(arg, options));
52137
+ }
52138
+
51880
52139
  // src/cli/index.ts
51881
52140
  init_config();
51882
52141
  var PREFLIGHT_SKIP_FLAGS = /* @__PURE__ */ new Set(["--help", "-h", "--version", "-V"]);
@@ -52012,7 +52271,15 @@ registerCliCatalogCommand(program2);
52012
52271
  registerOmScaffoldCommands(program2);
52013
52272
  registerSkillScaffoldCommand(program2);
52014
52273
  registerSkillCheckCoverageCommand(program2);
52015
- program2.parse();
52274
+ try {
52275
+ program2.parse(expandJsonFileArgs(process.argv), { from: "node" });
52276
+ } catch (error46) {
52277
+ if (error46 instanceof JsonFileArgError) {
52278
+ process.stderr.write(JSON.stringify({ error: error46.message, code: error46.code }) + "\n");
52279
+ process.exit(1);
52280
+ }
52281
+ throw error46;
52282
+ }
52016
52283
  // Annotate the CommonJS export names for ESM import in node:
52017
52284
  0 && (module.exports = {
52018
52285
  getProjectRoot