nexarch 0.5.9 → 0.5.11
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/check-in.js +8 -0
- package/dist/commands/init-agent.js +29 -15
- package/dist/lib/mcp.js +1 -1
- package/package.json +1 -1
|
@@ -69,6 +69,14 @@ export async function checkIn(args) {
|
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
const cmd = result.command;
|
|
72
|
+
if (result.handled) {
|
|
73
|
+
console.log("Auto command handled by Nexarch runtime.");
|
|
74
|
+
if (result.audit?.runId) {
|
|
75
|
+
const s = result.audit.summary ?? {};
|
|
76
|
+
console.log(`Policy audit run: ${result.audit.runId} (${s.passCount ?? 0} pass, ${s.partialCount ?? 0} partial, ${s.failCount ?? 0} fail)`);
|
|
77
|
+
}
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
72
80
|
console.log(`\n╔══════════════════════════════════════════════════════════════════╗`);
|
|
73
81
|
console.log(`║ COMMAND QUEUED — action required ║`);
|
|
74
82
|
console.log(`╚══════════════════════════════════════════════════════════════════╝`);
|
|
@@ -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
|
+
const CLI_VERSION = "0.5.11";
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
71
|
+
clientInfo: { name: "nexarch-cli", version: "0.5.11" },
|
|
72
72
|
}, options);
|
|
73
73
|
}
|
|
74
74
|
export async function mcpListTools(options = {}) {
|