nexarch 0.5.4 → 0.5.6

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.
@@ -5,7 +5,7 @@ import process from "process";
5
5
  import { requireCredentials } from "../lib/credentials.js";
6
6
  import { fetchAgentRegistryOrThrow } from "../lib/agent-registry.js";
7
7
  import { callMcpTool, mcpInitialize, mcpListTools } from "../lib/mcp.js";
8
- const CLI_VERSION = "0.5.4";
8
+ const CLI_VERSION = "0.5.6";
9
9
  const AGENT_ENTITY_TYPE = "agent";
10
10
  const TECH_COMPONENT_ENTITY_TYPE = "technology_component";
11
11
  function parseFlag(args, flag) {
@@ -300,6 +300,7 @@ export async function initAgent(args) {
300
300
  const toolNames = new Set(tools.map((t) => t.name));
301
301
  const required = [
302
302
  "nexarch_get_agent_registry",
303
+ "nexarch_get_company_onboarding",
303
304
  "nexarch_get_applied_policies",
304
305
  "nexarch_get_ingest_contract",
305
306
  "nexarch_upsert_entities",
@@ -312,25 +313,32 @@ export async function initAgent(args) {
312
313
  ok: missing.length === 0,
313
314
  detail: missing.length ? `missing: ${missing.join(", ")}` : `required tools present (${required.length})`,
314
315
  });
315
- const policiesRaw = await callMcpTool("nexarch_get_applied_policies", {}, { companyId: selectedCompanyId });
316
- const policies = parseToolText(policiesRaw);
317
- const onboardingReady = Boolean(policies.policyBundleHash);
316
+ const onboardingRaw = await callMcpTool("nexarch_get_company_onboarding", {}, { companyId: selectedCompanyId });
317
+ const onboarding = parseToolText(onboardingRaw);
318
+ const onboardingReady = onboarding.isComplete === true;
318
319
  checks.push({
319
- name: "governance.bootstrap",
320
+ name: "company.onboarding",
320
321
  ok: onboardingReady,
321
- detail: policies.policyBundleHash
322
- ? `policyBundleHash=${policies.policyBundleHash.slice(0, 12)}…`
323
- : "missing policyBundleHash",
322
+ detail: `status=${onboarding.onboardingStatus ?? "unknown"}`,
324
323
  });
325
324
  if (!onboardingReady) {
326
- const onboardingMessage = "Company onboarding is incomplete (missing policy bootstrap). Complete onboarding before running init-agent or init-project.";
325
+ const onboardingMessage = "Company onboarding is incomplete. Complete onboarding before running init-agent or init-project.";
327
326
  if (asJson) {
328
- process.stdout.write(`${JSON.stringify({ ok: false, error: "COMPANY_ONBOARDING_INCOMPLETE", message: onboardingMessage }, null, 2)}\n`);
327
+ process.stdout.write(`${JSON.stringify({ ok: false, error: "COMPANY_ONBOARDING_INCOMPLETE", message: onboardingMessage, onboardingStatus: onboarding.onboardingStatus ?? null }, null, 2)}\n`);
329
328
  process.exitCode = 1;
330
329
  return;
331
330
  }
332
331
  throw new Error(onboardingMessage);
333
332
  }
333
+ const policiesRaw = await callMcpTool("nexarch_get_applied_policies", {}, { companyId: selectedCompanyId });
334
+ const policies = parseToolText(policiesRaw);
335
+ checks.push({
336
+ name: "governance.bootstrap",
337
+ ok: Boolean(policies.policyBundleHash),
338
+ detail: policies.policyBundleHash
339
+ ? `policyBundleHash=${policies.policyBundleHash.slice(0, 12)}…`
340
+ : "missing policyBundleHash",
341
+ });
334
342
  const contractRaw = await callMcpTool("nexarch_get_ingest_contract", {}, { companyId: selectedCompanyId });
335
343
  const contract = parseToolText(contractRaw);
336
344
  checks.push({
@@ -812,14 +812,25 @@ export async function initProject(args) {
812
812
  process.stdout.write(`${JSON.stringify(output, null, 2)}\n`);
813
813
  return;
814
814
  }
815
+ const onboardingRaw = await callMcpTool("nexarch_get_company_onboarding", {}, mcpOpts);
816
+ const onboarding = parseToolText(onboardingRaw);
817
+ if (onboarding.isComplete !== true) {
818
+ const message = "Company onboarding is incomplete. Complete onboarding before running init-project.";
819
+ if (asJson) {
820
+ process.stdout.write(`${JSON.stringify({ ok: false, error: "COMPANY_ONBOARDING_INCOMPLETE", message, onboardingStatus: onboarding.onboardingStatus ?? null }, null, 2)}\n`);
821
+ process.exitCode = 1;
822
+ return;
823
+ }
824
+ throw new Error(message);
825
+ }
815
826
  // Policy bootstrap
816
827
  const policiesRaw = await callMcpTool("nexarch_get_applied_policies", {}, mcpOpts);
817
828
  const policies = parseToolText(policiesRaw);
818
829
  const policyBundleHash = policies.policyBundleHash ?? null;
819
830
  if (!policyBundleHash) {
820
- const message = "Company onboarding is incomplete (missing policy bootstrap). Complete onboarding before running init-project.";
831
+ const message = "Policy bootstrap is missing for this company. Re-run onboarding setup before init-project.";
821
832
  if (asJson) {
822
- process.stdout.write(`${JSON.stringify({ ok: false, error: "COMPANY_ONBOARDING_INCOMPLETE", message }, null, 2)}\n`);
833
+ process.stdout.write(`${JSON.stringify({ ok: false, error: "POLICY_BOOTSTRAP_MISSING", message }, null, 2)}\n`);
823
834
  process.exitCode = 1;
824
835
  return;
825
836
  }
package/dist/lib/mcp.js CHANGED
@@ -68,7 +68,7 @@ export async function mcpInitialize(options = {}) {
68
68
  return callMcpRpc("initialize", {
69
69
  protocolVersion: "2024-11-05",
70
70
  capabilities: {},
71
- clientInfo: { name: "nexarch-cli", version: "0.5.2" },
71
+ clientInfo: { name: "nexarch-cli", version: "0.5.6" },
72
72
  }, options);
73
73
  }
74
74
  export async function mcpListTools(options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexarch",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "Your architecture workspace for AI delivery.",
5
5
  "keywords": [
6
6
  "nexarch",