@twelvehart/cursor-agents 0.1.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.
@@ -0,0 +1,218 @@
1
+ import { z } from "zod";
2
+ export declare const ImageDimensionSchema: z.ZodObject<{
3
+ width: z.ZodNumber;
4
+ height: z.ZodNumber;
5
+ }, z.core.$strip>;
6
+ export type ImageDimension = z.infer<typeof ImageDimensionSchema>;
7
+ export declare const ImageSchema: z.ZodObject<{
8
+ data: z.ZodString;
9
+ dimension: z.ZodOptional<z.ZodObject<{
10
+ width: z.ZodNumber;
11
+ height: z.ZodNumber;
12
+ }, z.core.$strip>>;
13
+ }, z.core.$strip>;
14
+ export type Image = z.infer<typeof ImageSchema>;
15
+ export declare const PromptSchema: z.ZodObject<{
16
+ text: z.ZodString;
17
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
18
+ data: z.ZodString;
19
+ dimension: z.ZodOptional<z.ZodObject<{
20
+ width: z.ZodNumber;
21
+ height: z.ZodNumber;
22
+ }, z.core.$strip>>;
23
+ }, z.core.$strip>>>;
24
+ }, z.core.$strip>;
25
+ export type Prompt = z.infer<typeof PromptSchema>;
26
+ export declare const AgentStatusSchema: z.ZodEnum<{
27
+ CREATING: "CREATING";
28
+ RUNNING: "RUNNING";
29
+ FINISHED: "FINISHED";
30
+ ERROR: "ERROR";
31
+ EXPIRED: "EXPIRED";
32
+ }>;
33
+ export type AgentStatus = z.infer<typeof AgentStatusSchema>;
34
+ export declare const SourceSchema: z.ZodObject<{
35
+ repository: z.ZodString;
36
+ ref: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>;
38
+ export type Source = z.infer<typeof SourceSchema>;
39
+ export declare const TargetSchema: z.ZodObject<{
40
+ autoCreatePr: z.ZodOptional<z.ZodBoolean>;
41
+ openAsCursorGithubApp: z.ZodOptional<z.ZodBoolean>;
42
+ skipReviewerRequest: z.ZodOptional<z.ZodBoolean>;
43
+ branchName: z.ZodOptional<z.ZodString>;
44
+ autoBranch: z.ZodOptional<z.ZodBoolean>;
45
+ }, z.core.$strip>;
46
+ export type Target = z.infer<typeof TargetSchema>;
47
+ export declare const AgentSchema: z.ZodObject<{
48
+ id: z.ZodString;
49
+ name: z.ZodOptional<z.ZodString>;
50
+ status: z.ZodEnum<{
51
+ CREATING: "CREATING";
52
+ RUNNING: "RUNNING";
53
+ FINISHED: "FINISHED";
54
+ ERROR: "ERROR";
55
+ EXPIRED: "EXPIRED";
56
+ }>;
57
+ source: z.ZodObject<{
58
+ repository: z.ZodString;
59
+ ref: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$strip>;
61
+ target: z.ZodOptional<z.ZodObject<{
62
+ autoCreatePr: z.ZodOptional<z.ZodBoolean>;
63
+ openAsCursorGithubApp: z.ZodOptional<z.ZodBoolean>;
64
+ skipReviewerRequest: z.ZodOptional<z.ZodBoolean>;
65
+ branchName: z.ZodOptional<z.ZodString>;
66
+ autoBranch: z.ZodOptional<z.ZodBoolean>;
67
+ }, z.core.$strip>>;
68
+ summary: z.ZodOptional<z.ZodString>;
69
+ createdAt: z.ZodString;
70
+ }, z.core.$strip>;
71
+ export type Agent = z.infer<typeof AgentSchema>;
72
+ export declare const CreateAgentRequestSchema: z.ZodObject<{
73
+ prompt: z.ZodObject<{
74
+ text: z.ZodString;
75
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
76
+ data: z.ZodString;
77
+ dimension: z.ZodOptional<z.ZodObject<{
78
+ width: z.ZodNumber;
79
+ height: z.ZodNumber;
80
+ }, z.core.$strip>>;
81
+ }, z.core.$strip>>>;
82
+ }, z.core.$strip>;
83
+ source: z.ZodUnion<readonly [z.ZodObject<{
84
+ repository: z.ZodString;
85
+ ref: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strip>, z.ZodObject<{
87
+ prUrl: z.ZodString;
88
+ }, z.core.$strip>]>;
89
+ model: z.ZodOptional<z.ZodString>;
90
+ target: z.ZodOptional<z.ZodObject<{
91
+ autoCreatePr: z.ZodOptional<z.ZodBoolean>;
92
+ openAsCursorGithubApp: z.ZodOptional<z.ZodBoolean>;
93
+ skipReviewerRequest: z.ZodOptional<z.ZodBoolean>;
94
+ branchName: z.ZodOptional<z.ZodString>;
95
+ autoBranch: z.ZodOptional<z.ZodBoolean>;
96
+ }, z.core.$strip>>;
97
+ }, z.core.$strip>;
98
+ export type CreateAgentRequest = z.infer<typeof CreateAgentRequestSchema>;
99
+ export declare const CreateAgentResponseSchema: z.ZodObject<{
100
+ id: z.ZodString;
101
+ name: z.ZodOptional<z.ZodString>;
102
+ status: z.ZodEnum<{
103
+ CREATING: "CREATING";
104
+ RUNNING: "RUNNING";
105
+ FINISHED: "FINISHED";
106
+ ERROR: "ERROR";
107
+ EXPIRED: "EXPIRED";
108
+ }>;
109
+ source: z.ZodObject<{
110
+ repository: z.ZodString;
111
+ ref: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strip>;
113
+ createdAt: z.ZodString;
114
+ }, z.core.$strip>;
115
+ export type CreateAgentResponse = z.infer<typeof CreateAgentResponseSchema>;
116
+ export declare const ListAgentsResponseSchema: z.ZodObject<{
117
+ agents: z.ZodArray<z.ZodObject<{
118
+ id: z.ZodString;
119
+ name: z.ZodOptional<z.ZodString>;
120
+ status: z.ZodEnum<{
121
+ CREATING: "CREATING";
122
+ RUNNING: "RUNNING";
123
+ FINISHED: "FINISHED";
124
+ ERROR: "ERROR";
125
+ EXPIRED: "EXPIRED";
126
+ }>;
127
+ source: z.ZodObject<{
128
+ repository: z.ZodString;
129
+ ref: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strip>;
131
+ target: z.ZodOptional<z.ZodObject<{
132
+ autoCreatePr: z.ZodOptional<z.ZodBoolean>;
133
+ openAsCursorGithubApp: z.ZodOptional<z.ZodBoolean>;
134
+ skipReviewerRequest: z.ZodOptional<z.ZodBoolean>;
135
+ branchName: z.ZodOptional<z.ZodString>;
136
+ autoBranch: z.ZodOptional<z.ZodBoolean>;
137
+ }, z.core.$strip>>;
138
+ summary: z.ZodOptional<z.ZodString>;
139
+ createdAt: z.ZodString;
140
+ }, z.core.$strip>>;
141
+ nextCursor: z.ZodOptional<z.ZodString>;
142
+ }, z.core.$strip>;
143
+ export type ListAgentsResponse = z.infer<typeof ListAgentsResponseSchema>;
144
+ export declare const ConversationMessageSchema: z.ZodObject<{
145
+ id: z.ZodString;
146
+ type: z.ZodEnum<{
147
+ user_message: "user_message";
148
+ assistant_message: "assistant_message";
149
+ }>;
150
+ text: z.ZodString;
151
+ }, z.core.$strip>;
152
+ export type ConversationMessage = z.infer<typeof ConversationMessageSchema>;
153
+ export declare const ConversationSchema: z.ZodObject<{
154
+ id: z.ZodString;
155
+ messages: z.ZodArray<z.ZodObject<{
156
+ id: z.ZodString;
157
+ type: z.ZodEnum<{
158
+ user_message: "user_message";
159
+ assistant_message: "assistant_message";
160
+ }>;
161
+ text: z.ZodString;
162
+ }, z.core.$strip>>;
163
+ }, z.core.$strip>;
164
+ export type Conversation = z.infer<typeof ConversationSchema>;
165
+ export declare const ArtifactSchema: z.ZodObject<{
166
+ absolutePath: z.ZodString;
167
+ sizeBytes: z.ZodNumber;
168
+ updatedAt: z.ZodString;
169
+ }, z.core.$strip>;
170
+ export type Artifact = z.infer<typeof ArtifactSchema>;
171
+ export declare const ListArtifactsResponseSchema: z.ZodObject<{
172
+ artifacts: z.ZodArray<z.ZodObject<{
173
+ absolutePath: z.ZodString;
174
+ sizeBytes: z.ZodNumber;
175
+ updatedAt: z.ZodString;
176
+ }, z.core.$strip>>;
177
+ }, z.core.$strip>;
178
+ export type ListArtifactsResponse = z.infer<typeof ListArtifactsResponseSchema>;
179
+ export declare const DownloadArtifactResponseSchema: z.ZodObject<{
180
+ url: z.ZodString;
181
+ expiresAt: z.ZodString;
182
+ }, z.core.$strip>;
183
+ export type DownloadArtifactResponse = z.infer<typeof DownloadArtifactResponseSchema>;
184
+ export declare const MeResponseSchema: z.ZodObject<{
185
+ apiKeyName: z.ZodString;
186
+ createdAt: z.ZodString;
187
+ userEmail: z.ZodOptional<z.ZodString>;
188
+ }, z.core.$strip>;
189
+ export type MeResponse = z.infer<typeof MeResponseSchema>;
190
+ export declare const ModelsResponseSchema: z.ZodObject<{
191
+ models: z.ZodArray<z.ZodString>;
192
+ }, z.core.$strip>;
193
+ export type ModelsResponse = z.infer<typeof ModelsResponseSchema>;
194
+ export declare const RepositorySchema: z.ZodObject<{
195
+ owner: z.ZodString;
196
+ name: z.ZodString;
197
+ url: z.ZodString;
198
+ }, z.core.$strip>;
199
+ export type Repository = z.infer<typeof RepositorySchema>;
200
+ export declare const RepositoriesResponseSchema: z.ZodObject<{
201
+ repositories: z.ZodArray<z.ZodObject<{
202
+ owner: z.ZodString;
203
+ name: z.ZodString;
204
+ url: z.ZodString;
205
+ }, z.core.$strip>>;
206
+ }, z.core.$strip>;
207
+ export type RepositoriesResponse = z.infer<typeof RepositoriesResponseSchema>;
208
+ export declare const ErrorResponseSchema: z.ZodObject<{
209
+ error: z.ZodObject<{
210
+ message: z.ZodString;
211
+ code: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strip>;
213
+ }, z.core.$strip>;
214
+ export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
215
+ export declare const IdResponseSchema: z.ZodObject<{
216
+ id: z.ZodString;
217
+ }, z.core.$strip>;
218
+ export type IdResponse = z.infer<typeof IdResponseSchema>;
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@twelvehart/cursor-agents",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript SDK and CLI for the Cursor Cloud Agents API",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "cursor-agents": "bin/cursor-agents.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "scripts": {
18
+ "typecheck": "tsc --noEmit",
19
+ "lint": "bunx biome check src/ tests/ bin/ scripts/",
20
+ "lint:fix": "bunx biome check --write src/ tests/ bin/ scripts/",
21
+ "test": "bun test tests/unit",
22
+ "test:all": "bun test tests",
23
+ "test:integration": "bun test tests/integration",
24
+ "build": "node scripts/build.mjs",
25
+ "prepack": "bun run build"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "files": ["bin", "dist", "README.md", "LICENSE"],
31
+ "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/ASRagab/cursor-agents-sdk-ts.git"
35
+ },
36
+ "homepage": "https://github.com/ASRagab/cursor-agents-sdk-ts#readme",
37
+ "bugs": {
38
+ "url": "https://github.com/ASRagab/cursor-agents-sdk-ts/issues"
39
+ },
40
+ "engines": {
41
+ "node": ">=18"
42
+ },
43
+ "devDependencies": {
44
+ "@biomejs/biome": "^2.4.10",
45
+ "@types/bun": "^1.3.11",
46
+ "typescript": "^5.9.3"
47
+ },
48
+ "dependencies": {
49
+ "commander": "^14.0.3",
50
+ "dotenv": "^16.6.1",
51
+ "zod": "^4.3.6"
52
+ }
53
+ }