@clinebot/shared 0.0.12 → 0.0.14

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,5 @@
1
+ /**
2
+ * URI scheme for opening remote rules/workflows in the editor.
3
+ * Used to construct URIs like: remote://rule/{name} or remote://workflow/{name}
4
+ */
5
+ export declare const REMOTE_URI_SCHEME = "remote://";
@@ -0,0 +1,426 @@
1
+ /**
2
+ * ═══════════════════════════════════════════════════════════════════════════
3
+ * ⚠️ CRITICAL WARNING ⚠️
4
+ * ═══════════════════════════════════════════════════════════════════════════
5
+ *
6
+ * THE API SERVER MUST BE RE-DEPLOYED WHENEVER THIS SCHEMA IS UPDATED!
7
+ *
8
+ * This schema is used by both the extension and the API server for validation.
9
+ * Any changes here require a coordinated deployment to avoid validation errors.
10
+ *
11
+ * ═══════════════════════════════════════════════════════════════════════════
12
+ */
13
+ import { z } from "zod";
14
+ export declare const OpenAiCompatibleModelSchema: z.ZodObject<{
15
+ id: z.ZodString;
16
+ temperature: z.ZodOptional<z.ZodNumber>;
17
+ isR1FormatRequired: z.ZodOptional<z.ZodBoolean>;
18
+ maxTokens: z.ZodOptional<z.ZodNumber>;
19
+ contextWindow: z.ZodOptional<z.ZodNumber>;
20
+ inputPrice: z.ZodOptional<z.ZodNumber>;
21
+ outputPrice: z.ZodOptional<z.ZodNumber>;
22
+ supportsImages: z.ZodOptional<z.ZodBoolean>;
23
+ }, z.core.$strip>;
24
+ export declare const OpenAiCompatibleSchema: z.ZodObject<{
25
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
26
+ id: z.ZodString;
27
+ temperature: z.ZodOptional<z.ZodNumber>;
28
+ isR1FormatRequired: z.ZodOptional<z.ZodBoolean>;
29
+ maxTokens: z.ZodOptional<z.ZodNumber>;
30
+ contextWindow: z.ZodOptional<z.ZodNumber>;
31
+ inputPrice: z.ZodOptional<z.ZodNumber>;
32
+ outputPrice: z.ZodOptional<z.ZodNumber>;
33
+ supportsImages: z.ZodOptional<z.ZodBoolean>;
34
+ }, z.core.$strip>>>;
35
+ openAiBaseUrl: z.ZodOptional<z.ZodString>;
36
+ openAiHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
37
+ azureApiVersion: z.ZodOptional<z.ZodString>;
38
+ azureIdentity: z.ZodOptional<z.ZodBoolean>;
39
+ }, z.core.$strip>;
40
+ export declare const AwsBedrockModelSchema: z.ZodObject<{
41
+ id: z.ZodString;
42
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
43
+ }, z.core.$strip>;
44
+ export declare const AwsBedrockCustomModelSchema: z.ZodObject<{
45
+ name: z.ZodString;
46
+ baseModelId: z.ZodString;
47
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
48
+ }, z.core.$strip>;
49
+ export declare const AwsBedrockSettingsSchema: z.ZodObject<{
50
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
51
+ id: z.ZodString;
52
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
53
+ }, z.core.$strip>>>;
54
+ customModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
55
+ name: z.ZodString;
56
+ baseModelId: z.ZodString;
57
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
58
+ }, z.core.$strip>>>;
59
+ awsRegion: z.ZodOptional<z.ZodString>;
60
+ awsUseCrossRegionInference: z.ZodOptional<z.ZodBoolean>;
61
+ awsUseGlobalInference: z.ZodOptional<z.ZodBoolean>;
62
+ awsBedrockUsePromptCache: z.ZodOptional<z.ZodBoolean>;
63
+ awsBedrockEndpoint: z.ZodOptional<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ export declare const ClineModelSchema: z.ZodObject<{
66
+ id: z.ZodString;
67
+ }, z.core.$strip>;
68
+ export declare const ClineSettingsSchema: z.ZodObject<{
69
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
70
+ id: z.ZodString;
71
+ }, z.core.$strip>>>;
72
+ }, z.core.$strip>;
73
+ export declare const VertexModelSchema: z.ZodObject<{
74
+ id: z.ZodString;
75
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
76
+ }, z.core.$strip>;
77
+ export declare const VertexSettingsSchema: z.ZodObject<{
78
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
79
+ id: z.ZodString;
80
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
81
+ }, z.core.$strip>>>;
82
+ vertexProjectId: z.ZodOptional<z.ZodString>;
83
+ vertexRegion: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strip>;
85
+ export declare const LiteLLMModelSchema: z.ZodObject<{
86
+ id: z.ZodString;
87
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
88
+ promptCachingEnabled: z.ZodOptional<z.ZodBoolean>;
89
+ }, z.core.$strip>;
90
+ export declare const LiteLLMSchema: z.ZodObject<{
91
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
92
+ id: z.ZodString;
93
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
94
+ promptCachingEnabled: z.ZodOptional<z.ZodBoolean>;
95
+ }, z.core.$strip>>>;
96
+ baseUrl: z.ZodOptional<z.ZodString>;
97
+ }, z.core.$strip>;
98
+ export declare const AnthropicModelSchema: z.ZodObject<{
99
+ id: z.ZodString;
100
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
101
+ }, z.core.$strip>;
102
+ export declare const AnthropicSchema: z.ZodObject<{
103
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
104
+ id: z.ZodString;
105
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
106
+ }, z.core.$strip>>>;
107
+ baseUrl: z.ZodOptional<z.ZodString>;
108
+ }, z.core.$strip>;
109
+ declare const ProviderSettingsSchema: z.ZodObject<{
110
+ OpenAiCompatible: z.ZodOptional<z.ZodObject<{
111
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
112
+ id: z.ZodString;
113
+ temperature: z.ZodOptional<z.ZodNumber>;
114
+ isR1FormatRequired: z.ZodOptional<z.ZodBoolean>;
115
+ maxTokens: z.ZodOptional<z.ZodNumber>;
116
+ contextWindow: z.ZodOptional<z.ZodNumber>;
117
+ inputPrice: z.ZodOptional<z.ZodNumber>;
118
+ outputPrice: z.ZodOptional<z.ZodNumber>;
119
+ supportsImages: z.ZodOptional<z.ZodBoolean>;
120
+ }, z.core.$strip>>>;
121
+ openAiBaseUrl: z.ZodOptional<z.ZodString>;
122
+ openAiHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
123
+ azureApiVersion: z.ZodOptional<z.ZodString>;
124
+ azureIdentity: z.ZodOptional<z.ZodBoolean>;
125
+ }, z.core.$strip>>;
126
+ AwsBedrock: z.ZodOptional<z.ZodObject<{
127
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
128
+ id: z.ZodString;
129
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
130
+ }, z.core.$strip>>>;
131
+ customModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
132
+ name: z.ZodString;
133
+ baseModelId: z.ZodString;
134
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
135
+ }, z.core.$strip>>>;
136
+ awsRegion: z.ZodOptional<z.ZodString>;
137
+ awsUseCrossRegionInference: z.ZodOptional<z.ZodBoolean>;
138
+ awsUseGlobalInference: z.ZodOptional<z.ZodBoolean>;
139
+ awsBedrockUsePromptCache: z.ZodOptional<z.ZodBoolean>;
140
+ awsBedrockEndpoint: z.ZodOptional<z.ZodString>;
141
+ }, z.core.$strip>>;
142
+ Cline: z.ZodOptional<z.ZodObject<{
143
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
144
+ id: z.ZodString;
145
+ }, z.core.$strip>>>;
146
+ }, z.core.$strip>>;
147
+ Vertex: z.ZodOptional<z.ZodObject<{
148
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
149
+ id: z.ZodString;
150
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
151
+ }, z.core.$strip>>>;
152
+ vertexProjectId: z.ZodOptional<z.ZodString>;
153
+ vertexRegion: z.ZodOptional<z.ZodString>;
154
+ }, z.core.$strip>>;
155
+ LiteLLM: z.ZodOptional<z.ZodObject<{
156
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
157
+ id: z.ZodString;
158
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
159
+ promptCachingEnabled: z.ZodOptional<z.ZodBoolean>;
160
+ }, z.core.$strip>>>;
161
+ baseUrl: z.ZodOptional<z.ZodString>;
162
+ }, z.core.$strip>>;
163
+ Anthropic: z.ZodOptional<z.ZodObject<{
164
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
165
+ id: z.ZodString;
166
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
167
+ }, z.core.$strip>>>;
168
+ baseUrl: z.ZodOptional<z.ZodString>;
169
+ }, z.core.$strip>>;
170
+ }, z.core.$strip>;
171
+ export declare const AllowedMCPServerSchema: z.ZodObject<{
172
+ id: z.ZodString;
173
+ }, z.core.$strip>;
174
+ export declare const RemoteMCPServerSchema: z.ZodObject<{
175
+ name: z.ZodString;
176
+ url: z.ZodString;
177
+ alwaysEnabled: z.ZodOptional<z.ZodBoolean>;
178
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
179
+ }, z.core.$strip>;
180
+ export declare const GlobalInstructionsFileSchema: z.ZodObject<{
181
+ alwaysEnabled: z.ZodBoolean;
182
+ name: z.ZodString;
183
+ contents: z.ZodString;
184
+ }, z.core.$strip>;
185
+ export declare const S3AccessKeySettingsSchema: z.ZodObject<{
186
+ bucket: z.ZodString;
187
+ accessKeyId: z.ZodString;
188
+ secretAccessKey: z.ZodString;
189
+ region: z.ZodOptional<z.ZodString>;
190
+ endpoint: z.ZodOptional<z.ZodString>;
191
+ accountId: z.ZodOptional<z.ZodString>;
192
+ intervalMs: z.ZodOptional<z.ZodNumber>;
193
+ maxRetries: z.ZodOptional<z.ZodNumber>;
194
+ batchSize: z.ZodOptional<z.ZodNumber>;
195
+ maxQueueSize: z.ZodOptional<z.ZodNumber>;
196
+ maxFailedAgeMs: z.ZodOptional<z.ZodNumber>;
197
+ backfillEnabled: z.ZodOptional<z.ZodBoolean>;
198
+ }, z.core.$strip>;
199
+ export declare const PromptUploadingSchema: z.ZodObject<{
200
+ enabled: z.ZodOptional<z.ZodBoolean>;
201
+ type: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"s3_access_keys">, z.ZodLiteral<"r2_access_keys">]>>;
202
+ s3AccessSettings: z.ZodOptional<z.ZodObject<{
203
+ bucket: z.ZodString;
204
+ accessKeyId: z.ZodString;
205
+ secretAccessKey: z.ZodString;
206
+ region: z.ZodOptional<z.ZodString>;
207
+ endpoint: z.ZodOptional<z.ZodString>;
208
+ accountId: z.ZodOptional<z.ZodString>;
209
+ intervalMs: z.ZodOptional<z.ZodNumber>;
210
+ maxRetries: z.ZodOptional<z.ZodNumber>;
211
+ batchSize: z.ZodOptional<z.ZodNumber>;
212
+ maxQueueSize: z.ZodOptional<z.ZodNumber>;
213
+ maxFailedAgeMs: z.ZodOptional<z.ZodNumber>;
214
+ backfillEnabled: z.ZodOptional<z.ZodBoolean>;
215
+ }, z.core.$strip>>;
216
+ r2AccessSettings: z.ZodOptional<z.ZodObject<{
217
+ bucket: z.ZodString;
218
+ accessKeyId: z.ZodString;
219
+ secretAccessKey: z.ZodString;
220
+ region: z.ZodOptional<z.ZodString>;
221
+ endpoint: z.ZodOptional<z.ZodString>;
222
+ accountId: z.ZodOptional<z.ZodString>;
223
+ intervalMs: z.ZodOptional<z.ZodNumber>;
224
+ maxRetries: z.ZodOptional<z.ZodNumber>;
225
+ batchSize: z.ZodOptional<z.ZodNumber>;
226
+ maxQueueSize: z.ZodOptional<z.ZodNumber>;
227
+ maxFailedAgeMs: z.ZodOptional<z.ZodNumber>;
228
+ backfillEnabled: z.ZodOptional<z.ZodBoolean>;
229
+ }, z.core.$strip>>;
230
+ }, z.core.$strip>;
231
+ export declare const EnterpriseTelemetrySchema: z.ZodObject<{
232
+ promptUploading: z.ZodOptional<z.ZodObject<{
233
+ enabled: z.ZodOptional<z.ZodBoolean>;
234
+ type: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"s3_access_keys">, z.ZodLiteral<"r2_access_keys">]>>;
235
+ s3AccessSettings: z.ZodOptional<z.ZodObject<{
236
+ bucket: z.ZodString;
237
+ accessKeyId: z.ZodString;
238
+ secretAccessKey: z.ZodString;
239
+ region: z.ZodOptional<z.ZodString>;
240
+ endpoint: z.ZodOptional<z.ZodString>;
241
+ accountId: z.ZodOptional<z.ZodString>;
242
+ intervalMs: z.ZodOptional<z.ZodNumber>;
243
+ maxRetries: z.ZodOptional<z.ZodNumber>;
244
+ batchSize: z.ZodOptional<z.ZodNumber>;
245
+ maxQueueSize: z.ZodOptional<z.ZodNumber>;
246
+ maxFailedAgeMs: z.ZodOptional<z.ZodNumber>;
247
+ backfillEnabled: z.ZodOptional<z.ZodBoolean>;
248
+ }, z.core.$strip>>;
249
+ r2AccessSettings: z.ZodOptional<z.ZodObject<{
250
+ bucket: z.ZodString;
251
+ accessKeyId: z.ZodString;
252
+ secretAccessKey: z.ZodString;
253
+ region: z.ZodOptional<z.ZodString>;
254
+ endpoint: z.ZodOptional<z.ZodString>;
255
+ accountId: z.ZodOptional<z.ZodString>;
256
+ intervalMs: z.ZodOptional<z.ZodNumber>;
257
+ maxRetries: z.ZodOptional<z.ZodNumber>;
258
+ batchSize: z.ZodOptional<z.ZodNumber>;
259
+ maxQueueSize: z.ZodOptional<z.ZodNumber>;
260
+ maxFailedAgeMs: z.ZodOptional<z.ZodNumber>;
261
+ backfillEnabled: z.ZodOptional<z.ZodBoolean>;
262
+ }, z.core.$strip>>;
263
+ }, z.core.$strip>>;
264
+ }, z.core.$strip>;
265
+ export declare const RemoteConfigSchema: z.ZodObject<{
266
+ version: z.ZodString;
267
+ providerSettings: z.ZodOptional<z.ZodObject<{
268
+ OpenAiCompatible: z.ZodOptional<z.ZodObject<{
269
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
270
+ id: z.ZodString;
271
+ temperature: z.ZodOptional<z.ZodNumber>;
272
+ isR1FormatRequired: z.ZodOptional<z.ZodBoolean>;
273
+ maxTokens: z.ZodOptional<z.ZodNumber>;
274
+ contextWindow: z.ZodOptional<z.ZodNumber>;
275
+ inputPrice: z.ZodOptional<z.ZodNumber>;
276
+ outputPrice: z.ZodOptional<z.ZodNumber>;
277
+ supportsImages: z.ZodOptional<z.ZodBoolean>;
278
+ }, z.core.$strip>>>;
279
+ openAiBaseUrl: z.ZodOptional<z.ZodString>;
280
+ openAiHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
281
+ azureApiVersion: z.ZodOptional<z.ZodString>;
282
+ azureIdentity: z.ZodOptional<z.ZodBoolean>;
283
+ }, z.core.$strip>>;
284
+ AwsBedrock: z.ZodOptional<z.ZodObject<{
285
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
286
+ id: z.ZodString;
287
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
288
+ }, z.core.$strip>>>;
289
+ customModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
290
+ name: z.ZodString;
291
+ baseModelId: z.ZodString;
292
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
293
+ }, z.core.$strip>>>;
294
+ awsRegion: z.ZodOptional<z.ZodString>;
295
+ awsUseCrossRegionInference: z.ZodOptional<z.ZodBoolean>;
296
+ awsUseGlobalInference: z.ZodOptional<z.ZodBoolean>;
297
+ awsBedrockUsePromptCache: z.ZodOptional<z.ZodBoolean>;
298
+ awsBedrockEndpoint: z.ZodOptional<z.ZodString>;
299
+ }, z.core.$strip>>;
300
+ Cline: z.ZodOptional<z.ZodObject<{
301
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
302
+ id: z.ZodString;
303
+ }, z.core.$strip>>>;
304
+ }, z.core.$strip>>;
305
+ Vertex: z.ZodOptional<z.ZodObject<{
306
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
307
+ id: z.ZodString;
308
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
309
+ }, z.core.$strip>>>;
310
+ vertexProjectId: z.ZodOptional<z.ZodString>;
311
+ vertexRegion: z.ZodOptional<z.ZodString>;
312
+ }, z.core.$strip>>;
313
+ LiteLLM: z.ZodOptional<z.ZodObject<{
314
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
315
+ id: z.ZodString;
316
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
317
+ promptCachingEnabled: z.ZodOptional<z.ZodBoolean>;
318
+ }, z.core.$strip>>>;
319
+ baseUrl: z.ZodOptional<z.ZodString>;
320
+ }, z.core.$strip>>;
321
+ Anthropic: z.ZodOptional<z.ZodObject<{
322
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
323
+ id: z.ZodString;
324
+ thinkingBudgetTokens: z.ZodOptional<z.ZodNumber>;
325
+ }, z.core.$strip>>>;
326
+ baseUrl: z.ZodOptional<z.ZodString>;
327
+ }, z.core.$strip>>;
328
+ }, z.core.$strip>>;
329
+ telemetryEnabled: z.ZodOptional<z.ZodBoolean>;
330
+ kanbanEnabled: z.ZodOptional<z.ZodBoolean>;
331
+ mcpMarketplaceEnabled: z.ZodOptional<z.ZodBoolean>;
332
+ allowedMCPServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
333
+ id: z.ZodString;
334
+ }, z.core.$strip>>>;
335
+ remoteMCPServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
336
+ name: z.ZodString;
337
+ url: z.ZodString;
338
+ alwaysEnabled: z.ZodOptional<z.ZodBoolean>;
339
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
340
+ }, z.core.$strip>>>;
341
+ blockPersonalRemoteMCPServers: z.ZodOptional<z.ZodBoolean>;
342
+ yoloModeAllowed: z.ZodOptional<z.ZodBoolean>;
343
+ openTelemetryEnabled: z.ZodOptional<z.ZodBoolean>;
344
+ openTelemetryMetricsExporter: z.ZodOptional<z.ZodString>;
345
+ openTelemetryLogsExporter: z.ZodOptional<z.ZodString>;
346
+ openTelemetryOtlpProtocol: z.ZodOptional<z.ZodString>;
347
+ openTelemetryOtlpEndpoint: z.ZodOptional<z.ZodString>;
348
+ openTelemetryOtlpHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
349
+ openTelemetryOtlpMetricsProtocol: z.ZodOptional<z.ZodString>;
350
+ openTelemetryOtlpMetricsEndpoint: z.ZodOptional<z.ZodString>;
351
+ openTelemetryOtlpMetricsHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
352
+ openTelemetryOtlpLogsProtocol: z.ZodOptional<z.ZodString>;
353
+ openTelemetryOtlpLogsEndpoint: z.ZodOptional<z.ZodString>;
354
+ openTelemetryOtlpLogsHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
355
+ openTelemetryMetricExportInterval: z.ZodOptional<z.ZodNumber>;
356
+ openTelemetryOtlpInsecure: z.ZodOptional<z.ZodBoolean>;
357
+ openTelemetryLogBatchSize: z.ZodOptional<z.ZodNumber>;
358
+ openTelemetryLogBatchTimeout: z.ZodOptional<z.ZodNumber>;
359
+ openTelemetryLogMaxQueueSize: z.ZodOptional<z.ZodNumber>;
360
+ enterpriseTelemetry: z.ZodOptional<z.ZodObject<{
361
+ promptUploading: z.ZodOptional<z.ZodObject<{
362
+ enabled: z.ZodOptional<z.ZodBoolean>;
363
+ type: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"s3_access_keys">, z.ZodLiteral<"r2_access_keys">]>>;
364
+ s3AccessSettings: z.ZodOptional<z.ZodObject<{
365
+ bucket: z.ZodString;
366
+ accessKeyId: z.ZodString;
367
+ secretAccessKey: z.ZodString;
368
+ region: z.ZodOptional<z.ZodString>;
369
+ endpoint: z.ZodOptional<z.ZodString>;
370
+ accountId: z.ZodOptional<z.ZodString>;
371
+ intervalMs: z.ZodOptional<z.ZodNumber>;
372
+ maxRetries: z.ZodOptional<z.ZodNumber>;
373
+ batchSize: z.ZodOptional<z.ZodNumber>;
374
+ maxQueueSize: z.ZodOptional<z.ZodNumber>;
375
+ maxFailedAgeMs: z.ZodOptional<z.ZodNumber>;
376
+ backfillEnabled: z.ZodOptional<z.ZodBoolean>;
377
+ }, z.core.$strip>>;
378
+ r2AccessSettings: z.ZodOptional<z.ZodObject<{
379
+ bucket: z.ZodString;
380
+ accessKeyId: z.ZodString;
381
+ secretAccessKey: z.ZodString;
382
+ region: z.ZodOptional<z.ZodString>;
383
+ endpoint: z.ZodOptional<z.ZodString>;
384
+ accountId: z.ZodOptional<z.ZodString>;
385
+ intervalMs: z.ZodOptional<z.ZodNumber>;
386
+ maxRetries: z.ZodOptional<z.ZodNumber>;
387
+ batchSize: z.ZodOptional<z.ZodNumber>;
388
+ maxQueueSize: z.ZodOptional<z.ZodNumber>;
389
+ maxFailedAgeMs: z.ZodOptional<z.ZodNumber>;
390
+ backfillEnabled: z.ZodOptional<z.ZodBoolean>;
391
+ }, z.core.$strip>>;
392
+ }, z.core.$strip>>;
393
+ }, z.core.$strip>>;
394
+ globalRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
395
+ alwaysEnabled: z.ZodBoolean;
396
+ name: z.ZodString;
397
+ contents: z.ZodString;
398
+ }, z.core.$strip>>>;
399
+ globalWorkflows: z.ZodOptional<z.ZodArray<z.ZodObject<{
400
+ alwaysEnabled: z.ZodBoolean;
401
+ name: z.ZodString;
402
+ contents: z.ZodString;
403
+ }, z.core.$strip>>>;
404
+ }, z.core.$strip>;
405
+ export declare const APIKeySchema: z.ZodRecord<z.ZodString, z.ZodString>;
406
+ export type RemoteConfig = z.infer<typeof RemoteConfigSchema>;
407
+ export type MCPServer = z.infer<typeof AllowedMCPServerSchema>;
408
+ export type RemoteMCPServer = z.infer<typeof RemoteMCPServerSchema>;
409
+ export type GlobalInstructionsFile = z.infer<typeof GlobalInstructionsFileSchema>;
410
+ export type ProviderSettings = z.infer<typeof ProviderSettingsSchema>;
411
+ export type OpenAiCompatible = z.infer<typeof OpenAiCompatibleSchema>;
412
+ export type OpenAiCompatibleModel = z.infer<typeof OpenAiCompatibleModelSchema>;
413
+ export type AwsBedrockSettings = z.infer<typeof AwsBedrockSettingsSchema>;
414
+ export type AwsBedrockModel = z.infer<typeof AwsBedrockModelSchema>;
415
+ export type AwsBedrockCustomModel = z.infer<typeof AwsBedrockCustomModelSchema>;
416
+ export type VertexSettings = z.infer<typeof VertexSettingsSchema>;
417
+ export type VertexModel = z.infer<typeof VertexModelSchema>;
418
+ export type LiteLLMSettings = z.infer<typeof LiteLLMSchema>;
419
+ export type LiteLLMModel = z.infer<typeof LiteLLMModelSchema>;
420
+ export type AnthropicSettings = z.infer<typeof AnthropicSchema>;
421
+ export type AnthropicModel = z.infer<typeof AnthropicModelSchema>;
422
+ export type APIKeySettings = z.infer<typeof APIKeySchema>;
423
+ export type EnterpriseTelemetry = z.infer<typeof EnterpriseTelemetrySchema>;
424
+ export type PromptUploading = z.infer<typeof PromptUploadingSchema>;
425
+ export type S3AccessKeySettings = z.infer<typeof S3AccessKeySettingsSchema>;
426
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const CLINE_RPC_PORT = 25463;
2
+ export declare const CLINE_DEFAULT_RPC_PORT = 4317;
3
+ export declare const RPC_ADDRESS_BASE = "127.0.0.1";
4
+ export declare const CLINE_DEFAULT_RPC_ADDRESS = "127.0.0.1:4317";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clinebot/shared",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "Shared utilities, types, and schemas for Cline packages",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -35,12 +35,19 @@
35
35
  "scripts": {
36
36
  "build": "BUILD_MODE=package bun bun.mts",
37
37
  "clean": "rm -rf dist node_modules",
38
- "typecheck": "bun tsc --noEmit"
38
+ "typecheck": "bun tsc --noEmit",
39
+ "test": "bun run test:unit",
40
+ "test:unit": "vitest run --config vitest.config.ts"
41
+ },
42
+ "engines": {
43
+ "node": ">=20"
39
44
  },
