@ai-sdk/harness-opencode 1.0.72 → 1.0.73
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 +13 -0
- package/dist/bridge/index.mjs +16 -1
- package/dist/bridge/index.mjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +185 -69
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/bridge/index.ts +3 -0
- package/src/bridge/opencode-server-auth.ts +15 -0
- package/src/opencode-auth.ts +101 -4
- package/src/opencode-bootstrap.ts +58 -0
- package/src/opencode-harness.ts +75 -76
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/harness-opencode
|
|
2
2
|
|
|
3
|
+
## 1.0.73
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 69bb613: feat(harness): support request transformations in network sandbox abstraction and use it to apply credential brokering when available
|
|
8
|
+
- 52bc889: feat(harness): add `getPortEndpoint()` as more comprehensive replacement to `getPortUrl()` (now deprecated) in `HarnessV1NetworkSandboxSession`
|
|
9
|
+
- 4cd4989: chore(harness): decouple bridge based harness bootstrap recipe logic from dynamic params and enforce unique harnesses in `prepareSandboxForHarness()` helper
|
|
10
|
+
- 02af883: fix(harness-opencode): enhance local OpenCode server behavior
|
|
11
|
+
- Updated dependencies [69bb613]
|
|
12
|
+
- Updated dependencies [52bc889]
|
|
13
|
+
- Updated dependencies [4cd4989]
|
|
14
|
+
- @ai-sdk/harness@1.0.72
|
|
15
|
+
|
|
3
16
|
## 1.0.72
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/bridge/index.mjs
CHANGED
|
@@ -1259,6 +1259,19 @@ function prependOpenCodeBinToPath({
|
|
|
1259
1259
|
].join(path.delimiter);
|
|
1260
1260
|
}
|
|
1261
1261
|
|
|
1262
|
+
// src/bridge/opencode-server-auth.ts
|
|
1263
|
+
import { randomBytes } from "crypto";
|
|
1264
|
+
function configureOpenCodeServerAuth({
|
|
1265
|
+
env
|
|
1266
|
+
}) {
|
|
1267
|
+
const username = env.OPENCODE_SERVER_USERNAME ?? "opencode";
|
|
1268
|
+
const password = randomBytes(32).toString("hex");
|
|
1269
|
+
env.OPENCODE_SERVER_PASSWORD = password;
|
|
1270
|
+
return {
|
|
1271
|
+
Authorization: `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1262
1275
|
// src/bridge/tool-relay.ts
|
|
1263
1276
|
import { createServer } from "http";
|
|
1264
1277
|
|
|
@@ -1540,6 +1553,7 @@ async function ensureRuntime({
|
|
|
1540
1553
|
requestToolResult: turn.requestToolResult
|
|
1541
1554
|
});
|
|
1542
1555
|
}
|
|
1556
|
+
const serverAuthHeaders = configureOpenCodeServerAuth({ env: procEnv2 });
|
|
1543
1557
|
const server = await createOpencodeServer({
|
|
1544
1558
|
hostname: "127.0.0.1",
|
|
1545
1559
|
port: 0,
|
|
@@ -1552,7 +1566,8 @@ async function ensureRuntime({
|
|
|
1552
1566
|
runtime.server = server;
|
|
1553
1567
|
runtime.client = createOpencodeClient({
|
|
1554
1568
|
baseUrl: server.url,
|
|
1555
|
-
directory: workdir
|
|
1569
|
+
directory: workdir,
|
|
1570
|
+
headers: serverAuthHeaders
|
|
1556
1571
|
});
|
|
1557
1572
|
const mcpStatus = await runtime.client.mcp.status();
|
|
1558
1573
|
const mcpServers = asOpenCodeObject(mcpStatus.data) ?? {};
|