@elevasis/sdk 1.30.2 → 1.32.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
@@ -37935,6 +37935,7 @@ function buildOmCrossRefIndex(model) {
37935
37935
  systemsById.set(system.id, system);
37936
37936
  }
37937
37937
  const resourceIds = new Set(Object.keys(model.resources ?? {}));
37938
+ const clientIds = new Set(Object.keys(model.clients ?? {}));
37938
37939
  const knowledgeIds = new Set(Object.keys(model.knowledge ?? {}));
37939
37940
  const roleIds = new Set(Object.keys(model.roles ?? {}));
37940
37941
  const goalIds = new Set(Object.keys(model.goals ?? {}));
@@ -37968,6 +37969,7 @@ function buildOmCrossRefIndex(model) {
37968
37969
  return {
37969
37970
  systemsById,
37970
37971
  resourceIds,
37972
+ clientIds,
37971
37973
  knowledgeIds,
37972
37974
  roleIds,
37973
37975
  goalIds,
@@ -37981,6 +37983,7 @@ function buildOmCrossRefIndex(model) {
37981
37983
  }
37982
37984
  function knowledgeTargetExists(index, kind, id) {
37983
37985
  if (kind === "system") return index.systemsById.has(id);
37986
+ if (kind === "client") return index.clientIds.has(id);
37984
37987
  if (kind === "resource") return index.resourceIds.has(id);
37985
37988
  if (kind === "knowledge") return index.knowledgeIds.has(id);
37986
37989
  if (kind === "stage") return index.stageIds.has(id);
@@ -38924,6 +38927,7 @@ var DEFAULT_ORGANIZATION_MODEL_GOALS = {};
38924
38927
  // ../core/src/organization-model/domains/knowledge.ts
38925
38928
  var KnowledgeTargetKindSchema = external_exports.enum([
38926
38929
  "system",
38930
+ "client",
38927
38931
  "resource",
38928
38932
  "knowledge",
38929
38933
  "stage",
@@ -39185,10 +39189,10 @@ function asRoleHolderArray(heldBy) {
39185
39189
  function isKnowledgeKindCompatibleWithTarget(knowledgeKind, targetKind) {
39186
39190
  if (knowledgeKind === "reference") return true;
39187
39191
  if (knowledgeKind === "playbook") {
39188
- return ["system", "resource", "stage", "action", "ontology"].includes(targetKind);
39192
+ return ["system", "client", "resource", "stage", "action", "ontology"].includes(targetKind);
39189
39193
  }
39190
39194
  if (knowledgeKind === "strategy") {
39191
- return ["system", "goal", "offering", "customer-segment", "ontology"].includes(targetKind);
39195
+ return ["system", "client", "goal", "offering", "customer-segment", "ontology"].includes(targetKind);
39192
39196
  }
39193
39197
  return false;
39194
39198
  }
@@ -39717,9 +39721,68 @@ function refineOrganizationModel(model, ctx) {
39717
39721
  }
39718
39722
 
39719
39723
  // ../core/src/organization-model/schema.ts
39724
+ var ClientProfileIdSchema = external_exports.string().uuid();
39725
+ var ClientProfileStatusSchema = external_exports.enum(["active", "onboarding", "paused", "completed", "churned"]);
39726
+ var ClientProfileSourceSchema = external_exports.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/, "Source must use lowercase letters, numbers, and underscores");
39727
+ var ClientProfileIdentitySchema = external_exports.object({
39728
+ organizationName: LabelSchema.optional(),
39729
+ shortName: external_exports.string().trim().min(1).max(40).optional(),
39730
+ clientBrief: external_exports.string().trim().max(4e3).default(""),
39731
+ geographicFocus: external_exports.array(external_exports.string().trim().min(1).max(200)).default([]),
39732
+ timeZone: external_exports.string().trim().min(1).max(100).default("UTC")
39733
+ }).passthrough().default({
39734
+ clientBrief: "",
39735
+ geographicFocus: [],
39736
+ timeZone: "UTC"
39737
+ });
39738
+ var ClientProfileBrandingSchema = external_exports.object({
39739
+ voice: external_exports.string().trim().max(280).optional(),
39740
+ tagline: external_exports.string().trim().max(200).optional(),
39741
+ values: external_exports.array(external_exports.string().trim().min(1).max(100)).default([])
39742
+ }).passthrough().default({
39743
+ values: []
39744
+ });
39745
+ var ClientProfileWorkspaceSchema = external_exports.object({
39746
+ kind: external_exports.enum(["external-project", "internal-project", "none"]).optional(),
39747
+ owner: external_exports.enum(["developer", "client", "platform"]).optional(),
39748
+ projectId: external_exports.string().trim().min(1).max(200).optional(),
39749
+ workspacePath: external_exports.string().trim().min(1).max(500).optional()
39750
+ }).passthrough().default({});
39751
+ var ClientProfileLinksSchema = external_exports.object({
39752
+ projectIds: external_exports.array(external_exports.string().uuid()).default([]),
39753
+ primaryCompanyId: external_exports.string().uuid().optional(),
39754
+ primaryContactId: external_exports.string().uuid().optional(),
39755
+ sourceDealId: external_exports.string().uuid().optional()
39756
+ }).default({
39757
+ projectIds: []
39758
+ });
39759
+ var ClientProfilePromptsSchema = external_exports.object({
39760
+ defaultContext: external_exports.string().trim().max(8e3).default("")
39761
+ }).passthrough().default({
39762
+ defaultContext: ""
39763
+ });
39764
+ var ClientProfileSchema = external_exports.object({
39765
+ id: ClientProfileIdSchema,
39766
+ slug: ModelIdSchema,
39767
+ name: LabelSchema,
39768
+ status: ClientProfileStatusSchema.default("onboarding"),
39769
+ source: ClientProfileSourceSchema.optional(),
39770
+ identity: ClientProfileIdentitySchema,
39771
+ branding: ClientProfileBrandingSchema,
39772
+ workspace: ClientProfileWorkspaceSchema,
39773
+ links: ClientProfileLinksSchema,
39774
+ prompts: ClientProfilePromptsSchema,
39775
+ config: external_exports.record(external_exports.string().trim().min(1).max(200), JsonValueSchema).default({}),
39776
+ customValues: external_exports.record(external_exports.string().trim().min(1).max(200), JsonValueSchema).default({})
39777
+ }).strict();
39778
+ var ClientProfilesDomainSchema = external_exports.record(ClientProfileIdSchema, ClientProfileSchema).refine((record2) => Object.entries(record2).every(([key, entry]) => entry.id === key), {
39779
+ message: "Each client profile id must match its map key"
39780
+ }).default({});
39781
+ var DEFAULT_ORGANIZATION_MODEL_CLIENTS = {};
39720
39782
  var OrganizationModelDomainKeySchema = external_exports.enum([
39721
39783
  "branding",
39722
39784
  "identity",
39785
+ "clients",
39723
39786
  "customers",
39724
39787
  "offerings",
39725
39788
  "roles",
@@ -39740,6 +39803,7 @@ var OrganizationModelDomainMetadataSchema = external_exports.object({
39740
39803
  var DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA = {
39741
39804
  branding: { version: 1, lastModified: "2026-05-10" },
39742
39805
  identity: { version: 1, lastModified: "2026-05-10" },
39806
+ clients: { version: 1, lastModified: "2026-05-30" },
39743
39807
  customers: { version: 1, lastModified: "2026-05-10" },
39744
39808
  offerings: { version: 1, lastModified: "2026-05-10" },
39745
39809
  roles: { version: 1, lastModified: "2026-05-10" },
@@ -39756,6 +39820,7 @@ var DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA = {
39756
39820
  var OrganizationModelDomainMetadataByDomainSchema = external_exports.object({
39757
39821
  branding: OrganizationModelDomainMetadataSchema,
39758
39822
  identity: OrganizationModelDomainMetadataSchema,
39823
+ clients: OrganizationModelDomainMetadataSchema,
39759
39824
  customers: OrganizationModelDomainMetadataSchema,
39760
39825
  offerings: OrganizationModelDomainMetadataSchema,
39761
39826
  roles: OrganizationModelDomainMetadataSchema,
@@ -39771,10 +39836,23 @@ var OrganizationModelDomainMetadataByDomainSchema = external_exports.object({
39771
39836
  }).partial().default(DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA).transform((metadata) => ({ ...DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, ...metadata }));
39772
39837
  var OrganizationModelSchemaBase = external_exports.object({
39773
39838
  version: external_exports.literal(1).default(1),
39839
+ /**
39840
+ * Deterministic SHA-256 hex hash of the full resolved model, excluding this
39841
+ * field itself and volatile domainMetadata.lastModified values.
39842
+ *
39843
+ * Stamped at deploy time by the platform OM assembly and persisted alongside
39844
+ * the snapshot in the DB. Compared at API boot to detect stale deployed
39845
+ * snapshots (primary gate: deploy; secondary backstop: boot).
39846
+ *
39847
+ * Optional — absent on models that predate Step 2 versioning or that have
39848
+ * not been stamped (e.g. tenant partial overrides before re-deploy).
39849
+ */
39850
+ snapshotHash: external_exports.string().optional(),
39774
39851
  domainMetadata: OrganizationModelDomainMetadataByDomainSchema,
39775
39852
  branding: OrganizationModelBrandingSchema.default(DEFAULT_ORGANIZATION_MODEL_BRANDING),
39776
39853
  navigation: OrganizationModelNavigationSchema,
39777
39854
  identity: IdentityDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_IDENTITY),
39855
+ clients: ClientProfilesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_CLIENTS),
39778
39856
  customers: CustomersDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_CUSTOMERS),
39779
39857
  offerings: OfferingsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_OFFERINGS),
39780
39858
  roles: RolesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ROLES),
@@ -39807,6 +39885,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
39807
39885
  branding: DEFAULT_ORGANIZATION_MODEL_BRANDING,
39808
39886
  navigation: DEFAULT_ORGANIZATION_MODEL_NAVIGATION,
39809
39887
  identity: DEFAULT_ORGANIZATION_MODEL_IDENTITY,
39888
+ clients: DEFAULT_ORGANIZATION_MODEL_CLIENTS,
39810
39889
  customers: DEFAULT_ORGANIZATION_MODEL_CUSTOMERS,
39811
39890
  offerings: DEFAULT_ORGANIZATION_MODEL_OFFERINGS,
39812
39891
  roles: DEFAULT_ORGANIZATION_MODEL_ROLES,
@@ -39973,6 +40052,7 @@ function getAllProjectStatuses(model, appliesTo) {
39973
40052
  var OrganizationGraphNodeKindSchema = external_exports.enum([
39974
40053
  "organization",
39975
40054
  "system",
40055
+ "client",
39976
40056
  "role",
39977
40057
  "action",
39978
40058
  "entity",
@@ -40218,6 +40298,22 @@ function buildOrganizationGraph(input) {
40218
40298
  }
40219
40299
  const validSystemRefs = new Set(systemPathByRef.keys());
40220
40300
  const systemNodeId = (systemRef) => nodeId("system", systemPathByRef.get(systemRef) ?? systemRef);
40301
+ for (const client of Object.values(organizationModel.clients).sort((a, b) => a.slug.localeCompare(b.slug))) {
40302
+ const id = nodeId("client", client.id);
40303
+ pushUniqueNode(nodes, nodeIds, {
40304
+ id,
40305
+ kind: "client",
40306
+ label: client.name,
40307
+ sourceId: client.id,
40308
+ description: client.identity.clientBrief || void 0
40309
+ });
40310
+ pushUniqueEdge(edges, edgeIds, {
40311
+ id: edgeId("contains", organizationNode.id, id),
40312
+ kind: "contains",
40313
+ sourceId: organizationNode.id,
40314
+ targetId: id
40315
+ });
40316
+ }
40221
40317
  function topologyNodeId(ref) {
40222
40318
  if (ref.kind === "system") return systemNodeId(ref.id);
40223
40319
  if (ref.kind === "resource") return nodeId("resource", ref.id);
@@ -41585,7 +41681,13 @@ function computeInterfaceReadiness(model, request) {
41585
41681
  `System "${request.systemPath}" is missing.`,
41586
41682
  { ref: request.systemPath }
41587
41683
  );
41588
- return { ready: false, systemPath: request.systemPath, interfaceKey: request.interfaceKey, scopedResourceIds, issues };
41684
+ return {
41685
+ ready: false,
41686
+ systemPath: request.systemPath,
41687
+ interfaceKey: request.interfaceKey,
41688
+ scopedResourceIds,
41689
+ issues
41690
+ };
41589
41691
  }
41590
41692
  if (systemInterface === void 0) {
41591
41693
  addReadinessIssue(
@@ -41595,7 +41697,13 @@ function computeInterfaceReadiness(model, request) {
41595
41697
  `System "${request.systemPath}" does not declare interface "${request.interfaceKey}".`,
41596
41698
  { path: readinessMarkerPath(request) }
41597
41699
  );
41598
- return { ready: false, systemPath: request.systemPath, interfaceKey: request.interfaceKey, scopedResourceIds, issues };
41700
+ return {
41701
+ ready: false,
41702
+ systemPath: request.systemPath,
41703
+ interfaceKey: request.interfaceKey,
41704
+ scopedResourceIds,
41705
+ issues
41706
+ };
41599
41707
  }
41600
41708
  if (systemInterface.lifecycle !== "active") {
41601
41709
  addReadinessIssue(
@@ -45608,7 +45716,7 @@ function wrapAction(commandName, fn) {
45608
45716
  // package.json
45609
45717
  var package_default = {
45610
45718
  name: "@elevasis/sdk",
45611
- version: "1.30.2",
45719
+ version: "1.32.0",
45612
45720
  description: "SDK for building Elevasis organization resources",
45613
45721
  type: "module",
45614
45722
  bin: {
@@ -48381,6 +48489,15 @@ function governedBy(graph, nodeId2) {
48381
48489
  }
48382
48490
  return results;
48383
48491
  }
48492
+ function listAllSystemsFlat(model) {
48493
+ return listAllSystems(model);
48494
+ }
48495
+ function listAllResources(model) {
48496
+ return Object.values(model.resources ?? {}).sort((a, b) => a.id.localeCompare(b.id));
48497
+ }
48498
+ function listAllRoles(model) {
48499
+ return Object.values(model.roles ?? {}).sort((a, b) => a.id.localeCompare(b.id));
48500
+ }
48384
48501
  function parsePath(pathString) {
48385
48502
  if (!pathString || typeof pathString !== "string") {
48386
48503
  throw new Error("parsePath: path must be a non-empty string");
@@ -48431,11 +48548,20 @@ function parsePath(pathString) {
48431
48548
  }
48432
48549
  return { mount: "graph", args: [graphNodeId, verb] };
48433
48550
  }
48551
+ if (first === "all-systems" && rest.length === 0) {
48552
+ return { mount: "all-systems", args: [] };
48553
+ }
48554
+ if (first === "all-resources" && rest.length === 0) {
48555
+ return { mount: "all-resources", args: [] };
48556
+ }
48557
+ if (first === "all-roles" && rest.length === 0) {
48558
+ return { mount: "all-roles", args: [] };
48559
+ }
48434
48560
  if (segments.length === 1) {
48435
48561
  return { mount: "node", args: [first] };
48436
48562
  }
48437
48563
  throw new Error(
48438
- `parsePath: unrecognized path pattern "${pathString}". Supported: /by-system/<id>, /by-kind/<kind>, /by-owner/<id>, /graph/<nodeId>/governs, /graph/<nodeId>/governed-by, /<nodeId>`
48564
+ `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`
48439
48565
  );
48440
48566
  }
48441
48567
  function omSearch(model, query, options = {}) {
@@ -49099,9 +49225,37 @@ async function loadOrgModel(projectRoot) {
49099
49225
  }
49100
49226
 
49101
49227
  // src/cli/commands/knowledge/ls.ts
49228
+ function formatAllSystems(entries) {
49229
+ if (entries.length === 0) return "(no results)";
49230
+ const pathWidth = Math.max(...entries.map((e) => e.path.length), 4);
49231
+ const header = `${"PATH".padEnd(pathWidth)} LABEL`;
49232
+ const divider = "-".repeat(header.length + 20);
49233
+ const rows = entries.map((e) => {
49234
+ const label = e.system.label ?? e.system.title ?? e.path;
49235
+ return `${e.path.padEnd(pathWidth)} ${label}`;
49236
+ });
49237
+ return [header, divider, ...rows].join("\n");
49238
+ }
49239
+ function formatAllResources(resources) {
49240
+ if (resources.length === 0) return "(no results)";
49241
+ const idWidth = Math.max(...resources.map((r) => r.id.length), 4);
49242
+ const kindWidth = Math.max(...resources.map((r) => r.kind.length), 4);
49243
+ const header = `${"ID".padEnd(idWidth)} ${"KIND".padEnd(kindWidth)} TITLE`;
49244
+ const divider = "-".repeat(header.length + 20);
49245
+ const rows = resources.map((r) => `${r.id.padEnd(idWidth)} ${r.kind.padEnd(kindWidth)} ${r.title}`);
49246
+ return [header, divider, ...rows].join("\n");
49247
+ }
49248
+ function formatAllRoles(roles) {
49249
+ if (roles.length === 0) return "(no results)";
49250
+ const idWidth = Math.max(...roles.map((r) => r.id.length), 4);
49251
+ const header = `${"ID".padEnd(idWidth)} TITLE`;
49252
+ const divider = "-".repeat(header.length + 20);
49253
+ const rows = roles.map((r) => `${r.id.padEnd(idWidth)} ${r.title}`);
49254
+ return [header, divider, ...rows].join("\n");
49255
+ }
49102
49256
  function registerKnowledgeLs(program3) {
49103
49257
  program3.command("knowledge:ls <path>").alias("om:ls").description(
49104
- "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"
49258
+ "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"
49105
49259
  ).option("--json", "Print wrapped JSON envelope { path, mount, args, results }").option("--ids-only", "Print one ID per line (for piping)").action(
49106
49260
  wrapAction("knowledge:ls", async (pathArg, options) => {
49107
49261
  let parsed;
@@ -49114,6 +49268,42 @@ function registerKnowledgeLs(program3) {
49114
49268
  }
49115
49269
  const projectRoot = getProjectRoot();
49116
49270
  const model = await loadOrgModel(projectRoot);
49271
+ if (parsed.mount === "all-systems") {
49272
+ const entries = listAllSystemsFlat(model);
49273
+ if (options.json) {
49274
+ process.stdout.write(formatJson({ path: pathArg, parsed, results: entries.map((e) => e.path) }) + "\n");
49275
+ } else if (options.idsOnly) {
49276
+ const out = entries.map((e) => e.path).join("\n");
49277
+ if (out) process.stdout.write(out + "\n");
49278
+ } else {
49279
+ process.stdout.write(formatAllSystems(entries) + "\n");
49280
+ }
49281
+ return;
49282
+ }
49283
+ if (parsed.mount === "all-resources") {
49284
+ const resources = listAllResources(model);
49285
+ if (options.json) {
49286
+ process.stdout.write(formatJson({ path: pathArg, parsed, results: resources.map((r) => r.id) }) + "\n");
49287
+ } else if (options.idsOnly) {
49288
+ const out = resources.map((r) => r.id).join("\n");
49289
+ if (out) process.stdout.write(out + "\n");
49290
+ } else {
49291
+ process.stdout.write(formatAllResources(resources) + "\n");
49292
+ }
49293
+ return;
49294
+ }
49295
+ if (parsed.mount === "all-roles") {
49296
+ const roles = listAllRoles(model);
49297
+ if (options.json) {
49298
+ process.stdout.write(formatJson({ path: pathArg, parsed, results: roles.map((r) => r.id) }) + "\n");
49299
+ } else if (options.idsOnly) {
49300
+ const out = roles.map((r) => r.id).join("\n");
49301
+ if (out) process.stdout.write(out + "\n");
49302
+ } else {
49303
+ process.stdout.write(formatAllRoles(roles) + "\n");
49304
+ }
49305
+ return;
49306
+ }
49117
49307
  const graph = buildOrganizationGraph({ organizationModel: model });
49118
49308
  const knowledgeNodes = Object.values(model.knowledge);
49119
49309
  let results;
@@ -50649,13 +50839,14 @@ function registerAcquisitionCommands(program3) {
50649
50839
  init_source();
50650
50840
  init_config();
50651
50841
  function registerClientCreate(program3) {
50652
- 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-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("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
50842
+ 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("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
50653
50843
  wrapAction(
50654
50844
  "client:create",
50655
50845
  async (options) => {
50656
50846
  const apiUrl = resolveApiUrl(options.apiUrl);
50657
50847
  const body = { name: options.name };
50658
50848
  if (options.status !== void 0) body.status = options.status;
50849
+ if (options.source !== void 0) body.source = options.source;
50659
50850
  if (options.sourceDealId !== void 0) body.sourceDealId = options.sourceDealId;
50660
50851
  if (options.primaryCompanyId !== void 0) body.primaryCompanyId = options.primaryCompanyId;
50661
50852
  if (options.primaryContactId !== void 0) body.primaryContactId = options.primaryContactId;
@@ -50675,7 +50866,7 @@ Client created: ${result.name}`));
50675
50866
  );
50676
50867
  }
50677
50868
  function registerClientUpdate(program3) {
50678
- 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-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("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
50869
+ 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("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
50679
50870
  wrapAction(
50680
50871
  "client:update",
50681
50872
  async (id, options) => {
@@ -50710,6 +50901,7 @@ function registerClientUpdate(program3) {
50710
50901
  const body = {};
50711
50902
  if (options.name !== void 0) body.name = options.name;
50712
50903
  if (options.status !== void 0) body.status = options.status;
50904
+ if (options.source !== void 0) body.source = options.source;
50713
50905
  if (options.clearSourceDeal) {
50714
50906
  body.sourceDealId = null;
50715
50907
  } else if (options.sourceDealId !== void 0) {
@@ -50729,7 +50921,7 @@ function registerClientUpdate(program3) {
50729
50921
  if (Object.keys(body).length === 0) {
50730
50922
  process.stderr.write(
50731
50923
  JSON.stringify({
50732
- error: "At least one field must be provided (--name, --status, --source-deal-id, --clear-source-deal, --primary-company-id, --clear-primary-company, --primary-contact-id, --clear-primary-contact, --metadata)",
50924
+ error: "At least one field must be provided (--name, --status, --source, --source-deal-id, --clear-source-deal, --primary-company-id, --clear-primary-company, --primary-contact-id, --clear-primary-contact, --metadata)",
50733
50925
  code: "MISSING_FIELDS"
50734
50926
  }) + "\n"
50735
50927
  );