@abide/bridge 0.3.2 → 0.3.4

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,17 @@
1
1
  # @abide/bridge
2
2
 
3
+ ## 0.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 48cfc3e: multimodal transcripts — an `AssistantMessage`'s `content` is its words or its pieces in order, each `AssistantContent` text or an image as base64 with its type. `assistant` refuses an image a model can't take or one outside a user turn, and hands a `Provider` every turn as its pieces, words alone as one text piece. `claudeApi` shows each image to the model as an image block in its place, and `claudeCode` sends the one message Claude Code is sent as Messages API blocks, each image in its place. RULEBOOK 44.5, 44.36, 44.37, 44.38, 44.39
8
+
9
+ ## 0.3.3
10
+
11
+ ### Patch Changes
12
+
13
+ - f9b3789: a request is never reaped by the idle timeout while it is being answered, an idle connection is reaped after 10 seconds, and every event stream beats every 15 seconds ([`14eea6e`](https://github.com/briancray/abide/commit/14eea6e7ae0b72eb194c16e17ca4e7c4498baf46))
14
+
3
15
  ## 0.3.2
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abide/bridge",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
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",
@@ -27,7 +27,7 @@
27
27
  "CHANGELOG.md"
28
28
  ],
29
29
  "engines": {
30
- "bun": ">=1.4.3"
30
+ "bun": ">=1.4.4"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@abide/abide": "workspace:*"
package/src/bridge.ts CHANGED
@@ -26,7 +26,7 @@ const LAST_REDIAL_MILLISECONDS = 8_000
26
26
  export const RESUME_MILLISECONDS = 60_000
27
27
  // abide's `HEARTBEAT_MILLISECONDS`, spelled out for `BRIDGE_PATH`'s reason.
28
28
  export const HEARTBEAT_MILLISECONDS = 15_000
29
- // 44.28 — how long the stream may go without a line before it is taken for dropped.
29
+ // 44.27 — how long the stream may go without a line before it is taken for dropped.
30
30
  export const SILENCE_MILLISECONDS = 3 * HEARTBEAT_MILLISECONDS
31
31
 
32
32
  type SiteFrame =
@@ -162,7 +162,7 @@ export async function bridge(options: {
162
162
  }
163
163
 
164
164
  const turns = new Map<string, AbortController>()
165
- // 44.31 — A SIGNAL ENDS THE RUNS WITH THE BRIDGE: exiting on one skips every `finally`, so a run
165
+ // 44.30 — A SIGNAL ENDS THE RUNS WITH THE BRIDGE: exiting on one skips every `finally`, so a run
166
166
  // still going would outlive it, orphaned.
167
167
  const signals = { SIGHUP: 129, SIGINT: 130, SIGTERM: 143 } as const
168
168
  const stopped = (signal: keyof typeof signals): void => {
@@ -296,7 +296,7 @@ export async function bridge(options: {
296
296
  try {
297
297
  let bye = false
298
298
  for (;;) {
299
- // 44.28 — a stream silent past the bound is cut, and redialed as one that dropped.
299
+ // 44.27 — a stream silent past the bound is cut, and redialed as one that dropped.
300
300
  const silence = setTimeout(
301
301
  () => dialed.abort(),
302
302
  silenceMilliseconds,
package/src/claudeTurn.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // `assistant` yields. Claude Code runs its own loop; its tools are the site's, reached through the MCP
3
3
  // server this bridge runs on loopback, and whatever built-in tools the visitor gave this bridge.
4
4
  //
5
- // THE SITE ASKS, THE VISITOR GRANTS (44.15, 44.16, 44.30). Every option is Claude Code's own, by name:
5
+ // THE SITE ASKS, THE VISITOR GRANTS (44.15, 44.16, 44.29). Every option is Claude Code's own, by name:
6
6
  // a site's is laid on as its flag where it only shapes the answer, and its `tools` are a request the
7
7
  // visitor's own `--tools` narrows. What reaches this machine — a user's settings, a project's
8
8
  // CLAUDE.md, the files around it, its shell, the web from its network — is the visitor's to give, on
@@ -19,10 +19,10 @@ const SERVER_NAME = 'app'
19
19
  const SERVER_TOOLS = `mcp__${SERVER_NAME}`
20
20
  const TOOL_PREFIX = `${SERVER_TOOLS}__`
21
21
 
22
- /** What the site asks of one turn. */
22
+ /** What the site asks of one turn: its one message, as Messages API blocks. */
23
23
  export type TurnRequest = {
24
24
  id: string
25
- prompt: string
25
+ prompt: unknown[]
26
26
  config: ClaudeCodeConfig
27
27
  maxTurns: number
28
28
  }
@@ -133,7 +133,7 @@ function takeFlag(args: string[], spellings: string[]): string[] | undefined {
133
133
 
134
134
  /**
135
135
  * Every flag but the protocol's: the site's, then the visitor's — so theirs wins where both set one —
136
- * then the built-in tools both named (44.30), and no setting source where the visitor named none.
136
+ * then the built-in tools both named (44.29), and no setting source where the visitor named none.
137
137
  * Beside them, the tools the site asked for that the visitor did not give.
138
138
  */
139
139
  function launchFlags(
@@ -262,7 +262,7 @@ export async function claudeTurn(
262
262
  delta?.type === 'text_delta'
263
263
  )
264
264
  options.report({ type: 'text', text: delta.text as string })
265
- // 44.29 — the call is announced as the model starts writing it, its input once written.
265
+ // 44.28 — the call is announced as the model starts writing it, its input once written.
266
266
  else if (
267
267
  line.event?.type === 'content_block_start' &&
268
268
  started?.type === 'tool_use'