40
45
  "dependencies": {
41
- "better-sqlite3": "^11.10.0",
42
46
  "jsonrepair": "^3.13.2",
43
47
  "zod": "^4.3.6",
44
48
  "zod-to-json-schema": "^3.25.1"
49
+ },
50
+ "optionalDependencies": {
51
+ "better-sqlite3": "^12.8.0"
45
52
  }
46
53
  }
@@ -0,0 +1,152 @@
1
+ export type ConnectWhatsAppOptions = {
2
+ userName: string;
3
+ phoneNumberId?: string;
4
+ accessToken?: string;
5
+ appSecret?: string;
6
+ verifyToken?: string;
7
+ apiVersion?: string;
8
+ cwd: string;
9
+ model?: string;
10
+ provider?: string;
11
+ apiKey?: string;
12
+ systemPrompt?: string;
13
+ mode: "act" | "plan";
14
+ interactive: boolean;
15
+ maxIterations?: number;
16
+ enableTools: boolean;
17
+ rpcAddress: string;
18
+ hookCommand?: string;
19
+ port: number;
20
+ host: string;
21
+ baseUrl: string;
22
+ };
23
+
24
+ export type WhatsAppConnectorState = {
25
+ instanceKey: string;
26
+ userName: string;
27
+ phoneNumberId?: string;
28
+ pid: number;
29
+ rpcAddress: string;
30
+ port: number;
31
+ baseUrl: string;
32
+ startedAt: string;
33
+ };
34
+
35
+ export type ConnectTelegramOptions = {
36
+ botToken: string;
37
+ botUsername: string;
38
+ cwd: string;
39
+ model?: string;
40
+ provider?: string;
41
+ apiKey?: string;
42
+ systemPrompt?: string;
43
+ mode: "act" | "plan";
44
+ interactive: boolean;
45
+ maxIterations?: number;
46
+ enableTools: boolean;
47
+ rpcAddress: string;
48
+ hookCommand?: string;
49
+ };
50
+
51
+ export type TelegramConnectorState = {
52
+ botUsername: string;
53
+ pid: number;
54
+ rpcAddress: string;
55
+ startedAt: string;
56
+ };
57
+
58
+ export type ConnectSlackOptions = {
59
+ userName: string;
60
+ botToken?: string;
61
+ signingSecret?: string;
62
+ clientId?: string;
63
+ clientSecret?: string;
64
+ encryptionKey?: string;
65
+ installationKeyPrefix?: string;
66
+ cwd: string;
67
+ model?: string;
68
+ provider?: string;
69
+ apiKey?: string;
70
+ systemPrompt?: string;
71
+ mode: "act" | "plan";
72
+ interactive: boolean;
73
+ maxIterations?: number;
74
+ enableTools: boolean;
75
+ rpcAddress: string;
76
+ hookCommand?: string;
77
+ port: number;
78
+ host: string;
79
+ baseUrl: string;
80
+ };
81
+
82
+ export type SlackConnectorState = {
83
+ userName: string;
84
+ pid: number;
85
+ rpcAddress: string;
86
+ port: number;
87
+ baseUrl: string;
88
+ startedAt: string;
89
+ };
90
+
91
+ export type ConnectGoogleChatOptions = {
92
+ userName: string;
93
+ cwd: string;
94
+ model?: string;
95
+ provider?: string;
96
+ apiKey?: string;
97
+ systemPrompt?: string;
98
+ mode: "act" | "plan";
99
+ interactive: boolean;
100
+ maxIterations?: number;
101
+ enableTools: boolean;
102
+ rpcAddress: string;
103
+ hookCommand?: string;
104
+ port: number;
105
+ host: string;
106
+ baseUrl: string;
107
+ pubsubTopic?: string;
108
+ impersonateUser?: string;
109
+ useApplicationDefaultCredentials: boolean;
110
+ credentialsJson?: string;
111
+ };
112
+
113
+ export type GoogleChatConnectorState = {
114
+ userName: string;
115
+ pid: number;
116
+ rpcAddress: string;
117
+ port: number;
118
+ baseUrl: string;
119
+ startedAt: string;
120
+ };
121
+
122
+ export type ConnectLinearOptions = {
123
+ userName: string;
124
+ apiKey?: string;
125
+ clientId?: string;
126
+ clientSecret?: string;
127
+ accessToken?: string;
128
+ webhookSecret: string;
129
+ cwd: string;
130
+ model?: string;
131
+ provider?: string;
132
+ apiProviderKey?: string;
133
+ systemPrompt?: string;
134
+ mode: "act" | "plan";
135
+ interactive: boolean;
136
+ maxIterations?: number;
137
+ enableTools: boolean;
138
+ rpcAddress: string;
139
+ hookCommand?: string;
140
+ port: number;
141
+ host: string;
142
+ baseUrl: string;
143
+ };
144
+
145
+ export type LinearConnectorState = {
146
+ userName: string;
147
+ pid: number;
148
+ rpcAddress: string;
149
+ port: number;
150
+ baseUrl: string;
151
+ startedAt: string;
152
+ };
@@ -111,10 +111,17 @@ export function loadSqliteDb(filePath: string): SqliteDb {
111
111
  // Fall through to better-sqlite3 for older Node runtimes.
112
112
  }
