nexarch 0.5.9 → 0.5.10

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.
@@ -6,7 +6,7 @@ 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
8
  import { buildVersionAttributes } from "../lib/version-normalization.js";
9
- const CLI_VERSION = "0.5.9";
9
+ const CLI_VERSION = "0.5.10";
10
10
  const AGENT_ENTITY_TYPE = "agent";
11
11
  const TECH_COMPONENT_ENTITY_TYPE = "technology_component";
12
12
  function parseFlag(args, flag) {
@@ -251,11 +251,13 @@ function injectGenericAgentConfig(registry) {
251
251
  if (!template)
252
252
  continue;
253
253
  const filePath = join(process.cwd(), target.filePathPattern);
254
- if (!existsSync(filePath))
255
- continue;
256
- const existing = readFileSync(filePath, "utf8");
257
254
  const sectionBody = template.body.trim();
258
255
  const sectionHeading = target.sectionHeading ?? "## Nexarch Agent Registration";
256
+ if (!existsSync(filePath)) {
257
+ writeFileSync(filePath, `${sectionBody}\n`, "utf8");
258
+ return [{ path: filePath, status: "injected" }];
259
+ }
260
+ const existing = readFileSync(filePath, "utf8");
259
261
  if (target.insertionMode === "replace_section") {
260
262
  const replaced = replaceInjectedSection(existing, sectionHeading, sectionBody);
261
263
  if (replaced !== existing) {
@@ -267,7 +269,25 @@ function injectGenericAgentConfig(registry) {
267
269
  writeFileSync(filePath, existing + separator + sectionBody + "\n", "utf8");
268
270
  return [{ path: filePath, status: "injected" }];
269
271
  }
270
- return [];
272
+ const fallbackTemplate = templateByCode.get("nexarch_agent_registration_v1") ?? registry.instructionTemplates[0];
273
+ if (!fallbackTemplate)
274
+ return [];
275
+ const fallbackPath = join(process.cwd(), "AGENTS.md");
276
+ const sectionBody = fallbackTemplate.body.trim();
277
+ if (!existsSync(fallbackPath)) {
278
+ writeFileSync(fallbackPath, `${sectionBody}\n`, "utf8");
279
+ return [{ path: fallbackPath, status: "injected" }];
280
+ }
281
+ const existing = readFileSync(fallbackPath, "utf8");
282
+ const sectionHeading = "## Nexarch Agent Registration";
283
+ const replaced = replaceInjectedSection(existing, sectionHeading, sectionBody);
284
+ if (replaced !== existing) {
285
+ writeFileSync(fallbackPath, replaced, "utf8");
286
+ return [{ path: fallbackPath, status: "updated" }];
287
+ }
288
+ const separator = existing.endsWith("\n") ? "" : "\n";
289
+ writeFileSync(fallbackPath, existing + separator + sectionBody + "\n", "utf8");
290
+ return [{ path: fallbackPath, status: "injected" }];
271
291
  }
272
292
  export async function initAgent(args) {
273
293
  const asJson = parseFlag(args, "--json");
@@ -855,17 +875,11 @@ export async function initAgent(args) {
855
875
  }
856
876
  }
857
877
  const hasInjectedAgentInstructions = agentConfigResults.some((r) => r.status === "injected" || r.status === "updated");
878
+ console.log("\n➡ Next step (required): complete agent identity in your coding agent");
879
+ console.log(" Paste this and fill in real values:");
880
+ console.log(`\nrun npx nexarch@latest agent identify --agent-id \"${agentId}\" --provider \"<provider>\" --model \"<model>\" --client \"<client>\" --framework \"<openclaw|n8n|m365-agent-framework|other>\" --tool-version \"<tool-version>\" --capabilities \"<capability1,capability2>\" --json\n`);
858
881
  if (hasInjectedAgentInstructions) {
859
- if (!fromSetup) {
860
- console.log("\n➡ Next step: in your coding agent, run:");
861
- console.log("\nrun npx nexarch@latest init-agent\n");
862
- console.log(" (Registration instructions were already written into your agent config file.)");
863
- }
864
- }
865
- else {
866
- console.log("\n➡ Next step (required): complete agent identity in your coding agent");
867
- console.log(" Paste this and fill in real values:");
868
- console.log(`\nrun npx nexarch@latest agent identify --agent-id \"${agentId}\" --provider \"<provider>\" --model \"<model>\" --client \"<client>\" --framework \"<openclaw|n8n|m365-agent-framework|other>\" --tool-version \"<tool-version>\" --capabilities \"<capability1,capability2>\" --json\n`);
882
+ console.log(" (Registration instructions were already written into your agent config file.)");
869
883
  }
870
884
  if (!fromSetup && appDetection.detected) {
871
885
  console.log("\n➡ Optional next step: likely application detected in current directory.");
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.9" },
71
+ clientInfo: { name: "nexarch-cli", version: "0.5.10" },
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.9",
3
+ "version": "0.5.10",
4
4
  "description": "Your architecture workspace for AI delivery.",
5
5
  "keywords": [
6
6
  "nexarch",