forge-openclaw-plugin 0.2.4 → 0.2.10

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 (114) hide show
  1. package/README.md +186 -6
  2. package/dist/assets/board-C_m78kvK.js +6 -0
  3. package/dist/assets/board-C_m78kvK.js.map +1 -0
  4. package/dist/assets/favicon-BCHm9dUV.ico +0 -0
  5. package/dist/assets/index-BWtLtXwb.js +36 -0
  6. package/dist/assets/index-BWtLtXwb.js.map +1 -0
  7. package/dist/assets/index-Dp5GXY_z.css +1 -0
  8. package/dist/assets/motion-CpZvZumD.js +10 -0
  9. package/dist/assets/motion-CpZvZumD.js.map +1 -0
  10. package/dist/assets/plus-jakarta-sans-latin-ext-wght-normal-DmpS2jIq.woff2 +0 -0
  11. package/dist/assets/plus-jakarta-sans-latin-wght-normal-eXO_dkmS.woff2 +0 -0
  12. package/dist/assets/plus-jakarta-sans-vietnamese-wght-normal-qRpaaN48.woff2 +0 -0
  13. package/dist/assets/sora-latin-ext-wght-normal-CawQDOvP.woff2 +0 -0
  14. package/dist/assets/sora-latin-wght-normal-DdqRvwsR.woff2 +0 -0
  15. package/dist/assets/space-grotesk-latin-500-normal-CNSSEhBt.woff +0 -0
  16. package/dist/assets/space-grotesk-latin-500-normal-lFbtlQH6.woff2 +0 -0
  17. package/dist/assets/space-grotesk-latin-700-normal-CwsQ-cCU.woff +0 -0
  18. package/dist/assets/space-grotesk-latin-700-normal-RjhwGPKo.woff2 +0 -0
  19. package/dist/assets/space-grotesk-latin-ext-500-normal-3dgZTiw9.woff +0 -0
  20. package/dist/assets/space-grotesk-latin-ext-500-normal-DUe3BAxM.woff2 +0 -0
  21. package/dist/assets/space-grotesk-latin-ext-700-normal-BQnZhY3m.woff2 +0 -0
  22. package/dist/assets/space-grotesk-latin-ext-700-normal-HVCqSBdx.woff +0 -0
  23. package/dist/assets/space-grotesk-vietnamese-500-normal-BTqKIpxg.woff +0 -0
  24. package/dist/assets/space-grotesk-vietnamese-500-normal-BmEvtly_.woff2 +0 -0
  25. package/dist/assets/space-grotesk-vietnamese-700-normal-DMty7AZE.woff2 +0 -0
  26. package/dist/assets/space-grotesk-vietnamese-700-normal-Duxec5Rn.woff +0 -0
  27. package/dist/assets/table-DtyXTw03.js +23 -0
  28. package/dist/assets/table-DtyXTw03.js.map +1 -0
  29. package/dist/assets/ui-BXbpiKyS.js +46 -0
  30. package/dist/assets/ui-BXbpiKyS.js.map +1 -0
  31. package/dist/assets/vendor-CRS-psbw.css +1 -0
  32. package/dist/assets/vendor-QBH6qVEe.js +433 -0
  33. package/dist/assets/vendor-QBH6qVEe.js.map +1 -0
  34. package/dist/assets/viz-w-IMeueL.js +34 -0
  35. package/dist/assets/viz-w-IMeueL.js.map +1 -0
  36. package/dist/favicon.ico +0 -0
  37. package/dist/favicon.png +0 -0
  38. package/dist/index.html +29 -0
  39. package/dist/openclaw/api-client.d.ts +9 -0
  40. package/dist/openclaw/api-client.js +31 -4
  41. package/dist/openclaw/local-runtime.d.ts +3 -0
  42. package/dist/openclaw/local-runtime.js +136 -0
  43. package/dist/openclaw/parity.d.ts +4 -4
  44. package/dist/openclaw/parity.js +23 -33
  45. package/dist/openclaw/plugin-entry-shared.d.ts +4 -2
  46. package/dist/openclaw/plugin-entry-shared.js +63 -9
  47. package/dist/openclaw/routes.d.ts +12 -3
  48. package/dist/openclaw/routes.js +156 -924
  49. package/dist/openclaw/tools.js +242 -1100
  50. package/dist/server/app.js +2487 -0
  51. package/dist/server/db.js +313 -0
  52. package/dist/server/demo-data.js +49 -0
  53. package/dist/server/e2e-server.js +20 -0
  54. package/dist/server/errors.js +15 -0
  55. package/dist/server/index.js +16 -0
  56. package/dist/server/managers/base.js +17 -0
  57. package/dist/server/managers/contracts.js +47 -0
  58. package/dist/server/managers/platform/api-gateway-manager.js +11 -0
  59. package/dist/server/managers/platform/audit-manager.js +15 -0
  60. package/dist/server/managers/platform/authentication-manager.js +56 -0
  61. package/dist/server/managers/platform/authorization-manager.js +56 -0
  62. package/dist/server/managers/platform/background-job-manager.js +10 -0
  63. package/dist/server/managers/platform/configuration-manager.js +33 -0
  64. package/dist/server/managers/platform/database-manager.js +14 -0
  65. package/dist/server/managers/platform/event-bus-manager.js +7 -0
  66. package/dist/server/managers/platform/external-service-manager.js +11 -0
  67. package/dist/server/managers/platform/health-manager.js +7 -0
  68. package/dist/server/managers/platform/migration-manager.js +8 -0
  69. package/dist/server/managers/platform/search-index-manager.js +4 -0
  70. package/dist/server/managers/platform/secrets-manager.js +19 -0
  71. package/dist/server/managers/platform/session-manager.js +121 -0
  72. package/dist/server/managers/platform/storage-manager.js +16 -0
  73. package/dist/server/managers/platform/token-manager.js +37 -0
  74. package/dist/server/managers/platform/transaction-manager.js +8 -0
  75. package/dist/server/managers/platform/trusted-network.js +39 -0
  76. package/dist/server/managers/runtime.js +56 -0
  77. package/dist/server/managers/type-guards.js +4 -0
  78. package/dist/server/openapi.js +3553 -0
  79. package/dist/server/psyche-types.js +366 -0
  80. package/dist/server/repositories/activity-events.js +157 -0
  81. package/dist/server/repositories/collaboration.js +497 -0
  82. package/dist/server/repositories/deleted-entities.js +226 -0
  83. package/dist/server/repositories/domains.js +30 -0
  84. package/dist/server/repositories/event-log.js +64 -0
  85. package/dist/server/repositories/goals.js +156 -0
  86. package/dist/server/repositories/notes.js +359 -0
  87. package/dist/server/repositories/projects.js +211 -0
  88. package/dist/server/repositories/psyche.js +1353 -0
  89. package/dist/server/repositories/rewards.js +675 -0
  90. package/dist/server/repositories/settings.js +399 -0
  91. package/dist/server/repositories/tags.js +160 -0
  92. package/dist/server/repositories/task-runs.js +490 -0
  93. package/dist/server/repositories/tasks.js +424 -0
  94. package/dist/server/seed-demo.js +11 -0
  95. package/dist/server/services/context.js +214 -0
  96. package/dist/server/services/dashboard.js +173 -0
  97. package/dist/server/services/entity-crud.js +573 -0
  98. package/dist/server/services/gamification.js +215 -0
  99. package/dist/server/services/insights.js +91 -0
  100. package/dist/server/services/projects.js +77 -0
  101. package/dist/server/services/psyche.js +63 -0
  102. package/dist/server/services/relations.js +28 -0
  103. package/dist/server/services/reviews.js +88 -0
  104. package/dist/server/services/run-recovery.js +13 -0
  105. package/dist/server/services/tagging.js +49 -0
  106. package/dist/server/services/task-run-watchdog.js +92 -0
  107. package/dist/server/services/work-time.js +176 -0
  108. package/dist/server/types.js +1058 -0
  109. package/dist/server/web.js +91 -0
  110. package/openclaw.plugin.json +32 -9
  111. package/package.json +17 -4
  112. package/server/migrations/001_core.sql +411 -0
  113. package/server/migrations/002_psyche.sql +392 -0
  114. package/skills/forge-openclaw/SKILL.md +197 -271
