nexarch 0.2.1 → 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.
|
@@ -190,9 +190,9 @@ export async function agentIdentify(args) {
|
|
|
190
190
|
confidence: 1,
|
|
191
191
|
},
|
|
192
192
|
{
|
|
193
|
-
relationshipTypeCode: "
|
|
193
|
+
relationshipTypeCode: "offers",
|
|
194
194
|
fromEntityExternalKey: providerExternalKey,
|
|
195
|
-
toEntityExternalKey:
|
|
195
|
+
toEntityExternalKey: modelExternalKey,
|
|
196
196
|
confidence: 1,
|
|
197
197
|
},
|
|
198
198
|
];
|
|
@@ -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) {
|
|
@@ -521,6 +521,38 @@ export async function initAgent(args) {
|
|
|
521
521
|
confidence: 1,
|
|
522
522
|
});
|
|
523
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
|
+
}
|
|
524
556
|
}
|
|
525
557
|
}
|
|
526
558
|
if (registration.ok && bindToExternalKey) {
|
|
@@ -718,6 +718,15 @@ export async function initProject(args) {
|
|
|
718
718
|
addRel(pickRelationshipType(r.entityTypeCode, sp.entityType), sp.externalKey, r.canonicalExternalRef);
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
+
// Company org is accountable_for the top-level project entity
|
|
722
|
+
const orgExternalKey = `org:${creds.companyId}`;
|
|
723
|
+
addRel("accountable_for", orgExternalKey, projectExternalKey, 1);
|
|
724
|
+
// Also accountable_for any sub-package applications
|
|
725
|
+
for (const sp of subPackages) {
|
|
726
|
+
if (sp.externalKey && sp.entityType === "application") {
|
|
727
|
+
addRel("accountable_for", orgExternalKey, sp.externalKey, 1);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
721
730
|
if (!asJson)
|
|
722
731
|
console.log(`\nWriting to graph…`);
|
|
723
732
|
// Upsert entities
|
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 = {}) {
|