@anthropic-ai/claude-agent-sdk 0.2.75 → 0.2.77
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/agentSdkTypes.d.ts +1 -0
- package/browser-sdk.d.ts +52 -0
- package/browser-sdk.js +53 -0
- package/cli.js +2405 -2087
- package/manifest.json +18 -18
- package/manifest.zst.json +18 -18
- package/package.json +6 -2
- package/sdk-tools.d.ts +0 -15
- package/sdk.d.ts +165 -10
- package/sdk.mjs +36 -34
- package/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
- package/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
- package/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
- package/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
- package/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
- package/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sdk.js'
|
package/browser-sdk.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API surface definition for @anthropic-ai/claude-agent-sdk/browser.
|
|
3
|
+
*
|
|
4
|
+
* This file is the source of truth for the browser export's public types.
|
|
5
|
+
* It imports ONLY from agentSdkTypes.ts so the compiled .d.ts has exactly
|
|
6
|
+
* one import to rewrite (./agentSdkTypes → ./sdk) for the flat package layout.
|
|
7
|
+
*
|
|
8
|
+
* Compiled by scripts/build-ant-sdk-typings.sh; see build-agent-sdk.sh for the
|
|
9
|
+
* path rewrite and copy into the package.
|
|
10
|
+
*/
|
|
11
|
+
import type { CanUseTool, HookCallbackMatcher, HookEvent, McpServerConfig, Query, SDKUserMessage } from './agentSdkTypes.js';
|
|
12
|
+
export type { CanUseTool, HookCallbackMatcher, HookEvent, McpSdkServerConfigWithInstance, McpServerConfig, Query, SDKAssistantMessage, SDKMessage, SDKResultMessage, SDKSystemMessage, SDKUserMessage, } from './agentSdkTypes.js';
|
|
13
|
+
export { createSdkMcpServer, tool } from './agentSdkTypes.js';
|
|
14
|
+
export type OAuthCredential = {
|
|
15
|
+
type: 'oauth';
|
|
16
|
+
token: string;
|
|
17
|
+
};
|
|
18
|
+
export type AuthMessage = {
|
|
19
|
+
type: 'auth';
|
|
20
|
+
credential: OAuthCredential;
|
|
21
|
+
};
|
|
22
|
+
export type WebSocketOptions = {
|
|
23
|
+
url: string;
|
|
24
|
+
headers?: Record<string, string>;
|
|
25
|
+
authMessage?: AuthMessage;
|
|
26
|
+
};
|
|
27
|
+
export type BrowserQueryOptions = {
|
|
28
|
+
prompt: AsyncIterable<SDKUserMessage>;
|
|
29
|
+
websocket: WebSocketOptions;
|
|
30
|
+
abortController?: AbortController;
|
|
31
|
+
canUseTool?: CanUseTool;
|
|
32
|
+
hooks?: Partial<Record<HookEvent, HookCallbackMatcher[]>>;
|
|
33
|
+
mcpServers?: Record<string, McpServerConfig>;
|
|
34
|
+
jsonSchema?: Record<string, unknown>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Create a Claude Code query using WebSocket transport in the browser.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import { query } from '@anthropic-ai/claude-agent-sdk/browser'
|
|
42
|
+
*
|
|
43
|
+
* const messages = query({
|
|
44
|
+
* prompt: messageStream,
|
|
45
|
+
* websocket: { url: 'wss://api.example.com/claude' },
|
|
46
|
+
* })
|
|
47
|
+
* for await (const message of messages) {
|
|
48
|
+
* console.log(message)
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function query(options: BrowserQueryOptions): Query;
|