nexarch 0.4.5 → 0.4.7

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.
@@ -33,6 +33,7 @@ function parseCsv(value) {
33
33
  export async function agentIdentify(args) {
34
34
  const asJson = parseFlag(args, "--json");
35
35
  const agentId = parseOptionValue(args, "--agent-id") ?? getDefaultAgentId();
36
+ const looksLikeUuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(agentId);
36
37
  const provider = parseOptionValue(args, "--provider");
37
38
  const model = parseOptionValue(args, "--model");
38
39
  const client = parseOptionValue(args, "--client");
@@ -44,6 +45,9 @@ export async function agentIdentify(args) {
44
45
  if (!provider || !model || !client) {
45
46
  throw new Error("agent-identify requires --provider, --model, and --client");
46
47
  }
48
+ if (looksLikeUuid) {
49
+ throw new Error(`agent-identify expects the stable agent id (e.g. nexarch-cli:user@host), not a graph entity UUID (${agentId}). Re-run using --agent-id \"${getDefaultAgentId()}\" or omit --agent-id.`);
50
+ }
47
51
  const creds = requireCredentials();
48
52
  await mcpInitialize({ companyId: creds.companyId });
49
53
  const tools = await mcpListTools({ companyId: creds.companyId });
@@ -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.4.5";
8
+ const CLI_VERSION = "0.4.7";
9
9
  const AGENT_ENTITY_TYPE = "agent";
10
10
  const TECH_COMPONENT_ENTITY_TYPE = "technology_component";
11
11
  function parseFlag(args, flag) {
@@ -12,7 +12,22 @@ export async function setup(args) {
12
12
  await login(args);
13
13
  }
14
14
  requireCredentials(); // ensure login succeeded before continuing
15
- const registry = await fetchAgentRegistryOrThrow();
15
+ let registry;
16
+ try {
17
+ registry = await fetchAgentRegistryOrThrow();
18
+ }
19
+ catch (err) {
20
+ const message = err instanceof Error ? err.message : String(err);
21
+ if (/session has expired|token is invalid, expired, or revoked/i.test(message)) {
22
+ console.log("Session expired. Re-authenticating…\n");
23
+ await login(args);
24
+ requireCredentials();
25
+ registry = await fetchAgentRegistryOrThrow();
26
+ }
27
+ else {
28
+ throw err;
29
+ }
30
+ }
16
31
  console.log(`Using integration registry release v${registry.release.version}.`);
17
32
  console.log("Detecting installed MCP clients…\n");
18
33
  const clients = detectClientsFromRegistry(registry);
@@ -44,6 +44,9 @@ export async function fetchAgentRegistryOrThrow() {
44
44
  }
45
45
  catch (err) {
46
46
  const message = err instanceof Error ? err.message : String(err);
47
+ if (/token is invalid, expired, or revoked/i.test(message)) {
48
+ throw new Error("Your Nexarch session has expired. Run `nexarch login` and then retry `nexarch setup`.");
49
+ }
47
50
  throw new Error(`Nexarch integration registry unavailable. This command is blocked until service is restored. (${message})`);
48
51
  }
49
52
  }
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.4.5" },
71
+ clientInfo: { name: "nexarch-cli", version: "0.4.7" },
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.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "Your architecture workspace for AI delivery.",
5
5
  "keywords": [
6
6
  "nexarch",