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.
Files changed (108) hide show
  1. package/README.md +59 -3
  2. package/dist/assets/{board-ta0rUHOf.js → board-C6jCchjI.js} +2 -2
  3. package/dist/assets/{board-ta0rUHOf.js.map → board-C6jCchjI.js.map} +1 -1
  4. package/dist/assets/index-DVvS8iiU.css +1 -0
  5. package/dist/assets/index-zYB-9Dfo.js +85 -0
  6. package/dist/assets/index-zYB-9Dfo.js.map +1 -0
  7. package/dist/assets/knowledge-graph-layout.worker-DRvzPxhP.js +2 -0
  8. package/dist/assets/knowledge-graph-layout.worker-DRvzPxhP.js.map +1 -0
  9. package/dist/assets/{motion-fBKPB6yw.js → motion-DFHrH2rd.js} +2 -2
  10. package/dist/assets/{motion-fBKPB6yw.js.map → motion-DFHrH2rd.js.map} +1 -1
  11. package/dist/assets/{table-C-IGTQni.js → table-ZL7Di_u3.js} +2 -2
  12. package/dist/assets/{table-C-IGTQni.js.map → table-ZL7Di_u3.js.map} +1 -1
  13. package/dist/assets/{ui-DInOpaYF.js → ui-CKNPpz7q.js} +2 -2
  14. package/dist/assets/{ui-DInOpaYF.js.map → ui-CKNPpz7q.js.map} +1 -1
  15. package/dist/assets/vendor-DoNZuFhn.js +1247 -0
  16. package/dist/assets/vendor-DoNZuFhn.js.map +1 -0
  17. package/dist/index.html +7 -7
  18. package/dist/openclaw/local-runtime.js +16 -0
  19. package/dist/openclaw/routes.d.ts +27 -0
  20. package/dist/openclaw/routes.js +16 -12
  21. package/dist/server/server/migrations/037_workbench_public_inputs_and_run_inputs.sql +5 -0
  22. package/dist/server/server/migrations/038_data_management_settings.sql +11 -0
  23. package/dist/server/server/migrations/039_life_force_and_action_points.sql +114 -0
  24. package/dist/server/server/migrations/040_screen_time_domain.sql +89 -0
  25. package/dist/server/server/migrations/041_companion_source_states.sql +21 -0
  26. package/dist/server/server/migrations/042_movement_boxes.sql +47 -0
  27. package/dist/server/server/migrations/043_movement_box_overlap_overrides.sql +26 -0
  28. package/dist/server/server/src/app.js +1684 -117
  29. package/dist/server/server/src/connectors/box-registry.js +44 -9
  30. package/dist/server/server/src/data-management-types.js +107 -0
  31. package/dist/server/server/src/db.js +68 -4
  32. package/dist/server/server/src/demo-data.js +2 -2
  33. package/dist/server/server/src/health.js +702 -18
  34. package/dist/server/server/src/managers/platform/llm-manager.js +7 -4
  35. package/dist/server/server/src/managers/platform/mock-workbench-provider.js +149 -0
  36. package/dist/server/server/src/managers/platform/secrets-manager.js +18 -1
  37. package/dist/server/server/src/managers/runtime.js +9 -0
  38. package/dist/server/server/src/movement.js +1971 -112
  39. package/dist/server/server/src/openapi.js +489 -1
  40. package/dist/server/server/src/psyche-types.js +9 -1
  41. package/dist/server/server/src/repositories/activity-events.js +8 -0
  42. package/dist/server/server/src/repositories/ai-connectors.js +522 -74
  43. package/dist/server/server/src/repositories/habits.js +37 -1
  44. package/dist/server/server/src/repositories/model-settings.js +13 -3
  45. package/dist/server/server/src/repositories/notes.js +3 -0
  46. package/dist/server/server/src/repositories/settings.js +380 -18
  47. package/dist/server/server/src/repositories/tasks.js +170 -10
  48. package/dist/server/server/src/runtime-data-root.js +82 -0
  49. package/dist/server/server/src/screen-time.js +802 -0
  50. package/dist/server/server/src/services/data-management.js +788 -0
  51. package/dist/server/server/src/services/entity-crud.js +205 -2
  52. package/dist/server/server/src/services/knowledge-graph.js +1455 -0
  53. package/dist/server/server/src/services/life-force-model.js +197 -0
  54. package/dist/server/server/src/services/life-force.js +1270 -0
  55. package/dist/server/server/src/services/psyche-observation-calendar.js +383 -16
  56. package/dist/server/server/src/types.js +286 -13
  57. package/dist/server/server/src/web.js +228 -13
  58. package/dist/server/src/components/customization/utility-widgets.js +136 -27
  59. package/dist/server/src/components/ui/info-tooltip.js +25 -0
  60. package/dist/server/src/components/workbench-boxes/calendar/calendar-boxes.js +78 -0
  61. package/dist/server/src/components/workbench-boxes/goals/goals-boxes.js +62 -0
  62. package/dist/server/src/components/workbench-boxes/habits/habits-boxes.js +62 -0
  63. package/dist/server/src/components/workbench-boxes/health/health-boxes.js +63 -8
  64. package/dist/server/src/components/workbench-boxes/insights/insights-boxes.js +50 -0
  65. package/dist/server/src/components/workbench-boxes/kanban/kanban-boxes.js +62 -54
  66. package/dist/server/src/components/workbench-boxes/movement/movement-boxes.js +18 -8
  67. package/dist/server/src/components/workbench-boxes/notes/notes-boxes.js +56 -38
  68. package/dist/server/src/components/workbench-boxes/overview/overview-boxes.js +65 -0
  69. package/dist/server/src/components/workbench-boxes/preferences/preferences-boxes.js +78 -0
  70. package/dist/server/src/components/workbench-boxes/projects/projects-boxes.js +35 -30
  71. package/dist/server/src/components/workbench-boxes/psyche/psyche-boxes.js +88 -0
  72. package/dist/server/src/components/workbench-boxes/questionnaires/questionnaires-boxes.js +61 -0
  73. package/dist/server/src/components/workbench-boxes/review/review-boxes.js +53 -0
  74. package/dist/server/src/components/workbench-boxes/shared/define-workbench-box.js +3 -1
  75. package/dist/server/src/components/workbench-boxes/shared/generic-node-view.js +39 -3
  76. package/dist/server/src/components/workbench-boxes/strategies/strategies-boxes.js +62 -0
  77. package/dist/server/src/components/workbench-boxes/tasks/tasks-boxes.js +76 -0
  78. package/dist/server/src/components/workbench-boxes/today/today-boxes.js +47 -32
  79. package/dist/server/src/components/workbench-boxes/wiki/wiki-boxes.js +60 -0
  80. package/dist/server/src/lib/api.js +280 -21
  81. package/dist/server/src/lib/data-management-types.js +1 -0
  82. package/dist/server/src/lib/entity-visuals.js +279 -0
  83. package/dist/server/src/lib/knowledge-graph-types.js +276 -0
  84. package/dist/server/src/lib/knowledge-graph.js +470 -0
  85. package/dist/server/src/lib/schemas.js +4 -0
  86. package/dist/server/src/lib/snapshot-normalizer.js +43 -1
  87. package/dist/server/src/lib/workbench/contracts.js +229 -0
  88. package/dist/server/src/lib/workbench/nodes.js +200 -0
  89. package/dist/server/src/lib/workbench/registry.js +52 -5
  90. package/dist/server/src/lib/workbench/runtime.js +254 -38
  91. package/dist/server/src/lib/workbench/tool-catalog.js +68 -0
  92. package/openclaw.plugin.json +1 -1
  93. package/package.json +1 -1
  94. package/server/migrations/037_workbench_public_inputs_and_run_inputs.sql +5 -0
  95. package/server/migrations/038_data_management_settings.sql +11 -0
  96. package/server/migrations/039_life_force_and_action_points.sql +114 -0
  97. package/server/migrations/040_screen_time_domain.sql +89 -0
  98. package/server/migrations/041_companion_source_states.sql +21 -0
  99. package/server/migrations/042_movement_boxes.sql +47 -0
  100. package/server/migrations/043_movement_box_overlap_overrides.sql +26 -0
  101. package/skills/forge-openclaw/SKILL.md +24 -11
  102. package/skills/forge-openclaw/entity_conversation_playbooks.md +210 -34
  103. package/skills/forge-openclaw/psyche_entity_playbooks.md +113 -17
  104. package/dist/assets/index-Ro0ZF_az.css +0 -1
  105. package/dist/assets/index-ytlpSj23.js +0 -79
  106. package/dist/assets/index-ytlpSj23.js.map +0 -1
  107. package/dist/assets/vendor-lE3tZJcC.js +0 -876
  108. package/dist/assets/vendor-lE3tZJcC.js.map +0 -1
