@abide/bridge 0.9.1 → 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 CHANGED
@@ -1,5 +1,14 @@
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
+
3
12
  ## 0.9.1
4
13
 
5
14
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abide/bridge",
3
- "version": "0.9.1",
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",
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') ?? '').includes(
331
- 'text/event-stream',
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 — or, where they passed none, the user
95
- * scope of their Claude Code configuration. Read each time, so a server added since is found. 44.58.
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 (sources === undefined) {
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
- } else
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
- configured = await visitorServers(sources)
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 (45.15), or `undefined` where
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
  */
@@ -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
- let named = UNSHOWN.has(tool)
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