@clinebot/shared 0.0.13 → 0.0.15
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/dist/db/index.js +2 -2
- package/dist/remote-config/constants.d.ts +5 -0
- package/dist/remote-config/schema.d.ts +426 -0
- package/package.json +10 -3
- package/src/db/sqlite-db.ts +11 -4
- package/src/index.browser.ts +2 -0
- package/src/index.ts +2 -0
- package/src/remote-config/constants.ts +5 -0
- package/src/remote-config/schema.test.ts +1004 -0
- package/src/remote-config/schema.ts +263 -0
package/dist/db/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var I=Object.defineProperty;var J=(S)=>S;function K(S,x){this[S]=J.bind(null,x)}var _=(S,x)=>{for(var B in x)I(S,B,{get:x[B],enumerable:!0,configurable:!0,set:K.bind(x,B)})};import{mkdirSync as Q}from"node:fs";import{createRequire as U}from"node:module";import{dirname as V}from"node:path";function W(){return new Date().toISOString()}function X(S){return S?1:0}function Z(S){return typeof S==="string"?S:""}function $(S){if(typeof S!=="string")return;let x=S.trim();return x.length>0?x:void 0}function k(S){return S===1||S===!0}function y(S){return{prepare:(x)=>S.query(x),exec:(x)=>S.exec(x)}}function F(S){return{prepare:(x)=>{let B=S.prepare(x);return{run:(...j)=>B.run(...j),get:(...j)=>B.get(...j)??null,all:(...j)=>B.all(...j)}},exec:(x)=>S.exec(x)}}function H(S){Q(V(S),{recursive:!0});let x=U(import.meta.url);if(typeof globalThis.Bun<"u"){let{Database:B}=x("bun:sqlite");return y(new B(S,{create:!0}))}try{let B=process.emitWarning;process.emitWarning=(O,...z)=>{if((typeof O==="string"?O:O?.message??"").includes("SQLite"))return;return B.call(process,O,...z)};let{DatabaseSync:j}=x(["node",":sqlite"].join(""));return process.emitWarning=B,F(new j(S))}catch{}try{return new(x(["better","-sqlite3"].join("")))(S)}catch(B){throw Error("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.",{cause:B})}}var L=[`CREATE TABLE IF NOT EXISTS sessions (
|
|
2
2
|
session_id TEXT PRIMARY KEY,
|
|
3
3
|
source TEXT NOT NULL,
|
|
4
4
|
pid INTEGER NOT NULL,
|
|
@@ -77,4 +77,4 @@ var J=Object.defineProperty;var K=(S)=>S;function Q(S,x){this[S]=K.bind(null,x)}
|
|
|
77
77
|
FOREIGN KEY (session_id) REFERENCES sessions(session_id) ON DELETE SET NULL
|
|
78
78
|
);`,`CREATE INDEX IF NOT EXISTS idx_schedule_executions_schedule
|
|
79
79
|
ON schedule_executions(schedule_id, triggered_at DESC);`,`CREATE INDEX IF NOT EXISTS idx_schedules_next_run
|
|
80
|
-
ON schedules(enabled, next_run_at);`],
|
|
80
|
+
ON schedules(enabled, next_run_at);`],Y=[{table:"sessions",column:"workspace_root",sql:"ALTER TABLE sessions ADD COLUMN workspace_root TEXT;"},{table:"sessions",column:"parent_session_id",sql:"ALTER TABLE sessions ADD COLUMN parent_session_id TEXT;"},{table:"sessions",column:"parent_agent_id",sql:"ALTER TABLE sessions ADD COLUMN parent_agent_id TEXT;"},{table:"sessions",column:"agent_id",sql:"ALTER TABLE sessions ADD COLUMN agent_id TEXT;"},{table:"sessions",column:"conversation_id",sql:"ALTER TABLE sessions ADD COLUMN conversation_id TEXT;"},{table:"sessions",column:"is_subagent",sql:"ALTER TABLE sessions ADD COLUMN is_subagent INTEGER NOT NULL DEFAULT 0;"},{table:"sessions",column:"messages_path",sql:"ALTER TABLE sessions ADD COLUMN messages_path TEXT;"},{table:"sessions",column:"metadata_json",sql:"ALTER TABLE sessions ADD COLUMN metadata_json TEXT;"},{table:"schedules",column:"claim_token",sql:"ALTER TABLE schedules ADD COLUMN claim_token TEXT;"},{table:"schedules",column:"claim_started_at",sql:"ALTER TABLE schedules ADD COLUMN claim_started_at TEXT;"},{table:"schedules",column:"claim_until_at",sql:"ALTER TABLE schedules ADD COLUMN claim_until_at TEXT;"}];function D(S,x){return new Set(S.prepare(`PRAGMA table_info(${x});`).all().map((B)=>B.name))}function G(S,x={}){S.exec("PRAGMA journal_mode = WAL;"),S.exec("PRAGMA busy_timeout = 5000;");for(let O of L)S.exec(O);if(!x.includeLegacyMigrations)return;let B=new Map,j=(O)=>{let z=B.get(O);if(!z)z=D(S,O),B.set(O,z);return z};for(let O of Y)if(!j(O.table).has(O.column)){if(S.exec(O.sql),O.column==="workspace_root")S.exec("UPDATE sessions SET workspace_root = cwd WHERE workspace_root IS NULL OR workspace_root = '';")}}export{X as toBoolInt,W as nowIso,H as loadSqliteDb,G as ensureSessionSchema,Z as asString,$ as asOptionalString,k as asBool};
|
|
@@ -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 {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clinebot/shared",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
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
|
}
|
package/src/db/sqlite-db.ts
CHANGED
|
@@ -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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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 {
|
package/src/index.browser.ts
CHANGED
|
@@ -38,6 +38,8 @@ export {
|
|
|
38
38
|
normalizeUserInput,
|
|
39
39
|
xmlTagsRemoval,
|
|
40
40
|
} from "./prompt/format";
|
|
41
|
+
export * from "./remote-config/constants";
|
|
42
|
+
export * from "./remote-config/schema";
|
|
41
43
|
export { CLINE_DEFAULT_RPC_ADDRESS, CLINE_DEFAULT_RPC_PORT } from "./rpc";
|
|
42
44
|
export type {
|
|
43
45
|
RpcAddProviderActionRequest,
|
package/src/index.ts
CHANGED
|
@@ -38,6 +38,8 @@ export {
|
|
|
38
38
|
normalizeUserInput,
|
|
39
39
|
xmlTagsRemoval,
|
|
40
40
|
} from "./prompt/format";
|
|
41
|
+
export * from "./remote-config/constants";
|
|
42
|
+
export * from "./remote-config/schema";
|
|
41
43
|
export { CLINE_DEFAULT_RPC_ADDRESS, CLINE_DEFAULT_RPC_PORT } from "./rpc";
|
|
42
44
|
export type {
|
|
43
45
|
RpcAddProviderActionRequest,
|