@@ -0,0 +1,65 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { buildInsightsWorkbenchExecution, buildOverviewWorkbenchExecution, buildStaticWorkbenchExecution } from "../../../lib/workbench/runtime.js";
3
+ import { createContextOutput, createSummaryOutput } from "../../../lib/workbench/contracts.js";
4
+ import { createGenericWorkbenchNodeView } from "../shared/generic-node-view.js";
5
+ import { defineWorkbenchBox } from "../shared/define-workbench-box.js";
6
+ function Slot({ children }) {
7
+ return _jsx(_Fragment, { children: children });
8
+ }
9
+ function defineOverviewBox(id, title, description, tags, execute, output) {
10
+ return defineWorkbenchBox(Slot, {
11
+ id,
12
+ surfaceId: "overview",
13
+ routePath: "/overview",
14
+ title,
15
+ icon: "overview",
16
+ description,
17
+ category: "Overview",
18
+ tags,
19
+ inputs: [],
20
+ params: [],
21
+ output,
22
+ tools: [],
23
+ NodeView: createGenericWorkbenchNodeView({
24
+ title,
25
+ description,
26
+ inputs: [],
27
+ params: [],
28
+ output,
29
+ tools: []
30
+ }),
31
+ execute
32
+ });
33
+ }
34
+ export const OverviewSnapshotBox = defineOverviewBox("surface:overview:snapshot", "Forge snapshot", "Live overview of goals, projects, tasks, habits, and current operating pressure.", ["overview", "snapshot"], (input) => buildOverviewWorkbenchExecution(input), [
35
+ createSummaryOutput({
36
+ label: "Overview summary",
37
+ description: "Compact summary of goals, projects, tasks, and habits."
38
+ }),
39
+ createContextOutput({
40
+ key: "context",
41
+ label: "Overview context",
42
+ description: "Structured Forge overview context for the current operating picture.",
43
+ modelName: "ForgeOverviewContext"
44
+ })
45
+ ]);
46
+ export const OverviewMomentumBox = defineOverviewBox("surface:overview:momentum", "Momentum and health", "Momentum-focused summary of streaks, neglected areas, and active execution pressure.", ["overview", "momentum"], (input) => buildStaticWorkbenchExecution(input, {
47
+ dimensions: ["momentum", "neglected_goals", "domain_balance"]
48
+ }, "Overview momentum surface tracking neglected goals, domain balance, and execution pressure."), [
49
+ createSummaryOutput({
50
+ label: "Momentum summary",
51
+ description: "Summary of momentum, neglected goals, and execution pressure."
52
+ })
53
+ ]);
54
+ export const OverviewInsightsBox = defineOverviewBox("surface:overview:insights", "Overview insights", "Insight-oriented summary of the current Forge operating picture.", ["overview", "insights"], (input) => buildInsightsWorkbenchExecution(input), [
55
+ createSummaryOutput({
56
+ label: "Insight summary",
57
+ description: "Compact explanation of the current insight payload."
58
+ }),
59
+ createContextOutput({
60
+ key: "insights",
61
+ label: "Insight payload",
62
+ description: "Structured insight and coaching payload returned by Forge.",
63
+ modelName: "ForgeInsightsPayload"
64
+ })
65
+ ]);
@@ -0,0 +1,78 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { buildSearchWorkbenchExecution, buildStaticWorkbenchExecution } from "../../../lib/workbench/runtime.js";
3
+ import { createSearchEntitiesTool, createSearchInputs, createSearchOutputs, createSearchParams, createSummaryOutput } from "../../../lib/workbench/contracts.js";
4
+ import { createGenericWorkbenchNodeView } from "../shared/generic-node-view.js";
5
+ import { defineWorkbenchBox } from "../shared/define-workbench-box.js";
6
+ function Slot({ children }) {
7
+ return _jsx(_Fragment, { children: children });
8
+ }
9
+ function definePreferencesBox(id, title, description, tags, execute, output, tools = [], options) {
10
+ const inputs = options?.inputs ?? [];
11
+ const params = options?.params ?? [];
12
+ return defineWorkbenchBox(Slot, {
13
+ id,
14
+ surfaceId: "preferences",
15
+ routePath: "/preferences",
16
+ title,
17
+ icon: "preferences",
18
+ description,
19
+ category: "Preferences",
20
+ tags,
21
+ inputs,
22
+ params,
23
+ output,
24
+ tools,
25
+ NodeView: createGenericWorkbenchNodeView({
26
+ title,
27
+ description,
28
+ inputs,
29
+ params,
30
+ output,
31
+ tools
32
+ }),
33
+ execute
34
+ });
35
+ }
36
+ export const PreferencesWorkspaceBox = definePreferencesBox("surface:preferences:workspace", "Preferences workspace", "Main preference modeling workspace, including summaries, tradeoffs, and evidence.", ["preferences", "workspace"], (input) => buildStaticWorkbenchExecution(input, {
37
+ surfaces: ["summary", "comparison_game", "evidence"]
38
+ }, "Preferences workspace with summary, pairwise comparison, and evidence views."), [createSummaryOutput({ label: "Preference summary", description: "Summary of the active preference modeling workspace." })]);
39
+ export const PreferencesContextsBox = definePreferencesBox("surface:preferences:contexts", "Preference contexts", "Preference contexts that shape which tradeoffs and evidence are active.", ["preferences", "contexts"], (input) => buildSearchWorkbenchExecution(input, {
40
+ query: "",
41
+ entityTypes: ["preference_context"],
42
+ limit: 20
43
+ }), createSearchOutputs({
44
+ itemKind: "preference_context",
45
+ itemLabel: "Preference context"
46
+ }), [createSearchEntitiesTool("Search preference contexts and modeled preference items.")], {
47
+ inputs: createSearchInputs({
48
+ itemKind: "preference_context",
49
+ itemLabel: "Preference context",
50
+ defaultEntityTypes: ["preference_context"],
51
+ defaultLimit: 20
52
+ }),
53
+ params: createSearchParams({
54
+ itemKind: "preference_context",
55
+ defaultEntityTypes: ["preference_context"],
56
+ defaultLimit: 20
57
+ })
58
+ });
59
+ export const PreferencesItemsBox = definePreferencesBox("surface:preferences:items", "Preference items", "Preference items scored and compared inside the active context.", ["preferences", "items"], (input) => buildSearchWorkbenchExecution(input, {
60
+ query: "",
61
+ entityTypes: ["preference_item"],
62
+ limit: 20
63
+ }), createSearchOutputs({
64
+ itemKind: "preference_item",
65
+ itemLabel: "Preference item"
66
+ }), [createSearchEntitiesTool("Search preference contexts and modeled preference items.")], {
67
+ inputs: createSearchInputs({
68
+ itemKind: "preference_item",
69
+ itemLabel: "Preference item",
70
+ defaultEntityTypes: ["preference_item"],
71
+ defaultLimit: 20
72
+ }),
73
+ params: createSearchParams({
74
+ itemKind: "preference_item",
75
+ defaultEntityTypes: ["preference_item"],
76
+ defaultLimit: 20
77
+ })
78
+ });
@@ -1,11 +1,14 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { buildSearchWorkbenchExecution, buildStaticWorkbenchExecution } from "../../../lib/workbench/runtime.js";
3
+ import { createSearchEntitiesTool, createSearchInputs, createSearchOutputs, createSearchParams, createSummaryOutput } from "../../../lib/workbench/contracts.js";
3
4
  import { createGenericWorkbenchNodeView } from "../shared/generic-node-view.js";
