@1presence/bridge 0.63.0 → 0.64.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/claude.js +26 -4
  2. package/package.json +1 -1
package/dist/claude.js CHANGED
@@ -663,7 +663,10 @@ export function spawnClaude(params) {
663
663
  // callable tools and confabulated tool calls as text. See vault/Bugs.md.)
664
664
  cwd: BRIDGE_CWD,
665
665
  abortController: abort,
666
- includePartialMessages: false, // whole messages, matching the old non-partial path
666
+ includePartialMessages: true, // token-level streaming: emit stream_event partial deltas so
667
+ // Local Mode streams like hosted (see the stream_event case below).
668
+ // The whole `assistant` message STILL arrives and stays
669
+ // authoritative for tool_use / usage / storage / the tool-XML scrub.
667
670
  permissionMode: 'default',
668
671
  env: safeEnv,
669
672
  // Surface the SDK/CLI's own stderr. In verbose mode pass everything; in
@@ -830,9 +833,28 @@ export function spawnClaude(params) {
830
833
  }
831
834
  break;
832
835
  }
833
- // Everything else (partial messages, status, hooks, notifications,
834
- // thinking tokens, …) is SDK-internal not part of the CLI event
835
- // contract the gateway/accumulator understand, so it is dropped.
836
+ // Partial assistant deltas (includePartialMessages:true). Forward ONLY
837
+ // text deltas, as the gateway translator's {type:'text'} partial event,
838
+ // so Local Mode paints token-by-token like hosted. The whole `assistant`
839
+ // message still arrives after and stays authoritative for tool_use, usage,
840
+ // storage and the tool-XML scrub — so partials bypass handleEvent (they
841
+ // carry text only; the whole message is what handleEvent scans). Other
842
+ // partial event kinds (input_json_delta, thinking, message_start/stop) are
843
+ // SDK-internal and dropped. NOTE: partials are forwarded pre-scrub — the
844
+ // confab-tool-XML guard in handleEvent only cleans the whole message
845
+ // (storage). That guard exists for the no-callable-tools case; this bridge
846
+ // has callable tools, so confabulated XML shouldn't occur in a live turn.
847
+ case 'stream_event': {
848
+ const se = m;
849
+ const ev = se.event;
850
+ if (ev?.type === 'content_block_delta' && ev.delta?.type === 'text_delta' && ev.delta.text) {
851
+ onEvent({ type: 'text', text: ev.delta.text });
852
+ }
853
+ break;
854
+ }
855
+ // Everything else (status, hooks, notifications, thinking tokens, …) is
856
+ // SDK-internal — not part of the CLI event contract the gateway/accumulator
857
+ // understand, so it is dropped.
836
858
  default:
837
859
  break;
838
860
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1presence/bridge",
3
- "version": "0.63.0",
3
+ "version": "0.64.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",