forge-openclaw-plugin 0.2.26 → 0.2.28
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 +60 -3
- package/dist/assets/{board-ta0rUHOf.js → board-DPFvZf-D.js} +2 -2
- package/dist/assets/{board-ta0rUHOf.js.map → board-DPFvZf-D.js.map} +1 -1
- package/dist/assets/index-Auw3JrdE.css +1 -0
- package/dist/assets/index-D1H7myQH.js +85 -0
- package/dist/assets/index-D1H7myQH.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-Bvwc85ch.js} +2 -2
- package/dist/assets/{motion-fBKPB6yw.js.map → motion-Bvwc85ch.js.map} +1 -1
- package/dist/assets/{table-C-IGTQni.js → table-FJQTJvUR.js} +2 -2
- package/dist/assets/{table-C-IGTQni.js.map → table-FJQTJvUR.js.map} +1 -1
- package/dist/assets/{ui-DInOpaYF.js → ui-GXFcgvSw.js} +2 -2
- package/dist/assets/{ui-DInOpaYF.js.map → ui-GXFcgvSw.js.map} +1 -1
- package/dist/assets/vendor-Cwf49UMz.js +1247 -0
- package/dist/assets/vendor-Cwf49UMz.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 +1900 -91
- 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 +1390 -105
- 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/calendar.js +151 -0
- 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 +217 -0
- package/dist/server/server/src/services/life-force.js +2506 -0
- package/dist/server/server/src/services/psyche-observation-calendar.js +383 -16
- package/dist/server/server/src/types.js +307 -14
- 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 +45 -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 +41 -11
- package/skills/forge-openclaw/entity_conversation_playbooks.md +448 -34
- package/skills/forge-openclaw/psyche_entity_playbooks.md +170 -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,110 @@ 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
|
+
plannedRemainingAp: z.number(),
|
|
582
|
+
targetBandMinAp: z.number().min(0),
|
|
583
|
+
targetBandMaxAp: z.number().min(0),
|
|
584
|
+
instantCapacityApPerHour: z.number().min(0),
|
|
585
|
+
instantFreeApPerHour: z.number(),
|
|
586
|
+
overloadApPerHour: z.number().min(0),
|
|
587
|
+
currentDrainApPerHour: z.number().min(0),
|
|
588
|
+
fatigueBufferApPerHour: z.number().min(0),
|
|
589
|
+
sleepRecoveryMultiplier: z.number().min(0),
|
|
590
|
+
readinessMultiplier: z.number().min(0),
|
|
591
|
+
fatigueDebtCarry: z.number().min(0),
|
|
592
|
+
stats: z.array(lifeForceStatStateSchema),
|
|
593
|
+
currentCurve: z.array(lifeForceCurvePointSchema),
|
|
594
|
+
activeDrains: z.array(lifeForceDrainEntrySchema),
|
|
595
|
+
plannedDrains: z.array(lifeForceDrainEntrySchema),
|
|
596
|
+
warnings: z.array(lifeForceWarningSchema),
|
|
597
|
+
recommendations: z.array(trimmedString),
|
|
598
|
+
topTaskIdsNeedingSplit: z.array(z.string()),
|
|
599
|
+
updatedAt: z.string()
|
|
600
|
+
});
|
|
450
601
|
export const noteLinkSchema = z.object({
|
|
451
602
|
entityType: crudEntityTypeSchema,
|
|
452
603
|
entityId: nonEmptyTrimmedString,
|
|
@@ -558,10 +709,12 @@ export const taskSchema = z.object({
|
|
|
558
709
|
.number()
|
|
559
710
|
.int()
|
|
560
711
|
.min(60)
|
|
561
|
-
.max(86_400)
|
|
712
|
+
.max(7 * 86_400)
|
|
562
713
|
.nullable()
|
|
563
|
-
.default(
|
|
714
|
+
.default(86_400),
|
|
564
715
|
schedulingRules: calendarSchedulingRulesSchema.nullable().default(null),
|
|
716
|
+
resolutionKind: taskResolutionKindSchema.nullable().default(null),
|
|
717
|
+
splitParentTaskId: z.string().nullable().default(null),
|
|
565
718
|
completedAt: z.string().nullable(),
|
|
566
719
|
createdAt: z.string(),
|
|
567
720
|
updatedAt: z.string(),
|
|
@@ -576,6 +729,20 @@ export const taskSchema = z.object({
|
|
|
576
729
|
activeRunCount: 0,
|
|
577
730
|
hasCurrentRun: false,
|
|
578
731
|
currentRunId: null
|
|
732
|
+
}),
|
|
733
|
+
actionPointSummary: taskActionPointSummarySchema.default({
|
|
734
|
+
costBand: "standard",
|
|
735
|
+
totalCostAp: 100,
|
|
736
|
+
expectedDurationSeconds: 86_400,
|
|
737
|
+
sustainRateApPerHour: 100 / 24,
|
|
738
|
+
spentTodayAp: 0,
|
|
739
|
+
spentTotalAp: 0,
|
|
740
|
+
remainingAp: 100
|
|
741
|
+
}),
|
|
742
|
+
splitSuggestion: taskSplitSuggestionSchema.default({
|
|
743
|
+
shouldSplit: false,
|
|
744
|
+
reason: null,
|
|
745
|
+
thresholdSeconds: 2 * 86_400
|
|
579
746
|
})
|
|
580
747
|
});
|
|
581
748
|
export const taskRunSchema = z.object({
|
|
@@ -722,6 +889,7 @@ export const calendarEventSchema = z.object({
|
|
|
722
889
|
categories: z.array(z.string()).default([]),
|
|
723
890
|
sourceMappings: z.array(calendarEventSourceSchema).default([]),
|
|
724
891
|
links: z.array(calendarEventLinkSchema).default([]),
|
|
892
|
+
actionProfile: actionProfileSchema.nullable().default(null),
|
|
725
893
|
remoteUpdatedAt: z.string().nullable(),
|
|
726
894
|
deletedAt: z.string().nullable(),
|
|
727
895
|
createdAt: z.string(),
|
|
@@ -741,6 +909,7 @@ export const workBlockTemplateSchema = z
|
|
|
741
909
|
startsOn: dateOnlySchema.nullable().default(null),
|
|
742
910
|
endsOn: dateOnlySchema.nullable().default(null),
|
|
743
911
|
blockingState: z.enum(["allowed", "blocked"]),
|
|
912
|
+
actionProfile: actionProfileSchema.nullable().default(null),
|
|
744
913
|
createdAt: z.string(),
|
|
745
914
|
updatedAt: z.string(),
|
|
746
915
|
...ownershipShape
|
|
@@ -772,6 +941,7 @@ export const workBlockInstanceSchema = z.object({
|
|
|
772
941
|
color: z.string(),
|
|
773
942
|
blockingState: z.enum(["allowed", "blocked"]),
|
|
774
943
|
calendarEventId: z.string().nullable(),
|
|
944
|
+
actionProfile: actionProfileSchema.nullable().default(null),
|
|
775
945
|
createdAt: z.string(),
|
|
776
946
|
updatedAt: z.string()
|
|
777
947
|
});
|
|
@@ -789,6 +959,7 @@ export const taskTimeboxSchema = z.object({
|
|
|
789
959
|
startsAt: z.string(),
|
|
790
960
|
endsAt: z.string(),
|
|
791
961
|
overrideReason: trimmedString.nullable(),
|
|
962
|
+
actionProfile: actionProfileSchema.nullable().default(null),
|
|
792
963
|
createdAt: z.string(),
|
|
793
964
|
updatedAt: z.string(),
|
|
794
965
|
...ownershipShape
|
|
@@ -1273,7 +1444,8 @@ export const googleCalendarAuthSettingsSchema = z.object({
|
|
|
1273
1444
|
export const aiModelProviderSchema = z.enum([
|
|
1274
1445
|
"openai-api",
|
|
1275
1446
|
"openai-codex",
|
|
1276
|
-
"openai-compatible"
|
|
1447
|
+
"openai-compatible",
|
|
1448
|
+
"mock"
|
|
1277
1449
|
]);
|
|
1278
1450
|
export const aiModelAuthModeSchema = z.enum(["api_key", "oauth"]);
|
|
1279
1451
|
export const aiModelConnectionStatusSchema = z.enum([
|
|
@@ -1435,14 +1607,39 @@ export const forgeBoxToolAdapterSchema = z.object({
|
|
|
1435
1607
|
key: nonEmptyTrimmedString,
|
|
1436
1608
|
label: nonEmptyTrimmedString,
|
|
1437
1609
|
description: trimmedString.default(""),
|
|
1438
|
-
accessMode: aiProcessorAccessModeSchema.default("read")
|
|
1610
|
+
accessMode: aiProcessorAccessModeSchema.default("read"),
|
|
1611
|
+
argsSchema: z.record(z.string(), z.unknown()).optional()
|
|
1612
|
+
});
|
|
1613
|
+
const workbenchPortKindSchema = z
|
|
1614
|
+
.enum([...WORKBENCH_PORT_KINDS, ...LEGACY_WORKBENCH_PORT_KINDS])
|
|
1615
|
+
.transform((value) => normalizeWorkbenchPortKind({ kind: value }));
|
|
1616
|
+
export const forgeBoxPortShapeFieldSchema = z.object({
|
|
1617
|
+
key: nonEmptyTrimmedString,
|
|
1618
|
+
label: nonEmptyTrimmedString,
|
|
1619
|
+
kind: workbenchPortKindSchema.default("record"),
|
|
1620
|
+
description: trimmedString.optional(),
|
|
1621
|
+
required: z.boolean().default(false)
|
|
1439
1622
|
});
|
|
1440
1623
|
export const forgeBoxPortDefinitionSchema = z.object({
|
|
1441
1624
|
key: nonEmptyTrimmedString,
|
|
1442
1625
|
label: nonEmptyTrimmedString,
|
|
1443
|
-
kind:
|
|
1626
|
+
kind: workbenchPortKindSchema.default("record"),
|
|
1627
|
+
description: trimmedString.optional(),
|
|
1444
1628
|
required: z.boolean().default(false),
|
|
1445
|
-
expandableKeys: z.array(nonEmptyTrimmedString).default([])
|
|
1629
|
+
expandableKeys: z.array(nonEmptyTrimmedString).default([]),
|
|
1630
|
+
modelName: trimmedString.optional(),
|
|
1631
|
+
itemKind: trimmedString.optional(),
|
|
1632
|
+
shape: z.array(forgeBoxPortShapeFieldSchema).default([]),
|
|
1633
|
+
exampleValue: trimmedString.optional()
|
|
1634
|
+
});
|
|
1635
|
+
export const aiConnectorPublicInputBindingSchema = z.object({
|
|
1636
|
+
nodeId: nonEmptyTrimmedString,
|
|
1637
|
+
targetKey: nonEmptyTrimmedString,
|
|
1638
|
+
targetKind: z.enum(["input", "param"]).default("input")
|
|
1639
|
+
});
|
|
1640
|
+
export const aiConnectorPublicInputSchema = forgeBoxPortDefinitionSchema.extend({
|
|
1641
|
+
defaultValue: z.unknown().optional(),
|
|
1642
|
+
bindings: z.array(aiConnectorPublicInputBindingSchema).default([])
|
|
1446
1643
|
});
|
|
1447
1644
|
export const forgeBoxCatalogEntrySchema = z.object({
|
|
1448
1645
|
id: nonEmptyTrimmedString,
|
|
@@ -1543,6 +1740,30 @@ export const aiConnectorRunResultSchema = z.object({
|
|
|
1543
1740
|
text: z.string(),
|
|
1544
1741
|
json: z.record(z.string(), z.unknown()).nullable()
|
|
1545
1742
|
})),
|
|
1743
|
+
nodeResults: z
|
|
1744
|
+
.array(z.object({
|
|
1745
|
+
nodeId: nonEmptyTrimmedString,
|
|
1746
|
+
nodeType: aiConnectorNodeTypeSchema,
|
|
1747
|
+
label: nonEmptyTrimmedString,
|
|
1748
|
+
input: z.array(z.object({
|
|
1749
|
+
sourceNodeId: nonEmptyTrimmedString,
|
|
1750
|
+
sourceHandle: trimmedString.nullable(),
|
|
1751
|
+
targetHandle: trimmedString.nullable(),
|
|
1752
|
+
text: z.string(),
|
|
1753
|
+
json: z.record(z.string(), z.unknown()).nullable()
|
|
1754
|
+
})),
|
|
1755
|
+
primaryText: z.string(),
|
|
1756
|
+
payload: z.record(z.string(), z.unknown()).nullable(),
|
|
1757
|
+
outputMap: z.record(z.string(), z.object({
|
|
1758
|
+
text: z.string(),
|
|
1759
|
+
json: z.record(z.string(), z.unknown()).nullable()
|
|
1760
|
+
})),
|
|
1761
|
+
tools: z.array(z.string()).default([]),
|
|
1762
|
+
logs: z.array(z.string()).default([]),
|
|
1763
|
+
error: z.string().nullable(),
|
|
1764
|
+
timingMs: z.number().int().nonnegative().nullable().optional()
|
|
1765
|
+
}))
|
|
1766
|
+
.default([]),
|
|
1546
1767
|
debugTrace: z
|
|
1547
1768
|
.object({
|
|
1548
1769
|
nodes: z.array(z.object({
|
|
@@ -1574,6 +1795,7 @@ export const aiConnectorRunSchema = z.object({
|
|
|
1574
1795
|
mode: z.enum(["run", "chat"]),
|
|
1575
1796
|
status: z.enum(["running", "completed", "failed"]),
|
|
1576
1797
|
userInput: z.string(),
|
|
1798
|
+
inputs: z.record(z.string(), z.unknown()).default({}),
|
|
1577
1799
|
context: z.record(z.string(), z.unknown()).default({}),
|
|
1578
1800
|
conversationId: trimmedString.nullable(),
|
|
1579
1801
|
result: aiConnectorRunResultSchema.nullable(),
|
|
@@ -1606,6 +1828,7 @@ export const aiConnectorSchema = z.object({
|
|
|
1606
1828
|
nodes: z.array(aiConnectorNodeSchema).default([]),
|
|
1607
1829
|
edges: z.array(aiConnectorEdgeSchema).default([])
|
|
1608
1830
|
}),
|
|
1831
|
+
publicInputs: z.array(aiConnectorPublicInputSchema).default([]),
|
|
1609
1832
|
publishedOutputs: z.array(aiConnectorOutputSchema).default([]),
|
|
1610
1833
|
lastRun: aiConnectorRunSchema.nullable(),
|
|
1611
1834
|
legacyProcessorId: trimmedString.nullable().default(null),
|
|
@@ -2061,6 +2284,8 @@ export const activityListQuerySchema = z.object({
|
|
|
2061
2284
|
entityType: activityEntityTypeSchema.optional(),
|
|
2062
2285
|
entityId: nonEmptyTrimmedString.optional(),
|
|
2063
2286
|
source: activitySourceSchema.optional(),
|
|
2287
|
+
from: flexibleCalendarQueryDateSchema.optional(),
|
|
2288
|
+
to: flexibleCalendarQueryDateSchema.optional(),
|
|
2064
2289
|
includeCorrected: z.coerce.boolean().optional(),
|
|
2065
2290
|
userIds: repeatedTrimmedStringQuerySchema.optional(),
|
|
2066
2291
|
limit: z.coerce.number().int().positive().max(100).optional()
|
|
@@ -2083,6 +2308,23 @@ export const calendarOverviewQuerySchema = z.object({
|
|
|
2083
2308
|
to: flexibleCalendarQueryDateSchema.optional(),
|
|
2084
2309
|
userIds: repeatedTrimmedStringQuerySchema.optional()
|
|
2085
2310
|
});
|
|
2311
|
+
export const psycheObservationCalendarExportFormatSchema = z.enum([
|
|
2312
|
+
"json",
|
|
2313
|
+
"csv",
|
|
2314
|
+
"markdown",
|
|
2315
|
+
"ics"
|
|
2316
|
+
]);
|
|
2317
|
+
export const psycheObservationCalendarExportQuerySchema = z.object({
|
|
2318
|
+
from: flexibleCalendarQueryDateSchema.optional(),
|
|
2319
|
+
to: flexibleCalendarQueryDateSchema.optional(),
|
|
2320
|
+
userIds: repeatedTrimmedStringQuerySchema.optional(),
|
|
2321
|
+
tags: repeatedTrimmedStringQuerySchema.optional(),
|
|
2322
|
+
includeObservations: z.coerce.boolean().optional(),
|
|
2323
|
+
includeActivity: z.coerce.boolean().optional(),
|
|
2324
|
+
onlyHumanOwned: z.coerce.boolean().optional(),
|
|
2325
|
+
search: trimmedString.optional(),
|
|
2326
|
+
format: psycheObservationCalendarExportFormatSchema.default("markdown")
|
|
2327
|
+
});
|
|
2086
2328
|
export const createCalendarConnectionSchema = z.discriminatedUnion("provider", [
|
|
2087
2329
|
z.object({
|
|
2088
2330
|
provider: z.literal("google"),
|
|
@@ -2180,7 +2422,11 @@ const workBlockTemplateMutationShape = {
|
|
|
2180
2422
|
userId: nonEmptyTrimmedString.nullable().optional()
|
|
2181
2423
|
};
|
|
2182
2424
|
export const createWorkBlockTemplateSchema = z
|
|
2183
|
-
.object(
|
|
2425
|
+
.object({
|
|
2426
|
+
...workBlockTemplateMutationShape,
|
|
2427
|
+
activityPresetKey: trimmedString.nullable().optional(),
|
|
2428
|
+
customSustainRateApPerHour: z.number().min(0).nullable().optional()
|
|
2429
|
+
})
|
|
2184
2430
|
.superRefine((value, context) => {
|
|
2185
2431
|
if (value.endMinute <= value.startMinute) {
|
|
2186
2432
|
context.addIssue({
|
|
@@ -2212,6 +2458,8 @@ export const updateWorkBlockTemplateSchema = z
|
|
|
2212
2458
|
startsOn: dateOnlySchema.nullable().optional(),
|
|
2213
2459
|
endsOn: dateOnlySchema.nullable().optional(),
|
|
2214
2460
|
blockingState: z.enum(["allowed", "blocked"]).optional(),
|
|
2461
|
+
activityPresetKey: trimmedString.nullable().optional(),
|
|
2462
|
+
customSustainRateApPerHour: z.number().min(0).nullable().optional(),
|
|
2215
2463
|
userId: nonEmptyTrimmedString.nullable().optional()
|
|
2216
2464
|
})
|
|
2217
2465
|
.superRefine((value, context) => {
|
|
@@ -2246,6 +2494,8 @@ export const createTaskTimeboxSchema = z
|
|
|
2246
2494
|
source: calendarTimeboxSourceSchema.default("manual"),
|
|
2247
2495
|
status: calendarTimeboxStatusSchema.default("planned"),
|
|
2248
2496
|
overrideReason: trimmedString.nullable().default(null),
|
|
2497
|
+
activityPresetKey: trimmedString.nullable().optional(),
|
|
2498
|
+
customSustainRateApPerHour: z.number().min(0).nullable().optional(),
|
|
2249
2499
|
userId: nonEmptyTrimmedString.nullable().optional()
|
|
2250
2500
|
})
|
|
2251
2501
|
.superRefine((value, context) => {
|
|
@@ -2263,6 +2513,8 @@ export const updateTaskTimeboxSchema = z.object({
|
|
|
2263
2513
|
endsAt: z.string().datetime().optional(),
|
|
2264
2514
|
status: calendarTimeboxStatusSchema.optional(),
|
|
2265
2515
|
overrideReason: trimmedString.nullable().optional(),
|
|
2516
|
+
activityPresetKey: trimmedString.nullable().optional(),
|
|
2517
|
+
customSustainRateApPerHour: z.number().min(0).nullable().optional(),
|
|
2266
2518
|
userId: nonEmptyTrimmedString.nullable().optional()
|
|
2267
2519
|
});
|
|
2268
2520
|
export const recommendTaskTimeboxesSchema = z.object({
|
|
@@ -2294,6 +2546,8 @@ export const updateCalendarEventSchema = z
|
|
|
2294
2546
|
availability: calendarAvailabilitySchema.optional(),
|
|
2295
2547
|
eventType: trimmedString.optional(),
|
|
2296
2548
|
categories: z.array(trimmedString).optional(),
|
|
2549
|
+
activityPresetKey: trimmedString.nullable().optional(),
|
|
2550
|
+
customSustainRateApPerHour: z.number().min(0).nullable().optional(),
|
|
2297
2551
|
preferredCalendarId: nonEmptyTrimmedString.nullable().optional(),
|
|
2298
2552
|
userId: nonEmptyTrimmedString.nullable().optional(),
|
|
2299
2553
|
links: z
|
|
@@ -2346,6 +2600,8 @@ export const createCalendarEventSchema = z
|
|
|
2346
2600
|
availability: calendarAvailabilitySchema.default("busy"),
|
|
2347
2601
|
eventType: trimmedString.default(""),
|
|
2348
2602
|
categories: z.array(trimmedString).default([]),
|
|
2603
|
+
activityPresetKey: trimmedString.nullable().optional(),
|
|
2604
|
+
customSustainRateApPerHour: z.number().min(0).nullable().optional(),
|
|
2349
2605
|
preferredCalendarId: nonEmptyTrimmedString.nullable().optional(),
|
|
2350
2606
|
userId: nonEmptyTrimmedString.nullable().optional(),
|
|
2351
2607
|
links: z
|
|
@@ -2369,6 +2625,7 @@ export const habitListQuerySchema = z.object({
|
|
|
2369
2625
|
status: habitStatusSchema.optional(),
|
|
2370
2626
|
polarity: habitPolaritySchema.optional(),
|
|
2371
2627
|
dueToday: z.coerce.boolean().optional(),
|
|
2628
|
+
orderBy: habitOrderBySchema.optional(),
|
|
2372
2629
|
userIds: repeatedTrimmedStringQuerySchema.optional(),
|
|
2373
2630
|
limit: z.coerce.number().int().positive().max(100).optional()
|
|
2374
2631
|
});
|
|
@@ -2441,12 +2698,13 @@ export const taskMutationShape = {
|
|
|
2441
2698
|
.number()
|
|
2442
2699
|
.int()
|
|
2443
2700
|
.min(60)
|
|
2444
|
-
.max(86_400)
|
|
2701
|
+
.max(7 * 86_400)
|
|
2445
2702
|
.nullable()
|
|
2446
|
-
.default(
|
|
2703
|
+
.default(86_400),
|
|
2447
2704
|
schedulingRules: calendarSchedulingRulesSchema.nullable().default(null),
|
|
2448
2705
|
sortOrder: z.number().int().nonnegative().optional(),
|
|
2449
2706
|
tagIds: uniqueStringArraySchema.default([]),
|
|
2707
|
+
actionCostBand: actionCostBandSchema.default("standard"),
|
|
2450
2708
|
notes: z.array(nestedCreateNoteSchema).default([])
|
|
2451
2709
|
};
|
|
2452
2710
|
export const createTaskSchema = z.object(taskMutationShape);
|
|
@@ -2589,14 +2847,44 @@ export const updateTaskSchema = z.object({
|
|
|
2589
2847
|
.number()
|
|
2590
2848
|
.int()
|
|
2591
2849
|
.min(60)
|
|
2592
|
-
.max(86_400)
|
|
2850
|
+
.max(7 * 86_400)
|
|
2593
2851
|
.nullable()
|
|
2594
2852
|
.optional(),
|
|
2595
2853
|
schedulingRules: calendarSchedulingRulesSchema.nullable().optional(),
|
|
2854
|
+
resolutionKind: taskResolutionKindSchema.nullable().optional(),
|
|
2855
|
+
splitParentTaskId: z.string().nullable().optional(),
|
|
2856
|
+
enforceTodayWorkLog: z.boolean().optional(),
|
|
2857
|
+
completedTodayWorkSeconds: z
|
|
2858
|
+
.number()
|
|
2859
|
+
.int()
|
|
2860
|
+
.min(0)
|
|
2861
|
+
.max(7 * 86_400)
|
|
2862
|
+
.optional(),
|
|
2863
|
+
actionCostBand: actionCostBandSchema.optional(),
|
|
2596
2864
|
sortOrder: z.number().int().nonnegative().optional(),
|
|
2597
2865
|
tagIds: uniqueStringArraySchema.optional(),
|
|
2598
2866
|
notes: z.array(nestedCreateNoteSchema).optional()
|
|
2599
2867
|
});
|
|
2868
|
+
export const lifeForceProfilePatchSchema = z.object({
|
|
2869
|
+
baseDailyAp: z.number().int().min(50).max(500).optional(),
|
|
2870
|
+
readinessMultiplier: z.number().min(0.5).max(1.5).optional(),
|
|
2871
|
+
stats: z
|
|
2872
|
+
.record(lifeForceStatKeySchema, z.number().int().min(1).max(100))
|
|
2873
|
+
.optional()
|
|
2874
|
+
});
|
|
2875
|
+
export const lifeForceTemplateUpdateSchema = z.object({
|
|
2876
|
+
points: z.array(lifeForceCurvePointSchema).min(2)
|
|
2877
|
+
});
|
|
2878
|
+
export const fatigueSignalCreateSchema = z.object({
|
|
2879
|
+
signalType: z.enum(["tired", "okay_again"]),
|
|
2880
|
+
observedAt: dateTimeSchema.optional(),
|
|
2881
|
+
note: trimmedString.optional()
|
|
2882
|
+
});
|
|
2883
|
+
export const taskSplitCreateSchema = z.object({
|
|
2884
|
+
firstTitle: nonEmptyTrimmedString,
|
|
2885
|
+
secondTitle: nonEmptyTrimmedString,
|
|
2886
|
+
remainingRatio: z.number().min(0.1).max(0.9).default(0.5)
|
|
2887
|
+
});
|
|
2600
2888
|
export const tagSuggestionRequestSchema = z.object({
|
|
2601
2889
|
title: trimmedString.default(""),
|
|
2602
2890
|
description: trimmedString.default(""),
|
|
@@ -2757,6 +3045,7 @@ export const upsertAiModelConnectionSchema = z
|
|
|
2757
3045
|
.superRefine((value, context) => {
|
|
2758
3046
|
const authMode = value.authMode ??
|
|
2759
3047
|
(value.provider === "openai-codex" ? "oauth" : "api_key");
|
|
3048
|
+
const isMockProvider = value.provider === "mock";
|
|
2760
3049
|
if (value.provider === "openai-codex" && authMode !== "oauth") {
|
|
2761
3050
|
context.addIssue({
|
|
2762
3051
|
code: z.ZodIssueCode.custom,
|
|
@@ -2765,6 +3054,7 @@ export const upsertAiModelConnectionSchema = z
|
|
|
2765
3054
|
});
|
|
2766
3055
|
}
|
|
2767
3056
|
if (authMode === "api_key" &&
|
|
3057
|
+
!isMockProvider &&
|
|
2768
3058
|
!value.id?.trim() &&
|
|
2769
3059
|
!value.apiKey?.trim()) {
|
|
2770
3060
|
context.addIssue({
|
|
@@ -2841,6 +3131,7 @@ export const createAiConnectorSchema = z.object({
|
|
|
2841
3131
|
kind: aiConnectorKindSchema.default("functor"),
|
|
2842
3132
|
homeSurfaceId: trimmedString.nullable().default(null),
|
|
2843
3133
|
endpointEnabled: z.boolean().default(true),
|
|
3134
|
+
publicInputs: z.array(aiConnectorPublicInputSchema).default([]),
|
|
2844
3135
|
graph: z
|
|
2845
3136
|
.object({
|
|
2846
3137
|
nodes: z.array(aiConnectorNodeSchema).default([]),
|
|
@@ -2854,6 +3145,7 @@ export const updateAiConnectorSchema = z.object({
|
|
|
2854
3145
|
kind: aiConnectorKindSchema.optional(),
|
|
2855
3146
|
homeSurfaceId: trimmedString.nullable().optional(),
|
|
2856
3147
|
endpointEnabled: z.boolean().optional(),
|
|
3148
|
+
publicInputs: z.array(aiConnectorPublicInputSchema).optional(),
|
|
2857
3149
|
graph: z
|
|
2858
3150
|
.object({
|
|
2859
3151
|
nodes: z.array(aiConnectorNodeSchema).default([]),
|
|
@@ -2863,6 +3155,7 @@ export const updateAiConnectorSchema = z.object({
|
|
|
2863
3155
|
});
|
|
2864
3156
|
export const runAiConnectorSchema = z.object({
|
|
2865
3157
|
userInput: trimmedString.default(""),
|
|
3158
|
+
inputs: z.record(z.string(), z.unknown()).default({}),
|
|
2866
3159
|
context: z.record(z.string(), z.unknown()).default({}),
|
|
2867
3160
|
boxSnapshots: z.record(z.string(), z.unknown()).default({}),
|
|
2868
3161
|
conversationId: trimmedString.nullable().default(null),
|