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
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { getWorkbenchEntityPortShape, getWorkbenchModelPortShape, normalizeWorkbenchPortDefinition } from "./nodes.js";
|
|
2
|
+
function toPascalCase(value) {
|
|
3
|
+
return value
|
|
4
|
+
.split(/[^a-zA-Z0-9]+/)
|
|
5
|
+
.filter(Boolean)
|
|
6
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
7
|
+
.join("");
|
|
8
|
+
}
|
|
9
|
+
export function createOutputDefinition(input) {
|
|
10
|
+
const inferredEntityShape = input.itemKind
|
|
11
|
+
? getWorkbenchEntityPortShape(input.itemKind)
|
|
12
|
+
: [];
|
|
13
|
+
const inferredModelShape = input.modelName
|
|
14
|
+
? getWorkbenchModelPortShape(input.modelName)
|
|
15
|
+
: [];
|
|
16
|
+
return normalizeWorkbenchPortDefinition({
|
|
17
|
+
key: input.key,
|
|
18
|
+
label: input.label,
|
|
19
|
+
kind: input.kind,
|
|
20
|
+
description: input.description,
|
|
21
|
+
required: input.required ?? false,
|
|
22
|
+
modelName: input.modelName,
|
|
23
|
+
itemKind: input.itemKind,
|
|
24
|
+
shape: input.shape ??
|
|
25
|
+
(inferredEntityShape.length > 0 ? inferredEntityShape : inferredModelShape),
|
|
26
|
+
exampleValue: input.exampleValue
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export function createInputDefinition(input) {
|
|
30
|
+
const inferredEntityShape = input.itemKind
|
|
31
|
+
? getWorkbenchEntityPortShape(input.itemKind)
|
|
32
|
+
: [];
|
|
33
|
+
const inferredModelShape = input.modelName
|
|
34
|
+
? getWorkbenchModelPortShape(input.modelName)
|
|
35
|
+
: [];
|
|
36
|
+
return normalizeWorkbenchPortDefinition({
|
|
37
|
+
key: input.key,
|
|
38
|
+
label: input.label,
|
|
39
|
+
kind: input.kind,
|
|
40
|
+
description: input.description,
|
|
41
|
+
required: input.required ?? false,
|
|
42
|
+
modelName: input.modelName,
|
|
43
|
+
itemKind: input.itemKind,
|
|
44
|
+
shape: input.shape ??
|
|
45
|
+
(inferredEntityShape.length > 0 ? inferredEntityShape : inferredModelShape),
|
|
46
|
+
exampleValue: input.exampleValue
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function createParamDefinition(input) {
|
|
50
|
+
return {
|
|
51
|
+
key: input.key,
|
|
52
|
+
label: input.label,
|
|
53
|
+
kind: input.kind,
|
|
54
|
+
description: input.description,
|
|
55
|
+
required: input.required ?? false,
|
|
56
|
+
options: input.options
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function createSummaryOutput(input) {
|
|
60
|
+
return createOutputDefinition({
|
|
61
|
+
key: "summary",
|
|
62
|
+
label: input?.label ?? "Summary",
|
|
63
|
+
kind: "summary",
|
|
64
|
+
description: input?.description ??
|
|
65
|
+
"Human-readable summary of what this node currently knows or produced.",
|
|
66
|
+
modelName: "WorkbenchSummary",
|
|
67
|
+
exampleValue: input?.exampleValue
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
export function createSearchOutputs(input) {
|
|
71
|
+
const modelStem = toPascalCase(input.itemKind);
|
|
72
|
+
return [
|
|
73
|
+
createSummaryOutput({
|
|
74
|
+
label: input.summaryLabel ?? "Search summary",
|
|
75
|
+
description: `Compact summary of the current ${input.itemLabel.toLowerCase()} search results.`
|
|
76
|
+
}),
|
|
77
|
+
createOutputDefinition({
|
|
78
|
+
key: input.collectionKey ?? "matches",
|
|
79
|
+
label: input.collectionLabel ?? `${input.itemLabel} matches`,
|
|
80
|
+
kind: "entity_list",
|
|
81
|
+
description: `Structured ${input.itemLabel.toLowerCase()} records returned by Forge search.`,
|
|
82
|
+
modelName: `${modelStem}SearchResults`,
|
|
83
|
+
itemKind: input.itemKind,
|
|
84
|
+
exampleValue: `[{"id":"...","title":"Example ${input.itemLabel}"}]`
|
|
85
|
+
}),
|
|
86
|
+
createOutputDefinition({
|
|
87
|
+
key: "matchCount",
|
|
88
|
+
label: "Match count",
|
|
89
|
+
kind: "number",
|
|
90
|
+
description: "Number of records returned by the search.",
|
|
91
|
+
modelName: `${modelStem}SearchCount`,
|
|
92
|
+
exampleValue: "12"
|
|
93
|
+
})
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
export function createSearchInputs(input) {
|
|
97
|
+
const modelStem = toPascalCase(input.itemKind);
|
|
98
|
+
return [
|
|
99
|
+
createInputDefinition({
|
|
100
|
+
key: "query",
|
|
101
|
+
label: "Query",
|
|
102
|
+
kind: "text",
|
|
103
|
+
description: `Search text for narrowing ${input.itemLabel.toLowerCase()} results.`,
|
|
104
|
+
modelName: `${modelStem}SearchQuery`,
|
|
105
|
+
exampleValue: "backlog"
|
|
106
|
+
}),
|
|
107
|
+
createInputDefinition({
|
|
108
|
+
key: "entityTypes",
|
|
109
|
+
label: "Entity types",
|
|
110
|
+
kind: "array",
|
|
111
|
+
description: "Entity types to include in the Forge search.",
|
|
112
|
+
modelName: `${modelStem}SearchEntityTypes`,
|
|
113
|
+
exampleValue: JSON.stringify(input.defaultEntityTypes ?? [input.itemKind])
|
|
114
|
+
}),
|
|
115
|
+
createInputDefinition({
|
|
116
|
+
key: "limit",
|
|
117
|
+
label: "Limit",
|
|
118
|
+
kind: "number",
|
|
119
|
+
description: "Maximum number of results to request.",
|
|
120
|
+
modelName: `${modelStem}SearchLimit`,
|
|
121
|
+
exampleValue: String(input.defaultLimit ?? 20)
|
|
122
|
+
})
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
export function createSearchParams(input) {
|
|
126
|
+
return [
|
|
127
|
+
createParamDefinition({
|
|
128
|
+
key: "query",
|
|
129
|
+
label: "Default query",
|
|
130
|
+
kind: "text",
|
|
131
|
+
description: "Used when no query input edge is connected."
|
|
132
|
+
}),
|
|
133
|
+
createParamDefinition({
|
|
134
|
+
key: "entityTypes",
|
|
135
|
+
label: "Default entity types",
|
|
136
|
+
kind: "array",
|
|
137
|
+
description: "Used when no entity types input edge is connected. Enter a JSON array or comma-separated values."
|
|
138
|
+
}),
|
|
139
|
+
createParamDefinition({
|
|
140
|
+
key: "limit",
|
|
141
|
+
label: "Default limit",
|
|
142
|
+
kind: "number",
|
|
143
|
+
description: "Used when no limit input edge is connected."
|
|
144
|
+
})
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
export function createContextOutput(input) {
|
|
148
|
+
return createOutputDefinition({
|
|
149
|
+
key: input.key,
|
|
150
|
+
label: input.label,
|
|
151
|
+
kind: "context",
|
|
152
|
+
description: input.description,
|
|
153
|
+
modelName: input.modelName,
|
|
154
|
+
shape: input.shape,
|
|
155
|
+
exampleValue: input.exampleValue
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
export function createRecordListOutput(input) {
|
|
159
|
+
return createOutputDefinition({
|
|
160
|
+
key: input.key,
|
|
161
|
+
label: input.label,
|
|
162
|
+
kind: "record_list",
|
|
163
|
+
description: input.description,
|
|
164
|
+
modelName: input.modelName,
|
|
165
|
+
itemKind: input.itemKind,
|
|
166
|
+
exampleValue: input.exampleValue
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
export function createSearchEntitiesTool(description) {
|
|
170
|
+
return {
|
|
171
|
+
key: "forge.search_entities",
|
|
172
|
+
label: "Search Forge entities",
|
|
173
|
+
description,
|
|
174
|
+
accessMode: "read",
|
|
175
|
+
argsSchema: {
|
|
176
|
+
type: "object",
|
|
177
|
+
properties: {
|
|
178
|
+
query: { type: "string", description: "Search text to match against Forge entities." },
|
|
179
|
+
entityTypes: {
|
|
180
|
+
type: "array",
|
|
181
|
+
items: { type: "string" },
|
|
182
|
+
description: "Optional entity types to narrow the search."
|
|
183
|
+
},
|
|
184
|
+
limit: {
|
|
185
|
+
type: "number",
|
|
186
|
+
description: "Maximum number of results to return."
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
export function createNoteTool(description) {
|
|
193
|
+
return {
|
|
194
|
+
key: "forge.create_note",
|
|
195
|
+
label: "Create note",
|
|
196
|
+
description,
|
|
197
|
+
accessMode: "write",
|
|
198
|
+
argsSchema: {
|
|
199
|
+
type: "object",
|
|
200
|
+
properties: {
|
|
201
|
+
title: { type: "string", description: "Title of the note to create." },
|
|
202
|
+
summary: { type: "string", description: "Optional short summary for the note." },
|
|
203
|
+
markdown: {
|
|
204
|
+
type: "string",
|
|
205
|
+
description: "Markdown content that should become the note body."
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
export function createTaskStatusTool(description) {
|
|
212
|
+
return {
|
|
213
|
+
key: "forge.update_task_status",
|
|
214
|
+
label: "Move task",
|
|
215
|
+
description,
|
|
216
|
+
accessMode: "write",
|
|
217
|
+
argsSchema: {
|
|
218
|
+
type: "object",
|
|
219
|
+
properties: {
|
|
220
|
+
taskId: { type: "string", description: "Task id to update." },
|
|
221
|
+
status: {
|
|
222
|
+
type: "string",
|
|
223
|
+
description: "New Forge task status.",
|
|
224
|
+
enum: ["backlog", "focus", "in_progress", "blocked", "done"]
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
}
|
|
@@ -1,3 +1,203 @@
|
|
|
1
|
+
export const WORKBENCH_PORT_KINDS = [
|
|
2
|
+
"text",
|
|
3
|
+
"number",
|
|
4
|
+
"boolean",
|
|
5
|
+
"object",
|
|
6
|
+
"array",
|
|
7
|
+
"json",
|
|
8
|
+
"tool",
|
|
9
|
+
"summary",
|
|
10
|
+
"entity",
|
|
11
|
+
"entity_list",
|
|
12
|
+
"context",
|
|
13
|
+
"metrics",
|
|
14
|
+
"filters",
|
|
15
|
+
"markdown",
|
|
16
|
+
"timeline",
|
|
17
|
+
"selection",
|
|
18
|
+
"record",
|
|
19
|
+
"record_list"
|
|
20
|
+
];
|
|
21
|
+
export const LEGACY_WORKBENCH_PORT_KINDS = ["content"];
|
|
22
|
+
const ENTITY_PORT_SHAPES = {
|
|
23
|
+
goal: [
|
|
24
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
25
|
+
{ key: "title", label: "Title", kind: "text", required: true },
|
|
26
|
+
{ key: "status", label: "Status", kind: "text" },
|
|
27
|
+
{ key: "horizon", label: "Horizon", kind: "text" }
|
|
28
|
+
],
|
|
29
|
+
project: [
|
|
30
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
31
|
+
{ key: "title", label: "Title", kind: "text", required: true },
|
|
32
|
+
{ key: "status", label: "Status", kind: "text" },
|
|
33
|
+
{ key: "goalId", label: "Goal id", kind: "text" }
|
|
34
|
+
],
|
|
35
|
+
task: [
|
|
36
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
37
|
+
{ key: "title", label: "Title", kind: "text", required: true },
|
|
38
|
+
{ key: "status", label: "Status", kind: "text" },
|
|
39
|
+
{ key: "priority", label: "Priority", kind: "text" },
|
|
40
|
+
{ key: "projectId", label: "Project id", kind: "text" }
|
|
41
|
+
],
|
|
42
|
+
strategy: [
|
|
43
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
44
|
+
{ key: "title", label: "Title", kind: "text", required: true },
|
|
45
|
+
{ key: "status", label: "Status", kind: "text" },
|
|
46
|
+
{ key: "overview", label: "Overview", kind: "markdown" }
|
|
47
|
+
],
|
|
48
|
+
habit: [
|
|
49
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
50
|
+
{ key: "title", label: "Title", kind: "text", required: true },
|
|
51
|
+
{ key: "status", label: "Status", kind: "text" },
|
|
52
|
+
{ key: "frequency", label: "Frequency", kind: "text" },
|
|
53
|
+
{ key: "polarity", label: "Polarity", kind: "text" }
|
|
54
|
+
],
|
|
55
|
+
note: [
|
|
56
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
57
|
+
{ key: "title", label: "Title", kind: "text", required: true },
|
|
58
|
+
{ key: "summary", label: "Summary", kind: "markdown" },
|
|
59
|
+
{ key: "kind", label: "Kind", kind: "text" },
|
|
60
|
+
{ key: "updatedAt", label: "Updated at", kind: "text" }
|
|
61
|
+
],
|
|
62
|
+
insight: [
|
|
63
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
64
|
+
{ key: "title", label: "Title", kind: "text", required: true },
|
|
65
|
+
{ key: "summary", label: "Summary", kind: "markdown" },
|
|
66
|
+
{ key: "status", label: "Status", kind: "text" }
|
|
67
|
+
],
|
|
68
|
+
calendar_event: [
|
|
69
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
70
|
+
{ key: "title", label: "Title", kind: "text", required: true },
|
|
71
|
+
{ key: "startsAt", label: "Starts at", kind: "text" },
|
|
72
|
+
{ key: "endsAt", label: "Ends at", kind: "text" },
|
|
73
|
+
{ key: "origin", label: "Origin", kind: "text" }
|
|
74
|
+
],
|
|
75
|
+
wiki_page: [
|
|
76
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
77
|
+
{ key: "title", label: "Title", kind: "text", required: true },
|
|
78
|
+
{ key: "slug", label: "Slug", kind: "text" },
|
|
79
|
+
{ key: "summary", label: "Summary", kind: "markdown" }
|
|
80
|
+
],
|
|
81
|
+
sleep_session: [
|
|
82
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
83
|
+
{ key: "startAt", label: "Start", kind: "text" },
|
|
84
|
+
{ key: "endAt", label: "End", kind: "text" },
|
|
85
|
+
{ key: "totalSleepMinutes", label: "Total sleep minutes", kind: "number" }
|
|
86
|
+
],
|
|
87
|
+
workout_session: [
|
|
88
|
+
{ key: "id", label: "Id", kind: "text", required: true },
|
|
89
|
+
{ key: "type", label: "Type", kind: "text" },
|
|
90
|
+
{ key: "startedAt", label: "Started at", kind: "text" },
|
|
91
|
+
{ key: "durationMinutes", label: "Duration minutes", kind: "number" }
|
|
92
|
+
]
|
|
93
|
+
};
|
|
94
|
+
const MODEL_PORT_SHAPES = {
|
|
95
|
+
WorkbenchUserMessage: [{ key: "message", label: "Message", kind: "text", required: true }],
|
|
96
|
+
WorkbenchUserContext: [{ key: "context", label: "Context", kind: "record" }],
|
|
97
|
+
WorkbenchMergedContext: [{ key: "merged", label: "Merged", kind: "record", required: true }],
|
|
98
|
+
WorkbenchTemplateOutput: [{ key: "rendered", label: "Rendered", kind: "markdown", required: true }],
|
|
99
|
+
WorkbenchSelectedValue: [{ key: "selected", label: "Selected", kind: "record", required: true }],
|
|
100
|
+
WorkbenchPublishedOutput: [{ key: "published", label: "Published", kind: "record", required: true }],
|
|
101
|
+
WeeklyReviewPayload: [
|
|
102
|
+
{ key: "wins", label: "Wins", kind: "record_list" },
|
|
103
|
+
{ key: "trends", label: "Trends", kind: "record_list" }
|
|
104
|
+
],
|
|
105
|
+
InsightsPayload: [
|
|
106
|
+
{ key: "insights", label: "Insights", kind: "record_list" },
|
|
107
|
+
{ key: "heatmap", label: "Heatmap", kind: "record_list" }
|
|
108
|
+
],
|
|
109
|
+
OperatorOverviewPayload: [
|
|
110
|
+
{ key: "summary", label: "Summary", kind: "markdown" },
|
|
111
|
+
{ key: "currentWork", label: "Current work", kind: "record_list" }
|
|
112
|
+
],
|
|
113
|
+
OperatorContextPayload: [
|
|
114
|
+
{ key: "tasks", label: "Tasks", kind: "record_list" },
|
|
115
|
+
{ key: "focus", label: "Focus", kind: "record_list" }
|
|
116
|
+
],
|
|
117
|
+
SleepViewData: [
|
|
118
|
+
{ key: "sessions", label: "Sessions", kind: "record_list" },
|
|
119
|
+
{ key: "metrics", label: "Metrics", kind: "metrics" }
|
|
120
|
+
]
|
|
121
|
+
};
|
|
122
|
+
export function inferWorkbenchPortKind(input) {
|
|
123
|
+
const rawKind = input.kind?.trim().toLowerCase();
|
|
124
|
+
if (rawKind && WORKBENCH_PORT_KINDS.includes(rawKind)) {
|
|
125
|
+
return rawKind;
|
|
126
|
+
}
|
|
127
|
+
const key = input.key?.trim().toLowerCase() ?? "";
|
|
128
|
+
const modelName = input.modelName?.trim().toLowerCase() ?? "";
|
|
129
|
+
if (rawKind === "content") {
|
|
130
|
+
if (key === "summary" || modelName.includes("summary")) {
|
|
131
|
+
return "summary";
|
|
132
|
+
}
|
|
133
|
+
if (key === "answer" ||
|
|
134
|
+
key === "rendered" ||
|
|
135
|
+
modelName.includes("answer") ||
|
|
136
|
+
modelName.includes("markdown") ||
|
|
137
|
+
modelName.includes("template")) {
|
|
138
|
+
return "markdown";
|
|
139
|
+
}
|
|
140
|
+
if (key === "message" ||
|
|
141
|
+
key === "query" ||
|
|
142
|
+
key === "title" ||
|
|
143
|
+
modelName.includes("message")) {
|
|
144
|
+
return "text";
|
|
145
|
+
}
|
|
146
|
+
if (input.itemKind) {
|
|
147
|
+
return "entity_list";
|
|
148
|
+
}
|
|
149
|
+
return "record";
|
|
150
|
+
}
|
|
151
|
+
if (key.endsWith("count") || key === "limit") {
|
|
152
|
+
return "number";
|
|
153
|
+
}
|
|
154
|
+
if (key === "summary") {
|
|
155
|
+
return "summary";
|
|
156
|
+
}
|
|
157
|
+
if (key === "answer" || key === "rendered") {
|
|
158
|
+
return "markdown";
|
|
159
|
+
}
|
|
160
|
+
if (key === "message" || key === "query") {
|
|
161
|
+
return "text";
|
|
162
|
+
}
|
|
163
|
+
if (input.itemKind) {
|
|
164
|
+
return "entity_list";
|
|
165
|
+
}
|
|
166
|
+
return "record";
|
|
167
|
+
}
|
|
168
|
+
export function normalizeWorkbenchPortKind(input) {
|
|
169
|
+
return inferWorkbenchPortKind(input);
|
|
170
|
+
}
|
|
171
|
+
export function getWorkbenchEntityPortShape(itemKind) {
|
|
172
|
+
if (!itemKind) {
|
|
173
|
+
return [];
|
|
174
|
+
}
|
|
175
|
+
return ENTITY_PORT_SHAPES[itemKind] ?? [];
|
|
176
|
+
}
|
|
177
|
+
export function getWorkbenchModelPortShape(modelName) {
|
|
178
|
+
if (!modelName) {
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
return MODEL_PORT_SHAPES[modelName] ?? [];
|
|
182
|
+
}
|
|
183
|
+
export function normalizeWorkbenchPortDefinition(port) {
|
|
184
|
+
const kind = inferWorkbenchPortKind(port);
|
|
185
|
+
const entityShape = getWorkbenchEntityPortShape(port.itemKind);
|
|
186
|
+
const modelShape = getWorkbenchModelPortShape(port.modelName);
|
|
187
|
+
const inferredShape = port.shape && port.shape.length > 0
|
|
188
|
+
? port.shape
|
|
189
|
+
: entityShape.length > 0
|
|
190
|
+
? entityShape
|
|
191
|
+
: modelShape;
|
|
192
|
+
return {
|
|
193
|
+
...port,
|
|
194
|
+
kind,
|
|
195
|
+
shape: inferredShape.length > 0 ? inferredShape : []
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
export function normalizeWorkbenchPortDefinitions(ports) {
|
|
199
|
+
return ports.map((port) => normalizeWorkbenchPortDefinition(port));
|
|
200
|
+
}
|
|
1
201
|
export function defineWorkbenchComponent(component, workbench) {
|
|
2
202
|
return Object.assign(component, {
|
|
3
203
|
workbench: {
|
|
@@ -1,22 +1,49 @@
|
|
|
1
1
|
import { MiniCalendarWidget, QuickCaptureWidget, SpotifyWidget, TimeWidget, WeatherWidget } from "../../components/customization/utility-widgets.js";
|
|
2
|
+
import { InsightsCoachingBox, InsightsFeedBox } from "../../components/workbench-boxes/insights/insights-boxes.js";
|
|
2
3
|
import { KanbanBoardBox, KanbanFiltersBox, KanbanSummaryBox } from "../../components/workbench-boxes/kanban/kanban-boxes.js";
|
|
4
|
+
import { CalendarEventsBox, CalendarOverviewBox, CalendarPlanningBox } from "../../components/workbench-boxes/calendar/calendar-boxes.js";
|
|
5
|
+
import { GoalsHeroBox, GoalsSearchResultsBox, GoalsSummaryBox } from "../../components/workbench-boxes/goals/goals-boxes.js";
|
|
6
|
+
import { HabitsHeroBox, HabitsSearchResultsBox, HabitsSummaryBox } from "../../components/workbench-boxes/habits/habits-boxes.js";
|
|
3
7
|
import { SleepBrowserBox, SleepPatternsBox, SleepSummaryBox, SportsBrowserBox, SportsCompositionBox, SportsSummaryBox } from "../../components/workbench-boxes/health/health-boxes.js";
|
|
4
8
|
import { MovementDataBrowserBox, MovementPlacesBox, MovementSelectionBox, MovementSummaryBox, MovementTimelineBox } from "../../components/workbench-boxes/movement/movement-boxes.js";
|
|
5
9
|
import { NoteComposerBox, NoteFiltersBox, NotesLibraryBox } from "../../components/workbench-boxes/notes/notes-boxes.js";
|
|
10
|
+
import { OverviewInsightsBox, OverviewMomentumBox, OverviewSnapshotBox } from "../../components/workbench-boxes/overview/overview-boxes.js";
|
|
6
11
|
import { ProjectsHeroBox, ProjectsSearchResultsBox, ProjectsSummaryBox } from "../../components/workbench-boxes/projects/projects-boxes.js";
|
|
12
|
+
import { PreferencesContextsBox, PreferencesItemsBox, PreferencesWorkspaceBox } from "../../components/workbench-boxes/preferences/preferences-boxes.js";
|
|
13
|
+
import { PsycheOverviewBox, PsycheReportsBox, PsycheValuesBox } from "../../components/workbench-boxes/psyche/psyche-boxes.js";
|
|
14
|
+
import { QuestionnairesDraftingBox, QuestionnairesLibraryBox, QuestionnairesObservationBox } from "../../components/workbench-boxes/questionnaires/questionnaires-boxes.js";
|
|
15
|
+
import { WeeklyReviewRewardBox, WeeklyReviewSummaryBox } from "../../components/workbench-boxes/review/review-boxes.js";
|
|
16
|
+
import { StrategiesHeroBox, StrategiesSearchResultsBox, StrategiesSummaryBox } from "../../components/workbench-boxes/strategies/strategies-boxes.js";
|
|
17
|
+
import { TasksFocusBox, TasksInboxBox, TasksSummaryBox } from "../../components/workbench-boxes/tasks/tasks-boxes.js";
|
|
7
18
|
import { TodayCalendarBox, TodayFocusBox, TodayHeroBox, TodayMetricsBox, TodayRunwayBox } from "../../components/workbench-boxes/today/today-boxes.js";
|
|
19
|
+
import { WikiAuthoringBox, WikiHealthBox, WikiPagesBox } from "../../components/workbench-boxes/wiki/wiki-boxes.js";
|
|
20
|
+
import { normalizeWorkbenchPortDefinitions } from "./nodes.js";
|
|
8
21
|
export const WORKBENCH_COMPONENT_AUTOLOAD = [
|
|
9
22
|
TimeWidget,
|
|
10
23
|
MiniCalendarWidget,
|
|
11
24
|
SpotifyWidget,
|
|
12
25
|
WeatherWidget,
|
|
13
26
|
QuickCaptureWidget,
|
|
27
|
+
CalendarOverviewBox,
|
|
28
|
+
CalendarEventsBox,
|
|
29
|
+
CalendarPlanningBox,
|
|
30
|
+
GoalsHeroBox,
|
|
31
|
+
GoalsSearchResultsBox,
|
|
32
|
+
GoalsSummaryBox,
|
|
33
|
+
HabitsHeroBox,
|
|
34
|
+
HabitsSearchResultsBox,
|
|
35
|
+
HabitsSummaryBox,
|
|
36
|
+
InsightsFeedBox,
|
|
37
|
+
InsightsCoachingBox,
|
|
14
38
|
KanbanSummaryBox,
|
|
15
39
|
KanbanFiltersBox,
|
|
16
40
|
KanbanBoardBox,
|
|
17
41
|
NoteFiltersBox,
|
|
18
42
|
NoteComposerBox,
|
|
19
43
|
NotesLibraryBox,
|
|
44
|
+
OverviewSnapshotBox,
|
|
45
|
+
OverviewMomentumBox,
|
|
46
|
+
OverviewInsightsBox,
|
|
20
47
|
MovementSummaryBox,
|
|
21
48
|
MovementSelectionBox,
|
|
22
49
|
MovementTimelineBox,
|
|
@@ -31,11 +58,31 @@ export const WORKBENCH_COMPONENT_AUTOLOAD = [
|
|
|
31
58
|
ProjectsHeroBox,
|
|
32
59
|
ProjectsSearchResultsBox,
|
|
33
60
|
ProjectsSummaryBox,
|
|
61
|
+
PreferencesWorkspaceBox,
|
|
62
|
+
PreferencesContextsBox,
|
|
63
|
+
PreferencesItemsBox,
|
|
64
|
+
PsycheOverviewBox,
|
|
65
|
+
PsycheValuesBox,
|
|
66
|
+
PsycheReportsBox,
|
|
67
|
+
QuestionnairesLibraryBox,
|
|
68
|
+
QuestionnairesDraftingBox,
|
|
69
|
+
QuestionnairesObservationBox,
|
|
70
|
+
WeeklyReviewSummaryBox,
|
|
71
|
+
WeeklyReviewRewardBox,
|
|
72
|
+
StrategiesHeroBox,
|
|
73
|
+
StrategiesSearchResultsBox,
|
|
74
|
+
StrategiesSummaryBox,
|
|
75
|
+
TasksInboxBox,
|
|
76
|
+
TasksFocusBox,
|
|
77
|
+
TasksSummaryBox,
|
|
34
78
|
TodayHeroBox,
|
|
35
79
|
TodayMetricsBox,
|
|
36
80
|
TodayRunwayBox,
|
|
37
81
|
TodayCalendarBox,
|
|
38
|
-
TodayFocusBox
|
|
82
|
+
TodayFocusBox,
|
|
83
|
+
WikiPagesBox,
|
|
84
|
+
WikiHealthBox,
|
|
85
|
+
WikiAuthoringBox
|
|
39
86
|
];
|
|
40
87
|
const REGISTRY = new Map(WORKBENCH_COMPONENT_AUTOLOAD
|
|
41
88
|
.filter((component) => component.workbench)
|
|
@@ -62,11 +109,11 @@ export function getWorkbenchNodeCatalog() {
|
|
|
62
109
|
"content",
|
|
63
110
|
...(definition.tools.length > 0 ? ["tool"] : [])
|
|
64
111
|
],
|
|
65
|
-
inputs: definition.inputs,
|
|
66
|
-
params: definition.params,
|
|
67
|
-
output: definition.output,
|
|
112
|
+
inputs: normalizeWorkbenchPortDefinitions(definition.inputs),
|
|
113
|
+
params: normalizeWorkbenchPortDefinitions(definition.params),
|
|
114
|
+
output: normalizeWorkbenchPortDefinitions(definition.output),
|
|
68
115
|
tools: definition.tools,
|
|
69
|
-
outputs: definition.output,
|
|
116
|
+
outputs: normalizeWorkbenchPortDefinitions(definition.output),
|
|
70
117
|
toolAdapters: definition.tools,
|
|
71
118
|
snapshotResolverKey: undefined
|
|
72
119
|
}));
|