forge-openclaw-plugin 0.2.23 → 0.2.25
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/README.md +13 -0
- package/dist/assets/{board-_C6oMy5w.js → board-VmF4FAfr.js} +3 -3
- package/dist/assets/{board-_C6oMy5w.js.map → board-VmF4FAfr.js.map} +1 -1
- package/dist/assets/index-CFCKDIMH.js +67 -0
- package/dist/assets/index-CFCKDIMH.js.map +1 -0
- package/dist/assets/index-ZPY6U1TU.css +1 -0
- package/dist/assets/{motion-D4sZgCHd.js → motion-DvkU14p-.js} +3 -3
- package/dist/assets/motion-DvkU14p-.js.map +1 -0
- package/dist/assets/{table-BWzTaky1.js → table-DgiPof9E.js} +2 -2
- package/dist/assets/{table-BWzTaky1.js.map → table-DgiPof9E.js.map} +1 -1
- package/dist/assets/{ui-BzK4azQb.js → ui-nYfoC0Gq.js} +2 -2
- package/dist/assets/{ui-BzK4azQb.js.map → ui-nYfoC0Gq.js.map} +1 -1
- package/dist/assets/vendor-D9PTEPSB.js +824 -0
- package/dist/assets/vendor-D9PTEPSB.js.map +1 -0
- package/dist/assets/viz-Cqb6s--o.js +34 -0
- package/dist/assets/viz-Cqb6s--o.js.map +1 -0
- package/dist/index.html +8 -8
- package/dist/openclaw/parity.d.ts +1 -1
- package/dist/openclaw/parity.js +29 -0
- package/dist/openclaw/plugin-entry-shared.d.ts +1 -0
- package/dist/openclaw/plugin-entry-shared.js +7 -4
- package/dist/openclaw/plugin-sdk-types.d.ts +12 -0
- package/dist/openclaw/routes.js +236 -0
- package/dist/openclaw/session-bootstrap.d.ts +78 -0
- package/dist/openclaw/session-bootstrap.js +240 -0
- package/dist/openclaw/tools.js +279 -3
- package/dist/server/app.js +855 -19
- package/dist/server/connectors/box-registry.js +257 -0
- package/dist/server/db.js +2 -0
- package/dist/server/discovery-advertiser.js +114 -0
- package/dist/server/health.js +39 -11
- package/dist/server/index.js +4 -0
- package/dist/server/managers/platform/llm-manager.js +40 -4
- package/dist/server/managers/platform/openai-responses-provider.js +129 -19
- package/dist/server/movement.js +2935 -0
- package/dist/server/openapi.js +628 -5
- package/dist/server/psyche-types.js +15 -1
- package/dist/server/questionnaire-flow.js +552 -0
- package/dist/server/questionnaire-seeds.js +853 -0
- package/dist/server/questionnaire-types.js +340 -0
- package/dist/server/repositories/ai-connectors.js +944 -0
- package/dist/server/repositories/ai-processors.js +547 -0
- package/dist/server/repositories/diagnostic-logs.js +57 -4
- package/dist/server/repositories/entity-ownership.js +9 -1
- package/dist/server/repositories/habits.js +77 -9
- package/dist/server/repositories/model-settings.js +216 -0
- package/dist/server/repositories/notes.js +57 -15
- package/dist/server/repositories/preferences.js +124 -0
- package/dist/server/repositories/questionnaires.js +1338 -0
- package/dist/server/repositories/rewards.js +2 -2
- package/dist/server/repositories/settings.js +108 -12
- package/dist/server/repositories/surface-layouts.js +76 -0
- package/dist/server/repositories/wiki-memory.js +5 -1
- package/dist/server/services/entity-crud.js +81 -2
- package/dist/server/services/openai-codex-oauth.js +153 -0
- package/dist/server/services/psyche-observation-calendar.js +46 -0
- package/dist/server/types.js +492 -3
- package/dist/server/watch-mobile.js +562 -0
- package/dist/server/web.js +9 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +6 -1
- package/server/migrations/024_questionnaires.sql +96 -0
- package/server/migrations/025_ai_model_connections.sql +26 -0
- package/server/migrations/026_custom_theme_settings.sql +2 -0
- package/server/migrations/027_ai_processors.sql +31 -0
- package/server/migrations/028_movement_domain.sql +136 -0
- package/server/migrations/029_watch_micro_capture.sql +23 -0
- package/server/migrations/030_surface_layouts.sql +5 -0
- package/server/migrations/031_ai_processor_runtime_upgrades.sql +10 -0
- package/server/migrations/032_ai_connectors.sql +44 -0
- package/server/migrations/033_movement_trip_point_sync.sql +36 -0
- package/server/migrations/034_movement_segment_sync.sql +49 -0
- package/skills/forge-openclaw/SKILL.md +12 -1
- package/skills/forge-openclaw/entity_conversation_playbooks.md +331 -84
- package/skills/forge-openclaw/psyche_entity_playbooks.md +252 -221
- package/dist/assets/index-Ch_xeZ2u.js +0 -63
- package/dist/assets/index-Ch_xeZ2u.js.map +0 -1
- package/dist/assets/index-DvVM7K6j.css +0 -1
- package/dist/assets/motion-D4sZgCHd.js.map +0 -1
- package/dist/assets/vendor-De38P6YR.js +0 -729
- package/dist/assets/vendor-De38P6YR.js.map +0 -1
- package/dist/assets/viz-C6hfyqzu.js +0 -34
- package/dist/assets/viz-C6hfyqzu.js.map +0 -1
- package/skills/forge-openclaw/cron_jobs.md +0 -395
package/dist/server/types.js
CHANGED
|
@@ -93,6 +93,12 @@ export const activityEntityTypeSchema = z.enum([
|
|
|
93
93
|
"mode_profile",
|
|
94
94
|
"mode_guide_session",
|
|
95
95
|
"trigger_report",
|
|
96
|
+
"preference_catalog",
|
|
97
|
+
"preference_catalog_item",
|
|
98
|
+
"preference_context",
|
|
99
|
+
"preference_item",
|
|
100
|
+
"questionnaire_instrument",
|
|
101
|
+
"questionnaire_run",
|
|
96
102
|
"note",
|
|
97
103
|
"event_type",
|
|
98
104
|
"emotion_definition",
|
|
@@ -199,7 +205,12 @@ export const crudEntityTypeSchema = z.enum([
|
|
|
199
205
|
"mode_guide_session",
|
|
200
206
|
"event_type",
|
|
201
207
|
"emotion_definition",
|
|
202
|
-
"trigger_report"
|
|
208
|
+
"trigger_report",
|
|
209
|
+
"preference_catalog",
|
|
210
|
+
"preference_catalog_item",
|
|
211
|
+
"preference_context",
|
|
212
|
+
"preference_item",
|
|
213
|
+
"questionnaire_instrument"
|
|
203
214
|
]);
|
|
204
215
|
export const rewardableEntityTypeSchema = z.enum([
|
|
205
216
|
"system",
|
|
@@ -235,6 +246,11 @@ export const rewardRuleFamilySchema = z.enum([
|
|
|
235
246
|
"ambient"
|
|
236
247
|
]);
|
|
237
248
|
export const appLocaleSchema = z.enum(["en", "fr"]);
|
|
249
|
+
export const surfaceWidgetDensitySchema = z.enum([
|
|
250
|
+
"dense",
|
|
251
|
+
"compact",
|
|
252
|
+
"comfortable"
|
|
253
|
+
]);
|
|
238
254
|
const trimmedString = z.string().trim();
|
|
239
255
|
const nonEmptyTrimmedString = trimmedString.min(1);
|
|
240
256
|
const rewardConfigValueSchema = z.union([
|
|
@@ -876,7 +892,7 @@ export const activityEventSchema = z.object({
|
|
|
876
892
|
description: z.string(),
|
|
877
893
|
actor: z.string().nullable(),
|
|
878
894
|
source: activitySourceSchema,
|
|
879
|
-
metadata: z.record(z.string(), z.
|
|
895
|
+
metadata: z.record(z.string(), z.unknown()),
|
|
880
896
|
createdAt: z.string(),
|
|
881
897
|
...ownershipShape
|
|
882
898
|
});
|
|
@@ -1195,7 +1211,29 @@ export const notificationPreferencesSchema = z.object({
|
|
|
1195
1211
|
dailyQuestReminders: z.boolean(),
|
|
1196
1212
|
achievementCelebrations: z.boolean()
|
|
1197
1213
|
});
|
|
1198
|
-
|
|
1214
|
+
const hexColorSchema = z
|
|
1215
|
+
.string()
|
|
1216
|
+
.trim()
|
|
1217
|
+
.regex(/^#[0-9a-fA-F]{6}$/, "Use a 6-digit hex color");
|
|
1218
|
+
export const themePreferenceSchema = z.enum([
|
|
1219
|
+
"obsidian",
|
|
1220
|
+
"solar",
|
|
1221
|
+
"aurora",
|
|
1222
|
+
"ember",
|
|
1223
|
+
"custom",
|
|
1224
|
+
"system"
|
|
1225
|
+
]);
|
|
1226
|
+
export const customThemeSchema = z.object({
|
|
1227
|
+
label: z.string().trim().min(1).max(40),
|
|
1228
|
+
primary: hexColorSchema,
|
|
1229
|
+
secondary: hexColorSchema,
|
|
1230
|
+
tertiary: hexColorSchema,
|
|
1231
|
+
canvas: hexColorSchema,
|
|
1232
|
+
panel: hexColorSchema,
|
|
1233
|
+
panelHigh: hexColorSchema,
|
|
1234
|
+
panelLow: hexColorSchema,
|
|
1235
|
+
ink: hexColorSchema
|
|
1236
|
+
});
|
|
1199
1237
|
export const executionSettingsSchema = z.object({
|
|
1200
1238
|
maxActiveTasks: z.number().int().min(1).max(8),
|
|
1201
1239
|
timeAccountingMode: timeAccountingModeSchema
|
|
@@ -1211,6 +1249,309 @@ export const microsoftCalendarAuthSettingsSchema = z.object({
|
|
|
1211
1249
|
isReadyForSignIn: z.boolean(),
|
|
1212
1250
|
setupMessage: z.string()
|
|
1213
1251
|
});
|
|
1252
|
+
export const aiModelProviderSchema = z.enum([
|
|
1253
|
+
"openai-api",
|
|
1254
|
+
"openai-codex",
|
|
1255
|
+
"openai-compatible"
|
|
1256
|
+
]);
|
|
1257
|
+
export const aiModelAuthModeSchema = z.enum(["api_key", "oauth"]);
|
|
1258
|
+
export const aiModelConnectionStatusSchema = z.enum([
|
|
1259
|
+
"connected",
|
|
1260
|
+
"needs_attention"
|
|
1261
|
+
]);
|
|
1262
|
+
export const aiModelConnectionSchema = z.object({
|
|
1263
|
+
id: z.string(),
|
|
1264
|
+
label: z.string(),
|
|
1265
|
+
provider: aiModelProviderSchema,
|
|
1266
|
+
authMode: aiModelAuthModeSchema,
|
|
1267
|
+
baseUrl: z.string(),
|
|
1268
|
+
model: z.string(),
|
|
1269
|
+
accountLabel: z.string().nullable(),
|
|
1270
|
+
enabled: z.boolean(),
|
|
1271
|
+
status: aiModelConnectionStatusSchema,
|
|
1272
|
+
hasStoredCredential: z.boolean(),
|
|
1273
|
+
usesOAuth: z.boolean(),
|
|
1274
|
+
supportsCustomBaseUrl: z.boolean(),
|
|
1275
|
+
agentId: z.string(),
|
|
1276
|
+
agentLabel: z.string(),
|
|
1277
|
+
createdAt: z.string(),
|
|
1278
|
+
updatedAt: z.string()
|
|
1279
|
+
});
|
|
1280
|
+
export const forgeAgentModelSlotSchema = z.object({
|
|
1281
|
+
connectionId: z.string().nullable(),
|
|
1282
|
+
connectionLabel: z.string().nullable(),
|
|
1283
|
+
provider: aiModelProviderSchema.nullable(),
|
|
1284
|
+
baseUrl: z.string().nullable(),
|
|
1285
|
+
model: z.string()
|
|
1286
|
+
});
|
|
1287
|
+
export const modelSettingsPayloadSchema = z.object({
|
|
1288
|
+
forgeAgent: z.object({
|
|
1289
|
+
basicChat: forgeAgentModelSlotSchema,
|
|
1290
|
+
wiki: forgeAgentModelSlotSchema
|
|
1291
|
+
}),
|
|
1292
|
+
connections: z.array(aiModelConnectionSchema),
|
|
1293
|
+
oauth: z.object({
|
|
1294
|
+
openAiCodex: z.object({
|
|
1295
|
+
authorizeUrl: z.string(),
|
|
1296
|
+
callbackUrl: z.string(),
|
|
1297
|
+
setupMessage: z.string()
|
|
1298
|
+
})
|
|
1299
|
+
})
|
|
1300
|
+
});
|
|
1301
|
+
export const aiProcessorTriggerModeSchema = z.enum([
|
|
1302
|
+
"manual",
|
|
1303
|
+
"route",
|
|
1304
|
+
"cron"
|
|
1305
|
+
]);
|
|
1306
|
+
export const aiProcessorCapabilityModeSchema = z.enum([
|
|
1307
|
+
"content",
|
|
1308
|
+
"tool",
|
|
1309
|
+
"mcp",
|
|
1310
|
+
"processor"
|
|
1311
|
+
]);
|
|
1312
|
+
export const aiProcessorAccessModeSchema = z.enum([
|
|
1313
|
+
"read",
|
|
1314
|
+
"write",
|
|
1315
|
+
"read_write",
|
|
1316
|
+
"exec"
|
|
1317
|
+
]);
|
|
1318
|
+
export const aiProcessorMachineAccessSchema = z.object({
|
|
1319
|
+
read: z.boolean().default(false),
|
|
1320
|
+
write: z.boolean().default(false),
|
|
1321
|
+
exec: z.boolean().default(false)
|
|
1322
|
+
});
|
|
1323
|
+
export const aiProcessorAgentConfigSchema = z.object({
|
|
1324
|
+
agentId: nonEmptyTrimmedString,
|
|
1325
|
+
connectionId: trimmedString.nullable().default(null),
|
|
1326
|
+
model: trimmedString.default("")
|
|
1327
|
+
});
|
|
1328
|
+
export const aiProcessorToolSchema = z.object({
|
|
1329
|
+
key: nonEmptyTrimmedString,
|
|
1330
|
+
label: nonEmptyTrimmedString,
|
|
1331
|
+
description: trimmedString.default(""),
|
|
1332
|
+
endpoint: trimmedString.default(""),
|
|
1333
|
+
mode: aiProcessorCapabilityModeSchema.default("tool")
|
|
1334
|
+
});
|
|
1335
|
+
export const surfaceWidgetPreferencesSchema = z.object({
|
|
1336
|
+
hidden: z.boolean().default(false),
|
|
1337
|
+
fullWidth: z.boolean().default(false),
|
|
1338
|
+
titleVisible: z.boolean().default(true),
|
|
1339
|
+
descriptionVisible: z.boolean().default(true)
|
|
1340
|
+
});
|
|
1341
|
+
export const surfaceLayoutPayloadSchema = z.object({
|
|
1342
|
+
surfaceId: nonEmptyTrimmedString,
|
|
1343
|
+
order: z.array(nonEmptyTrimmedString).default([]),
|
|
1344
|
+
widgets: z.record(z.string(), surfaceWidgetPreferencesSchema).default({}),
|
|
1345
|
+
updatedAt: z.string()
|
|
1346
|
+
});
|
|
1347
|
+
export const writeSurfaceLayoutSchema = z.object({
|
|
1348
|
+
order: z.array(nonEmptyTrimmedString).default([]),
|
|
1349
|
+
widgets: z.record(z.string(), surfaceWidgetPreferencesSchema).default({})
|
|
1350
|
+
});
|
|
1351
|
+
export const aiProcessorSchema = z.object({
|
|
1352
|
+
id: z.string(),
|
|
1353
|
+
slug: z.string(),
|
|
1354
|
+
surfaceId: z.string(),
|
|
1355
|
+
title: z.string(),
|
|
1356
|
+
promptFlow: z.string(),
|
|
1357
|
+
contextInput: z.string(),
|
|
1358
|
+
toolConfig: z.array(aiProcessorToolSchema),
|
|
1359
|
+
agentIds: z.array(z.string()),
|
|
1360
|
+
agentConfigs: z.array(aiProcessorAgentConfigSchema),
|
|
1361
|
+
triggerMode: aiProcessorTriggerModeSchema,
|
|
1362
|
+
cronExpression: z.string(),
|
|
1363
|
+
machineAccess: aiProcessorMachineAccessSchema,
|
|
1364
|
+
endpointEnabled: z.boolean(),
|
|
1365
|
+
lastRunAt: z.string().nullable(),
|
|
1366
|
+
lastRunStatus: z.enum(["idle", "running", "completed", "failed"]).nullable(),
|
|
1367
|
+
lastRunOutput: z
|
|
1368
|
+
.object({
|
|
1369
|
+
concatenated: z.string(),
|
|
1370
|
+
byAgent: z.record(z.string(), z.string())
|
|
1371
|
+
})
|
|
1372
|
+
.nullable(),
|
|
1373
|
+
runHistory: z.array(z.object({
|
|
1374
|
+
id: z.string(),
|
|
1375
|
+
trigger: z.enum(["manual", "route", "cron"]),
|
|
1376
|
+
startedAt: z.string(),
|
|
1377
|
+
completedAt: z.string().nullable(),
|
|
1378
|
+
status: z.enum(["running", "completed", "failed"]),
|
|
1379
|
+
input: z.string(),
|
|
1380
|
+
output: z
|
|
1381
|
+
.object({
|
|
1382
|
+
concatenated: z.string(),
|
|
1383
|
+
byAgent: z.record(z.string(), z.string())
|
|
1384
|
+
})
|
|
1385
|
+
.nullable(),
|
|
1386
|
+
error: z.string().nullable()
|
|
1387
|
+
})),
|
|
1388
|
+
createdAt: z.string(),
|
|
1389
|
+
updatedAt: z.string()
|
|
1390
|
+
});
|
|
1391
|
+
export const aiProcessorLinkSchema = z.object({
|
|
1392
|
+
id: z.string(),
|
|
1393
|
+
surfaceId: z.string(),
|
|
1394
|
+
sourceWidgetId: z.string(),
|
|
1395
|
+
targetProcessorId: z.string(),
|
|
1396
|
+
accessMode: aiProcessorAccessModeSchema,
|
|
1397
|
+
capabilityMode: aiProcessorCapabilityModeSchema,
|
|
1398
|
+
metadata: z.record(z.string(), z.unknown()),
|
|
1399
|
+
createdAt: z.string(),
|
|
1400
|
+
updatedAt: z.string()
|
|
1401
|
+
});
|
|
1402
|
+
export const surfaceProcessorGraphPayloadSchema = z.object({
|
|
1403
|
+
surfaceId: z.string(),
|
|
1404
|
+
processors: z.array(aiProcessorSchema),
|
|
1405
|
+
links: z.array(aiProcessorLinkSchema)
|
|
1406
|
+
});
|
|
1407
|
+
export const forgeBoxCapabilityModeSchema = z.enum([
|
|
1408
|
+
"content",
|
|
1409
|
+
"tool",
|
|
1410
|
+
"action",
|
|
1411
|
+
"mcp"
|
|
1412
|
+
]);
|
|
1413
|
+
export const forgeBoxToolAdapterSchema = z.object({
|
|
1414
|
+
key: nonEmptyTrimmedString,
|
|
1415
|
+
label: nonEmptyTrimmedString,
|
|
1416
|
+
description: trimmedString.default(""),
|
|
1417
|
+
accessMode: aiProcessorAccessModeSchema.default("read")
|
|
1418
|
+
});
|
|
1419
|
+
export const forgeBoxCatalogEntrySchema = z.object({
|
|
1420
|
+
boxId: nonEmptyTrimmedString,
|
|
1421
|
+
surfaceId: trimmedString.nullable(),
|
|
1422
|
+
routePath: trimmedString.nullable(),
|
|
1423
|
+
label: nonEmptyTrimmedString,
|
|
1424
|
+
description: trimmedString.default(""),
|
|
1425
|
+
category: nonEmptyTrimmedString,
|
|
1426
|
+
capabilityModes: z.array(forgeBoxCapabilityModeSchema).default(["content"]),
|
|
1427
|
+
toolAdapters: z.array(forgeBoxToolAdapterSchema).default([])
|
|
1428
|
+
});
|
|
1429
|
+
export const forgeBoxSnapshotSchema = z.object({
|
|
1430
|
+
boxId: nonEmptyTrimmedString,
|
|
1431
|
+
label: nonEmptyTrimmedString,
|
|
1432
|
+
capturedAt: z.string(),
|
|
1433
|
+
contentText: z.string(),
|
|
1434
|
+
contentJson: z.record(z.string(), z.unknown()).nullable(),
|
|
1435
|
+
tools: z.array(forgeBoxToolAdapterSchema).default([])
|
|
1436
|
+
});
|
|
1437
|
+
export const aiConnectorKindSchema = z.enum(["functor", "chat"]);
|
|
1438
|
+
export const aiConnectorNodeTypeSchema = z.enum([
|
|
1439
|
+
"box_input",
|
|
1440
|
+
"user_input",
|
|
1441
|
+
"functor",
|
|
1442
|
+
"chat",
|
|
1443
|
+
"output"
|
|
1444
|
+
]);
|
|
1445
|
+
export const aiConnectorNodeModelConfigSchema = z.object({
|
|
1446
|
+
connectionId: trimmedString.nullable().default(null),
|
|
1447
|
+
provider: aiModelProviderSchema.nullable().default(null),
|
|
1448
|
+
baseUrl: trimmedString.nullable().default(null),
|
|
1449
|
+
model: trimmedString.default(""),
|
|
1450
|
+
thinking: trimmedString.nullable().default(null),
|
|
1451
|
+
verbosity: trimmedString.nullable().default(null)
|
|
1452
|
+
});
|
|
1453
|
+
export const aiConnectorNodeSchema = z.object({
|
|
1454
|
+
id: nonEmptyTrimmedString,
|
|
1455
|
+
type: aiConnectorNodeTypeSchema,
|
|
1456
|
+
position: z.object({
|
|
1457
|
+
x: z.number(),
|
|
1458
|
+
y: z.number()
|
|
1459
|
+
}),
|
|
1460
|
+
data: z.object({
|
|
1461
|
+
label: nonEmptyTrimmedString,
|
|
1462
|
+
description: trimmedString.default(""),
|
|
1463
|
+
boxId: trimmedString.nullable().optional(),
|
|
1464
|
+
prompt: trimmedString.optional(),
|
|
1465
|
+
systemPrompt: trimmedString.optional(),
|
|
1466
|
+
outputKey: trimmedString.optional(),
|
|
1467
|
+
enabledToolKeys: z.array(nonEmptyTrimmedString).default([]),
|
|
1468
|
+
modelConfig: aiConnectorNodeModelConfigSchema.optional()
|
|
1469
|
+
})
|
|
1470
|
+
});
|
|
1471
|
+
export const aiConnectorEdgeSchema = z.object({
|
|
1472
|
+
id: nonEmptyTrimmedString,
|
|
1473
|
+
source: nonEmptyTrimmedString,
|
|
1474
|
+
target: nonEmptyTrimmedString,
|
|
1475
|
+
sourceHandle: trimmedString.nullable().optional(),
|
|
1476
|
+
targetHandle: trimmedString.nullable().optional(),
|
|
1477
|
+
label: trimmedString.nullable().optional()
|
|
1478
|
+
});
|
|
1479
|
+
export const aiConnectorOutputSchema = z.object({
|
|
1480
|
+
id: nonEmptyTrimmedString,
|
|
1481
|
+
nodeId: nonEmptyTrimmedString,
|
|
1482
|
+
label: nonEmptyTrimmedString,
|
|
1483
|
+
apiPath: nonEmptyTrimmedString
|
|
1484
|
+
});
|
|
1485
|
+
export const aiConnectorRunResultSchema = z.object({
|
|
1486
|
+
primaryText: z.string(),
|
|
1487
|
+
outputs: z.record(z.string(), z.object({
|
|
1488
|
+
label: z.string(),
|
|
1489
|
+
text: z.string(),
|
|
1490
|
+
json: z.record(z.string(), z.unknown()).nullable()
|
|
1491
|
+
}))
|
|
1492
|
+
});
|
|
1493
|
+
export const aiConnectorRunSchema = z.object({
|
|
1494
|
+
id: nonEmptyTrimmedString,
|
|
1495
|
+
connectorId: nonEmptyTrimmedString,
|
|
1496
|
+
mode: z.enum(["run", "chat"]),
|
|
1497
|
+
status: z.enum(["running", "completed", "failed"]),
|
|
1498
|
+
userInput: z.string(),
|
|
1499
|
+
context: z.record(z.string(), z.unknown()).default({}),
|
|
1500
|
+
conversationId: trimmedString.nullable(),
|
|
1501
|
+
result: aiConnectorRunResultSchema.nullable(),
|
|
1502
|
+
error: z.string().nullable(),
|
|
1503
|
+
createdAt: z.string(),
|
|
1504
|
+
completedAt: z.string().nullable()
|
|
1505
|
+
});
|
|
1506
|
+
export const aiConnectorConversationSchema = z.object({
|
|
1507
|
+
id: nonEmptyTrimmedString,
|
|
1508
|
+
connectorId: nonEmptyTrimmedString,
|
|
1509
|
+
provider: trimmedString.nullable(),
|
|
1510
|
+
externalConversationId: trimmedString.nullable(),
|
|
1511
|
+
transcript: z.array(z.object({
|
|
1512
|
+
role: z.enum(["system", "developer", "user", "assistant", "tool"]),
|
|
1513
|
+
text: z.string(),
|
|
1514
|
+
createdAt: z.string()
|
|
1515
|
+
})),
|
|
1516
|
+
createdAt: z.string(),
|
|
1517
|
+
updatedAt: z.string()
|
|
1518
|
+
});
|
|
1519
|
+
export const aiConnectorSchema = z.object({
|
|
1520
|
+
id: nonEmptyTrimmedString,
|
|
1521
|
+
slug: nonEmptyTrimmedString,
|
|
1522
|
+
title: nonEmptyTrimmedString,
|
|
1523
|
+
description: trimmedString.default(""),
|
|
1524
|
+
kind: aiConnectorKindSchema,
|
|
1525
|
+
homeSurfaceId: trimmedString.nullable(),
|
|
1526
|
+
endpointEnabled: z.boolean().default(true),
|
|
1527
|
+
graph: z.object({
|
|
1528
|
+
nodes: z.array(aiConnectorNodeSchema).default([]),
|
|
1529
|
+
edges: z.array(aiConnectorEdgeSchema).default([])
|
|
1530
|
+
}),
|
|
1531
|
+
publishedOutputs: z.array(aiConnectorOutputSchema).default([]),
|
|
1532
|
+
lastRun: aiConnectorRunSchema.nullable(),
|
|
1533
|
+
legacyProcessorId: trimmedString.nullable().default(null),
|
|
1534
|
+
createdAt: z.string(),
|
|
1535
|
+
updatedAt: z.string()
|
|
1536
|
+
});
|
|
1537
|
+
export const openAiCodexOauthSessionSchema = z.object({
|
|
1538
|
+
id: z.string(),
|
|
1539
|
+
status: z.enum([
|
|
1540
|
+
"starting",
|
|
1541
|
+
"awaiting_browser",
|
|
1542
|
+
"awaiting_manual_input",
|
|
1543
|
+
"authorized",
|
|
1544
|
+
"error",
|
|
1545
|
+
"consumed",
|
|
1546
|
+
"expired"
|
|
1547
|
+
]),
|
|
1548
|
+
authUrl: z.string().nullable(),
|
|
1549
|
+
accountLabel: z.string().nullable(),
|
|
1550
|
+
error: z.string().nullable(),
|
|
1551
|
+
createdAt: z.string(),
|
|
1552
|
+
expiresAt: z.string(),
|
|
1553
|
+
credentialExpiresAt: z.string().nullable()
|
|
1554
|
+
});
|
|
1214
1555
|
export const agentTokenSummarySchema = z.object({
|
|
1215
1556
|
id: z.string(),
|
|
1216
1557
|
label: z.string(),
|
|
@@ -1440,6 +1781,7 @@ export const settingsPayloadSchema = z.object({
|
|
|
1440
1781
|
notifications: notificationPreferencesSchema,
|
|
1441
1782
|
execution: executionSettingsSchema,
|
|
1442
1783
|
themePreference: themePreferenceSchema,
|
|
1784
|
+
customTheme: customThemeSchema.nullable(),
|
|
1443
1785
|
localePreference: appLocaleSchema,
|
|
1444
1786
|
security: z.object({
|
|
1445
1787
|
integrityScore: z.number().int().min(0).max(100),
|
|
@@ -1452,6 +1794,7 @@ export const settingsPayloadSchema = z.object({
|
|
|
1452
1794
|
calendarProviders: z.object({
|
|
1453
1795
|
microsoft: microsoftCalendarAuthSettingsSchema
|
|
1454
1796
|
}),
|
|
1797
|
+
modelSettings: modelSettingsPayloadSchema,
|
|
1455
1798
|
agents: z.array(agentIdentitySchema),
|
|
1456
1799
|
agentTokens: z.array(agentTokenSummarySchema)
|
|
1457
1800
|
});
|
|
@@ -2243,6 +2586,7 @@ export const updateSettingsSchema = z.object({
|
|
|
2243
2586
|
notifications: notificationPreferencesSchema.partial().optional(),
|
|
2244
2587
|
execution: executionSettingsSchema.partial().optional(),
|
|
2245
2588
|
themePreference: themePreferenceSchema.optional(),
|
|
2589
|
+
customTheme: customThemeSchema.nullable().optional(),
|
|
2246
2590
|
localePreference: appLocaleSchema.optional(),
|
|
2247
2591
|
security: z
|
|
2248
2592
|
.object({
|
|
@@ -2258,9 +2602,154 @@ export const updateSettingsSchema = z.object({
|
|
|
2258
2602
|
redirectUri: trimmedString.optional()
|
|
2259
2603
|
})
|
|
2260
2604
|
.optional()
|
|
2605
|
+
})
|
|
2606
|
+
.optional(),
|
|
2607
|
+
modelSettings: z
|
|
2608
|
+
.object({
|
|
2609
|
+
forgeAgent: z
|
|
2610
|
+
.object({
|
|
2611
|
+
basicChat: z
|
|
2612
|
+
.object({
|
|
2613
|
+
connectionId: trimmedString.nullable().optional(),
|
|
2614
|
+
model: trimmedString.optional()
|
|
2615
|
+
})
|
|
2616
|
+
.optional(),
|
|
2617
|
+
wiki: z
|
|
2618
|
+
.object({
|
|
2619
|
+
connectionId: trimmedString.nullable().optional(),
|
|
2620
|
+
model: trimmedString.optional()
|
|
2621
|
+
})
|
|
2622
|
+
.optional()
|
|
2623
|
+
})
|
|
2624
|
+
.optional()
|
|
2625
|
+
})
|
|
2626
|
+
.optional()
|
|
2627
|
+
});
|
|
2628
|
+
export const upsertAiModelConnectionSchema = z
|
|
2629
|
+
.object({
|
|
2630
|
+
id: trimmedString.optional(),
|
|
2631
|
+
label: nonEmptyTrimmedString,
|
|
2632
|
+
provider: aiModelProviderSchema,
|
|
2633
|
+
authMode: aiModelAuthModeSchema.optional(),
|
|
2634
|
+
baseUrl: trimmedString.optional(),
|
|
2635
|
+
model: nonEmptyTrimmedString,
|
|
2636
|
+
apiKey: trimmedString.optional(),
|
|
2637
|
+
oauthSessionId: trimmedString.optional(),
|
|
2638
|
+
enabled: z.boolean().default(true)
|
|
2639
|
+
})
|
|
2640
|
+
.superRefine((value, context) => {
|
|
2641
|
+
const authMode = value.authMode ??
|
|
2642
|
+
(value.provider === "openai-codex" ? "oauth" : "api_key");
|
|
2643
|
+
if (value.provider === "openai-codex" && authMode !== "oauth") {
|
|
2644
|
+
context.addIssue({
|
|
2645
|
+
code: z.ZodIssueCode.custom,
|
|
2646
|
+
path: ["authMode"],
|
|
2647
|
+
message: "OpenAI Codex connections must use OAuth."
|
|
2648
|
+
});
|
|
2649
|
+
}
|
|
2650
|
+
if (authMode === "api_key" &&
|
|
2651
|
+
!value.id?.trim() &&
|
|
2652
|
+
!value.apiKey?.trim()) {
|
|
2653
|
+
context.addIssue({
|
|
2654
|
+
code: z.ZodIssueCode.custom,
|
|
2655
|
+
path: ["apiKey"],
|
|
2656
|
+
message: "API key is required for a new API-backed connection."
|
|
2657
|
+
});
|
|
2658
|
+
}
|
|
2659
|
+
if (authMode === "oauth" &&
|
|
2660
|
+
!value.id?.trim() &&
|
|
2661
|
+
!value.oauthSessionId?.trim()) {
|
|
2662
|
+
context.addIssue({
|
|
2663
|
+
code: z.ZodIssueCode.custom,
|
|
2664
|
+
path: ["oauthSessionId"],
|
|
2665
|
+
message: "OAuth session is required for a new OAuth-backed connection."
|
|
2666
|
+
});
|
|
2667
|
+
}
|
|
2668
|
+
});
|
|
2669
|
+
export const testAiModelConnectionSchema = z.object({
|
|
2670
|
+
connectionId: trimmedString.optional(),
|
|
2671
|
+
provider: aiModelProviderSchema.optional(),
|
|
2672
|
+
baseUrl: trimmedString.optional(),
|
|
2673
|
+
model: nonEmptyTrimmedString,
|
|
2674
|
+
apiKey: trimmedString.optional()
|
|
2675
|
+
});
|
|
2676
|
+
export const submitOpenAiCodexOauthManualCodeSchema = z.object({
|
|
2677
|
+
codeOrUrl: nonEmptyTrimmedString
|
|
2678
|
+
});
|
|
2679
|
+
export const createAiProcessorSchema = z.object({
|
|
2680
|
+
surfaceId: nonEmptyTrimmedString,
|
|
2681
|
+
title: nonEmptyTrimmedString,
|
|
2682
|
+
promptFlow: trimmedString.default(""),
|
|
2683
|
+
contextInput: trimmedString.default(""),
|
|
2684
|
+
toolConfig: z.array(aiProcessorToolSchema).default([]),
|
|
2685
|
+
agentIds: z.array(z.string().trim().min(1)).default([]),
|
|
2686
|
+
agentConfigs: z.array(aiProcessorAgentConfigSchema).default([]),
|
|
2687
|
+
triggerMode: aiProcessorTriggerModeSchema.default("manual"),
|
|
2688
|
+
cronExpression: trimmedString.default(""),
|
|
2689
|
+
machineAccess: aiProcessorMachineAccessSchema.default({
|
|
2690
|
+
read: false,
|
|
2691
|
+
write: false,
|
|
2692
|
+
exec: false
|
|
2693
|
+
}),
|
|
2694
|
+
endpointEnabled: z.boolean().default(true)
|
|
2695
|
+
});
|
|
2696
|
+
export const updateAiProcessorSchema = z.object({
|
|
2697
|
+
title: nonEmptyTrimmedString.optional(),
|
|
2698
|
+
promptFlow: trimmedString.optional(),
|
|
2699
|
+
contextInput: trimmedString.optional(),
|
|
2700
|
+
toolConfig: z.array(aiProcessorToolSchema).optional(),
|
|
2701
|
+
agentIds: z.array(z.string().trim().min(1)).optional(),
|
|
2702
|
+
agentConfigs: z.array(aiProcessorAgentConfigSchema).optional(),
|
|
2703
|
+
triggerMode: aiProcessorTriggerModeSchema.optional(),
|
|
2704
|
+
cronExpression: trimmedString.optional(),
|
|
2705
|
+
machineAccess: aiProcessorMachineAccessSchema.partial().optional(),
|
|
2706
|
+
endpointEnabled: z.boolean().optional()
|
|
2707
|
+
});
|
|
2708
|
+
export const createAiProcessorLinkSchema = z.object({
|
|
2709
|
+
surfaceId: nonEmptyTrimmedString,
|
|
2710
|
+
sourceWidgetId: nonEmptyTrimmedString,
|
|
2711
|
+
targetProcessorId: nonEmptyTrimmedString,
|
|
2712
|
+
accessMode: aiProcessorAccessModeSchema.default("read"),
|
|
2713
|
+
capabilityMode: aiProcessorCapabilityModeSchema.default("content"),
|
|
2714
|
+
metadata: z.record(z.string(), z.unknown()).default({})
|
|
2715
|
+
});
|
|
2716
|
+
export const runAiProcessorSchema = z.object({
|
|
2717
|
+
input: trimmedString.default(""),
|
|
2718
|
+
context: z.record(z.string(), z.unknown()).default({}),
|
|
2719
|
+
widgetSnapshots: z.record(z.string(), z.unknown()).default({})
|
|
2720
|
+
});
|
|
2721
|
+
export const createAiConnectorSchema = z.object({
|
|
2722
|
+
title: nonEmptyTrimmedString,
|
|
2723
|
+
description: trimmedString.default(""),
|
|
2724
|
+
kind: aiConnectorKindSchema.default("functor"),
|
|
2725
|
+
homeSurfaceId: trimmedString.nullable().default(null),
|
|
2726
|
+
endpointEnabled: z.boolean().default(true),
|
|
2727
|
+
graph: z
|
|
2728
|
+
.object({
|
|
2729
|
+
nodes: z.array(aiConnectorNodeSchema).default([]),
|
|
2730
|
+
edges: z.array(aiConnectorEdgeSchema).default([])
|
|
2731
|
+
})
|
|
2732
|
+
.default({ nodes: [], edges: [] })
|
|
2733
|
+
});
|
|
2734
|
+
export const updateAiConnectorSchema = z.object({
|
|
2735
|
+
title: nonEmptyTrimmedString.optional(),
|
|
2736
|
+
description: trimmedString.optional(),
|
|
2737
|
+
kind: aiConnectorKindSchema.optional(),
|
|
2738
|
+
homeSurfaceId: trimmedString.nullable().optional(),
|
|
2739
|
+
endpointEnabled: z.boolean().optional(),
|
|
2740
|
+
graph: z
|
|
2741
|
+
.object({
|
|
2742
|
+
nodes: z.array(aiConnectorNodeSchema).default([]),
|
|
2743
|
+
edges: z.array(aiConnectorEdgeSchema).default([])
|
|
2261
2744
|
})
|
|
2262
2745
|
.optional()
|
|
2263
2746
|
});
|
|
2747
|
+
export const runAiConnectorSchema = z.object({
|
|
2748
|
+
userInput: trimmedString.default(""),
|
|
2749
|
+
context: z.record(z.string(), z.unknown()).default({}),
|
|
2750
|
+
boxSnapshots: z.record(z.string(), z.unknown()).default({}),
|
|
2751
|
+
conversationId: trimmedString.nullable().default(null)
|
|
2752
|
+
});
|
|
2264
2753
|
export const createAgentTokenSchema = z.object({
|
|
2265
2754
|
label: nonEmptyTrimmedString,
|
|
2266
2755
|
agentLabel: nonEmptyTrimmedString.default("Forge Agent"),
|