pi-cursor-agent 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.
Files changed (117) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +45 -0
  3. package/package.json +50 -0
  4. package/src/__generated__/agent/v1/agent_pb.ts +4642 -0
  5. package/src/__generated__/agent/v1/agent_service_connect.ts +71 -0
  6. package/src/__generated__/agent/v1/apply_agent_diff_tool_pb.ts +317 -0
  7. package/src/__generated__/agent/v1/ask_question_tool_pb.ts +588 -0
  8. package/src/__generated__/agent/v1/background_shell_exec_pb.ts +245 -0
  9. package/src/__generated__/agent/v1/computer_use_tool_pb.ts +959 -0
  10. package/src/__generated__/agent/v1/control_service_connect.ts +144 -0
  11. package/src/__generated__/agent/v1/control_service_pb.ts +1308 -0
  12. package/src/__generated__/agent/v1/create_plan_tool_pb.ts +366 -0
  13. package/src/__generated__/agent/v1/cursor_packages_pb.ts +278 -0
  14. package/src/__generated__/agent/v1/cursor_rules_pb.ts +301 -0
  15. package/src/__generated__/agent/v1/delete_exec_pb.ts +443 -0
  16. package/src/__generated__/agent/v1/delete_tool_pb.ts +52 -0
  17. package/src/__generated__/agent/v1/diagnostics_exec_pb.ts +399 -0
  18. package/src/__generated__/agent/v1/edit_tool_pb.ts +497 -0
  19. package/src/__generated__/agent/v1/exa_fetch_tool_pb.ts +472 -0
  20. package/src/__generated__/agent/v1/exa_search_tool_pb.ts +484 -0
  21. package/src/__generated__/agent/v1/exec_pb.ts +1271 -0
  22. package/src/__generated__/agent/v1/exec_service_connect.ts +14 -0
  23. package/src/__generated__/agent/v1/fetch_tool_pb.ts +242 -0
  24. package/src/__generated__/agent/v1/generate_image_tool_pb.ts +230 -0
  25. package/src/__generated__/agent/v1/glob_tool_pb.ts +248 -0
  26. package/src/__generated__/agent/v1/grep_exec_pb.ts +690 -0
  27. package/src/__generated__/agent/v1/grep_tool_pb.ts +52 -0
  28. package/src/__generated__/agent/v1/kv_pb.ts +281 -0
  29. package/src/__generated__/agent/v1/ls_exec_pb.ts +295 -0
  30. package/src/__generated__/agent/v1/ls_tool_pb.ts +52 -0
  31. package/src/__generated__/agent/v1/mcp_pb.ts +302 -0
  32. package/src/__generated__/agent/v1/mcp_resource_tool_pb.ts +688 -0
  33. package/src/__generated__/agent/v1/mcp_tool_pb.ts +630 -0
  34. package/src/__generated__/agent/v1/private_worker_bridge_external_connect.ts +26 -0
  35. package/src/__generated__/agent/v1/read_exec_pb.ts +412 -0
  36. package/src/__generated__/agent/v1/read_lints_tool_pb.ts +384 -0
  37. package/src/__generated__/agent/v1/read_tool_pb.ts +342 -0
  38. package/src/__generated__/agent/v1/record_screen_tool_pb.ts +376 -0
  39. package/src/__generated__/agent/v1/reflect_tool_pb.ts +236 -0
  40. package/src/__generated__/agent/v1/repo_pb.ts +154 -0
  41. package/src/__generated__/agent/v1/report_bugfix_results_tool_pb.ts +305 -0
  42. package/src/__generated__/agent/v1/request_context_exec_pb.ts +528 -0
  43. package/src/__generated__/agent/v1/sandbox_pb.ts +125 -0
  44. package/src/__generated__/agent/v1/selected_context_pb.ts +2272 -0
  45. package/src/__generated__/agent/v1/semsearch_tool_pb.ts +230 -0
  46. package/src/__generated__/agent/v1/setup_vm_environment_tool_pb.ts +168 -0
  47. package/src/__generated__/agent/v1/shell_exec_pb.ts +1195 -0
  48. package/src/__generated__/agent/v1/shell_tool_pb.ts +176 -0
  49. package/src/__generated__/agent/v1/start_grind_execution_tool_pb.ts +212 -0
  50. package/src/__generated__/agent/v1/start_grind_planning_tool_pb.ts +212 -0
  51. package/src/__generated__/agent/v1/subagents_pb.ts +1106 -0
  52. package/src/__generated__/agent/v1/switch_mode_tool_pb.ts +429 -0
  53. package/src/__generated__/agent/v1/todo_tool_pb.ts +551 -0
  54. package/src/__generated__/agent/v1/utils_pb.ts +348 -0
  55. package/src/__generated__/agent/v1/web_fetch_tool_pb.ts +429 -0
  56. package/src/__generated__/agent/v1/web_search_tool_pb.ts +466 -0
  57. package/src/__generated__/agent/v1/write_exec_pb.ts +379 -0
  58. package/src/__generated__/agent/v1/write_shell_stdin_tool_pb.ts +224 -0
  59. package/src/__generated__/aiserver/v1/aiserver_service_connect.ts +40 -0
  60. package/src/api/agent-service.ts +55 -0
  61. package/src/api/ai-service.ts +42 -0
  62. package/src/api/auth.ts +74 -0
  63. package/src/index.ts +101 -0
  64. package/src/lib/agent-store/disk.ts +139 -0
  65. package/src/lib/agent-store/index.ts +72 -0
  66. package/src/lib/agent-store/json-blob-store.ts +47 -0
  67. package/src/lib/auth.ts +135 -0
  68. package/src/lib/backoff.ts +32 -0
  69. package/src/lib/env.ts +3 -0
  70. package/src/lib/heartbeat.ts +21 -0
  71. package/src/pi/agent-store.ts +102 -0
  72. package/src/pi/env.ts +11 -0
  73. package/src/pi/executors/delete.ts +129 -0
  74. package/src/pi/executors/grep.ts +238 -0
  75. package/src/pi/executors/hook.ts +64 -0
  76. package/src/pi/executors/ls.ts +107 -0
  77. package/src/pi/executors/read.ts +73 -0
  78. package/src/pi/executors/request-context.ts +120 -0
  79. package/src/pi/executors/shell-stream.ts +136 -0
  80. package/src/pi/executors/shell.ts +157 -0
  81. package/src/pi/executors/stubs.ts +173 -0
  82. package/src/pi/executors/write.ts +189 -0
  83. package/src/pi/local-resource-provider/index.ts +10 -0
  84. package/src/pi/local-resource-provider/provider.ts +98 -0
  85. package/src/pi/local-resource-provider/types.ts +110 -0
  86. package/src/pi/model-mapping.ts +115 -0
  87. package/src/pi/model-override.ts +110 -0
  88. package/src/pi/model.ts +61 -0
  89. package/src/pi/request-builder.ts +279 -0
  90. package/src/pi/utils/tool-result.ts +35 -0
  91. package/src/stream.ts +386 -0
  92. package/src/tool-host.ts +44 -0
  93. package/src/vendor/agent-client/checkpoint-controller.ts +34 -0
  94. package/src/vendor/agent-client/connect.ts +348 -0
  95. package/src/vendor/agent-client/exec-controller.ts +102 -0
  96. package/src/vendor/agent-client/index.ts +25 -0
  97. package/src/vendor/agent-client/interaction-controller.ts +96 -0
  98. package/src/vendor/agent-client/split-stream.ts +143 -0
  99. package/src/vendor/agent-core/index.ts +9 -0
  100. package/src/vendor/agent-core/interaction-conversion.ts +558 -0
  101. package/src/vendor/agent-exec/controlled.ts +104 -0
  102. package/src/vendor/agent-exec/index.ts +45 -0
  103. package/src/vendor/agent-exec/registry-resource-accessor.ts +39 -0
  104. package/src/vendor/agent-exec/resources.ts +121 -0
  105. package/src/vendor/agent-exec/serialization.ts +22 -0
  106. package/src/vendor/agent-exec/simple-controlled-exec-manager.ts +161 -0
  107. package/src/vendor/agent-kv/agent-store.ts +115 -0
  108. package/src/vendor/agent-kv/blob-store.ts +36 -0
  109. package/src/vendor/agent-kv/controlled.ts +117 -0
  110. package/src/vendor/agent-kv/index.ts +15 -0
  111. package/src/vendor/agent-kv/serde.ts +44 -0
  112. package/src/vendor/local-exec/common.ts +19 -0
  113. package/src/vendor/local-exec/git-executor.ts +37 -0
  114. package/src/vendor/local-exec/git-helpers.ts +79 -0
  115. package/src/vendor/local-exec/index.ts +8 -0
  116. package/src/vendor/utils/index.ts +5 -0
  117. package/src/vendor/utils/map-writable.ts +34 -0
