forge-openclaw-plugin 0.2.4 → 0.2.7

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