llm-relay 0.69.0 → 0.70.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/backend.d.ts +5 -2
- package/dist/backend.js.map +1 -1
- package/dist/candidate-runner.d.ts +11 -9
- package/dist/candidate-runner.js +5 -2
- package/dist/candidate-runner.js.map +1 -1
- package/dist/config.d.ts +22 -7
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/hedge-trigger.d.ts +92 -19
- package/dist/hedge-trigger.js +25 -12
- package/dist/hedge-trigger.js.map +1 -1
- package/dist/routes/messages.d.ts +7 -0
- package/dist/routes/messages.js +1 -0
- package/dist/routes/messages.js.map +1 -1
- package/dist/routes/openai-front.d.ts +6 -0
- package/dist/routes/openai-front.js +1 -0
- package/dist/routes/openai-front.js.map +1 -1
- package/dist/server.d.ts +2 -5
- package/dist/server.js +4 -2
- package/dist/server.js.map +1 -1
- package/dist/setup-claude.d.ts +39 -2
- package/dist/setup-claude.js +18 -11
- package/dist/setup-claude.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install-skill.mjs +79 -1
- package/skills/llm-relay/SKILL.md +18 -0
package/dist/setup-claude.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-claude.js","sourceRoot":"","sources":["../src/setup-claude.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"setup-claude.js","sourceRoot":"","sources":["../src/setup-claude.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E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CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAE9D,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,4BAA4B,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IAEpC,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,gEAAgE;QACzE,KAAK;KACN,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Install/refresh the llm-relay skill bundle for Claude Code, Codex and OpenCode from the same
|
|
4
4
|
* shipped source directory, and provision Codex's global provider plus the host-independent MCP
|
|
5
|
-
* dispatch entry point.
|
|
5
|
+
* dispatch entry point plus a Codex `relay` subagent file (`~/.codex/agents/relay.toml`) that
|
|
6
|
+
* pins no model, mirroring `src/setup-claude.ts`'s Claude `relay` agent.
|
|
6
7
|
*
|
|
7
8
|
* Runs from npm `postinstall`, but only acts on GLOBAL installs (`npm i -g llm-relay`)
|
|
8
9
|
* so that a repo-local `npm install` (dev checkout, CI) never touches the developer's
|
|
@@ -53,6 +54,76 @@ const LEGACY_CODEX_AGENTS = [
|
|
|
53
54
|
},
|
|
54
55
|
];
|
|
55
56
|
|
|
57
|
+
/**
|
|
58
|
+
* The REPLACEMENT for the two legacy agents above (owner direction 2026-09-04: "The relay should
|
|
59
|
+
* also work via Codex. I don't want to hard code a model name."). Confirmed against Codex's
|
|
60
|
+
* subagent docs (`/codex/agent-configuration/subagents`, fetched 2026-09-04) and three
|
|
61
|
+
* currently-installed sibling files on this machine (`~/.codex/agents/codebase-memory*.toml`,
|
|
62
|
+
* from codebase-memory-mcp): `name`, `description` and `developer_instructions` are the three
|
|
63
|
+
* REQUIRED fields; `model`/`model_reasoning_effort`/`sandbox_mode`/`mcp_servers` are optional,
|
|
64
|
+
* and — the load-bearing fact — "session settings... inherit from the parent when the custom
|
|
65
|
+
* agent file omits them." ⚠ `model_provider` is NOT a documented custom-agent-file field at all
|
|
66
|
+
* (only `model` is), which is one likely reason the legacy agents above needed retiring: they set
|
|
67
|
+
* BOTH `model_provider = "llm-relay"` and `model = "pool/medium"`, and Codex Desktop validates a
|
|
68
|
+
* child's model against the signed-in ChatGPT account before ever consulting `model_provider` —
|
|
69
|
+
* so a `pool/*` value fails that check regardless of the provider block backing it (the "Codex's
|
|
70
|
+
* installed relay-backed `default` subagent profile is unusable with a ChatGPT account" backlog
|
|
71
|
+
* item; C:\Code\docs\backlog.md). This template pins NEITHER field. With no `model`/
|
|
72
|
+
* `model_provider` of its own it inherits the CALLING session's — so Desktop's validation sees an
|
|
73
|
+
* ordinary child on the account's own model, never a `pool/*` value, and never even reaches the
|
|
74
|
+
* relay for that decision. The agent's own job, once spawned, is to call the already-configured
|
|
75
|
+
* `llm-relay` MCP `dispatch` tool for whichever task it was given — the SAME pass-through
|
|
76
|
+
* contract as the Claude `relay` agent in `src/setup-claude.ts`, ported to Codex's bare
|
|
77
|
+
* (unprefixed) MCP tool-name convention and with no ToolSearch step, because Codex's per-agent
|
|
78
|
+
* `enabled_tools` grants direct access with no deferred-loading discovery call to make first.
|
|
79
|
+
*/
|
|
80
|
+
const CODEX_RELAY_AGENT_MARKER_PREFIX = "# llm-relay:codex-relay-agent";
|
|
81
|
+
const CODEX_RELAY_AGENT_MARKER = "# llm-relay:codex-relay-agent v1";
|
|
82
|
+
const CODEX_RELAY_AGENT_TEMPLATE = `${CODEX_RELAY_AGENT_MARKER}
|
|
83
|
+
name = "relay"
|
|
84
|
+
description = "Hands one self-contained task to llm-relay dispatch, free model pools or peer agent CLIs, and returns the lane's answer verbatim with its provenance. Use for any task another agent can do: a search, a sweep, a draft, a summary, a second opinion."
|
|
85
|
+
sandbox_mode = "read-only"
|
|
86
|
+
developer_instructions = """
|
|
87
|
+
You have no knowledge of your own and no permission to answer any task yourself. The only
|
|
88
|
+
legitimate action available to you is exactly one \`dispatch\` tool call, plus polling its status
|
|
89
|
+
and result. The caller is measuring the LANE that \`dispatch\` reaches, not you — composing your
|
|
90
|
+
own answer, however small, is never a valid response.
|
|
91
|
+
|
|
92
|
+
1. Call the \`dispatch\` tool ONCE with the task text verbatim.
|
|
93
|
+
2. This holds for EVERY task, even one that looks trivial — an echo, a one-word reply, a question you think you already know the answer to. Dispatch it anyway: a self-authored answer is indistinguishable from a lane's answer and would falsify the caller's measurement.
|
|
94
|
+
3. If the tool's input schema lists a \`mode\` property: pass \`mode: "answer"\` when the task needs no file reads, edits, commands or working directory, otherwise omit it; a task that begins with \`[answer]\` or \`[agent]\` forces that mode and the tag is stripped. If the schema has no \`mode\` property, pass no mode.
|
|
95
|
+
4. If the result is a jobId, poll \`dispatch_status\` about every 15 seconds, then call \`dispatch_result\`.
|
|
96
|
+
5. Return the lane's answer VERBATIM, then one final line \`provenance: lane=<id> spec=<spec> elapsed=<seconds>\` copied from the tool result — never invented. A reply with no provenance line is a FAILURE: it means no lane ran.
|
|
97
|
+
6. Add no analysis and no commentary.
|
|
98
|
+
7. If the tool result says the lane FAILED, dispatch once more with \`tier: "high"\`; if that fails too, return exactly \`RELAY_DISPATCH_FAILED: <reason>\`.
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
[mcp_servers.llm-relay]
|
|
102
|
+
command = "llm-relay"
|
|
103
|
+
args = ["mcp"]
|
|
104
|
+
enabled_tools = ["dispatch", "dispatch_status", "dispatch_result"]
|
|
105
|
+
`;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Install/upgrade the Codex `relay` agent file. Ownership test mirrors `installRelayAgent` in
|
|
109
|
+
* `src/setup-claude.ts`: a PREFIX match against ANY versioned marker, not just the current one, so
|
|
110
|
+
* a file carrying an older marker is recognised as ours and upgraded in place rather than refused
|
|
111
|
+
* as foreign. `agentDir` is assumed to already exist — `installCodexSetup` creates it before
|
|
112
|
+
* calling this, the same order the legacy-agent retirement above already relies on.
|
|
113
|
+
*/
|
|
114
|
+
function installCodexRelayAgent(agentDir) {
|
|
115
|
+
const path = join(agentDir, "relay.toml");
|
|
116
|
+
const existed = existsSync(path);
|
|
117
|
+
if (existed) {
|
|
118
|
+
const existing = readFileSync(path, "utf8");
|
|
119
|
+
if (!existing.includes(CODEX_RELAY_AGENT_MARKER_PREFIX)) {
|
|
120
|
+
return { path, status: "refused" };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
writeFileSync(path, CODEX_RELAY_AGENT_TEMPLATE);
|
|
124
|
+
return { path, status: existed ? "updated" : "installed" };
|
|
125
|
+
}
|
|
126
|
+
|
|
56
127
|
/** Add the provider section without disturbing unrelated Codex settings or duplicating it. */
|
|
57
128
|
function hasConfiguredCodexTable(current, section, quotedSection) {
|
|
58
129
|
// Accept the normal unquoted TOML table and the equivalent quoted spelling, and tolerate
|
|
@@ -130,6 +201,13 @@ function installCodexSetup(home) {
|
|
|
130
201
|
if (result.status === "absent") continue;
|
|
131
202
|
process.stderr.write(`llm-relay: Codex agent ${result.status} at ${result.path}\n`);
|
|
132
203
|
}
|
|
204
|
+
|
|
205
|
+
const relayResult = installCodexRelayAgent(agentDir);
|
|
206
|
+
if (relayResult.status === "refused") {
|
|
207
|
+
process.stderr.write(`llm-relay: Refusing to overwrite foreign Codex relay agent file at ${relayResult.path}\n`);
|
|
208
|
+
} else {
|
|
209
|
+
process.stderr.write(`llm-relay: Codex relay agent ${relayResult.status} at ${relayResult.path}\n`);
|
|
210
|
+
}
|
|
133
211
|
}
|
|
134
212
|
|
|
135
213
|
try {
|
|
@@ -84,6 +84,24 @@ Claude Code workflows and subagents can delegate tasks to llm-relay lanes via th
|
|
|
84
84
|
- On the Agent tool: `subagent_type: relay`
|
|
85
85
|
- The `[answer]`/`[agent]` tag: a task that begins with `[answer]` or `[agent]` forces answer mode (`mode: "answer"`) when the task needs no file reads, edits, commands or working directory, and the tag is stripped before dispatch.
|
|
86
86
|
- Installation: `llm-relay setup claude-desktop` or `llm-relay setup claude-cli` installs the definition at `~/.claude/agents/relay.md`.
|
|
87
|
+
- The relay agent never answers a task itself, even a trivial one — it always dispatches and ends its reply with a `provenance: lane=<id> spec=<spec> elapsed=<seconds>` line, so a reply with no provenance line means no lane ran.
|
|
88
|
+
- The relay agent pins no model — it runs on whatever model the calling session is on. Pass
|
|
89
|
+
`model` on the `agent()` call (`agent(task, {agentType: "relay", model: "sonnet"})`) or the
|
|
90
|
+
Agent tool call (`subagent_type: relay`, `model: "sonnet"`) to choose a different one for a
|
|
91
|
+
single call. Measured 2026-09-04: on `haiku` the wrapper answered a trivial echo task itself
|
|
92
|
+
instead of dispatching (no provenance line), while a realistic task dispatched correctly; on
|
|
93
|
+
`sonnet` even the echo dispatched.
|
|
94
|
+
- A changed `relay.md` takes effect only in a new Claude Code session — the running session already loaded the agent definition and does not re-read edits to it.
|
|
95
|
+
|
|
96
|
+
## Use from Codex
|
|
97
|
+
|
|
98
|
+
A global install also provisions a Codex `relay` subagent (`~/.codex/agents/relay.toml`) with the
|
|
99
|
+
same no-model-pinned pass-through contract — it inherits whichever model/provider the calling
|
|
100
|
+
session already uses, so Desktop's collaboration launcher never sees a `pool/*` child to reject.
|
|
101
|
+
Reach it with a delegation request ("spawn a relay agent for this", "delegate this in parallel") —
|
|
102
|
+
Codex has no dedicated Agent-tool-style call for it. `codex exec`'s own top-level session exposes
|
|
103
|
+
no MCP tools at all (a separate, pre-existing limitation); Codex Desktop is the confirmed working
|
|
104
|
+
host for MCP `dispatch` generally.
|
|
87
105
|
|
|
88
106
|
## First use on a machine — ASK, do not assume
|
|
89
107
|
|