@cursor/sdk 1.0.7
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/LICENSE.md +3 -0
- package/README.md +364 -0
- package/dist/cjs/829.index.js +1 -0
- package/dist/cjs/agent.d.ts +153 -0
- package/dist/cjs/agent.d.ts.map +1 -0
- package/dist/cjs/analytics.d.ts +67 -0
- package/dist/cjs/analytics.d.ts.map +1 -0
- package/dist/cjs/artifacts.d.ts +6 -0
- package/dist/cjs/artifacts.d.ts.map +1 -0
- package/dist/cjs/cloud-agent.d.ts +22 -0
- package/dist/cjs/cloud-agent.d.ts.map +1 -0
- package/dist/cjs/cloud-api-client.d.ts +192 -0
- package/dist/cjs/cloud-api-client.d.ts.map +1 -0
- package/dist/cjs/cloud-executor.d.ts +14 -0
- package/dist/cjs/cloud-executor.d.ts.map +1 -0
- package/dist/cjs/cloud-mcp-utils.d.ts +4 -0
- package/dist/cjs/cloud-mcp-utils.d.ts.map +1 -0
- package/dist/cjs/core-adapter.d.ts +2 -0
- package/dist/cjs/core-adapter.d.ts.map +1 -0
- package/dist/cjs/errors.d.ts +96 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/executor-common.d.ts +16 -0
- package/dist/cjs/executor-common.d.ts.map +1 -0
- package/dist/cjs/executor-types.d.ts +59 -0
- package/dist/cjs/executor-types.d.ts.map +1 -0
- package/dist/cjs/index.d.ts +17 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/index.js.LICENSE.txt +274 -0
- package/dist/cjs/local-executor.d.ts +15 -0
- package/dist/cjs/local-executor.d.ts.map +1 -0
- package/dist/cjs/messages.d.ts +110 -0
- package/dist/cjs/messages.d.ts.map +1 -0
- package/dist/cjs/options.d.ts +122 -0
- package/dist/cjs/options.d.ts.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/platform.d.ts +42 -0
- package/dist/cjs/platform.d.ts.map +1 -0
- package/dist/cjs/public-api.d.ts +12 -0
- package/dist/cjs/public-api.d.ts.map +1 -0
- package/dist/cjs/run-event-tailer.d.ts +33 -0
- package/dist/cjs/run-event-tailer.d.ts.map +1 -0
- package/dist/cjs/run-interaction-accumulator.d.ts +32 -0
- package/dist/cjs/run-interaction-accumulator.d.ts.map +1 -0
- package/dist/cjs/run.d.ts +44 -0
- package/dist/cjs/run.d.ts.map +1 -0
- package/dist/cjs/stubs.d.ts +95 -0
- package/dist/cjs/stubs.d.ts.map +1 -0
- package/dist/cjs/subagent-conversion.d.ts +9 -0
- package/dist/cjs/subagent-conversion.d.ts.map +1 -0
- package/dist/cjs/tool-call-utils.d.ts +7 -0
- package/dist/cjs/tool-call-utils.d.ts.map +1 -0
- package/dist/cjs/types/conversation-types.d.ts +12062 -0
- package/dist/cjs/types/conversation-types.d.ts.map +1 -0
- package/dist/cjs/types/delta-types.d.ts +2 -0
- package/dist/cjs/types/delta-types.d.ts.map +1 -0
- package/dist/cjs/types/tool-call-types.d.ts +2 -0
- package/dist/cjs/types/tool-call-types.d.ts.map +1 -0
- package/dist/cjs/utils/conversation-utils.d.ts +3 -0
- package/dist/cjs/utils/conversation-utils.d.ts.map +1 -0
- package/dist/cjs/utils/logger.d.ts +12 -0
- package/dist/cjs/utils/logger.d.ts.map +1 -0
- package/dist/cjs/utils/message-schemas.d.ts +2 -0
- package/dist/cjs/utils/message-schemas.d.ts.map +1 -0
- package/dist/esm/829.index.js +1 -0
- package/dist/esm/agent.d.ts +153 -0
- package/dist/esm/agent.d.ts.map +1 -0
- package/dist/esm/analytics.d.ts +67 -0
- package/dist/esm/analytics.d.ts.map +1 -0
- package/dist/esm/artifacts.d.ts +6 -0
- package/dist/esm/artifacts.d.ts.map +1 -0
- package/dist/esm/cloud-agent.d.ts +22 -0
- package/dist/esm/cloud-agent.d.ts.map +1 -0
- package/dist/esm/cloud-api-client.d.ts +192 -0
- package/dist/esm/cloud-api-client.d.ts.map +1 -0
- package/dist/esm/cloud-executor.d.ts +14 -0
- package/dist/esm/cloud-executor.d.ts.map +1 -0
- package/dist/esm/cloud-mcp-utils.d.ts +4 -0
- package/dist/esm/cloud-mcp-utils.d.ts.map +1 -0
- package/dist/esm/core-adapter.d.ts +2 -0
- package/dist/esm/core-adapter.d.ts.map +1 -0
- package/dist/esm/errors.d.ts +96 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/executor-common.d.ts +16 -0
- package/dist/esm/executor-common.d.ts.map +1 -0
- package/dist/esm/executor-types.d.ts +59 -0
- package/dist/esm/executor-types.d.ts.map +1 -0
- package/dist/esm/index.d.ts +17 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.LICENSE.txt +274 -0
- package/dist/esm/local-executor.d.ts +15 -0
- package/dist/esm/local-executor.d.ts.map +1 -0
- package/dist/esm/messages.d.ts +110 -0
- package/dist/esm/messages.d.ts.map +1 -0
- package/dist/esm/options.d.ts +122 -0
- package/dist/esm/options.d.ts.map +1 -0
- package/dist/esm/platform.d.ts +42 -0
- package/dist/esm/platform.d.ts.map +1 -0
- package/dist/esm/public-api.d.ts +12 -0
- package/dist/esm/public-api.d.ts.map +1 -0
- package/dist/esm/run-event-tailer.d.ts +33 -0
- package/dist/esm/run-event-tailer.d.ts.map +1 -0
- package/dist/esm/run-interaction-accumulator.d.ts +32 -0
- package/dist/esm/run-interaction-accumulator.d.ts.map +1 -0
- package/dist/esm/run.d.ts +44 -0
- package/dist/esm/run.d.ts.map +1 -0
- package/dist/esm/stubs.d.ts +95 -0
- package/dist/esm/stubs.d.ts.map +1 -0
- package/dist/esm/subagent-conversion.d.ts +9 -0
- package/dist/esm/subagent-conversion.d.ts.map +1 -0
- package/dist/esm/tool-call-utils.d.ts +7 -0
- package/dist/esm/tool-call-utils.d.ts.map +1 -0
- package/dist/esm/types/conversation-types.d.ts +12062 -0
- package/dist/esm/types/conversation-types.d.ts.map +1 -0
- package/dist/esm/types/delta-types.d.ts +2 -0
- package/dist/esm/types/delta-types.d.ts.map +1 -0
- package/dist/esm/types/tool-call-types.d.ts +2 -0
- package/dist/esm/types/tool-call-types.d.ts.map +1 -0
- package/dist/esm/utils/conversation-utils.d.ts +3 -0
- package/dist/esm/utils/conversation-utils.d.ts.map +1 -0
- package/dist/esm/utils/logger.d.ts +12 -0
- package/dist/esm/utils/logger.d.ts.map +1 -0
- package/dist/esm/utils/message-schemas.d.ts +2 -0
- package/dist/esm/utils/message-schemas.d.ts.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-adapter.d.ts","sourceRoot":"","sources":["../../src/agent/core-adapter.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ErrorDetails_Error } from "@anysphere/proto/aiserver/v1/utils_pb.js";
|
|
2
|
+
import { Code, ConnectError } from "@connectrpc/connect";
|
|
3
|
+
/**
|
|
4
|
+
* Base error class for all Cursor Agent SDK errors.
|
|
5
|
+
*
|
|
6
|
+
* This can wrap internal ConnectError objects from gRPC calls, or represent
|
|
7
|
+
* SDK-level errors (like API key exchange failures) that occur before any RPC.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CursorAgentError extends Error {
|
|
10
|
+
/**
|
|
11
|
+
* Whether this error is retryable (based on backend's retry flag or error type).
|
|
12
|
+
*/
|
|
13
|
+
readonly isRetryable: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The Connect gRPC error code (if this wraps a ConnectError).
|
|
16
|
+
*/
|
|
17
|
+
readonly code?: Code;
|
|
18
|
+
/**
|
|
19
|
+
* The original ConnectError (for debugging purposes, if this wraps a ConnectError).
|
|
20
|
+
*/
|
|
21
|
+
readonly cause?: ConnectError;
|
|
22
|
+
/**
|
|
23
|
+
* Internal proto error code (if available from a ConnectError).
|
|
24
|
+
*/
|
|
25
|
+
readonly protoErrorCode?: ErrorDetails_Error;
|
|
26
|
+
constructor(message: string, options?: {
|
|
27
|
+
code?: Code;
|
|
28
|
+
isRetryable?: boolean;
|
|
29
|
+
cause?: ConnectError;
|
|
30
|
+
protoErrorCode?: ErrorDetails_Error;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Authentication-related errors (401).
|
|
35
|
+
*
|
|
36
|
+
* Examples: Invalid API key, not logged in, insufficient permissions.
|
|
37
|
+
*/
|
|
38
|
+
export declare class AuthenticationError extends CursorAgentError {
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Rate limiting errors (429).
|
|
42
|
+
*
|
|
43
|
+
* Examples: Too many requests, usage limits exceeded.
|
|
44
|
+
*/
|
|
45
|
+
export declare class RateLimitError extends CursorAgentError {
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Configuration errors (400, 404).
|
|
49
|
+
*
|
|
50
|
+
* Examples: Bad API key, invalid model name, invalid request parameters.
|
|
51
|
+
*/
|
|
52
|
+
export declare class ConfigurationError extends CursorAgentError {
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The caller has not connected the SCM integration for the target
|
|
56
|
+
* repository's provider. Distinct from `[repository_access]`, which means
|
|
57
|
+
* the integration is connected but doesn't cover that repo.
|
|
58
|
+
*/
|
|
59
|
+
export declare class IntegrationNotConnectedError extends ConfigurationError {
|
|
60
|
+
readonly helpUrl: string;
|
|
61
|
+
readonly provider: string;
|
|
62
|
+
constructor(message: string, options: {
|
|
63
|
+
helpUrl: string;
|
|
64
|
+
provider: string;
|
|
65
|
+
code?: Code;
|
|
66
|
+
isRetryable?: boolean;
|
|
67
|
+
cause?: ConnectError;
|
|
68
|
+
protoErrorCode?: ErrorDetails_Error;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Network/server errors (503, 504, etc.).
|
|
73
|
+
*
|
|
74
|
+
* Examples: Service unavailable, timeout, internal server errors.
|
|
75
|
+
*/
|
|
76
|
+
export declare class NetworkError extends CursorAgentError {
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Unknown or unclassified errors.
|
|
80
|
+
*/
|
|
81
|
+
export declare class UnknownAgentError extends CursorAgentError {
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Convert a generic Error to an SDK error if it represents a ConnectError.
|
|
85
|
+
*
|
|
86
|
+
* Handles cases where errors may be wrapped or serialized.
|
|
87
|
+
*/
|
|
88
|
+
export declare function convertError(err: unknown): CursorAgentError | Error;
|
|
89
|
+
/**
|
|
90
|
+
* Convert a ConnectError to a user-friendly SDK error.
|
|
91
|
+
*
|
|
92
|
+
* Extracts the ErrorDetails proto, reads the user-facing message,
|
|
93
|
+
* and wraps it in an appropriate SDK error class.
|
|
94
|
+
*/
|
|
95
|
+
export declare function convertConnectError(error: ConnectError): CursorAgentError;
|
|
96
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/agent/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EACnB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC;gBAG3C,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QACP,IAAI,CAAC,EAAE,IAAI,CAAC;QACZ,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,KAAK,CAAC,EAAE,YAAY,CAAC;QACrB,cAAc,CAAC,EAAE,kBAAkB,CAAC;KAChC;CAST;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,gBAAgB;CAAG;AAE5D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,gBAAgB;CAAG;AAEvD;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,gBAAgB;CAAG;AAE3D;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,kBAAkB;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAIzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAGxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,IAAI,CAAC;QACZ,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,KAAK,CAAC,EAAE,YAAY,CAAC;QACrB,cAAc,CAAC,EAAE,kBAAkB,CAAC;KACrC;CAMJ;AAED;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,gBAAgB;CAAG;AAErD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,gBAAgB;CAAG;AAmB1D;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,GAAG,KAAK,CAMnE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,gBAAgB,CAwIzE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentClient } from "@anysphere/agent-client";
|
|
2
|
+
import { PrivacyMode } from "@anysphere/proto/aiserver/v1/privacy_mode_pb.js";
|
|
3
|
+
import type { Transport } from "@connectrpc/connect";
|
|
4
|
+
export declare const backendUrl: string;
|
|
5
|
+
export declare let ghostModeHeaderValue: string;
|
|
6
|
+
export declare const ghostModeHeaderCache: Map<string, string>;
|
|
7
|
+
export declare const getGhostModeHeaderFromPrivacyMode: (privacyMode: PrivacyMode | undefined) => string;
|
|
8
|
+
export declare function exchangeApiKeyForAccessToken(apiKeyToExchange: string, baseUrl: string): Promise<string | undefined>;
|
|
9
|
+
export declare function setGhostModeHeaderForApiKey(apiKey: string, headerValue: string): void;
|
|
10
|
+
export declare const getCachedGhostModeHeader: (apiKey?: string) => string;
|
|
11
|
+
export declare function getSdkClientVersionHeader(): string;
|
|
12
|
+
export declare function ensureGhostModeHeaderForApiKey(apiKey?: string): Promise<void>;
|
|
13
|
+
export declare function buildTransport(apiKey: string): Transport;
|
|
14
|
+
export declare function createRetryingAgentClient(initialClient: AgentClient, refreshClient: () => AgentClient): AgentClient;
|
|
15
|
+
export declare function detectImageMimeType(bytes: Uint8Array): string | undefined;
|
|
16
|
+
//# sourceMappingURL=executor-common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor-common.d.ts","sourceRoot":"","sources":["../../src/agent/executor-common.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,KAAK,EAIV,SAAS,EAGV,MAAM,qBAAqB,CAAC;AAc7B,eAAO,MAAM,UAAU,QACqC,CAAC;AAE7D,eAAO,IAAI,oBAAoB,EAAE,MAAe,CAAC;AACjD,eAAO,MAAM,oBAAoB,qBAA4B,CAAC;AAG9D,eAAO,MAAM,iCAAiC,GAC5C,aAAa,WAAW,GAAG,SAAS,KACnC,MAQF,CAAC;AAYF,wBAAsB,4BAA4B,CAChD,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAmE7B;AAoCD,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,IAAI,CAGN;AAED,eAAO,MAAM,wBAAwB,GAAI,SAAS,MAAM,KAAG,MAK1D,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,MAAM,CAalD;AAED,wBAAsB,8BAA8B,CAClD,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAgGxD;AAED,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,WAAW,EAC1B,aAAa,EAAE,MAAM,WAAW,GAC/B,WAAW,CA8Bb;AAOD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAUzE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { BlobStore } from "@anysphere/agent-kv";
|
|
2
|
+
import type { ConversationStateStructure } from "@anysphere/proto/agent/v1/agent_pb.js";
|
|
3
|
+
import type { AgentOptions, ModelSelection } from "./options.js";
|
|
4
|
+
import type { InteractionListener } from "./types/delta-types.js";
|
|
5
|
+
export interface RunExecutorInput {
|
|
6
|
+
text: string;
|
|
7
|
+
images?: Array<{
|
|
8
|
+
type: "base64";
|
|
9
|
+
data: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export interface RunResultMetadata {
|
|
13
|
+
status: string;
|
|
14
|
+
result?: string;
|
|
15
|
+
durationMs?: number;
|
|
16
|
+
git?: {
|
|
17
|
+
branches: Array<{
|
|
18
|
+
repoUrl: string;
|
|
19
|
+
branch?: string;
|
|
20
|
+
prUrl?: string;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface RunExecutorOptions {
|
|
25
|
+
sessionId?: string;
|
|
26
|
+
model?: string;
|
|
27
|
+
apiKey: string;
|
|
28
|
+
requestId?: string;
|
|
29
|
+
initialState?: ConversationStateStructure;
|
|
30
|
+
blobStore?: BlobStore;
|
|
31
|
+
onCheckpoint?: (checkpoint: ConversationStateStructure) => void | Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
export interface RunExecutorController {
|
|
34
|
+
abort(): void;
|
|
35
|
+
done: Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
export type RunExecutor = (input: RunExecutorInput, opts: RunExecutorOptions, listener: InteractionListener) => Promise<RunExecutorController>;
|
|
38
|
+
export interface CloudWorkingLocation {
|
|
39
|
+
type: "github";
|
|
40
|
+
repository: string;
|
|
41
|
+
ref?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface CloudExecutorConfig {
|
|
44
|
+
env?: {
|
|
45
|
+
type: "cloud" | "pool" | "machine";
|
|
46
|
+
name?: string;
|
|
47
|
+
};
|
|
48
|
+
repos: Array<{
|
|
49
|
+
url: string;
|
|
50
|
+
startingRef?: string;
|
|
51
|
+
prUrl?: string;
|
|
52
|
+
}>;
|
|
53
|
+
workOnCurrentBranch?: boolean;
|
|
54
|
+
autoCreatePR?: boolean;
|
|
55
|
+
skipReviewerRequest?: boolean;
|
|
56
|
+
model?: ModelSelection;
|
|
57
|
+
mcpServers?: AgentOptions["mcpServers"];
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=executor-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor-types.d.ts","sourceRoot":"","sources":["../../src/agent/executor-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,iBAAiB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AC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,UAAU,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;CACzC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor Agent SDK
|
|
3
|
+
*
|
|
4
|
+
* Public API types and utilities for interacting with Cursor Agent.
|
|
5
|
+
*/
|
|
6
|
+
export { AuthenticationError, ConfigurationError, CursorAgentError, convertConnectError, convertError, IntegrationNotConnectedError, NetworkError, RateLimitError, UnknownAgentError, } from "./errors.js";
|
|
7
|
+
export type { AgentCheckpointStore, AgentDefinition, AgentLifecycleStatus, AgentMessage, AgentOperationOptions, AgentOptions, AgentRecord, AgentRunStore, AppendRunEventInput, AttachRunEventsInput, CheckpointRef, CreateAgentInput, CreateFollowUpRunInput, CursorAgentPlatformOptions, CursorRequestOptions, GetAgentMessagesOptions, GetAgentOptions, GetRunOptions, ListAgentsOptions, ListResult, ListRunEventsInput, ListRunEventsResult, ListRunsOptions, LocalRunEventNotifierOptions, LocalRunEventNotifierServerOptions, LocalRunStreamDoneEvent, LocalRunStreamEvent, LocalRunStreamResultEvent, LocalRunStreamSdkMessageEvent, McpServerConfig, ModelListItem, ModelParameterDefinition, ModelParameterValue, ModelSelection, ModelVariant, Run, RunEventHint, RunEventNotifier, RunEventOffset, RunEventRecord, RunEventStore, RunEventStreamStore, RunEventSubscription, RunLifecycleStatus, RunOperation, RunRecord, RunResult, RunResultStatus, RunStatus, RunTerminalPatch, SDKAgent, SDKAgentInfo, SDKArtifact, SDKAssistantMessage, SDKImage, SDKImageDimension, SDKMessage, SDKModel, SDKRepository, SDKStatusMessage, SDKSystemMessage, SDKTaskMessage, SDKThinkingMessage, SDKToolUseMessage, SDKUser, SDKUserMessage, SDKUserMessageEvent, SendOptions, SettingSource, TextBlock, ToolUseBlock, WatchableRunEventStore, WatchRunEventsInput, } from "./public-api.js";
|
|
8
|
+
export { Agent, Cursor, CursorAgentPlatform, createAgentPlatform, createInMemoryRunEventNotifier, createLocalRunEventNotifier, createSdkMessageRunStreamEvent, decodeLocalRunStreamEvent, decodeSdkMessageRunStreamEvent, InMemoryRunEventNotifier, isTerminalLocalRunStreamEvent, LOCAL_RUN_STREAM_EVENT_TYPE, LOCAL_RUN_STREAM_SCHEMA_VERSION, LocalRunEventNotifier, LocalRunEventNotifierServer, localRunStreamEventToSdkMessage, startLocalRunEventNotifierServer, UnsupportedRunOperationError, } from "./public-api.js";
|
|
9
|
+
export type { AgentConversationTurn, AssistantMessage as SdkAssistantMessage, ConversationStep, ConversationTurn, ShellCommand, ShellConversationTurn, ShellOutput, ThinkingMessage as SdkThinkingMessage, UserMessage as SdkUserMessage, } from "./types/conversation-types.js";
|
|
10
|
+
export { AgentConversationTurnSchema, AssistantMessageSchema as SdkAssistantMessageSchema, ConversationStepSchema, ConversationTurnSchema, ShellCommandSchema, ShellConversationTurnSchema, ShellOutputSchema, ThinkingMessageSchema as SdkThinkingMessageSchema, UserMessageSchema as SdkUserMessageSchema, } from "./types/conversation-types.js";
|
|
11
|
+
export type { InteractionListener, InteractionUpdate, PartialToolCallUpdate, ShellOutputDeltaUpdate, SummaryCompletedUpdate, SummaryStartedUpdate, SummaryUpdate, TextDeltaUpdate, ThinkingCompletedUpdate, ThinkingDeltaUpdate, TokenDeltaUpdate, ToolCallCompletedUpdate, ToolCallStartedUpdate, TurnEndedUpdate, UserMessageAppendedUpdate, } from "./types/delta-types.js";
|
|
12
|
+
export { InteractionUpdateSchema, PartialToolCallUpdateSchema, ShellOutputDeltaUpdateSchema, SummaryCompletedUpdateSchema, SummaryStartedUpdateSchema, SummaryUpdateSchema, TextDeltaUpdateSchema, ThinkingCompletedUpdateSchema, ThinkingDeltaUpdateSchema, TokenDeltaUpdateSchema, ToolCallCompletedUpdateSchema, ToolCallStartedUpdateSchema, TurnEndedUpdateSchema, UserMessageAppendedUpdateSchema, } from "./types/delta-types.js";
|
|
13
|
+
export type { CreatePlanArgs, CreatePlanResult, CreatePlanSuccess, CreatePlanToolCall, DeleteArgs, DeleteResult, DeleteSuccess, DeleteToolCall, EditArgs, EditResult, EditSuccess, EditToolCall, GlobArgs, GlobResult, GlobSuccess, GlobToolCall, GrepArgs, GrepContentOutput, GrepCountOutput, GrepFilesOutput, GrepResult, GrepSuccess, GrepToolCall, LsArgs, LsResult, LsSuccess, LsToolCall, McpArgs, McpProviderId, McpResult, McpSuccess, McpToolCall, McpToolId, ReadArgs, ReadLintsArgs, ReadLintsResult, ReadLintsSuccess, ReadLintsToolCall, ReadResult, ReadSuccess, ReadToolCall, SemSearchArgs, SemSearchResult, SemSearchSuccess, SemSearchToolCall, ShellArgs, ShellResult, ShellSuccess, ShellToolCall, SimpleError, SubagentBackgroundReason, TaskArgs, TaskMode, TaskResult, TaskSubagentType, TaskSuccess, TaskToolCall, TodoItem, TodoStatus, ToolCall, ToolType, UpdateTodosArgs, UpdateTodosResult, UpdateTodosSuccess, UpdateTodosToolCall, WriteArgs, WriteResult, WriteSuccess, WriteToolCall, } from "./types/tool-call-types.js";
|
|
14
|
+
export { getTurnType } from "./utils/conversation-utils.js";
|
|
15
|
+
export type { AssistantMessage, Image, Message, UserMessage, } from "./utils/message-schemas.js";
|
|
16
|
+
export { AssistantMessageSchema, ImageSchema, isAssistantMessage, isMessage, isUserMessage, MessageSchema, UserMessageSchema, } from "./utils/message-schemas.js";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,mBAAmB,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