@ai-sdk/harness 1.0.0-canary.9 → 1.0.0
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 +144 -0
- package/README.md +27 -15
- package/dist/agent/index.d.ts +45 -12
- package/dist/agent/index.js +258 -31
- package/dist/agent/index.js.map +1 -1
- package/dist/bridge/index.js +3 -2
- package/dist/bridge/index.js.map +1 -1
- package/dist/utils/index.d.ts +8 -1
- package/dist/utils/index.js +13 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +6 -6
- package/src/agent/harness-agent-settings.ts +47 -12
- package/src/agent/harness-agent.ts +70 -35
- package/src/agent/internal/bootstrap-recipe.ts +1 -1
- package/src/agent/internal/harness-stream-text-result.ts +12 -1
- package/src/agent/internal/run-prompt.ts +13 -1
- package/src/agent/internal/sandbox-bootstrap.ts +266 -0
- package/src/agent/prewarm.ts +29 -11
- package/src/bridge/index.ts +4 -2
- package/src/utils/ai-gateway-auth.ts +15 -0
- package/src/utils/index.ts +1 -0
package/src/bridge/index.ts
CHANGED
|
@@ -675,12 +675,14 @@ export async function runBridge<TStart extends { type: 'start' }>(
|
|
|
675
675
|
emit({ type: 'error', error: serialiseError(err) });
|
|
676
676
|
});
|
|
677
677
|
|
|
678
|
-
await new Promise<void>(resolve => {
|
|
678
|
+
await new Promise<void>((resolve, reject) => {
|
|
679
679
|
if (wss.address() != null) {
|
|
680
680
|
resolve();
|
|
681
681
|
return;
|
|
682
682
|
}
|
|
683
|
-
|
|
683
|
+
|
|
684
|
+
wss.once('listening', resolve);
|
|
685
|
+
wss.once('error', reject);
|
|
684
686
|
});
|
|
685
687
|
|
|
686
688
|
return {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const DEFAULT_AI_GATEWAY_BASE_URL = 'https://ai-gateway.vercel.sh';
|
|
2
|
+
|
|
3
|
+
export function getAiGatewayAuthFromEnv({
|
|
4
|
+
env,
|
|
5
|
+
}: {
|
|
6
|
+
env: Record<string, string | undefined>;
|
|
7
|
+
}): {
|
|
8
|
+
apiKey: string | undefined;
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
} {
|
|
11
|
+
return {
|
|
12
|
+
apiKey: env.AI_GATEWAY_API_KEY || env.VERCEL_OIDC_TOKEN || undefined,
|
|
13
|
+
baseUrl: env.AI_GATEWAY_BASE_URL ?? DEFAULT_AI_GATEWAY_BASE_URL,
|
|
14
|
+
};
|
|
15
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export {
|
|
|
5
5
|
type SandboxChannelReconnectOptions,
|
|
6
6
|
} from './sandbox-channel';
|
|
7
7
|
export { classifyDiskLog, type DiskLogRecoveryMode } from './classify-disk-log';
|
|
8
|
+
export { getAiGatewayAuthFromEnv } from './ai-gateway-auth';
|
|
8
9
|
export {
|
|
9
10
|
markBridgeStarting,
|
|
10
11
|
waitForBridgeReady,
|