@1presence/bridge 0.94.0 → 0.96.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/claude.js CHANGED
@@ -140,13 +140,17 @@ export function isPermissionTransportFailure(text) {
140
140
  export function isLiveTurnResult(result, producedRealOutput) {
141
141
  return producedRealOutput || result.is_error === true;
142
142
  }
143
- const MCP_TOOL_UNREGISTERED_RE = new RegExp(`No such tool available:\\s*(?:${MCP_TOOL_PREFIX}|${LEGACY_MCP_TOOL_PREFIX})`, 'i');
143
+ const MCP_TOOL_UNREGISTERED_RE = new RegExp(`No such tool available:\\s*((?:${MCP_TOOL_PREFIX}|${LEGACY_MCP_TOOL_PREFIX})[A-Za-z0-9_]+)`, 'i');
144
144
  export function shouldReconnectRemoteMcp(args) {
145
- const { toolName, isError, text } = args;
145
+ const { toolName, isError, text, served } = args;
146
146
  if (MCP_SESSION_EXPIRED_RE.test(text))
147
147
  return true;
148
- if (MCP_TOOL_UNREGISTERED_RE.test(text))
148
+ const unregistered = MCP_TOOL_UNREGISTERED_RE.exec(text);
149
+ if (unregistered) {
150
+ if (served && served.size > 0 && !served.has(unregistered[1]))
151
+ return false;
149
152
  return true;
153
+ }
150
154
  if (!isError || !isPresenceToolName(toolName))
151
155
  return false;
152
156
  if (OUTBOUND_NETWORK_TOOLS.has(toolName))
@@ -541,6 +545,7 @@ export function spawnClaude(params) {
541
545
  inputReleaseTimer.unref?.();
542
546
  let lastMcpReconnectAt = 0;
543
547
  let mcpReconnecting = false;
548
+ let servedPresenceTools = new Set();
544
549
  const MCP_RECONNECT_THROTTLE_MS = 10_000;
545
550
  const maybeReconnectRemoteMcp = (q) => {
546
551
  const now = Date.now();
@@ -566,9 +571,10 @@ export function spawnClaude(params) {
566
571
  const subtype = m.subtype;
567
572
  if (subtype === 'init') {
568
573
  const init = m;
569
- const event = { type: 'system', subtype: 'init', model: init.model, apiKeySource: init.apiKeySource, claude_code_version: init.claude_code_version };
574
+ const event = { type: 'system', subtype: 'init', model: init.model, apiKeySource: init.apiKeySource, claude_code_version: init.claude_code_version, session_id: init.session_id };
570
575
  if (handleEvent(event))
571
576
  onEvent(event);
577
+ servedPresenceTools = new Set((init.tools ?? []).filter((t) => isPresenceToolName(t)));
572
578
  const surface = assessRemoteMcpSurface(m);
573
579
  const surfaceLine = `[bridge] mcp surface: ${REMOTE_MCP_SERVER_NAME}=${surface.status}, ${surface.toolCount} tool(s)`;
574
580
  if (surfaceLine !== lastSurfaceLog) {
@@ -658,6 +664,7 @@ export function spawnClaude(params) {
658
664
  toolName: toolNames.get(b['tool_use_id'] ?? '') ?? '',
659
665
  isError: b['is_error'] === true,
660
666
  text: resultText,
667
+ served: servedPresenceTools,
661
668
  })) {
662
669
  maybeReconnectRemoteMcp(q);
663
670
  break;
package/dist/config.js CHANGED
@@ -54,7 +54,7 @@ function detectClaudeDefaultModel() {
54
54
  }
55
55
  const MODEL_OPTIONS = [
56
56
  { num: 1, model: null, label: 'Use Claude Code default' },
57
- { num: 2, model: 'claude-opus-5', label: 'claude-opus-5' },
57
+ { num: 2, model: 'claude-opus-5-5', label: 'claude-opus-5-5' },
58
58
  { num: 3, model: 'claude-fable-5-1', label: 'claude-fable-5-1' },
59
59
  { num: 4, model: 'claude-sonnet-5', label: 'claude-sonnet-5' },
60
60
  { num: 5, model: 'claude-haiku-4-5', label: 'claude-haiku-4-5' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1presence/bridge",
3
- "version": "0.94.0",
3
+ "version": "0.96.0",
4
4
  "description": "Run 1Presence on your Mac and use your Claude.ai Pro subscription from any device",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -21,7 +21,7 @@
21
21
  "start": "node dist/index.js"
22
22
  },
23
23
  "dependencies": {
24
- "@anthropic-ai/claude-agent-sdk": "^0.3.257",
24
+ "@anthropic-ai/claude-agent-sdk": "^0.3.280",
25
25
  "ws": "^8.20.0",
26
26
  "zod": "^4.0.0"
27
27
  },