forge-openclaw-plugin 0.2.24 → 0.2.26

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 (208) hide show
  1. package/README.md +13 -0
  2. package/dist/assets/{board-_C6oMy5w.js → board-ta0rUHOf.js} +3 -3
  3. package/dist/assets/{board-_C6oMy5w.js.map → board-ta0rUHOf.js.map} +1 -1
  4. package/dist/assets/index-Ro0ZF_az.css +1 -0
  5. package/dist/assets/index-ytlpSj23.js +79 -0
  6. package/dist/assets/index-ytlpSj23.js.map +1 -0
  7. package/dist/assets/{motion-D4sZgCHd.js → motion-fBKPB6yw.js} +3 -3
  8. package/dist/assets/motion-fBKPB6yw.js.map +1 -0
  9. package/dist/assets/{table-BWzTaky1.js → table-C-IGTQni.js} +2 -2
  10. package/dist/assets/{table-BWzTaky1.js.map → table-C-IGTQni.js.map} +1 -1
  11. package/dist/assets/{ui-BzK4azQb.js → ui-DInOpaYF.js} +2 -2
  12. package/dist/assets/{ui-BzK4azQb.js.map → ui-DInOpaYF.js.map} +1 -1
  13. package/dist/assets/vendor-lE3tZJcC.js +876 -0
  14. package/dist/assets/vendor-lE3tZJcC.js.map +1 -0
  15. package/dist/index.html +7 -8
  16. package/dist/openclaw/local-runtime.d.ts +3 -1
  17. package/dist/openclaw/local-runtime.js +51 -15
  18. package/dist/openclaw/parity.d.ts +1 -1
  19. package/dist/openclaw/parity.js +29 -0
  20. package/dist/openclaw/plugin-entry-shared.d.ts +1 -0
  21. package/dist/openclaw/plugin-entry-shared.js +31 -6
  22. package/dist/openclaw/plugin-sdk-types.d.ts +29 -0
  23. package/dist/openclaw/routes.js +236 -0
  24. package/dist/openclaw/session-bootstrap.d.ts +78 -0
  25. package/dist/openclaw/session-bootstrap.js +240 -0
  26. package/dist/openclaw/tools.js +279 -6
  27. package/dist/server/server/migrations/001_core.sql +411 -0
  28. package/dist/server/server/migrations/002_psyche.sql +392 -0
  29. package/dist/server/server/migrations/003_habits.sql +30 -0
  30. package/dist/server/server/migrations/004_habit_links.sql +8 -0
  31. package/dist/server/server/migrations/005_habit_psyche_links.sql +24 -0
  32. package/dist/server/server/migrations/006_work_adjustments.sql +14 -0
  33. package/dist/server/server/migrations/007_weekly_review_closures.sql +17 -0
  34. package/dist/server/server/migrations/008_calendar_execution.sql +147 -0
  35. package/dist/server/server/migrations/009_true_calendar_events.sql +195 -0
  36. package/dist/server/server/migrations/010_calendar_selection_state.sql +6 -0
  37. package/dist/server/server/migrations/011_calendar_timezone_backfill.sql +11 -0
  38. package/dist/server/server/migrations/012_work_block_ranges.sql +7 -0
  39. package/dist/server/server/migrations/013_microsoft_local_auth_settings.sql +8 -0
  40. package/dist/server/server/migrations/014_note_tags_and_ephemeral.sql +8 -0
  41. package/dist/server/server/migrations/015_multi_user_and_strategies.sql +244 -0
  42. package/dist/server/server/migrations/016_health_companion.sql +158 -0
  43. package/dist/server/server/migrations/016_strategy_contracts_and_user_graph.sql +22 -0
  44. package/dist/server/server/migrations/017_preferences.sql +131 -0
  45. package/dist/server/server/migrations/018_preference_catalogs.sql +31 -0
  46. package/dist/server/server/migrations/019_wiki_memory.sql +255 -0
  47. package/dist/server/server/migrations/020_wiki_page_hierarchy.sql +11 -0
  48. package/dist/server/server/migrations/021_hide_evidence_from_wiki_index.sql +3 -0
  49. package/dist/server/server/migrations/022_wiki_ingest_background.sql +85 -0
  50. package/dist/server/server/migrations/023_diagnostic_logs.sql +28 -0
  51. package/dist/server/server/migrations/024_questionnaires.sql +96 -0
  52. package/dist/server/server/migrations/025_ai_model_connections.sql +26 -0
  53. package/dist/server/server/migrations/026_custom_theme_settings.sql +2 -0
  54. package/dist/server/server/migrations/027_ai_processors.sql +31 -0
  55. package/dist/server/server/migrations/028_movement_domain.sql +136 -0
  56. package/dist/server/server/migrations/029_watch_micro_capture.sql +23 -0
  57. package/dist/server/server/migrations/030_surface_layouts.sql +5 -0
  58. package/dist/server/server/migrations/031_ai_processor_runtime_upgrades.sql +10 -0
  59. package/dist/server/server/migrations/032_ai_connectors.sql +44 -0
  60. package/dist/server/server/migrations/033_movement_trip_point_sync.sql +36 -0
  61. package/dist/server/server/migrations/034_movement_segment_sync.sql +49 -0
  62. package/dist/server/server/migrations/035_google_local_auth_settings.sql +2 -0
  63. package/dist/server/server/migrations/036_google_local_auth_client_secret.sql +2 -0
  64. package/dist/server/{app.js → server/src/app.js} +992 -25
  65. package/dist/server/server/src/connectors/box-registry.js +188 -0
  66. package/dist/server/{db.js → server/src/db.js} +6 -0
  67. package/dist/server/server/src/debug.js +19 -0
  68. package/dist/server/server/src/discovery-advertiser.js +114 -0
  69. package/dist/server/{health.js → server/src/health.js} +39 -11
  70. package/dist/server/{index.js → server/src/index.js} +4 -0
  71. package/dist/server/{managers → server/src/managers}/platform/llm-manager.js +40 -4
  72. package/dist/server/{managers → server/src/managers}/platform/openai-responses-provider.js +129 -19
  73. package/dist/server/server/src/movement.js +2935 -0
  74. package/dist/server/{openapi.js → server/src/openapi.js} +628 -5
  75. package/dist/server/{psyche-types.js → server/src/psyche-types.js} +15 -1
  76. package/dist/server/server/src/questionnaire-flow.js +552 -0
  77. package/dist/server/server/src/questionnaire-seeds.js +853 -0
  78. package/dist/server/server/src/questionnaire-types.js +340 -0
  79. package/dist/server/server/src/repositories/ai-connectors.js +1207 -0
  80. package/dist/server/server/src/repositories/ai-processors.js +547 -0
  81. package/dist/server/{repositories → server/src/repositories}/calendar.js +1 -1
  82. package/dist/server/{repositories → server/src/repositories}/entity-ownership.js +9 -1
  83. package/dist/server/{repositories → server/src/repositories}/habits.js +69 -5
  84. package/dist/server/server/src/repositories/model-settings.js +216 -0
  85. package/dist/server/{repositories → server/src/repositories}/notes.js +57 -15
  86. package/dist/server/{repositories → server/src/repositories}/preferences.js +124 -0
  87. package/dist/server/server/src/repositories/questionnaires.js +1338 -0
  88. package/dist/server/{repositories → server/src/repositories}/settings.js +156 -12
  89. package/dist/server/server/src/repositories/surface-layouts.js +76 -0
  90. package/dist/server/{repositories → server/src/repositories}/wiki-memory.js +5 -1
  91. package/dist/server/{services → server/src/services}/calendar-runtime.js +775 -58
  92. package/dist/server/{services → server/src/services}/entity-crud.js +81 -2
  93. package/dist/server/server/src/services/google-calendar-oauth-config.js +176 -0
  94. package/dist/server/server/src/services/openai-codex-oauth.js +153 -0
  95. package/dist/server/server/src/services/psyche-observation-calendar.js +46 -0
  96. package/dist/server/{types.js → server/src/types.js} +621 -14
  97. package/dist/server/server/src/watch-mobile.js +562 -0
  98. package/dist/server/{web.js → server/src/web.js} +30 -4
  99. package/dist/server/src/components/customization/utility-widgets.js +330 -0
  100. package/dist/server/src/components/workbench-boxes/health/health-boxes.js +92 -0
  101. package/dist/server/src/components/workbench-boxes/kanban/kanban-boxes.js +128 -0
  102. package/dist/server/src/components/workbench-boxes/movement/movement-boxes.js +37 -0
  103. package/dist/server/src/components/workbench-boxes/notes/notes-boxes.js +114 -0
  104. package/dist/server/src/components/workbench-boxes/projects/projects-boxes.js +57 -0
  105. package/dist/server/src/components/workbench-boxes/shared/define-workbench-box.js +4 -0
  106. package/dist/server/src/components/workbench-boxes/shared/generic-node-view.js +13 -0
  107. package/dist/server/src/components/workbench-boxes/today/today-boxes.js +63 -0
  108. package/dist/server/src/lib/api-error.js +37 -0
  109. package/dist/server/src/lib/api.js +1859 -0
  110. package/dist/server/src/lib/calendar-name-deduper.js +144 -0
  111. package/dist/server/src/lib/diagnostics.js +67 -0
  112. package/dist/server/src/lib/psyche-types.js +1 -0
  113. package/dist/server/src/lib/questionnaire-types.js +1 -0
  114. package/dist/server/src/lib/runtime-paths.js +24 -0
  115. package/dist/server/src/lib/schemas.js +234 -0
  116. package/dist/server/src/lib/snapshot-normalizer.js +374 -0
  117. package/dist/server/src/lib/theme-system.js +319 -0
  118. package/dist/server/src/lib/types.js +1 -0
  119. package/dist/server/src/lib/utils.js +22 -0
  120. package/dist/server/src/lib/workbench/boxes.js +16 -0
  121. package/dist/server/src/lib/workbench/nodes.js +15 -0
  122. package/dist/server/src/lib/workbench/registry.js +73 -0
  123. package/dist/server/src/lib/workbench/runtime.js +181 -0
  124. package/openclaw.plugin.json +1 -1
  125. package/package.json +6 -1
  126. package/server/index.js +68 -0
  127. package/server/migrations/024_questionnaires.sql +96 -0
  128. package/server/migrations/025_ai_model_connections.sql +26 -0
  129. package/server/migrations/026_custom_theme_settings.sql +2 -0
  130. package/server/migrations/027_ai_processors.sql +31 -0
  131. package/server/migrations/028_movement_domain.sql +136 -0
  132. package/server/migrations/029_watch_micro_capture.sql +23 -0
  133. package/server/migrations/030_surface_layouts.sql +5 -0
  134. package/server/migrations/031_ai_processor_runtime_upgrades.sql +10 -0
  135. package/server/migrations/032_ai_connectors.sql +44 -0
  136. package/server/migrations/033_movement_trip_point_sync.sql +36 -0
  137. package/server/migrations/034_movement_segment_sync.sql +49 -0
  138. package/server/migrations/035_google_local_auth_settings.sql +2 -0
  139. package/server/migrations/036_google_local_auth_client_secret.sql +2 -0
  140. package/skills/forge-openclaw/SKILL.md +15 -1
  141. package/skills/forge-openclaw/entity_conversation_playbooks.md +523 -87
  142. package/skills/forge-openclaw/psyche_entity_playbooks.md +331 -221
  143. package/dist/assets/index-DTCwBWAs.js +0 -65
  144. package/dist/assets/index-DTCwBWAs.js.map +0 -1
  145. package/dist/assets/index-DttXlAgi.css +0 -1
  146. package/dist/assets/motion-D4sZgCHd.js.map +0 -1
  147. package/dist/assets/vendor-De38P6YR.js +0 -729
  148. package/dist/assets/vendor-De38P6YR.js.map +0 -1
  149. package/dist/assets/viz-C6hfyqzu.js +0 -34
  150. package/dist/assets/viz-C6hfyqzu.js.map +0 -1
  151. package/skills/forge-openclaw/cron_jobs.md +0 -395
  152. /package/dist/server/{demo-data.js → server/src/demo-data.js} +0 -0
  153. /package/dist/server/{e2e-server.js → server/src/e2e-server.js} +0 -0
  154. /package/dist/server/{errors.js → server/src/errors.js} +0 -0
  155. /package/dist/server/{managers → server/src/managers}/base.js +0 -0
  156. /package/dist/server/{managers → server/src/managers}/contracts.js +0 -0
  157. /package/dist/server/{managers → server/src/managers}/platform/api-gateway-manager.js +0 -0
  158. /package/dist/server/{managers → server/src/managers}/platform/audit-manager.js +0 -0
  159. /package/dist/server/{managers → server/src/managers}/platform/authentication-manager.js +0 -0
  160. /package/dist/server/{managers → server/src/managers}/platform/authorization-manager.js +0 -0
  161. /package/dist/server/{managers → server/src/managers}/platform/background-job-manager.js +0 -0
  162. /package/dist/server/{managers → server/src/managers}/platform/configuration-manager.js +0 -0
  163. /package/dist/server/{managers → server/src/managers}/platform/database-manager.js +0 -0
  164. /package/dist/server/{managers → server/src/managers}/platform/event-bus-manager.js +0 -0
  165. /package/dist/server/{managers → server/src/managers}/platform/external-service-manager.js +0 -0
  166. /package/dist/server/{managers → server/src/managers}/platform/health-manager.js +0 -0
  167. /package/dist/server/{managers → server/src/managers}/platform/migration-manager.js +0 -0
  168. /package/dist/server/{managers → server/src/managers}/platform/search-index-manager.js +0 -0
  169. /package/dist/server/{managers → server/src/managers}/platform/secrets-manager.js +0 -0
  170. /package/dist/server/{managers → server/src/managers}/platform/session-manager.js +0 -0
  171. /package/dist/server/{managers → server/src/managers}/platform/storage-manager.js +0 -0
  172. /package/dist/server/{managers → server/src/managers}/platform/token-manager.js +0 -0
  173. /package/dist/server/{managers → server/src/managers}/platform/transaction-manager.js +0 -0
  174. /package/dist/server/{managers → server/src/managers}/platform/trusted-network.js +0 -0
  175. /package/dist/server/{managers → server/src/managers}/runtime.js +0 -0
  176. /package/dist/server/{managers → server/src/managers}/type-guards.js +0 -0
  177. /package/dist/server/{preferences-seeds.js → server/src/preferences-seeds.js} +0 -0
  178. /package/dist/server/{preferences-types.js → server/src/preferences-types.js} +0 -0
  179. /package/dist/server/{repositories → server/src/repositories}/activity-events.js +0 -0
  180. /package/dist/server/{repositories → server/src/repositories}/collaboration.js +0 -0
  181. /package/dist/server/{repositories → server/src/repositories}/deleted-entities.js +0 -0
  182. /package/dist/server/{repositories → server/src/repositories}/diagnostic-logs.js +0 -0
  183. /package/dist/server/{repositories → server/src/repositories}/domains.js +0 -0
  184. /package/dist/server/{repositories → server/src/repositories}/event-log.js +0 -0
  185. /package/dist/server/{repositories → server/src/repositories}/goals.js +0 -0
  186. /package/dist/server/{repositories → server/src/repositories}/projects.js +0 -0
  187. /package/dist/server/{repositories → server/src/repositories}/psyche.js +0 -0
  188. /package/dist/server/{repositories → server/src/repositories}/rewards.js +0 -0
  189. /package/dist/server/{repositories → server/src/repositories}/strategies.js +0 -0
  190. /package/dist/server/{repositories → server/src/repositories}/tags.js +0 -0
  191. /package/dist/server/{repositories → server/src/repositories}/task-runs.js +0 -0
  192. /package/dist/server/{repositories → server/src/repositories}/tasks.js +0 -0
  193. /package/dist/server/{repositories → server/src/repositories}/users.js +0 -0
  194. /package/dist/server/{repositories → server/src/repositories}/weekly-reviews.js +0 -0
  195. /package/dist/server/{repositories → server/src/repositories}/work-adjustments.js +0 -0
  196. /package/dist/server/{seed-demo.js → server/src/seed-demo.js} +0 -0
  197. /package/dist/server/{services → server/src/services}/context.js +0 -0
  198. /package/dist/server/{services → server/src/services}/dashboard.js +0 -0
  199. /package/dist/server/{services → server/src/services}/gamification.js +0 -0
  200. /package/dist/server/{services → server/src/services}/insights.js +0 -0
  201. /package/dist/server/{services → server/src/services}/projects.js +0 -0
  202. /package/dist/server/{services → server/src/services}/psyche.js +0 -0
  203. /package/dist/server/{services → server/src/services}/relations.js +0 -0
  204. /package/dist/server/{services → server/src/services}/reviews.js +0 -0
  205. /package/dist/server/{services → server/src/services}/run-recovery.js +0 -0
  206. /package/dist/server/{services → server/src/services}/tagging.js +0 -0
  207. /package/dist/server/{services → server/src/services}/task-run-watchdog.js +0 -0
  208. /package/dist/server/{services → server/src/services}/work-time.js +0 -0
