nexarch 0.2.2 → 0.2.3
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/commands/init-agent.js +33 -9
- package/dist/lib/mcp.js +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { join } from "path";
|
|
|
4
4
|
import process from "process";
|
|
5
5
|
import { requireCredentials } from "../lib/credentials.js";
|
|
6
6
|
import { callMcpTool, mcpInitialize, mcpListTools } from "../lib/mcp.js";
|
|
7
|
-
const CLI_VERSION = "0.2.
|
|
7
|
+
const CLI_VERSION = "0.2.3";
|
|
8
8
|
const AGENT_ENTITY_TYPE = "agent";
|
|
9
9
|
const TECH_COMPONENT_ENTITY_TYPE = "technology_component";
|
|
10
10
|
function parseFlag(args, flag) {
|
|
@@ -481,14 +481,6 @@ export async function initAgent(args) {
|
|
|
481
481
|
confidence: 0.95,
|
|
482
482
|
attributes: { source: "nexarch-cli-init-agent", kind: "host_os", createdAt: nowIso },
|
|
483
483
|
},
|
|
484
|
-
// Company org is accountable_for the agent
|
|
485
|
-
{
|
|
486
|
-
relationshipTypeCode: "accountable_for",
|
|
487
|
-
fromEntityExternalKey: `org:${creds.companyId}`,
|
|
488
|
-
toEntityExternalKey: agentExternalKey,
|
|
489
|
-
confidence: 1,
|
|
490
|
-
attributes: { source: "nexarch-cli-init-agent", kind: "org_agent", createdAt: nowIso },
|
|
491
|
-
},
|
|
492
484
|
],
|
|
493
485
|
agentContext: {
|
|
494
486
|
agentId,
|
|
@@ -529,6 +521,38 @@ export async function initAgent(args) {
|
|
|
529
521
|
confidence: 1,
|
|
530
522
|
});
|
|
531
523
|
}
|
|
524
|
+
// Wire org → accountable_for → agent as a separate non-fatal call.
|
|
525
|
+
// The org entity is created by the onboarding flow; if it doesn't exist yet, skip silently.
|
|
526
|
+
try {
|
|
527
|
+
await callMcpTool("nexarch_upsert_relationships", {
|
|
528
|
+
relationships: [
|
|
529
|
+
{
|
|
530
|
+
relationshipTypeCode: "accountable_for",
|
|
531
|
+
fromEntityExternalKey: `org:${creds.companyId}`,
|
|
532
|
+
toEntityExternalKey: agentExternalKey,
|
|
533
|
+
confidence: 1,
|
|
534
|
+
attributes: { source: "nexarch-cli-init-agent", kind: "org_agent", createdAt: nowIso },
|
|
535
|
+
},
|
|
536
|
+
],
|
|
537
|
+
agentContext: {
|
|
538
|
+
agentId,
|
|
539
|
+
agentRunId: `${agentRunId}-org-rel`,
|
|
540
|
+
repoRef: "nexarch-cli/init-agent",
|
|
541
|
+
observedAt: nowIso,
|
|
542
|
+
source: "nexarch-cli",
|
|
543
|
+
model: "n/a",
|
|
544
|
+
provider: "n/a",
|
|
545
|
+
},
|
|
546
|
+
policyContext: {
|
|
547
|
+
policyBundleHash: policies.policyBundleHash,
|
|
548
|
+
alignmentSummary: { score: 1, violations: [], waivers: [] },
|
|
549
|
+
},
|
|
550
|
+
dryRun: false,
|
|
551
|
+
}, { companyId: selectedCompanyId });
|
|
552
|
+
}
|
|
553
|
+
catch {
|
|
554
|
+
// non-fatal: org entity may not exist yet
|
|
555
|
+
}
|
|
532
556
|
}
|
|
533
557
|
}
|
|
534
558
|
if (registration.ok && bindToExternalKey) {
|
package/dist/lib/mcp.js
CHANGED
|
@@ -62,7 +62,7 @@ export async function mcpInitialize(options = {}) {
|
|
|
62
62
|
return callMcpRpc("initialize", {
|
|
63
63
|
protocolVersion: "2024-11-05",
|
|
64
64
|
capabilities: {},
|
|
65
|
-
clientInfo: { name: "nexarch-cli", version: "0.2.
|
|
65
|
+
clientInfo: { name: "nexarch-cli", version: "0.2.3" },
|
|
66
66
|
}, options);
|
|
67
67
|
}
|
|
68
68
|
export async function mcpListTools(options = {}) {
|