4
5
  import { defineWorkbenchBox } from "../shared/define-workbench-box.js";
5
6
  function Slot({ children }) {
6
7
  return _jsx(_Fragment, { children: children });
7
8
  }
8
- function defineProjectBox(id, title, description, tags, execute) {
9
+ function defineProjectBox(id, title, description, tags, execute, output, tools = [], options) {
10
+ const inputs = options?.inputs ?? [];
11
+ const params = options?.params ?? [];
9
12
  return defineWorkbenchBox(Slot, {
10
13
  id,
11
14
  surfaceId: "projects",
@@ -15,43 +18,45 @@ function defineProjectBox(id, title, description, tags, execute) {
15
18
  description,
16
19
  category: "Projects",
17
20
  tags,
18
- inputs: [],
19
- params: [],
20
- output: [{ key: "primary", label: title, kind: "content" }],
21
- tools: id === "surface:projects:search-results"
22
- ? [
23
- {
24
- key: "forge.search_entities",
25
- label: "Search Forge entities",
26
- description: "Search Forge entities by query and entity types.",
27
- accessMode: "read"
28
- }
29
- ]
30
- : [],
21
+ inputs,
22
+ params,
23
+ output,
24
+ tools,
31
25
  NodeView: createGenericWorkbenchNodeView({
32
26
  title,
33
27
  description,
34
- inputs: [],
35
- params: [],
36
- output: [{ key: "primary", label: title, kind: "content" }],
37
- tools: id === "surface:projects:search-results"
38
- ? [
39
- {
40
- key: "forge.search_entities",
41
- label: "Search Forge entities",
42
- description: "Search Forge entities by query and entity types.",
43
- accessMode: "read"
44
- }
45
- ]
46
- : []
28
+ inputs,
29
+ params,
30
+ output,
31
+ tools
47
32
  }),
48
33
  execute
49
34
  });
50
35
  }
51
- export const ProjectsHeroBox = defineProjectBox("surface:projects:hero", "Projects hero", "Projects page header.", ["projects", "hero"], (input) => buildStaticWorkbenchExecution(input, null, "Projects page header."));
36
+ export const ProjectsHeroBox = defineProjectBox("surface:projects:hero", "Projects hero", "Projects page header.", ["projects", "hero"], (input) => buildStaticWorkbenchExecution(input, null, "Projects page header."), [createSummaryOutput({ label: "Projects summary", description: "High-level projects page framing." })]);
52
37
  export const ProjectsSearchResultsBox = defineProjectBox("surface:projects:search-results", "Search and results", "Project browser, filters, and search context.", ["projects", "search"], (input) => buildSearchWorkbenchExecution(input, {
53
38
  query: "",
54
39
  entityTypes: ["project"],
55
40
  limit: 20
56
- }));
57
- export const ProjectsSummaryBox = defineProjectBox("surface:projects:summary", "Collection summary", "Collection summary and project state metrics.", ["projects", "summary"], (input) => buildStaticWorkbenchExecution(input, null, "Project collection summary."));
41
+ }), createSearchOutputs({
42
+ itemKind: "project",
43
+ itemLabel: "Project"
44
+ }), [createSearchEntitiesTool("Search project entities by query and entity types.")], {
45
+ inputs: createSearchInputs({
46
+ itemKind: "project",
47
+ itemLabel: "Project",
48
+ defaultEntityTypes: ["project"],
49
+ defaultLimit: 20
50
+ }),
51
+ params: createSearchParams({
52
+ itemKind: "project",
53
+ defaultEntityTypes: ["project"],
54
+ defaultLimit: 20
55
+ })
56
+ });
57
+ export const ProjectsSummaryBox = defineProjectBox("surface:projects:summary", "Collection summary", "Collection summary and project state metrics.", ["projects", "summary"], (input) => buildStaticWorkbenchExecution(input, null, "Project collection summary."), [
58
+ createSummaryOutput({
59
+ label: "Project summary",
60
+ description: "Summary of the project collection and current state."
61
+ })
62
+ ]);
@@ -0,0 +1,88 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { buildSearchWorkbenchExecution, buildStaticWorkbenchExecution } from "../../../lib/workbench/runtime.js";
3
+ import { createSearchEntitiesTool, createSearchInputs, createSearchOutputs, createSearchParams, createSummaryOutput } from "../../../lib/workbench/contracts.js";
4
+ import { createGenericWorkbenchNodeView } from "../shared/generic-node-view.js";
5
+ import { defineWorkbenchBox } from "../shared/define-workbench-box.js";
6
+ function Slot({ children }) {
7
+ return _jsx(_Fragment, { children: children });
8
+ }
9
+ function definePsycheBox(id, title, description, tags, execute, output, tools = [], options) {
10
+ const inputs = options?.inputs ?? [];
11
+ const params = options?.params ?? [];
12
+ return defineWorkbenchBox(Slot, {
13
+ id,
14
+ surfaceId: "psyche",
15
+ routePath: "/psyche",
16
+ title,
17
+ icon: "psyche",
18
+ description,
19
+ category: "Psyche",
20
+ tags,
21
+ inputs,
22
+ params,
23
+ output,
24
+ tools,
25
+ NodeView: createGenericWorkbenchNodeView({
26
+ title,
27
+ description,
28
+ inputs,
29
+ params,
30
+ output,
31
+ tools
32
+ }),
33
+ execute
34
+ });
35
+ }
36
+ export const PsycheOverviewBox = definePsycheBox("surface:psyche:overview", "Psyche overview", "High-level overview of values, patterns, beliefs, modes, and reports.", ["psyche", "overview"], (input) => buildStaticWorkbenchExecution(input, {
37
+ surfaces: ["values", "patterns", "beliefs", "modes", "reports"]
38
+ }, "Psyche overview spanning values, patterns, beliefs, modes, and reports."), [createSummaryOutput({ label: "Psyche summary", description: "Summary of values, patterns, beliefs, modes, and reports." })]);
39
+ export const PsycheValuesBox = definePsycheBox("surface:psyche:values", "Psyche values", "Values and long-lived internal directions tracked inside Forge.", ["psyche", "values"], (input) => buildSearchWorkbenchExecution(input, {
40
+ query: "",
41
+ entityTypes: ["psyche_value"],
42
+ limit: 20
43
+ }), createSearchOutputs({
44
+ itemKind: "psyche_value",
45
+ itemLabel: "Psyche value"
46
+ }), [createSearchEntitiesTool("Search psyche entities and reflective records.")], {
47
+ inputs: createSearchInputs({
48
+ itemKind: "psyche_value",
49
+ itemLabel: "Psyche value",
50
+ defaultEntityTypes: ["psyche_value"],
51
+ defaultLimit: 20
52
+ }),
53
+ params: createSearchParams({
54
+ itemKind: "psyche_value",
55
+ defaultEntityTypes: ["psyche_value"],
56
+ defaultLimit: 20
57
+ })
58
+ });
59
+ export const PsycheReportsBox = definePsycheBox("surface:psyche:reports", "Trigger reports", "Trigger reports and behavior-pattern signals linked to reflective work.", ["psyche", "reports", "patterns"], (input) => buildSearchWorkbenchExecution(input, {
60
+ query: "",
61
+ entityTypes: ["trigger_report", "behavior_pattern", "belief_entry", "mode_profile"],
62
+ limit: 20
63
+ }), createSearchOutputs({
64
+ itemKind: "psyche_record",
65
+ itemLabel: "Psyche record"
66
+ }), [createSearchEntitiesTool("Search psyche entities and reflective records.")], {
67
+ inputs: createSearchInputs({
68
+ itemKind: "psyche_record",
69
+ itemLabel: "Psyche record",
70
+ defaultEntityTypes: [
71
+ "trigger_report",
72
+ "behavior_pattern",
73
+ "belief_entry",
74
+ "mode_profile"
75
+ ],
76
+ defaultLimit: 20
77
+ }),
78
+ params: createSearchParams({
79
+ itemKind: "psyche_record",
80
+ defaultEntityTypes: [
81
+ "trigger_report",
82
+ "behavior_pattern",
83
+ "belief_entry",
84
+ "mode_profile"
85
+ ],
86
+ defaultLimit: 20
87
+ })
88
+ });
@@ -0,0 +1,61 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { buildSearchWorkbenchExecution, buildStaticWorkbenchExecution } from "../../../lib/workbench/runtime.js";
3
+ import { createSearchEntitiesTool, createSearchInputs, createSearchOutputs, createSearchParams, createSummaryOutput } from "../../../lib/workbench/contracts.js";
4
+ import { createGenericWorkbenchNodeView } from "../shared/generic-node-view.js";
5
+ import { defineWorkbenchBox } from "../shared/define-workbench-box.js";
6
+ function Slot({ children }) {
7
+ return _jsx(_Fragment, { children: children });
8
+ }
9
+ function defineQuestionnaireBox(id, title, description, tags, execute, output, tools = [], options) {
10
+ const inputs = options?.inputs ?? [];
11
+ const params = options?.params ?? [];
12
+ return defineWorkbenchBox(Slot, {
13
+ id,
14
+ surfaceId: "questionnaires",
15
+ routePath: "/psyche/questionnaires",
16
+ title,
17
+ icon: "questionnaire",
18
+ description,
19
+ category: "Questionnaires",
20
+ tags,
21
+ inputs,
22
+ params,
23
+ output,
24
+ tools,
25
+ NodeView: createGenericWorkbenchNodeView({
26
+ title,
27
+ description,
28
+ inputs,
29
+ params,
30
+ output,
31
+ tools
32
+ }),
33
+ execute
34
+ });
35
+ }
36
+ export const QuestionnairesLibraryBox = defineQuestionnaireBox("surface:questionnaires:library", "Questionnaire library", "Library of questionnaire instruments available in Forge.", ["questionnaires", "library"], (input) => buildSearchWorkbenchExecution(input, {
37
+ query: "",
38
+ entityTypes: ["questionnaire_instrument"],
39
+ limit: 20
40
+ }), createSearchOutputs({
41
+ itemKind: "questionnaire_instrument",
42
+ itemLabel: "Questionnaire"
43
+ }), [createSearchEntitiesTool("Search questionnaire instruments and related records.")], {
44
+ inputs: createSearchInputs({
45
+ itemKind: "questionnaire_instrument",
46
+ itemLabel: "Questionnaire",
47
+ defaultEntityTypes: ["questionnaire_instrument"],
48
+ defaultLimit: 20
49
+ }),
50
+ params: createSearchParams({
51
+ itemKind: "questionnaire_instrument",
52
+ defaultEntityTypes: ["questionnaire_instrument"],
53
+ defaultLimit: 20
54
+ })
55
+ });
56
+ export const QuestionnairesDraftingBox = defineQuestionnaireBox("surface:questionnaires:drafting", "Questionnaire drafting", "Drafting and publishing context for questionnaire instruments.", ["questionnaires", "drafting", "authoring"], (input) => buildStaticWorkbenchExecution(input, {
57
+ states: ["draft", "published", "run"]
58
+ }, "Questionnaire drafting surface with draft, publish, and run lifecycle context."), [createSummaryOutput({ label: "Drafting summary", description: "Summary of questionnaire drafting and lifecycle context." })]);
59
+ export const QuestionnairesObservationBox = defineQuestionnaireBox("surface:questionnaires:self-observation", "Self-observation calendar", "Calendar of self-observation notes and linked psyche context.", ["questionnaires", "self-observation", "psyche"], (input) => buildStaticWorkbenchExecution(input, {
60
+ linkedDomains: ["patterns", "reports", "notes"]
61
+ }, "Self-observation calendar surface with linked psyche context."), [createSummaryOutput({ label: "Observation summary", description: "Summary of the self-observation calendar and linked psyche context." })]);
@@ -0,0 +1,53 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { buildStaticWorkbenchExecution, buildWeeklyReviewWorkbenchExecution } from "../../../lib/workbench/runtime.js";
3
+ import { createContextOutput, createSummaryOutput } from "../../../lib/workbench/contracts.js";
4
+ import { createGenericWorkbenchNodeView } from "../shared/generic-node-view.js";
5
+ import { defineWorkbenchBox } from "../shared/define-workbench-box.js";
6
+ function Slot({ children }) {
7
+ return _jsx(_Fragment, { children: children });
8
+ }
9
+ function defineReviewBox(id, title, description, tags, execute, output) {
10
+ return defineWorkbenchBox(Slot, {
11
+ id,
12
+ surfaceId: "review",
13
+ routePath: "/review/weekly",
14
+ title,
15
+ icon: "review",
16
+ description,
17
+ category: "Review",
18
+ tags,
19
+ inputs: [],
20
+ params: [],
21
+ output,
22
+ tools: [],
23
+ NodeView: createGenericWorkbenchNodeView({
24
+ title,
25
+ description,
26
+ inputs: [],
27
+ params: [],
28
+ output,
29
+ tools: []
30
+ }),
31
+ execute
32
+ });
33
+ }
34
+ export const WeeklyReviewSummaryBox = defineReviewBox("surface:review:weekly-summary", "Weekly review summary", "Weekly review payload with momentum, wins, calibration, and completion state.", ["review", "weekly"], (input) => buildWeeklyReviewWorkbenchExecution(input), [
35
+ createSummaryOutput({
36
+ label: "Weekly review summary",
37
+ description: "Summary of momentum, wins, calibration, and review completion state."
38
+ }),
39
+ createContextOutput({
40
+ key: "weeklyReview",
41
+ label: "Weekly review payload",
42
+ description: "Structured weekly review payload returned by Forge.",
43
+ modelName: "ForgeWeeklyReview"
44
+ })
45
+ ]);
46
+ export const WeeklyReviewRewardBox = defineReviewBox("surface:review:reward", "Review reward", "Reward framing and completion incentive for closing the current review cycle.", ["review", "reward"], (input) => buildStaticWorkbenchExecution(input, {
47
+ reward: "weekly_review_completion"
48
+ }, "Weekly review reward surface for locking the current cycle into evidence."), [
49
+ createSummaryOutput({
50
+ label: "Review reward summary",
51
+ description: "Summary of the reward framing for closing the current review cycle."
52
+ })
53
+ ]);
@@ -1,4 +1,6 @@
1
1
  import { defineWorkbenchComponent } from "../../../lib/workbench/nodes.js";
