@1presence/bridge 0.22.0 → 0.23.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
@@ -97,8 +97,12 @@ function spawnClaude(params) {
97
97
  // - `--no-session-persistence` keeps no jsonl on disk. The bridge has zero
98
98
  // local filesystem dependency for continuity; Firestore is the only
99
99
  // source of truth.
100
- // - `--session-id <presenceSessionId>` pins the CLI session UUID to the
101
- // presence sessionId so logs across bridge/gateway are easy to correlate.
100
+ // - `--session-id <uuid>` must be a fresh UUID per spawn: the CLI treats
101
+ // this flag as a "claim a new session ID" operation and rejects the
102
+ // second spawn with "Session ID X is already in use" if we reuse one
103
+ // across turns of a chat — even with --no-session-persistence. The
104
+ // bridge passes the per-spawn `conversationId` here; the presence
105
+ // sessionId is correlated separately via bridge logs and spool records.
102
106
  const args = [
103
107
  '--print',
104
108
  '--input-format', 'stream-json',
package/dist/index.js CHANGED
@@ -171,10 +171,14 @@ async function handleMessage(conversationId, text, sessionId, history, auth, vau
171
171
  const accumulator = (0, accumulator_1.makeBridgeAccumulator)();
172
172
  const startedAt = Date.now();
173
173
  const turnSessionId = sessionId ?? conversationId; // gateway always supplies one; defensive fallback
174
- // --session-id requires a UUID; turnSessionId is always one in practice
175
- // (gateway generates via crypto.randomUUID). Defensive: if a non-UUID slips
176
- // through, fall back to conversationId which is also crypto.randomUUID.
177
- const claudePinnedSessionId = isUuid(turnSessionId) ? turnSessionId : conversationId;
174
+ // The CLI's `--session-id` is treated as a "claim this new session ID"
175
+ // operation passing the same UUID across turns of one chat (which is
176
+ // what the presence sessionId is) makes turn 2 fail with "Session ID X
177
+ // is already in use", even with --no-session-persistence. Use the
178
+ // per-spawn conversationId instead — continuity comes from history
179
+ // replay via --input-format stream-json, not from CLI session tracking.
180
+ // turnSessionId is still kept for spool records / log correlation.
181
+ const claudePinnedSessionId = isUuid(conversationId) ? conversationId : crypto.randomUUID();
178
182
  function buildSpoolRecord(usage, model) {
179
183
  const s = accumulator.state();
180
184
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1presence/bridge",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Run 1Presence on your Mac and use your Claude.ai Pro subscription from any device",
5
5
  "bin": {
6
6
  "1presence-bridge": "dist/index.js"