@@ -19,6 +19,281 @@ function jsonResponse(schema, description) {
19
19
  }
20
20
  };
21
21
  }
22
+ const HTTP_METHODS = new Set([
23
+ "get",
24
+ "post",
25
+ "put",
26
+ "patch",
27
+ "delete",
28
+ "options",
29
+ "head"
30
+ ]);
31
+ const API_TAGS = [
32
+ {
33
+ name: "Meta",
34
+ description: "OpenAPI discovery and route-level API metadata."
35
+ },
36
+ {
37
+ name: "Health",
38
+ description: "Runtime health, sleep, sports, workout, and mobile sync surfaces."
39
+ },
40
+ {
41
+ name: "Auth",
42
+ description: "Operator session bootstrapping for trusted local usage."
43
+ },
44
+ {
45
+ name: "Platform",
46
+ description: "Top-level runtime context and canonical Forge domain catalogs."
47
+ },
48
+ {
49
+ name: "Operator",
50
+ description: "Current work, overview, and operator-facing runtime state."
51
+ },
52
+ {
53
+ name: "Users",
54
+ description: "Forge user directory, ownership, and multi-user runtime surfaces."
55
+ },
56
+ {
57
+ name: "Settings",
58
+ description: "Local runtime settings, settings bin, and token management."
59
+ },
60
+ {
61
+ name: "Agents",
62
+ description: "Agent onboarding, registry, and action feeds."
63
+ },
64
+ {
65
+ name: "Approvals",
66
+ description: "Approval workflows for deferred or gated agent actions."
67
+ },
68
+ {
69
+ name: "Entity Batch",
70
+ description: "Batch create, update, delete, restore, and search operations across entity types."
71
+ },
72
+ {
73
+ name: "Goals",
74
+ description: "Long-horizon life goals."
75
+ },
76
+ {
77
+ name: "Projects",
78
+ description: "Project execution surfaces and project summaries."
79
+ },
80
+ {
81
+ name: "Strategies",
82
+ description: "Directed planning structures that sit above project execution."
83
+ },
84
+ {
85
+ name: "Tasks",
86
+ description: "Task CRUD, task context, and execution-adjacent task routes."
87
+ },
88
+ {
89
+ name: "Task Runs",
90
+ description: "Live task timer and timed work-session operations."
91
+ },
92
+ {
93
+ name: "Habits",
94
+ description: "Recurring commitments and habit check-ins."
95
+ },
96
+ {
97
+ name: "Calendar",
98
+ description: "Calendar connections, work blocks, timeboxes, and native Forge events."
99
+ },
100
+ {
101
+ name: "Notes",
102
+ description: "Markdown evidence records linked to one or more Forge entities."
103
+ },
104
+ {
105
+ name: "Tags",
106
+ description: "Tag CRUD for shared Forge classification."
107
+ },
108
+ {
109
+ name: "Wiki",
110
+ description: "File-first wiki settings, pages, ingest, sync, health, and search."
111
+ },
112
+ {
113
+ name: "Preferences",
114
+ description: "Preference profiles, comparisons, concepts, contexts, and learned scores."
115
+ },
116
+ {
117
+ name: "Psyche",
118
+ description: "Values, patterns, behaviors, beliefs, modes, reports, and related Psyche surfaces."
119
+ },
120
+ {
121
+ name: "Questionnaires",
122
+ description: "Psyche questionnaire libraries, runs, scoring, and self-observation calendar integration."
123
+ },
124
+ {
125
+ name: "Insights",
126
+ description: "Stored insights and structured feedback on them."
127
+ },
128
+ {
129
+ name: "Metrics",
130
+ description: "XP, reward-ledger, and runtime metric surfaces."
131
+ },
132
+ {
133
+ name: "Reviews",
134
+ description: "Weekly review and review-finalization operations."
135
+ },
136
+ {
137
+ name: "Activity",
138
+ description: "Activity feeds, event logs, and ambient session events."
139
+ },
140
+ {
141
+ name: "Diagnostics",
142
+ description: "Runtime diagnostics and operational logging routes."
143
+ }
144
+ ];
145
+ const API_TAG_GROUPS = [
146
+ {
147
+ name: "Runtime",
148
+ tags: ["Meta", "Health", "Auth", "Platform", "Operator", "Diagnostics"]
149
+ },
150
+ {
151
+ name: "Core Work",
152
+ tags: [
153
+ "Goals",
154
+ "Projects",
155
+ "Strategies",
156
+ "Tasks",
157
+ "Task Runs",
158
+ "Habits",
159
+ "Calendar",
160
+ "Notes",
161
+ "Tags",
162
+ "Activity",
163
+ "Metrics",
164
+ "Reviews",
165
+ "Insights"
166
+ ]
167
+ },
168
+ {
169
+ name: "Knowledge And Reflection",
170
+ tags: ["Wiki", "Preferences", "Psyche", "Questionnaires"]
171
+ },
172
+ {
173
+ name: "Platform And Agents",
174
+ tags: ["Users", "Settings", "Agents", "Approvals", "Entity Batch"]
175
+ }
176
+ ];
177
+ function resolveTagsForPath(path) {
178
+ if (path === "/api/v1/openapi.json") {
179
+ return ["Meta"];
180
+ }
181
+ if (path.startsWith("/api/v1/diagnostics")) {
182
+ return ["Diagnostics"];
183
+ }
184
+ if (path.startsWith("/api/v1/auth")) {
185
+ return ["Auth"];
186
+ }
187
+ if (path.startsWith("/api/v1/health") ||
188
+ path.startsWith("/api/v1/mobile")) {
189
+ return ["Health"];
190
+ }
191
+ if (path === "/api/v1/context" || path.startsWith("/api/v1/domains")) {
192
+ return ["Platform"];
193
+ }
194
+ if (path.startsWith("/api/v1/operator")) {
195
+ return ["Operator"];
196
+ }
197
+ if (path.startsWith("/api/v1/users")) {
198
+ return ["Users"];
199
+ }
200
+ if (path.startsWith("/api/v1/settings")) {
201
+ return ["Settings"];
202
+ }
203
+ if (path.startsWith("/api/v1/approval-requests")) {
204
+ return ["Approvals"];
205
+ }
206
+ if (path.startsWith("/api/v1/agents") ||
207
+ path.startsWith("/api/v1/agent-actions")) {
208
+ return ["Agents"];
209
+ }
210
+ if (path.startsWith("/api/v1/entities")) {
211
+ return ["Entity Batch"];
212
+ }
213
+ if (path.startsWith("/api/v1/wiki")) {
214
+ return ["Wiki"];
215
+ }
216
+ if (path.startsWith("/api/v1/preferences")) {
217
+ return ["Preferences"];
218
+ }
219
+ if (path.startsWith("/api/v1/psyche/questionnaires") ||
220
+ path.startsWith("/api/v1/psyche/questionnaire-runs") ||
221
+ path.startsWith("/api/v1/psyche/self-observation")) {
222
+ return ["Questionnaires", "Psyche"];
223
+ }
224
+ if (path.startsWith("/api/v1/psyche")) {
225
+ return ["Psyche"];
226
+ }
227
+ if (path.startsWith("/api/v1/notes")) {
228
+ return ["Notes"];
229
+ }
230
+ if (path.startsWith("/api/v1/strategies")) {
231
+ return ["Strategies"];
232
+ }
233
+ if (path.startsWith("/api/v1/projects") || path.startsWith("/api/v1/campaigns")) {
234
+ return ["Projects"];
235
+ }
236
+ if (path.startsWith("/api/v1/goals")) {
237
+ return ["Goals"];
238
+ }
239
+ if (path.startsWith("/api/v1/habits")) {
240
+ return ["Habits"];
241
+ }
242
+ if (path.startsWith("/api/v1/tags")) {
243
+ return ["Tags"];
244
+ }
245
+ if (path.startsWith("/api/v1/task-runs")) {
246
+ return ["Task Runs"];
247
+ }
248
+ if (path.startsWith("/api/v1/tasks") ||
249
+ path.startsWith("/api/v1/work-adjustments")) {
250
+ return ["Tasks"];
251
+ }
252
+ if (path.startsWith("/api/v1/calendar")) {
253
+ return ["Calendar"];
254
+ }
255
+ if (path.startsWith("/api/v1/activity") ||
256
+ path.startsWith("/api/v1/events") ||
257
+ path.startsWith("/api/v1/session-events")) {
258
+ return ["Activity"];
259
+ }
260
+ if (path.startsWith("/api/v1/metrics") ||
261
+ path.startsWith("/api/v1/rewards")) {
262
+ return ["Metrics"];
263
+ }
264
+ if (path.startsWith("/api/v1/reviews")) {
265
+ return ["Reviews"];
266
+ }
267
+ if (path.startsWith("/api/v1/insights")) {
268
+ return ["Insights"];
269
+ }
270
+ return ["Platform"];
271
+ }
272
+ function toOperationId(method, path) {
273
+ return `${method}${path
274
+ .replace(/^\/api\/v1\//, "_")
275
+ .replace(/[{}]/g, "")
276
+ .replace(/[^A-Za-z0-9]+/g, "_")
277
+ .replace(/^_+|_+$/g, "")}`;
278
+ }
279
+ function annotateOpenApiDocument(document) {
280
+ const paths = document.paths;
281
+ document.tags = [...API_TAGS];
282
+ document["x-tagGroups"] = [...API_TAG_GROUPS];
283
+ if (!paths) {
284
+ return document;
285
+ }
286
+ for (const [path, pathItem] of Object.entries(paths)) {
287
+ for (const [method, operation] of Object.entries(pathItem)) {
288
+ if (!HTTP_METHODS.has(method)) {
289
+ continue;
290
+ }
291
+ operation.tags ??= resolveTagsForPath(path);
292
+ operation.operationId ??= toOperationId(method, path);
293
+ }
294
+ }
295
+ return document;
296
+ }
22
297
  export function buildOpenApiDocument() {
23
298
  const validationIssue = {
24
299
  type: "object",
@@ -1723,8 +1998,34 @@ export function buildOpenApiDocument() {
1723
1998
  },
1724
1999
  themePreference: {
1725
2000
  type: "string",
1726
- enum: ["obsidian", "solar", "system"]
2001
+ enum: ["obsidian", "solar", "aurora", "ember", "paper", "dawn", "atelier", "custom", "system"]
1727
2002
  },
2003
+ customTheme: nullable({
2004
+ type: "object",
2005
+ additionalProperties: false,
2006
+ required: [
2007
+ "label",
2008
+ "primary",
2009
+ "secondary",
2010
+ "tertiary",
2011
+ "canvas",
2012
+ "panel",
2013
+ "panelHigh",
2014
+ "panelLow",
2015
+ "ink"
2016
+ ],
2017
+ properties: {
2018
+ label: { type: "string" },
2019
+ primary: { type: "string" },
2020
+ secondary: { type: "string" },
2021
+ tertiary: { type: "string" },
2022
+ canvas: { type: "string" },
2023
+ panel: { type: "string" },
2024
+ panelHigh: { type: "string" },
2025
+ panelLow: { type: "string" },
2026
+ ink: { type: "string" }
2027
+ }
2028
+ }),
1728
2029
  localePreference: { type: "string", enum: ["en", "fr"] }
1729
2030
  }
1730
2031
  };