113
113
 
114
- const BetterSqlite3 = require(["better", "-sqlite3"].join("")) as new (
115
- path: string,
116
- ) => SqliteDb;
117
- return new BetterSqlite3(filePath);
114
+ try {
115
+ const BetterSqlite3 = require(["better", "-sqlite3"].join("")) as new (
116
+ path: string,
117
+ ) => SqliteDb;
118
+ return new BetterSqlite3(filePath);
119
+ } catch (error) {
120
+ throw new Error(
121
+ "SQLite requires Node's built-in sqlite support or the optional dependency better-sqlite3. Install better-sqlite3 when running on older Node versions without node:sqlite.",
122
+ { cause: error },
123
+ );
124
+ }
118
125
  }
119
126
 
120
127
  export interface SessionSchemaOptions {
@@ -5,6 +5,7 @@ export {
5
5
  isOAuthProviderId,
6
6
  OAUTH_PROVIDER_IDS,
7
7
  } from "./auth/constants";
8
+ export type * from "./connectors/adapters";
8
9
  export type {
9
10
  ConnectorHookEvent,
10
11
  ConnectorHookEventName,
@@ -37,6 +38,7 @@ export {
37
38
  normalizeUserInput,
38
39
  xmlTagsRemoval,
39
40
  } from "./prompt/format";
41
+ export { CLINE_DEFAULT_RPC_ADDRESS, CLINE_DEFAULT_RPC_PORT } from "./rpc";
40
42
  export type {
41
43
  RpcAddProviderActionRequest,
42
44
  RpcAgentMode,
package/src/index.ts CHANGED
@@ -5,6 +5,7 @@ export {
5
5
  isOAuthProviderId,
6
6
  OAUTH_PROVIDER_IDS,
7
7
  } from "./auth/constants";
8
+ export type * from "./connectors/adapters";
8
9
  export type {
9
10
  ConnectorHookEvent,
10
11
  ConnectorHookEventName,
@@ -37,6 +38,7 @@ export {
37
38
  normalizeUserInput,
38
39
  xmlTagsRemoval,
39
40
  } from "./prompt/format";
41
+ export { CLINE_DEFAULT_RPC_ADDRESS, CLINE_DEFAULT_RPC_PORT } from "./rpc";
40
42
  export type {
41
43
  RpcAddProviderActionRequest,
42
44
  RpcAgentMode,
@@ -0,0 +1,5 @@
1
+ /**
2
+ * URI scheme for opening remote rules/workflows in the editor.
3
+ * Used to construct URIs like: remote://rule/{name} or remote://workflow/{name}
4
+ */
5
+ export const REMOTE_URI_SCHEME = "remote://";