github-router 0.3.162 → 0.3.163

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.
@@ -2,7 +2,7 @@
2
2
  "manifest_version": 3,
3
3
  "name": "github-router browser bridge",
4
4
  "short_name": "gh-router-browser",
5
- "version": "0.3.162",
5
+ "version": "0.3.163",
6
6
  "description": "Bridge between Claude (via github-router /mcp) and the browser. Implements tab control, navigation, clicks, form fill, downloads, screenshots, devtools eval. Blocks navigation to chrome://settings.",
7
7
  "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJElxuBlonBS3TVW9FJN0mGTtShB3L1hoaYf6k39SOr1ogGYmF90EjRxy1i21k9wQQjPf26bcBu/9X67KrQjQV0uB38CaNukgiSeoLjfptN811u+PJHx6BP+jx3Qa6/3VenNPxHC8WEU0GXql8QSjIHEyCwKb6fMASXOK94JyB5Ywov2x8mt/+9ncqBBBMVzf6r5Sagy4PL1XnryLsuADD/vOEkPet8wXgH/Oj7v5tTsQQZ7U1JT51PoDs2BFnXc5v3TkVgZwd32k3ONh+nkDw1Hof+4zwUGOyJE6eMrlYzRlKM4Qxdf9JpavQvqfieAbTRWcyKeclnHeoIfE7cDBQIDAQAB",
8
8
  "background": {
package/dist/main.js CHANGED
@@ -1204,7 +1204,7 @@ function buildPeerAgentDefinitions(opts) {
1204
1204
  });
1205
1205
  if (opts.implementerModel && opts.implementerModel.length > 0) out.implementer = {
1206
1206
  description: "Bounded implementation subagent running gpt-5.5 (strong non-Claude coder, high reasoning). Use for well-scoped coding tasks — edits, small features, fixes — you want implemented in an integrated subagent. Model is overridable at spawn.",
1207
- prompt: "You are a bounded implementation subagent for well-scoped coding tasks. Implement the requested change surgically, matching the surrounding code style and minimizing unrelated churn. Verify with the project's build or tests where applicable. Do the work yourself — do not spawn further subagents. Report exactly what changed and any risks.",
1207
+ prompt: "You are a bounded implementation subagent for well-scoped coding tasks. Implement the requested change surgically, matching the surrounding code style and minimizing unrelated churn. Use the dedicated Edit/Write/Read tools for file changes and Grep/Glob for search; reserve Bash for running builds, tests, and git — do not shell out (sed/awk/python/here-docs) to read or edit files. Verify with the project's build or tests where applicable. Do the work yourself — do not spawn further subagents. Report exactly what changed and any risks.",
1208
1208
  model: opts.implementerModel
1209
1209
  };
1210
1210
  if (opts.workerToolsAvailable) {
@@ -4095,7 +4095,7 @@ function initProxyFromEnv() {
4095
4095
  //#endregion
4096
4096
  //#region package.json
4097
4097
  var name = "github-router";
4098
- var version$1 = "0.3.162";
4098
+ var version$1 = "0.3.163";
4099
4099
 
4100
4100
  //#endregion
4101
4101
  //#region src/lib/approval.ts
@@ -4918,6 +4918,34 @@ function clampEffort(bucketed, supported) {
4918
4918
 
4919
4919
  //#endregion
4920
4920
  //#region src/lib/anthropic-translate/anthropic-request.ts
4921
+ /**
4922
+ * Steering appended to `instructions` for shim-routed (non-Claude) models when
4923
+ * the request carries Claude Code's native file tools. gpt-5.5 and other
4924
+ * OpenAI/Gemini-lineage models receive the Edit/Write tool definitions verbatim
4925
+ * (the shim never mangles them), but their base prior is to script file ops in
4926
+ * Python/Bash rather than call the dedicated tools. Claude models never reach
4927
+ * this code path (they fall through to the /v1/messages passthrough), so this is
4928
+ * automatically scoped to the models that need the nudge. Strong PREFERENCE, not
4929
+ * a Bash ban — running builds/tests/git still belongs in Bash.
4930
+ */
4931
+ const FILE_TOOL_GUIDANCE = `<file_tools>
4932
+ You have dedicated tools for files: use Read to read a file, Edit to modify an existing file, and Write to create one. Prefer them over shell for reading or editing. Do NOT shell out (cat, sed, awk, echo >, here-docs, or python/one-off scripts) to read, search, or rewrite file contents when a dedicated tool exists — the dedicated tools are safer and produce reviewable diffs. Use Grep/Glob to search rather than shell grep/find. Reserve Bash for commands that have no dedicated tool: builds, tests, git, package managers, and running programs.
4933
+ </file_tools>`;
4934
+ /**
4935
+ * Append `FILE_TOOL_GUIDANCE` to the flattened system `instructions` iff the
4936
+ * request carries Claude Code's canonical `Edit` or `Write` tool. The exact
4937
+ * capitalized-name match is deliberately precise: it fires for a Claude Code
4938
+ * editing session but not for arbitrary MCP tools like `write_file`, and not for
4939
+ * non-editing chats (so a plain gpt-5.5 conversation is not polluted). The block
4940
+ * is appended AFTER the existing instructions (end-of-prompt recency) and the
4941
+ * original system text is preserved, never replaced. Opt out with
4942
+ * `GH_ROUTER_DISABLE_SHIM_TOOL_STEERING=1`.
4943
+ */
4944
+ function appendFileToolGuidance(instructions, tools) {
4945
+ if (parseBoolEnv(process.env.GH_ROUTER_DISABLE_SHIM_TOOL_STEERING) === true) return instructions;
4946
+ if (!tools?.some((t) => t.name === "Edit" || t.name === "Write")) return instructions;
4947
+ return instructions && instructions.length > 0 ? `${instructions}\n\n${FILE_TOOL_GUIDANCE}` : FILE_TOOL_GUIDANCE;
4948
+ }
4921
4949
  /** Flatten Anthropic `system` (string | array of text blocks) into a string. */
4922
4950
  function flattenSystem(system) {
4923
4951
  if (typeof system === "string") return system.length > 0 ? system : void 0;
@@ -5183,11 +5211,12 @@ function parseAnthropicRequest(body, resolvedModel, model) {
5183
5211
  }
5184
5212
  const maxTokens = typeof body.max_tokens === "number" && body.max_tokens > 0 ? body.max_tokens : void 0;
5185
5213
  const stopSequences = Array.isArray(body.stop_sequences) ? body.stop_sequences.filter((s) => typeof s === "string") : void 0;
5214
+ const tools = parseTools(body.tools);
5186
5215
  return {
5187
5216
  model: resolvedModel,
5188
- instructions: flattenSystem(body.system),
5217
+ instructions: appendFileToolGuidance(flattenSystem(body.system), tools),
5189
5218
  messages,
5190
- tools: parseTools(body.tools),
5219
+ tools,
5191
5220
  toolChoice: parseToolChoice(body.tool_choice),
5192
5221
  parallelToolCalls: parseDisableParallelToolUse(body.tool_choice),
5193
5222
  reasoningEffort: body.thinking === void 0 ? defaultReasoningEffort(model) : parseReasoningEffort(body.thinking, model),