nextclaw-core 0.2.8 → 0.4.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 (3) hide show
  1. package/dist/index.d.ts +603 -109
  2. package/dist/index.js +1394 -125
  3. package/package.json +8 -8
package/dist/index.d.ts CHANGED
@@ -60,6 +60,72 @@ declare abstract class LLMProvider {
60
60
  abstract getDefaultModel(): string;
61
61
  }
62
62
 
63
+ declare class ProviderManager {
64
+ private provider;
65
+ constructor(provider: LLMProvider);
66
+ get(): LLMProvider;
67
+ set(next: LLMProvider): void;
68
+ }
69
+
70
+ declare abstract class Tool {
71
+ private static typeMap;
72
+ abstract get name(): string;
73
+ abstract get description(): string;
74
+ abstract get parameters(): Record<string, unknown>;
75
+ abstract execute(params: Record<string, unknown>): Promise<string>;
76
+ validateParams(params: Record<string, unknown>): string[];
77
+ toSchema(): Record<string, unknown>;
78
+ private validateValue;
79
+ }
80
+
81
+ type GatewayConfigSnapshot = {
82
+ raw?: string | null;
83
+ hash?: string | null;
84
+ path?: string;
85
+ config?: Record<string, unknown>;
86
+ parsed?: Record<string, unknown>;
87
+ resolved?: Record<string, unknown>;
88
+ valid?: boolean;
89
+ };
90
+ type GatewayController = {
91
+ status?: () => Promise<Record<string, unknown> | string> | Record<string, unknown> | string;
92
+ reloadConfig?: (reason?: string) => Promise<string | void> | string | void;
93
+ restart?: (options?: {
94
+ delayMs?: number;
95
+ reason?: string;
96
+ }) => Promise<string | void> | string | void;
97
+ getConfig?: () => Promise<GatewayConfigSnapshot | string> | GatewayConfigSnapshot | string;
98
+ getConfigSchema?: () => Promise<Record<string, unknown> | string> | Record<string, unknown> | string;
99
+ applyConfig?: (params: {
100
+ raw: string;
101
+ baseHash?: string;
102
+ note?: string;
103
+ restartDelayMs?: number;
104
+ sessionKey?: string;
105
+ }) => Promise<Record<string, unknown> | string | void> | Record<string, unknown> | string | void;
106
+ patchConfig?: (params: {
107
+ raw: string;
108
+ baseHash?: string;
109
+ note?: string;
110
+ restartDelayMs?: number;
111
+ sessionKey?: string;
112
+ }) => Promise<Record<string, unknown> | string | void> | Record<string, unknown> | string | void;
113
+ updateRun?: (params: {
114
+ note?: string;
115
+ restartDelayMs?: number;
116
+ timeoutMs?: number;
117
+ sessionKey?: string;
118
+ }) => Promise<Record<string, unknown> | string | void> | Record<string, unknown> | string | void;
119
+ };
120
+ declare class GatewayTool extends Tool {
121
+ private controller?;
122
+ constructor(controller?: GatewayController | undefined);
123
+ get name(): string;
124
+ get description(): string;
125
+ get parameters(): Record<string, unknown>;
126
+ execute(params: Record<string, unknown>): Promise<string>;
127
+ }
128
+
63
129
  type SessionMessage = {
64
130
  role: string;
65
131
  content: string;
@@ -80,6 +146,7 @@ declare class SessionManager {
80
146
  constructor(workspace: string);
81
147
  private getSessionPath;
82
148
  getOrCreate(key: string): Session;
149
+ getIfExists(key: string): Session | null;
83
150
  addMessage(session: Session, role: string, content: string, extra?: Record<string, unknown>): void;
84
151
  getHistory(session: Session, maxMessages?: number): Array<Record<string, string>>;
85
152
  clear(session: Session): void;
@@ -161,52 +228,6 @@ declare class CronService {
161
228
  };
162
229
  }
163
230
 
164
- declare class AgentLoop {
165
- private options;
166
- private context;
167
- private sessions;
168
- private tools;
169
- private subagents;
170
- private running;
171
- constructor(options: {
172
- bus: MessageBus;
173
- provider: LLMProvider;
174
- workspace: string;
175
- model?: string | null;
176
- maxIterations?: number;
177
- braveApiKey?: string | null;
178
- execConfig?: {
179
- timeout: number;
180
- };
181
- cronService?: CronService | null;
182
- restrictToWorkspace?: boolean;
183
- sessionManager?: SessionManager;
184
- });
185
- private registerDefaultTools;
186
- run(): Promise<void>;
187
- stop(): void;
188
- processDirect(params: {
189
- content: string;
190
- sessionKey?: string;
191
- channel?: string;
192
- chatId?: string;
193
- }): Promise<string>;
194
- private processMessage;
195
- private processSystemMessage;
196
- }
197
-
198
- type FeishuProbeResult = {
199
- ok: true;
200
- appId: string;
201
- botName?: string;
202
- botOpenId?: string;
203
- } | {
204
- ok: false;
205
- appId?: string;
206
- error: string;
207
- };
208
- declare function probeFeishu(appId: string, appSecret: string): Promise<FeishuProbeResult>;
209
-
210
231
  declare const WhatsAppConfigSchema: z.ZodObject<{
211
232
  enabled: z.ZodDefault<z.ZodBoolean>;
212
233
  bridgeUrl: z.ZodDefault<z.ZodString>;
@@ -245,15 +266,15 @@ declare const FeishuConfigSchema: z.ZodObject<{
245
266
  allowFrom: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
246
267
  }, "strip", z.ZodTypeAny, {
247
268
  enabled: boolean;
248
- appId: string;
249
269
  allowFrom: string[];
270
+ appId: string;
250
271
  appSecret: string;
251
272
  encryptKey: string;
252
273
  verificationToken: string;
253
274
  }, {
254
275
  enabled?: boolean | undefined;
255
- appId?: string | undefined;
256
276
  allowFrom?: string[] | undefined;
277
+ appId?: string | undefined;
257
278
  appSecret?: string | undefined;
258
279
  encryptKey?: string | undefined;
259
280
  verificationToken?: string | undefined;
@@ -536,14 +557,14 @@ declare const QQConfigSchema: z.ZodObject<{
536
557
  allowFrom: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
537
558
  }, "strip", z.ZodTypeAny, {
538
559
  enabled: boolean;
539
- appId: string;
540
560
  allowFrom: string[];
561
+ appId: string;
541
562
  secret: string;
542
563
  markdownSupport: boolean;
543
564
  }, {
544
565
  enabled?: boolean | undefined;
545
- appId?: string | undefined;
546
566
  allowFrom?: string[] | undefined;
567
+ appId?: string | undefined;
547
568
  secret?: string | undefined;
548
569
  markdownSupport?: boolean | undefined;
549
570
  }>;
@@ -605,15 +626,15 @@ declare const ChannelsConfigSchema: z.ZodObject<{
605
626
  allowFrom: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
606
627
  }, "strip", z.ZodTypeAny, {
607
628
  enabled: boolean;
608
- appId: string;
609
629
  allowFrom: string[];
630
+ appId: string;
610
631
  appSecret: string;
611
632
  encryptKey: string;
612
633
  verificationToken: string;
613
634
  }, {
614
635
  enabled?: boolean | undefined;
615
- appId?: string | undefined;
616
636
  allowFrom?: string[] | undefined;
637
+ appId?: string | undefined;
617
638
  appSecret?: string | undefined;
618
639
  encryptKey?: string | undefined;
619
640
  verificationToken?: string | undefined;
@@ -850,14 +871,14 @@ declare const ChannelsConfigSchema: z.ZodObject<{
850
871
  allowFrom: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
851
872
  }, "strip", z.ZodTypeAny, {
852
873
  enabled: boolean;
853
- appId: string;
854
874
  allowFrom: string[];
875
+ appId: string;
855
876
  secret: string;
856
877
  markdownSupport: boolean;
857
878
  }, {
858
879
  enabled?: boolean | undefined;
859
- appId?: string | undefined;
860
880
  allowFrom?: string[] | undefined;
881
+ appId?: string | undefined;
861
882
  secret?: string | undefined;
862
883
  markdownSupport?: boolean | undefined;
863
884
  }>>;
@@ -882,8 +903,8 @@ declare const ChannelsConfigSchema: z.ZodObject<{
882
903
  };
883
904
  feishu: {
884
905
  enabled: boolean;
885
- appId: string;
886
906
  allowFrom: string[];
907
+ appId: string;
887
908
  appSecret: string;
888
909
  encryptKey: string;
889
910
  verificationToken: string;
@@ -962,8 +983,8 @@ declare const ChannelsConfigSchema: z.ZodObject<{
962
983
  };
963
984
  qq: {
964
985
  enabled: boolean;
965
- appId: string;
966
986
  allowFrom: string[];
987
+ appId: string;
967
988
  secret: string;
968
989
  markdownSupport: boolean;
969
990
  };
@@ -988,8 +1009,8 @@ declare const ChannelsConfigSchema: z.ZodObject<{
988
1009
  } | undefined;
989
1010
  feishu?: {
990
1011
  enabled?: boolean | undefined;
991
- appId?: string | undefined;
992
1012
  allowFrom?: string[] | undefined;
1013
+ appId?: string | undefined;
993
1014
  appSecret?: string | undefined;
994
1015
  encryptKey?: string | undefined;
995
1016
  verificationToken?: string | undefined;
@@ -1068,8 +1089,8 @@ declare const ChannelsConfigSchema: z.ZodObject<{
1068
1089
  } | undefined;
1069
1090
  qq?: {
1070
1091
  enabled?: boolean | undefined;
1071
- appId?: string | undefined;
1072
1092
  allowFrom?: string[] | undefined;
1093
+ appId?: string | undefined;
1073
1094
  secret?: string | undefined;
1074
1095
  markdownSupport?: boolean | undefined;
1075
1096
  } | undefined;
@@ -1093,6 +1114,90 @@ declare const AgentDefaultsSchema: z.ZodObject<{
1093
1114
  maxTokens?: number | undefined;
1094
1115
  maxToolIterations?: number | undefined;
1095
1116
  }>;
1117
+ declare const ContextBootstrapSchema: z.ZodObject<{
1118
+ files: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1119
+ minimalFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1120
+ heartbeatFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1121
+ perFileChars: z.ZodDefault<z.ZodNumber>;
1122
+ totalChars: z.ZodDefault<z.ZodNumber>;
1123
+ }, "strip", z.ZodTypeAny, {
1124
+ files: string[];
1125
+ minimalFiles: string[];
1126
+ heartbeatFiles: string[];
1127
+ perFileChars: number;
1128
+ totalChars: number;
1129
+ }, {
1130
+ files?: string[] | undefined;
1131
+ minimalFiles?: string[] | undefined;
1132
+ heartbeatFiles?: string[] | undefined;
1133
+ perFileChars?: number | undefined;
1134
+ totalChars?: number | undefined;
1135
+ }>;
1136
+ declare const ContextMemorySchema: z.ZodObject<{
1137
+ enabled: z.ZodDefault<z.ZodBoolean>;
1138
+ maxChars: z.ZodDefault<z.ZodNumber>;
1139
+ }, "strip", z.ZodTypeAny, {
1140
+ enabled: boolean;
1141
+ maxChars: number;
1142
+ }, {
1143
+ enabled?: boolean | undefined;
1144
+ maxChars?: number | undefined;
1145
+ }>;
1146
+ declare const ContextConfigSchema: z.ZodObject<{
1147
+ bootstrap: z.ZodDefault<z.ZodObject<{
1148
+ files: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1149
+ minimalFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1150
+ heartbeatFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1151
+ perFileChars: z.ZodDefault<z.ZodNumber>;
1152
+ totalChars: z.ZodDefault<z.ZodNumber>;
1153
+ }, "strip", z.ZodTypeAny, {
1154
+ files: string[];
1155
+ minimalFiles: string[];
1156
+ heartbeatFiles: string[];
1157
+ perFileChars: number;
1158
+ totalChars: number;
1159
+ }, {
1160
+ files?: string[] | undefined;
1161
+ minimalFiles?: string[] | undefined;
1162
+ heartbeatFiles?: string[] | undefined;
1163
+ perFileChars?: number | undefined;
1164
+ totalChars?: number | undefined;
1165
+ }>>;
1166
+ memory: z.ZodDefault<z.ZodObject<{
1167
+ enabled: z.ZodDefault<z.ZodBoolean>;
1168
+ maxChars: z.ZodDefault<z.ZodNumber>;
1169
+ }, "strip", z.ZodTypeAny, {
1170
+ enabled: boolean;
1171
+ maxChars: number;
1172
+ }, {
1173
+ enabled?: boolean | undefined;
1174
+ maxChars?: number | undefined;
1175
+ }>>;
1176
+ }, "strip", z.ZodTypeAny, {
1177
+ memory: {
1178
+ enabled: boolean;
1179
+ maxChars: number;
1180
+ };
1181
+ bootstrap: {
1182
+ files: string[];
1183
+ minimalFiles: string[];
1184
+ heartbeatFiles: string[];
1185
+ perFileChars: number;
1186
+ totalChars: number;
1187
+ };
1188
+ }, {
1189
+ memory?: {
1190
+ enabled?: boolean | undefined;
1191
+ maxChars?: number | undefined;
1192
+ } | undefined;
1193
+ bootstrap?: {
1194
+ files?: string[] | undefined;
1195
+ minimalFiles?: string[] | undefined;
1196
+ heartbeatFiles?: string[] | undefined;
1197
+ perFileChars?: number | undefined;
1198
+ totalChars?: number | undefined;
1199
+ } | undefined;
1200
+ }>;
1096
1201
  declare const AgentsConfigSchema: z.ZodObject<{
1097
1202
  defaults: z.ZodDefault<z.ZodObject<{
1098
1203
  workspace: z.ZodDefault<z.ZodString>;
@@ -1113,6 +1218,61 @@ declare const AgentsConfigSchema: z.ZodObject<{
1113
1218
  maxTokens?: number | undefined;
1114
1219
  maxToolIterations?: number | undefined;
1115
1220
  }>>;
1221
+ context: z.ZodDefault<z.ZodObject<{
1222
+ bootstrap: z.ZodDefault<z.ZodObject<{
1223
+ files: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1224
+ minimalFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1225
+ heartbeatFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1226
+ perFileChars: z.ZodDefault<z.ZodNumber>;
1227
+ totalChars: z.ZodDefault<z.ZodNumber>;
1228
+ }, "strip", z.ZodTypeAny, {
1229
+ files: string[];
1230
+ minimalFiles: string[];
1231
+ heartbeatFiles: string[];
1232
+ perFileChars: number;
1233
+ totalChars: number;
1234
+ }, {
1235
+ files?: string[] | undefined;
1236
+ minimalFiles?: string[] | undefined;
1237
+ heartbeatFiles?: string[] | undefined;
1238
+ perFileChars?: number | undefined;
1239
+ totalChars?: number | undefined;
1240
+ }>>;
1241
+ memory: z.ZodDefault<z.ZodObject<{
1242
+ enabled: z.ZodDefault<z.ZodBoolean>;
1243
+ maxChars: z.ZodDefault<z.ZodNumber>;
1244
+ }, "strip", z.ZodTypeAny, {
1245
+ enabled: boolean;
1246
+ maxChars: number;
1247
+ }, {
1248
+ enabled?: boolean | undefined;
1249
+ maxChars?: number | undefined;
1250
+ }>>;
1251
+ }, "strip", z.ZodTypeAny, {
1252
+ memory: {
1253
+ enabled: boolean;
1254
+ maxChars: number;
1255
+ };
1256
+ bootstrap: {
1257
+ files: string[];
1258
+ minimalFiles: string[];
1259
+ heartbeatFiles: string[];
1260
+ perFileChars: number;
1261
+ totalChars: number;
1262
+ };
1263
+ }, {
1264
+ memory?: {
1265
+ enabled?: boolean | undefined;
1266
+ maxChars?: number | undefined;
1267
+ } | undefined;
1268
+ bootstrap?: {
1269
+ files?: string[] | undefined;
1270
+ minimalFiles?: string[] | undefined;
1271
+ heartbeatFiles?: string[] | undefined;
1272
+ perFileChars?: number | undefined;
1273
+ totalChars?: number | undefined;
1274
+ } | undefined;
1275
+ }>>;
1116
1276
  }, "strip", z.ZodTypeAny, {
1117
1277
  defaults: {
1118
1278
  workspace: string;
@@ -1121,6 +1281,19 @@ declare const AgentsConfigSchema: z.ZodObject<{
1121
1281
  maxTokens: number;
1122
1282
  maxToolIterations: number;
1123
1283
  };
1284
+ context: {
1285
+ memory: {
1286
+ enabled: boolean;
1287
+ maxChars: number;
1288
+ };
1289
+ bootstrap: {
1290
+ files: string[];
1291
+ minimalFiles: string[];
1292
+ heartbeatFiles: string[];
1293
+ perFileChars: number;
1294
+ totalChars: number;
1295
+ };
1296
+ };
1124
1297
  }, {
1125
1298
  defaults?: {
1126
1299
  workspace?: string | undefined;
@@ -1129,298 +1302,374 @@ declare const AgentsConfigSchema: z.ZodObject<{
1129
1302
  maxTokens?: number | undefined;
1130
1303
  maxToolIterations?: number | undefined;
1131
1304
  } | undefined;
1305
+ context?: {
1306
+ memory?: {
1307
+ enabled?: boolean | undefined;
1308
+ maxChars?: number | undefined;
1309
+ } | undefined;
1310
+ bootstrap?: {
1311
+ files?: string[] | undefined;
1312
+ minimalFiles?: string[] | undefined;
1313
+ heartbeatFiles?: string[] | undefined;
1314
+ perFileChars?: number | undefined;
1315
+ totalChars?: number | undefined;
1316
+ } | undefined;
1317
+ } | undefined;
1132
1318
  }>;
1133
1319
  declare const ProviderConfigSchema: z.ZodObject<{
1134
1320
  apiKey: z.ZodDefault<z.ZodString>;
1135
1321
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1136
1322
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1323
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1137
1324
  }, "strip", z.ZodTypeAny, {
1138
1325
  apiKey: string;
1139
1326
  apiBase: string | null;
1140
1327
  extraHeaders: Record<string, string> | null;
1328
+ wireApi: "auto" | "chat" | "responses";
1141
1329
  }, {
1142
1330
  apiKey?: string | undefined;
1143
1331
  apiBase?: string | null | undefined;
1144
1332
  extraHeaders?: Record<string, string> | null | undefined;
1333
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1145
1334
  }>;
1146
1335
  declare const ProvidersConfigSchema: z.ZodObject<{
1147
1336
  anthropic: z.ZodDefault<z.ZodObject<{
1148
1337
  apiKey: z.ZodDefault<z.ZodString>;
1149
1338
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1150
1339
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1340
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1151
1341
  }, "strip", z.ZodTypeAny, {
1152
1342
  apiKey: string;
1153
1343
  apiBase: string | null;
1154
1344
  extraHeaders: Record<string, string> | null;
1345
+ wireApi: "auto" | "chat" | "responses";
1155
1346
  }, {
1156
1347
  apiKey?: string | undefined;
1157
1348
  apiBase?: string | null | undefined;
1158
1349
  extraHeaders?: Record<string, string> | null | undefined;
1350
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1159
1351
  }>>;
1160
1352
  openai: z.ZodDefault<z.ZodObject<{
1161
1353
  apiKey: z.ZodDefault<z.ZodString>;
1162
1354
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1163
1355
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1356
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1164
1357
  }, "strip", z.ZodTypeAny, {
1165
1358
  apiKey: string;
1166
1359
  apiBase: string | null;
1167
1360
  extraHeaders: Record<string, string> | null;
1361
+ wireApi: "auto" | "chat" | "responses";
1168
1362
  }, {
1169
1363
  apiKey?: string | undefined;
1170
1364
  apiBase?: string | null | undefined;
1171
1365
  extraHeaders?: Record<string, string> | null | undefined;
1366
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1172
1367
  }>>;
1173
1368
  openrouter: z.ZodDefault<z.ZodObject<{
1174
1369
  apiKey: z.ZodDefault<z.ZodString>;
1175
1370
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1176
1371
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1372
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1177
1373
  }, "strip", z.ZodTypeAny, {
1178
1374
  apiKey: string;
1179
1375
  apiBase: string | null;
1180
1376
  extraHeaders: Record<string, string> | null;
1377
+ wireApi: "auto" | "chat" | "responses";
1181
1378
  }, {
1182
1379
  apiKey?: string | undefined;
1183
1380
  apiBase?: string | null | undefined;
1184
1381
  extraHeaders?: Record<string, string> | null | undefined;
1382
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1185
1383
  }>>;
1186
1384
  deepseek: z.ZodDefault<z.ZodObject<{
1187
1385
  apiKey: z.ZodDefault<z.ZodString>;
1188
1386
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1189
1387
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1388
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1190
1389
  }, "strip", z.ZodTypeAny, {
1191
1390
  apiKey: string;
1192
1391
  apiBase: string | null;
1193
1392
  extraHeaders: Record<string, string> | null;
1393
+ wireApi: "auto" | "chat" | "responses";
1194
1394
  }, {
1195
1395
  apiKey?: string | undefined;
1196
1396
  apiBase?: string | null | undefined;
1197
1397
  extraHeaders?: Record<string, string> | null | undefined;
1398
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1198
1399
  }>>;
1199
1400
  groq: z.ZodDefault<z.ZodObject<{
1200
1401
  apiKey: z.ZodDefault<z.ZodString>;
1201
1402
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1202
1403
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1404
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1203
1405
  }, "strip", z.ZodTypeAny, {
1204
1406
  apiKey: string;
1205
1407
  apiBase: string | null;
1206
1408
  extraHeaders: Record<string, string> | null;
1409
+ wireApi: "auto" | "chat" | "responses";
1207
1410
  }, {
1208
1411
  apiKey?: string | undefined;
1209
1412
  apiBase?: string | null | undefined;
1210
1413
  extraHeaders?: Record<string, string> | null | undefined;
1414
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1211
1415
  }>>;
1212
1416
  zhipu: z.ZodDefault<z.ZodObject<{
1213
1417
  apiKey: z.ZodDefault<z.ZodString>;
1214
1418
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1215
1419
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1420
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1216
1421
  }, "strip", z.ZodTypeAny, {
1217
1422
  apiKey: string;
1218
1423
  apiBase: string | null;
1219
1424
  extraHeaders: Record<string, string> | null;
1425
+ wireApi: "auto" | "chat" | "responses";
1220
1426
  }, {
1221
1427
  apiKey?: string | undefined;
1222
1428
  apiBase?: string | null | undefined;
1223
1429
  extraHeaders?: Record<string, string> | null | undefined;
1430
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1224
1431
  }>>;
1225
1432
  dashscope: z.ZodDefault<z.ZodObject<{
1226
1433
  apiKey: z.ZodDefault<z.ZodString>;
1227
1434
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1228
1435
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1436
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1229
1437
  }, "strip", z.ZodTypeAny, {
1230
1438
  apiKey: string;
1231
1439
  apiBase: string | null;
1232
1440
  extraHeaders: Record<string, string> | null;
1441
+ wireApi: "auto" | "chat" | "responses";
1233
1442
  }, {
1234
1443
  apiKey?: string | undefined;
1235
1444
  apiBase?: string | null | undefined;
1236
1445
  extraHeaders?: Record<string, string> | null | undefined;
1446
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1237
1447
  }>>;
1238
1448
  vllm: z.ZodDefault<z.ZodObject<{
1239
1449
  apiKey: z.ZodDefault<z.ZodString>;
1240
1450
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1241
1451
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1452
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1242
1453
  }, "strip", z.ZodTypeAny, {
1243
1454
  apiKey: string;
1244
1455
  apiBase: string | null;
1245
1456
  extraHeaders: Record<string, string> | null;
1457
+ wireApi: "auto" | "chat" | "responses";
1246
1458
  }, {
1247
1459
  apiKey?: string | undefined;
1248
1460
  apiBase?: string | null | undefined;
1249
1461
  extraHeaders?: Record<string, string> | null | undefined;
1462
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1250
1463
  }>>;
1251
1464
  gemini: z.ZodDefault<z.ZodObject<{
1252
1465
  apiKey: z.ZodDefault<z.ZodString>;
1253
1466
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1254
1467
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1468
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1255
1469
  }, "strip", z.ZodTypeAny, {
1256
1470
  apiKey: string;
1257
1471
  apiBase: string | null;
1258
1472
  extraHeaders: Record<string, string> | null;
1473
+ wireApi: "auto" | "chat" | "responses";
1259
1474
  }, {
1260
1475
  apiKey?: string | undefined;
1261
1476
  apiBase?: string | null | undefined;
1262
1477
  extraHeaders?: Record<string, string> | null | undefined;
1478
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1263
1479
  }>>;
1264
1480
  moonshot: z.ZodDefault<z.ZodObject<{
1265
1481
  apiKey: z.ZodDefault<z.ZodString>;
1266
1482
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1267
1483
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1484
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1268
1485
  }, "strip", z.ZodTypeAny, {
1269
1486
  apiKey: string;
1270
1487
  apiBase: string | null;
1271
1488
  extraHeaders: Record<string, string> | null;
1489
+ wireApi: "auto" | "chat" | "responses";
1272
1490
  }, {
1273
1491
  apiKey?: string | undefined;
1274
1492
  apiBase?: string | null | undefined;
1275
1493
  extraHeaders?: Record<string, string> | null | undefined;
1494
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1276
1495
  }>>;
1277
1496
  minimax: z.ZodDefault<z.ZodObject<{
1278
1497
  apiKey: z.ZodDefault<z.ZodString>;
1279
1498
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1280
1499
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1500
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1281
1501
  }, "strip", z.ZodTypeAny, {
1282
1502
  apiKey: string;
1283
1503
  apiBase: string | null;
1284
1504
  extraHeaders: Record<string, string> | null;
1505
+ wireApi: "auto" | "chat" | "responses";
1285
1506
  }, {
1286
1507
  apiKey?: string | undefined;
1287
1508
  apiBase?: string | null | undefined;
1288
1509
  extraHeaders?: Record<string, string> | null | undefined;
1510
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1289
1511
  }>>;
1290
1512
  aihubmix: z.ZodDefault<z.ZodObject<{
1291
1513
  apiKey: z.ZodDefault<z.ZodString>;
1292
1514
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1293
1515
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1516
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
1294
1517
  }, "strip", z.ZodTypeAny, {
1295
1518
  apiKey: string;
1296
1519
  apiBase: string | null;
1297
1520
  extraHeaders: Record<string, string> | null;
1521
+ wireApi: "auto" | "chat" | "responses";
1298
1522
  }, {
1299
1523
  apiKey?: string | undefined;
1300
1524
  apiBase?: string | null | undefined;
1301
1525
  extraHeaders?: Record<string, string> | null | undefined;
1526
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1302
1527
  }>>;
1303
1528
  }, "strip", z.ZodTypeAny, {
1304
1529
  openrouter: {
1305
1530
  apiKey: string;
1306
1531
  apiBase: string | null;
1307
1532
  extraHeaders: Record<string, string> | null;
1533
+ wireApi: "auto" | "chat" | "responses";
1308
1534
  };
1309
1535
  aihubmix: {
1310
1536
  apiKey: string;
1311
1537
  apiBase: string | null;
1312
1538
  extraHeaders: Record<string, string> | null;
1539
+ wireApi: "auto" | "chat" | "responses";
1313
1540
  };
1314
1541
  openai: {
1315
1542
  apiKey: string;
1316
1543
  apiBase: string | null;
1317
1544
  extraHeaders: Record<string, string> | null;
1545
+ wireApi: "auto" | "chat" | "responses";
1318
1546
  };
1319
1547
  anthropic: {
1320
1548
  apiKey: string;
1321
1549
  apiBase: string | null;
1322
1550
  extraHeaders: Record<string, string> | null;
1551
+ wireApi: "auto" | "chat" | "responses";
1323
1552
  };
1324
1553
  deepseek: {
1325
1554
  apiKey: string;
1326
1555
  apiBase: string | null;
1327
1556
  extraHeaders: Record<string, string> | null;
1557
+ wireApi: "auto" | "chat" | "responses";
1328
1558
  };
1329
1559
  gemini: {
1330
1560
  apiKey: string;
1331
1561
  apiBase: string | null;
1332
1562
  extraHeaders: Record<string, string> | null;
1563
+ wireApi: "auto" | "chat" | "responses";
1333
1564
  };
1334
1565
  zhipu: {
1335
1566
  apiKey: string;
1336
1567
  apiBase: string | null;
1337
1568
  extraHeaders: Record<string, string> | null;
1569
+ wireApi: "auto" | "chat" | "responses";
1338
1570
  };
1339
1571
  dashscope: {
1340
1572
  apiKey: string;
1341
1573
  apiBase: string | null;
1342
1574
  extraHeaders: Record<string, string> | null;
1575
+ wireApi: "auto" | "chat" | "responses";
1343
1576
  };
1344
1577
  moonshot: {
1345
1578
  apiKey: string;
1346
1579
  apiBase: string | null;
1347
1580
  extraHeaders: Record<string, string> | null;
1581
+ wireApi: "auto" | "chat" | "responses";
1348
1582
  };
1349
1583
  minimax: {
1350
1584
  apiKey: string;
1351
1585
  apiBase: string | null;
1352
1586
  extraHeaders: Record<string, string> | null;
1587
+ wireApi: "auto" | "chat" | "responses";
1353
1588
  };
1354
1589
  vllm: {
1355
1590
  apiKey: string;
1356
1591
  apiBase: string | null;
1357
1592
  extraHeaders: Record<string, string> | null;
1593
+ wireApi: "auto" | "chat" | "responses";
1358
1594
  };
1359
1595
  groq: {
1360
1596
  apiKey: string;
1361
1597
  apiBase: string | null;
1362
1598
  extraHeaders: Record<string, string> | null;
1599
+ wireApi: "auto" | "chat" | "responses";
1363
1600
  };
1364
1601
  }, {
1365
1602
  openrouter?: {
1366
1603
  apiKey?: string | undefined;
1367
1604
  apiBase?: string | null | undefined;
1368
1605
  extraHeaders?: Record<string, string> | null | undefined;
1606
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1369
1607
  } | undefined;
1370
1608
  aihubmix?: {
1371
1609
  apiKey?: string | undefined;
1372
1610
  apiBase?: string | null | undefined;
1373
1611
  extraHeaders?: Record<string, string> | null | undefined;
1612
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1374
1613
  } | undefined;
1375
1614
  openai?: {
1376
1615
  apiKey?: string | undefined;
1377
1616
  apiBase?: string | null | undefined;
1378
1617
  extraHeaders?: Record<string, string> | null | undefined;
1618
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1379
1619
  } | undefined;
1380
1620
  anthropic?: {
1381
1621
  apiKey?: string | undefined;
1382
1622
  apiBase?: string | null | undefined;
1383
1623
  extraHeaders?: Record<string, string> | null | undefined;
1624
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1384
1625
  } | undefined;
1385
1626
  deepseek?: {
1386
1627
  apiKey?: string | undefined;
1387
1628
  apiBase?: string | null | undefined;
1388
1629
  extraHeaders?: Record<string, string> | null | undefined;
1630
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1389
1631
  } | undefined;
1390
1632
  gemini?: {
1391
1633
  apiKey?: string | undefined;
1392
1634
  apiBase?: string | null | undefined;
1393
1635
  extraHeaders?: Record<string, string> | null | undefined;
1636
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1394
1637
  } | undefined;
1395
1638
  zhipu?: {
1396
1639
  apiKey?: string | undefined;
1397
1640
  apiBase?: string | null | undefined;
1398
1641
  extraHeaders?: Record<string, string> | null | undefined;
1642
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1399
1643
  } | undefined;
1400
1644
  dashscope?: {
1401
1645
  apiKey?: string | undefined;
1402
1646
  apiBase?: string | null | undefined;
1403
1647
  extraHeaders?: Record<string, string> | null | undefined;
1648
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1404
1649
  } | undefined;
1405
1650
  moonshot?: {
1406
1651
  apiKey?: string | undefined;
1407
1652
  apiBase?: string | null | undefined;
1408
1653
  extraHeaders?: Record<string, string> | null | undefined;
1654
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1409
1655
  } | undefined;
1410
1656
  minimax?: {
1411
1657
  apiKey?: string | undefined;
1412
1658
  apiBase?: string | null | undefined;
1413
1659
  extraHeaders?: Record<string, string> | null | undefined;
1660
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1414
1661
  } | undefined;
1415
1662
  vllm?: {
1416
1663
  apiKey?: string | undefined;
1417
1664
  apiBase?: string | null | undefined;
1418
1665
  extraHeaders?: Record<string, string> | null | undefined;
1666
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1419
1667
  } | undefined;
1420
1668
  groq?: {
1421
1669
  apiKey?: string | undefined;
1422
1670
  apiBase?: string | null | undefined;
1423
1671
  extraHeaders?: Record<string, string> | null | undefined;
1672
+ wireApi?: "auto" | "chat" | "responses" | undefined;
1424
1673
  } | undefined;
1425
1674
  }>;
1426
1675
  declare const GatewayConfigSchema: z.ZodObject<{
@@ -1453,32 +1702,32 @@ declare const WebSearchConfigSchema: z.ZodObject<{
1453
1702
  apiKey: z.ZodDefault<z.ZodString>;
1454
1703
  maxResults: z.ZodDefault<z.ZodNumber>;
1455
1704
  }, "strip", z.ZodTypeAny, {
1456
- maxResults: number;
1457
1705
  apiKey: string;
1706
+ maxResults: number;
1458
1707
  }, {
1459
- maxResults?: number | undefined;
1460
1708
  apiKey?: string | undefined;
1709
+ maxResults?: number | undefined;
1461
1710
  }>;
1462
1711
  declare const WebToolsConfigSchema: z.ZodObject<{
1463
1712
  search: z.ZodDefault<z.ZodObject<{
1464
1713
  apiKey: z.ZodDefault<z.ZodString>;
1465
1714
  maxResults: z.ZodDefault<z.ZodNumber>;
1466
1715
  }, "strip", z.ZodTypeAny, {
1467
- maxResults: number;
1468
1716
  apiKey: string;
1717
+ maxResults: number;
1469
1718
  }, {
1470
- maxResults?: number | undefined;
1471
1719
  apiKey?: string | undefined;
1720
+ maxResults?: number | undefined;
1472
1721
  }>>;
1473
1722
  }, "strip", z.ZodTypeAny, {
1474
1723
  search: {
1475
- maxResults: number;
1476
1724
  apiKey: string;
1725
+ maxResults: number;
1477
1726
  };
1478
1727
  }, {
1479
1728
  search?: {
1480
- maxResults?: number | undefined;
1481
1729
  apiKey?: string | undefined;
1730
+ maxResults?: number | undefined;
1482
1731
  } | undefined;
1483
1732
  }>;
1484
1733
  declare const ExecToolConfigSchema: z.ZodObject<{
@@ -1494,21 +1743,21 @@ declare const ToolsConfigSchema: z.ZodObject<{
1494
1743
  apiKey: z.ZodDefault<z.ZodString>;
1495
1744
  maxResults: z.ZodDefault<z.ZodNumber>;
1496
1745
  }, "strip", z.ZodTypeAny, {
1497
- maxResults: number;
1498
1746
  apiKey: string;
1747
+ maxResults: number;
1499
1748
  }, {
1500
- maxResults?: number | undefined;
1501
1749
  apiKey?: string | undefined;
1750
+ maxResults?: number | undefined;
1502
1751
  }>>;
1503
1752
  }, "strip", z.ZodTypeAny, {
1504
1753
  search: {
1505
- maxResults: number;
1506
1754
  apiKey: string;
1755
+ maxResults: number;
1507
1756
  };
1508
1757
  }, {
1509
1758
  search?: {
1510
- maxResults?: number | undefined;
1511
1759
  apiKey?: string | undefined;
1760
+ maxResults?: number | undefined;
1512
1761
  } | undefined;
1513
1762
  }>>;
1514
1763
  exec: z.ZodDefault<z.ZodObject<{
@@ -1520,26 +1769,26 @@ declare const ToolsConfigSchema: z.ZodObject<{
1520
1769
  }>>;
1521
1770
  restrictToWorkspace: z.ZodDefault<z.ZodBoolean>;
1522
1771
  }, "strip", z.ZodTypeAny, {
1523
- exec: {
1524
- timeout: number;
1525
- };
1526
1772
  web: {
1527
1773
  search: {
1528
- maxResults: number;
1529
1774
  apiKey: string;
1775
+ maxResults: number;
1530
1776
  };
1531
1777
  };
1778
+ exec: {
1779
+ timeout: number;
1780
+ };
1532
1781
  restrictToWorkspace: boolean;
1533
1782
  }, {
1534
- exec?: {
1535
- timeout?: number | undefined;
1536
- } | undefined;
1537
1783
  web?: {
1538
1784
  search?: {
1539
- maxResults?: number | undefined;
1540
1785
  apiKey?: string | undefined;
1786
+ maxResults?: number | undefined;
1541
1787
  } | undefined;
1542
1788
  } | undefined;
1789
+ exec?: {
1790
+ timeout?: number | undefined;
1791
+ } | undefined;
1543
1792
  restrictToWorkspace?: boolean | undefined;
1544
1793
  }>;
1545
1794
  declare const ConfigSchema: z.ZodObject<{
@@ -1563,6 +1812,61 @@ declare const ConfigSchema: z.ZodObject<{
1563
1812
  maxTokens?: number | undefined;
1564
1813
  maxToolIterations?: number | undefined;
1565
1814
  }>>;
1815
+ context: z.ZodDefault<z.ZodObject<{
1816
+ bootstrap: z.ZodDefault<z.ZodObject<{
1817
+ files: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1818
+ minimalFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1819
+ heartbeatFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1820
+ perFileChars: z.ZodDefault<z.ZodNumber>;
1821
+ totalChars: z.ZodDefault<z.ZodNumber>;
1822
+ }, "strip", z.ZodTypeAny, {
1823
+ files: string[];
1824
+ minimalFiles: string[];
1825
+ heartbeatFiles: string[];
1826
+ perFileChars: number;
1827
+ totalChars: number;
1828
+ }, {
1829
+ files?: string[] | undefined;
1830
+ minimalFiles?: string[] | undefined;
1831
+ heartbeatFiles?: string[] | undefined;
1832
+ perFileChars?: number | undefined;
1833
+ totalChars?: number | undefined;
1834
+ }>>;
1835
+ memory: z.ZodDefault<z.ZodObject<{
1836
+ enabled: z.ZodDefault<z.ZodBoolean>;
1837
+ maxChars: z.ZodDefault<z.ZodNumber>;
1838
+ }, "strip", z.ZodTypeAny, {
1839
+ enabled: boolean;
1840
+ maxChars: number;
1841
+ }, {
1842
+ enabled?: boolean | undefined;
1843
+ maxChars?: number | undefined;
1844
+ }>>;
1845
+ }, "strip", z.ZodTypeAny, {
1846
+ memory: {
1847
+ enabled: boolean;
1848
+ maxChars: number;
1849
+ };
1850
+ bootstrap: {
1851
+ files: string[];
1852
+ minimalFiles: string[];
1853
+ heartbeatFiles: string[];
1854
+ perFileChars: number;
1855
+ totalChars: number;
1856
+ };
1857
+ }, {
1858
+ memory?: {
1859
+ enabled?: boolean | undefined;
1860
+ maxChars?: number | undefined;
1861
+ } | undefined;
1862
+ bootstrap?: {
1863
+ files?: string[] | undefined;
1864
+ minimalFiles?: string[] | undefined;
1865
+ heartbeatFiles?: string[] | undefined;
1866
+ perFileChars?: number | undefined;
1867
+ totalChars?: number | undefined;
1868
+ } | undefined;
1869
+ }>>;
1566
1870
  }, "strip", z.ZodTypeAny, {
1567
1871
  defaults: {
1568
1872
  workspace: string;
@@ -1571,6 +1875,19 @@ declare const ConfigSchema: z.ZodObject<{
1571
1875
  maxTokens: number;
1572
1876
  maxToolIterations: number;
1573
1877
  };
1878
+ context: {
1879
+ memory: {
1880
+ enabled: boolean;
1881
+ maxChars: number;
1882
+ };
1883
+ bootstrap: {
1884
+ files: string[];
1885
+ minimalFiles: string[];
1886
+ heartbeatFiles: string[];
1887
+ perFileChars: number;
1888
+ totalChars: number;
1889
+ };
1890
+ };
1574
1891
  }, {
1575
1892
  defaults?: {
1576
1893
  workspace?: string | undefined;
@@ -1579,6 +1896,19 @@ declare const ConfigSchema: z.ZodObject<{
1579
1896
  maxTokens?: number | undefined;
1580
1897
  maxToolIterations?: number | undefined;
1581
1898
  } | undefined;
1899
+ context?: {
1900
+ memory?: {
1901
+ enabled?: boolean | undefined;
1902
+ maxChars?: number | undefined;
1903
+ } | undefined;
1904
+ bootstrap?: {
1905
+ files?: string[] | undefined;
1906
+ minimalFiles?: string[] | undefined;
1907
+ heartbeatFiles?: string[] | undefined;
1908
+ perFileChars?: number | undefined;
1909
+ totalChars?: number | undefined;
1910
+ } | undefined;
1911
+ } | undefined;
1582
1912
  }>>;
1583
1913
  channels: z.ZodDefault<z.ZodObject<{
1584
1914
  whatsapp: z.ZodDefault<z.ZodObject<{
@@ -1638,15 +1968,15 @@ declare const ConfigSchema: z.ZodObject<{
1638
1968
  allowFrom: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1639
1969
  }, "strip", z.ZodTypeAny, {
1640
1970
  enabled: boolean;
1641
- appId: string;
1642
1971
  allowFrom: string[];
1972
+ appId: string;
1643
1973
  appSecret: string;
1644
1974
  encryptKey: string;
1645
1975
  verificationToken: string;
1646
1976
  }, {
1647
1977
  enabled?: boolean | undefined;
1648
- appId?: string | undefined;
1649
1978
  allowFrom?: string[] | undefined;
1979
+ appId?: string | undefined;
1650
1980
  appSecret?: string | undefined;
1651
1981
  encryptKey?: string | undefined;
1652
1982
  verificationToken?: string | undefined;
@@ -1883,14 +2213,14 @@ declare const ConfigSchema: z.ZodObject<{
1883
2213
  allowFrom: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1884
2214
  }, "strip", z.ZodTypeAny, {
1885
2215
  enabled: boolean;
1886
- appId: string;
1887
2216
  allowFrom: string[];
2217
+ appId: string;
1888
2218
  secret: string;
1889
2219
  markdownSupport: boolean;
1890
2220
  }, {
1891
2221
  enabled?: boolean | undefined;
1892
- appId?: string | undefined;
1893
2222
  allowFrom?: string[] | undefined;
2223
+ appId?: string | undefined;
1894
2224
  secret?: string | undefined;
1895
2225
  markdownSupport?: boolean | undefined;
1896
2226
  }>>;
@@ -1915,8 +2245,8 @@ declare const ConfigSchema: z.ZodObject<{
1915
2245
  };
1916
2246
  feishu: {
1917
2247
  enabled: boolean;
1918
- appId: string;
1919
2248
  allowFrom: string[];
2249
+ appId: string;
1920
2250
  appSecret: string;
1921
2251
  encryptKey: string;
1922
2252
  verificationToken: string;
@@ -1995,8 +2325,8 @@ declare const ConfigSchema: z.ZodObject<{
1995
2325
  };
1996
2326
  qq: {
1997
2327
  enabled: boolean;
1998
- appId: string;
1999
2328
  allowFrom: string[];
2329
+ appId: string;
2000
2330
  secret: string;
2001
2331
  markdownSupport: boolean;
2002
2332
  };
@@ -2021,8 +2351,8 @@ declare const ConfigSchema: z.ZodObject<{
2021
2351
  } | undefined;
2022
2352
  feishu?: {
2023
2353
  enabled?: boolean | undefined;
2024
- appId?: string | undefined;
2025
2354
  allowFrom?: string[] | undefined;
2355
+ appId?: string | undefined;
2026
2356
  appSecret?: string | undefined;
2027
2357
  encryptKey?: string | undefined;
2028
2358
  verificationToken?: string | undefined;
@@ -2101,8 +2431,8 @@ declare const ConfigSchema: z.ZodObject<{
2101
2431
  } | undefined;
2102
2432
  qq?: {
2103
2433
  enabled?: boolean | undefined;
2104
- appId?: string | undefined;
2105
2434
  allowFrom?: string[] | undefined;
2435
+ appId?: string | undefined;
2106
2436
  secret?: string | undefined;
2107
2437
  markdownSupport?: boolean | undefined;
2108
2438
  } | undefined;
@@ -2112,279 +2442,339 @@ declare const ConfigSchema: z.ZodObject<{
2112
2442
  apiKey: z.ZodDefault<z.ZodString>;
2113
2443
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2114
2444
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2445
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2115
2446
  }, "strip", z.ZodTypeAny, {
2116
2447
  apiKey: string;
2117
2448
  apiBase: string | null;
2118
2449
  extraHeaders: Record<string, string> | null;
2450
+ wireApi: "auto" | "chat" | "responses";
2119
2451
  }, {
2120
2452
  apiKey?: string | undefined;
2121
2453
  apiBase?: string | null | undefined;
2122
2454
  extraHeaders?: Record<string, string> | null | undefined;
2455
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2123
2456
  }>>;
2124
2457
  openai: z.ZodDefault<z.ZodObject<{
2125
2458
  apiKey: z.ZodDefault<z.ZodString>;
2126
2459
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2127
2460
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2461
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2128
2462
  }, "strip", z.ZodTypeAny, {
2129
2463
  apiKey: string;
2130
2464
  apiBase: string | null;
2131
2465
  extraHeaders: Record<string, string> | null;
2466
+ wireApi: "auto" | "chat" | "responses";
2132
2467
  }, {
2133
2468
  apiKey?: string | undefined;
2134
2469
  apiBase?: string | null | undefined;
2135
2470
  extraHeaders?: Record<string, string> | null | undefined;
2471
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2136
2472
  }>>;
2137
2473
  openrouter: z.ZodDefault<z.ZodObject<{
2138
2474
  apiKey: z.ZodDefault<z.ZodString>;
2139
2475
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2140
2476
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2477
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2141
2478
  }, "strip", z.ZodTypeAny, {
2142
2479
  apiKey: string;
2143
2480
  apiBase: string | null;
2144
2481
  extraHeaders: Record<string, string> | null;
2482
+ wireApi: "auto" | "chat" | "responses";
2145
2483
  }, {
2146
2484
  apiKey?: string | undefined;
2147
2485
  apiBase?: string | null | undefined;
2148
2486
  extraHeaders?: Record<string, string> | null | undefined;
2487
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2149
2488
  }>>;
2150
2489
  deepseek: z.ZodDefault<z.ZodObject<{
2151
2490
  apiKey: z.ZodDefault<z.ZodString>;
2152
2491
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2153
2492
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2493
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2154
2494
  }, "strip", z.ZodTypeAny, {
2155
2495
  apiKey: string;
2156
2496
  apiBase: string | null;
2157
2497
  extraHeaders: Record<string, string> | null;
2498
+ wireApi: "auto" | "chat" | "responses";
2158
2499
  }, {
2159
2500
  apiKey?: string | undefined;
2160
2501
  apiBase?: string | null | undefined;
2161
2502
  extraHeaders?: Record<string, string> | null | undefined;
2503
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2162
2504
  }>>;
2163
2505
  groq: z.ZodDefault<z.ZodObject<{
2164
2506
  apiKey: z.ZodDefault<z.ZodString>;
2165
2507
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2166
2508
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2509
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2167
2510
  }, "strip", z.ZodTypeAny, {
2168
2511
  apiKey: string;
2169
2512
  apiBase: string | null;
2170
2513
  extraHeaders: Record<string, string> | null;
2514
+ wireApi: "auto" | "chat" | "responses";
2171
2515
  }, {
2172
2516
  apiKey?: string | undefined;
2173
2517
  apiBase?: string | null | undefined;
2174
2518
  extraHeaders?: Record<string, string> | null | undefined;
2519
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2175
2520
  }>>;
2176
2521
  zhipu: z.ZodDefault<z.ZodObject<{
2177
2522
  apiKey: z.ZodDefault<z.ZodString>;
2178
2523
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2179
2524
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2525
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2180
2526
  }, "strip", z.ZodTypeAny, {
2181
2527
  apiKey: string;
2182
2528
  apiBase: string | null;
2183
2529
  extraHeaders: Record<string, string> | null;
2530
+ wireApi: "auto" | "chat" | "responses";
2184
2531
  }, {
2185
2532
  apiKey?: string | undefined;
2186
2533
  apiBase?: string | null | undefined;
2187
2534
  extraHeaders?: Record<string, string> | null | undefined;
2535
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2188
2536
  }>>;
2189
2537
  dashscope: z.ZodDefault<z.ZodObject<{
2190
2538
  apiKey: z.ZodDefault<z.ZodString>;
2191
2539
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2192
2540
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2541
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2193
2542
  }, "strip", z.ZodTypeAny, {
2194
2543
  apiKey: string;
2195
2544
  apiBase: string | null;
2196
2545
  extraHeaders: Record<string, string> | null;
2546
+ wireApi: "auto" | "chat" | "responses";
2197
2547
  }, {
2198
2548
  apiKey?: string | undefined;
2199
2549
  apiBase?: string | null | undefined;
2200
2550
  extraHeaders?: Record<string, string> | null | undefined;
2551
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2201
2552
  }>>;
2202
2553
  vllm: z.ZodDefault<z.ZodObject<{
2203
2554
  apiKey: z.ZodDefault<z.ZodString>;
2204
2555
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2205
2556
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2557
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2206
2558
  }, "strip", z.ZodTypeAny, {
2207
2559
  apiKey: string;
2208
2560
  apiBase: string | null;
2209
2561
  extraHeaders: Record<string, string> | null;
2562
+ wireApi: "auto" | "chat" | "responses";
2210
2563
  }, {
2211
2564
  apiKey?: string | undefined;
2212
2565
  apiBase?: string | null | undefined;
2213
2566
  extraHeaders?: Record<string, string> | null | undefined;
2567
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2214
2568
  }>>;
2215
2569
  gemini: z.ZodDefault<z.ZodObject<{
2216
2570
  apiKey: z.ZodDefault<z.ZodString>;
2217
2571
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2218
2572
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2573
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2219
2574
  }, "strip", z.ZodTypeAny, {
2220
2575
  apiKey: string;
2221
2576
  apiBase: string | null;
2222
2577
  extraHeaders: Record<string, string> | null;
2578
+ wireApi: "auto" | "chat" | "responses";
2223
2579
  }, {
2224
2580
  apiKey?: string | undefined;
2225
2581
  apiBase?: string | null | undefined;
2226
2582
  extraHeaders?: Record<string, string> | null | undefined;
2583
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2227
2584
  }>>;
2228
2585
  moonshot: z.ZodDefault<z.ZodObject<{
2229
2586
  apiKey: z.ZodDefault<z.ZodString>;
2230
2587
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2231
2588
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2589
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2232
2590
  }, "strip", z.ZodTypeAny, {
2233
2591
  apiKey: string;
2234
2592
  apiBase: string | null;
2235
2593
  extraHeaders: Record<string, string> | null;
2594
+ wireApi: "auto" | "chat" | "responses";
2236
2595
  }, {
2237
2596
  apiKey?: string | undefined;
2238
2597
  apiBase?: string | null | undefined;
2239
2598
  extraHeaders?: Record<string, string> | null | undefined;
2599
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2240
2600
  }>>;
2241
2601
  minimax: z.ZodDefault<z.ZodObject<{
2242
2602
  apiKey: z.ZodDefault<z.ZodString>;
2243
2603
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2244
2604
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2605
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2245
2606
  }, "strip", z.ZodTypeAny, {
2246
2607
  apiKey: string;
2247
2608
  apiBase: string | null;
2248
2609
  extraHeaders: Record<string, string> | null;
2610
+ wireApi: "auto" | "chat" | "responses";
2249
2611
  }, {
2250
2612
  apiKey?: string | undefined;
2251
2613
  apiBase?: string | null | undefined;
2252
2614
  extraHeaders?: Record<string, string> | null | undefined;
2615
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2253
2616
  }>>;
2254
2617
  aihubmix: z.ZodDefault<z.ZodObject<{
2255
2618
  apiKey: z.ZodDefault<z.ZodString>;
2256
2619
  apiBase: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2257
2620
  extraHeaders: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
2621
+ wireApi: z.ZodDefault<z.ZodEnum<["auto", "chat", "responses"]>>;
2258
2622
  }, "strip", z.ZodTypeAny, {
2259
2623
  apiKey: string;
2260
2624
  apiBase: string | null;
2261
2625
  extraHeaders: Record<string, string> | null;
2626
+ wireApi: "auto" | "chat" | "responses";
2262
2627
  }, {
2263
2628
  apiKey?: string | undefined;
2264
2629
  apiBase?: string | null | undefined;
2265
2630
  extraHeaders?: Record<string, string> | null | undefined;
2631
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2266
2632
  }>>;
2267
2633
  }, "strip", z.ZodTypeAny, {
2268
2634
  openrouter: {
2269
2635
  apiKey: string;
2270
2636
  apiBase: string | null;
2271
2637
  extraHeaders: Record<string, string> | null;
2638
+ wireApi: "auto" | "chat" | "responses";
2272
2639
  };
2273
2640
  aihubmix: {
2274
2641
  apiKey: string;
2275
2642
  apiBase: string | null;
2276
2643
  extraHeaders: Record<string, string> | null;
2644
+ wireApi: "auto" | "chat" | "responses";
2277
2645
  };
2278
2646
  openai: {
2279
2647
  apiKey: string;
2280
2648
  apiBase: string | null;
2281
2649
  extraHeaders: Record<string, string> | null;
2650
+ wireApi: "auto" | "chat" | "responses";
2282
2651
  };
2283
2652
  anthropic: {
2284
2653
  apiKey: string;
2285
2654
  apiBase: string | null;
2286
2655
  extraHeaders: Record<string, string> | null;
2656
+ wireApi: "auto" | "chat" | "responses";
2287
2657
  };
2288
2658
  deepseek: {
2289
2659
  apiKey: string;
2290
2660
  apiBase: string | null;
2291
2661
  extraHeaders: Record<string, string> | null;
2662
+ wireApi: "auto" | "chat" | "responses";
2292
2663
  };
2293
2664
  gemini: {
2294
2665
  apiKey: string;
2295
2666
  apiBase: string | null;
2296
2667
  extraHeaders: Record<string, string> | null;
2668
+ wireApi: "auto" | "chat" | "responses";
2297
2669
  };
2298
2670
  zhipu: {
2299
2671
  apiKey: string;
2300
2672
  apiBase: string | null;
2301
2673
  extraHeaders: Record<string, string> | null;
2674
+ wireApi: "auto" | "chat" | "responses";
2302
2675
  };
2303
2676
  dashscope: {
2304
2677
  apiKey: string;
2305
2678
  apiBase: string | null;
2306
2679
  extraHeaders: Record<string, string> | null;
2680
+ wireApi: "auto" | "chat" | "responses";
2307
2681
  };
2308
2682
  moonshot: {
2309
2683
  apiKey: string;
2310
2684
  apiBase: string | null;
2311
2685
  extraHeaders: Record<string, string> | null;
2686
+ wireApi: "auto" | "chat" | "responses";
2312
2687
  };
2313
2688
  minimax: {
2314
2689
  apiKey: string;
2315
2690
  apiBase: string | null;
2316
2691
  extraHeaders: Record<string, string> | null;
2692
+ wireApi: "auto" | "chat" | "responses";
2317
2693
  };
2318
2694
  vllm: {
2319
2695
  apiKey: string;
2320
2696
  apiBase: string | null;
2321
2697
  extraHeaders: Record<string, string> | null;
2698
+ wireApi: "auto" | "chat" | "responses";
2322
2699
  };
2323
2700
  groq: {
2324
2701
  apiKey: string;
2325
2702
  apiBase: string | null;
2326
2703
  extraHeaders: Record<string, string> | null;
2704
+ wireApi: "auto" | "chat" | "responses";
2327
2705
  };
2328
2706
  }, {
2329
2707
  openrouter?: {
2330
2708
  apiKey?: string | undefined;
2331
2709
  apiBase?: string | null | undefined;
2332
2710
  extraHeaders?: Record<string, string> | null | undefined;
2711
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2333
2712
  } | undefined;
2334
2713
  aihubmix?: {
2335
2714
  apiKey?: string | undefined;
2336
2715
  apiBase?: string | null | undefined;
2337
2716
  extraHeaders?: Record<string, string> | null | undefined;
2717
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2338
2718
  } | undefined;
2339
2719
  openai?: {
2340
2720
  apiKey?: string | undefined;
2341
2721
  apiBase?: string | null | undefined;
2342
2722
  extraHeaders?: Record<string, string> | null | undefined;
2723
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2343
2724
  } | undefined;
2344
2725
  anthropic?: {
2345
2726
  apiKey?: string | undefined;
2346
2727
  apiBase?: string | null | undefined;
2347
2728
  extraHeaders?: Record<string, string> | null | undefined;
2729
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2348
2730
  } | undefined;
2349
2731
  deepseek?: {
2350
2732
  apiKey?: string | undefined;
2351
2733
  apiBase?: string | null | undefined;
2352
2734
  extraHeaders?: Record<string, string> | null | undefined;
2735
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2353
2736
  } | undefined;
2354
2737
  gemini?: {
2355
2738
  apiKey?: string | undefined;
2356
2739
  apiBase?: string | null | undefined;
2357
2740
  extraHeaders?: Record<string, string> | null | undefined;
2741
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2358
2742
  } | undefined;
2359
2743
  zhipu?: {
2360
2744
  apiKey?: string | undefined;
2361
2745
  apiBase?: string | null | undefined;
2362
2746
  extraHeaders?: Record<string, string> | null | undefined;
2747
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2363
2748
  } | undefined;
2364
2749
  dashscope?: {
2365
2750
  apiKey?: string | undefined;
2366
2751
  apiBase?: string | null | undefined;
2367
2752
  extraHeaders?: Record<string, string> | null | undefined;
2753
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2368
2754
  } | undefined;
2369
2755
  moonshot?: {
2370
2756
  apiKey?: string | undefined;
2371
2757
  apiBase?: string | null | undefined;
2372
2758
  extraHeaders?: Record<string, string> | null | undefined;
2759
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2373
2760
  } | undefined;
2374
2761
  minimax?: {
2375
2762
  apiKey?: string | undefined;
2376
2763
  apiBase?: string | null | undefined;
2377
2764
  extraHeaders?: Record<string, string> | null | undefined;
2765
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2378
2766
  } | undefined;
2379
2767
  vllm?: {
2380
2768
  apiKey?: string | undefined;
2381
2769
  apiBase?: string | null | undefined;
2382
2770
  extraHeaders?: Record<string, string> | null | undefined;
2771
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2383
2772
  } | undefined;
2384
2773
  groq?: {
2385
2774
  apiKey?: string | undefined;
2386
2775
  apiBase?: string | null | undefined;
2387
2776
  extraHeaders?: Record<string, string> | null | undefined;
2777
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2388
2778
  } | undefined;
2389
2779
  }>>;
2390
2780
  gateway: z.ZodDefault<z.ZodObject<{
@@ -2419,21 +2809,21 @@ declare const ConfigSchema: z.ZodObject<{
2419
2809
  apiKey: z.ZodDefault<z.ZodString>;
2420
2810
  maxResults: z.ZodDefault<z.ZodNumber>;
2421
2811
  }, "strip", z.ZodTypeAny, {
2422
- maxResults: number;
2423
2812
  apiKey: string;
2813
+ maxResults: number;
2424
2814
  }, {
2425
- maxResults?: number | undefined;
2426
2815
  apiKey?: string | undefined;
2816
+ maxResults?: number | undefined;
2427
2817
  }>>;
2428
2818
  }, "strip", z.ZodTypeAny, {
2429
2819
  search: {
2430
- maxResults: number;
2431
2820
  apiKey: string;
2821
+ maxResults: number;
2432
2822
  };
2433
2823
  }, {
2434
2824
  search?: {
2435
- maxResults?: number | undefined;
2436
2825
  apiKey?: string | undefined;
2826
+ maxResults?: number | undefined;
2437
2827
  } | undefined;
2438
2828
  }>>;
2439
2829
  exec: z.ZodDefault<z.ZodObject<{
@@ -2445,26 +2835,26 @@ declare const ConfigSchema: z.ZodObject<{
2445
2835
  }>>;
2446
2836
  restrictToWorkspace: z.ZodDefault<z.ZodBoolean>;
2447
2837
  }, "strip", z.ZodTypeAny, {
2448
- exec: {
2449
- timeout: number;
2450
- };
2451
2838
  web: {
2452
2839
  search: {
2453
- maxResults: number;
2454
2840
  apiKey: string;
2841
+ maxResults: number;
2455
2842
  };
2456
2843
  };
2844
+ exec: {
2845
+ timeout: number;
2846
+ };
2457
2847
  restrictToWorkspace: boolean;
2458
2848
  }, {
2459
- exec?: {
2460
- timeout?: number | undefined;
2461
- } | undefined;
2462
2849
  web?: {
2463
2850
  search?: {
2464
- maxResults?: number | undefined;
2465
2851
  apiKey?: string | undefined;
2852
+ maxResults?: number | undefined;
2466
2853
  } | undefined;
2467
2854
  } | undefined;
2855
+ exec?: {
2856
+ timeout?: number | undefined;
2857
+ } | undefined;
2468
2858
  restrictToWorkspace?: boolean | undefined;
2469
2859
  }>>;
2470
2860
  }, "strip", z.ZodTypeAny, {
@@ -2476,6 +2866,19 @@ declare const ConfigSchema: z.ZodObject<{
2476
2866
  maxTokens: number;
2477
2867
  maxToolIterations: number;
2478
2868
  };
2869
+ context: {
2870
+ memory: {
2871
+ enabled: boolean;
2872
+ maxChars: number;
2873
+ };
2874
+ bootstrap: {
2875
+ files: string[];
2876
+ minimalFiles: string[];
2877
+ heartbeatFiles: string[];
2878
+ perFileChars: number;
2879
+ totalChars: number;
2880
+ };
2881
+ };
2479
2882
  };
2480
2883
  channels: {
2481
2884
  whatsapp: {
@@ -2498,8 +2901,8 @@ declare const ConfigSchema: z.ZodObject<{
2498
2901
  };
2499
2902
  feishu: {
2500
2903
  enabled: boolean;
2501
- appId: string;
2502
2904
  allowFrom: string[];
2905
+ appId: string;
2503
2906
  appSecret: string;
2504
2907
  encryptKey: string;
2505
2908
  verificationToken: string;
@@ -2578,8 +2981,8 @@ declare const ConfigSchema: z.ZodObject<{
2578
2981
  };
2579
2982
  qq: {
2580
2983
  enabled: boolean;
2581
- appId: string;
2582
2984
  allowFrom: string[];
2985
+ appId: string;
2583
2986
  secret: string;
2584
2987
  markdownSupport: boolean;
2585
2988
  };
@@ -2589,61 +2992,73 @@ declare const ConfigSchema: z.ZodObject<{
2589
2992
  apiKey: string;
2590
2993
  apiBase: string | null;
2591
2994
  extraHeaders: Record<string, string> | null;
2995
+ wireApi: "auto" | "chat" | "responses";
2592
2996
  };
2593
2997
  aihubmix: {
2594
2998
  apiKey: string;
2595
2999
  apiBase: string | null;
2596
3000
  extraHeaders: Record<string, string> | null;
3001
+ wireApi: "auto" | "chat" | "responses";
2597
3002
  };
2598
3003
  openai: {
2599
3004
  apiKey: string;
2600
3005
  apiBase: string | null;
2601
3006
  extraHeaders: Record<string, string> | null;
3007
+ wireApi: "auto" | "chat" | "responses";
2602
3008
  };
2603
3009
  anthropic: {
2604
3010
  apiKey: string;
2605
3011
  apiBase: string | null;
2606
3012
  extraHeaders: Record<string, string> | null;
3013
+ wireApi: "auto" | "chat" | "responses";
2607
3014
  };
2608
3015
  deepseek: {
2609
3016
  apiKey: string;
2610
3017
  apiBase: string | null;
2611
3018
  extraHeaders: Record<string, string> | null;
3019
+ wireApi: "auto" | "chat" | "responses";
2612
3020
  };
2613
3021
  gemini: {
2614
3022
  apiKey: string;
2615
3023
  apiBase: string | null;
2616
3024
  extraHeaders: Record<string, string> | null;
3025
+ wireApi: "auto" | "chat" | "responses";
2617
3026
  };
2618
3027
  zhipu: {
2619
3028
  apiKey: string;
2620
3029
  apiBase: string | null;
2621
3030
  extraHeaders: Record<string, string> | null;
3031
+ wireApi: "auto" | "chat" | "responses";
2622
3032
  };
2623
3033
  dashscope: {
2624
3034
  apiKey: string;
2625
3035
  apiBase: string | null;
2626
3036
  extraHeaders: Record<string, string> | null;
3037
+ wireApi: "auto" | "chat" | "responses";
2627
3038
  };
2628
3039
  moonshot: {
2629
3040
  apiKey: string;
2630
3041
  apiBase: string | null;
2631
3042
  extraHeaders: Record<string, string> | null;
3043
+ wireApi: "auto" | "chat" | "responses";
2632
3044
  };
2633
3045
  minimax: {
2634
3046
  apiKey: string;
2635
3047
  apiBase: string | null;
2636
3048
  extraHeaders: Record<string, string> | null;
3049
+ wireApi: "auto" | "chat" | "responses";
2637
3050
  };
2638
3051
  vllm: {
2639
3052
  apiKey: string;
2640
3053
  apiBase: string | null;
2641
3054
  extraHeaders: Record<string, string> | null;
3055
+ wireApi: "auto" | "chat" | "responses";
2642
3056
  };
2643
3057
  groq: {
2644
3058
  apiKey: string;
2645
3059
  apiBase: string | null;
2646
3060
  extraHeaders: Record<string, string> | null;
3061
+ wireApi: "auto" | "chat" | "responses";
2647
3062
  };
2648
3063
  };
2649
3064
  gateway: {
@@ -2657,15 +3072,15 @@ declare const ConfigSchema: z.ZodObject<{
2657
3072
  port: number;
2658
3073
  };
2659
3074
  tools: {
2660
- exec: {
2661
- timeout: number;
2662
- };
2663
3075
  web: {
2664
3076
  search: {
2665
- maxResults: number;
2666
3077
  apiKey: string;
3078
+ maxResults: number;
2667
3079
  };
2668
3080
  };
3081
+ exec: {
3082
+ timeout: number;
3083
+ };
2669
3084
  restrictToWorkspace: boolean;
2670
3085
  };
2671
3086
  }, {
@@ -2677,6 +3092,19 @@ declare const ConfigSchema: z.ZodObject<{
2677
3092
  maxTokens?: number | undefined;
2678
3093
  maxToolIterations?: number | undefined;
2679
3094
  } | undefined;
3095
+ context?: {
3096
+ memory?: {
3097
+ enabled?: boolean | undefined;
3098
+ maxChars?: number | undefined;
3099
+ } | undefined;
3100
+ bootstrap?: {
3101
+ files?: string[] | undefined;
3102
+ minimalFiles?: string[] | undefined;
3103
+ heartbeatFiles?: string[] | undefined;
3104
+ perFileChars?: number | undefined;
3105
+ totalChars?: number | undefined;
3106
+ } | undefined;
3107
+ } | undefined;
2680
3108
  } | undefined;
2681
3109
  channels?: {
2682
3110
  whatsapp?: {
@@ -2699,8 +3127,8 @@ declare const ConfigSchema: z.ZodObject<{
2699
3127
  } | undefined;
2700
3128
  feishu?: {
2701
3129
  enabled?: boolean | undefined;
2702
- appId?: string | undefined;
2703
3130
  allowFrom?: string[] | undefined;
3131
+ appId?: string | undefined;
2704
3132
  appSecret?: string | undefined;
2705
3133
  encryptKey?: string | undefined;
2706
3134
  verificationToken?: string | undefined;
@@ -2779,8 +3207,8 @@ declare const ConfigSchema: z.ZodObject<{
2779
3207
  } | undefined;
2780
3208
  qq?: {
2781
3209
  enabled?: boolean | undefined;
2782
- appId?: string | undefined;
2783
3210
  allowFrom?: string[] | undefined;
3211
+ appId?: string | undefined;
2784
3212
  secret?: string | undefined;
2785
3213
  markdownSupport?: boolean | undefined;
2786
3214
  } | undefined;
@@ -2790,61 +3218,73 @@ declare const ConfigSchema: z.ZodObject<{
2790
3218
  apiKey?: string | undefined;
2791
3219
  apiBase?: string | null | undefined;
2792
3220
  extraHeaders?: Record<string, string> | null | undefined;
3221
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2793
3222
  } | undefined;
2794
3223
  aihubmix?: {
2795
3224
  apiKey?: string | undefined;
2796
3225
  apiBase?: string | null | undefined;
2797
3226
  extraHeaders?: Record<string, string> | null | undefined;
3227
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2798
3228
  } | undefined;
2799
3229
  openai?: {
2800
3230
  apiKey?: string | undefined;
2801
3231
  apiBase?: string | null | undefined;
2802
3232
  extraHeaders?: Record<string, string> | null | undefined;
3233
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2803
3234
  } | undefined;
2804
3235
  anthropic?: {
2805
3236
  apiKey?: string | undefined;
2806
3237
  apiBase?: string | null | undefined;
2807
3238
  extraHeaders?: Record<string, string> | null | undefined;
3239
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2808
3240
  } | undefined;
2809
3241
  deepseek?: {
2810
3242
  apiKey?: string | undefined;
2811
3243
  apiBase?: string | null | undefined;
2812
3244
  extraHeaders?: Record<string, string> | null | undefined;
3245
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2813
3246
  } | undefined;
2814
3247
  gemini?: {
2815
3248
  apiKey?: string | undefined;
2816
3249
  apiBase?: string | null | undefined;
2817
3250
  extraHeaders?: Record<string, string> | null | undefined;
3251
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2818
3252
  } | undefined;
2819
3253
  zhipu?: {
2820
3254
  apiKey?: string | undefined;
2821
3255
  apiBase?: string | null | undefined;
2822
3256
  extraHeaders?: Record<string, string> | null | undefined;
3257
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2823
3258
  } | undefined;
2824
3259
  dashscope?: {
2825
3260
  apiKey?: string | undefined;
2826
3261
  apiBase?: string | null | undefined;
2827
3262
  extraHeaders?: Record<string, string> | null | undefined;
3263
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2828
3264
  } | undefined;
2829
3265
  moonshot?: {
2830
3266
  apiKey?: string | undefined;
2831
3267
  apiBase?: string | null | undefined;
2832
3268
  extraHeaders?: Record<string, string> | null | undefined;
3269
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2833
3270
  } | undefined;
2834
3271
  minimax?: {
2835
3272
  apiKey?: string | undefined;
2836
3273
  apiBase?: string | null | undefined;
2837
3274
  extraHeaders?: Record<string, string> | null | undefined;
3275
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2838
3276
  } | undefined;
2839
3277
  vllm?: {
2840
3278
  apiKey?: string | undefined;
2841
3279
  apiBase?: string | null | undefined;
2842
3280
  extraHeaders?: Record<string, string> | null | undefined;
3281
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2843
3282
  } | undefined;
2844
3283
  groq?: {
2845
3284
  apiKey?: string | undefined;
2846
3285
  apiBase?: string | null | undefined;
2847
3286
  extraHeaders?: Record<string, string> | null | undefined;
3287
+ wireApi?: "auto" | "chat" | "responses" | undefined;
2848
3288
  } | undefined;
2849
3289
  } | undefined;
2850
3290
  gateway?: {
@@ -2858,15 +3298,15 @@ declare const ConfigSchema: z.ZodObject<{
2858
3298
  port?: number | undefined;
2859
3299
  } | undefined;
2860
3300
  tools?: {
2861
- exec?: {
2862
- timeout?: number | undefined;
2863
- } | undefined;
2864
3301
  web?: {
2865
3302
  search?: {
2866
- maxResults?: number | undefined;
2867
3303
  apiKey?: string | undefined;
3304
+ maxResults?: number | undefined;
2868
3305
  } | undefined;
2869
3306
  } | undefined;
3307
+ exec?: {
3308
+ timeout?: number | undefined;
3309
+ } | undefined;
2870
3310
  restrictToWorkspace?: boolean | undefined;
2871
3311
  } | undefined;
2872
3312
  }>;
@@ -2882,6 +3322,54 @@ declare function getProviderName(config: Config, model?: string): string | null;
2882
3322
  declare function getApiKey(config: Config, model?: string): string | null;
2883
3323
  declare function getApiBase(config: Config, model?: string): string | null;
2884
3324
 
3325
+ declare class AgentLoop {
3326
+ private options;
3327
+ private context;
3328
+ private sessions;
3329
+ private tools;
3330
+ private subagents;
3331
+ private running;
3332
+ constructor(options: {
3333
+ bus: MessageBus;
3334
+ providerManager: ProviderManager;
3335
+ workspace: string;
3336
+ model?: string | null;
3337
+ maxIterations?: number;
3338
+ braveApiKey?: string | null;
3339
+ execConfig?: {
3340
+ timeout: number;
3341
+ };
3342
+ cronService?: CronService | null;
3343
+ restrictToWorkspace?: boolean;
3344
+ sessionManager?: SessionManager;
3345
+ contextConfig?: Config["agents"]["context"];
3346
+ gatewayController?: GatewayController;
3347
+ });
3348
+ private registerDefaultTools;
3349
+ run(): Promise<void>;
3350
+ stop(): void;
3351
+ processDirect(params: {
3352
+ content: string;
3353
+ sessionKey?: string;
3354
+ channel?: string;
3355
+ chatId?: string;
3356
+ }): Promise<string>;
3357
+ private processMessage;
3358
+ private processSystemMessage;
3359
+ }
3360
+
3361
+ type FeishuProbeResult = {
3362
+ ok: true;
3363
+ appId: string;
3364
+ botName?: string;
3365
+ botOpenId?: string;
3366
+ } | {
3367
+ ok: false;
3368
+ appId?: string;
3369
+ error: string;
3370
+ };
3371
+ declare function probeFeishu(appId: string, appSecret: string): Promise<FeishuProbeResult>;
3372
+
2885
3373
  declare abstract class BaseChannel<TConfig extends Record<string, unknown>> {
2886
3374
  protected config: TConfig;
2887
3375
  protected bus: MessageBus;
@@ -2945,6 +3433,7 @@ declare function saveConfig(config: Config, configPath?: string): void;
2945
3433
  type ReloadPlan = {
2946
3434
  changedPaths: string[];
2947
3435
  restartChannels: boolean;
3436
+ reloadProviders: boolean;
2948
3437
  restartRequired: string[];
2949
3438
  noopPaths: string[];
2950
3439
  };
@@ -2976,6 +3465,7 @@ type LiteLLMProviderOptions = {
2976
3465
  defaultModel: string;
2977
3466
  extraHeaders?: Record<string, string> | null;
2978
3467
  providerName?: string | null;
3468
+ wireApi?: "auto" | "chat" | "responses" | null;
2979
3469
  };
2980
3470
  declare class LiteLLMProvider extends LLMProvider {
2981
3471
  private defaultModel;
@@ -2998,6 +3488,7 @@ declare class LiteLLMProvider extends LLMProvider {
2998
3488
  private getStandardSpec;
2999
3489
  }
3000
3490
 
3491
+ type WireApiMode = "auto" | "chat" | "responses";
3001
3492
  type ProviderSpec = {
3002
3493
  name: string;
3003
3494
  keywords: string[];
@@ -3013,6 +3504,9 @@ type ProviderSpec = {
3013
3504
  defaultApiBase?: string;
3014
3505
  stripModelPrefix?: boolean;
3015
3506
  modelOverrides?: Array<[string, Record<string, unknown>]>;
3507
+ supportsWireApi?: boolean;
3508
+ wireApiOptions?: WireApiMode[];
3509
+ defaultWireApi?: WireApiMode;
3016
3510
  };
3017
3511
  declare const PROVIDERS: ProviderSpec[];
3018
3512
  declare function findProviderByName(name: string): ProviderSpec | undefined;
@@ -3036,4 +3530,4 @@ declare function parseSessionKey(key: string): {
3036
3530
  };
3037
3531
  declare function expandHome(value: string): string;
3038
3532
 
3039
- export { APP_NAME, APP_REPLY_SUBJECT, APP_TAGLINE, APP_TITLE, APP_USER_AGENT, AgentDefaultsSchema, AgentLoop, AgentsConfigSchema, ChannelManager, ChannelsConfigSchema, type Config, ConfigSchema, CronService, DEFAULT_CONFIG_FILE, DEFAULT_CONFIG_PATH, DEFAULT_HEARTBEAT_INTERVAL_S, DEFAULT_HOME_DIR, DEFAULT_WORKSPACE_DIR, DEFAULT_WORKSPACE_PATH, DingTalkConfigSchema, DiscordConfigSchema, ENV_APP_NAME_KEY, ENV_HOME_KEY, EmailConfigSchema, ExecToolConfigSchema, FeishuConfigSchema, type FeishuProbeResult, GatewayConfigSchema, HEARTBEAT_OK_TOKEN, HEARTBEAT_PROMPT, HeartbeatService, LLMProvider, type LLMResponse, LiteLLMProvider, type LiteLLMProviderOptions, MessageBus, MochatConfigSchema, MochatGroupRuleSchema, MochatMentionSchema, PROVIDERS, type ProviderConfig, ProviderConfigSchema, type ProviderSpec, ProvidersConfigSchema, QQConfigSchema, type ReloadPlan, SKILL_METADATA_KEY, type Session, SessionManager, type SessionMessage, SlackConfigSchema, SlackDMSchema, TelegramConfigSchema, type ToolCallRequest, ToolsConfigSchema, UiConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WhatsAppConfigSchema, buildReloadPlan, diffConfigPaths, ensureDir, expandHome, findGateway, findProviderByModel, findProviderByName, getApiBase, getApiKey, getConfigPath, getDataDir, getDataPath, getMemoryPath, getProvider, getProviderName, getSessionsPath, getSkillsPath, getWorkspacePath, getWorkspacePathFromConfig, loadConfig, matchProvider, parseSessionKey, probeFeishu, providerLabel, safeFilename, saveConfig, timestamp, todayDate, truncateString };
3533
+ export { APP_NAME, APP_REPLY_SUBJECT, APP_TAGLINE, APP_TITLE, APP_USER_AGENT, AgentDefaultsSchema, AgentLoop, AgentsConfigSchema, ChannelManager, ChannelsConfigSchema, type Config, ConfigSchema, ContextBootstrapSchema, ContextConfigSchema, ContextMemorySchema, CronService, DEFAULT_CONFIG_FILE, DEFAULT_CONFIG_PATH, DEFAULT_HEARTBEAT_INTERVAL_S, DEFAULT_HOME_DIR, DEFAULT_WORKSPACE_DIR, DEFAULT_WORKSPACE_PATH, DingTalkConfigSchema, DiscordConfigSchema, ENV_APP_NAME_KEY, ENV_HOME_KEY, EmailConfigSchema, ExecToolConfigSchema, FeishuConfigSchema, type FeishuProbeResult, GatewayConfigSchema, type GatewayConfigSnapshot, type GatewayController, GatewayTool, HEARTBEAT_OK_TOKEN, HEARTBEAT_PROMPT, HeartbeatService, LLMProvider, type LLMResponse, LiteLLMProvider, type LiteLLMProviderOptions, MessageBus, MochatConfigSchema, MochatGroupRuleSchema, MochatMentionSchema, PROVIDERS, type ProviderConfig, ProviderConfigSchema, ProviderManager, type ProviderSpec, ProvidersConfigSchema, QQConfigSchema, type ReloadPlan, SKILL_METADATA_KEY, type Session, SessionManager, type SessionMessage, SlackConfigSchema, SlackDMSchema, TelegramConfigSchema, type ToolCallRequest, ToolsConfigSchema, UiConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WhatsAppConfigSchema, type WireApiMode, buildReloadPlan, diffConfigPaths, ensureDir, expandHome, findGateway, findProviderByModel, findProviderByName, getApiBase, getApiKey, getConfigPath, getDataDir, getDataPath, getMemoryPath, getProvider, getProviderName, getSessionsPath, getSkillsPath, getWorkspacePath, getWorkspacePathFromConfig, loadConfig, matchProvider, parseSessionKey, probeFeishu, providerLabel, safeFilename, saveConfig, timestamp, todayDate, truncateString };