@1presence/bridge 0.51.0 → 0.52.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
@@ -234,7 +234,7 @@ async function* promptStream(messages) {
234
234
  }
235
235
  // ─── Spawn (drive one turn through the SDK) ──────────────────────────────────────
236
236
  export function spawnClaude(params) {
237
- const { conversationId, presenceSessionId, text, uid, history, vaultFileOpen, clientCapabilities, syncedFolders, onEvent, onDone, onError, onNotice } = params;
237
+ const { conversationId, presenceSessionId, text, uid, history, vaultFileOpen, clientCapabilities, syncedFolders, model: perTurnModel, onEvent, onDone, onError, onNotice } = params;
238
238
  const systemPromptPath = join(tmpdir(), `agent-${uid}.md`);
239
239
  const mcpConfigPath = join(tmpdir(), `mcp-${uid}.json`);
240
240
  if (verbose) {
@@ -337,7 +337,7 @@ export function spawnClaude(params) {
337
337
  if (!safeEnv['MAX_MCP_OUTPUT_TOKENS']) {
338
338
  safeEnv['MAX_MCP_OUTPUT_TOKENS'] = '200000';
339
339
  }
340
- const pinnedModel = getBridgeModel();
340
+ const pinnedModel = perTurnModel ?? getBridgeModel();
341
341
  // Process one translated raw stream-json event: bookkeeping + forward. Mirrors
342
342
  // the old CLI stdout parser so the gateway/accumulator see identical shapes.
343
343
  // Returns false when the event must be suppressed (errors) or the turn was
package/dist/index.js CHANGED
@@ -219,7 +219,7 @@ function isUuid(value) {
219
219
  return UUID_RE.test(value);
220
220
  }
221
221
  // ─── Handle a single incoming message (token refresh + spawn) ─────────────────
222
- async function handleMessage(conversationId, text, sessionId, history, auth, vaultFileOpen, clientCapabilities, syncedFolders, agentSlug) {
222
+ async function handleMessage(conversationId, text, sessionId, history, auth, vaultFileOpen, clientCapabilities, syncedFolders, agentSlug, model) {
223
223
  // Refresh JWT if <10 min remaining before spawning Claude
224
224
  let activeAuth = auth;
225
225
  try {
@@ -322,6 +322,7 @@ async function handleMessage(conversationId, text, sessionId, history, auth, vau
322
322
  vaultFileOpen,
323
323
  clientCapabilities,
324
324
  syncedFolders,
325
+ model,
325
326
  onEvent: (event) => {
326
327
  accumulator.consume(event);
327
328
  if (!responding && event['type'] === 'assistant') {
@@ -500,12 +501,12 @@ function connect(auth, retryDelay = 1000) {
500
501
  }
501
502
  if (msg.type !== 'message' || !msg.conversationId || !msg.text)
502
503
  return;
503
- const { conversationId, text, sessionId, history, vaultFileOpen, clientCapabilities, syncedFolders, agentSlug } = msg;
504
+ const { conversationId, text, sessionId, history, vaultFileOpen, clientCapabilities, syncedFolders, agentSlug, model } = msg;
504
505
  const ts = new Date().toLocaleTimeString();
505
506
  const hist = Array.isArray(history) ? history : [];
506
507
  console.log(`[${ts}] ▶ ${text}${hist.length ? ` (history: ${hist.length} turn${hist.length === 1 ? '' : 's'})` : ''}`);
507
508
  startTurnTimer();
508
- handleMessage(conversationId, text, sessionId ?? null, hist, auth, vaultFileOpen, clientCapabilities, syncedFolders, agentSlug).catch((err) => {
509
+ handleMessage(conversationId, text, sessionId ?? null, hist, auth, vaultFileOpen, clientCapabilities, syncedFolders, agentSlug, model).catch((err) => {
509
510
  stopTurnTimer();
510
511
  console.error(`[bridge] handleMessage error: ${err.message}`);
511
512
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1presence/bridge",
3
- "version": "0.51.0",
3
+ "version": "0.52.0",
4
4
  "description": "Run 1Presence on your Mac and use your Claude.ai Pro subscription from any device",
5
5
  "type": "module",
6
6
  "bin": {