@rk0429/agentic-relay 0.9.0 → 0.10.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.
Files changed (2) hide show
  1. package/dist/relay.mjs +31 -22
  2. package/package.json +1 -1
package/dist/relay.mjs CHANGED
@@ -18,6 +18,9 @@ function resolveLogLevel() {
18
18
  }
19
19
  return 3;
20
20
  }
21
+ function redirectToStderr() {
22
+ logger.options.stdout = process.stderr;
23
+ }
21
24
  var LOG_LEVEL_MAP, logger;
22
25
  var init_logger = __esm({
23
26
  "src/infrastructure/logger.ts"() {
@@ -508,7 +511,8 @@ ${input.prompt}`;
508
511
  maxDepth: guard.getConfig().maxDepth,
509
512
  traceId: envContext.traceId
510
513
  },
511
- ...mcpServers ? { mcpServers } : {}
514
+ ...mcpServers ? { mcpServers } : {},
515
+ ...input.timeoutMs ? { timeoutMs: input.timeoutMs } : {}
512
516
  });
513
517
  }
514
518
  })();
@@ -633,7 +637,7 @@ var init_spawn_agent = __esm({
633
637
  definitionPath: z2.string().describe("Path to the agent definition file (e.g., '.claude/agents/software-engineer.md')")
634
638
  }).optional().describe("Agent definition file to inject into the sub-agent's system prompt"),
635
639
  preferredBackend: z2.enum(["claude", "codex", "gemini"]).optional().describe("Preferred backend override. Takes priority over automatic selection based on agent/task type."),
636
- taskType: z2.enum(["code", "document", "analysis", "mixed"]).optional().describe("Task type hint for automatic backend selection when preferredBackend is not specified."),
640
+ taskType: z2.enum(["code-writing", "code-review", "document-writing", "document-review", "research", "mixed"]).optional().describe("Task type hint for automatic backend selection when preferredBackend is not specified. code-writing\u2192codex, code-review\u2192claude, document-writing\u2192claude, document-review\u2192codex, research\u2192codex, mixed\u2192claude."),
637
641
  timeoutMs: z2.number().optional().describe("Timeout in milliseconds for agent execution. Default: no timeout."),
638
642
  taskInstructionPath: z2.string().optional().describe(
639
643
  "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."
@@ -957,10 +961,12 @@ var init_backend_selector = __esm({
957
961
  "payments-billing": "codex"
958
962
  };
959
963
  TASK_TYPE_TO_BACKEND_MAP = {
960
- code: "codex",
961
- document: "claude",
962
- analysis: "claude",
963
- mixed: "claude"
964
+ "code-writing": "codex",
965
+ "code-review": "claude",
966
+ "document-writing": "claude",
967
+ "document-review": "codex",
968
+ "research": "codex",
969
+ "mixed": "claude"
964
970
  };
965
971
  DEFAULT_BACKEND = "claude";
966
972
  BackendSelector = class {
@@ -1109,7 +1115,7 @@ var init_server = __esm({
1109
1115
  this.backendSelector = new BackendSelector();
1110
1116
  this.server = new McpServer({
1111
1117
  name: "agentic-relay",
1112
- version: "0.9.0"
1118
+ version: "0.10.0"
1113
1119
  });
1114
1120
  this.registerTools(this.server);
1115
1121
  }
@@ -1354,6 +1360,7 @@ var init_server = __esm({
1354
1360
  async start(options) {
1355
1361
  const transportType = options?.transport ?? "stdio";
1356
1362
  if (transportType === "stdio") {
1363
+ redirectToStderr();
1357
1364
  logger.info("Starting agentic-relay MCP server (stdio transport)...");
1358
1365
  const transport = new StdioServerTransport();
1359
1366
  await this.server.connect(transport);
@@ -1416,7 +1423,7 @@ var init_server = __esm({
1416
1423
  });
1417
1424
  const server = new McpServer({
1418
1425
  name: "agentic-relay",
1419
- version: "0.9.0"
1426
+ version: "0.10.0"
1420
1427
  });
1421
1428
  this.registerTools(server);
1422
1429
  transport.onclose = () => {
@@ -1780,8 +1787,10 @@ var CLAUDE_NESTING_ENV_VARS = [
1780
1787
  "CLAUDE_CODE_SSE_PORT",
1781
1788
  "CLAUDE_CODE_ENTRYPOINT"
1782
1789
  ];
1783
- var DEFAULT_CLAUDE_SDK_TIMEOUT_MS = 5 * 60 * 1e3;
1784
- function getClaudeSdkTimeoutMs() {
1790
+ function resolveClaudeSdkTimeoutMs(flagsTimeoutMs) {
1791
+ if (flagsTimeoutMs !== void 0 && flagsTimeoutMs > 0) {
1792
+ return flagsTimeoutMs;
1793
+ }
1785
1794
  const envVal = process.env["RELAY_CLAUDE_TIMEOUT_MS"];
1786
1795
  if (envVal) {
1787
1796
  const parsed = Number(envVal);
@@ -1789,7 +1798,7 @@ function getClaudeSdkTimeoutMs() {
1789
1798
  return parsed;
1790
1799
  }
1791
1800
  }
1792
- return DEFAULT_CLAUDE_SDK_TIMEOUT_MS;
1801
+ return void 0;
1793
1802
  }
1794
1803
  var ClaudeAdapter = class extends BaseAdapter {
1795
1804
  id = "claude";
@@ -1828,9 +1837,9 @@ var ClaudeAdapter = class extends BaseAdapter {
1828
1837
  }
1829
1838
  const env = this.buildCleanEnv(flags);
1830
1839
  const permissionMode = this.getPermissionMode();
1831
- const timeoutMs = getClaudeSdkTimeoutMs();
1840
+ const timeoutMs = resolveClaudeSdkTimeoutMs(flags.timeoutMs);
1832
1841
  const abortController = new AbortController();
1833
- const timer = setTimeout(() => abortController.abort(), timeoutMs);
1842
+ const timer = timeoutMs !== void 0 ? setTimeout(() => abortController.abort(), timeoutMs) : void 0;
1834
1843
  try {
1835
1844
  const { query } = await loadClaudeSDK();
1836
1845
  const options = {
@@ -1898,7 +1907,7 @@ var ClaudeAdapter = class extends BaseAdapter {
1898
1907
  stderr: error instanceof Error ? error.message : String(error)
1899
1908
  };
1900
1909
  } finally {
1901
- clearTimeout(timer);
1910
+ if (timer !== void 0) clearTimeout(timer);
1902
1911
  }
1903
1912
  }
1904
1913
  async *executeStreaming(flags) {
@@ -1907,9 +1916,9 @@ var ClaudeAdapter = class extends BaseAdapter {
1907
1916
  }
1908
1917
  const env = this.buildCleanEnv(flags);
1909
1918
  const permissionMode = this.getPermissionMode();
1910
- const timeoutMs = getClaudeSdkTimeoutMs();
1919
+ const timeoutMs = resolveClaudeSdkTimeoutMs(flags.timeoutMs);
1911
1920
  const abortController = new AbortController();
1912
- const timer = setTimeout(() => abortController.abort(), timeoutMs);
1921
+ const timer = timeoutMs !== void 0 ? setTimeout(() => abortController.abort(), timeoutMs) : void 0;
1913
1922
  try {
1914
1923
  const { query } = await loadClaudeSDK();
1915
1924
  const options = {
@@ -1984,13 +1993,13 @@ var ClaudeAdapter = class extends BaseAdapter {
1984
1993
  result: { exitCode: 1, stdout: "", stderr: errorMessage }
1985
1994
  };
1986
1995
  } finally {
1987
- clearTimeout(timer);
1996
+ if (timer !== void 0) clearTimeout(timer);
1988
1997
  }
1989
1998
  }
1990
1999
  async continueSession(nativeSessionId, prompt) {
1991
- const timeoutMs = getClaudeSdkTimeoutMs();
2000
+ const timeoutMs = resolveClaudeSdkTimeoutMs();
1992
2001
  const abortController = new AbortController();
1993
- const timer = setTimeout(() => abortController.abort(), timeoutMs);
2002
+ const timer = timeoutMs !== void 0 ? setTimeout(() => abortController.abort(), timeoutMs) : void 0;
1994
2003
  try {
1995
2004
  const { query } = await loadClaudeSDK();
1996
2005
  const permissionMode = this.getPermissionMode();
@@ -2036,7 +2045,7 @@ var ClaudeAdapter = class extends BaseAdapter {
2036
2045
  stderr: error instanceof Error ? error.message : String(error)
2037
2046
  };
2038
2047
  } finally {
2039
- clearTimeout(timer);
2048
+ if (timer !== void 0) clearTimeout(timer);
2040
2049
  }
2041
2050
  }
2042
2051
  async resumeSession(sessionId, flags) {
@@ -4362,7 +4371,7 @@ function createVersionCommand(registry2) {
4362
4371
  description: "Show relay and backend versions"
4363
4372
  },
4364
4373
  async run() {
4365
- const relayVersion = "0.9.0";
4374
+ const relayVersion = "0.10.0";
4366
4375
  console.log(`agentic-relay v${relayVersion}`);
4367
4376
  console.log("");
4368
4377
  console.log("Backends:");
@@ -4712,7 +4721,7 @@ void configManager.getConfig().then((config) => {
4712
4721
  var main = defineCommand10({
4713
4722
  meta: {
4714
4723
  name: "relay",
4715
- version: "0.9.0",
4724
+ version: "0.10.0",
4716
4725
  description: "Unified CLI proxy for Claude Code, Codex CLI, and Gemini CLI"
4717
4726
  },
4718
4727
  subCommands: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rk0429/agentic-relay",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Unified CLI proxy for Claude Code, Codex CLI, and Gemini CLI with MCP-based multi-layer sub-agent orchestration",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",