2
2
  export function defineWorkbenchBox(component, definition) {
3
- return defineWorkbenchComponent(component, definition);
3
+ const WorkbenchBoxComponent = (props) => component(props);
4
+ WorkbenchBoxComponent.displayName = definition.title.replace(/\s+/g, "");
5
+ return defineWorkbenchComponent(WorkbenchBoxComponent, definition);
4
6
  }
@@ -1,13 +1,49 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Handle, Position } from "@xyflow/react";
3
+ import { useState } from "react";
4
+ import { InfoTooltip } from "../../../components/ui/info-tooltip.js";
3
5
  import { cn } from "../../../lib/utils.js";
6
+ function describePort(port) {
7
+ return [port.kind, port.modelName, port.itemKind ? `item:${port.itemKind}` : null]
8
+ .filter(Boolean)
9
+ .join(" · ");
10
+ }
4
11
  function PortList({ title, ports, align }) {
5
- return (_jsxs("div", { className: "grid gap-1.5", children: [_jsx("div", { className: cn("text-[10px] uppercase tracking-[0.18em] text-white/34", align === "left" ? "text-left" : "text-right"), children: title }), ports.length === 0 ? (_jsx("div", { className: "rounded-full border border-dashed border-white/10 px-3 py-1.5 text-[11px] text-white/28", children: "None" })) : null, ports.map((port) => (_jsxs("div", { className: cn("relative rounded-full bg-white/[0.05] px-3 py-1.5 text-[11px] text-white/62", align === "left" ? "pl-5 text-left" : "pr-5 text-right"), children: [_jsx(Handle, { type: align === "left" ? "target" : "source", position: align === "left" ? Position.Left : Position.Right, id: port.key, className: "!size-2.5 !border !border-white/80 !bg-[#b8c5ff]", style: {
12
+ return (_jsxs("div", { className: "grid gap-1.5", children: [_jsxs("div", { className: cn("flex items-center gap-1 text-[10px] uppercase tracking-[0.18em] text-white/34", align === "left" ? "text-left" : "text-right"), children: [_jsx("span", { children: title }), _jsx(InfoTooltip, { content: align === "left"
13
+ ? "Inputs are values this box expects from upstream nodes."
14
+ : "Outputs are values this box publishes for downstream nodes.", label: align === "left" ? "Explain box inputs" : "Explain box outputs" })] }), ports.length === 0 ? (_jsx("div", { className: "rounded-full border border-dashed border-white/10 px-3 py-1.5 text-[11px] text-white/28", children: "None" })) : null, ports.map((port) => (_jsxs("div", { className: cn("relative rounded-[16px] bg-white/[0.05] px-3 py-2 text-[11px] text-white/62", align === "left" ? "pl-5 text-left" : "pr-5 text-right"), children: [_jsx(Handle, { type: align === "left" ? "target" : "source", position: align === "left" ? Position.Left : Position.Right, id: port.key, className: "!size-2.5 !border !border-white/80 !bg-[#b8c5ff]", style: {
6
15
  [align]: 6
7
- } }), port.label] }, port.key)))] }));
16
+ } }), _jsx("div", { children: port.label }), _jsx("div", { className: "mt-1 text-[10px] text-white/38", children: describePort(port) })] }, port.key)))] }));
8
17
  }
