@abide/bridge 0.3.3 → 0.3.5

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.5
4
+
5
+ ### Patch Changes
6
+
7
+ - a9f8ad1: format the repo with abide format and bun fmt ([`d7cd46d`](https://github.com/briancray/abide/commit/d7cd46da1e0cd523631d38d923f8bb08d1f0716f))
8
+
9
+ ## 0.3.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 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
14
+
3
15
  ## 0.3.3
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.3",
3
+ "version": "0.3.5",
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
@@ -8,6 +8,7 @@
8
8
  // machine, and none of this machine's reaches the site.
9
9
 
10
10
  import type { AssistantEvent } from '@abide/abide/server'
11
+
11
12
  import { claudeTurn, type TurnRequest } from './claudeTurn.ts'
12
13
  import { readLines } from './readLines.ts'
13
14
 
package/src/claudeTurn.ts CHANGED
@@ -10,7 +10,9 @@
10
10
 
11
11
  import { mkdtemp, rm } from 'node:fs/promises' // bun has no temporary directory or recursive remove of its own
12
12
  import { tmpdir } from 'node:os' // bun exposes no temporary directory of its own
13
+
13
14
  import type { AssistantEvent, ClaudeCodeConfig } from '@abide/abide/server'
15
+
14
16
  import { readLines } from './readLines.ts'
15
17
 
16
18
  // What Claude Code names the one MCP server it is handed, and so the prefix on each tool it calls.
@@ -19,10 +21,10 @@ const SERVER_NAME = 'app'
19
21
  const SERVER_TOOLS = `mcp__${SERVER_NAME}`
20
22
  const TOOL_PREFIX = `${SERVER_TOOLS}__`
21
23
 
22
- /** What the site asks of one turn. */
24
+ /** What the site asks of one turn: its one message, as Messages API blocks. */
23
25
  export type TurnRequest = {
24
26
  id: string
25
- prompt: string
27
+ prompt: unknown[]
26
28
  config: ClaudeCodeConfig
27
29
  maxTurns: number
28
30
  }
@@ -109,7 +111,7 @@ function siteFlags(config: Omit<ClaudeCodeConfig, 'tools'>): string[] {
109
111
  */
110
112
  function takeFlag(args: string[], spellings: string[]): string[] | undefined {
111
113
  let values: string[] | undefined
112
- for (let index = 0; index < args.length; ) {
114
+ for (let index = 0; index < args.length;) {
113
115
  const arg = args[index] as string
114
116
  const [flag, inline] = arg.split(/=(.*)/s) as [string, string?]
115
117
  if (!spellings.includes(flag)) {