forge-openclaw-plugin 0.2.26 → 0.2.27
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 +59 -3
- package/dist/assets/{board-ta0rUHOf.js → board-C6jCchjI.js} +2 -2
- package/dist/assets/{board-ta0rUHOf.js.map → board-C6jCchjI.js.map} +1 -1
- package/dist/assets/index-DVvS8iiU.css +1 -0
- package/dist/assets/index-zYB-9Dfo.js +85 -0
- package/dist/assets/index-zYB-9Dfo.js.map +1 -0
- package/dist/assets/knowledge-graph-layout.worker-DRvzPxhP.js +2 -0
- package/dist/assets/knowledge-graph-layout.worker-DRvzPxhP.js.map +1 -0
- package/dist/assets/{motion-fBKPB6yw.js → motion-DFHrH2rd.js} +2 -2
- package/dist/assets/{motion-fBKPB6yw.js.map → motion-DFHrH2rd.js.map} +1 -1
- package/dist/assets/{table-C-IGTQni.js → table-ZL7Di_u3.js} +2 -2
- package/dist/assets/{table-C-IGTQni.js.map → table-ZL7Di_u3.js.map} +1 -1
- package/dist/assets/{ui-DInOpaYF.js → ui-CKNPpz7q.js} +2 -2
- package/dist/assets/{ui-DInOpaYF.js.map → ui-CKNPpz7q.js.map} +1 -1
- package/dist/assets/vendor-DoNZuFhn.js +1247 -0
- package/dist/assets/vendor-DoNZuFhn.js.map +1 -0
- package/dist/index.html +7 -7
- package/dist/openclaw/local-runtime.js +16 -0
- package/dist/openclaw/routes.d.ts +27 -0
- package/dist/openclaw/routes.js +16 -12
- package/dist/server/server/migrations/037_workbench_public_inputs_and_run_inputs.sql +5 -0
- package/dist/server/server/migrations/038_data_management_settings.sql +11 -0
- package/dist/server/server/migrations/039_life_force_and_action_points.sql +114 -0
- package/dist/server/server/migrations/040_screen_time_domain.sql +89 -0
- package/dist/server/server/migrations/041_companion_source_states.sql +21 -0
- package/dist/server/server/migrations/042_movement_boxes.sql +47 -0
- package/dist/server/server/migrations/043_movement_box_overlap_overrides.sql +26 -0
- package/dist/server/server/src/app.js +1684 -117
- package/dist/server/server/src/connectors/box-registry.js +44 -9
- package/dist/server/server/src/data-management-types.js +107 -0
- package/dist/server/server/src/db.js +68 -4
- package/dist/server/server/src/demo-data.js +2 -2
- package/dist/server/server/src/health.js +702 -18
- package/dist/server/server/src/managers/platform/llm-manager.js +7 -4
- package/dist/server/server/src/managers/platform/mock-workbench-provider.js +149 -0
- package/dist/server/server/src/managers/platform/secrets-manager.js +18 -1
- package/dist/server/server/src/managers/runtime.js +9 -0
- package/dist/server/server/src/movement.js +1971 -112
- package/dist/server/server/src/openapi.js +489 -1
- package/dist/server/server/src/psyche-types.js +9 -1
- package/dist/server/server/src/repositories/activity-events.js +8 -0
- package/dist/server/server/src/repositories/ai-connectors.js +522 -74
- package/dist/server/server/src/repositories/habits.js +37 -1
- package/dist/server/server/src/repositories/model-settings.js +13 -3
- package/dist/server/server/src/repositories/notes.js +3 -0
- package/dist/server/server/src/repositories/settings.js +380 -18
- package/dist/server/server/src/repositories/tasks.js +170 -10
- package/dist/server/server/src/runtime-data-root.js +82 -0
- package/dist/server/server/src/screen-time.js +802 -0
- package/dist/server/server/src/services/data-management.js +788 -0
- package/dist/server/server/src/services/entity-crud.js +205 -2
- package/dist/server/server/src/services/knowledge-graph.js +1455 -0
- package/dist/server/server/src/services/life-force-model.js +197 -0
- package/dist/server/server/src/services/life-force.js +1270 -0
- package/dist/server/server/src/services/psyche-observation-calendar.js +383 -16
- package/dist/server/server/src/types.js +286 -13
- package/dist/server/server/src/web.js +228 -13
- package/dist/server/src/components/customization/utility-widgets.js +136 -27
- package/dist/server/src/components/ui/info-tooltip.js +25 -0
- package/dist/server/src/components/workbench-boxes/calendar/calendar-boxes.js +78 -0
- package/dist/server/src/components/workbench-boxes/goals/goals-boxes.js +62 -0
- package/dist/server/src/components/workbench-boxes/habits/habits-boxes.js +62 -0
- package/dist/server/src/components/workbench-boxes/health/health-boxes.js +63 -8
- package/dist/server/src/components/workbench-boxes/insights/insights-boxes.js +50 -0
- package/dist/server/src/components/workbench-boxes/kanban/kanban-boxes.js +62 -54
- package/dist/server/src/components/workbench-boxes/movement/movement-boxes.js +18 -8
- package/dist/server/src/components/workbench-boxes/notes/notes-boxes.js +56 -38
- package/dist/server/src/components/workbench-boxes/overview/overview-boxes.js +65 -0
- package/dist/server/src/components/workbench-boxes/preferences/preferences-boxes.js +78 -0
- package/dist/server/src/components/workbench-boxes/projects/projects-boxes.js +35 -30
- package/dist/server/src/components/workbench-boxes/psyche/psyche-boxes.js +88 -0
- package/dist/server/src/components/workbench-boxes/questionnaires/questionnaires-boxes.js +61 -0
- package/dist/server/src/components/workbench-boxes/review/review-boxes.js +53 -0
- package/dist/server/src/components/workbench-boxes/shared/define-workbench-box.js +3 -1
- package/dist/server/src/components/workbench-boxes/shared/generic-node-view.js +39 -3
- package/dist/server/src/components/workbench-boxes/strategies/strategies-boxes.js +62 -0
- package/dist/server/src/components/workbench-boxes/tasks/tasks-boxes.js +76 -0
- package/dist/server/src/components/workbench-boxes/today/today-boxes.js +47 -32
- package/dist/server/src/components/workbench-boxes/wiki/wiki-boxes.js +60 -0
- package/dist/server/src/lib/api.js +280 -21
- package/dist/server/src/lib/data-management-types.js +1 -0
- package/dist/server/src/lib/entity-visuals.js +279 -0
- package/dist/server/src/lib/knowledge-graph-types.js +276 -0
- package/dist/server/src/lib/knowledge-graph.js +470 -0
- package/dist/server/src/lib/schemas.js +4 -0
- package/dist/server/src/lib/snapshot-normalizer.js +43 -1
- package/dist/server/src/lib/workbench/contracts.js +229 -0
- package/dist/server/src/lib/workbench/nodes.js +200 -0
- package/dist/server/src/lib/workbench/registry.js +52 -5
- package/dist/server/src/lib/workbench/runtime.js +254 -38
- package/dist/server/src/lib/workbench/tool-catalog.js +68 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server/migrations/037_workbench_public_inputs_and_run_inputs.sql +5 -0
- package/server/migrations/038_data_management_settings.sql +11 -0
- package/server/migrations/039_life_force_and_action_points.sql +114 -0
- package/server/migrations/040_screen_time_domain.sql +89 -0
- package/server/migrations/041_companion_source_states.sql +21 -0
- package/server/migrations/042_movement_boxes.sql +47 -0
- package/server/migrations/043_movement_box_overlap_overrides.sql +26 -0
- package/skills/forge-openclaw/SKILL.md +24 -11
- package/skills/forge-openclaw/entity_conversation_playbooks.md +210 -34
- package/skills/forge-openclaw/psyche_entity_playbooks.md +113 -17
- package/dist/assets/index-Ro0ZF_az.css +0 -1
- package/dist/assets/index-ytlpSj23.js +0 -79
- package/dist/assets/index-ytlpSj23.js.map +0 -1
- package/dist/assets/vendor-lE3tZJcC.js +0 -876
- package/dist/assets/vendor-lE3tZJcC.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { LEGACY_WORKBENCH_PORT_KINDS, WORKBENCH_PORT_KINDS, normalizeWorkbenchPortKind } from "../../src/lib/workbench/nodes.js";
|
|
2
3
|
export const taskStatusSchema = z.enum([
|
|
3
4
|
"backlog",
|
|
4
5
|
"focus",
|
|
@@ -33,6 +34,13 @@ export const habitFrequencySchema = z.enum(["daily", "weekly"]);
|
|
|
33
34
|
export const habitPolaritySchema = z.enum(["positive", "negative"]);
|
|
34
35
|
export const habitStatusSchema = z.enum(["active", "paused", "archived"]);
|
|
35
36
|
export const habitCheckInStatusSchema = z.enum(["done", "missed"]);
|
|
37
|
+
export const habitOrderBySchema = z.enum([
|
|
38
|
+
"needs_attention",
|
|
39
|
+
"name",
|
|
40
|
+
"streak",
|
|
41
|
+
"created_at",
|
|
42
|
+
"updated_at"
|
|
43
|
+
]);
|
|
36
44
|
export const calendarProviderSchema = z.enum([
|
|
37
45
|
"google",
|
|
38
46
|
"apple",
|
|
@@ -79,6 +87,35 @@ export const calendarTimeboxSourceSchema = z.enum([
|
|
|
79
87
|
"live_run"
|
|
80
88
|
]);
|
|
81
89
|
export const workAdjustmentEntityTypeSchema = z.enum(["task", "project"]);
|
|
90
|
+
export const taskResolutionKindSchema = z.enum(["completed", "split"]);
|
|
91
|
+
export const actionProfileModeSchema = z.enum([
|
|
92
|
+
"impulse",
|
|
93
|
+
"rate",
|
|
94
|
+
"hybrid",
|
|
95
|
+
"recovery",
|
|
96
|
+
"container"
|
|
97
|
+
]);
|
|
98
|
+
export const actionProfileSourceMethodSchema = z.enum([
|
|
99
|
+
"seeded",
|
|
100
|
+
"inferred",
|
|
101
|
+
"manual",
|
|
102
|
+
"learned"
|
|
103
|
+
]);
|
|
104
|
+
export const actionCostBandSchema = z.enum([
|
|
105
|
+
"tiny",
|
|
106
|
+
"light",
|
|
107
|
+
"standard",
|
|
108
|
+
"heavy",
|
|
109
|
+
"brutal"
|
|
110
|
+
]);
|
|
111
|
+
export const lifeForceStatKeySchema = z.enum([
|
|
112
|
+
"life_force",
|
|
113
|
+
"activation",
|
|
114
|
+
"focus",
|
|
115
|
+
"vigor",
|
|
116
|
+
"composure",
|
|
117
|
+
"flow"
|
|
118
|
+
]);
|
|
82
119
|
export const activityEntityTypeSchema = z.enum([
|
|
83
120
|
"task",
|
|
84
121
|
"habit",
|
|
@@ -115,7 +152,9 @@ export const activityEntityTypeSchema = z.enum([
|
|
|
115
152
|
"calendar_event",
|
|
116
153
|
"work_block",
|
|
117
154
|
"work_block_template",
|
|
118
|
-
"task_timebox"
|
|
155
|
+
"task_timebox",
|
|
156
|
+
"sleep_session",
|
|
157
|
+
"workout_session"
|
|
119
158
|
]);
|
|
120
159
|
export const activitySourceSchema = z.enum([
|
|
121
160
|
"ui",
|
|
@@ -123,12 +162,18 @@ export const activitySourceSchema = z.enum([
|
|
|
123
162
|
"agent",
|
|
124
163
|
"system"
|
|
125
164
|
]);
|
|
126
|
-
export const diagnosticLogLevelSchema = z.
|
|
165
|
+
export const diagnosticLogLevelSchema = z.preprocess((value) => {
|
|
166
|
+
if (typeof value !== "string") {
|
|
167
|
+
return value;
|
|
168
|
+
}
|
|
169
|
+
const normalized = value.trim().toLowerCase();
|
|
170
|
+
return normalized === "warn" ? "warning" : normalized;
|
|
171
|
+
}, z.enum([
|
|
127
172
|
"debug",
|
|
128
173
|
"info",
|
|
129
174
|
"warning",
|
|
130
175
|
"error"
|
|
131
|
-
]);
|
|
176
|
+
]));
|
|
132
177
|
export const diagnosticLogSourceSchema = z.enum([
|
|
133
178
|
"ui",
|
|
134
179
|
"openclaw",
|
|
@@ -210,7 +255,9 @@ export const crudEntityTypeSchema = z.enum([
|
|
|
210
255
|
"preference_catalog_item",
|
|
211
256
|
"preference_context",
|
|
212
257
|
"preference_item",
|
|
213
|
-
"questionnaire_instrument"
|
|
258
|
+
"questionnaire_instrument",
|
|
259
|
+
"sleep_session",
|
|
260
|
+
"workout_session"
|
|
214
261
|
]);
|
|
215
262
|
export const rewardableEntityTypeSchema = z.enum([
|
|
216
263
|
"system",
|
|
@@ -447,6 +494,108 @@ export const workAdjustmentResultSchema = z.object({
|
|
|
447
494
|
reward: z.lazy(() => rewardLedgerEventSchema).nullable(),
|
|
448
495
|
metrics: z.lazy(() => xpMetricsPayloadSchema)
|
|
449
496
|
});
|
|
497
|
+
export const actionDemandWeightsSchema = z.object({
|
|
498
|
+
activation: z.number().min(0).max(1),
|
|
499
|
+
focus: z.number().min(0).max(1),
|
|
500
|
+
vigor: z.number().min(0).max(1),
|
|
501
|
+
composure: z.number().min(0).max(1),
|
|
502
|
+
flow: z.number().min(0).max(1)
|
|
503
|
+
});
|
|
504
|
+
export const actionProfileSchema = z.object({
|
|
505
|
+
id: z.string(),
|
|
506
|
+
profileKey: nonEmptyTrimmedString,
|
|
507
|
+
title: nonEmptyTrimmedString,
|
|
508
|
+
entityType: trimmedString.nullable().default(null),
|
|
509
|
+
mode: actionProfileModeSchema,
|
|
510
|
+
startupAp: z.number().min(0).default(0),
|
|
511
|
+
totalCostAp: z.number().min(0).default(0),
|
|
512
|
+
expectedDurationSeconds: z.number().int().positive().nullable().default(null),
|
|
513
|
+
sustainRateApPerHour: z.number().min(0).default(0),
|
|
514
|
+
demandWeights: actionDemandWeightsSchema,
|
|
515
|
+
doubleCountPolicy: z.enum([
|
|
516
|
+
"primary_only",
|
|
517
|
+
"secondary_weighted",
|
|
518
|
+
"always_count",
|
|
519
|
+
"container_only"
|
|
520
|
+
]),
|
|
521
|
+
sourceMethod: actionProfileSourceMethodSchema,
|
|
522
|
+
costBand: actionCostBandSchema.default("standard"),
|
|
523
|
+
recoveryEffect: z.number().default(0),
|
|
524
|
+
metadata: z.record(z.string(), z.unknown()).default({}),
|
|
525
|
+
createdAt: z.string(),
|
|
526
|
+
updatedAt: z.string()
|
|
527
|
+
});
|
|
528
|
+
export const taskActionPointSummarySchema = z.object({
|
|
529
|
+
costBand: actionCostBandSchema,
|
|
530
|
+
totalCostAp: z.number().min(0),
|
|
531
|
+
expectedDurationSeconds: z.number().int().positive(),
|
|
532
|
+
sustainRateApPerHour: z.number().min(0),
|
|
533
|
+
spentTodayAp: z.number().min(0),
|
|
534
|
+
spentTotalAp: z.number().min(0),
|
|
535
|
+
remainingAp: z.number().min(0)
|
|
536
|
+
});
|
|
537
|
+
export const taskSplitSuggestionSchema = z.object({
|
|
538
|
+
shouldSplit: z.boolean(),
|
|
539
|
+
reason: trimmedString.nullable().default(null),
|
|
540
|
+
thresholdSeconds: z.number().int().positive()
|
|
541
|
+
});
|
|
542
|
+
export const lifeForceStatStateSchema = z.object({
|
|
543
|
+
key: lifeForceStatKeySchema,
|
|
544
|
+
label: nonEmptyTrimmedString,
|
|
545
|
+
level: z.number().int().min(1),
|
|
546
|
+
xp: z.number().min(0),
|
|
547
|
+
xpToNextLevel: z.number().min(0),
|
|
548
|
+
costModifier: z.number().min(0)
|
|
549
|
+
});
|
|
550
|
+
export const lifeForceCurvePointSchema = z.object({
|
|
551
|
+
minuteOfDay: z.number().int().min(0).max(24 * 60),
|
|
552
|
+
rateApPerHour: z.number().min(0),
|
|
553
|
+
locked: z.boolean().optional()
|
|
554
|
+
});
|
|
555
|
+
export const lifeForceDrainEntrySchema = z.object({
|
|
556
|
+
id: z.string(),
|
|
557
|
+
sourceType: nonEmptyTrimmedString,
|
|
558
|
+
sourceId: nonEmptyTrimmedString,
|
|
559
|
+
title: nonEmptyTrimmedString,
|
|
560
|
+
role: z.enum(["primary", "secondary", "background", "recovery"]),
|
|
561
|
+
apPerHour: z.number(),
|
|
562
|
+
instantAp: z.number(),
|
|
563
|
+
why: trimmedString.default(""),
|
|
564
|
+
startedAt: z.string().nullable().default(null),
|
|
565
|
+
endsAt: z.string().nullable().default(null)
|
|
566
|
+
});
|
|
567
|
+
export const lifeForceWarningSchema = z.object({
|
|
568
|
+
id: z.string(),
|
|
569
|
+
tone: z.enum(["info", "warning", "danger", "success"]),
|
|
570
|
+
title: nonEmptyTrimmedString,
|
|
571
|
+
detail: trimmedString.default("")
|
|
572
|
+
});
|
|
573
|
+
export const lifeForcePayloadSchema = z.object({
|
|
574
|
+
userId: z.string(),
|
|
575
|
+
dateKey: dateOnlySchema,
|
|
576
|
+
baselineDailyAp: z.number().min(0),
|
|
577
|
+
dailyBudgetAp: z.number().min(0),
|
|
578
|
+
spentTodayAp: z.number(),
|
|
579
|
+
remainingAp: z.number(),
|
|
580
|
+
forecastAp: z.number(),
|
|
581
|
+
targetBandMinAp: z.number().min(0),
|
|
582
|
+
targetBandMaxAp: z.number().min(0),
|
|
583
|
+
instantCapacityApPerHour: z.number().min(0),
|
|
584
|
+
instantFreeApPerHour: z.number(),
|
|
585
|
+
overloadApPerHour: z.number().min(0),
|
|
586
|
+
currentDrainApPerHour: z.number().min(0),
|
|
587
|
+
fatigueBufferApPerHour: z.number().min(0),
|
|
588
|
+
sleepRecoveryMultiplier: z.number().min(0),
|
|
589
|
+
readinessMultiplier: z.number().min(0),
|
|
590
|
+
fatigueDebtCarry: z.number().min(0),
|
|
591
|
+
stats: z.array(lifeForceStatStateSchema),
|
|
592
|
+
currentCurve: z.array(lifeForceCurvePointSchema),
|
|
593
|
+
activeDrains: z.array(lifeForceDrainEntrySchema),
|
|
594
|
+
warnings: z.array(lifeForceWarningSchema),
|
|
595
|
+
recommendations: z.array(trimmedString),
|
|
596
|
+
topTaskIdsNeedingSplit: z.array(z.string()),
|
|
597
|
+
updatedAt: z.string()
|
|
598
|
+
});
|
|
450
599
|
export const noteLinkSchema = z.object({
|
|
451
600
|
entityType: crudEntityTypeSchema,
|
|
452
601
|
entityId: nonEmptyTrimmedString,
|
|
@@ -558,10 +707,12 @@ export const taskSchema = z.object({
|
|
|
558
707
|
.number()
|
|
559
708
|
.int()
|
|
560
709
|
.min(60)
|
|
561
|
-
.max(86_400)
|
|
710
|
+
.max(7 * 86_400)
|
|
562
711
|
.nullable()
|
|
563
|
-
.default(
|
|
712
|
+
.default(86_400),
|
|
564
713
|
schedulingRules: calendarSchedulingRulesSchema.nullable().default(null),
|
|
714
|
+
resolutionKind: taskResolutionKindSchema.nullable().default(null),
|
|
715
|
+
splitParentTaskId: z.string().nullable().default(null),
|
|
565
716
|
completedAt: z.string().nullable(),
|
|
566
717
|
createdAt: z.string(),
|
|
567
718
|
updatedAt: z.string(),
|
|
@@ -576,6 +727,20 @@ export const taskSchema = z.object({
|
|
|
576
727
|
activeRunCount: 0,
|
|
577
728
|
hasCurrentRun: false,
|
|
578
729
|
currentRunId: null
|
|
730
|
+
}),
|
|
731
|
+
actionPointSummary: taskActionPointSummarySchema.default({
|
|
732
|
+
costBand: "standard",
|
|
733
|
+
totalCostAp: 100,
|
|
734
|
+
expectedDurationSeconds: 86_400,
|
|
735
|
+
sustainRateApPerHour: 100 / 24,
|
|
736
|
+
spentTodayAp: 0,
|
|
737
|
+
spentTotalAp: 0,
|
|
738
|
+
remainingAp: 100
|
|
739
|
+
}),
|
|
740
|
+
splitSuggestion: taskSplitSuggestionSchema.default({
|
|
741
|
+
shouldSplit: false,
|
|
742
|
+
reason: null,
|
|
743
|
+
thresholdSeconds: 2 * 86_400
|
|
579
744
|
})
|
|
580
745
|
});
|
|
581
746
|
export const taskRunSchema = z.object({
|
|
@@ -1273,7 +1438,8 @@ export const googleCalendarAuthSettingsSchema = z.object({
|
|
|
1273
1438
|
export const aiModelProviderSchema = z.enum([
|
|
1274
1439
|
"openai-api",
|
|
1275
1440
|
"openai-codex",
|
|
1276
|
-
"openai-compatible"
|
|
1441
|
+
"openai-compatible",
|
|
1442
|
+
"mock"
|
|
1277
1443
|
]);
|
|
1278
1444
|
export const aiModelAuthModeSchema = z.enum(["api_key", "oauth"]);
|
|
1279
1445
|
export const aiModelConnectionStatusSchema = z.enum([
|
|
@@ -1435,14 +1601,39 @@ export const forgeBoxToolAdapterSchema = z.object({
|
|
|
1435
1601
|
key: nonEmptyTrimmedString,
|
|
1436
1602
|
label: nonEmptyTrimmedString,
|
|
1437
1603
|
description: trimmedString.default(""),
|
|
1438
|
-
accessMode: aiProcessorAccessModeSchema.default("read")
|
|
1604
|
+
accessMode: aiProcessorAccessModeSchema.default("read"),
|
|
1605
|
+
argsSchema: z.record(z.string(), z.unknown()).optional()
|
|
1606
|
+
});
|
|
1607
|
+
const workbenchPortKindSchema = z
|
|
1608
|
+
.enum([...WORKBENCH_PORT_KINDS, ...LEGACY_WORKBENCH_PORT_KINDS])
|
|
1609
|
+
.transform((value) => normalizeWorkbenchPortKind({ kind: value }));
|
|
1610
|
+
export const forgeBoxPortShapeFieldSchema = z.object({
|
|
1611
|
+
key: nonEmptyTrimmedString,
|
|
1612
|
+
label: nonEmptyTrimmedString,
|
|
1613
|
+
kind: workbenchPortKindSchema.default("record"),
|
|
1614
|
+
description: trimmedString.optional(),
|
|
1615
|
+
required: z.boolean().default(false)
|
|
1439
1616
|
});
|
|
1440
1617
|
export const forgeBoxPortDefinitionSchema = z.object({
|
|
1441
1618
|
key: nonEmptyTrimmedString,
|
|
1442
1619
|
label: nonEmptyTrimmedString,
|
|
1443
|
-
kind:
|
|
1620
|
+
kind: workbenchPortKindSchema.default("record"),
|
|
1621
|
+
description: trimmedString.optional(),
|
|
1444
1622
|
required: z.boolean().default(false),
|
|
1445
|
-
expandableKeys: z.array(nonEmptyTrimmedString).default([])
|
|
1623
|
+
expandableKeys: z.array(nonEmptyTrimmedString).default([]),
|
|
1624
|
+
modelName: trimmedString.optional(),
|
|
1625
|
+
itemKind: trimmedString.optional(),
|
|
1626
|
+
shape: z.array(forgeBoxPortShapeFieldSchema).default([]),
|
|
1627
|
+
exampleValue: trimmedString.optional()
|
|
1628
|
+
});
|
|
1629
|
+
export const aiConnectorPublicInputBindingSchema = z.object({
|
|
1630
|
+
nodeId: nonEmptyTrimmedString,
|
|
1631
|
+
targetKey: nonEmptyTrimmedString,
|
|
1632
|
+
targetKind: z.enum(["input", "param"]).default("input")
|
|
1633
|
+
});
|
|
1634
|
+
export const aiConnectorPublicInputSchema = forgeBoxPortDefinitionSchema.extend({
|
|
1635
|
+
defaultValue: z.unknown().optional(),
|
|
1636
|
+
bindings: z.array(aiConnectorPublicInputBindingSchema).default([])
|
|
1446
1637
|
});
|
|
1447
1638
|
export const forgeBoxCatalogEntrySchema = z.object({
|
|
1448
1639
|
id: nonEmptyTrimmedString,
|
|
@@ -1543,6 +1734,30 @@ export const aiConnectorRunResultSchema = z.object({
|
|
|
1543
1734
|
text: z.string(),
|
|
1544
1735
|
json: z.record(z.string(), z.unknown()).nullable()
|
|
1545
1736
|
})),
|
|
1737
|
+
nodeResults: z
|
|
1738
|
+
.array(z.object({
|
|
1739
|
+
nodeId: nonEmptyTrimmedString,
|
|
1740
|
+
nodeType: aiConnectorNodeTypeSchema,
|
|
1741
|
+
label: nonEmptyTrimmedString,
|
|
1742
|
+
input: z.array(z.object({
|
|
1743
|
+
sourceNodeId: nonEmptyTrimmedString,
|
|
1744
|
+
sourceHandle: trimmedString.nullable(),
|
|
1745
|
+
targetHandle: trimmedString.nullable(),
|
|
1746
|
+
text: z.string(),
|
|
1747
|
+
json: z.record(z.string(), z.unknown()).nullable()
|
|
1748
|
+
})),
|
|
1749
|
+
primaryText: z.string(),
|
|
1750
|
+
payload: z.record(z.string(), z.unknown()).nullable(),
|
|
1751
|
+
outputMap: z.record(z.string(), z.object({
|
|
1752
|
+
text: z.string(),
|
|
1753
|
+
json: z.record(z.string(), z.unknown()).nullable()
|
|
1754
|
+
})),
|
|
1755
|
+
tools: z.array(z.string()).default([]),
|
|
1756
|
+
logs: z.array(z.string()).default([]),
|
|
1757
|
+
error: z.string().nullable(),
|
|
1758
|
+
timingMs: z.number().int().nonnegative().nullable().optional()
|
|
1759
|
+
}))
|
|
1760
|
+
.default([]),
|
|
1546
1761
|
debugTrace: z
|
|
1547
1762
|
.object({
|
|
1548
1763
|
nodes: z.array(z.object({
|
|
@@ -1574,6 +1789,7 @@ export const aiConnectorRunSchema = z.object({
|
|
|
1574
1789
|
mode: z.enum(["run", "chat"]),
|
|
1575
1790
|
status: z.enum(["running", "completed", "failed"]),
|
|
1576
1791
|
userInput: z.string(),
|
|
1792
|
+
inputs: z.record(z.string(), z.unknown()).default({}),
|
|
1577
1793
|
context: z.record(z.string(), z.unknown()).default({}),
|
|
1578
1794
|
conversationId: trimmedString.nullable(),
|
|
1579
1795
|
result: aiConnectorRunResultSchema.nullable(),
|
|
@@ -1606,6 +1822,7 @@ export const aiConnectorSchema = z.object({
|
|
|
1606
1822
|
nodes: z.array(aiConnectorNodeSchema).default([]),
|
|
1607
1823
|
edges: z.array(aiConnectorEdgeSchema).default([])
|
|
1608
1824
|
}),
|
|
1825
|
+
publicInputs: z.array(aiConnectorPublicInputSchema).default([]),
|
|
1609
1826
|
publishedOutputs: z.array(aiConnectorOutputSchema).default([]),
|
|
1610
1827
|
lastRun: aiConnectorRunSchema.nullable(),
|
|
1611
1828
|
legacyProcessorId: trimmedString.nullable().default(null),
|
|
@@ -2061,6 +2278,8 @@ export const activityListQuerySchema = z.object({
|
|
|
2061
2278
|
entityType: activityEntityTypeSchema.optional(),
|
|
2062
2279
|
entityId: nonEmptyTrimmedString.optional(),
|
|
2063
2280
|
source: activitySourceSchema.optional(),
|
|
2281
|
+
from: flexibleCalendarQueryDateSchema.optional(),
|
|
2282
|
+
to: flexibleCalendarQueryDateSchema.optional(),
|
|
2064
2283
|
includeCorrected: z.coerce.boolean().optional(),
|
|
2065
2284
|
userIds: repeatedTrimmedStringQuerySchema.optional(),
|
|
2066
2285
|
limit: z.coerce.number().int().positive().max(100).optional()
|
|
@@ -2083,6 +2302,23 @@ export const calendarOverviewQuerySchema = z.object({
|
|
|
2083
2302
|
to: flexibleCalendarQueryDateSchema.optional(),
|
|
2084
2303
|
userIds: repeatedTrimmedStringQuerySchema.optional()
|
|
2085
2304
|
});
|
|
2305
|
+
export const psycheObservationCalendarExportFormatSchema = z.enum([
|
|
2306
|
+
"json",
|
|
2307
|
+
"csv",
|
|
2308
|
+
"markdown",
|
|
2309
|
+
"ics"
|
|
2310
|
+
]);
|
|
2311
|
+
export const psycheObservationCalendarExportQuerySchema = z.object({
|
|
2312
|
+
from: flexibleCalendarQueryDateSchema.optional(),
|
|
2313
|
+
to: flexibleCalendarQueryDateSchema.optional(),
|
|
2314
|
+
userIds: repeatedTrimmedStringQuerySchema.optional(),
|
|
2315
|
+
tags: repeatedTrimmedStringQuerySchema.optional(),
|
|
2316
|
+
includeObservations: z.coerce.boolean().optional(),
|
|
2317
|
+
includeActivity: z.coerce.boolean().optional(),
|
|
2318
|
+
onlyHumanOwned: z.coerce.boolean().optional(),
|
|
2319
|
+
search: trimmedString.optional(),
|
|
2320
|
+
format: psycheObservationCalendarExportFormatSchema.default("markdown")
|
|
2321
|
+
});
|
|
2086
2322
|
export const createCalendarConnectionSchema = z.discriminatedUnion("provider", [
|
|
2087
2323
|
z.object({
|
|
2088
2324
|
provider: z.literal("google"),
|
|
@@ -2369,6 +2605,7 @@ export const habitListQuerySchema = z.object({
|
|
|
2369
2605
|
status: habitStatusSchema.optional(),
|
|
2370
2606
|
polarity: habitPolaritySchema.optional(),
|
|
2371
2607
|
dueToday: z.coerce.boolean().optional(),
|
|
2608
|
+
orderBy: habitOrderBySchema.optional(),
|
|
2372
2609
|
userIds: repeatedTrimmedStringQuerySchema.optional(),
|
|
2373
2610
|
limit: z.coerce.number().int().positive().max(100).optional()
|
|
2374
2611
|
});
|
|
@@ -2441,12 +2678,13 @@ export const taskMutationShape = {
|
|
|
2441
2678
|
.number()
|
|
2442
2679
|
.int()
|
|
2443
2680
|
.min(60)
|
|
2444
|
-
.max(86_400)
|
|
2681
|
+
.max(7 * 86_400)
|
|
2445
2682
|
.nullable()
|
|
2446
|
-
.default(
|
|
2683
|
+
.default(86_400),
|
|
2447
2684
|
schedulingRules: calendarSchedulingRulesSchema.nullable().default(null),
|
|
2448
2685
|
sortOrder: z.number().int().nonnegative().optional(),
|
|
2449
2686
|
tagIds: uniqueStringArraySchema.default([]),
|
|
2687
|
+
actionCostBand: actionCostBandSchema.default("standard"),
|
|
2450
2688
|
notes: z.array(nestedCreateNoteSchema).default([])
|
|
2451
2689
|
};
|
|
2452
2690
|
export const createTaskSchema = z.object(taskMutationShape);
|
|
@@ -2589,14 +2827,44 @@ export const updateTaskSchema = z.object({
|
|
|
2589
2827
|
.number()
|
|
2590
2828
|
.int()
|
|
2591
2829
|
.min(60)
|
|
2592
|
-
.max(86_400)
|
|
2830
|
+
.max(7 * 86_400)
|
|
2593
2831
|
.nullable()
|
|
2594
2832
|
.optional(),
|
|
2595
2833
|
schedulingRules: calendarSchedulingRulesSchema.nullable().optional(),
|
|
2834
|
+
resolutionKind: taskResolutionKindSchema.nullable().optional(),
|
|
2835
|
+
splitParentTaskId: z.string().nullable().optional(),
|
|
2836
|
+
enforceTodayWorkLog: z.boolean().optional(),
|
|
2837
|
+
completedTodayWorkSeconds: z
|
|
2838
|
+
.number()
|
|
2839
|
+
.int()
|
|
2840
|
+
.min(0)
|
|
2841
|
+
.max(7 * 86_400)
|
|
2842
|
+
.optional(),
|
|
2843
|
+
actionCostBand: actionCostBandSchema.optional(),
|
|
2596
2844
|
sortOrder: z.number().int().nonnegative().optional(),
|
|
2597
2845
|
tagIds: uniqueStringArraySchema.optional(),
|
|
2598
2846
|
notes: z.array(nestedCreateNoteSchema).optional()
|
|
2599
2847
|
});
|
|
2848
|
+
export const lifeForceProfilePatchSchema = z.object({
|
|
2849
|
+
baseDailyAp: z.number().int().min(50).max(500).optional(),
|
|
2850
|
+
readinessMultiplier: z.number().min(0.5).max(1.5).optional(),
|
|
2851
|
+
stats: z
|
|
2852
|
+
.record(lifeForceStatKeySchema, z.number().int().min(1).max(100))
|
|
2853
|
+
.optional()
|
|
2854
|
+
});
|
|
2855
|
+
export const lifeForceTemplateUpdateSchema = z.object({
|
|
2856
|
+
points: z.array(lifeForceCurvePointSchema).min(2)
|
|
2857
|
+
});
|
|
2858
|
+
export const fatigueSignalCreateSchema = z.object({
|
|
2859
|
+
signalType: z.enum(["tired", "okay_again"]),
|
|
2860
|
+
observedAt: dateTimeSchema.optional(),
|
|
2861
|
+
note: trimmedString.optional()
|
|
2862
|
+
});
|
|
2863
|
+
export const taskSplitCreateSchema = z.object({
|
|
2864
|
+
firstTitle: nonEmptyTrimmedString,
|
|
2865
|
+
secondTitle: nonEmptyTrimmedString,
|
|
2866
|
+
remainingRatio: z.number().min(0.1).max(0.9).default(0.5)
|
|
2867
|
+
});
|
|
2600
2868
|
export const tagSuggestionRequestSchema = z.object({
|
|
2601
2869
|
title: trimmedString.default(""),
|
|
2602
2870
|
description: trimmedString.default(""),
|
|
@@ -2757,6 +3025,7 @@ export const upsertAiModelConnectionSchema = z
|
|
|
2757
3025
|
.superRefine((value, context) => {
|
|
2758
3026
|
const authMode = value.authMode ??
|
|
2759
3027
|
(value.provider === "openai-codex" ? "oauth" : "api_key");
|
|
3028
|
+
const isMockProvider = value.provider === "mock";
|
|
2760
3029
|
if (value.provider === "openai-codex" && authMode !== "oauth") {
|
|
2761
3030
|
context.addIssue({
|
|
2762
3031
|
code: z.ZodIssueCode.custom,
|
|
@@ -2765,6 +3034,7 @@ export const upsertAiModelConnectionSchema = z
|
|
|
2765
3034
|
});
|
|
2766
3035
|
}
|
|
2767
3036
|
if (authMode === "api_key" &&
|
|
3037
|
+
!isMockProvider &&
|
|
2768
3038
|
!value.id?.trim() &&
|
|
2769
3039
|
!value.apiKey?.trim()) {
|
|
2770
3040
|
context.addIssue({
|
|
@@ -2841,6 +3111,7 @@ export const createAiConnectorSchema = z.object({
|
|
|
2841
3111
|
kind: aiConnectorKindSchema.default("functor"),
|
|
2842
3112
|
homeSurfaceId: trimmedString.nullable().default(null),
|
|
2843
3113
|
endpointEnabled: z.boolean().default(true),
|
|
3114
|
+
publicInputs: z.array(aiConnectorPublicInputSchema).default([]),
|
|
2844
3115
|
graph: z
|
|
2845
3116
|
.object({
|
|
2846
3117
|
nodes: z.array(aiConnectorNodeSchema).default([]),
|
|
@@ -2854,6 +3125,7 @@ export const updateAiConnectorSchema = z.object({
|
|
|
2854
3125
|
kind: aiConnectorKindSchema.optional(),
|
|
2855
3126
|
homeSurfaceId: trimmedString.nullable().optional(),
|
|
2856
3127
|
endpointEnabled: z.boolean().optional(),
|
|
3128
|
+
publicInputs: z.array(aiConnectorPublicInputSchema).optional(),
|
|
2857
3129
|
graph: z
|
|
2858
3130
|
.object({
|
|
2859
3131
|
nodes: z.array(aiConnectorNodeSchema).default([]),
|
|
@@ -2863,6 +3135,7 @@ export const updateAiConnectorSchema = z.object({
|
|
|
2863
3135
|
});
|
|
2864
3136
|
export const runAiConnectorSchema = z.object({
|
|
2865
3137
|
userInput: trimmedString.default(""),
|
|
3138
|
+
inputs: z.record(z.string(), z.unknown()).default({}),
|
|
2866
3139
|
context: z.record(z.string(), z.unknown()).default({}),
|
|
2867
3140
|
boxSnapshots: z.record(z.string(), z.unknown()).default({}),
|
|
2868
3141
|
conversationId: trimmedString.nullable().default(null),
|