9
18
  export function createGenericWorkbenchNodeView(definition) {
10
19
  return function GenericWorkbenchNodeView(_props) {
11
- return (_jsxs("div", { className: "min-w-[280px] rounded-[24px] border border-white/10 bg-[linear-gradient(180deg,rgba(20,28,45,0.98),rgba(11,16,29,0.98))] p-3 shadow-[0_26px_80px_rgba(0,0,0,0.4)]", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate text-sm font-semibold text-white", children: definition.title }), _jsx("div", { className: "mt-1 line-clamp-2 text-[12px] leading-5 text-white/48", children: definition.description })] }), _jsx("div", { className: "rounded-full bg-white/[0.06] px-2.5 py-1 text-[10px] uppercase tracking-[0.16em] text-white/56", children: "box" })] }), definition.params.length > 0 ? (_jsxs("div", { className: "mt-3 rounded-[18px] bg-white/[0.04] px-3 py-2 text-[11px] text-white/52", children: [definition.params.length, " param", definition.params.length === 1 ? "" : "s", " configurable in the flow editor"] })) : null, definition.tools.length > 0 ? (_jsxs("div", { className: "mt-2 rounded-[18px] bg-white/[0.04] px-3 py-2 text-[11px] text-white/52", children: [definition.tools.length, " tool", definition.tools.length === 1 ? "" : "s", " available"] })) : null, _jsxs("div", { className: "mt-3 grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-3", children: [_jsx(PortList, { title: "Inputs", ports: definition.inputs, align: "left" }), _jsx(PortList, { title: "Outputs", ports: definition.output, align: "right" })] })] }));
20
+ const [schemaOpen, setSchemaOpen] = useState(false);
21
+ return (_jsxs("div", { className: "min-w-[280px] rounded-[24px] border border-white/10 bg-[linear-gradient(180deg,rgba(20,28,45,0.98),rgba(11,16,29,0.98))] p-3 shadow-[0_26px_80px_rgba(0,0,0,0.4)]", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate text-sm font-semibold text-white", children: definition.title }), _jsx("div", { className: "mt-1 line-clamp-2 text-[12px] leading-5 text-white/48", children: definition.description })] }), _jsx("div", { className: "rounded-full bg-white/[0.06] px-2.5 py-1 text-[10px] uppercase tracking-[0.16em] text-white/56", children: "box" })] }), definition.params.length > 0 ? (_jsxs("div", { className: "mt-3 rounded-[18px] bg-white/[0.04] px-3 py-2 text-[11px] text-white/52", children: [definition.params.length, " param", definition.params.length === 1 ? "" : "s", " configurable in the flow editor"] })) : null, definition.tools.length > 0 ? (_jsxs("div", { className: "mt-2 rounded-[18px] bg-white/[0.04] px-3 py-2 text-[11px] text-white/52", children: [definition.tools.length, " tool", definition.tools.length === 1 ? "" : "s", " available"] })) : null, _jsx("div", { className: "mt-2", children: _jsx("button", { type: "button", className: "rounded-full bg-white/[0.05] px-3 py-1.5 text-[11px] text-white/56 transition hover:bg-white/[0.08] hover:text-white", onClick: () => setSchemaOpen((current) => !current), children: schemaOpen ? "Hide schema" : "Preview schema" }) }), _jsxs("div", { className: "mt-3 grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-3", children: [_jsx(PortList, { title: "Inputs", ports: definition.inputs, align: "left" }), _jsx(PortList, { title: "Outputs", ports: definition.output, align: "right" })] }), schemaOpen ? (_jsxs("div", { className: "mt-3 rounded-[18px] border border-white/8 bg-black/20 p-3", children: [_jsxs("div", { className: "flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-white/38", children: [_jsx("span", { children: "Box contract" }), _jsx(InfoTooltip, { content: "This preview summarizes what the box consumes, publishes, and what tools it can expose to AI nodes.", label: "Explain box contract preview" })] }), _jsx("pre", { className: "mt-2 overflow-auto whitespace-pre-wrap text-[11px] leading-5 text-white/64", children: JSON.stringify({
22
+ inputs: definition.inputs.map(({ key, kind, required, description, modelName, itemKind, shape, exampleValue }) => ({
23
+ key,
24
+ kind,
25
+ required: Boolean(required),
26
+ description,
27
+ modelName,
28
+ itemKind,
29
+ shape,
30
+ exampleValue
31
+ })),
32
+ outputs: definition.output.map(({ key, kind, required, description, modelName, itemKind, shape, exampleValue }) => ({
33
+ key,
34
+ kind,
35
+ required: Boolean(required),
36
+ description,
37
+ modelName,
38
+ itemKind,
39
+ shape,
40
+ exampleValue
41
+ })),
42
+ tools: definition.tools.map(({ key, accessMode, argsSchema }) => ({
43
+ key,
44
+ accessMode,
45
+ argsSchema
46
+ }))
47
+ }, null, 2) })] })) : null] }));
12
48
  };
