@ai-sdk/harness 1.0.94 → 1.0.95
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 +9 -0
- package/dist/agent/index.js +30 -6
- package/dist/agent/index.js.map +1 -1
- package/dist/utils/index.d.ts +7 -1
- package/dist/utils/index.js +16 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
- package/src/agent/internal/run-prompt.ts +15 -0
- package/src/agent/internal/turn-telemetry.ts +34 -8
- package/src/utils/bridge-token.ts +18 -0
- package/src/utils/index.ts +1 -0
package/dist/utils/index.d.ts
CHANGED
|
@@ -568,6 +568,12 @@ declare function markBridgeStarting({ sandbox, bridgeStateDir, bridgeType, abort
|
|
|
568
568
|
}): Promise<void>;
|
|
569
569
|
declare function waitForBridgeReady({ proc, sandbox, bridgeStateDir, bridgeType, timeoutMs, abortSignal, pollIntervalMs, createTimeoutError, createExitError, }: WaitForBridgeReadyOptions): Promise<WaitForBridgeReadyResult>;
|
|
570
570
|
|
|
571
|
+
declare function createBridgeToken(): string;
|
|
572
|
+
declare function withBridgeToken({ endpoint, token, }: {
|
|
573
|
+
endpoint: HarnessV1PortEndpoint;
|
|
574
|
+
token: string;
|
|
575
|
+
}): HarnessV1PortEndpoint;
|
|
576
|
+
|
|
571
577
|
type BridgeProcessStreamName = 'stdout' | 'stderr';
|
|
572
578
|
declare function formatBridgeError(error: unknown): string;
|
|
573
579
|
declare function logBridgeError({ harnessId, sessionId, context, error, write, }: {
|
|
@@ -607,4 +613,4 @@ declare function resolveSandboxDefaultWorkingDirectory({ sandboxSession, abortSi
|
|
|
607
613
|
|
|
608
614
|
declare function getRestrictedSandboxSession(sandboxSession: HarnessV1NetworkSandboxSession | Experimental_SandboxSession): Experimental_SandboxSession;
|
|
609
615
|
|
|
610
|
-
export { type BridgeReadyErrorContext, type BridgeReadySource, type DiskLogRecoveryMode, type Experimental_BridgeUserMessageRequest, type Experimental_BridgeUserMessageResponse, type Experimental_BridgeUserMessageSubmitter, SandboxChannel, type SandboxChannelDebugEvent, type SandboxChannelOptions, type SandboxChannelReconnectOptions, type SkillFilePathMode, type WaitForBridgeReadyOptions, type WaitForBridgeReadyResult, type WriteSkillsOptions, type WriteSkillsResult, applyCredentialForwarding, classifyDiskLog, createBridgeErrorHandler, createBridgeStartupError, createCredentialRequestTransformation, createSandboxCredentialEnvironment, drainBridgeProcessStream, experimental_createBridgeUserMessageSubmitter, formatBridgeError, forwardBridgeProcessStream, generateSandboxCredentialPlaceholder, getAiGatewayAuthFromEnv, getRestrictedSandboxSession, isHarnessAuthenticationEnvironment, isSandboxCredentialPlaceholder, logBridgeError, markBridgeStarting, maskSandboxCredentials, resolveSandboxDefaultWorkingDirectory, resolveSandboxHomeDir, shellQuote, waitForBridgeReady, warnCredentialBrokeringUnavailable, writeSkills };
|
|
616
|
+
export { type BridgeReadyErrorContext, type BridgeReadySource, type DiskLogRecoveryMode, type Experimental_BridgeUserMessageRequest, type Experimental_BridgeUserMessageResponse, type Experimental_BridgeUserMessageSubmitter, SandboxChannel, type SandboxChannelDebugEvent, type SandboxChannelOptions, type SandboxChannelReconnectOptions, type SkillFilePathMode, type WaitForBridgeReadyOptions, type WaitForBridgeReadyResult, type WriteSkillsOptions, type WriteSkillsResult, applyCredentialForwarding, classifyDiskLog, createBridgeErrorHandler, createBridgeStartupError, createBridgeToken, createCredentialRequestTransformation, createSandboxCredentialEnvironment, drainBridgeProcessStream, experimental_createBridgeUserMessageSubmitter, formatBridgeError, forwardBridgeProcessStream, generateSandboxCredentialPlaceholder, getAiGatewayAuthFromEnv, getRestrictedSandboxSession, isHarnessAuthenticationEnvironment, isSandboxCredentialPlaceholder, logBridgeError, markBridgeStarting, maskSandboxCredentials, resolveSandboxDefaultWorkingDirectory, resolveSandboxHomeDir, shellQuote, waitForBridgeReady, warnCredentialBrokeringUnavailable, withBridgeToken, writeSkills };
|
package/dist/utils/index.js
CHANGED
|
@@ -1523,6 +1523,20 @@ function lineDecoder() {
|
|
|
1523
1523
|
};
|
|
1524
1524
|
}
|
|
1525
1525
|
|
|
1526
|
+
// src/utils/bridge-token.ts
|
|
1527
|
+
import { randomBytes as randomBytes2 } from "crypto";
|
|
1528
|
+
function createBridgeToken() {
|
|
1529
|
+
return randomBytes2(32).toString("hex");
|
|
1530
|
+
}
|
|
1531
|
+
function withBridgeToken({
|
|
1532
|
+
endpoint,
|
|
1533
|
+
token
|
|
1534
|
+
}) {
|
|
1535
|
+
const bridgeUrl = new URL(endpoint.url);
|
|
1536
|
+
bridgeUrl.searchParams.set("agent_bridge_token", token);
|
|
1537
|
+
return { ...endpoint, url: bridgeUrl.toString() };
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1526
1540
|
// src/utils/bridge-diagnostics.ts
|
|
1527
1541
|
var DEFAULT_TAIL_LIMIT = 20;
|
|
1528
1542
|
function isSerializedError(error) {
|
|
@@ -1723,6 +1737,7 @@ export {
|
|
|
1723
1737
|
classifyDiskLog,
|
|
1724
1738
|
createBridgeErrorHandler,
|
|
1725
1739
|
createBridgeStartupError,
|
|
1740
|
+
createBridgeToken,
|
|
1726
1741
|
createCredentialRequestTransformation,
|
|
1727
1742
|
createSandboxCredentialEnvironment,
|
|
1728
1743
|
drainBridgeProcessStream,
|
|
@@ -1742,6 +1757,7 @@ export {
|
|
|
1742
1757
|
shellQuote,
|
|
1743
1758
|
waitForBridgeReady,
|
|
1744
1759
|
warnCredentialBrokeringUnavailable,
|
|
1760
|
+
withBridgeToken,
|
|
1745
1761
|
writeSkills
|
|
1746
1762
|
};
|
|
1747
1763
|
//# sourceMappingURL=index.js.map
|