@@ -0,0 +1,302 @@
1
+ // @generated by protoc-gen-es v1.10.0 with parameter "target=ts"
2
+ // @generated from file agent/v1/mcp.proto (package agent.v1, syntax proto3)
3
+ /* eslint-disable */
4
+ // @ts-nocheck
5
+
6
+ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
7
+ import { Message, proto3 } from "@bufbuild/protobuf";
8
+
9
+ /**
10
+ * @generated from message agent.v1.McpToolDefinition
11
+ */
12
+ export class McpToolDefinition extends Message<McpToolDefinition> {
13
+ /**
14
+ * @generated from field: string name = 1;
15
+ */
16
+ name = "";
17
+
18
+ /**
19
+ * @generated from field: string provider_identifier = 4;
20
+ */
21
+ providerIdentifier = "";
22
+
23
+ /**
24
+ * @generated from field: string tool_name = 5;
25
+ */
26
+ toolName = "";
27
+
28
+ /**
29
+ * @generated from field: string description = 2;
30
+ */
31
+ description = "";
32
+
33
+ /**
34
+ * @generated from field: bytes input_schema = 3;
35
+ */
36
+ inputSchema = new Uint8Array(0);
37
+
38
+ constructor(data?: PartialMessage<McpToolDefinition>) {
39
+ super();
40
+ proto3.util.initPartial(data, this);
41
+ }
42
+
43
+ static readonly runtime: typeof proto3 = proto3;
44
+ static readonly typeName = "agent.v1.McpToolDefinition";
45
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
46
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
47
+ { no: 4, name: "provider_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ },
48
+ { no: 5, name: "tool_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
49
+ { no: 2, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ },
50
+ { no: 3, name: "input_schema", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
51
+ ]);
52
+
53
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): McpToolDefinition {
54
+ return new McpToolDefinition().fromBinary(bytes, options);
55
+ }
56
+
57
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): McpToolDefinition {
58
+ return new McpToolDefinition().fromJson(jsonValue, options);
59
+ }
60
+
61
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): McpToolDefinition {
62
+ return new McpToolDefinition().fromJsonString(jsonString, options);
63
+ }
64
+
65
+ static equals(a: McpToolDefinition | PlainMessage<McpToolDefinition> | undefined, b: McpToolDefinition | PlainMessage<McpToolDefinition> | undefined): boolean {
66
+ return proto3.util.equals(McpToolDefinition, a, b);
67
+ }
68
+ }
69
+
70
+ /**
71
+ * @generated from message agent.v1.McpTools
72
+ */
73
+ export class McpTools extends Message<McpTools> {
74
+ /**
75
+ * @generated from field: repeated agent.v1.McpToolDefinition mcp_tools = 1;
76
+ */
77
+ mcpTools: McpToolDefinition[] = [];
78
+
79
+ constructor(data?: PartialMessage<McpTools>) {
80
+ super();
81
+ proto3.util.initPartial(data, this);
82
+ }
83
+
84
+ static readonly runtime: typeof proto3 = proto3;
85
+ static readonly typeName = "agent.v1.McpTools";
86
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
87
+ { no: 1, name: "mcp_tools", kind: "message", T: McpToolDefinition, repeated: true },
88
+ ]);
89
+
90
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): McpTools {
91
+ return new McpTools().fromBinary(bytes, options);
92
+ }
93
+
94
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): McpTools {
95
+ return new McpTools().fromJson(jsonValue, options);
96
+ }
97
+
98
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): McpTools {
99
+ return new McpTools().fromJsonString(jsonString, options);
100
+ }
101
+
102
+ static equals(a: McpTools | PlainMessage<McpTools> | undefined, b: McpTools | PlainMessage<McpTools> | undefined): boolean {
103
+ return proto3.util.equals(McpTools, a, b);
104
+ }
105
+ }
106
+
107
+ /**
108
+ * @generated from message agent.v1.McpInstructions
109
+ */
110
+ export class McpInstructions extends Message<McpInstructions> {
111
+ /**
112
+ * @generated from field: string server_name = 1;
113
+ */
114
+ serverName = "";
115
+
116
+ /**
117
+ * @generated from field: string instructions = 2;
118
+ */
119
+ instructions = "";
120
+
121
+ constructor(data?: PartialMessage<McpInstructions>) {
122
+ super();
123
+ proto3.util.initPartial(data, this);
124
+ }
125
+
126
+ static readonly runtime: typeof proto3 = proto3;
127
+ static readonly typeName = "agent.v1.McpInstructions";
128
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
129
+ { no: 1, name: "server_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
130
+ { no: 2, name: "instructions", kind: "scalar", T: 9 /* ScalarType.STRING */ },
131
+ ]);
132
+
133
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): McpInstructions {
134
+ return new McpInstructions().fromBinary(bytes, options);
135
+ }
136
+
137
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): McpInstructions {
138
+ return new McpInstructions().fromJson(jsonValue, options);
139
+ }
140
+
141
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): McpInstructions {
142
+ return new McpInstructions().fromJsonString(jsonString, options);
143
+ }
144
+
145
+ static equals(a: McpInstructions | PlainMessage<McpInstructions> | undefined, b: McpInstructions | PlainMessage<McpInstructions> | undefined): boolean {
146
+ return proto3.util.equals(McpInstructions, a, b);
147
+ }
148
+ }
149
+
150
+ /**
151
+ * @generated from message agent.v1.McpDescriptor
152
+ */
153
+ export class McpDescriptor extends Message<McpDescriptor> {
154
+ /**
155
+ * @generated from field: string server_name = 1;
156
+ */
157
+ serverName = "";
158
+
159
+ /**
160
+ * @generated from field: string server_identifier = 2;
161
+ */
162
+ serverIdentifier = "";
163
+
164
+ /**
165
+ * @generated from field: optional string folder_path = 3;
166
+ */
167
+ folderPath?: string;
168
+
169
+ /**
170
+ * @generated from field: optional string server_use_instructions = 4;
171
+ */
172
+ serverUseInstructions?: string;
173
+
174
+ /**
175
+ * @generated from field: repeated agent.v1.McpToolDescriptor tools = 5;
176
+ */
177
+ tools: McpToolDescriptor[] = [];
178
+
179
+ constructor(data?: PartialMessage<McpDescriptor>) {
180
+ super();
181
+ proto3.util.initPartial(data, this);
182
+ }
183
+
184
+ static readonly runtime: typeof proto3 = proto3;
185
+ static readonly typeName = "agent.v1.McpDescriptor";
186
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
187
+ { no: 1, name: "server_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
188
+ { no: 2, name: "server_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ },
189
+ { no: 3, name: "folder_path", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
190
+ { no: 4, name: "server_use_instructions", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
191
+ { no: 5, name: "tools", kind: "message", T: McpToolDescriptor, repeated: true },
192
+ ]);
193
+
194
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): McpDescriptor {
195
+ return new McpDescriptor().fromBinary(bytes, options);
196
+ }
197
+
198
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): McpDescriptor {
199
+ return new McpDescriptor().fromJson(jsonValue, options);
200
+ }
201
+
202
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): McpDescriptor {
203
+ return new McpDescriptor().fromJsonString(jsonString, options);
204
+ }
205
+
206
+ static equals(a: McpDescriptor | PlainMessage<McpDescriptor> | undefined, b: McpDescriptor | PlainMessage<McpDescriptor> | undefined): boolean {
207
+ return proto3.util.equals(McpDescriptor, a, b);
208
+ }
209
+ }
210
+
211
+ /**
212
+ * @generated from message agent.v1.McpToolDescriptor
213
+ */
214
+ export class McpToolDescriptor extends Message<McpToolDescriptor> {
215
+ /**
216
+ * @generated from field: string tool_name = 1;
217
+ */
218
+ toolName = "";
219
+
220
+ /**
221
+ * @generated from field: optional string definition_path = 2;
222
+ */
223
+ definitionPath?: string;
224
+
225
+ constructor(data?: PartialMessage<McpToolDescriptor>) {
226
+ super();
227
+ proto3.util.initPartial(data, this);
228
+ }
229
+
230
+ static readonly runtime: typeof proto3 = proto3;
231
+ static readonly typeName = "agent.v1.McpToolDescriptor";
232
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
233
+ { no: 1, name: "tool_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
234
+ { no: 2, name: "definition_path", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
235
+ ]);
236
+
237
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): McpToolDescriptor {
238
+ return new McpToolDescriptor().fromBinary(bytes, options);
239
+ }
240
+
241
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): McpToolDescriptor {
242
+ return new McpToolDescriptor().fromJson(jsonValue, options);
243
+ }
244
+
245
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): McpToolDescriptor {
246
+ return new McpToolDescriptor().fromJsonString(jsonString, options);
247
+ }
248
+
249
+ static equals(a: McpToolDescriptor | PlainMessage<McpToolDescriptor> | undefined, b: McpToolDescriptor | PlainMessage<McpToolDescriptor> | undefined): boolean {
250
+ return proto3.util.equals(McpToolDescriptor, a, b);
251
+ }
252
+ }
253
+
254
+ /**
255
+ * @generated from message agent.v1.McpFileSystemOptions
256
+ */
257
+ export class McpFileSystemOptions extends Message<McpFileSystemOptions> {
258
+ /**
259
+ * @generated from field: bool enabled = 1;
260
+ */
261
+ enabled = false;
262
+
263
+ /**
264
+ * @generated from field: string workspace_project_dir = 2;
265
+ */
266
+ workspaceProjectDir = "";
267
+
268
+ /**
269
+ * @generated from field: repeated agent.v1.McpDescriptor mcp_descriptors = 3;
270
+ */
271
+ mcpDescriptors: McpDescriptor[] = [];
272
+
273
+ constructor(data?: PartialMessage<McpFileSystemOptions>) {
274
+ super();
275
+ proto3.util.initPartial(data, this);
276
+ }
277
+
278
+ static readonly runtime: typeof proto3 = proto3;
279
+ static readonly typeName = "agent.v1.McpFileSystemOptions";
280
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
281
+ { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
282
+ { no: 2, name: "workspace_project_dir", kind: "scalar", T: 9 /* ScalarType.STRING */ },
283
+ { no: 3, name: "mcp_descriptors", kind: "message", T: McpDescriptor, repeated: true },
284
+ ]);
285
+
286
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): McpFileSystemOptions {
287
+ return new McpFileSystemOptions().fromBinary(bytes, options);
288
+ }
289
+
290
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): McpFileSystemOptions {
291
+ return new McpFileSystemOptions().fromJson(jsonValue, options);
292
+ }
293
+
294
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): McpFileSystemOptions {
295
+ return new McpFileSystemOptions().fromJsonString(jsonString, options);
296
+ }
297
+
298
+ static equals(a: McpFileSystemOptions | PlainMessage<McpFileSystemOptions> | undefined, b: McpFileSystemOptions | PlainMessage<McpFileSystemOptions> | undefined): boolean {
299
+ return proto3.util.equals(McpFileSystemOptions, a, b);
300
+ }
301
+ }
302
+