@anthropic-ai/claude-agent-sdk 0.2.81 → 0.2.84
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/bridge.d.ts +37 -0
- package/bridge.mjs +88 -49
- package/browser-sdk.js +74 -35
- package/cli.js +3735 -2801
- package/manifest.json +18 -18
- package/manifest.zst.json +22 -22
- package/package.json +2 -2
- package/sdk-tools.d.ts +8 -7
- package/sdk.d.ts +148 -8
- package/sdk.mjs +87 -47
package/bridge.d.ts
CHANGED
|
@@ -112,6 +112,15 @@ export type AttachBridgeSessionOptions = {
|
|
|
112
112
|
initialSequenceNum?: number;
|
|
113
113
|
/** CCRClient heartbeat interval. Defaults to 20s (server TTL is 60s). */
|
|
114
114
|
heartbeatIntervalMs?: number;
|
|
115
|
+
/**
|
|
116
|
+
* When true, the bridge only forwards events outbound (local → CCR). The
|
|
117
|
+
* SSE read stream is not opened — no inbound events are received. Control
|
|
118
|
+
* requests that arrive via the write-path ACK channel reply with an error
|
|
119
|
+
* instead of false-success. onInboundMessage is never called. Use for
|
|
120
|
+
* mirror-mode attachments where the remote UI should see the session but
|
|
121
|
+
* not be able to drive it.
|
|
122
|
+
*/
|
|
123
|
+
outboundOnly?: boolean;
|
|
115
124
|
/**
|
|
116
125
|
* User message typed on claude.ai. Echoes of outbound writes and
|
|
117
126
|
* re-deliveries of prompts already forwarded are filtered before this
|
|
@@ -160,3 +169,31 @@ export type AttachBridgeSessionOptions = {
|
|
|
160
169
|
* @alpha
|
|
161
170
|
*/
|
|
162
171
|
export declare function attachBridgeSession(opts: AttachBridgeSessionOptions): Promise<BridgeSessionHandle>;
|
|
172
|
+
/**
|
|
173
|
+
* Worker credentials from `POST /v1/code/sessions/{id}/bridge`.
|
|
174
|
+
* Each call bumps `worker_epoch` server-side — the call IS the worker register.
|
|
175
|
+
* @alpha
|
|
176
|
+
*/
|
|
177
|
+
export type RemoteCredentials = {
|
|
178
|
+
worker_jwt: string;
|
|
179
|
+
api_base_url: string;
|
|
180
|
+
expires_in: number;
|
|
181
|
+
worker_epoch: number;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* `POST /v1/code/sessions` — create a fresh CCR session. Returns the `cse_*`
|
|
185
|
+
* session id, or null on any failure (HTTP error, malformed response).
|
|
186
|
+
*
|
|
187
|
+
* Callers supply their own OAuth token — this is a thin HTTP wrapper with no
|
|
188
|
+
* implicit auth, so it works from any process (not just the CLI).
|
|
189
|
+
* @alpha
|
|
190
|
+
*/
|
|
191
|
+
export declare function createCodeSession(baseUrl: string, accessToken: string, title: string, timeoutMs: number): Promise<string | null>;
|
|
192
|
+
/**
|
|
193
|
+
* `POST /v1/code/sessions/{id}/bridge` — mint a worker JWT for the session.
|
|
194
|
+
* Returns credentials or null on failure. The call IS the worker register
|
|
195
|
+
* (bumps epoch server-side), so pass `epoch: creds.worker_epoch` to
|
|
196
|
+
* `attachBridgeSession` to skip a redundant register.
|
|
197
|
+
* @alpha
|
|
198
|
+
*/
|
|
199
|
+
export declare function fetchRemoteCredentials(sessionId: string, baseUrl: string, accessToken: string, timeoutMs: number): Promise<RemoteCredentials | null>;
|