@abide/bridge 0.9.1 → 0.9.3
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 +1 -1
- package/src/callTool.ts +3 -3
- package/src/grant.ts +12 -5
- package/src/install.ts +6 -0
- 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.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 14d5634: the installed applet declares local network use, so macOS asks rather than refusing a LAN site — 44.43 ([`109fc83`](https://github.com/briancray/abide/commit/109fc836f2d68a8e75de439d3ddeb2eef8377574))
|
|
8
|
+
|
|
9
|
+
## 0.9.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 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))
|
|
14
|
+
- the bridge carries no abide at run time, held by a test ([`ff0827e`](https://github.com/briancray/abide/commit/ff0827e11b7f957c51210595662266018aafb926))
|
|
15
|
+
- 660c375: A bridge reads a visitor's MCP server answering `Text/Event-Stream` as a stream, however the media type is cased
|
|
16
|
+
- 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
|
|
17
|
+
|
|
3
18
|
## 0.9.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/package.json
CHANGED
package/src/callTool.ts
CHANGED
|
@@ -327,9 +327,9 @@ function httpSession(
|
|
|
327
327
|
return undefined
|
|
328
328
|
}
|
|
329
329
|
if (
|
|
330
|
-
!(answer.headers.get('content-type') ?? '')
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
!(answer.headers.get('content-type') ?? '')
|
|
331
|
+
.toLowerCase()
|
|
332
|
+
.includes('text/event-stream')
|
|
333
333
|
)
|
|
334
334
|
return (await answer.json()) as RpcMessage
|
|
335
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/install.ts
CHANGED
|
@@ -210,6 +210,12 @@ async function installMac(
|
|
|
210
210
|
for (const [key, type, value] of [
|
|
211
211
|
['CFBundleIdentifier', '-string', IDENTIFIER],
|
|
212
212
|
['LSUIElement', '-bool', 'YES'],
|
|
213
|
+
// Without it macOS never asks for Local Network access, and a bridge to a LAN site is refused.
|
|
214
|
+
[
|
|
215
|
+
'NSLocalNetworkUsageDescription',
|
|
216
|
+
'-string',
|
|
217
|
+
'Pairs your Claude Code with sites on your local network.',
|
|
218
|
+
],
|
|
213
219
|
[
|
|
214
220
|
'CFBundleURLTypes',
|
|
215
221
|
'-json',
|
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
|