13
49
  }
@@ -0,0 +1,62 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { buildSearchWorkbenchExecution, buildStaticWorkbenchExecution } from "../../../lib/workbench/runtime.js";
3
+ import { createSearchEntitiesTool, createSearchInputs, createSearchOutputs, createSearchParams, createSummaryOutput } from "../../../lib/workbench/contracts.js";
4
+ import { createGenericWorkbenchNodeView } from "../shared/generic-node-view.js";
5
+ import { defineWorkbenchBox } from "../shared/define-workbench-box.js";
6
+ function Slot({ children }) {
7
+ return _jsx(_Fragment, { children: children });
8
+ }
9
+ function defineStrategyBox(id, title, description, tags, execute, output, tools = [], options) {
10
+ const inputs = options?.inputs ?? [];
11
+ const params = options?.params ?? [];
12
+ return defineWorkbenchBox(Slot, {
13
+ id,
14
+ surfaceId: "strategies",
15
+ routePath: "/strategies",
16
+ title,
17
+ icon: "strategy",
18
+ description,
19
+ category: "Strategies",
20
+ tags,
21
+ inputs,
22
+ params,
23
+ output,
24
+ tools,
25
+ NodeView: createGenericWorkbenchNodeView({
26
+ title,
27
+ description,
28
+ inputs,
29
+ params,
30
+ output,
31
+ tools
32
+ }),
33
+ execute
34
+ });
35
+ }
36
+ export const StrategiesHeroBox = defineStrategyBox("surface:strategies:hero", "Strategies hero", "Strategies page header and sequencing context.", ["strategies", "hero"], (input) => buildStaticWorkbenchExecution(input, null, "Strategies page header."), [createSummaryOutput({ label: "Strategies summary", description: "High-level strategies page framing." })]);
37
+ export const StrategiesSearchResultsBox = defineStrategyBox("surface:strategies:search-results", "Strategies list and results", "Strategy browser and structured operating context.", ["strategies", "search"], (input) => buildSearchWorkbenchExecution(input, {
38
+ query: "",
39
+ entityTypes: ["strategy"],
40
+ limit: 20
41
+ }), createSearchOutputs({
42
+ itemKind: "strategy",
43
+ itemLabel: "Strategy"
44
+ }), [createSearchEntitiesTool("Search strategy entities by query and entity types.")], {
45
+ inputs: createSearchInputs({
46
+ itemKind: "strategy",
47
+ itemLabel: "Strategy",
48
+ defaultEntityTypes: ["strategy"],
49
+ defaultLimit: 20
50
+ }),
51
+ params: createSearchParams({
52
+ itemKind: "strategy",
53
+ defaultEntityTypes: ["strategy"],
54
+ defaultLimit: 20
55
+ })
56
+ });
57
+ export const StrategiesSummaryBox = defineStrategyBox("surface:strategies:summary", "Strategies summary", "Strategy collection summary and state context.", ["strategies", "summary"], (input) => buildStaticWorkbenchExecution(input, null, "Strategy collection summary."), [
58
+ createSummaryOutput({
59
+ label: "Strategy summary",
60
+ description: "Summary of strategy state and collection context."
61
+ })
62
+ ]);
@@ -0,0 +1,76 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { buildSearchWorkbenchExecution, buildStaticWorkbenchExecution } from "../../../lib/workbench/runtime.js";
3
+ import { createSearchEntitiesTool, createSearchInputs, createSearchOutputs, createSearchParams, createSummaryOutput, createTaskStatusTool } from "../../../lib/workbench/contracts.js";
4
+ import { createGenericWorkbenchNodeView } from "../shared/generic-node-view.js";
5
+ import { defineWorkbenchBox } from "../shared/define-workbench-box.js";
6
+ function Slot({ children }) {
7
+ return _jsx(_Fragment, { children: children });
8
+ }
9
+ function defineTasksBox(id, title, description, tags, execute, output, tools = [], options) {
10
+ const inputs = options?.inputs ?? [];
11
+ const params = options?.params ?? [];
12
+ return defineWorkbenchBox(Slot, {
13
+ id,
14
+ surfaceId: "tasks",
15
+ routePath: "/today",
16
+ title,
17
+ icon: "task",
18
+ description,
19
+ category: "Tasks",
20
+ tags,
21
+ inputs,
22
+ params,
23
+ output,
24
+ tools,
25
+ NodeView: createGenericWorkbenchNodeView({
26
+ title,
27
+ description,
28
+ inputs,
29
+ params,
30
+ output,
31
+ tools
32
+ }),
33
+ execute
34
+ });
35
+ }
36
+ export const TasksInboxBox = defineTasksBox("surface:tasks:inbox", "Task queue", "Searchable task queue spanning backlog, focus, and in-progress work.", ["tasks", "queue", "search"], (input) => buildSearchWorkbenchExecution(input, {
37
+ query: "",
38
+ entityTypes: ["task"],
39
+ limit: 20
40
+ }), createSearchOutputs({
41
+ itemKind: "task",
42
+ itemLabel: "Task"
43
+ }), [
44
+ createSearchEntitiesTool("Search task entities by title, status, or linked context."),
45
+ createTaskStatusTool("Move a task between backlog, focus, in progress, blocked, and done.")
46
+ ], {
47
+ inputs: createSearchInputs({
48
+ itemKind: "task",
49
+ itemLabel: "Task",
50
+ defaultEntityTypes: ["task"],
51
+ defaultLimit: 20
52
+ }),
53
+ params: createSearchParams({
54
+ itemKind: "task",
55
+ defaultEntityTypes: ["task"],
56
+ defaultLimit: 20
57
+ })
58
+ });
59
+ export const TasksFocusBox = defineTasksBox("surface:tasks:focus-lane", "Focus lane", "Focused task lane for what should happen next right now.", ["tasks", "focus", "execution"], (input) => buildStaticWorkbenchExecution(input, {
60
+ hint: "Use this surface to represent active or next-up work."
61
+ }, "Focus lane context for the current execution board."), [
62
+ createSummaryOutput({
63
+ label: "Focus summary",
64
+ description: "Human-readable explanation of what the focus lane represents."
65
+ })
66
+ ], [
67
+ createTaskStatusTool("Change task state as the flow decides what should happen next.")
68
+ ]);
69
+ export const TasksSummaryBox = defineTasksBox("surface:tasks:summary", "Task summary", "High-level summary of the current task system and work state.", ["tasks", "summary"], (input) => buildStaticWorkbenchExecution(input, {
70
+ states: ["backlog", "focus", "in_progress", "blocked", "done"]
71
+ }, "Task system summary with the key task states Forge tracks."), [
72
+ createSummaryOutput({
73
+ label: "Task summary",
74
+ description: "High-level summary of the current task system and work state."
75
+ })
76
+ ]);