@@ -2180,6 +2481,7 @@ export function buildOpenApiDocument() {
2180
2481
  "notifications",
2181
2482
  "execution",
2182
2483
  "themePreference",
2484
+ "customTheme",
2183
2485
  "localePreference",
2184
2486
  "security",
2185
2487
  "agents",
@@ -2213,8 +2515,34 @@ export function buildOpenApiDocument() {
2213
2515
  execution: { $ref: "#/components/schemas/ExecutionSettings" },
2214
2516
  themePreference: {
2215
2517
  type: "string",
2216
- enum: ["obsidian", "solar", "system"]
2518
+ enum: ["obsidian", "solar", "aurora", "ember", "paper", "dawn", "atelier", "custom", "system"]
2217
2519
  },
2520
+ customTheme: nullable({
2521
+ type: "object",
2522
+ additionalProperties: false,
2523
+ required: [
2524
+ "label",
2525
+ "primary",
2526
+ "secondary",
2527
+ "tertiary",
2528
+ "canvas",
2529
+ "panel",
2530
+ "panelHigh",
2531
+ "panelLow",
2532
+ "ink"
2533
+ ],
2534
+ properties: {
2535
+ label: { type: "string" },
2536
+ primary: { type: "string" },
2537
+ secondary: { type: "string" },
2538
+ tertiary: { type: "string" },
2539
+ canvas: { type: "string" },
2540
+ panel: { type: "string" },
2541
+ panelHigh: { type: "string" },
2542
+ panelLow: { type: "string" },
2543
+ ink: { type: "string" }
2544
+ }
2545
+ }),
2218
2546
  localePreference: { type: "string", enum: ["en", "fr"] },
2219
2547
  security: {
2220
2548
  type: "object",
@@ -3352,17 +3680,21 @@ export function buildOpenApiDocument() {
3352
3680
  sessions: arrayOf({ $ref: "#/components/schemas/WorkoutSession" })
3353
3681
  }
3354
3682
  };
3355
- return {
3683
+ const document = {
3356
3684
  openapi: "3.1.0",
3357
3685
  info: {
3358
3686
  title: "Forge API",
3359
3687
  version: "v1",
3360
- description: "Projects-first API for the Forge life-goal, project, task, and evidence system."
3688
+ description: "Local-first execution, planning, memory, health, and Psyche API for the Forge runtime."
3361
3689
  },
3362
3690
  servers: [
3691
+ {
3692
+ url: "http://127.0.0.1:4317",
3693
+ description: "Default local Forge runtime"
3694
+ },
3363
3695
  {
3364
3696
  url: "/",
3365
- description: "Forge runtime"
3697
+ description: "Embedded runtime-relative origin"
3366
3698
  }
3367
3699
  ],
3368
3700
  components: {
@@ -4040,6 +4372,296 @@ export function buildOpenApiDocument() {
4040
4372
  }
4041
4373
  }
4042
4374
  },
4375
+ "/api/v1/psyche/questionnaires": {
4376
+ get: {
4377
+ summary: "List questionnaire instruments available in the Psyche library",
4378
+ responses: {
4379
+ "200": jsonResponse({
4380
+ type: "object",
4381
+ required: ["instruments"],
4382
+ properties: {
4383
+ instruments: arrayOf({
4384
+ type: "object",
4385
+ additionalProperties: true
4386
+ })
4387
+ }
4388
+ }, "Questionnaire instrument collection"),
4389
+ default: { $ref: "#/components/responses/Error" }
4390
+ }
4391
+ },
4392
+ post: {
4393
+ summary: "Create a custom questionnaire instrument",
4394
+ responses: {
4395
+ "201": jsonResponse({
4396
+ type: "object",
4397
+ required: ["instrument"],
4398
+ properties: {
4399
+ instrument: {
4400
+ type: "object",
4401
+ additionalProperties: true
4402
+ }
4403
+ }
4404
+ }, "Created questionnaire instrument"),
4405
+ default: { $ref: "#/components/responses/Error" }
4406
+ }
4407
+ }
4408
+ },
4409
+ "/api/v1/psyche/questionnaires/{id}": {
4410
+ get: {
4411
+ summary: "Get one questionnaire instrument with version and history detail",
4412
+ responses: {
4413
+ "200": jsonResponse({
4414
+ type: "object",
4415
+ required: ["instrument"],
4416
+ properties: {
4417
+ instrument: {
4418
+ type: "object",
4419
+ additionalProperties: true
4420
+ }
4421
+ }
4422
+ }, "Questionnaire instrument detail"),
4423
+ default: { $ref: "#/components/responses/Error" }
4424
+ }
4425
+ }
4426
+ },
4427
+ "/api/v1/psyche/questionnaires/{id}/clone": {
4428
+ post: {
4429
+ summary: "Clone a questionnaire instrument into a new draftable custom copy",
4430
+ responses: {
4431
+ "201": jsonResponse({
4432
+ type: "object",
4433
+ required: ["instrument"],
4434
+ properties: {
4435
+ instrument: {
4436
+ type: "object",
4437
+ additionalProperties: true
4438
+ }
4439
+ }
4440
+ }, "Cloned questionnaire instrument"),
4441
+ default: { $ref: "#/components/responses/Error" }
4442
+ }
4443
+ }
4444
+ },
4445
+ "/api/v1/psyche/questionnaires/{id}/draft": {
4446
+ post: {
4447
+ summary: "Ensure a draft questionnaire version exists",
4448
+ responses: {
4449
+ "200": jsonResponse({
4450
+ type: "object",
4451
+ required: ["instrument"],
4452
+ properties: {
4453
+ instrument: {
4454
+ type: "object",
4455
+ additionalProperties: true
4456
+ }
4457
+ }
4458
+ }, "Questionnaire instrument with ensured draft"),
4459
+ default: { $ref: "#/components/responses/Error" }
4460
+ }
4461
+ },
4462
+ patch: {
4463
+ summary: "Update the current questionnaire draft version",
4464
+ responses: {
4465
+ "200": jsonResponse({
4466
+ type: "object",
4467
+ required: ["instrument"],
4468
+ properties: {
4469
+ instrument: {
4470
+ type: "object",
4471
+ additionalProperties: true
4472
+ }
4473
+ }
4474
+ }, "Questionnaire instrument with updated draft"),
4475
+ default: { $ref: "#/components/responses/Error" }
4476
+ }
4477
+ }
4478
+ },
4479
+ "/api/v1/psyche/questionnaires/{id}/publish": {
4480
+ post: {
4481
+ summary: "Publish the current questionnaire draft as a new version",
4482
+ responses: {
4483
+ "200": jsonResponse({
4484
+ type: "object",
4485
+ required: ["instrument"],
4486
+ properties: {
4487
+ instrument: {
4488
+ type: "object",
4489
+ additionalProperties: true
4490
+ }
4491
+ }
4492
+ }, "Published questionnaire instrument"),
4493
+ default: { $ref: "#/components/responses/Error" }
4494
+ }
4495
+ }
4496
+ },
4497
+ "/api/v1/psyche/questionnaires/{id}/runs": {
4498
+ post: {
4499
+ summary: "Start a questionnaire run for one user and instrument version",
4500
+ responses: {
4501
+ "201": jsonResponse({
4502
+ type: "object",
4503
+ required: ["run", "instrument", "version", "answers", "scores", "history"],
4504
+ properties: {
4505
+ run: {
4506
+ type: "object",
4507
+ additionalProperties: true
4508
+ },
4509
+ instrument: {
4510
+ type: "object",
4511
+ additionalProperties: true
4512
+ },
4513
+ version: {
4514
+ type: "object",
4515
+ additionalProperties: true
4516
+ },
4517
+ answers: arrayOf({
4518
+ type: "object",
4519
+ additionalProperties: true
4520
+ }),
4521
+ scores: arrayOf({
4522
+ type: "object",
4523
+ additionalProperties: true
4524
+ }),
4525
+ history: arrayOf({
4526
+ type: "object",
4527
+ additionalProperties: true
4528
+ })
4529
+ }
4530
+ }, "Started questionnaire run"),
4531
+ default: { $ref: "#/components/responses/Error" }
4532
+ }
4533
+ }
4534
+ },
4535
+ "/api/v1/psyche/questionnaire-runs/{id}": {
4536
+ get: {
4537
+ summary: "Get one questionnaire run with answers, scores, and version detail",
4538
+ responses: {
4539
+ "200": jsonResponse({
4540
+ type: "object",
4541
+ required: ["run", "instrument", "version", "answers", "scores", "history"],
4542
+ properties: {
4543
+ run: {
4544
+ type: "object",
4545
+ additionalProperties: true
4546
+ },
4547
+ instrument: {
4548
+ type: "object",
4549
+ additionalProperties: true
4550
+ },
4551
+ version: {
4552
+ type: "object",
4553
+ additionalProperties: true
4554
+ },
4555
+ answers: arrayOf({
4556
+ type: "object",
4557
+ additionalProperties: true
4558
+ }),
4559
+ scores: arrayOf({
4560
+ type: "object",
4561
+ additionalProperties: true
4562
+ }),
4563
+ history: arrayOf({
4564
+ type: "object",
4565
+ additionalProperties: true
4566
+ })
4567
+ }
4568
+ }, "Questionnaire run detail"),
4569
+ default: { $ref: "#/components/responses/Error" }
4570
+ }
4571
+ },
4572
+ patch: {
4573
+ summary: "Update an in-progress questionnaire run",
4574
+ responses: {
4575
+ "200": jsonResponse({
4576
+ type: "object",
4577
+ required: ["run", "instrument", "version", "answers", "scores", "history"],
4578
+ properties: {
4579
+ run: {
4580
+ type: "object",
4581
+ additionalProperties: true
4582
+ },
4583
+ instrument: {
4584
+ type: "object",
4585
+ additionalProperties: true
4586
+ },
4587
+ version: {
4588
+ type: "object",
4589
+ additionalProperties: true
4590
+ },
4591
+ answers: arrayOf({
4592
+ type: "object",
4593
+ additionalProperties: true
4594
+ }),
4595
+ scores: arrayOf({
4596
+ type: "object",
4597
+ additionalProperties: true
4598
+ }),
4599
+ history: arrayOf({
4600
+ type: "object",
4601
+ additionalProperties: true
4602
+ })
4603
+ }
4604
+ }, "Updated questionnaire run"),
4605
+ default: { $ref: "#/components/responses/Error" }
4606
+ }
4607
+ }
4608
+ },
4609
+ "/api/v1/psyche/questionnaire-runs/{id}/complete": {
4610
+ post: {
4611
+ summary: "Complete a questionnaire run and persist its final scores",
4612
+ responses: {
4613
+ "200": jsonResponse({
4614
+ type: "object",
4615
+ required: ["run", "instrument", "version", "answers", "scores", "history"],
4616
+ properties: {
4617
+ run: {
4618
+ type: "object",
4619
+ additionalProperties: true
4620
+ },
4621
+ instrument: {
4622
+ type: "object",
4623
+ additionalProperties: true
4624
+ },
4625
+ version: {
4626
+ type: "object",
4627
+ additionalProperties: true
4628
+ },
4629
+ answers: arrayOf({
4630
+ type: "object",
4631
+ additionalProperties: true
4632
+ }),
4633
+ scores: arrayOf({
4634
+ type: "object",
4635
+ additionalProperties: true
4636
+ }),
4637
+ history: arrayOf({
4638
+ type: "object",
4639
+ additionalProperties: true
4640
+ })
4641
+ }
4642
+ }, "Completed questionnaire run"),
4643
+ default: { $ref: "#/components/responses/Error" }
4644
+ }
4645
+ }
4646
+ },
4647
+ "/api/v1/psyche/self-observation/calendar": {
4648
+ get: {
4649
+ summary: "Read self-observation notes arranged as a calendar-ready reflection surface",
4650
+ responses: {
4651
+ "200": jsonResponse({
4652
+ type: "object",
4653
+ required: ["calendar"],
4654
+ properties: {
4655
+ calendar: {
4656
+ type: "object",
4657
+ additionalProperties: true
4658
+ }
4659
+ }
4660
+ }, "Self-observation calendar"),
4661
+ default: { $ref: "#/components/responses/Error" }
4662
+ }
4663
+ }
4664
+ },
4043
4665
  "/api/v1/operator/overview": {
4044
4666
  get: {
4045
4667
  summary: "Get the one-shot operator overview with full current state, route guidance, and optional Psyche summary",
@@ -6310,4 +6932,5 @@ export function buildOpenApiDocument() {
6310
6932
  }
6311
6933
  }
6312
6934
  };
6935
+ return annotateOpenApiDocument(document);
6313
6936
  }