@1presence/bridge 0.84.0 → 0.86.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 +9 -6
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/claude.js
CHANGED
|
@@ -254,11 +254,6 @@ export function spawnClaude(params) {
|
|
|
254
254
|
}
|
|
255
255
|
else {
|
|
256
256
|
process.stderr.write(`[bridge] session ${presenceSessionId}\n`);
|
|
257
|
-
const prompt = text.replace(/\s+/g, ' ').trim();
|
|
258
|
-
if (prompt) {
|
|
259
|
-
const shown = prompt.length > 300 ? `${prompt.slice(0, 300)}…` : prompt;
|
|
260
|
-
process.stderr.write(paint(SECTION_COLORS.user, `[bridge] ▸ ${shown}`) + '\n');
|
|
261
|
-
}
|
|
262
257
|
}
|
|
263
258
|
void vaultFileOpen;
|
|
264
259
|
void clientCapabilities;
|
|
@@ -548,6 +543,7 @@ export function spawnClaude(params) {
|
|
|
548
543
|
.finally(() => { mcpReconnecting = false; });
|
|
549
544
|
};
|
|
550
545
|
try {
|
|
546
|
+
let lastSurfaceLog = '';
|
|
551
547
|
const q = query({ prompt: input.stream, options });
|
|
552
548
|
for await (const m of q) {
|
|
553
549
|
if (m.isReplay)
|
|
@@ -561,7 +557,11 @@ export function spawnClaude(params) {
|
|
|
561
557
|
if (handleEvent(event))
|
|
562
558
|
onEvent(event);
|
|
563
559
|
const surface = assessRemoteMcpSurface(m);
|
|
564
|
-
|
|
560
|
+
const surfaceLine = `[bridge] mcp surface: ${REMOTE_MCP_SERVER_NAME}=${surface.status}, ${surface.toolCount} tool(s)`;
|
|
561
|
+
if (surfaceLine !== lastSurfaceLog) {
|
|
562
|
+
lastSurfaceLog = surfaceLine;
|
|
563
|
+
process.stderr.write(paint(surface.usable ? SECTION_COLORS.system : SECTION_COLORS.error, surfaceLine) + '\n');
|
|
564
|
+
}
|
|
565
565
|
if (!surface.usable) {
|
|
566
566
|
let detail = '';
|
|
567
567
|
try {
|
|
@@ -572,6 +572,9 @@ export function spawnClaude(params) {
|
|
|
572
572
|
}
|
|
573
573
|
catch { }
|
|
574
574
|
process.stderr.write(paint(SECTION_COLORS.error, `[bridge] FATAL no 1Presence tools this turn (${surface.status}) — ending the turn rather than answering blind${detail}`) + '\n');
|
|
575
|
+
if (surface.status === 'needs-auth' && !detail) {
|
|
576
|
+
process.stderr.write(paint(SECTION_COLORS.error, '[bridge] ↳ the server asked for OAuth, which Local Mode does not use — this is NOT a stale local token, and restarting will not clear it. The gateway is rejecting this account\'s token on /mcp.') + '\n');
|
|
577
|
+
}
|
|
575
578
|
active.delete(conversationId);
|
|
576
579
|
clearTimeout(inputReleaseTimer);
|
|
577
580
|
input.release();
|
package/dist/index.js
CHANGED
|
@@ -169,7 +169,7 @@ function writeMcpConfig(auth) {
|
|
|
169
169
|
mcpServers: {
|
|
170
170
|
'1presence': {
|
|
171
171
|
type: 'sse',
|
|
172
|
-
url: `${GATEWAY_HTTP}/mcp`,
|
|
172
|
+
url: `${GATEWAY_HTTP}/mcp/bridge`,
|
|
173
173
|
headers: { Authorization: `Bearer ${token}` },
|
|
174
174
|
alwaysLoad: true,
|
|
175
175
|
},
|
|
@@ -539,7 +539,7 @@ function connect(auth, retryDelay = 1000) {
|
|
|
539
539
|
const now = new Date();
|
|
540
540
|
const ts = `${now.toLocaleDateString(undefined, { day: '2-digit', month: 'short' })} ${now.toLocaleTimeString()}`;
|
|
541
541
|
const hist = Array.isArray(history) ? history : [];
|
|
542
|
-
console.log(`[${ts}] ▶ ${text}${hist.length ? ` (history: ${hist.length} turn${hist.length === 1 ? '' : 's'})` : ''}`);
|
|
542
|
+
console.log(paint(SECTION_COLORS.user, `[${ts}] ▶ ${text}${hist.length ? ` (history: ${hist.length} turn${hist.length === 1 ? '' : 's'})` : ''}`));
|
|
543
543
|
startTurnTimer();
|
|
544
544
|
handleMessage(conversationId, text, sessionId ?? null, hist, auth, vaultFileOpen, clientCapabilities, syncedFolders, agentSlug, model).catch((err) => {
|
|
545
545
|
stopTurnTimer();
|