@@ -0,0 +1,3553 @@
1
+ function arrayOf(items) {
2
+ return {
3
+ type: "array",
4
+ items
5
+ };
6
+ }
7
+ function nullable(schema) {
8
+ return {
9
+ anyOf: [schema, { type: "null" }]
10
+ };
11
+ }
12
+ function jsonResponse(schema, description) {
13
+ return {
14
+ description,
15
+ content: {
16
+ "application/json": {
17
+ schema
18
+ }
19
+ }
20
+ };
21
+ }
22
+ export function buildOpenApiDocument() {
23
+ const validationIssue = {
24
+ type: "object",
25
+ additionalProperties: false,
26
+ required: ["path", "message"],
27
+ properties: {
28
+ path: { type: "string" },
29
+ message: { type: "string" }
30
+ }
31
+ };
32
+ const errorResponse = {
33
+ type: "object",
34
+ additionalProperties: true,
35
+ required: ["code", "error", "statusCode"],
36
+ properties: {
37
+ code: { type: "string" },
38
+ error: { type: "string" },
39
+ statusCode: { type: "integer" },
40
+ details: arrayOf({ $ref: "#/components/schemas/ValidationIssue" })
41
+ }
42
+ };
43
+ const tag = {
44
+ type: "object",
45
+ additionalProperties: false,
46
+ required: ["id", "name", "kind", "color", "description"],
47
+ properties: {
48
+ id: { type: "string" },
49
+ name: { type: "string" },
50
+ kind: { type: "string", enum: ["value", "category", "execution"] },
51
+ color: { type: "string" },
52
+ description: { type: "string" }
53
+ }
54
+ };
55
+ const goal = {
56
+ type: "object",
57
+ additionalProperties: false,
58
+ required: ["id", "title", "description", "horizon", "status", "targetPoints", "themeColor", "createdAt", "updatedAt", "tagIds"],
59
+ properties: {
60
+ id: { type: "string" },
61
+ title: { type: "string" },
62
+ description: { type: "string" },
63
+ horizon: { type: "string", enum: ["quarter", "year", "lifetime"] },
64
+ status: { type: "string", enum: ["active", "paused", "completed"] },
65
+ targetPoints: { type: "integer" },
66
+ themeColor: { type: "string" },
67
+ createdAt: { type: "string", format: "date-time" },
68
+ updatedAt: { type: "string", format: "date-time" },
69
+ tagIds: arrayOf({ type: "string" })
70
+ }
71
+ };
72
+ const dashboardGoal = {
73
+ allOf: [
74
+ { $ref: "#/components/schemas/Goal" },
75
+ {
76
+ type: "object",
77
+ additionalProperties: false,
78
+ required: ["progress", "totalTasks", "completedTasks", "earnedPoints", "momentumLabel", "tags"],
79
+ properties: {
80
+ progress: { type: "number" },
81
+ totalTasks: { type: "integer" },
82
+ completedTasks: { type: "integer" },
83
+ earnedPoints: { type: "integer" },
84
+ momentumLabel: { type: "string" },
85
+ tags: arrayOf({ $ref: "#/components/schemas/Tag" })
86
+ }
87
+ }
88
+ ]
89
+ };
90
+ const project = {
91
+ type: "object",
92
+ additionalProperties: false,
93
+ required: ["id", "goalId", "title", "description", "status", "targetPoints", "themeColor", "createdAt", "updatedAt"],
94
+ properties: {
95
+ id: { type: "string" },
96
+ goalId: { type: "string" },
97
+ title: { type: "string" },
98
+ description: { type: "string" },
99
+ status: { type: "string", enum: ["active", "paused", "completed"] },
100
+ targetPoints: { type: "integer" },
101
+ themeColor: { type: "string" },
102
+ createdAt: { type: "string", format: "date-time" },
103
+ updatedAt: { type: "string", format: "date-time" }
104
+ }
105
+ };
106
+ const taskTimeSummary = {
107
+ type: "object",
108
+ additionalProperties: false,
109
+ required: ["totalTrackedSeconds", "totalCreditedSeconds", "activeRunCount", "hasCurrentRun", "currentRunId"],
110
+ properties: {
111
+ totalTrackedSeconds: { type: "integer" },
112
+ totalCreditedSeconds: { type: "number" },
113
+ activeRunCount: { type: "integer" },
114
+ hasCurrentRun: { type: "boolean" },
115
+ currentRunId: nullable({ type: "string" })
116
+ }
117
+ };
118
+ const projectSummary = {
119
+ allOf: [
120
+ { $ref: "#/components/schemas/Project" },
121
+ {
122
+ type: "object",
123
+ additionalProperties: false,
124
+ required: [
125
+ "goalTitle",
126
+ "activeTaskCount",
127
+ "completedTaskCount",
128
+ "totalTasks",
129
+ "earnedPoints",
130
+ "progress",
131
+ "nextTaskId",
132
+ "nextTaskTitle",
133
+ "momentumLabel",
134
+ "time"
135
+ ],
136
+ properties: {
137
+ goalTitle: { type: "string" },
138
+ activeTaskCount: { type: "integer" },
139
+ completedTaskCount: { type: "integer" },
140
+ totalTasks: { type: "integer" },
141
+ earnedPoints: { type: "integer" },
142
+ progress: { type: "number" },
143
+ nextTaskId: nullable({ type: "string" }),
144
+ nextTaskTitle: nullable({ type: "string" }),
145
+ momentumLabel: { type: "string" },
146
+ time: { $ref: "#/components/schemas/TaskTimeSummary" }
147
+ }
148
+ }
149
+ ]
150
+ };
151
+ const task = {
152
+ type: "object",
153
+ additionalProperties: false,
154
+ required: [
155
+ "id",
156
+ "title",
157
+ "description",
158
+ "status",
159
+ "priority",
160
+ "owner",
161
+ "goalId",
162
+ "projectId",
163
+ "dueDate",
164
+ "effort",
165
+ "energy",
166
+ "points",
167
+ "sortOrder",
168
+ "completedAt",
169
+ "createdAt",
170
+ "updatedAt",
171
+ "tagIds",
172
+ "time"
173
+ ],
174
+ properties: {
175
+ id: { type: "string" },
176
+ title: { type: "string" },
177
+ description: { type: "string" },
178
+ status: { type: "string", enum: ["backlog", "focus", "in_progress", "blocked", "done"] },
179
+ priority: { type: "string", enum: ["low", "medium", "high", "critical"] },
180
+ owner: { type: "string" },
181
+ goalId: nullable({ type: "string" }),
182
+ projectId: nullable({ type: "string" }),
183
+ dueDate: nullable({ type: "string", format: "date" }),
184
+ effort: { type: "string", enum: ["light", "deep", "marathon"] },
185
+ energy: { type: "string", enum: ["low", "steady", "high"] },
186
+ points: { type: "integer" },
187
+ sortOrder: { type: "integer" },
188
+ completedAt: nullable({ type: "string", format: "date-time" }),
189
+ createdAt: { type: "string", format: "date-time" },
190
+ updatedAt: { type: "string", format: "date-time" },
191
+ tagIds: arrayOf({ type: "string" }),
192
+ time: { $ref: "#/components/schemas/TaskTimeSummary" }
193
+ }
194
+ };
195
+ const taskRun = {
196
+ type: "object",
197
+ additionalProperties: false,
198
+ required: [
199
+ "id",
200
+ "taskId",
201
+ "taskTitle",
202
+ "actor",
203
+ "status",
204
+ "note",
205
+ "leaseTtlSeconds",
206
+ "claimedAt",
207
+ "heartbeatAt",
208
+ "leaseExpiresAt",
209
+ "completedAt",
210
+ "releasedAt",
211
+ "timedOutAt",
212
+ "updatedAt",
213
+ "timerMode",
214
+ "plannedDurationSeconds",
215
+ "elapsedWallSeconds",
216
+ "creditedSeconds",
217
+ "remainingSeconds",
218
+ "overtimeSeconds",
219
+ "isCurrent"
220
+ ],
221
+ properties: {
222
+ id: { type: "string" },
223
+ taskId: { type: "string" },
224
+ taskTitle: { type: "string" },
225
+ actor: { type: "string" },
226
+ status: { type: "string", enum: ["active", "completed", "released", "timed_out"] },
227
+ note: { type: "string" },
228
+ leaseTtlSeconds: { type: "integer" },
229
+ claimedAt: { type: "string", format: "date-time" },
230
+ heartbeatAt: { type: "string", format: "date-time" },
231
+ leaseExpiresAt: { type: "string", format: "date-time" },
232
+ completedAt: nullable({ type: "string", format: "date-time" }),
233
+ releasedAt: nullable({ type: "string", format: "date-time" }),
234
+ timedOutAt: nullable({ type: "string", format: "date-time" }),
235
+ updatedAt: { type: "string", format: "date-time" },
236
+ timerMode: { type: "string", enum: ["planned", "unlimited"] },
237
+ plannedDurationSeconds: nullable({ type: "integer" }),
238
+ elapsedWallSeconds: { type: "integer" },
239
+ creditedSeconds: { type: "number" },
240
+ remainingSeconds: nullable({ type: "integer" }),
241
+ overtimeSeconds: { type: "integer" },
242
+ isCurrent: { type: "boolean" }
243
+ }
244
+ };
245
+ const activityEvent = {
246
+ type: "object",
247
+ additionalProperties: false,
248
+ required: ["id", "entityType", "entityId", "eventType", "title", "description", "actor", "source", "metadata", "createdAt"],
249
+ properties: {
250
+ id: { type: "string" },
251
+ entityType: {
252
+ type: "string",
253
+ enum: [
254
+ "task",
255
+ "goal",
256
+ "project",
257
+ "domain",
258
+ "psyche_value",
259
+ "behavior_pattern",
260
+ "behavior",
261
+ "belief_entry",
262
+ "mode_profile",
263
+ "mode_guide_session",
264
+ "trigger_report",
265
+ "note",
266
+ "tag",
267
+ "task_run",
268
+ "system",
269
+ "insight",
270
+ "approval_request",
271
+ "agent_action",
272
+ "reward",
273
+ "session",
274
+ "event_type",
275
+ "emotion_definition"
276
+ ]
277
+ },
278
+ entityId: { type: "string" },
279
+ eventType: { type: "string" },
280
+ title: { type: "string" },
281
+ description: { type: "string" },
282
+ actor: nullable({ type: "string" }),
283
+ source: { type: "string", enum: ["ui", "openclaw", "agent", "system"] },
284
+ metadata: {
285
+ type: "object",
286
+ additionalProperties: {
287
+ anyOf: [{ type: "string" }, { type: "number" }, { type: "boolean" }, { type: "null" }]
288
+ }
289
+ },
290
+ createdAt: { type: "string", format: "date-time" }
291
+ }
292
+ };
293
+ const gamificationProfile = {
294
+ type: "object",
295
+ additionalProperties: false,
296
+ required: ["totalXp", "level", "currentLevelXp", "nextLevelXp", "weeklyXp", "streakDays", "comboMultiplier", "momentumScore", "topGoalId", "topGoalTitle"],
297
+ properties: {
298
+ totalXp: { type: "integer" },
299
+ level: { type: "integer" },
300
+ currentLevelXp: { type: "integer" },
301
+ nextLevelXp: { type: "integer" },
302
+ weeklyXp: { type: "integer" },
303
+ streakDays: { type: "integer" },
304
+ comboMultiplier: { type: "number" },
305
+ momentumScore: { type: "integer" },
306
+ topGoalId: nullable({ type: "string" }),
307
+ topGoalTitle: nullable({ type: "string" })
308
+ }
309
+ };
310
+ const noteLink = {
311
+ type: "object",
312
+ additionalProperties: false,
313
+ required: ["entityType", "entityId", "anchorKey"],
314
+ properties: {
315
+ entityType: { type: "string" },
316
+ entityId: { type: "string" },
317
+ anchorKey: nullable({ type: "string" })
318
+ }
319
+ };
320
+ const note = {
321
+ type: "object",
322
+ additionalProperties: false,
323
+ required: ["id", "contentMarkdown", "contentPlain", "author", "source", "createdAt", "updatedAt", "links"],
324
+ properties: {
325
+ id: { type: "string" },
326
+ contentMarkdown: { type: "string" },
327
+ contentPlain: { type: "string" },
328
+ author: nullable({ type: "string" }),
329
+ source: { type: "string", enum: ["ui", "openclaw", "agent", "system"] },
330
+ createdAt: { type: "string", format: "date-time" },
331
+ updatedAt: { type: "string", format: "date-time" },
332
+ links: arrayOf({ $ref: "#/components/schemas/NoteLink" })
333
+ }
334
+ };
335
+ const noteSummary = {
336
+ type: "object",
337
+ additionalProperties: false,
338
+ required: ["count", "latestNoteId", "latestCreatedAt"],
339
+ properties: {
340
+ count: { type: "integer" },
341
+ latestNoteId: nullable({ type: "string" }),
342
+ latestCreatedAt: nullable({ type: "string", format: "date-time" })
343
+ }
344
+ };
345
+ const notesSummaryByEntity = {
346
+ type: "object",
347
+ additionalProperties: { $ref: "#/components/schemas/NoteSummary" }
348
+ };
349
+ const achievementSignal = {
350
+ type: "object",
351
+ additionalProperties: false,
352
+ required: ["id", "title", "summary", "tier", "progressLabel", "unlocked", "unlockedAt"],
353
+ properties: {
354
+ id: { type: "string" },
355
+ title: { type: "string" },
356
+ summary: { type: "string" },
357
+ tier: { type: "string", enum: ["bronze", "silver", "gold", "platinum"] },
358
+ progressLabel: { type: "string" },
359
+ unlocked: { type: "boolean" },
360
+ unlockedAt: nullable({ type: "string", format: "date-time" })
361
+ }
362
+ };
363
+ const milestoneReward = {
364
+ type: "object",
365
+ additionalProperties: false,
366
+ required: ["id", "title", "summary", "rewardLabel", "progressLabel", "current", "target", "completed"],
367
+ properties: {
368
+ id: { type: "string" },
369
+ title: { type: "string" },
370
+ summary: { type: "string" },
371
+ rewardLabel: { type: "string" },
372
+ progressLabel: { type: "string" },
373
+ current: { type: "integer" },
374
+ target: { type: "integer" },
375
+ completed: { type: "boolean" }
376
+ }
377
+ };
378
+ const dashboardPayload = {
379
+ type: "object",
380
+ additionalProperties: false,
381
+ required: ["stats", "goals", "projects", "tasks", "tags", "suggestedTags", "owners", "executionBuckets", "gamification", "achievements", "milestoneRewards", "recentActivity", "notesSummaryByEntity"],
382
+ properties: {
383
+ stats: {
384
+ type: "object",
385
+ additionalProperties: false,
386
+ required: ["totalPoints", "completedThisWeek", "activeGoals", "alignmentScore", "focusTasks", "overdueTasks", "dueThisWeek"],
387
+ properties: {
388
+ totalPoints: { type: "integer" },
389
+ completedThisWeek: { type: "integer" },
390
+ activeGoals: { type: "integer" },
391
+ alignmentScore: { type: "integer" },
392
+ focusTasks: { type: "integer" },
393
+ overdueTasks: { type: "integer" },
394
+ dueThisWeek: { type: "integer" }
395
+ }
396
+ },
397
+ goals: arrayOf({ $ref: "#/components/schemas/DashboardGoal" }),
398
+ projects: arrayOf({ $ref: "#/components/schemas/ProjectSummary" }),
399
+ tasks: arrayOf({ $ref: "#/components/schemas/Task" }),
400
+ tags: arrayOf({ $ref: "#/components/schemas/Tag" }),
401
+ suggestedTags: arrayOf({ $ref: "#/components/schemas/Tag" }),
402
+ owners: arrayOf({ type: "string" }),
403
+ executionBuckets: arrayOf({
404
+ type: "object",
405
+ additionalProperties: false,
406
+ required: ["id", "label", "summary", "tone", "tasks"],
407
+ properties: {
408
+ id: { type: "string", enum: ["overdue", "due_soon", "focus_now", "recently_completed"] },
409
+ label: { type: "string" },
410
+ summary: { type: "string" },
411
+ tone: { type: "string", enum: ["urgent", "accent", "neutral", "success"] },
412
+ tasks: arrayOf({ $ref: "#/components/schemas/Task" })
413
+ }
414
+ }),
415
+ gamification: { $ref: "#/components/schemas/GamificationProfile" },
416
+ achievements: arrayOf({ $ref: "#/components/schemas/AchievementSignal" }),
417
+ milestoneRewards: arrayOf({ $ref: "#/components/schemas/MilestoneReward" }),
418
+ recentActivity: arrayOf({ $ref: "#/components/schemas/ActivityEvent" }),
419
+ notesSummaryByEntity: { $ref: "#/components/schemas/NotesSummaryByEntity" }
420
+ }
421
+ };
422
+ const overviewContext = {
423
+ type: "object",
424
+ additionalProperties: false,
425
+ required: ["generatedAt", "strategicHeader", "projects", "activeGoals", "topTasks", "recentEvidence", "achievements", "domainBalance", "neglectedGoals"],
426
+ properties: {
427
+ generatedAt: { type: "string", format: "date-time" },
428
+ strategicHeader: {
429
+ type: "object",
430
+ additionalProperties: false,
431
+ required: ["streakDays", "level", "totalXp", "currentLevelXp", "nextLevelXp", "momentumScore", "focusTasks", "overdueTasks"],
432
+ properties: {
433
+ streakDays: { type: "integer" },
434
+ level: { type: "integer" },
435
+ totalXp: { type: "integer" },
436
+ currentLevelXp: { type: "integer" },
437
+ nextLevelXp: { type: "integer" },
438
+ momentumScore: { type: "integer" },
439
+ focusTasks: { type: "integer" },
440
+ overdueTasks: { type: "integer" }
441
+ }
442
+ },
443
+ projects: arrayOf({ $ref: "#/components/schemas/ProjectSummary" }),
444
+ activeGoals: arrayOf({ $ref: "#/components/schemas/DashboardGoal" }),
445
+ topTasks: arrayOf({ $ref: "#/components/schemas/Task" }),
446
+ recentEvidence: arrayOf({ $ref: "#/components/schemas/ActivityEvent" }),
447
+ achievements: arrayOf({ $ref: "#/components/schemas/AchievementSignal" }),
448
+ domainBalance: arrayOf({
449
+ type: "object",
450
+ additionalProperties: false,
451
+ required: ["tagId", "label", "color", "goalCount", "activeTaskCount", "completedPoints", "momentumLabel"],
452
+ properties: {
453
+ tagId: { type: "string" },
454
+ label: { type: "string" },
455
+ color: { type: "string" },
456
+ goalCount: { type: "integer" },
457
+ activeTaskCount: { type: "integer" },
458
+ completedPoints: { type: "integer" },
459
+ momentumLabel: { type: "string" }
460
+ }
461
+ }),
462
+ neglectedGoals: arrayOf({
463
+ type: "object",
464
+ additionalProperties: false,
465
+ required: ["goalId", "title", "summary", "risk"],
466
+ properties: {
467
+ goalId: { type: "string" },
468
+ title: { type: "string" },
469
+ summary: { type: "string" },
470
+ risk: { type: "string", enum: ["low", "medium", "high"] }
471
+ }
472
+ })
473
+ }
474
+ };
475
+ const todayContext = {
476
+ type: "object",
477
+ additionalProperties: false,
478
+ required: ["generatedAt", "directive", "timeline", "dailyQuests", "milestoneRewards", "momentum"],
479
+ properties: {
480
+ generatedAt: { type: "string", format: "date-time" },
481
+ directive: {
482
+ type: "object",
483
+ additionalProperties: false,
484
+ required: ["task", "goalTitle", "rewardXp", "sessionLabel"],
485
+ properties: {
486
+ task: nullable({ $ref: "#/components/schemas/Task" }),
487
+ goalTitle: nullable({ type: "string" }),
488
+ rewardXp: { type: "integer" },
489
+ sessionLabel: { type: "string" }
490
+ }
491
+ },
492
+ timeline: arrayOf({
493
+ type: "object",
494
+ additionalProperties: false,
495
+ required: ["id", "label", "tasks"],
496
+ properties: {
497
+ id: { type: "string", enum: ["completed", "active", "upcoming", "deferred"] },
498
+ label: { type: "string" },
499
+ tasks: arrayOf({ $ref: "#/components/schemas/Task" })
500
+ }
501
+ }),
502
+ dailyQuests: arrayOf({
503
+ type: "object",
504
+ additionalProperties: false,
505
+ required: ["id", "title", "summary", "rewardXp", "progressLabel", "completed"],
506
+ properties: {
507
+ id: { type: "string" },
508
+ title: { type: "string" },
509
+ summary: { type: "string" },
510
+ rewardXp: { type: "integer" },
511
+ progressLabel: { type: "string" },
512
+ completed: { type: "boolean" }
513
+ }
514
+ }),
515
+ milestoneRewards: arrayOf({ $ref: "#/components/schemas/MilestoneReward" }),
516
+ momentum: {
517
+ type: "object",
518
+ additionalProperties: false,
519
+ required: ["streakDays", "momentumScore", "recoveryHint"],
520
+ properties: {
521
+ streakDays: { type: "integer" },
522
+ momentumScore: { type: "integer" },
523
+ recoveryHint: { type: "string" }
524
+ }
525
+ }
526
+ }
527
+ };
528
+ const riskContext = {
529
+ type: "object",
530
+ additionalProperties: false,
531
+ required: ["generatedAt", "overdueTasks", "blockedTasks", "neglectedGoals", "summary"],
532
+ properties: {
533
+ generatedAt: { type: "string", format: "date-time" },
534
+ overdueTasks: arrayOf({ $ref: "#/components/schemas/Task" }),
535
+ blockedTasks: arrayOf({ $ref: "#/components/schemas/Task" }),
536
+ neglectedGoals: arrayOf({
537
+ type: "object",
538
+ additionalProperties: false,
539
+ required: ["goalId", "title", "summary", "risk"],
540
+ properties: {
541
+ goalId: { type: "string" },
542
+ title: { type: "string" },
543
+ summary: { type: "string" },
544
+ risk: { type: "string", enum: ["low", "medium", "high"] }
545
+ }
546
+ }),
547
+ summary: { type: "string" }
548
+ }
549
+ };
550
+ const forgeSnapshot = {
551
+ type: "object",
552
+ additionalProperties: false,
553
+ required: ["meta", "metrics", "dashboard", "overview", "today", "risk", "goals", "projects", "tags", "tasks", "activeTaskRuns", "activity"],
554
+ properties: {
555
+ meta: {
556
+ type: "object",
557
+ additionalProperties: false,
558
+ required: ["apiVersion", "transport", "generatedAt", "backend", "mode"],
559
+ properties: {
560
+ apiVersion: { type: "string", const: "v1" },
561
+ transport: { type: "string" },
562
+ generatedAt: { type: "string", format: "date-time" },
563
+ backend: { type: "string" },
564
+ mode: { type: "string" }
565
+ }
566
+ },
567
+ metrics: { $ref: "#/components/schemas/GamificationProfile" },
568
+ dashboard: { $ref: "#/components/schemas/DashboardPayload" },
569
+ overview: { $ref: "#/components/schemas/OverviewContext" },
570
+ today: { $ref: "#/components/schemas/TodayContext" },
571
+ risk: { $ref: "#/components/schemas/RiskContext" },
572
+ goals: arrayOf({ $ref: "#/components/schemas/Goal" }),
573
+ projects: arrayOf({ $ref: "#/components/schemas/ProjectSummary" }),
574
+ tags: arrayOf({ $ref: "#/components/schemas/Tag" }),
575
+ tasks: arrayOf({ $ref: "#/components/schemas/Task" }),
576
+ activeTaskRuns: arrayOf({ $ref: "#/components/schemas/TaskRun" }),
577
+ activity: arrayOf({ $ref: "#/components/schemas/ActivityEvent" })
578
+ }
579
+ };
580
+ const taskContextPayload = {
581
+ type: "object",
582
+ additionalProperties: false,
583
+ required: ["task", "goal", "project", "activeTaskRun", "taskRuns", "activity", "notesSummaryByEntity"],
584
+ properties: {
585
+ task: { $ref: "#/components/schemas/Task" },
586
+ goal: nullable({ $ref: "#/components/schemas/Goal" }),
587
+ project: nullable({ $ref: "#/components/schemas/ProjectSummary" }),
588
+ activeTaskRun: nullable({ $ref: "#/components/schemas/TaskRun" }),
589
+ taskRuns: arrayOf({ $ref: "#/components/schemas/TaskRun" }),
590
+ activity: arrayOf({ $ref: "#/components/schemas/ActivityEvent" }),
591
+ notesSummaryByEntity: { $ref: "#/components/schemas/NotesSummaryByEntity" }
592
+ }
593
+ };
594
+ const projectBoardPayload = {
595
+ type: "object",
596
+ additionalProperties: false,
597
+ required: ["project", "goal", "tasks", "activity", "notesSummaryByEntity"],
598
+ properties: {
599
+ project: { $ref: "#/components/schemas/ProjectSummary" },
600
+ goal: { $ref: "#/components/schemas/Goal" },
601
+ tasks: arrayOf({ $ref: "#/components/schemas/Task" }),
602
+ activity: arrayOf({ $ref: "#/components/schemas/ActivityEvent" }),
603
+ notesSummaryByEntity: { $ref: "#/components/schemas/NotesSummaryByEntity" }
604
+ }
605
+ };
606
+ const insightsPayload = {
607
+ type: "object",
608
+ additionalProperties: false,
609
+ required: ["generatedAt", "status", "momentumHeatmap", "executionTrends", "domainBalance", "coaching", "evidenceDigest", "feed", "openCount"],
610
+ properties: {
611
+ generatedAt: { type: "string", format: "date-time" },
612
+ status: {
613
+ type: "object",
614
+ additionalProperties: false,
615
+ required: ["systemStatus", "streakDays", "momentumScore"],
616
+ properties: {
617
+ systemStatus: { type: "string" },
618
+ streakDays: { type: "integer" },
619
+ momentumScore: { type: "integer" }
620
+ }
621
+ },
622
+ momentumHeatmap: arrayOf({
623
+ type: "object",
624
+ additionalProperties: false,
625
+ required: ["id", "label", "completed", "focus", "intensity"],
626
+ properties: {
627
+ id: { type: "string" },
628
+ label: { type: "string" },
629
+ completed: { type: "integer" },
630
+ focus: { type: "integer" },
631
+ intensity: { type: "integer" }
632
+ }
633
+ }),
634
+ executionTrends: arrayOf({
635
+ type: "object",
636
+ additionalProperties: false,
637
+ required: ["label", "xp", "focusScore"],
638
+ properties: {
639
+ label: { type: "string" },
640
+ xp: { type: "integer" },
641
+ focusScore: { type: "integer" }
642
+ }
643
+ }),
644
+ domainBalance: arrayOf({
645
+ type: "object",
646
+ additionalProperties: false,
647
+ required: ["label", "value", "color", "note"],
648
+ properties: {
649
+ label: { type: "string" },
650
+ value: { type: "integer" },
651
+ color: { type: "string" },
652
+ note: { type: "string" }
653
+ }
654
+ }),
655
+ coaching: {
656
+ type: "object",
657
+ additionalProperties: false,
658
+ required: ["title", "summary", "recommendation", "ctaLabel"],
659
+ properties: {
660
+ title: { type: "string" },
661
+ summary: { type: "string" },
662
+ recommendation: { type: "string" },
663
+ ctaLabel: { type: "string" }
664
+ }
665
+ },
666
+ evidenceDigest: arrayOf({ $ref: "#/components/schemas/ActivityEvent" }),
667
+ feed: arrayOf({ $ref: "#/components/schemas/Insight" }),
668
+ openCount: { type: "integer" }
669
+ }
670
+ };
671
+ const weeklyReviewPayload = {
672
+ type: "object",
673
+ additionalProperties: false,
674
+ required: ["generatedAt", "windowLabel", "momentumSummary", "chart", "wins", "calibration", "reward"],
675
+ properties: {
676
+ generatedAt: { type: "string", format: "date-time" },
677
+ windowLabel: { type: "string" },
678
+ momentumSummary: {
679
+ type: "object",
680
+ additionalProperties: false,
681
+ required: ["totalXp", "focusHours", "efficiencyScore", "peakWindow"],
682
+ properties: {
683
+ totalXp: { type: "integer" },
684
+ focusHours: { type: "integer" },
685
+ efficiencyScore: { type: "integer" },
686
+ peakWindow: { type: "string" }
687
+ }
688
+ },
689
+ chart: arrayOf({
690
+ type: "object",
691
+ additionalProperties: false,
692
+ required: ["label", "xp", "focusHours"],
693
+ properties: {
694
+ label: { type: "string" },
695
+ xp: { type: "integer" },
696
+ focusHours: { type: "integer" }
697
+ }
698
+ }),
699
+ wins: arrayOf({
700
+ type: "object",
701
+ additionalProperties: false,
702
+ required: ["id", "title", "summary", "rewardXp"],
703
+ properties: {
704
+ id: { type: "string" },
705
+ title: { type: "string" },
706
+ summary: { type: "string" },
707
+ rewardXp: { type: "integer" }
708
+ }
709
+ }),
710
+ calibration: arrayOf({
711
+ type: "object",
712
+ additionalProperties: false,
713
+ required: ["id", "title", "mode", "note"],
714
+ properties: {
715
+ id: { type: "string" },
716
+ title: { type: "string" },
717
+ mode: { type: "string", enum: ["accelerate", "maintain", "recover"] },
718
+ note: { type: "string" }
719
+ }
720
+ }),
721
+ reward: {
722
+ type: "object",
723
+ additionalProperties: false,
724
+ required: ["title", "summary", "rewardXp"],
725
+ properties: {
726
+ title: { type: "string" },
727
+ summary: { type: "string" },
728
+ rewardXp: { type: "integer" }
729
+ }
730
+ }
731
+ }
732
+ };
733
+ const agentTokenSummary = {
734
+ type: "object",
735
+ additionalProperties: false,
736
+ required: ["id", "label", "tokenPrefix", "scopes", "agentId", "agentLabel", "trustLevel", "autonomyMode", "approvalMode", "description", "lastUsedAt", "revokedAt", "createdAt", "updatedAt", "status"],
737
+ properties: {
738
+ id: { type: "string" },
739
+ label: { type: "string" },
740
+ tokenPrefix: { type: "string" },
741
+ scopes: arrayOf({ type: "string" }),
742
+ agentId: nullable({ type: "string" }),
743
+ agentLabel: nullable({ type: "string" }),
744
+ trustLevel: { type: "string", enum: ["standard", "trusted", "autonomous"] },
745
+ autonomyMode: { type: "string", enum: ["approval_required", "scoped_write", "autonomous"] },
746
+ approvalMode: { type: "string", enum: ["approval_by_default", "high_impact_only", "none"] },
747
+ description: { type: "string" },
748
+ lastUsedAt: nullable({ type: "string", format: "date-time" }),
749
+ revokedAt: nullable({ type: "string", format: "date-time" }),
750
+ createdAt: { type: "string", format: "date-time" },
751
+ updatedAt: { type: "string", format: "date-time" },
752
+ status: { type: "string", enum: ["active", "revoked"] }
753
+ }
754
+ };
755
+ const executionSettings = {
756
+ type: "object",
757
+ additionalProperties: false,
758
+ required: ["maxActiveTasks", "timeAccountingMode"],
759
+ properties: {
760
+ maxActiveTasks: { type: "integer", minimum: 1, maximum: 8 },
761
+ timeAccountingMode: { type: "string", enum: ["split", "parallel", "primary_only"] }
762
+ }
763
+ };
764
+ const taskRunClaimInput = {
765
+ type: "object",
766
+ additionalProperties: false,
767
+ required: ["actor"],
768
+ properties: {
769
+ actor: { type: "string" },
770
+ timerMode: { type: "string", enum: ["planned", "unlimited"], default: "unlimited" },
771
+ plannedDurationSeconds: nullable({ type: "integer", minimum: 60, maximum: 86400 }),
772
+ isCurrent: { type: "boolean", default: true },
773
+ leaseTtlSeconds: { type: "integer", minimum: 1, maximum: 14400, default: 900 },
774
+ note: { type: "string", default: "" }
775
+ }
776
+ };
777
+ const taskRunHeartbeatInput = {
778
+ type: "object",
779
+ additionalProperties: false,
780
+ properties: {
781
+ actor: { type: "string" },
782
+ leaseTtlSeconds: { type: "integer", minimum: 1, maximum: 14400, default: 900 },
783
+ note: { type: "string" }
784
+ }
785
+ };
786
+ const taskRunFinishInput = {
787
+ type: "object",
788
+ additionalProperties: false,
789
+ properties: {
790
+ actor: { type: "string" },
791
+ note: { type: "string", default: "" },
792
+ closeoutNote: {
793
+ type: "object",
794
+ additionalProperties: false,
795
+ required: ["contentMarkdown"],
796
+ properties: {
797
+ contentMarkdown: { type: "string" },
798
+ author: nullable({ type: "string" }),
799
+ links: arrayOf({ $ref: "#/components/schemas/NoteLink" })
800
+ }
801
+ }
802
+ }
803
+ };
804
+ const taskRunFocusInput = {
805
+ type: "object",
806
+ additionalProperties: false,
807
+ properties: {
808
+ actor: { type: "string" }
809
+ }
810
+ };
811
+ const settingsUpdateInput = {
812
+ type: "object",
813
+ additionalProperties: false,
814
+ properties: {
815
+ profile: {
816
+ type: "object",
817
+ additionalProperties: false,
818
+ properties: {
819
+ operatorName: { type: "string" },
820
+ operatorEmail: { type: "string" },
821
+ operatorTitle: { type: "string" }
822
+ }
823
+ },
824
+ notifications: {
825
+ type: "object",
826
+ additionalProperties: false,
827
+ properties: {
828
+ goalDriftAlerts: { type: "boolean" },
829
+ dailyQuestReminders: { type: "boolean" },
830
+ achievementCelebrations: { type: "boolean" }
831
+ }
832
+ },
833
+ execution: {
834
+ type: "object",
835
+ additionalProperties: false,
836
+ properties: {
837
+ maxActiveTasks: { type: "integer", minimum: 1, maximum: 8 },
838
+ timeAccountingMode: { type: "string", enum: ["split", "parallel", "primary_only"] }
839
+ }
840
+ },
841
+ themePreference: { type: "string", enum: ["obsidian", "solar", "system"] },
842
+ localePreference: { type: "string", enum: ["en", "fr"] }
843
+ }
844
+ };
845
+ const agentIdentity = {
846
+ type: "object",
847
+ additionalProperties: false,
848
+ required: ["id", "label", "agentType", "trustLevel", "autonomyMode", "approvalMode", "description", "tokenCount", "activeTokenCount", "createdAt", "updatedAt"],
849
+ properties: {
850
+ id: { type: "string" },
851
+ label: { type: "string" },
852
+ agentType: { type: "string" },
853
+ trustLevel: { type: "string", enum: ["standard", "trusted", "autonomous"] },
854
+ autonomyMode: { type: "string", enum: ["approval_required", "scoped_write", "autonomous"] },
855
+ approvalMode: { type: "string", enum: ["approval_by_default", "high_impact_only", "none"] },
856
+ description: { type: "string" },
857
+ tokenCount: { type: "integer" },
858
+ activeTokenCount: { type: "integer" },
859
+ createdAt: { type: "string", format: "date-time" },
860
+ updatedAt: { type: "string", format: "date-time" }
861
+ }
862
+ };
863
+ const insight = {
864
+ type: "object",
865
+ additionalProperties: false,
866
+ required: ["id", "originType", "originAgentId", "originLabel", "visibility", "status", "entityType", "entityId", "timeframeLabel", "title", "summary", "recommendation", "rationale", "confidence", "ctaLabel", "evidence", "createdAt", "updatedAt"],
867
+ properties: {
868
+ id: { type: "string" },
869
+ originType: { type: "string", enum: ["system", "user", "agent"] },
870
+ originAgentId: nullable({ type: "string" }),
871
+ originLabel: nullable({ type: "string" }),
872
+ visibility: { type: "string", enum: ["visible", "pending_review", "archived"] },
873
+ status: { type: "string", enum: ["open", "accepted", "dismissed", "snoozed", "applied", "expired"] },
874
+ entityType: nullable({ type: "string" }),
875
+ entityId: nullable({ type: "string" }),
876
+ timeframeLabel: nullable({ type: "string" }),
877
+ title: { type: "string" },
878
+ summary: { type: "string" },
879
+ recommendation: { type: "string" },
880
+ rationale: { type: "string" },
881
+ confidence: { type: "number" },
882
+ ctaLabel: { type: "string" },
883
+ evidence: arrayOf({
884
+ type: "object",
885
+ additionalProperties: false,
886
+ required: ["entityType", "entityId", "label"],
887
+ properties: {
888
+ entityType: { type: "string" },
889
+ entityId: { type: "string" },
890
+ label: { type: "string" }
891
+ }
892
+ }),
893
+ createdAt: { type: "string", format: "date-time" },
894
+ updatedAt: { type: "string", format: "date-time" }
895
+ }
896
+ };
897
+ const insightFeedback = {
898
+ type: "object",
899
+ additionalProperties: false,
900
+ required: ["id", "insightId", "actor", "feedbackType", "note", "createdAt"],
901
+ properties: {
902
+ id: { type: "string" },
903
+ insightId: { type: "string" },
904
+ actor: nullable({ type: "string" }),
905
+ feedbackType: { type: "string", enum: ["accepted", "dismissed", "applied", "snoozed"] },
906
+ note: { type: "string" },
907
+ createdAt: { type: "string", format: "date-time" }
908
+ }
909
+ };
910
+ const approvalRequest = {
911
+ type: "object",
912
+ additionalProperties: false,
913
+ required: ["id", "actionType", "status", "title", "summary", "entityType", "entityId", "requestedByAgentId", "requestedByTokenId", "requestedPayload", "approvedBy", "approvedAt", "rejectedBy", "rejectedAt", "resolutionNote", "createdAt", "updatedAt"],
914
+ properties: {
915
+ id: { type: "string" },
916
+ actionType: { type: "string" },
917
+ status: { type: "string", enum: ["pending", "approved", "rejected", "cancelled", "executed"] },
918
+ title: { type: "string" },
919
+ summary: { type: "string" },
920
+ entityType: nullable({ type: "string" }),
921
+ entityId: nullable({ type: "string" }),
922
+ requestedByAgentId: nullable({ type: "string" }),
923
+ requestedByTokenId: nullable({ type: "string" }),
924
+ requestedPayload: { type: "object", additionalProperties: true },
925
+ approvedBy: nullable({ type: "string" }),
926
+ approvedAt: nullable({ type: "string", format: "date-time" }),
927
+ rejectedBy: nullable({ type: "string" }),
928
+ rejectedAt: nullable({ type: "string", format: "date-time" }),
929
+ resolutionNote: { type: "string" },
930
+ createdAt: { type: "string", format: "date-time" },
931
+ updatedAt: { type: "string", format: "date-time" }
932
+ }
933
+ };
934
+ const agentAction = {
935
+ type: "object",
936
+ additionalProperties: false,
937
+ required: ["id", "agentId", "tokenId", "actionType", "riskLevel", "status", "title", "summary", "payload", "idempotencyKey", "approvalRequestId", "outcome", "createdAt", "updatedAt", "completedAt"],
938
+ properties: {
939
+ id: { type: "string" },
940
+ agentId: nullable({ type: "string" }),
941
+ tokenId: nullable({ type: "string" }),
942
+ actionType: { type: "string" },
943
+ riskLevel: { type: "string", enum: ["low", "medium", "high"] },
944
+ status: { type: "string", enum: ["pending_approval", "approved", "rejected", "executed"] },
945
+ title: { type: "string" },
946
+ summary: { type: "string" },
947
+ payload: { type: "object", additionalProperties: true },
948
+ idempotencyKey: nullable({ type: "string" }),
949
+ approvalRequestId: nullable({ type: "string" }),
950
+ outcome: { type: "object", additionalProperties: true },
951
+ createdAt: { type: "string", format: "date-time" },
952
+ updatedAt: { type: "string", format: "date-time" },
953
+ completedAt: nullable({ type: "string", format: "date-time" })
954
+ }
955
+ };
956
+ const rewardRule = {
957
+ type: "object",
958
+ additionalProperties: false,
959
+ required: ["id", "family", "code", "title", "description", "active", "config", "createdAt", "updatedAt"],
960
+ properties: {
961
+ id: { type: "string" },
962
+ family: { type: "string", enum: ["completion", "consistency", "alignment", "recovery", "collaboration", "ambient"] },
963
+ code: { type: "string" },
964
+ title: { type: "string" },
965
+ description: { type: "string" },
966
+ active: { type: "boolean" },
967
+ config: { type: "object", additionalProperties: true },
968
+ createdAt: { type: "string", format: "date-time" },
969
+ updatedAt: { type: "string", format: "date-time" }
970
+ }
971
+ };
972
+ const rewardLedgerEvent = {
973
+ type: "object",
974
+ additionalProperties: false,
975
+ required: ["id", "ruleId", "eventLogId", "entityType", "entityId", "actor", "source", "deltaXp", "reasonTitle", "reasonSummary", "reversibleGroup", "reversedByRewardId", "metadata", "createdAt"],
976
+ properties: {
977
+ id: { type: "string" },
978
+ ruleId: nullable({ type: "string" }),
979
+ eventLogId: nullable({ type: "string" }),
980
+ entityType: { type: "string" },
981
+ entityId: { type: "string" },
982
+ actor: nullable({ type: "string" }),
983
+ source: { type: "string", enum: ["ui", "openclaw", "agent", "system"] },
984
+ deltaXp: { type: "integer" },
985
+ reasonTitle: { type: "string" },
986
+ reasonSummary: { type: "string" },
987
+ reversibleGroup: nullable({ type: "string" }),
988
+ reversedByRewardId: nullable({ type: "string" }),
989
+ metadata: { type: "object", additionalProperties: true },
990
+ createdAt: { type: "string", format: "date-time" }
991
+ }
992
+ };
993
+ const eventLogEntry = {
994
+ type: "object",
995
+ additionalProperties: false,
996
+ required: ["id", "eventKind", "entityType", "entityId", "actor", "source", "causedByEventId", "metadata", "createdAt"],
997
+ properties: {
998
+ id: { type: "string" },
999
+ eventKind: { type: "string" },
1000
+ entityType: { type: "string" },
1001
+ entityId: { type: "string" },
1002
+ actor: nullable({ type: "string" }),
1003
+ source: { type: "string", enum: ["ui", "openclaw", "agent", "system"] },
1004
+ causedByEventId: nullable({ type: "string" }),
1005
+ metadata: { type: "object", additionalProperties: true },
1006
+ createdAt: { type: "string", format: "date-time" }
1007
+ }
1008
+ };
1009
+ const xpMomentumPulse = {
1010
+ type: "object",
1011
+ additionalProperties: false,
1012
+ required: ["status", "headline", "detail", "celebrationLabel", "nextMilestoneId", "nextMilestoneLabel"],
1013
+ properties: {
1014
+ status: { type: "string", enum: ["surging", "steady", "recovering"] },
1015
+ headline: { type: "string" },
1016
+ detail: { type: "string" },
1017
+ celebrationLabel: { type: "string" },
1018
+ nextMilestoneId: nullable({ type: "string" }),
1019
+ nextMilestoneLabel: { type: "string" }
1020
+ }
1021
+ };
1022
+ const xpMetricsPayload = {
1023
+ type: "object",
1024
+ additionalProperties: false,
1025
+ required: ["profile", "achievements", "milestoneRewards", "momentumPulse", "recentLedger", "rules", "dailyAmbientXp", "dailyAmbientCap"],
1026
+ properties: {
1027
+ profile: { $ref: "#/components/schemas/GamificationProfile" },
1028
+ achievements: arrayOf({ $ref: "#/components/schemas/AchievementSignal" }),
1029
+ milestoneRewards: arrayOf({ $ref: "#/components/schemas/MilestoneReward" }),
1030
+ momentumPulse: { $ref: "#/components/schemas/XpMomentumPulse" },
1031
+ recentLedger: arrayOf({ $ref: "#/components/schemas/RewardLedgerEvent" }),
1032
+ rules: arrayOf({ $ref: "#/components/schemas/RewardRule" }),
1033
+ dailyAmbientXp: { type: "integer" },
1034
+ dailyAmbientCap: { type: "integer" }
1035
+ }
1036
+ };
1037
+ const operatorContextPayload = {
1038
+ type: "object",
1039
+ additionalProperties: false,
1040
+ required: [
1041
+ "generatedAt",
1042
+ "activeProjects",
1043
+ "focusTasks",
1044
+ "currentBoard",
1045
+ "recentActivity",
1046
+ "recentTaskRuns",
1047
+ "recommendedNextTask",
1048
+ "xp"
1049
+ ],
1050
+ properties: {
1051
+ generatedAt: { type: "string", format: "date-time" },
1052
+ activeProjects: arrayOf({ $ref: "#/components/schemas/ProjectSummary" }),
1053
+ focusTasks: arrayOf({ $ref: "#/components/schemas/Task" }),
1054
+ currentBoard: {
1055
+ type: "object",
1056
+ additionalProperties: false,
1057
+ required: ["backlog", "focus", "inProgress", "blocked", "done"],
1058
+ properties: {
1059
+ backlog: arrayOf({ $ref: "#/components/schemas/Task" }),
1060
+ focus: arrayOf({ $ref: "#/components/schemas/Task" }),
1061
+ inProgress: arrayOf({ $ref: "#/components/schemas/Task" }),
1062
+ blocked: arrayOf({ $ref: "#/components/schemas/Task" }),
1063
+ done: arrayOf({ $ref: "#/components/schemas/Task" })
1064
+ }
1065
+ },
1066
+ recentActivity: arrayOf({ $ref: "#/components/schemas/ActivityEvent" }),
1067
+ recentTaskRuns: arrayOf({ $ref: "#/components/schemas/TaskRun" }),
1068
+ recommendedNextTask: nullable({ $ref: "#/components/schemas/Task" }),
1069
+ xp: { $ref: "#/components/schemas/XpMetricsPayload" }
1070
+ }
1071
+ };
1072
+ const operatorOverviewPayload = {
1073
+ type: "object",
1074
+ additionalProperties: false,
1075
+ required: [
1076
+ "generatedAt",
1077
+ "snapshot",
1078
+ "operator",
1079
+ "domains",
1080
+ "psyche",
1081
+ "onboarding",
1082
+ "capabilities",
1083
+ "warnings",
1084
+ "routeGuide"
1085
+ ],
1086
+ properties: {
1087
+ generatedAt: { type: "string", format: "date-time" },
1088
+ snapshot: { $ref: "#/components/schemas/ForgeSnapshot" },
1089
+ operator: { $ref: "#/components/schemas/OperatorContextPayload" },
1090
+ domains: arrayOf({ $ref: "#/components/schemas/Domain" }),
1091
+ psyche: nullable({ $ref: "#/components/schemas/PsycheOverviewPayload" }),
1092
+ onboarding: { $ref: "#/components/schemas/AgentOnboardingPayload" },
1093
+ capabilities: {
1094
+ type: "object",
1095
+ additionalProperties: false,
1096
+ required: ["tokenPresent", "scopes", "canReadPsyche", "canWritePsyche", "canManageModes", "canManageRewards"],
1097
+ properties: {
1098
+ tokenPresent: { type: "boolean" },
1099
+ scopes: arrayOf({ type: "string" }),
1100
+ canReadPsyche: { type: "boolean" },
1101
+ canWritePsyche: { type: "boolean" },
1102
+ canManageModes: { type: "boolean" },
1103
+ canManageRewards: { type: "boolean" }
1104
+ }
1105
+ },
1106
+ warnings: arrayOf({ type: "string" }),
1107
+ routeGuide: {
1108
+ type: "object",
1109
+ additionalProperties: false,
1110
+ required: ["preferredStart", "mainRoutes"],
1111
+ properties: {
1112
+ preferredStart: { type: "string" },
1113
+ mainRoutes: arrayOf({
1114
+ type: "object",
1115
+ additionalProperties: false,
1116
+ required: ["id", "path", "summary", "requiredScope"],
1117
+ properties: {
1118
+ id: { type: "string" },
1119
+ path: { type: "string" },
1120
+ summary: { type: "string" },
1121
+ requiredScope: nullable({ type: "string" })
1122
+ }
1123
+ })
1124
+ }
1125
+ }
1126
+ }
1127
+ };
1128
+ const settingsPayload = {
1129
+ type: "object",
1130
+ additionalProperties: false,
1131
+ required: ["profile", "notifications", "execution", "themePreference", "localePreference", "security", "agents", "agentTokens"],
1132
+ properties: {
1133
+ profile: {
1134
+ type: "object",
1135
+ additionalProperties: false,
1136
+ required: ["operatorName", "operatorEmail", "operatorTitle"],
1137
+ properties: {
1138
+ operatorName: { type: "string" },
1139
+ operatorEmail: { type: "string" },
1140
+ operatorTitle: { type: "string" }
1141
+ }
1142
+ },
1143
+ notifications: {
1144
+ type: "object",
1145
+ additionalProperties: false,
1146
+ required: ["goalDriftAlerts", "dailyQuestReminders", "achievementCelebrations"],
1147
+ properties: {
1148
+ goalDriftAlerts: { type: "boolean" },
1149
+ dailyQuestReminders: { type: "boolean" },
1150
+ achievementCelebrations: { type: "boolean" }
1151
+ }
1152
+ },
1153
+ execution: { $ref: "#/components/schemas/ExecutionSettings" },
1154
+ themePreference: { type: "string", enum: ["obsidian", "solar", "system"] },
1155
+ localePreference: { type: "string", enum: ["en", "fr"] },
1156
+ security: {
1157
+ type: "object",
1158
+ additionalProperties: false,
1159
+ required: ["integrityScore", "lastAuditAt", "storageMode", "activeSessions", "tokenCount"],
1160
+ properties: {
1161
+ integrityScore: { type: "integer" },
1162
+ lastAuditAt: { type: "string", format: "date-time" },
1163
+ storageMode: { type: "string", const: "local-first" },
1164
+ activeSessions: { type: "integer" },
1165
+ tokenCount: { type: "integer" }
1166
+ }
1167
+ },
1168
+ agents: arrayOf({ $ref: "#/components/schemas/AgentIdentity" }),
1169
+ agentTokens: arrayOf({ $ref: "#/components/schemas/AgentTokenSummary" })
1170
+ }
1171
+ };
1172
+ const agentOnboardingPayload = {
1173
+ type: "object",
1174
+ additionalProperties: false,
1175
+ required: [
1176
+ "forgeBaseUrl",
1177
+ "webAppUrl",
1178
+ "apiBaseUrl",
1179
+ "openApiUrl",
1180
+ "healthUrl",
1181
+ "settingsUrl",
1182
+ "tokenCreateUrl",
1183
+ "pluginBasePath",
1184
+ "defaultConnectionMode",
1185
+ "defaultActorLabel",
1186
+ "defaultTimeoutMs",
1187
+ "recommendedScopes",
1188
+ "recommendedTrustLevel",
1189
+ "recommendedAutonomyMode",
1190
+ "recommendedApprovalMode",
1191
+ "authModes",
1192
+ "tokenRecovery",
1193
+ "requiredHeaders",
1194
+ "conceptModel",
1195
+ "psycheSubmoduleModel",
1196
+ "psycheCoachingPlaybooks",
1197
+ "relationshipModel",
1198
+ "entityCatalog",
1199
+ "toolInputCatalog",
1200
+ "verificationPaths",
1201
+ "recommendedPluginTools",
1202
+ "interactionGuidance",
1203
+ "mutationGuidance"
1204
+ ],
1205
+ properties: {
1206
+ forgeBaseUrl: { type: "string" },
1207
+ webAppUrl: { type: "string" },
1208
+ apiBaseUrl: { type: "string" },
1209
+ openApiUrl: { type: "string" },
1210
+ healthUrl: { type: "string" },
1211
+ settingsUrl: { type: "string" },
1212
+ tokenCreateUrl: { type: "string" },
1213
+ pluginBasePath: { type: "string" },
1214
+ defaultConnectionMode: { type: "string", enum: ["operator_session", "managed_token"] },
1215
+ defaultActorLabel: { type: "string" },
1216
+ defaultTimeoutMs: { type: "integer" },
1217
+ recommendedScopes: arrayOf({ type: "string" }),
1218
+ recommendedTrustLevel: { type: "string", enum: ["standard", "trusted", "autonomous"] },
1219
+ recommendedAutonomyMode: { type: "string", enum: ["approval_required", "scoped_write", "autonomous"] },
1220
+ recommendedApprovalMode: { type: "string", enum: ["approval_by_default", "high_impact_only", "none"] },
1221
+ authModes: {
1222
+ type: "object",
1223
+ additionalProperties: false,
1224
+ required: ["operatorSession", "managedToken"],
1225
+ properties: {
1226
+ operatorSession: {
1227
+ type: "object",
1228
+ additionalProperties: false,
1229
+ required: ["label", "summary", "tokenRequired", "trustedTargets"],
1230
+ properties: {
1231
+ label: { type: "string" },
1232
+ summary: { type: "string" },
1233
+ tokenRequired: { type: "boolean" },
1234
+ trustedTargets: arrayOf({ type: "string" })
1235
+ }
1236
+ },
1237
+ managedToken: {
1238
+ type: "object",
1239
+ additionalProperties: false,
1240
+ required: ["label", "summary", "tokenRequired"],
1241
+ properties: {
1242
+ label: { type: "string" },
1243
+ summary: { type: "string" },
1244
+ tokenRequired: { type: "boolean" }
1245
+ }
1246
+ }
1247
+ }
1248
+ },
1249
+ tokenRecovery: {
1250
+ type: "object",
1251
+ additionalProperties: false,
1252
+ required: ["rawTokenStoredByForge", "recoveryAction", "rotationSummary", "settingsSummary"],
1253
+ properties: {
1254
+ rawTokenStoredByForge: { type: "boolean" },
1255
+ recoveryAction: { type: "string" },
1256
+ rotationSummary: { type: "string" },
1257
+ settingsSummary: { type: "string" }
1258
+ }
1259
+ },
1260
+ requiredHeaders: {
1261
+ type: "object",
1262
+ additionalProperties: false,
1263
+ required: ["authorization", "source", "actor"],
1264
+ properties: {
1265
+ authorization: { type: "string" },
1266
+ source: { type: "string" },
1267
+ actor: { type: "string" }
1268
+ }
1269
+ },
1270
+ conceptModel: {
1271
+ type: "object",
1272
+ additionalProperties: false,
1273
+ required: ["goal", "project", "task", "taskRun", "note", "insight", "psyche"],
1274
+ properties: {
1275
+ goal: { type: "string" },
1276
+ project: { type: "string" },
1277
+ task: { type: "string" },
1278
+ taskRun: { type: "string" },
1279
+ note: { type: "string" },
1280
+ insight: { type: "string" },
1281
+ psyche: { type: "string" }
1282
+ }
1283
+ },
1284
+ psycheSubmoduleModel: {
1285
+ type: "object",
1286
+ additionalProperties: false,
1287
+ required: [
1288
+ "value",
1289
+ "behaviorPattern",
1290
+ "behavior",
1291
+ "beliefEntry",
1292
+ "schemaCatalog",
1293
+ "modeProfile",
1294
+ "modeGuideSession",
1295
+ "eventType",
1296
+ "emotionDefinition",
1297
+ "triggerReport"
1298
+ ],
1299
+ properties: {
1300
+ value: { type: "string" },
1301
+ behaviorPattern: { type: "string" },
1302
+ behavior: { type: "string" },
1303
+ beliefEntry: { type: "string" },
1304
+ schemaCatalog: { type: "string" },
1305
+ modeProfile: { type: "string" },
1306
+ modeGuideSession: { type: "string" },
1307
+ eventType: { type: "string" },
1308
+ emotionDefinition: { type: "string" },
1309
+ triggerReport: { type: "string" }
1310
+ }
1311
+ },
1312
+ psycheCoachingPlaybooks: arrayOf({
1313
+ type: "object",
1314
+ additionalProperties: false,
1315
+ required: [
1316
+ "focus",
1317
+ "useWhen",
1318
+ "coachingGoal",
1319
+ "askSequence",
1320
+ "requiredForCreate",
1321
+ "highValueOptionalFields",
1322
+ "exampleQuestions",
1323
+ "notes"
1324
+ ],
1325
+ properties: {
1326
+ focus: { type: "string" },
1327
+ useWhen: { type: "string" },
1328
+ coachingGoal: { type: "string" },
1329
+ askSequence: arrayOf({ type: "string" }),
1330
+ requiredForCreate: arrayOf({ type: "string" }),
1331
+ highValueOptionalFields: arrayOf({ type: "string" }),
1332
+ exampleQuestions: arrayOf({ type: "string" }),
1333
+ notes: arrayOf({ type: "string" })
1334
+ }
1335
+ }),
1336
+ relationshipModel: arrayOf({ type: "string" }),
1337
+ entityCatalog: arrayOf({
1338
+ type: "object",
1339
+ additionalProperties: false,
1340
+ required: ["entityType", "purpose", "minimumCreateFields", "relationshipRules", "searchHints", "fieldGuide"],
1341
+ properties: {
1342
+ entityType: { type: "string" },
1343
+ purpose: { type: "string" },
1344
+ minimumCreateFields: arrayOf({ type: "string" }),
1345
+ relationshipRules: arrayOf({ type: "string" }),
1346
+ searchHints: arrayOf({ type: "string" }),
1347
+ fieldGuide: arrayOf({
1348
+ type: "object",
1349
+ additionalProperties: false,
1350
+ required: ["name", "type", "required", "description"],
1351
+ properties: {
1352
+ name: { type: "string" },
1353
+ type: { type: "string" },
1354
+ required: { type: "boolean" },
1355
+ description: { type: "string" },
1356
+ enumValues: arrayOf({ type: "string" }),
1357
+ defaultValue: { oneOf: [{ type: "string" }, { type: "number" }, { type: "boolean" }, { type: "null" }] },
1358
+ nullable: { type: "boolean" }
1359
+ }
1360
+ })
1361
+ }
1362
+ }),
1363
+ toolInputCatalog: arrayOf({
1364
+ type: "object",
1365
+ additionalProperties: false,
1366
+ required: ["toolName", "summary", "whenToUse", "inputShape", "requiredFields", "notes", "example"],
1367
+ properties: {
1368
+ toolName: { type: "string" },
1369
+ summary: { type: "string" },
1370
+ whenToUse: { type: "string" },
1371
+ inputShape: { type: "string" },
1372
+ requiredFields: arrayOf({ type: "string" }),
1373
+ notes: arrayOf({ type: "string" }),
1374
+ example: { type: "string" }
1375
+ }
1376
+ }),
1377
+ verificationPaths: {
1378
+ type: "object",
1379
+ additionalProperties: false,
1380
+ required: ["context", "xpMetrics", "weeklyReview", "settingsBin", "batchSearch", "psycheSchemaCatalog", "psycheEventTypes", "psycheEmotions"],
1381
+ properties: {
1382
+ context: { type: "string" },
1383
+ xpMetrics: { type: "string" },
1384
+ weeklyReview: { type: "string" },
1385
+ settingsBin: { type: "string" },
1386
+ batchSearch: { type: "string" },
1387
+ psycheSchemaCatalog: { type: "string" },
1388
+ psycheEventTypes: { type: "string" },
1389
+ psycheEmotions: { type: "string" }
1390
+ }
1391
+ },
1392
+ recommendedPluginTools: {
1393
+ type: "object",
1394
+ additionalProperties: false,
1395
+ required: ["bootstrap", "readModels", "uiWorkflow", "entityWorkflow", "workWorkflow", "insightWorkflow"],
1396
+ properties: {
1397
+ bootstrap: arrayOf({ type: "string" }),
1398
+ readModels: arrayOf({ type: "string" }),
1399
+ uiWorkflow: arrayOf({ type: "string" }),
1400
+ entityWorkflow: arrayOf({ type: "string" }),
1401
+ workWorkflow: arrayOf({ type: "string" }),
1402
+ insightWorkflow: arrayOf({ type: "string" })
1403
+ }
1404
+ },
1405
+ interactionGuidance: {
1406
+ type: "object",
1407
+ additionalProperties: false,
1408
+ required: [
1409
+ "conversationMode",
1410
+ "saveSuggestionPlacement",
1411
+ "saveSuggestionTone",
1412
+ "maxQuestionsPerTurn",
1413
+ "duplicateCheckRoute",
1414
+ "uiSuggestionRule",
1415
+ "browserFallbackRule",
1416
+ "writeConsentRule"
1417
+ ],
1418
+ properties: {
1419
+ conversationMode: { type: "string" },
1420
+ saveSuggestionPlacement: { type: "string" },
1421
+ saveSuggestionTone: { type: "string" },
1422
+ maxQuestionsPerTurn: { type: "integer" },
1423
+ duplicateCheckRoute: { type: "string" },
1424
+ uiSuggestionRule: { type: "string" },
1425
+ browserFallbackRule: { type: "string" },
1426
+ writeConsentRule: { type: "string" }
1427
+ }
1428
+ },
1429
+ mutationGuidance: {
1430
+ type: "object",
1431
+ additionalProperties: false,
1432
+ required: [
1433
+ "preferredBatchRoutes",
1434
+ "deleteDefault",
1435
+ "hardDeleteRequiresExplicitMode",
1436
+ "restoreSummary",
1437
+ "entityDeleteSummary",
1438
+ "batchingRule",
1439
+ "searchRule",
1440
+ "createRule",
1441
+ "updateRule",
1442
+ "createExample",
1443
+ "updateExample"
1444
+ ],
1445
+ properties: {
1446
+ preferredBatchRoutes: {
1447
+ type: "object",
1448
+ additionalProperties: false,
1449
+ required: ["create", "update", "delete", "restore", "search"],
1450
+ properties: {
1451
+ create: { type: "string" },
1452
+ update: { type: "string" },
1453
+ delete: { type: "string" },
1454
+ restore: { type: "string" },
1455
+ search: { type: "string" }
1456
+ }
1457
+ },
1458
+ deleteDefault: { type: "string", enum: ["soft", "hard"] },
1459
+ hardDeleteRequiresExplicitMode: { type: "boolean" },
1460
+ restoreSummary: { type: "string" },
1461
+ entityDeleteSummary: { type: "string" },
1462
+ batchingRule: { type: "string" },
1463
+ searchRule: { type: "string" },
1464
+ createRule: { type: "string" },
1465
+ updateRule: { type: "string" },
1466
+ createExample: { type: "string" },
1467
+ updateExample: { type: "string" }
1468
+ }
1469
+ }
1470
+ }
1471
+ };
1472
+ const deletedEntityRecord = {
1473
+ type: "object",
1474
+ additionalProperties: false,
1475
+ required: ["entityType", "entityId", "title", "deletedAt", "snapshot"],
1476
+ properties: {
1477
+ entityType: { type: "string" },
1478
+ entityId: { type: "string" },
1479
+ title: { type: "string" },
1480
+ subtitle: { type: ["string", "null"] },
1481
+ deletedAt: { type: "string", format: "date-time" },
1482
+ deletedByActor: { type: ["string", "null"] },
1483
+ deletedSource: { type: ["string", "null"] },
1484
+ deleteReason: { type: ["string", "null"] },
1485
+ snapshot: { type: "object", additionalProperties: true }
1486
+ }
1487
+ };
1488
+ const settingsBinPayload = {
1489
+ type: "object",
1490
+ additionalProperties: false,
1491
+ required: ["generatedAt", "totalCount", "countsByEntityType", "records"],
1492
+ properties: {
1493
+ generatedAt: { type: "string", format: "date-time" },
1494
+ totalCount: { type: "integer" },
1495
+ countsByEntityType: { type: "object", additionalProperties: { type: "integer" } },
1496
+ records: arrayOf({ $ref: "#/components/schemas/DeletedEntityRecord" })
1497
+ }
1498
+ };
1499
+ const batchEntityResult = {
1500
+ type: "object",
1501
+ additionalProperties: true,
1502
+ required: ["ok", "entityType"],
1503
+ properties: {
1504
+ ok: { type: "boolean" },
1505
+ entityType: { type: "string" },
1506
+ id: { type: "string" },
1507
+ clientRef: { type: "string" },
1508
+ entity: { type: "object", additionalProperties: true },
1509
+ matches: arrayOf({ type: "object", additionalProperties: true }),
1510
+ deletedRecord: { $ref: "#/components/schemas/DeletedEntityRecord" },
1511
+ error: {
1512
+ type: "object",
1513
+ additionalProperties: false,
1514
+ properties: {
1515
+ code: { type: "string" },
1516
+ message: { type: "string" }
1517
+ }
1518
+ }
1519
+ }
1520
+ };
1521
+ const agentTokenMutationResult = {
1522
+ type: "object",
1523
+ additionalProperties: false,
1524
+ required: ["token", "tokenSummary"],
1525
+ properties: {
1526
+ token: { type: "string" },
1527
+ tokenSummary: { $ref: "#/components/schemas/AgentTokenSummary" }
1528
+ }
1529
+ };
1530
+ const domain = {
1531
+ type: "object",
1532
+ additionalProperties: false,
1533
+ required: ["id", "slug", "title", "description", "themeColor", "sensitive", "createdAt", "updatedAt"],
1534
+ properties: {
1535
+ id: { type: "string" },
1536
+ slug: { type: "string" },
1537
+ title: { type: "string" },
1538
+ description: { type: "string" },
1539
+ themeColor: { type: "string" },
1540
+ sensitive: { type: "boolean" },
1541
+ createdAt: { type: "string", format: "date-time" },
1542
+ updatedAt: { type: "string", format: "date-time" }
1543
+ }
1544
+ };
1545
+ const psycheValue = {
1546
+ type: "object",
1547
+ additionalProperties: false,
1548
+ required: [
1549
+ "id",
1550
+ "domainId",
1551
+ "title",
1552
+ "description",
1553
+ "valuedDirection",
1554
+ "whyItMatters",
1555
+ "linkedGoalIds",
1556
+ "linkedProjectIds",
1557
+ "linkedTaskIds",
1558
+ "committedActions",
1559
+ "createdAt",
1560
+ "updatedAt"
1561
+ ],
1562
+ properties: {
1563
+ id: { type: "string" },
1564
+ domainId: { type: "string" },
1565
+ title: { type: "string" },
1566
+ description: { type: "string" },
1567
+ valuedDirection: { type: "string" },
1568
+ whyItMatters: { type: "string" },
1569
+ linkedGoalIds: arrayOf({ type: "string" }),
1570
+ linkedProjectIds: arrayOf({ type: "string" }),
1571
+ linkedTaskIds: arrayOf({ type: "string" }),
1572
+ committedActions: arrayOf({ type: "string" }),
1573
+ createdAt: { type: "string", format: "date-time" },
1574
+ updatedAt: { type: "string", format: "date-time" }
1575
+ }
1576
+ };
1577
+ const behaviorPattern = {
1578
+ type: "object",
1579
+ additionalProperties: false,
1580
+ required: [
1581
+ "id",
1582
+ "domainId",
1583
+ "title",
1584
+ "description",
1585
+ "targetBehavior",
1586
+ "cueContexts",
1587
+ "shortTermPayoff",
1588
+ "longTermCost",
1589
+ "preferredResponse",
1590
+ "linkedValueIds",
1591
+ "linkedSchemaLabels",
1592
+ "linkedModeLabels",
1593
+ "createdAt",
1594
+ "updatedAt"
1595
+ ],
1596
+ properties: {
1597
+ id: { type: "string" },
1598
+ domainId: { type: "string" },
1599
+ title: { type: "string" },
1600
+ description: { type: "string" },
1601
+ targetBehavior: { type: "string" },
1602
+ cueContexts: arrayOf({ type: "string" }),
1603
+ shortTermPayoff: { type: "string" },
1604
+ longTermCost: { type: "string" },
1605
+ preferredResponse: { type: "string" },
1606
+ linkedValueIds: arrayOf({ type: "string" }),
1607
+ linkedSchemaLabels: arrayOf({ type: "string" }),
1608
+ linkedModeLabels: arrayOf({ type: "string" }),
1609
+ createdAt: { type: "string", format: "date-time" },
1610
+ updatedAt: { type: "string", format: "date-time" }
1611
+ }
1612
+ };
1613
+ const schemaCatalogEntry = {
1614
+ type: "object",
1615
+ additionalProperties: false,
1616
+ required: ["id", "slug", "title", "family", "schemaType", "description", "createdAt", "updatedAt"],
1617
+ properties: {
1618
+ id: { type: "string" },
1619
+ slug: { type: "string" },
1620
+ title: { type: "string" },
1621
+ family: { type: "string" },
1622
+ schemaType: { type: "string", enum: ["maladaptive", "adaptive"] },
1623
+ description: { type: "string" },
1624
+ createdAt: { type: "string", format: "date-time" },
1625
+ updatedAt: { type: "string", format: "date-time" }
1626
+ }
1627
+ };
1628
+ const eventType = {
1629
+ type: "object",
1630
+ additionalProperties: false,
1631
+ required: ["id", "domainId", "label", "description", "system", "createdAt", "updatedAt"],
1632
+ properties: {
1633
+ id: { type: "string" },
1634
+ domainId: { type: "string" },
1635
+ label: { type: "string" },
1636
+ description: { type: "string" },
1637
+ system: { type: "boolean" },
1638
+ createdAt: { type: "string", format: "date-time" },
1639
+ updatedAt: { type: "string", format: "date-time" }
1640
+ }
1641
+ };
1642
+ const emotionDefinition = {
1643
+ type: "object",
1644
+ additionalProperties: false,
1645
+ required: ["id", "domainId", "label", "description", "category", "system", "createdAt", "updatedAt"],
1646
+ properties: {
1647
+ id: { type: "string" },
1648
+ domainId: { type: "string" },
1649
+ label: { type: "string" },
1650
+ description: { type: "string" },
1651
+ category: { type: "string" },
1652
+ system: { type: "boolean" },
1653
+ createdAt: { type: "string", format: "date-time" },
1654
+ updatedAt: { type: "string", format: "date-time" }
1655
+ }
1656
+ };
1657
+ const behavior = {
1658
+ type: "object",
1659
+ additionalProperties: false,
1660
+ required: [
1661
+ "id",
1662
+ "domainId",
1663
+ "kind",
1664
+ "title",
1665
+ "description",
1666
+ "commonCues",
1667
+ "urgeStory",
1668
+ "shortTermPayoff",
1669
+ "longTermCost",
1670
+ "replacementMove",
1671
+ "repairPlan",
1672
+ "linkedPatternIds",
1673
+ "linkedValueIds",
1674
+ "linkedSchemaIds",
1675
+ "linkedModeIds",
1676
+ "createdAt",
1677
+ "updatedAt"
1678
+ ],
1679
+ properties: {
1680
+ id: { type: "string" },
1681
+ domainId: { type: "string" },
1682
+ kind: { type: "string", enum: ["away", "committed", "recovery"] },
1683
+ title: { type: "string" },
1684
+ description: { type: "string" },
1685
+ commonCues: arrayOf({ type: "string" }),
1686
+ urgeStory: { type: "string" },
1687
+ shortTermPayoff: { type: "string" },
1688
+ longTermCost: { type: "string" },
1689
+ replacementMove: { type: "string" },
1690
+ repairPlan: { type: "string" },
1691
+ linkedPatternIds: arrayOf({ type: "string" }),
1692
+ linkedValueIds: arrayOf({ type: "string" }),
1693
+ linkedSchemaIds: arrayOf({ type: "string" }),
1694
+ linkedModeIds: arrayOf({ type: "string" }),
1695
+ createdAt: { type: "string", format: "date-time" },
1696
+ updatedAt: { type: "string", format: "date-time" }
1697
+ }
1698
+ };
1699
+ const beliefEntry = {
1700
+ type: "object",
1701
+ additionalProperties: false,
1702
+ required: [
1703
+ "id",
1704
+ "domainId",
1705
+ "schemaId",
1706
+ "statement",
1707
+ "beliefType",
1708
+ "originNote",
1709
+ "confidence",
1710
+ "evidenceFor",
1711
+ "evidenceAgainst",
1712
+ "flexibleAlternative",
1713
+ "linkedValueIds",
1714
+ "linkedBehaviorIds",
1715
+ "linkedModeIds",
1716
+ "linkedReportIds",
1717
+ "createdAt",
1718
+ "updatedAt"
1719
+ ],
1720
+ properties: {
1721
+ id: { type: "string" },
1722
+ domainId: { type: "string" },
1723
+ schemaId: nullable({ type: "string" }),
1724
+ statement: { type: "string" },
1725
+ beliefType: { type: "string", enum: ["absolute", "conditional"] },
1726
+ originNote: { type: "string" },
1727
+ confidence: { type: "integer" },
1728
+ evidenceFor: arrayOf({ type: "string" }),
1729
+ evidenceAgainst: arrayOf({ type: "string" }),
1730
+ flexibleAlternative: { type: "string" },
1731
+ linkedValueIds: arrayOf({ type: "string" }),
1732
+ linkedBehaviorIds: arrayOf({ type: "string" }),
1733
+ linkedModeIds: arrayOf({ type: "string" }),
1734
+ linkedReportIds: arrayOf({ type: "string" }),
1735
+ createdAt: { type: "string", format: "date-time" },
1736
+ updatedAt: { type: "string", format: "date-time" }
1737
+ }
1738
+ };
1739
+ const modeProfile = {
1740
+ type: "object",
1741
+ additionalProperties: false,
1742
+ required: [
1743
+ "id",
1744
+ "domainId",
1745
+ "family",
1746
+ "archetype",
1747
+ "title",
1748
+ "persona",
1749
+ "imagery",
1750
+ "symbolicForm",
1751
+ "facialExpression",
1752
+ "fear",
1753
+ "burden",
1754
+ "protectiveJob",
1755
+ "originContext",
1756
+ "firstAppearanceAt",
1757
+ "linkedPatternIds",
1758
+ "linkedBehaviorIds",
1759
+ "linkedValueIds",
1760
+ "createdAt",
1761
+ "updatedAt"
1762
+ ],
1763
+ properties: {
1764
+ id: { type: "string" },
1765
+ domainId: { type: "string" },
1766
+ family: { type: "string", enum: ["coping", "child", "critic_parent", "healthy_adult", "happy_child"] },
1767
+ archetype: { type: "string" },
1768
+ title: { type: "string" },
1769
+ persona: { type: "string" },
1770
+ imagery: { type: "string" },
1771
+ symbolicForm: { type: "string" },
1772
+ facialExpression: { type: "string" },
1773
+ fear: { type: "string" },
1774
+ burden: { type: "string" },
1775
+ protectiveJob: { type: "string" },
1776
+ originContext: { type: "string" },
1777
+ firstAppearanceAt: nullable({ type: "string", format: "date-time" }),
1778
+ linkedPatternIds: arrayOf({ type: "string" }),
1779
+ linkedBehaviorIds: arrayOf({ type: "string" }),
1780
+ linkedValueIds: arrayOf({ type: "string" }),
1781
+ createdAt: { type: "string", format: "date-time" },
1782
+ updatedAt: { type: "string", format: "date-time" }
1783
+ }
1784
+ };
1785
+ const modeGuideSession = {
1786
+ type: "object",
1787
+ additionalProperties: false,
1788
+ required: ["id", "summary", "answers", "results", "createdAt", "updatedAt"],
1789
+ properties: {
1790
+ id: { type: "string" },
1791
+ summary: { type: "string" },
1792
+ answers: arrayOf({
1793
+ type: "object",
1794
+ additionalProperties: false,
1795
+ required: ["questionKey", "value"],
1796
+ properties: {
1797
+ questionKey: { type: "string" },
1798
+ value: { type: "string" }
1799
+ }
1800
+ }),
1801
+ results: arrayOf({
1802
+ type: "object",
1803
+ additionalProperties: false,
1804
+ required: ["family", "archetype", "label", "confidence", "reasoning"],
1805
+ properties: {
1806
+ family: { type: "string", enum: ["coping", "child", "critic_parent", "healthy_adult", "happy_child"] },
1807
+ archetype: { type: "string" },
1808
+ label: { type: "string" },
1809
+ confidence: { type: "number" },
1810
+ reasoning: { type: "string" }
1811
+ }
1812
+ }),
1813
+ createdAt: { type: "string", format: "date-time" },
1814
+ updatedAt: { type: "string", format: "date-time" }
1815
+ }
1816
+ };
1817
+ const triggerReport = {
1818
+ type: "object",
1819
+ additionalProperties: false,
1820
+ required: [
1821
+ "id",
1822
+ "domainId",
1823
+ "title",
1824
+ "status",
1825
+ "eventTypeId",
1826
+ "customEventType",
1827
+ "eventSituation",
1828
+ "occurredAt",
1829
+ "emotions",
1830
+ "thoughts",
1831
+ "behaviors",
1832
+ "consequences",
1833
+ "linkedPatternIds",
1834
+ "linkedValueIds",
1835
+ "linkedGoalIds",
1836
+ "linkedProjectIds",
1837
+ "linkedTaskIds",
1838
+ "linkedBehaviorIds",
1839
+ "linkedBeliefIds",
1840
+ "linkedModeIds",
1841
+ "modeOverlays",
1842
+ "schemaLinks",
1843
+ "modeTimeline",
1844
+ "nextMoves",
1845
+ "createdAt",
1846
+ "updatedAt"
1847
+ ],
1848
+ properties: {
1849
+ id: { type: "string" },
1850
+ domainId: { type: "string" },
1851
+ title: { type: "string" },
1852
+ status: { type: "string", enum: ["draft", "reviewed", "integrated"] },
1853
+ eventTypeId: nullable({ type: "string" }),
1854
+ customEventType: { type: "string" },
1855
+ eventSituation: { type: "string" },
1856
+ occurredAt: nullable({ type: "string", format: "date-time" }),
1857
+ emotions: arrayOf({
1858
+ type: "object",
1859
+ additionalProperties: false,
1860
+ required: ["id", "emotionDefinitionId", "label", "intensity", "note"],
1861
+ properties: {
1862
+ id: { type: "string" },
1863
+ emotionDefinitionId: nullable({ type: "string" }),
1864
+ label: { type: "string" },
1865
+ intensity: { type: "integer" },
1866
+ note: { type: "string" }
1867
+ }
1868
+ }),
1869
+ thoughts: arrayOf({
1870
+ type: "object",
1871
+ additionalProperties: false,
1872
+ required: ["id", "text", "parentMode", "criticMode", "beliefId"],
1873
+ properties: {
1874
+ id: { type: "string" },
1875
+ text: { type: "string" },
1876
+ parentMode: { type: "string" },
1877
+ criticMode: { type: "string" },
1878
+ beliefId: nullable({ type: "string" })
1879
+ }
1880
+ }),
1881
+ behaviors: arrayOf({
1882
+ type: "object",
1883
+ additionalProperties: false,
1884
+ required: ["id", "text", "mode", "behaviorId"],
1885
+ properties: {
1886
+ id: { type: "string" },
1887
+ text: { type: "string" },
1888
+ mode: { type: "string" },
1889
+ behaviorId: nullable({ type: "string" })
1890
+ }
1891
+ }),
1892
+ consequences: {
1893
+ type: "object",
1894
+ additionalProperties: false,
1895
+ required: ["selfShortTerm", "selfLongTerm", "othersShortTerm", "othersLongTerm"],
1896
+ properties: {
1897
+ selfShortTerm: arrayOf({ type: "string" }),
1898
+ selfLongTerm: arrayOf({ type: "string" }),
1899
+ othersShortTerm: arrayOf({ type: "string" }),
1900
+ othersLongTerm: arrayOf({ type: "string" })
1901
+ }
1902
+ },
1903
+ linkedPatternIds: arrayOf({ type: "string" }),
1904
+ linkedValueIds: arrayOf({ type: "string" }),
1905
+ linkedGoalIds: arrayOf({ type: "string" }),
1906
+ linkedProjectIds: arrayOf({ type: "string" }),
1907
+ linkedTaskIds: arrayOf({ type: "string" }),
1908
+ linkedBehaviorIds: arrayOf({ type: "string" }),
1909
+ linkedBeliefIds: arrayOf({ type: "string" }),
1910
+ linkedModeIds: arrayOf({ type: "string" }),
1911
+ modeOverlays: arrayOf({ type: "string" }),
1912
+ schemaLinks: arrayOf({ type: "string" }),
1913
+ modeTimeline: arrayOf({
1914
+ type: "object",
1915
+ additionalProperties: false,
1916
+ required: ["id", "stage", "modeId", "label", "note"],
1917
+ properties: {
1918
+ id: { type: "string" },
1919
+ stage: { type: "string" },
1920
+ modeId: nullable({ type: "string" }),
1921
+ label: { type: "string" },
1922
+ note: { type: "string" }
1923
+ }
1924
+ }),
1925
+ nextMoves: arrayOf({ type: "string" }),
1926
+ createdAt: { type: "string", format: "date-time" },
1927
+ updatedAt: { type: "string", format: "date-time" }
1928
+ }
1929
+ };
1930
+ const psycheOverviewPayload = {
1931
+ type: "object",
1932
+ additionalProperties: false,
1933
+ required: [
1934
+ "generatedAt",
1935
+ "domain",
1936
+ "values",
1937
+ "patterns",
1938
+ "behaviors",
1939
+ "beliefs",
1940
+ "modes",
1941
+ "schemaPressure",
1942
+ "reports",
1943
+ "openInsights",
1944
+ "openNotes",
1945
+ "committedActions"
1946
+ ],
1947
+ properties: {
1948
+ generatedAt: { type: "string", format: "date-time" },
1949
+ domain: { $ref: "#/components/schemas/Domain" },
1950
+ values: arrayOf({ $ref: "#/components/schemas/PsycheValue" }),
1951
+ patterns: arrayOf({ $ref: "#/components/schemas/BehaviorPattern" }),
1952
+ behaviors: arrayOf({ $ref: "#/components/schemas/Behavior" }),
1953
+ beliefs: arrayOf({ $ref: "#/components/schemas/BeliefEntry" }),
1954
+ modes: arrayOf({ $ref: "#/components/schemas/ModeProfile" }),
1955
+ schemaPressure: arrayOf({
1956
+ type: "object",
1957
+ additionalProperties: false,
1958
+ required: ["schemaId", "title", "activationCount"],
1959
+ properties: {
1960
+ schemaId: { type: "string" },
1961
+ title: { type: "string" },
1962
+ activationCount: { type: "integer" }
1963
+ }
1964
+ }),
1965
+ reports: arrayOf({ $ref: "#/components/schemas/TriggerReport" }),
1966
+ openInsights: { type: "integer" },
1967
+ openNotes: { type: "integer" },
1968
+ committedActions: arrayOf({ type: "string" })
1969
+ }
1970
+ };
1971
+ return {
1972
+ openapi: "3.1.0",
1973
+ info: {
1974
+ title: "Forge API",
1975
+ version: "v1",
1976
+ description: "Projects-first API for the Forge life-goal, project, task, and evidence system."
1977
+ },
1978
+ servers: [
1979
+ {
1980
+ url: "/",
1981
+ description: "Forge runtime"
1982
+ }
1983
+ ],
1984
+ components: {
1985
+ schemas: {
1986
+ ValidationIssue: validationIssue,
1987
+ ErrorResponse: errorResponse,
1988
+ Tag: tag,
1989
+ Goal: goal,
1990
+ DashboardGoal: dashboardGoal,
1991
+ Project: project,
1992
+ TaskTimeSummary: taskTimeSummary,
1993
+ ProjectSummary: projectSummary,
1994
+ Task: task,
1995
+ TaskRun: taskRun,
1996
+ ActivityEvent: activityEvent,
1997
+ GamificationProfile: gamificationProfile,
1998
+ AchievementSignal: achievementSignal,
1999
+ MilestoneReward: milestoneReward,
2000
+ XpMomentumPulse: xpMomentumPulse,
2001
+ DashboardPayload: dashboardPayload,
2002
+ OverviewContext: overviewContext,
2003
+ TodayContext: todayContext,
2004
+ RiskContext: riskContext,
2005
+ ForgeSnapshot: forgeSnapshot,
2006
+ TaskContextPayload: taskContextPayload,
2007
+ ProjectBoardPayload: projectBoardPayload,
2008
+ InsightsPayload: insightsPayload,
2009
+ WeeklyReviewPayload: weeklyReviewPayload,
2010
+ SettingsPayload: settingsPayload,
2011
+ ExecutionSettings: executionSettings,
2012
+ TaskRunClaimInput: taskRunClaimInput,
2013
+ TaskRunHeartbeatInput: taskRunHeartbeatInput,
2014
+ TaskRunFinishInput: taskRunFinishInput,
2015
+ TaskRunFocusInput: taskRunFocusInput,
2016
+ SettingsUpdateInput: settingsUpdateInput,
2017
+ AgentOnboardingPayload: agentOnboardingPayload,
2018
+ DeletedEntityRecord: deletedEntityRecord,
2019
+ SettingsBinPayload: settingsBinPayload,
2020
+ BatchEntityResult: batchEntityResult,
2021
+ AgentIdentity: agentIdentity,
2022
+ AgentTokenSummary: agentTokenSummary,
2023
+ AgentTokenMutationResult: agentTokenMutationResult,
2024
+ Domain: domain,
2025
+ SchemaCatalogEntry: schemaCatalogEntry,
2026
+ EventType: eventType,
2027
+ EmotionDefinition: emotionDefinition,
2028
+ PsycheValue: psycheValue,
2029
+ BehaviorPattern: behaviorPattern,
2030
+ Behavior: behavior,
2031
+ BeliefEntry: beliefEntry,
2032
+ ModeProfile: modeProfile,
2033
+ ModeGuideSession: modeGuideSession,
2034
+ TriggerReport: triggerReport,
2035
+ NoteLink: noteLink,
2036
+ Note: note,
2037
+ NoteSummary: noteSummary,
2038
+ NotesSummaryByEntity: notesSummaryByEntity,
2039
+ PsycheOverviewPayload: psycheOverviewPayload,
2040
+ Insight: insight,
2041
+ InsightFeedback: insightFeedback,
2042
+ ApprovalRequest: approvalRequest,
2043
+ AgentAction: agentAction,
2044
+ RewardRule: rewardRule,
2045
+ RewardLedgerEvent: rewardLedgerEvent,
2046
+ EventLogEntry: eventLogEntry,
2047
+ XpMetricsPayload: xpMetricsPayload,
2048
+ OperatorContextPayload: operatorContextPayload,
2049
+ OperatorOverviewPayload: operatorOverviewPayload
2050
+ },
2051
+ responses: {
2052
+ Error: jsonResponse({ $ref: "#/components/schemas/ErrorResponse" }, "Error response")
2053
+ }
2054
+ },
2055
+ paths: {
2056
+ "/api/v1/health": {
2057
+ get: {
2058
+ summary: "Get Forge API health and watchdog status",
2059
+ responses: {
2060
+ "200": jsonResponse({
2061
+ type: "object",
2062
+ required: ["ok", "app", "now", "watchdog"],
2063
+ properties: {
2064
+ ok: { type: "boolean" },
2065
+ app: { type: "string", enum: ["forge"] },
2066
+ now: { type: "string", format: "date-time" },
2067
+ watchdog: {
2068
+ type: "object",
2069
+ required: ["enabled", "healthy", "state", "reason", "status"],
2070
+ properties: {
2071
+ enabled: { type: "boolean" },
2072
+ healthy: { type: "boolean" },
2073
+ state: { type: "string", enum: ["disabled", "idle", "healthy", "degraded"] },
2074
+ reason: { anyOf: [{ type: "string" }, { type: "null" }] },
2075
+ status: { anyOf: [{ type: "object", additionalProperties: true }, { type: "null" }] }
2076
+ }
2077
+ }
2078
+ }
2079
+ }, "Forge health payload")
2080
+ }
2081
+ }
2082
+ },
2083
+ "/api/v1/context": {
2084
+ get: {
2085
+ summary: "Get the full Forge snapshot for the routed app shell",
2086
+ responses: {
2087
+ "200": jsonResponse({ $ref: "#/components/schemas/ForgeSnapshot" }, "Forge snapshot"),
2088
+ default: { $ref: "#/components/responses/Error" }
2089
+ }
2090
+ }
2091
+ },
2092
+ "/api/v1/operator/context": {
2093
+ get: {
2094
+ summary: "Get the operator-focused Forge context for agents and assistant workflows",
2095
+ responses: {
2096
+ "200": jsonResponse({
2097
+ type: "object",
2098
+ required: ["context"],
2099
+ properties: {
2100
+ context: { $ref: "#/components/schemas/OperatorContextPayload" }
2101
+ }
2102
+ }, "Operator context")
2103
+ }
2104
+ }
2105
+ },
2106
+ "/api/v1/operator/overview": {
2107
+ get: {
2108
+ summary: "Get the one-shot operator overview with full current state, route guidance, and optional Psyche summary",
2109
+ responses: {
2110
+ "200": jsonResponse({
2111
+ type: "object",
2112
+ required: ["overview"],
2113
+ properties: {
2114
+ overview: { $ref: "#/components/schemas/OperatorOverviewPayload" }
2115
+ }
2116
+ }, "Operator overview")
2117
+ }
2118
+ }
2119
+ },
2120
+ "/api/v1/domains": {
2121
+ get: {
2122
+ summary: "List canonical Forge domains",
2123
+ responses: {
2124
+ "200": jsonResponse({
2125
+ type: "object",
2126
+ required: ["domains"],
2127
+ properties: {
2128
+ domains: arrayOf({ $ref: "#/components/schemas/Domain" })
2129
+ }
2130
+ }, "Domain collection"),
2131
+ default: { $ref: "#/components/responses/Error" }
2132
+ }
2133
+ }
2134
+ },
2135
+ "/api/v1/psyche/overview": {
2136
+ get: {
2137
+ summary: "Get the Psyche hub overview",
2138
+ responses: {
2139
+ "200": jsonResponse({
2140
+ type: "object",
2141
+ required: ["overview"],
2142
+ properties: {
2143
+ overview: { $ref: "#/components/schemas/PsycheOverviewPayload" }
2144
+ }
2145
+ }, "Psyche overview"),
2146
+ default: { $ref: "#/components/responses/Error" }
2147
+ }
2148
+ }
2149
+ },
2150
+ "/api/v1/psyche/values": {
2151
+ get: {
2152
+ summary: "List ACT-style values",
2153
+ responses: {
2154
+ "200": jsonResponse({ type: "object", required: ["values"], properties: { values: arrayOf({ $ref: "#/components/schemas/PsycheValue" }) } }, "Psyche value collection"),
2155
+ default: { $ref: "#/components/responses/Error" }
2156
+ }
2157
+ },
2158
+ post: {
2159
+ summary: "Create a Psyche value",
2160
+ responses: {
2161
+ "201": jsonResponse({ type: "object", required: ["value"], properties: { value: { $ref: "#/components/schemas/PsycheValue" } } }, "Created value"),
2162
+ default: { $ref: "#/components/responses/Error" }
2163
+ }
2164
+ }
2165
+ },
2166
+ "/api/v1/psyche/values/{id}": {
2167
+ get: {
2168
+ summary: "Get a Psyche value",
2169
+ responses: {
2170
+ "200": jsonResponse({ type: "object", required: ["value"], properties: { value: { $ref: "#/components/schemas/PsycheValue" } } }, "Psyche value"),
2171
+ default: { $ref: "#/components/responses/Error" }
2172
+ }
2173
+ },
2174
+ patch: {
2175
+ summary: "Update a Psyche value",
2176
+ responses: {
2177
+ "200": jsonResponse({ type: "object", required: ["value"], properties: { value: { $ref: "#/components/schemas/PsycheValue" } } }, "Updated value"),
2178
+ default: { $ref: "#/components/responses/Error" }
2179
+ }
2180
+ },
2181
+ delete: {
2182
+ summary: "Delete a Psyche value",
2183
+ responses: {
2184
+ "200": jsonResponse({ type: "object", required: ["value"], properties: { value: { $ref: "#/components/schemas/PsycheValue" } } }, "Deleted value"),
2185
+ default: { $ref: "#/components/responses/Error" }
2186
+ }
2187
+ }
2188
+ },
2189
+ "/api/v1/psyche/patterns": {
2190
+ get: {
2191
+ summary: "List behavior patterns",
2192
+ responses: {
2193
+ "200": jsonResponse({ type: "object", required: ["patterns"], properties: { patterns: arrayOf({ $ref: "#/components/schemas/BehaviorPattern" }) } }, "Behavior pattern collection"),
2194
+ default: { $ref: "#/components/responses/Error" }
2195
+ }
2196
+ },
2197
+ post: {
2198
+ summary: "Create a behavior pattern",
2199
+ responses: {
2200
+ "201": jsonResponse({ type: "object", required: ["pattern"], properties: { pattern: { $ref: "#/components/schemas/BehaviorPattern" } } }, "Created behavior pattern"),
2201
+ default: { $ref: "#/components/responses/Error" }
2202
+ }
2203
+ }
2204
+ },
2205
+ "/api/v1/psyche/patterns/{id}": {
2206
+ get: {
2207
+ summary: "Get a behavior pattern",
2208
+ responses: {
2209
+ "200": jsonResponse({ type: "object", required: ["pattern"], properties: { pattern: { $ref: "#/components/schemas/BehaviorPattern" } } }, "Behavior pattern"),
2210
+ default: { $ref: "#/components/responses/Error" }
2211
+ }
2212
+ },
2213
+ patch: {
2214
+ summary: "Update a behavior pattern",
2215
+ responses: {
2216
+ "200": jsonResponse({ type: "object", required: ["pattern"], properties: { pattern: { $ref: "#/components/schemas/BehaviorPattern" } } }, "Updated behavior pattern"),
2217
+ default: { $ref: "#/components/responses/Error" }
2218
+ }
2219
+ },
2220
+ delete: {
2221
+ summary: "Delete a behavior pattern",
2222
+ responses: {
2223
+ "200": jsonResponse({ type: "object", required: ["pattern"], properties: { pattern: { $ref: "#/components/schemas/BehaviorPattern" } } }, "Deleted behavior pattern"),
2224
+ default: { $ref: "#/components/responses/Error" }
2225
+ }
2226
+ }
2227
+ },
2228
+ "/api/v1/psyche/behaviors": {
2229
+ get: {
2230
+ summary: "List tracked Psyche behaviors",
2231
+ responses: {
2232
+ "200": jsonResponse({ type: "object", required: ["behaviors"], properties: { behaviors: arrayOf({ $ref: "#/components/schemas/Behavior" }) } }, "Behavior collection"),
2233
+ default: { $ref: "#/components/responses/Error" }
2234
+ }
2235
+ },
2236
+ post: {
2237
+ summary: "Create a Psyche behavior",
2238
+ responses: {
2239
+ "201": jsonResponse({ type: "object", required: ["behavior"], properties: { behavior: { $ref: "#/components/schemas/Behavior" } } }, "Created behavior"),
2240
+ default: { $ref: "#/components/responses/Error" }
2241
+ }
2242
+ }
2243
+ },
2244
+ "/api/v1/psyche/behaviors/{id}": {
2245
+ get: {
2246
+ summary: "Get a Psyche behavior",
2247
+ responses: {
2248
+ "200": jsonResponse({ type: "object", required: ["behavior"], properties: { behavior: { $ref: "#/components/schemas/Behavior" } } }, "Behavior detail"),
2249
+ default: { $ref: "#/components/responses/Error" }
2250
+ }
2251
+ },
2252
+ patch: {
2253
+ summary: "Update a Psyche behavior",
2254
+ responses: {
2255
+ "200": jsonResponse({ type: "object", required: ["behavior"], properties: { behavior: { $ref: "#/components/schemas/Behavior" } } }, "Updated behavior"),
2256
+ default: { $ref: "#/components/responses/Error" }
2257
+ }
2258
+ },
2259
+ delete: {
2260
+ summary: "Delete a Psyche behavior",
2261
+ responses: {
2262
+ "200": jsonResponse({ type: "object", required: ["behavior"], properties: { behavior: { $ref: "#/components/schemas/Behavior" } } }, "Deleted behavior"),
2263
+ default: { $ref: "#/components/responses/Error" }
2264
+ }
2265
+ }
2266
+ },
2267
+ "/api/v1/psyche/schema-catalog": {
2268
+ get: {
2269
+ summary: "List the fixed schema-therapy catalog",
2270
+ responses: {
2271
+ "200": jsonResponse({ type: "object", required: ["schemas"], properties: { schemas: arrayOf({ $ref: "#/components/schemas/SchemaCatalogEntry" }) } }, "Schema catalog"),
2272
+ default: { $ref: "#/components/responses/Error" }
2273
+ }
2274
+ }
2275
+ },
2276
+ "/api/v1/psyche/beliefs": {
2277
+ get: {
2278
+ summary: "List belief entries linked to schemas and reports",
2279
+ responses: {
2280
+ "200": jsonResponse({ type: "object", required: ["beliefs"], properties: { beliefs: arrayOf({ $ref: "#/components/schemas/BeliefEntry" }) } }, "Belief collection"),
2281
+ default: { $ref: "#/components/responses/Error" }
2282
+ }
2283
+ },
2284
+ post: {
2285
+ summary: "Create a belief entry",
2286
+ responses: {
2287
+ "201": jsonResponse({ type: "object", required: ["belief"], properties: { belief: { $ref: "#/components/schemas/BeliefEntry" } } }, "Created belief"),
2288
+ default: { $ref: "#/components/responses/Error" }
2289
+ }
2290
+ }
2291
+ },
2292
+ "/api/v1/psyche/beliefs/{id}": {
2293
+ get: {
2294
+ summary: "Get a belief entry",
2295
+ responses: {
2296
+ "200": jsonResponse({ type: "object", required: ["belief"], properties: { belief: { $ref: "#/components/schemas/BeliefEntry" } } }, "Belief detail"),
2297
+ default: { $ref: "#/components/responses/Error" }
2298
+ }
2299
+ },
2300
+ patch: {
2301
+ summary: "Update a belief entry",
2302
+ responses: {
2303
+ "200": jsonResponse({ type: "object", required: ["belief"], properties: { belief: { $ref: "#/components/schemas/BeliefEntry" } } }, "Updated belief"),
2304
+ default: { $ref: "#/components/responses/Error" }
2305
+ }
2306
+ },
2307
+ delete: {
2308
+ summary: "Delete a belief entry",
2309
+ responses: {
2310
+ "200": jsonResponse({ type: "object", required: ["belief"], properties: { belief: { $ref: "#/components/schemas/BeliefEntry" } } }, "Deleted belief"),
2311
+ default: { $ref: "#/components/responses/Error" }
2312
+ }
2313
+ }
2314
+ },
2315
+ "/api/v1/psyche/modes": {
2316
+ get: {
2317
+ summary: "List Psyche mode profiles",
2318
+ responses: {
2319
+ "200": jsonResponse({ type: "object", required: ["modes"], properties: { modes: arrayOf({ $ref: "#/components/schemas/ModeProfile" }) } }, "Mode collection"),
2320
+ default: { $ref: "#/components/responses/Error" }
2321
+ }
2322
+ },
2323
+ post: {
2324
+ summary: "Create a Psyche mode profile",
2325
+ responses: {
2326
+ "201": jsonResponse({ type: "object", required: ["mode"], properties: { mode: { $ref: "#/components/schemas/ModeProfile" } } }, "Created mode"),
2327
+ default: { $ref: "#/components/responses/Error" }
2328
+ }
2329
+ }
2330
+ },
2331
+ "/api/v1/psyche/modes/{id}": {
2332
+ get: {
2333
+ summary: "Get a Psyche mode profile",
2334
+ responses: {
2335
+ "200": jsonResponse({ type: "object", required: ["mode"], properties: { mode: { $ref: "#/components/schemas/ModeProfile" } } }, "Mode detail"),
2336
+ default: { $ref: "#/components/responses/Error" }
2337
+ }
2338
+ },
2339
+ patch: {
2340
+ summary: "Update a Psyche mode profile",
2341
+ responses: {
2342
+ "200": jsonResponse({ type: "object", required: ["mode"], properties: { mode: { $ref: "#/components/schemas/ModeProfile" } } }, "Updated mode"),
2343
+ default: { $ref: "#/components/responses/Error" }
2344
+ }
2345
+ },
2346
+ delete: {
2347
+ summary: "Delete a Psyche mode profile",
2348
+ responses: {
2349
+ "200": jsonResponse({ type: "object", required: ["mode"], properties: { mode: { $ref: "#/components/schemas/ModeProfile" } } }, "Deleted mode"),
2350
+ default: { $ref: "#/components/responses/Error" }
2351
+ }
2352
+ }
2353
+ },
2354
+ "/api/v1/psyche/mode-guides": {
2355
+ get: {
2356
+ summary: "List guided mode-identification sessions",
2357
+ responses: {
2358
+ "200": jsonResponse({ type: "object", required: ["sessions"], properties: { sessions: arrayOf({ $ref: "#/components/schemas/ModeGuideSession" }) } }, "Mode guide sessions"),
2359
+ default: { $ref: "#/components/responses/Error" }
2360
+ }
2361
+ },
2362
+ post: {
2363
+ summary: "Create a guided mode-identification session",
2364
+ responses: {
2365
+ "201": jsonResponse({ type: "object", required: ["session"], properties: { session: { $ref: "#/components/schemas/ModeGuideSession" } } }, "Created mode guide session"),
2366
+ default: { $ref: "#/components/responses/Error" }
2367
+ }
2368
+ }
2369
+ },
2370
+ "/api/v1/psyche/mode-guides/{id}": {
2371
+ get: {
2372
+ summary: "Get a guided mode-identification session",
2373
+ responses: {
2374
+ "200": jsonResponse({ type: "object", required: ["session"], properties: { session: { $ref: "#/components/schemas/ModeGuideSession" } } }, "Mode guide detail"),
2375
+ default: { $ref: "#/components/responses/Error" }
2376
+ }
2377
+ },
2378
+ patch: {
2379
+ summary: "Update a guided mode-identification session",
2380
+ responses: {
2381
+ "200": jsonResponse({ type: "object", required: ["session"], properties: { session: { $ref: "#/components/schemas/ModeGuideSession" } } }, "Updated mode guide session"),
2382
+ default: { $ref: "#/components/responses/Error" }
2383
+ }
2384
+ },
2385
+ delete: {
2386
+ summary: "Delete a guided mode-identification session",
2387
+ responses: {
2388
+ "200": jsonResponse({ type: "object", required: ["session"], properties: { session: { $ref: "#/components/schemas/ModeGuideSession" } } }, "Deleted mode guide session"),
2389
+ default: { $ref: "#/components/responses/Error" }
2390
+ }
2391
+ }
2392
+ },
2393
+ "/api/v1/psyche/event-types": {
2394
+ get: {
2395
+ summary: "List seeded and custom Psyche event types",
2396
+ responses: {
2397
+ "200": jsonResponse({ type: "object", required: ["eventTypes"], properties: { eventTypes: arrayOf({ $ref: "#/components/schemas/EventType" }) } }, "Event type collection"),
2398
+ default: { $ref: "#/components/responses/Error" }
2399
+ }
2400
+ },
2401
+ post: {
2402
+ summary: "Create a custom Psyche event type",
2403
+ responses: {
2404
+ "201": jsonResponse({ type: "object", required: ["eventType"], properties: { eventType: { $ref: "#/components/schemas/EventType" } } }, "Created event type"),
2405
+ default: { $ref: "#/components/responses/Error" }
2406
+ }
2407
+ }
2408
+ },
2409
+ "/api/v1/psyche/event-types/{id}": {
2410
+ get: {
2411
+ summary: "Get a Psyche event type",
2412
+ responses: {
2413
+ "200": jsonResponse({ type: "object", required: ["eventType"], properties: { eventType: { $ref: "#/components/schemas/EventType" } } }, "Event type detail"),
2414
+ default: { $ref: "#/components/responses/Error" }
2415
+ }
2416
+ },
2417
+ patch: {
2418
+ summary: "Update a custom Psyche event type",
2419
+ responses: {
2420
+ "200": jsonResponse({ type: "object", required: ["eventType"], properties: { eventType: { $ref: "#/components/schemas/EventType" } } }, "Updated event type"),
2421
+ default: { $ref: "#/components/responses/Error" }
2422
+ }
2423
+ },
2424
+ delete: {
2425
+ summary: "Delete a custom Psyche event type",
2426
+ responses: {
2427
+ "200": jsonResponse({ type: "object", required: ["eventType"], properties: { eventType: { $ref: "#/components/schemas/EventType" } } }, "Deleted event type"),
2428
+ default: { $ref: "#/components/responses/Error" }
2429
+ }
2430
+ }
2431
+ },
2432
+ "/api/v1/psyche/emotions": {
2433
+ get: {
2434
+ summary: "List seeded and custom Psyche emotions",
2435
+ responses: {
2436
+ "200": jsonResponse({ type: "object", required: ["emotions"], properties: { emotions: arrayOf({ $ref: "#/components/schemas/EmotionDefinition" }) } }, "Emotion collection"),
2437
+ default: { $ref: "#/components/responses/Error" }
2438
+ }
2439
+ },
2440
+ post: {
2441
+ summary: "Create a custom Psyche emotion",
2442
+ responses: {
2443
+ "201": jsonResponse({ type: "object", required: ["emotion"], properties: { emotion: { $ref: "#/components/schemas/EmotionDefinition" } } }, "Created emotion"),
2444
+ default: { $ref: "#/components/responses/Error" }
2445
+ }
2446
+ }
2447
+ },
2448
+ "/api/v1/psyche/emotions/{id}": {
2449
+ get: {
2450
+ summary: "Get a Psyche emotion definition",
2451
+ responses: {
2452
+ "200": jsonResponse({ type: "object", required: ["emotion"], properties: { emotion: { $ref: "#/components/schemas/EmotionDefinition" } } }, "Emotion detail"),
2453
+ default: { $ref: "#/components/responses/Error" }
2454
+ }
2455
+ },
2456
+ patch: {
2457
+ summary: "Update a custom Psyche emotion definition",
2458
+ responses: {
2459
+ "200": jsonResponse({ type: "object", required: ["emotion"], properties: { emotion: { $ref: "#/components/schemas/EmotionDefinition" } } }, "Updated emotion"),
2460
+ default: { $ref: "#/components/responses/Error" }
2461
+ }
2462
+ },
2463
+ delete: {
2464
+ summary: "Delete a custom Psyche emotion definition",
2465
+ responses: {
2466
+ "200": jsonResponse({ type: "object", required: ["emotion"], properties: { emotion: { $ref: "#/components/schemas/EmotionDefinition" } } }, "Deleted emotion"),
2467
+ default: { $ref: "#/components/responses/Error" }
2468
+ }
2469
+ }
2470
+ },
2471
+ "/api/v1/psyche/reports": {
2472
+ get: {
2473
+ summary: "List trigger reports",
2474
+ responses: {
2475
+ "200": jsonResponse({ type: "object", required: ["reports"], properties: { reports: arrayOf({ $ref: "#/components/schemas/TriggerReport" }) } }, "Trigger report collection"),
2476
+ default: { $ref: "#/components/responses/Error" }
2477
+ }
2478
+ },
2479
+ post: {
2480
+ summary: "Create a trigger report",
2481
+ responses: {
2482
+ "201": jsonResponse({ type: "object", required: ["report"], properties: { report: { $ref: "#/components/schemas/TriggerReport" } } }, "Created trigger report"),
2483
+ default: { $ref: "#/components/responses/Error" }
2484
+ }
2485
+ }
2486
+ },
2487
+ "/api/v1/psyche/reports/{id}": {
2488
+ get: {
2489
+ summary: "Get a trigger report with linked notes and insights",
2490
+ responses: {
2491
+ "200": jsonResponse({
2492
+ type: "object",
2493
+ required: ["report", "notes", "insights"],
2494
+ properties: {
2495
+ report: { $ref: "#/components/schemas/TriggerReport" },
2496
+ notes: arrayOf({ $ref: "#/components/schemas/Note" }),
2497
+ insights: arrayOf({ $ref: "#/components/schemas/Insight" })
2498
+ }
2499
+ }, "Trigger report detail"),
2500
+ default: { $ref: "#/components/responses/Error" }
2501
+ }
2502
+ },
2503
+ patch: {
2504
+ summary: "Update a trigger report",
2505
+ responses: {
2506
+ "200": jsonResponse({ type: "object", required: ["report"], properties: { report: { $ref: "#/components/schemas/TriggerReport" } } }, "Updated trigger report"),
2507
+ default: { $ref: "#/components/responses/Error" }
2508
+ }
2509
+ },
2510
+ delete: {
2511
+ summary: "Delete a trigger report",
2512
+ responses: {
2513
+ "200": jsonResponse({ type: "object", required: ["report"], properties: { report: { $ref: "#/components/schemas/TriggerReport" } } }, "Deleted trigger report"),
2514
+ default: { $ref: "#/components/responses/Error" }
2515
+ }
2516
+ }
2517
+ },
2518
+ "/api/v1/notes": {
2519
+ get: {
2520
+ summary: "List notes linked to Forge entities",
2521
+ responses: {
2522
+ "200": jsonResponse({ type: "object", required: ["notes"], properties: { notes: arrayOf({ $ref: "#/components/schemas/Note" }) } }, "Note collection"),
2523
+ default: { $ref: "#/components/responses/Error" }
2524
+ }
2525
+ },
2526
+ post: {
2527
+ summary: "Create a note linked to one or more Forge entities",
2528
+ responses: {
2529
+ "201": jsonResponse({ type: "object", required: ["note"], properties: { note: { $ref: "#/components/schemas/Note" } } }, "Created note"),
2530
+ default: { $ref: "#/components/responses/Error" }
2531
+ }
2532
+ }
2533
+ },
2534
+ "/api/v1/notes/{id}": {
2535
+ get: {
2536
+ summary: "Get a note",
2537
+ responses: {
2538
+ "200": jsonResponse({ type: "object", required: ["note"], properties: { note: { $ref: "#/components/schemas/Note" } } }, "Note"),
2539
+ default: { $ref: "#/components/responses/Error" }
2540
+ }
2541
+ },
2542
+ patch: {
2543
+ summary: "Update a note",
2544
+ responses: {
2545
+ "200": jsonResponse({ type: "object", required: ["note"], properties: { note: { $ref: "#/components/schemas/Note" } } }, "Updated note"),
2546
+ default: { $ref: "#/components/responses/Error" }
2547
+ }
2548
+ },
2549
+ delete: {
2550
+ summary: "Delete a note",
2551
+ responses: {
2552
+ "200": jsonResponse({ type: "object", required: ["note"], properties: { note: { $ref: "#/components/schemas/Note" } } }, "Deleted note"),
2553
+ default: { $ref: "#/components/responses/Error" }
2554
+ }
2555
+ }
2556
+ },
2557
+ "/api/v1/projects": {
2558
+ get: {
2559
+ summary: "List projects",
2560
+ responses: {
2561
+ "200": jsonResponse({
2562
+ type: "object",
2563
+ required: ["projects"],
2564
+ properties: {
2565
+ projects: arrayOf({ $ref: "#/components/schemas/ProjectSummary" })
2566
+ }
2567
+ }, "Project collection"),
2568
+ default: { $ref: "#/components/responses/Error" }
2569
+ }
2570
+ },
2571
+ post: {
2572
+ summary: "Create a project",
2573
+ responses: {
2574
+ "201": jsonResponse({
2575
+ type: "object",
2576
+ required: ["project"],
2577
+ properties: {
2578
+ project: { $ref: "#/components/schemas/Project" }
2579
+ }
2580
+ }, "Created project"),
2581
+ default: { $ref: "#/components/responses/Error" }
2582
+ }
2583
+ }
2584
+ },
2585
+ "/api/v1/campaigns": {
2586
+ get: {
2587
+ deprecated: true,
2588
+ summary: "Deprecated alias for project listing",
2589
+ responses: {
2590
+ "200": jsonResponse({
2591
+ type: "object",
2592
+ required: ["projects"],
2593
+ properties: {
2594
+ projects: arrayOf({ $ref: "#/components/schemas/ProjectSummary" })
2595
+ }
2596
+ }, "Project collection"),
2597
+ default: { $ref: "#/components/responses/Error" }
2598
+ }
2599
+ }
2600
+ },
2601
+ "/api/v1/projects/{id}": {
2602
+ get: {
2603
+ summary: "Get a project summary",
2604
+ responses: {
2605
+ "200": jsonResponse({
2606
+ type: "object",
2607
+ required: ["project"],
2608
+ properties: {
2609
+ project: { $ref: "#/components/schemas/ProjectSummary" }
2610
+ }
2611
+ }, "Project summary"),
2612
+ "404": { $ref: "#/components/responses/Error" }
2613
+ }
2614
+ },
2615
+ patch: {
2616
+ summary: "Update a project",
2617
+ responses: {
2618
+ "200": jsonResponse({
2619
+ type: "object",
2620
+ required: ["project"],
2621
+ properties: {
2622
+ project: { $ref: "#/components/schemas/Project" }
2623
+ }
2624
+ }, "Updated project"),
2625
+ "404": { $ref: "#/components/responses/Error" },
2626
+ default: { $ref: "#/components/responses/Error" }
2627
+ }
2628
+ },
2629
+ delete: {
2630
+ summary: "Delete a project",
2631
+ responses: {
2632
+ "200": jsonResponse({
2633
+ type: "object",
2634
+ required: ["project"],
2635
+ properties: {
2636
+ project: { $ref: "#/components/schemas/Project" }
2637
+ }
2638
+ }, "Deleted project"),
2639
+ "404": { $ref: "#/components/responses/Error" },
2640
+ default: { $ref: "#/components/responses/Error" }
2641
+ }
2642
+ }
2643
+ },
2644
+ "/api/v1/projects/{id}/board": {
2645
+ get: {
2646
+ summary: "Get the board and evidence for one project",
2647
+ responses: {
2648
+ "200": jsonResponse({ $ref: "#/components/schemas/ProjectBoardPayload" }, "Project board"),
2649
+ "404": { $ref: "#/components/responses/Error" }
2650
+ }
2651
+ }
2652
+ },
2653
+ "/api/v1/goals": {
2654
+ get: {
2655
+ summary: "List life goals",
2656
+ responses: {
2657
+ "200": jsonResponse({
2658
+ type: "object",
2659
+ required: ["goals"],
2660
+ properties: {
2661
+ goals: arrayOf({ $ref: "#/components/schemas/Goal" })
2662
+ }
2663
+ }, "Goal collection")
2664
+ }
2665
+ },
2666
+ post: {
2667
+ summary: "Create a life goal",
2668
+ responses: {
2669
+ "201": jsonResponse({
2670
+ type: "object",
2671
+ required: ["goal"],
2672
+ properties: {
2673
+ goal: { $ref: "#/components/schemas/Goal" }
2674
+ }
2675
+ }, "Created goal"),
2676
+ default: { $ref: "#/components/responses/Error" }
2677
+ }
2678
+ }
2679
+ },
2680
+ "/api/v1/goals/{id}": {
2681
+ get: {
2682
+ summary: "Get a life goal",
2683
+ responses: {
2684
+ "200": jsonResponse({
2685
+ type: "object",
2686
+ required: ["goal"],
2687
+ properties: {
2688
+ goal: { $ref: "#/components/schemas/Goal" }
2689
+ }
2690
+ }, "Goal"),
2691
+ "404": { $ref: "#/components/responses/Error" }
2692
+ }
2693
+ },
2694
+ patch: {
2695
+ summary: "Update a life goal",
2696
+ responses: {
2697
+ "200": jsonResponse({
2698
+ type: "object",
2699
+ required: ["goal"],
2700
+ properties: {
2701
+ goal: { $ref: "#/components/schemas/Goal" }
2702
+ }
2703
+ }, "Updated goal"),
2704
+ "404": { $ref: "#/components/responses/Error" }
2705
+ }
2706
+ },
2707
+ delete: {
2708
+ summary: "Delete a life goal",
2709
+ responses: {
2710
+ "200": jsonResponse({
2711
+ type: "object",
2712
+ required: ["goal"],
2713
+ properties: {
2714
+ goal: { $ref: "#/components/schemas/Goal" }
2715
+ }
2716
+ }, "Deleted goal"),
2717
+ "404": { $ref: "#/components/responses/Error" }
2718
+ }
2719
+ }
2720
+ },
2721
+ "/api/v1/tags": {
2722
+ get: {
2723
+ summary: "List tags",
2724
+ responses: {
2725
+ "200": jsonResponse({
2726
+ type: "object",
2727
+ required: ["tags"],
2728
+ properties: {
2729
+ tags: arrayOf({ $ref: "#/components/schemas/Tag" })
2730
+ }
2731
+ }, "Tag collection")
2732
+ }
2733
+ },
2734
+ post: {
2735
+ summary: "Create a tag",
2736
+ responses: {
2737
+ "201": jsonResponse({
2738
+ type: "object",
2739
+ required: ["tag"],
2740
+ properties: {
2741
+ tag: { $ref: "#/components/schemas/Tag" }
2742
+ }
2743
+ }, "Created tag"),
2744
+ default: { $ref: "#/components/responses/Error" }
2745
+ }
2746
+ }
2747
+ },
2748
+ "/api/v1/tags/{id}": {
2749
+ get: {
2750
+ summary: "Get a tag",
2751
+ responses: {
2752
+ "200": jsonResponse({
2753
+ type: "object",
2754
+ required: ["tag"],
2755
+ properties: {
2756
+ tag: { $ref: "#/components/schemas/Tag" }
2757
+ }
2758
+ }, "Tag"),
2759
+ "404": { $ref: "#/components/responses/Error" }
2760
+ }
2761
+ },
2762
+ patch: {
2763
+ summary: "Update a tag",
2764
+ responses: {
2765
+ "200": jsonResponse({
2766
+ type: "object",
2767
+ required: ["tag"],
2768
+ properties: {
2769
+ tag: { $ref: "#/components/schemas/Tag" }
2770
+ }
2771
+ }, "Updated tag"),
2772
+ "404": { $ref: "#/components/responses/Error" },
2773
+ default: { $ref: "#/components/responses/Error" }
2774
+ }
2775
+ },
2776
+ delete: {
2777
+ summary: "Delete a tag",
2778
+ responses: {
2779
+ "200": jsonResponse({
2780
+ type: "object",
2781
+ required: ["tag"],
2782
+ properties: {
2783
+ tag: { $ref: "#/components/schemas/Tag" }
2784
+ }
2785
+ }, "Deleted tag"),
2786
+ "404": { $ref: "#/components/responses/Error" },
2787
+ default: { $ref: "#/components/responses/Error" }
2788
+ }
2789
+ }
2790
+ },
2791
+ "/api/v1/tasks": {
2792
+ get: {
2793
+ summary: "List tasks",
2794
+ responses: {
2795
+ "200": jsonResponse({
2796
+ type: "object",
2797
+ required: ["tasks"],
2798
+ properties: {
2799
+ tasks: arrayOf({ $ref: "#/components/schemas/Task" })
2800
+ }
2801
+ }, "Task collection")
2802
+ }
2803
+ },
2804
+ post: {
2805
+ summary: "Create a task",
2806
+ responses: {
2807
+ "201": jsonResponse({
2808
+ type: "object",
2809
+ required: ["task"],
2810
+ properties: {
2811
+ task: { $ref: "#/components/schemas/Task" }
2812
+ }
2813
+ }, "Created task"),
2814
+ default: { $ref: "#/components/responses/Error" }
2815
+ }
2816
+ }
2817
+ },
2818
+ "/api/v1/operator/log-work": {
2819
+ post: {
2820
+ summary: "Log work that already happened by creating or updating a task and returning fresh XP state",
2821
+ responses: {
2822
+ "200": jsonResponse({
2823
+ type: "object",
2824
+ required: ["task", "xp"],
2825
+ properties: {
2826
+ task: { $ref: "#/components/schemas/Task" },
2827
+ xp: { $ref: "#/components/schemas/XpMetricsPayload" }
2828
+ }
2829
+ }, "Updated task and XP state"),
2830
+ "201": jsonResponse({
2831
+ type: "object",
2832
+ required: ["task", "xp"],
2833
+ properties: {
2834
+ task: { $ref: "#/components/schemas/Task" },
2835
+ xp: { $ref: "#/components/schemas/XpMetricsPayload" }
2836
+ }
2837
+ }, "Created task and XP state"),
2838
+ "404": { $ref: "#/components/responses/Error" }
2839
+ }
2840
+ }
2841
+ },
2842
+ "/api/v1/tasks/{id}": {
2843
+ get: {
2844
+ summary: "Get a task",
2845
+ responses: {
2846
+ "200": jsonResponse({
2847
+ type: "object",
2848
+ required: ["task"],
2849
+ properties: {
2850
+ task: { $ref: "#/components/schemas/Task" }
2851
+ }
2852
+ }, "Task"),
2853
+ "404": { $ref: "#/components/responses/Error" }
2854
+ }
2855
+ },
2856
+ patch: {
2857
+ summary: "Update a task",
2858
+ responses: {
2859
+ "200": jsonResponse({
2860
+ type: "object",
2861
+ required: ["task"],
2862
+ properties: {
2863
+ task: { $ref: "#/components/schemas/Task" }
2864
+ }
2865
+ }, "Updated task"),
2866
+ "404": { $ref: "#/components/responses/Error" }
2867
+ }
2868
+ },
2869
+ delete: {
2870
+ summary: "Delete a task",
2871
+ responses: {
2872
+ "200": jsonResponse({
2873
+ type: "object",
2874
+ required: ["task"],
2875
+ properties: {
2876
+ task: { $ref: "#/components/schemas/Task" }
2877
+ }
2878
+ }, "Deleted task"),
2879
+ "404": { $ref: "#/components/responses/Error" }
2880
+ }
2881
+ }
2882
+ },
2883
+ "/api/v1/tasks/{id}/context": {
2884
+ get: {
2885
+ summary: "Get task detail context including project, goal, runs, and evidence",
2886
+ responses: {
2887
+ "200": jsonResponse({ $ref: "#/components/schemas/TaskContextPayload" }, "Task detail payload"),
2888
+ "404": { $ref: "#/components/responses/Error" }
2889
+ }
2890
+ }
2891
+ },
2892
+ "/api/v1/tasks/{id}/runs": {
2893
+ post: {
2894
+ summary: "Start or renew a live task timer for a task",
2895
+ requestBody: {
2896
+ required: true,
2897
+ content: {
2898
+ "application/json": {
2899
+ schema: { $ref: "#/components/schemas/TaskRunClaimInput" }
2900
+ }
2901
+ }
2902
+ },
2903
+ responses: {
2904
+ "200": jsonResponse({
2905
+ type: "object",
2906
+ required: ["taskRun"],
2907
+ properties: {
2908
+ taskRun: { $ref: "#/components/schemas/TaskRun" }
2909
+ }
2910
+ }, "Existing active task timer"),
2911
+ "201": jsonResponse({
2912
+ type: "object",
2913
+ required: ["taskRun"],
2914
+ properties: {
2915
+ taskRun: { $ref: "#/components/schemas/TaskRun" }
2916
+ }
2917
+ }, "Created task timer"),
2918
+ default: { $ref: "#/components/responses/Error" }
2919
+ }
2920
+ }
2921
+ },
2922
+ "/api/v1/tasks/{id}/uncomplete": {
2923
+ post: {
2924
+ summary: "Reopen a completed task and remove its completion XP",
2925
+ responses: {
2926
+ "200": jsonResponse({
2927
+ type: "object",
2928
+ required: ["task"],
2929
+ properties: {
2930
+ task: { $ref: "#/components/schemas/Task" }
2931
+ }
2932
+ }, "Reopened task"),
2933
+ "404": { $ref: "#/components/responses/Error" }
2934
+ }
2935
+ }
2936
+ },
2937
+ "/api/v1/task-runs": {
2938
+ get: {
2939
+ summary: "List task timers with optional task and active-state filters",
2940
+ parameters: [
2941
+ { name: "taskId", in: "query", schema: { type: "string" } },
2942
+ { name: "status", in: "query", schema: { type: "string", enum: ["active", "completed", "released", "timed_out"] } },
2943
+ { name: "active", in: "query", schema: { type: "boolean" } },
2944
+ { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100 } }
2945
+ ],
2946
+ responses: {
2947
+ "200": jsonResponse({
2948
+ type: "object",
2949
+ required: ["taskRuns"],
2950
+ properties: {
2951
+ taskRuns: arrayOf({ $ref: "#/components/schemas/TaskRun" })
2952
+ }
2953
+ }, "Task timers")
2954
+ }
2955
+ }
2956
+ },
2957
+ "/api/v1/task-runs/{id}/heartbeat": {
2958
+ post: {
2959
+ summary: "Renew a live task timer heartbeat",
2960
+ requestBody: {
2961
+ required: false,
2962
+ content: {
2963
+ "application/json": {
2964
+ schema: { $ref: "#/components/schemas/TaskRunHeartbeatInput" }
2965
+ }
2966
+ }
2967
+ },
2968
+ responses: {
2969
+ "200": jsonResponse({
2970
+ type: "object",
2971
+ required: ["taskRun"],
2972
+ properties: {
2973
+ taskRun: { $ref: "#/components/schemas/TaskRun" }
2974
+ }
2975
+ }, "Updated task timer heartbeat"),
2976
+ default: { $ref: "#/components/responses/Error" }
2977
+ }
2978
+ }
2979
+ },
2980
+ "/api/v1/task-runs/{id}/focus": {
2981
+ post: {
2982
+ summary: "Mark one live task timer as the current primary timer",
2983
+ requestBody: {
2984
+ required: false,
2985
+ content: {
2986
+ "application/json": {
2987
+ schema: { $ref: "#/components/schemas/TaskRunFocusInput" }
2988
+ }
2989
+ }
2990
+ },
2991
+ responses: {
2992
+ "200": jsonResponse({
2993
+ type: "object",
2994
+ required: ["taskRun"],
2995
+ properties: {
2996
+ taskRun: { $ref: "#/components/schemas/TaskRun" }
2997
+ }
2998
+ }, "Focused task timer"),
2999
+ default: { $ref: "#/components/responses/Error" }
3000
+ }
3001
+ }
3002
+ },
3003
+ "/api/v1/task-runs/{id}/complete": {
3004
+ post: {
3005
+ summary: "Complete a live task timer and complete the task",
3006
+ requestBody: {
3007
+ required: false,
3008
+ content: {
3009
+ "application/json": {
3010
+ schema: { $ref: "#/components/schemas/TaskRunFinishInput" }
3011
+ }
3012
+ }
3013
+ },
3014
+ responses: {
3015
+ "200": jsonResponse({
3016
+ type: "object",
3017
+ required: ["taskRun"],
3018
+ properties: {
3019
+ taskRun: { $ref: "#/components/schemas/TaskRun" }
3020
+ }
3021
+ }, "Completed task timer"),
3022
+ default: { $ref: "#/components/responses/Error" }
3023
+ }
3024
+ }
3025
+ },
3026
+ "/api/v1/task-runs/{id}/release": {
3027
+ post: {
3028
+ summary: "Pause or release a live task timer without completing the task",
3029
+ requestBody: {
3030
+ required: false,
3031
+ content: {
3032
+ "application/json": {
3033
+ schema: { $ref: "#/components/schemas/TaskRunFinishInput" }
3034
+ }
3035
+ }
3036
+ },
3037
+ responses: {
3038
+ "200": jsonResponse({
3039
+ type: "object",
3040
+ required: ["taskRun"],
3041
+ properties: {
3042
+ taskRun: { $ref: "#/components/schemas/TaskRun" }
3043
+ }
3044
+ }, "Released task timer"),
3045
+ default: { $ref: "#/components/responses/Error" }
3046
+ }
3047
+ }
3048
+ },
3049
+ "/api/v1/activity": {
3050
+ get: {
3051
+ summary: "List visible activity events",
3052
+ responses: {
3053
+ "200": jsonResponse({
3054
+ type: "object",
3055
+ required: ["activity"],
3056
+ properties: {
3057
+ activity: arrayOf({ $ref: "#/components/schemas/ActivityEvent" })
3058
+ }
3059
+ }, "Activity archive")
3060
+ }
3061
+ }
3062
+ },
3063
+ "/api/v1/activity/{id}/remove": {
3064
+ post: {
3065
+ summary: "Hide an activity event from the visible archive through a correction record",
3066
+ responses: {
3067
+ "200": jsonResponse({
3068
+ type: "object",
3069
+ required: ["event"],
3070
+ properties: {
3071
+ event: { $ref: "#/components/schemas/ActivityEvent" }
3072
+ }
3073
+ }, "Correction event"),
3074
+ "404": { $ref: "#/components/responses/Error" }
3075
+ }
3076
+ }
3077
+ },
3078
+ "/api/v1/metrics": {
3079
+ get: {
3080
+ summary: "Get gamification metrics",
3081
+ responses: {
3082
+ "200": jsonResponse({
3083
+ type: "object",
3084
+ required: ["metrics"],
3085
+ properties: {
3086
+ metrics: {
3087
+ type: "object",
3088
+ additionalProperties: false,
3089
+ required: ["profile", "achievements", "milestoneRewards"],
3090
+ properties: {
3091
+ profile: { $ref: "#/components/schemas/GamificationProfile" },
3092
+ achievements: arrayOf({ $ref: "#/components/schemas/AchievementSignal" }),
3093
+ milestoneRewards: arrayOf({ $ref: "#/components/schemas/MilestoneReward" })
3094
+ }
3095
+ }
3096
+ }
3097
+ }, "Gamification metrics")
3098
+ }
3099
+ }
3100
+ },
3101
+ "/api/v1/metrics/xp": {
3102
+ get: {
3103
+ summary: "Get explainable XP metrics and reward-ledger state",
3104
+ responses: {
3105
+ "200": jsonResponse({
3106
+ type: "object",
3107
+ required: ["metrics"],
3108
+ properties: {
3109
+ metrics: { $ref: "#/components/schemas/XpMetricsPayload" }
3110
+ }
3111
+ }, "XP metrics payload")
3112
+ }
3113
+ }
3114
+ },
3115
+ "/api/v1/insights": {
3116
+ get: {
3117
+ summary: "Get deterministic coaching and stored insight feed",
3118
+ responses: {
3119
+ "200": jsonResponse({
3120
+ type: "object",
3121
+ required: ["insights"],
3122
+ properties: {
3123
+ insights: { $ref: "#/components/schemas/InsightsPayload" }
3124
+ }
3125
+ }, "Insights payload")
3126
+ }
3127
+ },
3128
+ post: {
3129
+ summary: "Store a structured insight",
3130
+ responses: {
3131
+ "201": jsonResponse({
3132
+ type: "object",
3133
+ required: ["insight"],
3134
+ properties: {
3135
+ insight: { $ref: "#/components/schemas/Insight" }
3136
+ }
3137
+ }, "Created insight")
3138
+ }
3139
+ }
3140
+ },
3141
+ "/api/v1/insights/{id}": {
3142
+ get: {
3143
+ summary: "Get one stored insight",
3144
+ responses: {
3145
+ "200": jsonResponse({
3146
+ type: "object",
3147
+ required: ["insight"],
3148
+ properties: {
3149
+ insight: { $ref: "#/components/schemas/Insight" }
3150
+ }
3151
+ }, "Insight")
3152
+ }
3153
+ },
3154
+ patch: {
3155
+ summary: "Update a stored insight",
3156
+ responses: {
3157
+ "200": jsonResponse({
3158
+ type: "object",
3159
+ required: ["insight"],
3160
+ properties: {
3161
+ insight: { $ref: "#/components/schemas/Insight" }
3162
+ }
3163
+ }, "Updated insight")
3164
+ }
3165
+ },
3166
+ delete: {
3167
+ summary: "Soft delete or permanently delete a stored insight",
3168
+ parameters: [
3169
+ { name: "mode", in: "query", schema: { type: "string", enum: ["soft", "hard"] } },
3170
+ { name: "reason", in: "query", schema: { type: "string" } }
3171
+ ],
3172
+ responses: {
3173
+ "200": jsonResponse({
3174
+ type: "object",
3175
+ required: ["insight"],
3176
+ properties: {
3177
+ insight: { $ref: "#/components/schemas/Insight" }
3178
+ }
3179
+ }, "Deleted insight"),
3180
+ "404": { $ref: "#/components/responses/Error" }
3181
+ }
3182
+ }
3183
+ },
3184
+ "/api/v1/insights/{id}/feedback": {
3185
+ post: {
3186
+ summary: "Record structured feedback for an insight",
3187
+ responses: {
3188
+ "200": jsonResponse({
3189
+ type: "object",
3190
+ required: ["feedback"],
3191
+ properties: {
3192
+ feedback: { $ref: "#/components/schemas/InsightFeedback" }
3193
+ }
3194
+ }, "Insight feedback")
3195
+ }
3196
+ }
3197
+ },
3198
+ "/api/v1/approval-requests": {
3199
+ get: {
3200
+ summary: "List approval requests",
3201
+ responses: {
3202
+ "200": jsonResponse({
3203
+ type: "object",
3204
+ required: ["approvalRequests"],
3205
+ properties: {
3206
+ approvalRequests: arrayOf({ $ref: "#/components/schemas/ApprovalRequest" })
3207
+ }
3208
+ }, "Approval requests")
3209
+ }
3210
+ }
3211
+ },
3212
+ "/api/v1/approval-requests/{id}/approve": {
3213
+ post: {
3214
+ summary: "Approve and execute a pending agent action",
3215
+ responses: {
3216
+ "200": jsonResponse({
3217
+ type: "object",
3218
+ required: ["approvalRequest"],
3219
+ properties: {
3220
+ approvalRequest: { $ref: "#/components/schemas/ApprovalRequest" }
3221
+ }
3222
+ }, "Approved request")
3223
+ }
3224
+ }
3225
+ },
3226
+ "/api/v1/approval-requests/{id}/reject": {
3227
+ post: {
3228
+ summary: "Reject a pending agent action",
3229
+ responses: {
3230
+ "200": jsonResponse({
3231
+ type: "object",
3232
+ required: ["approvalRequest"],
3233
+ properties: {
3234
+ approvalRequest: { $ref: "#/components/schemas/ApprovalRequest" }
3235
+ }
3236
+ }, "Rejected request")
3237
+ }
3238
+ }
3239
+ },
3240
+ "/api/v1/agents": {
3241
+ get: {
3242
+ summary: "List registered agent identities",
3243
+ responses: {
3244
+ "200": jsonResponse({
3245
+ type: "object",
3246
+ required: ["agents"],
3247
+ properties: {
3248
+ agents: arrayOf({ $ref: "#/components/schemas/AgentIdentity" })
3249
+ }
3250
+ }, "Agent identities")
3251
+ }
3252
+ }
3253
+ },
3254
+ "/api/v1/agents/onboarding": {
3255
+ get: {
3256
+ summary: "Get the live onboarding contract for new API agents",
3257
+ responses: {
3258
+ "200": jsonResponse({
3259
+ type: "object",
3260
+ required: ["onboarding"],
3261
+ properties: {
3262
+ onboarding: { $ref: "#/components/schemas/AgentOnboardingPayload" }
3263
+ }
3264
+ }, "Agent onboarding payload")
3265
+ }
3266
+ }
3267
+ },
3268
+ "/api/v1/agents/{id}/actions": {
3269
+ get: {
3270
+ summary: "List actions created by one agent",
3271
+ responses: {
3272
+ "200": jsonResponse({
3273
+ type: "object",
3274
+ required: ["actions"],
3275
+ properties: {
3276
+ actions: arrayOf({ $ref: "#/components/schemas/AgentAction" })
3277
+ }
3278
+ }, "Agent actions")
3279
+ }
3280
+ }
3281
+ },
3282
+ "/api/v1/agent-actions": {
3283
+ post: {
3284
+ summary: "Create an agent action that either executes directly or enters the approval queue",
3285
+ responses: {
3286
+ "201": jsonResponse({
3287
+ type: "object",
3288
+ required: ["action", "approvalRequest"],
3289
+ properties: {
3290
+ action: { $ref: "#/components/schemas/AgentAction" },
3291
+ approvalRequest: nullable({ $ref: "#/components/schemas/ApprovalRequest" })
3292
+ }
3293
+ }, "Executed agent action"),
3294
+ "202": jsonResponse({
3295
+ type: "object",
3296
+ required: ["action", "approvalRequest"],
3297
+ properties: {
3298
+ action: { $ref: "#/components/schemas/AgentAction" },
3299
+ approvalRequest: nullable({ $ref: "#/components/schemas/ApprovalRequest" })
3300
+ }
3301
+ }, "Pending approval agent action")
3302
+ }
3303
+ }
3304
+ },
3305
+ "/api/v1/rewards/rules": {
3306
+ get: {
3307
+ summary: "List reward rules",
3308
+ responses: {
3309
+ "200": jsonResponse({
3310
+ type: "object",
3311
+ required: ["rules"],
3312
+ properties: {
3313
+ rules: arrayOf({ $ref: "#/components/schemas/RewardRule" })
3314
+ }
3315
+ }, "Reward rules")
3316
+ }
3317
+ }
3318
+ },
3319
+ "/api/v1/rewards/rules/{id}": {
3320
+ get: {
3321
+ summary: "Get one reward rule",
3322
+ responses: {
3323
+ "200": jsonResponse({
3324
+ type: "object",
3325
+ required: ["rule"],
3326
+ properties: {
3327
+ rule: { $ref: "#/components/schemas/RewardRule" }
3328
+ }
3329
+ }, "Reward rule"),
3330
+ "404": { $ref: "#/components/responses/Error" }
3331
+ }
3332
+ },
3333
+ patch: {
3334
+ summary: "Update a reward rule",
3335
+ responses: {
3336
+ "200": jsonResponse({
3337
+ type: "object",
3338
+ required: ["rule"],
3339
+ properties: {
3340
+ rule: { $ref: "#/components/schemas/RewardRule" }
3341
+ }
3342
+ }, "Updated reward rule"),
3343
+ "404": { $ref: "#/components/responses/Error" }
3344
+ }
3345
+ }
3346
+ },
3347
+ "/api/v1/rewards/ledger": {
3348
+ get: {
3349
+ summary: "List reward ledger events",
3350
+ responses: {
3351
+ "200": jsonResponse({
3352
+ type: "object",
3353
+ required: ["ledger"],
3354
+ properties: {
3355
+ ledger: arrayOf({ $ref: "#/components/schemas/RewardLedgerEvent" })
3356
+ }
3357
+ }, "Reward ledger")
3358
+ }
3359
+ }
3360
+ },
3361
+ "/api/v1/rewards/bonus": {
3362
+ post: {
3363
+ summary: "Create a manual, explainable XP bonus entry",
3364
+ responses: {
3365
+ "201": jsonResponse({
3366
+ type: "object",
3367
+ required: ["reward", "metrics"],
3368
+ properties: {
3369
+ reward: { $ref: "#/components/schemas/RewardLedgerEvent" },
3370
+ metrics: { $ref: "#/components/schemas/XpMetricsPayload" }
3371
+ }
3372
+ }, "Manual reward bonus")
3373
+ }
3374
+ }
3375
+ },
3376
+ "/api/v1/events": {
3377
+ get: {
3378
+ summary: "List canonical event log entries",
3379
+ responses: {
3380
+ "200": jsonResponse({
3381
+ type: "object",
3382
+ required: ["events"],
3383
+ properties: {
3384
+ events: arrayOf({ $ref: "#/components/schemas/EventLogEntry" })
3385
+ }
3386
+ }, "Event log")
3387
+ }
3388
+ }
3389
+ },
3390
+ "/api/v1/session-events": {
3391
+ post: {
3392
+ summary: "Record bounded ambient engagement telemetry",
3393
+ responses: {
3394
+ "201": jsonResponse({
3395
+ type: "object",
3396
+ required: ["sessionEvent", "rewardEvent"],
3397
+ properties: {
3398
+ sessionEvent: { type: "object", additionalProperties: true },
3399
+ rewardEvent: nullable({ $ref: "#/components/schemas/RewardLedgerEvent" })
3400
+ }
3401
+ }, "Recorded session event")
3402
+ }
3403
+ }
3404
+ },
3405
+ "/api/v1/reviews/weekly": {
3406
+ get: {
3407
+ summary: "Get the weekly review payload",
3408
+ responses: {
3409
+ "200": jsonResponse({
3410
+ type: "object",
3411
+ required: ["review"],
3412
+ properties: {
3413
+ review: { $ref: "#/components/schemas/WeeklyReviewPayload" }
3414
+ }
3415
+ }, "Weekly review payload")
3416
+ }
3417
+ }
3418
+ },
3419
+ "/api/v1/settings": {
3420
+ get: {
3421
+ summary: "Get local operator settings",
3422
+ responses: {
3423
+ "200": jsonResponse({
3424
+ type: "object",
3425
+ required: ["settings"],
3426
+ properties: {
3427
+ settings: { $ref: "#/components/schemas/SettingsPayload" }
3428
+ }
3429
+ }, "Settings payload")
3430
+ }
3431
+ },
3432
+ patch: {
3433
+ summary: "Update local operator settings",
3434
+ requestBody: {
3435
+ required: true,
3436
+ content: {
3437
+ "application/json": {
3438
+ schema: { $ref: "#/components/schemas/SettingsUpdateInput" }
3439
+ }
3440
+ }
3441
+ },
3442
+ responses: {
3443
+ "200": jsonResponse({
3444
+ type: "object",
3445
+ required: ["settings"],
3446
+ properties: {
3447
+ settings: { $ref: "#/components/schemas/SettingsPayload" }
3448
+ }
3449
+ }, "Updated settings")
3450
+ }
3451
+ }
3452
+ },
3453
+ "/api/v1/settings/bin": {
3454
+ get: {
3455
+ summary: "Get the deleted-items bin with restore and hard-delete context",
3456
+ responses: {
3457
+ "200": jsonResponse({
3458
+ type: "object",
3459
+ required: ["bin"],
3460
+ properties: {
3461
+ bin: { $ref: "#/components/schemas/SettingsBinPayload" }
3462
+ }
3463
+ }, "Settings bin payload")
3464
+ }
3465
+ }
3466
+ },
3467
+ "/api/v1/entities/create": {
3468
+ post: {
3469
+ summary: "Create multiple Forge entities in one ordered batch request",
3470
+ responses: {
3471
+ "200": jsonResponse({
3472
+ type: "object",
3473
+ required: ["results"],
3474
+ properties: {
3475
+ results: arrayOf({ $ref: "#/components/schemas/BatchEntityResult" })
3476
+ }
3477
+ }, "Batch create results")
3478
+ }
3479
+ }
3480
+ },
3481
+ "/api/v1/entities/update": {
3482
+ post: {
3483
+ summary: "Update multiple Forge entities in one ordered batch request",
3484
+ responses: {
3485
+ "200": jsonResponse({
3486
+ type: "object",
3487
+ required: ["results"],
3488
+ properties: {
3489
+ results: arrayOf({ $ref: "#/components/schemas/BatchEntityResult" })
3490
+ }
3491
+ }, "Batch update results")
3492
+ }
3493
+ }
3494
+ },
3495
+ "/api/v1/entities/delete": {
3496
+ post: {
3497
+ summary: "Delete multiple Forge entities in one ordered batch request. Soft delete is the default.",
3498
+ responses: {
3499
+ "200": jsonResponse({
3500
+ type: "object",
3501
+ required: ["results"],
3502
+ properties: {
3503
+ results: arrayOf({ $ref: "#/components/schemas/BatchEntityResult" })
3504
+ }
3505
+ }, "Batch delete results")
3506
+ }
3507
+ }
3508
+ },
3509
+ "/api/v1/entities/restore": {
3510
+ post: {
3511
+ summary: "Restore multiple soft-deleted Forge entities in one ordered batch request",
3512
+ responses: {
3513
+ "200": jsonResponse({
3514
+ type: "object",
3515
+ required: ["results"],
3516
+ properties: {
3517
+ results: arrayOf({ $ref: "#/components/schemas/BatchEntityResult" })
3518
+ }
3519
+ }, "Batch restore results")
3520
+ }
3521
+ }
3522
+ },
3523
+ "/api/v1/entities/search": {
3524
+ post: {
3525
+ summary: "Search across multiple Forge entity types in one ordered batch request",
3526
+ responses: {
3527
+ "200": jsonResponse({
3528
+ type: "object",
3529
+ required: ["results"],
3530
+ properties: {
3531
+ results: arrayOf({ $ref: "#/components/schemas/BatchEntityResult" })
3532
+ }
3533
+ }, "Batch search results")
3534
+ }
3535
+ }
3536
+ },
3537
+ "/api/v1/settings/tokens": {
3538
+ post: {
3539
+ summary: "Create an agent token",
3540
+ responses: {
3541
+ "201": jsonResponse({
3542
+ type: "object",
3543
+ required: ["token"],
3544
+ properties: {
3545
+ token: { $ref: "#/components/schemas/AgentTokenMutationResult" }
3546
+ }
3547
+ }, "Created agent token")
3548
+ }
3549
+ }
3550
+ }
3551
+ }
3552
+ };
3553
+ }