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,248 @@
1
+ // @generated by protoc-gen-es v1.10.0 with parameter "target=ts"
2
+ // @generated from file agent/v1/glob_tool.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.GlobToolResult
11
+ */
12
+ export class GlobToolResult extends Message<GlobToolResult> {
13
+ /**
14
+ * @generated from oneof agent.v1.GlobToolResult.result
15
+ */
16
+ result: {
17
+ /**
18
+ * @generated from field: agent.v1.GlobToolSuccess success = 1;
19
+ */
20
+ value: GlobToolSuccess;
21
+ case: "success";
22
+ } | {
23
+ /**
24
+ * @generated from field: agent.v1.GlobToolError error = 2;
25
+ */
26
+ value: GlobToolError;
27
+ case: "error";
28
+ } | { case: undefined; value?: undefined } = { case: undefined };
29
+
30
+ constructor(data?: PartialMessage<GlobToolResult>) {
31
+ super();
32
+ proto3.util.initPartial(data, this);
33
+ }
34
+
35
+ static readonly runtime: typeof proto3 = proto3;
36
+ static readonly typeName = "agent.v1.GlobToolResult";
37
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
38
+ { no: 1, name: "success", kind: "message", T: GlobToolSuccess, oneof: "result" },
39
+ { no: 2, name: "error", kind: "message", T: GlobToolError, oneof: "result" },
40
+ ]);
41
+
42
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GlobToolResult {
43
+ return new GlobToolResult().fromBinary(bytes, options);
44
+ }
45
+
46
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GlobToolResult {
47
+ return new GlobToolResult().fromJson(jsonValue, options);
48
+ }
49
+
50
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GlobToolResult {
51
+ return new GlobToolResult().fromJsonString(jsonString, options);
52
+ }
53
+
54
+ static equals(a: GlobToolResult | PlainMessage<GlobToolResult> | undefined, b: GlobToolResult | PlainMessage<GlobToolResult> | undefined): boolean {
55
+ return proto3.util.equals(GlobToolResult, a, b);
56
+ }
57
+ }
58
+
59
+ /**
60
+ * @generated from message agent.v1.GlobToolError
61
+ */
62
+ export class GlobToolError extends Message<GlobToolError> {
63
+ /**
64
+ * @generated from field: string error = 1;
65
+ */
66
+ error = "";
67
+
68
+ constructor(data?: PartialMessage<GlobToolError>) {
69
+ super();
70
+ proto3.util.initPartial(data, this);
71
+ }
72
+
73
+ static readonly runtime: typeof proto3 = proto3;
74
+ static readonly typeName = "agent.v1.GlobToolError";
75
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
76
+ { no: 1, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */ },
77
+ ]);
78
+
79
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GlobToolError {
80
+ return new GlobToolError().fromBinary(bytes, options);
81
+ }
82
+
83
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GlobToolError {
84
+ return new GlobToolError().fromJson(jsonValue, options);
85
+ }
86
+
87
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GlobToolError {
88
+ return new GlobToolError().fromJsonString(jsonString, options);
89
+ }
90
+
91
+ static equals(a: GlobToolError | PlainMessage<GlobToolError> | undefined, b: GlobToolError | PlainMessage<GlobToolError> | undefined): boolean {
92
+ return proto3.util.equals(GlobToolError, a, b);
93
+ }
94
+ }
95
+
96
+ /**
97
+ * @generated from message agent.v1.GlobToolSuccess
98
+ */
99
+ export class GlobToolSuccess extends Message<GlobToolSuccess> {
100
+ /**
101
+ * @generated from field: string pattern = 1;
102
+ */
103
+ pattern = "";
104
+
105
+ /**
106
+ * @generated from field: string path = 2;
107
+ */
108
+ path = "";
109
+
110
+ /**
111
+ * @generated from field: repeated string files = 3;
112
+ */
113
+ files: string[] = [];
114
+
115
+ /**
116
+ * @generated from field: int32 total_files = 4;
117
+ */
118
+ totalFiles = 0;
119
+
120
+ /**
121
+ * @generated from field: bool client_truncated = 5;
122
+ */
123
+ clientTruncated = false;
124
+
125
+ /**
126
+ * @generated from field: bool ripgrep_truncated = 6;
127
+ */
128
+ ripgrepTruncated = false;
129
+
130
+ constructor(data?: PartialMessage<GlobToolSuccess>) {
131
+ super();
132
+ proto3.util.initPartial(data, this);
133
+ }
134
+
135
+ static readonly runtime: typeof proto3 = proto3;
136
+ static readonly typeName = "agent.v1.GlobToolSuccess";
137
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
138
+ { no: 1, name: "pattern", kind: "scalar", T: 9 /* ScalarType.STRING */ },
139
+ { no: 2, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ },
140
+ { no: 3, name: "files", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
141
+ { no: 4, name: "total_files", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
142
+ { no: 5, name: "client_truncated", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
143
+ { no: 6, name: "ripgrep_truncated", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
144
+ ]);
145
+
146
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GlobToolSuccess {
147
+ return new GlobToolSuccess().fromBinary(bytes, options);
148
+ }
149
+
150
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GlobToolSuccess {
151
+ return new GlobToolSuccess().fromJson(jsonValue, options);
152
+ }
153
+
154
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GlobToolSuccess {
155
+ return new GlobToolSuccess().fromJsonString(jsonString, options);
156
+ }
157
+
158
+ static equals(a: GlobToolSuccess | PlainMessage<GlobToolSuccess> | undefined, b: GlobToolSuccess | PlainMessage<GlobToolSuccess> | undefined): boolean {
159
+ return proto3.util.equals(GlobToolSuccess, a, b);
160
+ }
161
+ }
162
+
163
+ /**
164
+ * @generated from message agent.v1.GlobToolArgs
165
+ */
166
+ export class GlobToolArgs extends Message<GlobToolArgs> {
167
+ /**
168
+ * @generated from field: optional string target_directory = 1;
169
+ */
170
+ targetDirectory?: string;
171
+
172
+ /**
173
+ * @generated from field: string glob_pattern = 2;
174
+ */
175
+ globPattern = "";
176
+
177
+ constructor(data?: PartialMessage<GlobToolArgs>) {
178
+ super();
179
+ proto3.util.initPartial(data, this);
180
+ }
181
+
182
+ static readonly runtime: typeof proto3 = proto3;
183
+ static readonly typeName = "agent.v1.GlobToolArgs";
184
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
185
+ { no: 1, name: "target_directory", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
186
+ { no: 2, name: "glob_pattern", kind: "scalar", T: 9 /* ScalarType.STRING */ },
187
+ ]);
188
+
189
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GlobToolArgs {
190
+ return new GlobToolArgs().fromBinary(bytes, options);
191
+ }
192
+
193
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GlobToolArgs {
194
+ return new GlobToolArgs().fromJson(jsonValue, options);
195
+ }
196
+
197
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GlobToolArgs {
198
+ return new GlobToolArgs().fromJsonString(jsonString, options);
199
+ }
200
+
201
+ static equals(a: GlobToolArgs | PlainMessage<GlobToolArgs> | undefined, b: GlobToolArgs | PlainMessage<GlobToolArgs> | undefined): boolean {
202
+ return proto3.util.equals(GlobToolArgs, a, b);
203
+ }
204
+ }
205
+
206
+ /**
207
+ * @generated from message agent.v1.GlobToolCall
208
+ */
209
+ export class GlobToolCall extends Message<GlobToolCall> {
210
+ /**
211
+ * @generated from field: agent.v1.GlobToolArgs args = 1;
212
+ */
213
+ args?: GlobToolArgs;
214
+
215
+ /**
216
+ * @generated from field: agent.v1.GlobToolResult result = 2;
217
+ */
218
+ result?: GlobToolResult;
219
+
220
+ constructor(data?: PartialMessage<GlobToolCall>) {
221
+ super();
222
+ proto3.util.initPartial(data, this);
223
+ }
224
+
225
+ static readonly runtime: typeof proto3 = proto3;
226
+ static readonly typeName = "agent.v1.GlobToolCall";
227
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
228
+ { no: 1, name: "args", kind: "message", T: GlobToolArgs },
229
+ { no: 2, name: "result", kind: "message", T: GlobToolResult },
230
+ ]);
231
+
232
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GlobToolCall {
233
+ return new GlobToolCall().fromBinary(bytes, options);
234
+ }
235
+
236
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GlobToolCall {
237
+ return new GlobToolCall().fromJson(jsonValue, options);
238
+ }
239
+
240
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GlobToolCall {
241
+ return new GlobToolCall().fromJsonString(jsonString, options);
242
+ }
243
+
244
+ static equals(a: GlobToolCall | PlainMessage<GlobToolCall> | undefined, b: GlobToolCall | PlainMessage<GlobToolCall> | undefined): boolean {
245
+ return proto3.util.equals(GlobToolCall, a, b);
246
+ }
247
+ }
248
+