@abide/bridge 0.6.1 → 0.6.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,11 @@
1
1
  # @abide/bridge
2
2
 
3
+ ## 0.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 068afc4: constants abide's tests read are leaves, and grant.ts exports only what is imported ([`c16c791`](https://github.com/briancray/abide/commit/c16c791c1cee3a1a4f06e648608b42e375679dc0))
8
+
3
9
  ## 0.6.1
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abide/bridge",
3
- "version": "0.6.1",
3
+ "version": "0.6.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",
@@ -0,0 +1,3 @@
1
+ // abide's `BRIDGE_ADDRESS`, spelled out because the bridge carries no abide at run time — a test
2
+ // holds the two equal.
3
+ export const BRIDGE_PATH = '/__abide/bridge'
@@ -0,0 +1,2 @@
1
+ // abide's `HEARTBEAT_MILLISECONDS`, spelled out for `BRIDGE_PATH`'s reason.
2
+ export const HEARTBEAT_MILLISECONDS = 15_000
@@ -0,0 +1,2 @@
1
+ // abide's `BRIDGE_SCHEME`, spelled out for `BRIDGE_PATH`'s reason — a test holds the two equal.
2
+ export const PAIRING_SCHEME = 'abide-bridge'
@@ -0,0 +1,3 @@
1
+ // abide's `RESUME_MILLISECONDS`, spelled out for `BRIDGE_PATH`'s reason: past it the site no longer
2
+ // holds the pairing, and a redial is refused.
3
+ export const RESUME_MILLISECONDS = 60_000
package/src/bridge.ts CHANGED
@@ -9,15 +9,15 @@
9
9
 
10
10
  import type { ProviderEvent } from '@abide/abide/server'
11
11
 
12
+ import { BRIDGE_PATH } from './BRIDGE_PATH.ts'
12
13
  import { claudeTurn, type TurnRequest } from './claudeTurn.ts'
13
14
  import { grantFor, withheldNotices } from './grant.ts'
15
+ import { HEARTBEAT_MILLISECONDS } from './HEARTBEAT_MILLISECONDS.ts'
14
16
  import { siteOf } from './pairingLink.ts'
15
17
  import { readLines } from './readLines.ts'
18
+ import { RESUME_MILLISECONDS } from './RESUME_MILLISECONDS.ts'
16
19
  import { siteTls } from './siteTls.ts'
17
20
 
18
- // abide's `BRIDGE_ADDRESS`, spelled out because the bridge carries no abide at run time — a test
19
- // holds the two equal.
20
- export const BRIDGE_PATH = '/__abide/bridge'
21
21
  // How long reports gather before they are posted, so a streamed reply is not a post per token.
22
22
  const BATCH_MILLISECONDS = 15
23
23
  // 44.24 — how long a relayed MCP request waits for the site's reply.
@@ -25,11 +25,6 @@ const REPLY_MILLISECONDS = 120_000
25
25
  // 44.25 — the first wait before redialing a dropped stream, doubled per failed dial up to the last.
26
26
  const FIRST_REDIAL_MILLISECONDS = 250
27
27
  const LAST_REDIAL_MILLISECONDS = 8_000
28
- // abide's `RESUME_MILLISECONDS`, spelled out for `BRIDGE_PATH`'s reason: past it the site no longer
29
- // holds the pairing, and a redial is refused.
30
- export const RESUME_MILLISECONDS = 60_000
31
- // abide's `HEARTBEAT_MILLISECONDS`, spelled out for `BRIDGE_PATH`'s reason.
32
- export const HEARTBEAT_MILLISECONDS = 15_000
33
28
  // 44.27 — how long the stream may go without a line before it is taken for dropped.
34
29
  export const SILENCE_MILLISECONDS = 3 * HEARTBEAT_MILLISECONDS
35
30
 
package/src/claudeTurn.ts CHANGED
@@ -114,7 +114,7 @@ function siteFlags(config: Omit<ClaudeCodeConfig, 'tools'>): string[] {
114
114
  * Every flag but the protocol's: the site's, then the visitor's — so theirs wins where both set one —
115
115
  * then the tools the site asked for and the visitor granted (44.29), and no setting source where the
116
116
  * visitor named none.
117
- * Beside them, what the site was given of this machine (`grantOf`).
117
+ * Beside them, what the site was given of this machine (`grantFor`).
118
118
  */
119
119
  async function launchFlags(
120
120
  config: ClaudeCodeConfig,
package/src/grant.ts CHANGED
@@ -52,7 +52,7 @@ export function takeFlag(
52
52
  }
53
53
 
54
54
  /** The tools the visitor granted, each `--tools` value split on commas and spaces. */
55
- export function grantedOf(values: string[] | undefined): Set<string> {
55
+ function grantedOf(values: string[] | undefined): Set<string> {
56
56
  const granted = new Set<string>()
57
57
  for (const value of values ?? [])
58
58
  for (const tool of value.split(/[\s,]+/))
@@ -61,7 +61,7 @@ export function grantedOf(values: string[] | undefined): Set<string> {
61
61
  }
62
62
 
63
63
  /** The server an MCP tool name is of — `calendar` for `mcp__calendar__meetings` or `mcp__calendar` — or `undefined` for a built-in. */
64
- export function serverOf(tool: string): string | undefined {
64
+ function serverOf(tool: string): string | undefined {
65
65
  if (!tool.startsWith('mcp__')) return undefined
66
66
  const rest = tool.slice('mcp__'.length)
67
67
  const end = rest.indexOf('__')
package/src/install.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  import { rm } from 'node:fs/promises' // bun has no recursive remove of its own
16
16
 
17
17
  import type { HandlerSettings } from './opened.ts'
18
- import { PAIRING_SCHEME } from './pairingLink.ts'
18
+ import { PAIRING_SCHEME } from './PAIRING_SCHEME.ts'
19
19
 
20
20
  const APP_NAME = 'abide bridge'
21
21
  export const IDENTIFIER = 'abide.bridge'
package/src/opened.ts CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  allowedSites,
18
18
  allowsUnasked,
19
19
  } from './allowedSites.ts'
20
- import { BRIDGE_PATH } from './bridge.ts'
20
+ import { BRIDGE_PATH } from './BRIDGE_PATH.ts'
21
21
  import { type Answer, ask, notify } from './desktop.ts'
22
22
  import { grantFor, serversNamed } from './grant.ts'
23
23
  import { type Pairing, pairingOf } from './pairingLink.ts'
@@ -3,8 +3,7 @@
3
3
  // release that speaks the site's relay and the tools of this machine it asks for — and nothing more,
4
4
  // and the handler asks the visitor before it runs one (44.42).
5
5
 
6
- // abide's `BRIDGE_SCHEME`, spelled out for `BRIDGE_PATH`'s reason — a test holds the two equal.
7
- export const PAIRING_SCHEME = 'abide-bridge'
6
+ import { PAIRING_SCHEME } from './PAIRING_SCHEME.ts'
8
7
 
9
8
  /** One pairing a link asks for. */
10
9
  export type Pairing = {