nexarch 0.2.0 → 0.2.1

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.
@@ -112,37 +112,52 @@ export async function agentIdentify(args) {
112
112
  const upsert = parseToolText(upsertRaw);
113
113
  const failed = Number(upsert.summary?.failed ?? 0) > 0;
114
114
  const firstResult = upsert.results?.[0];
115
- // Upsert provider, model, and client as first-class graph entities
115
+ // Upsert provider, model, client, and (optionally) framework as first-class graph entities
116
116
  const providerExternalKey = `org:provider:${provider.toLowerCase().replace(/[^a-z0-9]+/g, "_")}`;
117
117
  const modelExternalKey = `model:${model.toLowerCase().replace(/[^a-z0-9]+/g, "_")}`;
118
118
  const clientExternalKey = `tool:client:${client.toLowerCase().replace(/[^a-z0-9]+/g, "_")}`;
119
+ const frameworkExternalKey = framework
120
+ ? `technology_component:framework:${framework.toLowerCase().replace(/[^a-z0-9]+/g, "_")}`
121
+ : null;
119
122
  const agentExternalKey = `agent:${agentId}`;
123
+ const identityEntities = [
124
+ {
125
+ externalKey: providerExternalKey,
126
+ entityTypeCode: "organisation",
127
+ entitySubtypeCode: "org_partner",
128
+ name: provider,
129
+ description: `AI provider: ${provider}`,
130
+ confidence: 1,
131
+ },
132
+ {
133
+ externalKey: modelExternalKey,
134
+ entityTypeCode: "model",
135
+ entitySubtypeCode: "model_llm",
136
+ name: model,
137
+ description: `Large language model: ${model}`,
138
+ confidence: 1,
139
+ },
140
+ {
141
+ externalKey: clientExternalKey,
142
+ entityTypeCode: "tool",
143
+ name: client,
144
+ description: `AI agent client: ${client}`,
145
+ confidence: 1,
146
+ },
147
+ ];
148
+ if (framework && frameworkExternalKey) {
149
+ identityEntities.push({
150
+ externalKey: frameworkExternalKey,
151
+ entityTypeCode: "technology_component",
152
+ entitySubtypeCode: "tool_agent_runtime",
153
+ name: framework,
154
+ description: `Agent framework: ${framework}`,
155
+ confidence: 1,
156
+ attributes: { kind: "agent_framework", framework },
157
+ });
158
+ }
120
159
  await callMcpTool("nexarch_upsert_entities", {
121
- entities: [
122
- {
123
- externalKey: providerExternalKey,
124
- entityTypeCode: "organisation",
125
- entitySubtypeCode: "org_partner",
126
- name: provider,
127
- description: `AI provider: ${provider}`,
128
- confidence: 1,
129
- },
130
- {
131
- externalKey: modelExternalKey,
132
- entityTypeCode: "model",
133
- entitySubtypeCode: "model_llm",
134
- name: model,
135
- description: `Large language model: ${model}`,
136
- confidence: 1,
137
- },
138
- {
139
- externalKey: clientExternalKey,
140
- entityTypeCode: "tool",
141
- name: client,
142
- description: `AI agent client: ${client}`,
143
- confidence: 1,
144
- },
145
- ],
160
+ entities: identityEntities,
146
161
  agentContext: {
147
162
  agentId,
148
163
  agentRunId: `agent-identify-entities-${Date.now()}`,
@@ -160,28 +175,37 @@ export async function agentIdentify(args) {
160
175
  : undefined,
161
176
  dryRun: false,
162
177
  }, { companyId: creds.companyId });
163
- // Wire relationships: uses_model, uses, accountable_for
178
+ // Wire relationships: uses_model, uses (client), accountable_for (provider), runs_on (framework)
179
+ const identityRelationships = [
180
+ {
181
+ relationshipTypeCode: "uses_model",
182
+ fromEntityExternalKey: agentExternalKey,
183
+ toEntityExternalKey: modelExternalKey,
184
+ confidence: 1,
185
+ },
186
+ {
187
+ relationshipTypeCode: "uses",
188
+ fromEntityExternalKey: agentExternalKey,
189
+ toEntityExternalKey: clientExternalKey,
190
+ confidence: 1,
191
+ },
192
+ {
193
+ relationshipTypeCode: "accountable_for",
194
+ fromEntityExternalKey: providerExternalKey,
195
+ toEntityExternalKey: agentExternalKey,
196
+ confidence: 1,
197
+ },
198
+ ];
199
+ if (framework && frameworkExternalKey) {
200
+ identityRelationships.push({
201
+ relationshipTypeCode: "runs_on",
202
+ fromEntityExternalKey: agentExternalKey,
203
+ toEntityExternalKey: frameworkExternalKey,
204
+ confidence: 1,
205
+ });
206
+ }
164
207
  await callMcpTool("nexarch_upsert_relationships", {
165
- relationships: [
166
- {
167
- relationshipTypeCode: "uses_model",
168
- fromEntityExternalKey: agentExternalKey,
169
- toEntityExternalKey: modelExternalKey,
170
- confidence: 1,
171
- },
172
- {
173
- relationshipTypeCode: "uses",
174
- fromEntityExternalKey: agentExternalKey,
175
- toEntityExternalKey: clientExternalKey,
176
- confidence: 1,
177
- },
178
- {
179
- relationshipTypeCode: "accountable_for",
180
- fromEntityExternalKey: providerExternalKey,
181
- toEntityExternalKey: agentExternalKey,
182
- confidence: 1,
183
- },
184
- ],
208
+ relationships: identityRelationships,
185
209
  agentContext: {
186
210
  agentId,
187
211
  agentRunId: `agent-identify-rels-${Date.now()}`,
@@ -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.0";
7
+ const CLI_VERSION = "0.2.1";
8
8
  const AGENT_ENTITY_TYPE = "agent";
9
9
  const TECH_COMPONENT_ENTITY_TYPE = "technology_component";
10
10
  function parseFlag(args, flag) {
@@ -473,6 +473,14 @@ export async function initAgent(args) {
473
473
  confidence: 0.95,
474
474
  attributes: { source: "nexarch-cli-init-agent", kind: "runtime", createdAt: nowIso },
475
475
  },
476
+ // Host runs on its OS — gives the host entity its own OS relationship
477
+ {
478
+ relationshipTypeCode: "runs_on",
479
+ fromEntityExternalKey: hostExternalKey,
480
+ toEntityExternalKey: osExternalKey,
481
+ confidence: 0.95,
482
+ attributes: { source: "nexarch-cli-init-agent", kind: "host_os", createdAt: nowIso },
483
+ },
476
484
  ],
477
485
  agentContext: {
478
486
  agentId,
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.1.11" },
65
+ clientInfo: { name: "nexarch-cli", version: "0.2.1" },
66
66
  }, options);
67
67
  }
68
68
  export async function mcpListTools(options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexarch",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Connect AI coding tools to your Nexarch architecture workspace",
5
5
  "keywords": [
6
6
  "nexarch",