@rk0429/agentic-relay 1.4.2 → 1.5.0
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/relay.mjs +12 -29
- package/package.json +1 -1
package/dist/relay.mjs
CHANGED
|
@@ -1076,7 +1076,6 @@ async function executeSpawnAgent(input, registry2, sessionManager2, guard, hooks
|
|
|
1076
1076
|
const availableBackends = registry2.listIds();
|
|
1077
1077
|
const selectionContext = {
|
|
1078
1078
|
availableBackends,
|
|
1079
|
-
preferredBackend: input.preferredBackend,
|
|
1080
1079
|
agentType: input.agent,
|
|
1081
1080
|
taskType: input.taskType
|
|
1082
1081
|
};
|
|
@@ -1395,7 +1394,6 @@ ${input.prompt}`;
|
|
|
1395
1394
|
const metadata = {
|
|
1396
1395
|
durationMs: new Date(completedAt).getTime() - new Date(spawnStartedAt).getTime(),
|
|
1397
1396
|
selectedBackend: effectiveBackend,
|
|
1398
|
-
...input.preferredBackend ? { requestedBackend: input.preferredBackend } : {},
|
|
1399
1397
|
selectionReason,
|
|
1400
1398
|
startedAt: spawnStartedAt,
|
|
1401
1399
|
completedAt,
|
|
@@ -1635,12 +1633,12 @@ var init_spawn_agent = __esm({
|
|
|
1635
1633
|
init_metadata_validation();
|
|
1636
1634
|
spawnAgentInputSchema = z2.object({
|
|
1637
1635
|
fallbackBackend: z2.enum(["claude", "codex", "gemini"]).optional().describe(
|
|
1638
|
-
"Optional fallback backend. Used only when BackendSelector is not active or cannot determine a backend. When BackendSelector is active, backend is auto-selected by priority:
|
|
1636
|
+
"Optional fallback backend. Used only when BackendSelector is not active or cannot determine a backend. When BackendSelector is active, backend is auto-selected by priority: agentType mapping > taskType mapping > default (claude)."
|
|
1639
1637
|
),
|
|
1640
1638
|
prompt: z2.string().describe(
|
|
1641
1639
|
"The task instruction for the sub-agent. Be specific and include all necessary context for autonomous execution."
|
|
1642
1640
|
),
|
|
1643
|
-
agent: z2.string().
|
|
1641
|
+
agent: z2.string().describe(
|
|
1644
1642
|
"Agent type identifier (e.g., 'coder', 'researcher', 'documenter', 'software-engineer'). Affects backend auto-selection: coder/researcher/software-engineer/devops-engineer\u2192codex, documenter\u2192claude. Also used to resolve agentDefinition files from .agents/agents/<agent>.md."
|
|
1645
1643
|
),
|
|
1646
1644
|
systemPrompt: z2.string().optional().describe(
|
|
@@ -1659,11 +1657,8 @@ var init_spawn_agent = __esm({
|
|
|
1659
1657
|
agentDefinition: z2.object({
|
|
1660
1658
|
definitionPath: z2.string().describe("Path to the agent definition .md file (e.g., '.agents/agents/coder.md')")
|
|
1661
1659
|
}).optional().describe("Agent definition file to inject into the sub-agent's system prompt as <agent-definition> context."),
|
|
1662
|
-
preferredBackend: z2.enum(["claude", "codex", "gemini"]).optional().describe(
|
|
1663
|
-
"Preferred backend override. Takes highest priority in backend selection. Use when the automatic agentType/taskType mapping does not match your needs."
|
|
1664
|
-
),
|
|
1665
1660
|
taskType: z2.enum(["code-writing", "code-review", "document-writing", "document-review", "research", "mixed"]).optional().describe(
|
|
1666
|
-
"Task type hint for automatic backend selection (priority
|
|
1661
|
+
"Task type hint for automatic backend selection (priority 2, after agentType). Mapping: code-writing\u2192codex, code-review\u2192claude, document-writing\u2192claude, document-review\u2192codex, research\u2192codex, mixed\u2192claude."
|
|
1667
1662
|
),
|
|
1668
1663
|
taskInstructionPath: z2.string().optional().describe(
|
|
1669
1664
|
"Path to a file containing task instructions. Content is prepended to the prompt. Path is resolved relative to the project root and validated against path traversal."
|
|
@@ -2129,13 +2124,10 @@ var init_backend_selector = __esm({
|
|
|
2129
2124
|
return this.selectBackendWithReason(context).backend;
|
|
2130
2125
|
}
|
|
2131
2126
|
selectBackendWithReason(context) {
|
|
2132
|
-
const { availableBackends,
|
|
2127
|
+
const { availableBackends, agentType, taskType } = context;
|
|
2133
2128
|
if (availableBackends.length === 0) {
|
|
2134
2129
|
throw new Error("No backends available");
|
|
2135
2130
|
}
|
|
2136
|
-
if (preferredBackend && availableBackends.includes(preferredBackend)) {
|
|
2137
|
-
return { backend: preferredBackend, reason: "preferredBackend" };
|
|
2138
|
-
}
|
|
2139
2131
|
if (agentType) {
|
|
2140
2132
|
const mapped = this.agentToBackendMap[agentType];
|
|
2141
2133
|
if (mapped && availableBackends.includes(mapped)) {
|
|
@@ -2420,7 +2412,7 @@ var init_server = __esm({
|
|
|
2420
2412
|
this.agentEventStore
|
|
2421
2413
|
);
|
|
2422
2414
|
this.server = new McpServer(
|
|
2423
|
-
{ name: "agentic-relay", version: "1.
|
|
2415
|
+
{ name: "agentic-relay", version: "1.5.0" },
|
|
2424
2416
|
createMcpServerOptions()
|
|
2425
2417
|
);
|
|
2426
2418
|
this.registerTools(this.server);
|
|
@@ -2558,7 +2550,7 @@ var init_server = __esm({
|
|
|
2558
2550
|
server.experimental.tasks.registerToolTask(
|
|
2559
2551
|
"spawn_agent",
|
|
2560
2552
|
{
|
|
2561
|
-
description: "Spawn a sub-agent on a backend CLI (Claude Code, Codex CLI, or Gemini CLI). The agent executes the given prompt in non-interactive mode and returns the result. Backend is auto-selected by priority:
|
|
2553
|
+
description: "Spawn a sub-agent on a backend CLI (Claude Code, Codex CLI, or Gemini CLI). The agent executes the given prompt in non-interactive mode and returns the result. Backend is auto-selected by priority: agentType mapping (coder/researcher\u2192codex, documenter\u2192claude) > taskType mapping > default (claude). Use 'agentDefinition' to inject an agent .md file, 'skillContext' for a SKILL.md, or 'systemPrompt' for custom instructions.",
|
|
2562
2554
|
inputSchema: spawnAgentInputSchema.shape,
|
|
2563
2555
|
execution: { taskSupport: "optional" }
|
|
2564
2556
|
},
|
|
@@ -2614,20 +2606,11 @@ var init_server = __esm({
|
|
|
2614
2606
|
failedResults: z7.array(z7.object({
|
|
2615
2607
|
index: z7.number(),
|
|
2616
2608
|
originalInput: spawnAgentInputSchema
|
|
2617
|
-
})).min(1).describe("Array of failed results with their original input configurations")
|
|
2618
|
-
overrides: z7.object({
|
|
2619
|
-
preferredBackend: z7.enum(["claude", "codex", "gemini"]).optional()
|
|
2620
|
-
}).optional().describe("Parameter overrides applied to all retried agents")
|
|
2609
|
+
})).min(1).describe("Array of failed results with their original input configurations")
|
|
2621
2610
|
},
|
|
2622
2611
|
async (params) => {
|
|
2623
2612
|
try {
|
|
2624
|
-
const agents = params.failedResults.map((r) => {
|
|
2625
|
-
const input = { ...r.originalInput };
|
|
2626
|
-
if (params.overrides) {
|
|
2627
|
-
if (params.overrides.preferredBackend !== void 0) input.preferredBackend = params.overrides.preferredBackend;
|
|
2628
|
-
}
|
|
2629
|
-
return input;
|
|
2630
|
-
});
|
|
2613
|
+
const agents = params.failedResults.map((r) => ({ ...r.originalInput }));
|
|
2631
2614
|
const result = await executeSpawnAgentsParallel(
|
|
2632
2615
|
agents,
|
|
2633
2616
|
this.registry,
|
|
@@ -2908,7 +2891,7 @@ var init_server = __esm({
|
|
|
2908
2891
|
sessionIdGenerator: () => randomUUID()
|
|
2909
2892
|
});
|
|
2910
2893
|
const server = new McpServer(
|
|
2911
|
-
{ name: "agentic-relay", version: "1.
|
|
2894
|
+
{ name: "agentic-relay", version: "1.5.0" },
|
|
2912
2895
|
createMcpServerOptions()
|
|
2913
2896
|
);
|
|
2914
2897
|
this.registerTools(server);
|
|
@@ -7347,7 +7330,7 @@ function createMCPCommand(configManager2, registry2, sessionManager2, hooksEngin
|
|
|
7347
7330
|
responseOutputDir,
|
|
7348
7331
|
relayConfig
|
|
7349
7332
|
);
|
|
7350
|
-
await server.start({ transport, port, currentVersion: "1.
|
|
7333
|
+
await server.start({ transport, port, currentVersion: "1.5.0" });
|
|
7351
7334
|
}
|
|
7352
7335
|
})
|
|
7353
7336
|
},
|
|
@@ -7507,7 +7490,7 @@ function createVersionCommand(registry2) {
|
|
|
7507
7490
|
description: "Show relay and backend versions"
|
|
7508
7491
|
},
|
|
7509
7492
|
async run() {
|
|
7510
|
-
const relayVersion = "1.
|
|
7493
|
+
const relayVersion = "1.5.0";
|
|
7511
7494
|
console.log(`agentic-relay v${relayVersion}`);
|
|
7512
7495
|
console.log("");
|
|
7513
7496
|
console.log("Backends:");
|
|
@@ -7904,7 +7887,7 @@ var subCommandNames = /* @__PURE__ */ new Set(["claude", "codex", "gemini", "upd
|
|
|
7904
7887
|
var main = defineCommand11({
|
|
7905
7888
|
meta: {
|
|
7906
7889
|
name: "relay",
|
|
7907
|
-
version: "1.
|
|
7890
|
+
version: "1.5.0",
|
|
7908
7891
|
description: "Unified CLI proxy for Claude Code, Codex CLI, and Gemini CLI"
|
|
7909
7892
|
},
|
|
7910
7893
|
args: {
|
package/package.json
CHANGED