@abide/bridge 0.9.0 → 0.9.2
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/CHANGELOG.md +15 -0
- package/package.json +3 -2
- package/src/callTool.ts +5 -3
- package/src/grant.ts +12 -5
- package/src/opened.ts +1 -1
- package/src/requestedLines.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @abide/bridge
|
|
2
2
|
|
|
3
|
+
## 0.9.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bench:share navigates between two pages the docs have; citations that resolve to the wrong clause point at the right one ([`89a42d5`](https://github.com/briancray/abide/commit/89a42d581c4fcd0a8a80c667692ecda7518f7c81))
|
|
8
|
+
- the bridge carries no abide at run time, held by a test ([`ff0827e`](https://github.com/briancray/abide/commit/ff0827e11b7f957c51210595662266018aafb926))
|
|
9
|
+
- 660c375: A bridge reads a visitor's MCP server answering `Text/Event-Stream` as a stream, however the media type is cased
|
|
10
|
+
- b5e98bd: A bridge run `--full` and passed an `--mcp-config` finds the visitor's user-scope MCP servers too, as the full turn does: a tool of a user-scope server is granted rather than reported missing
|
|
11
|
+
|
|
12
|
+
## 0.9.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- a8ce49b: buildCompiledPage scratches through temporaryModule, harness stops publishing buildInjectable, two comments fixed ([`9efac50`](https://github.com/briancray/abide/commit/9efac50a3a05cfc4463e0b282b6b0bcf7e249669))
|
|
17
|
+
|
|
3
18
|
## 0.9.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abide/bridge",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Connects the Claude Code on your machine to the assistant on an abide site",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"bun": ">=1.4.4"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@abide/abide": "workspace:*"
|
|
38
|
+
"@abide/abide": "workspace:*",
|
|
39
|
+
"@abide/harness": "workspace:*"
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
41
42
|
"typecheck": "bun check"
|
package/src/callTool.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { messageOf } from './messageOf.ts'
|
|
|
8
8
|
import { readLines } from './readLines.ts'
|
|
9
9
|
import { scratchDirectory } from './scratchDirectory.ts'
|
|
10
10
|
|
|
11
|
+
// The version the bridge PROPOSES as a client to a visitor's MCP server — not abide's
|
|
12
|
+
// `MCP_PROTOCOL_VERSION`, the one abide serves, so the two move independently.
|
|
11
13
|
const PROTOCOL_VERSION = '2025-06-18'
|
|
12
14
|
/** How long a `headersHelper` has to write its headers, as Claude Code gives one. */
|
|
13
15
|
const HEADERS_HELPER_MILLISECONDS = 10_000
|
|
@@ -325,9 +327,9 @@ function httpSession(
|
|
|
325
327
|
return undefined
|
|
326
328
|
}
|
|
327
329
|
if (
|
|
328
|
-
!(answer.headers.get('content-type') ?? '')
|
|
329
|
-
|
|
330
|
-
|
|
330
|
+
!(answer.headers.get('content-type') ?? '')
|
|
331
|
+
.toLowerCase()
|
|
332
|
+
.includes('text/event-stream')
|
|
331
333
|
)
|
|
332
334
|
return (await answer.json()) as RpcMessage
|
|
333
335
|
let data = ''
|
package/src/grant.ts
CHANGED
|
@@ -91,23 +91,26 @@ function userConfiguration(): string {
|
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* The MCP servers the visitor's Claude Code is configured with, by the name its tools carry: those of
|
|
94
|
-
* each `--mcp-config` they passed — a file, or JSON written out —
|
|
95
|
-
*
|
|
94
|
+
* each `--mcp-config` they passed — a file, or JSON written out — and the user scope of their Claude
|
|
95
|
+
* Code configuration where `userScope` says, by default where they passed none. Read each time, so a
|
|
96
|
+
* server added since is found. 44.58.
|
|
96
97
|
*
|
|
97
98
|
* Throws where a source they named cannot be read.
|
|
98
99
|
*/
|
|
99
100
|
export async function visitorServers(
|
|
100
101
|
sources: string[] | undefined,
|
|
102
|
+
userScope: boolean = sources === undefined,
|
|
101
103
|
): Promise<Map<string, unknown>> {
|
|
102
104
|
const servers = new Map<string, unknown>()
|
|
103
105
|
const read: { mcpServers?: Record<string, unknown> }[] = []
|
|
104
|
-
if (
|
|
106
|
+
if (userScope) {
|
|
105
107
|
// Claude Code rewrites this file while it runs, so a read caught mid-write is no servers rather
|
|
106
108
|
// than a failed turn — the visitor named no source to be told about.
|
|
107
109
|
try {
|
|
108
110
|
read.push(await Bun.file(userConfiguration()).json())
|
|
109
111
|
} catch {}
|
|
110
|
-
}
|
|
112
|
+
}
|
|
113
|
+
if (sources !== undefined)
|
|
111
114
|
for (const source of sources) {
|
|
112
115
|
const written = source.trim()
|
|
113
116
|
try {
|
|
@@ -190,7 +193,11 @@ export async function grantFor(
|
|
|
190
193
|
let configured = new Map<string, unknown>()
|
|
191
194
|
if (asksMcp)
|
|
192
195
|
try {
|
|
193
|
-
|
|
196
|
+
// 44.58 — run full, the turn reads the user scope beside each `--mcp-config` (44.82).
|
|
197
|
+
configured = await visitorServers(
|
|
198
|
+
sources,
|
|
199
|
+
full || sources === undefined,
|
|
200
|
+
)
|
|
194
201
|
} catch (thrown) {
|
|
195
202
|
if (unreadable === undefined) throw thrown
|
|
196
203
|
unreadable(messageOf(thrown))
|
package/src/opened.ts
CHANGED
|
@@ -245,7 +245,7 @@ const LARGEST_ICON = 1024 * 1024
|
|
|
245
245
|
const PNG_SIGNATURE = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]
|
|
246
246
|
|
|
247
247
|
/**
|
|
248
|
-
* The icon `site` publishes at `/icon.png`, abide's app icon (
|
|
248
|
+
* The icon `site` publishes at `/icon.png`, abide's app icon (44.90), or `undefined` where
|
|
249
249
|
* it publishes none, it is no PNG, or it is larger than any app icon — the question waits on it, so it
|
|
250
250
|
* is given three seconds.
|
|
251
251
|
*/
|
package/src/requestedLines.ts
CHANGED
|
@@ -22,6 +22,9 @@ const CAPABILITIES: readonly { line: string; tools: readonly string[] }[] = [
|
|
|
22
22
|
{ line: 'Start helper agents', tools: ['Agent', 'Task'] },
|
|
23
23
|
]
|
|
24
24
|
const UNSHOWN = new Set(['TodoWrite', 'ExitPlanMode'])
|
|
25
|
+
// Every built-in a line already names, or that is no line at all.
|
|
26
|
+
const LISTED = new Set(UNSHOWN)
|
|
27
|
+
for (const { tools } of CAPABILITIES) for (const tool of tools) LISTED.add(tool)
|
|
25
28
|
|
|
26
29
|
/**
|
|
27
30
|
* The lines naming what `tools` ask of this machine: one per capability their built-in tools give, in
|
|
@@ -40,10 +43,7 @@ export function requestedLines(tools: readonly string[]): string[] {
|
|
|
40
43
|
for (const tool of tools) {
|
|
41
44
|
const server = serverOf(tool)
|
|
42
45
|
if (server === undefined) {
|
|
43
|
-
|
|
44
|
-
for (const { tools: covered } of CAPABILITIES)
|
|
45
|
-
if (covered.includes(tool)) named = true
|
|
46
|
-
if (!named) lines.push(`Use ${tool}`)
|
|
46
|
+
if (!LISTED.has(tool)) lines.push(`Use ${tool}`)
|
|
47
47
|
continue
|
|
48
48
|
}
|
|
49
49
|
const counted = servers.get(server) ?? 0
|