@useorgx/openclaw-plugin 0.4.9 → 0.7.2

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 (224) hide show
  1. package/README.md +77 -11
  2. package/dashboard/dist/assets/6mILZQ2a.js +1 -0
  3. package/dashboard/dist/assets/6mILZQ2a.js.br +0 -0
  4. package/dashboard/dist/assets/6mILZQ2a.js.gz +0 -0
  5. package/dashboard/dist/assets/8dksYiq4.js +2 -0
  6. package/dashboard/dist/assets/8dksYiq4.js.br +0 -0
  7. package/dashboard/dist/assets/8dksYiq4.js.gz +0 -0
  8. package/dashboard/dist/assets/B5zYRHc3.js +1 -0
  9. package/dashboard/dist/assets/B5zYRHc3.js.br +0 -0
  10. package/dashboard/dist/assets/B5zYRHc3.js.gz +0 -0
  11. package/dashboard/dist/assets/B6wPWJ35.js +1 -0
  12. package/dashboard/dist/assets/B6wPWJ35.js.br +0 -0
  13. package/dashboard/dist/assets/B6wPWJ35.js.gz +0 -0
  14. package/dashboard/dist/assets/BJgZIVUQ.js +53 -0
  15. package/dashboard/dist/assets/BJgZIVUQ.js.br +0 -0
  16. package/dashboard/dist/assets/BJgZIVUQ.js.gz +0 -0
  17. package/dashboard/dist/assets/BWEwjt1W.js +1 -0
  18. package/dashboard/dist/assets/BWEwjt1W.js.br +0 -0
  19. package/dashboard/dist/assets/BWEwjt1W.js.gz +0 -0
  20. package/dashboard/dist/assets/BgOYB78t.js +4 -0
  21. package/dashboard/dist/assets/BgOYB78t.js.br +0 -0
  22. package/dashboard/dist/assets/BgOYB78t.js.gz +0 -0
  23. package/dashboard/dist/assets/BzRbDCAD.css +1 -0
  24. package/dashboard/dist/assets/BzRbDCAD.css.br +0 -0
  25. package/dashboard/dist/assets/BzRbDCAD.css.gz +0 -0
  26. package/dashboard/dist/assets/C-KIc3Wc.js.br +0 -0
  27. package/dashboard/dist/assets/C-KIc3Wc.js.gz +0 -0
  28. package/dashboard/dist/assets/C8uM3AX8.js +1 -0
  29. package/dashboard/dist/assets/C8uM3AX8.js.br +0 -0
  30. package/dashboard/dist/assets/C8uM3AX8.js.gz +0 -0
  31. package/dashboard/dist/assets/C9jy61eu.js +212 -0
  32. package/dashboard/dist/assets/C9jy61eu.js.br +0 -0
  33. package/dashboard/dist/assets/C9jy61eu.js.gz +0 -0
  34. package/dashboard/dist/assets/CC63EwFD.js +1 -0
  35. package/dashboard/dist/assets/CC63EwFD.js.br +0 -0
  36. package/dashboard/dist/assets/CC63EwFD.js.gz +0 -0
  37. package/dashboard/dist/assets/CL_wXqR7.js +1 -0
  38. package/dashboard/dist/assets/CL_wXqR7.js.br +0 -0
  39. package/dashboard/dist/assets/CL_wXqR7.js.gz +0 -0
  40. package/dashboard/dist/assets/CZaT3ob_.js +1 -0
  41. package/dashboard/dist/assets/CZaT3ob_.js.br +0 -0
  42. package/dashboard/dist/assets/CZaT3ob_.js.gz +0 -0
  43. package/dashboard/dist/assets/CgaottFX.js +1 -0
  44. package/dashboard/dist/assets/CgaottFX.js.br +0 -0
  45. package/dashboard/dist/assets/CgaottFX.js.gz +0 -0
  46. package/dashboard/dist/assets/{CpJsfbXo.js → CxQ08qFN.js} +2 -2
  47. package/dashboard/dist/assets/CxQ08qFN.js.br +0 -0
  48. package/dashboard/dist/assets/CxQ08qFN.js.gz +0 -0
  49. package/dashboard/dist/assets/CzCxAZlW.js +1 -0
  50. package/dashboard/dist/assets/CzCxAZlW.js.br +0 -0
  51. package/dashboard/dist/assets/CzCxAZlW.js.gz +0 -0
  52. package/dashboard/dist/assets/D3iMTYEj.js +1 -0
  53. package/dashboard/dist/assets/D3iMTYEj.js.br +0 -0
  54. package/dashboard/dist/assets/D3iMTYEj.js.gz +0 -0
  55. package/dashboard/dist/assets/D8JNX8kq.js +2 -0
  56. package/dashboard/dist/assets/D8JNX8kq.js.br +0 -0
  57. package/dashboard/dist/assets/D8JNX8kq.js.gz +0 -0
  58. package/dashboard/dist/assets/DnA8dpj6.js +1 -0
  59. package/dashboard/dist/assets/DnA8dpj6.js.br +0 -0
  60. package/dashboard/dist/assets/DnA8dpj6.js.gz +0 -0
  61. package/dashboard/dist/assets/IUexzymk.js +1 -0
  62. package/dashboard/dist/assets/IUexzymk.js.br +0 -0
  63. package/dashboard/dist/assets/IUexzymk.js.gz +0 -0
  64. package/dashboard/dist/assets/cNrhgGc1.js +8 -0
  65. package/dashboard/dist/assets/cNrhgGc1.js.br +0 -0
  66. package/dashboard/dist/assets/cNrhgGc1.js.gz +0 -0
  67. package/dashboard/dist/assets/ic2FaMnh.js +1 -0
  68. package/dashboard/dist/assets/ic2FaMnh.js.br +0 -0
  69. package/dashboard/dist/assets/ic2FaMnh.js.gz +0 -0
  70. package/dashboard/dist/assets/qm8xLgv-.css +1 -0
  71. package/dashboard/dist/assets/qm8xLgv-.css.br +0 -0
  72. package/dashboard/dist/assets/qm8xLgv-.css.gz +0 -0
  73. package/dashboard/dist/assets/rttbDbEx.js +1 -0
  74. package/dashboard/dist/assets/rttbDbEx.js.br +0 -0
  75. package/dashboard/dist/assets/rttbDbEx.js.gz +0 -0
  76. package/dashboard/dist/brand/anthropic-mark.svg.br +0 -0
  77. package/dashboard/dist/brand/anthropic-mark.svg.gz +0 -0
  78. package/dashboard/dist/brand/openai-mark.svg.br +0 -0
  79. package/dashboard/dist/brand/openai-mark.svg.gz +0 -0
  80. package/dashboard/dist/brand/openclaw-mark.svg.br +0 -0
  81. package/dashboard/dist/brand/openclaw-mark.svg.gz +0 -0
  82. package/dashboard/dist/brand/xandy-orchestrator.png +0 -0
  83. package/dashboard/dist/index.html +7 -5
  84. package/dashboard/dist/index.html.br +0 -0
  85. package/dashboard/dist/index.html.gz +0 -0
  86. package/dist/activity-actor-fields.js +26 -4
  87. package/dist/activity-store.js +34 -8
  88. package/dist/agent-context-store.js +79 -17
  89. package/dist/agent-run-store.js +44 -3
  90. package/dist/agent-suite.d.ts +9 -0
  91. package/dist/agent-suite.js +149 -9
  92. package/dist/artifacts/artifact-domain-schemas.d.ts +66 -0
  93. package/dist/artifacts/artifact-domain-schemas.js +357 -0
  94. package/dist/artifacts/register-artifact.d.ts +4 -3
  95. package/dist/artifacts/register-artifact.js +170 -57
  96. package/dist/chat-store.d.ts +157 -0
  97. package/dist/chat-store.js +586 -0
  98. package/dist/cli/orgx.js +11 -0
  99. package/dist/contracts/client.d.ts +43 -3
  100. package/dist/contracts/client.js +159 -30
  101. package/dist/contracts/practice-exercise-schema.d.ts +216 -0
  102. package/dist/contracts/practice-exercise-schema.js +314 -0
  103. package/dist/contracts/retro-schema.d.ts +81 -0
  104. package/dist/contracts/retro-schema.js +80 -0
  105. package/dist/contracts/shared-types.d.ts +159 -0
  106. package/dist/contracts/shared-types.js +199 -1
  107. package/dist/contracts/skill-pack-schema.d.ts +192 -0
  108. package/dist/contracts/skill-pack-schema.js +180 -0
  109. package/dist/contracts/types.d.ts +247 -2
  110. package/dist/entities/auto-assignment.js +43 -17
  111. package/dist/event-sanitization.d.ts +11 -0
  112. package/dist/event-sanitization.js +113 -0
  113. package/dist/gateway-watchdog.d.ts +5 -0
  114. package/dist/gateway-watchdog.js +50 -0
  115. package/dist/hooks/post-reporting-event.mjs +1 -5
  116. package/dist/http/helpers/activity-headline.js +13 -132
  117. package/dist/http/helpers/auto-continue-engine.d.ts +198 -10
  118. package/dist/http/helpers/auto-continue-engine.js +3145 -186
  119. package/dist/http/helpers/autopilot-operations.d.ts +19 -0
  120. package/dist/http/helpers/autopilot-operations.js +182 -31
  121. package/dist/http/helpers/autopilot-runtime.d.ts +1 -0
  122. package/dist/http/helpers/autopilot-runtime.js +328 -25
  123. package/dist/http/helpers/autopilot-slice-utils.d.ts +18 -0
  124. package/dist/http/helpers/autopilot-slice-utils.js +514 -93
  125. package/dist/http/helpers/decision-mapper.d.ts +40 -0
  126. package/dist/http/helpers/decision-mapper.js +223 -7
  127. package/dist/http/helpers/dispatch-lifecycle.d.ts +19 -2
  128. package/dist/http/helpers/dispatch-lifecycle.js +242 -37
  129. package/dist/http/helpers/kickoff-context.js +104 -0
  130. package/dist/http/helpers/llm-client.d.ts +47 -0
  131. package/dist/http/helpers/llm-client.js +256 -0
  132. package/dist/http/helpers/mission-control.d.ts +102 -3
  133. package/dist/http/helpers/mission-control.js +498 -9
  134. package/dist/http/helpers/sentinel-catalog.d.ts +23 -0
  135. package/dist/http/helpers/sentinel-catalog.js +193 -0
  136. package/dist/http/helpers/session-classification.d.ts +9 -0
  137. package/dist/http/helpers/session-classification.js +564 -0
  138. package/dist/http/helpers/slice-experience-v2.d.ts +137 -0
  139. package/dist/http/helpers/slice-experience-v2.js +677 -0
  140. package/dist/http/helpers/slice-run-projections.d.ts +72 -0
  141. package/dist/http/helpers/slice-run-projections.js +877 -0
  142. package/dist/http/helpers/triage-mapper.d.ts +43 -0
  143. package/dist/http/helpers/triage-mapper.js +549 -0
  144. package/dist/http/helpers/value-utils.js +7 -2
  145. package/dist/http/helpers/workspace-scope.d.ts +15 -0
  146. package/dist/http/helpers/workspace-scope.js +170 -0
  147. package/dist/http/index.js +1420 -105
  148. package/dist/http/routes/agent-suite.d.ts +9 -0
  149. package/dist/http/routes/agent-suite.js +294 -8
  150. package/dist/http/routes/agents-catalog.js +64 -19
  151. package/dist/http/routes/chat.d.ts +19 -0
  152. package/dist/http/routes/chat.js +522 -0
  153. package/dist/http/routes/decision-actions.d.ts +8 -1
  154. package/dist/http/routes/decision-actions.js +42 -5
  155. package/dist/http/routes/dispatch-gateway-envelope.d.ts +25 -0
  156. package/dist/http/routes/dispatch-gateway-envelope.js +26 -0
  157. package/dist/http/routes/entities.d.ts +16 -0
  158. package/dist/http/routes/entities.js +232 -6
  159. package/dist/http/routes/live-legacy.d.ts +5 -0
  160. package/dist/http/routes/live-legacy.js +23 -509
  161. package/dist/http/routes/live-misc.d.ts +12 -0
  162. package/dist/http/routes/live-misc.js +251 -31
  163. package/dist/http/routes/live-snapshot.d.ts +49 -2
  164. package/dist/http/routes/live-snapshot.js +653 -23
  165. package/dist/http/routes/live-terminal.d.ts +11 -0
  166. package/dist/http/routes/live-terminal.js +154 -0
  167. package/dist/http/routes/live-triage.d.ts +61 -0
  168. package/dist/http/routes/live-triage.js +192 -0
  169. package/dist/http/routes/mission-control-actions.d.ts +49 -1
  170. package/dist/http/routes/mission-control-actions.js +1246 -84
  171. package/dist/http/routes/mission-control-read.d.ts +48 -3
  172. package/dist/http/routes/mission-control-read.js +1658 -20
  173. package/dist/http/routes/realtime-orchestrator.d.ts +10 -0
  174. package/dist/http/routes/realtime-orchestrator.js +74 -0
  175. package/dist/http/routes/run-control.d.ts +5 -2
  176. package/dist/http/routes/run-control.js +10 -0
  177. package/dist/http/routes/sentinels-catalog.d.ts +7 -0
  178. package/dist/http/routes/sentinels-catalog.js +24 -0
  179. package/dist/http/routes/summary.js +10 -3
  180. package/dist/http/routes/usage.d.ts +24 -0
  181. package/dist/http/routes/usage.js +362 -0
  182. package/dist/http/routes/work-artifacts.js +28 -9
  183. package/dist/index.js +165 -27
  184. package/dist/local-openclaw.js +29 -6
  185. package/dist/mcp-client-setup.js +3 -3
  186. package/dist/mcp-http-handler.d.ts +3 -0
  187. package/dist/mcp-http-handler.js +34 -60
  188. package/dist/next-up-queue-store.d.ts +16 -1
  189. package/dist/next-up-queue-store.js +89 -7
  190. package/dist/outbox.d.ts +5 -0
  191. package/dist/outbox.js +113 -9
  192. package/dist/paths.js +36 -5
  193. package/dist/reporting/rollups.d.ts +41 -0
  194. package/dist/reporting/rollups.js +113 -0
  195. package/dist/retro/domain-templates.d.ts +45 -0
  196. package/dist/retro/domain-templates.js +297 -0
  197. package/dist/retro/quality-rubric.d.ts +33 -0
  198. package/dist/retro/quality-rubric.js +213 -0
  199. package/dist/runtime-cleanup.d.ts +18 -0
  200. package/dist/runtime-cleanup.js +87 -0
  201. package/dist/services/background.d.ts +11 -0
  202. package/dist/services/background.js +22 -0
  203. package/dist/services/experiment-randomization.d.ts +21 -0
  204. package/dist/services/experiment-randomization.js +63 -0
  205. package/dist/skill-pack-state.d.ts +36 -5
  206. package/dist/skill-pack-state.js +273 -29
  207. package/dist/sync/local-agent-telemetry.d.ts +13 -0
  208. package/dist/sync/local-agent-telemetry.js +128 -0
  209. package/dist/sync/outbox-replay.js +131 -24
  210. package/dist/team-context-store.d.ts +23 -0
  211. package/dist/team-context-store.js +116 -0
  212. package/dist/telemetry/posthog.js +4 -2
  213. package/dist/tools/core-tools.d.ts +10 -14
  214. package/dist/tools/core-tools.js +1289 -24
  215. package/dist/types.d.ts +2 -0
  216. package/dist/types.js +2 -0
  217. package/dist/worker-supervisor.js +23 -0
  218. package/package.json +20 -6
  219. package/dashboard/dist/assets/B3ziCA02.js +0 -8
  220. package/dashboard/dist/assets/B5NEElEI.css +0 -1
  221. package/dashboard/dist/assets/BhapSNAs.js +0 -215
  222. package/dashboard/dist/assets/iFdvE7lx.js +0 -1
  223. package/dashboard/dist/assets/jRJsmpYM.js +0 -1
  224. package/dashboard/dist/assets/sAhvFnpk.js +0 -4
@@ -0,0 +1,314 @@
1
+ export const PRACTICE_EXERCISE_TEMPLATE_SCHEMA_VERSION = "practice-exercise-template.v1";
2
+ function isRecord(value) {
3
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
4
+ }
5
+ function readString(source, key, errors, opts = {}) {
6
+ const { required = true } = opts;
7
+ const value = source[key];
8
+ if (typeof value !== "string") {
9
+ if (required)
10
+ errors.push(`${key} must be a string`);
11
+ return "";
12
+ }
13
+ const normalized = value.trim();
14
+ if (!normalized && required) {
15
+ errors.push(`${key} must not be empty`);
16
+ }
17
+ return normalized;
18
+ }
19
+ function readStringArray(source, key, errors, opts = {}) {
20
+ const { required = true, minItems = 0 } = opts;
21
+ const value = source[key];
22
+ if (!Array.isArray(value)) {
23
+ if (required)
24
+ errors.push(`${key} must be an array`);
25
+ return [];
26
+ }
27
+ const output = [];
28
+ value.forEach((entry, index) => {
29
+ if (typeof entry !== "string" || !entry.trim()) {
30
+ errors.push(`${key}[${index}] must be a non-empty string`);
31
+ return;
32
+ }
33
+ output.push(entry.trim());
34
+ });
35
+ if (output.length < minItems) {
36
+ errors.push(`${key} must include at least ${minItems} item(s)`);
37
+ }
38
+ return output;
39
+ }
40
+ const TASK_TYPE_SET = new Set([
41
+ "analysis",
42
+ "implementation",
43
+ "review",
44
+ "debugging",
45
+ "planning",
46
+ ]);
47
+ const CONSTRAINT_SEVERITY_SET = new Set(["hard", "soft"]);
48
+ const OUTPUT_FORMAT_SET = new Set(["json_object", "markdown", "text"]);
49
+ function parseScenario(raw, index, errors) {
50
+ if (!isRecord(raw)) {
51
+ errors.push(`scenarios[${index}] must be an object`);
52
+ return null;
53
+ }
54
+ const id = readString(raw, "id", errors);
55
+ const title = readString(raw, "title", errors);
56
+ const input = raw.input;
57
+ if (!isRecord(input)) {
58
+ errors.push(`scenarios[${index}].input must be an object`);
59
+ }
60
+ const contextRaw = raw.context;
61
+ const context = typeof contextRaw === "string" && contextRaw.trim() ? contextRaw.trim() : undefined;
62
+ const successCriteria = readStringArray(raw, "success_criteria", errors, {
63
+ minItems: 1,
64
+ });
65
+ if (!isRecord(input))
66
+ return null;
67
+ return {
68
+ id,
69
+ title,
70
+ input,
71
+ context,
72
+ success_criteria: successCriteria,
73
+ };
74
+ }
75
+ function parseConstraint(raw, index, errors) {
76
+ if (!isRecord(raw)) {
77
+ errors.push(`constraints[${index}] must be an object`);
78
+ return null;
79
+ }
80
+ const id = readString(raw, "id", errors);
81
+ const title = readString(raw, "title", errors);
82
+ const description = readString(raw, "description", errors);
83
+ const severityRaw = readString(raw, "severity", errors);
84
+ if (!CONSTRAINT_SEVERITY_SET.has(severityRaw)) {
85
+ errors.push(`constraints[${index}].severity must be one of: hard, soft`);
86
+ }
87
+ const rationaleRaw = raw.rationale;
88
+ const rationale = typeof rationaleRaw === "string" && rationaleRaw.trim() ? rationaleRaw.trim() : undefined;
89
+ return {
90
+ id,
91
+ title,
92
+ description,
93
+ severity: severityRaw,
94
+ rationale,
95
+ };
96
+ }
97
+ function parseExpectedOutputShape(raw, errors) {
98
+ if (!isRecord(raw)) {
99
+ errors.push("expected_output_shape must be an object");
100
+ return null;
101
+ }
102
+ const format = readString(raw, "format", errors);
103
+ if (!OUTPUT_FORMAT_SET.has(format)) {
104
+ errors.push("expected_output_shape.format must be one of: json_object, markdown, text");
105
+ }
106
+ const fieldsRaw = raw.fields;
107
+ if (!Array.isArray(fieldsRaw)) {
108
+ errors.push("expected_output_shape.fields must be an array");
109
+ return null;
110
+ }
111
+ const fields = [];
112
+ fieldsRaw.forEach((entry, index) => {
113
+ if (!isRecord(entry)) {
114
+ errors.push(`expected_output_shape.fields[${index}] must be an object`);
115
+ return;
116
+ }
117
+ const path = readString(entry, "path", errors);
118
+ const type = readString(entry, "type", errors);
119
+ const required = entry.required;
120
+ if (typeof required !== "boolean") {
121
+ errors.push(`expected_output_shape.fields[${index}].required must be boolean`);
122
+ return;
123
+ }
124
+ const description = readString(entry, "description", errors);
125
+ fields.push({ path, type, required, description });
126
+ });
127
+ if (fields.length === 0) {
128
+ errors.push("expected_output_shape.fields must include at least 1 field");
129
+ }
130
+ const exampleRaw = raw.example;
131
+ const example = typeof exampleRaw === "string"
132
+ ? exampleRaw
133
+ : isRecord(exampleRaw)
134
+ ? exampleRaw
135
+ : undefined;
136
+ if (typeof exampleRaw !== "undefined" &&
137
+ typeof exampleRaw !== "string" &&
138
+ !isRecord(exampleRaw)) {
139
+ errors.push("expected_output_shape.example must be a string or object");
140
+ }
141
+ return {
142
+ format: format,
143
+ fields,
144
+ example,
145
+ };
146
+ }
147
+ export function validatePracticeExerciseTemplate(input) {
148
+ if (!isRecord(input)) {
149
+ return {
150
+ ok: false,
151
+ errors: ["template must be an object"],
152
+ template: null,
153
+ };
154
+ }
155
+ const errors = [];
156
+ const schemaVersion = readString(input, "schema_version", errors);
157
+ if (schemaVersion !== PRACTICE_EXERCISE_TEMPLATE_SCHEMA_VERSION) {
158
+ errors.push(`schema_version must equal "${PRACTICE_EXERCISE_TEMPLATE_SCHEMA_VERSION}"`);
159
+ }
160
+ const id = readString(input, "id", errors);
161
+ const title = readString(input, "title", errors);
162
+ const summary = readString(input, "summary", errors);
163
+ const taskType = readString(input, "task_type", errors);
164
+ if (!TASK_TYPE_SET.has(taskType)) {
165
+ errors.push("task_type must be one of: analysis, implementation, review, debugging, planning");
166
+ }
167
+ const scenariosRaw = input.scenarios;
168
+ const scenarios = [];
169
+ if (!Array.isArray(scenariosRaw)) {
170
+ errors.push("scenarios must be an array");
171
+ }
172
+ else {
173
+ scenariosRaw.forEach((entry, index) => {
174
+ const parsed = parseScenario(entry, index, errors);
175
+ if (parsed)
176
+ scenarios.push(parsed);
177
+ });
178
+ }
179
+ if (scenarios.length === 0) {
180
+ errors.push("scenarios must include at least 1 scenario");
181
+ }
182
+ const constraintsRaw = input.constraints;
183
+ const constraints = [];
184
+ if (!Array.isArray(constraintsRaw)) {
185
+ errors.push("constraints must be an array");
186
+ }
187
+ else {
188
+ constraintsRaw.forEach((entry, index) => {
189
+ const parsed = parseConstraint(entry, index, errors);
190
+ if (parsed)
191
+ constraints.push(parsed);
192
+ });
193
+ }
194
+ const expectedOutputShape = parseExpectedOutputShape(input.expected_output_shape, errors);
195
+ const tags = readStringArray(input, "tags", errors, { required: false });
196
+ const template = errors.length === 0 && expectedOutputShape
197
+ ? {
198
+ schema_version: PRACTICE_EXERCISE_TEMPLATE_SCHEMA_VERSION,
199
+ id,
200
+ title,
201
+ summary,
202
+ task_type: taskType,
203
+ scenarios,
204
+ constraints,
205
+ expected_output_shape: expectedOutputShape,
206
+ tags: tags.length > 0 ? tags : undefined,
207
+ }
208
+ : null;
209
+ return { ok: errors.length === 0, errors, template };
210
+ }
211
+ export const PRACTICE_EXERCISE_TEMPLATE_JSON_SCHEMA = {
212
+ $schema: "https://json-schema.org/draft/2020-12/schema",
213
+ $id: "https://schemas.useorgx.com/practice-exercise-template/v1.json",
214
+ title: "OrgX Practice Exercise Template v1",
215
+ description: "Structured exercise template for practice loops with scenarios, constraints, and expected output shape.",
216
+ type: "object",
217
+ additionalProperties: false,
218
+ required: [
219
+ "schema_version",
220
+ "id",
221
+ "title",
222
+ "summary",
223
+ "task_type",
224
+ "scenarios",
225
+ "constraints",
226
+ "expected_output_shape",
227
+ ],
228
+ properties: {
229
+ schema_version: {
230
+ type: "string",
231
+ const: PRACTICE_EXERCISE_TEMPLATE_SCHEMA_VERSION,
232
+ },
233
+ id: { type: "string", minLength: 1, maxLength: 120 },
234
+ title: { type: "string", minLength: 1, maxLength: 300 },
235
+ summary: { type: "string", minLength: 1, maxLength: 3000 },
236
+ task_type: {
237
+ type: "string",
238
+ enum: ["analysis", "implementation", "review", "debugging", "planning"],
239
+ },
240
+ scenarios: {
241
+ type: "array",
242
+ minItems: 1,
243
+ maxItems: 25,
244
+ items: {
245
+ type: "object",
246
+ additionalProperties: false,
247
+ required: ["id", "title", "input", "success_criteria"],
248
+ properties: {
249
+ id: { type: "string", minLength: 1, maxLength: 120 },
250
+ title: { type: "string", minLength: 1, maxLength: 300 },
251
+ input: { type: "object", additionalProperties: true },
252
+ context: { type: "string", minLength: 1, maxLength: 4000 },
253
+ success_criteria: {
254
+ type: "array",
255
+ minItems: 1,
256
+ maxItems: 20,
257
+ items: { type: "string", minLength: 1, maxLength: 1000 },
258
+ },
259
+ },
260
+ },
261
+ },
262
+ constraints: {
263
+ type: "array",
264
+ maxItems: 25,
265
+ items: {
266
+ type: "object",
267
+ additionalProperties: false,
268
+ required: ["id", "title", "description", "severity"],
269
+ properties: {
270
+ id: { type: "string", minLength: 1, maxLength: 120 },
271
+ title: { type: "string", minLength: 1, maxLength: 300 },
272
+ description: { type: "string", minLength: 1, maxLength: 2000 },
273
+ severity: { type: "string", enum: ["hard", "soft"] },
274
+ rationale: { type: "string", minLength: 1, maxLength: 2000 },
275
+ },
276
+ },
277
+ },
278
+ expected_output_shape: {
279
+ type: "object",
280
+ additionalProperties: false,
281
+ required: ["format", "fields"],
282
+ properties: {
283
+ format: { type: "string", enum: ["json_object", "markdown", "text"] },
284
+ fields: {
285
+ type: "array",
286
+ minItems: 1,
287
+ maxItems: 50,
288
+ items: {
289
+ type: "object",
290
+ additionalProperties: false,
291
+ required: ["path", "type", "required", "description"],
292
+ properties: {
293
+ path: { type: "string", minLength: 1, maxLength: 400 },
294
+ type: { type: "string", minLength: 1, maxLength: 120 },
295
+ required: { type: "boolean" },
296
+ description: { type: "string", minLength: 1, maxLength: 2000 },
297
+ },
298
+ },
299
+ },
300
+ example: {
301
+ oneOf: [
302
+ { type: "string", minLength: 1, maxLength: 20000 },
303
+ { type: "object", additionalProperties: true },
304
+ ],
305
+ },
306
+ },
307
+ },
308
+ tags: {
309
+ type: "array",
310
+ maxItems: 30,
311
+ items: { type: "string", minLength: 1, maxLength: 80 },
312
+ },
313
+ },
314
+ };
@@ -0,0 +1,81 @@
1
+ export declare const RETRO_ARTIFACT_SCHEMA_VERSION: "retro.v1";
2
+ export type RetroArtifactSchemaVersion = typeof RETRO_ARTIFACT_SCHEMA_VERSION;
3
+ export declare const RETRO_ARTIFACT_JSON_SCHEMA: {
4
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
5
+ readonly $id: "https://schemas.useorgx.com/retro-artifact/v1.json";
6
+ readonly title: "OrgX Run Retro Artifact v1";
7
+ readonly description: "Structured post-run retrospective artifact emitted by OpenClaw/OrgX execution paths.";
8
+ readonly type: "object";
9
+ readonly additionalProperties: false;
10
+ readonly required: readonly ["schema_version", "summary"];
11
+ readonly properties: {
12
+ readonly schema_version: {
13
+ readonly type: "string";
14
+ readonly const: "retro.v1";
15
+ readonly description: "Version marker for safe schema evolution.";
16
+ };
17
+ readonly summary: {
18
+ readonly type: "string";
19
+ readonly minLength: 1;
20
+ readonly maxLength: 4000;
21
+ readonly description: "Required high-level run retrospective summary.";
22
+ };
23
+ readonly what_went_well: {
24
+ readonly type: "array";
25
+ readonly maxItems: 25;
26
+ readonly items: {
27
+ readonly type: "string";
28
+ readonly minLength: 1;
29
+ readonly maxLength: 1000;
30
+ };
31
+ };
32
+ readonly what_went_wrong: {
33
+ readonly type: "array";
34
+ readonly maxItems: 25;
35
+ readonly items: {
36
+ readonly type: "string";
37
+ readonly minLength: 1;
38
+ readonly maxLength: 1000;
39
+ };
40
+ };
41
+ readonly decisions: {
42
+ readonly type: "array";
43
+ readonly maxItems: 25;
44
+ readonly items: {
45
+ readonly type: "string";
46
+ readonly minLength: 1;
47
+ readonly maxLength: 1000;
48
+ };
49
+ };
50
+ readonly follow_ups: {
51
+ readonly type: "array";
52
+ readonly maxItems: 25;
53
+ readonly items: {
54
+ readonly type: "object";
55
+ readonly additionalProperties: false;
56
+ readonly required: readonly ["title"];
57
+ readonly properties: {
58
+ readonly title: {
59
+ readonly type: "string";
60
+ readonly minLength: 1;
61
+ readonly maxLength: 500;
62
+ };
63
+ readonly priority: {
64
+ readonly type: "string";
65
+ readonly enum: readonly ["p0", "p1", "p2"];
66
+ };
67
+ readonly reason: {
68
+ readonly type: "string";
69
+ readonly minLength: 1;
70
+ readonly maxLength: 2000;
71
+ };
72
+ };
73
+ };
74
+ };
75
+ readonly signals: {
76
+ readonly type: "object";
77
+ readonly additionalProperties: true;
78
+ readonly description: "Telemetry-style structured metadata for analytics and drill-down.";
79
+ };
80
+ };
81
+ };
@@ -0,0 +1,80 @@
1
+ export const RETRO_ARTIFACT_SCHEMA_VERSION = 'retro.v1';
2
+ export const RETRO_ARTIFACT_JSON_SCHEMA = {
3
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
4
+ $id: 'https://schemas.useorgx.com/retro-artifact/v1.json',
5
+ title: 'OrgX Run Retro Artifact v1',
6
+ description: 'Structured post-run retrospective artifact emitted by OpenClaw/OrgX execution paths.',
7
+ type: 'object',
8
+ additionalProperties: false,
9
+ required: ['schema_version', 'summary'],
10
+ properties: {
11
+ schema_version: {
12
+ type: 'string',
13
+ const: RETRO_ARTIFACT_SCHEMA_VERSION,
14
+ description: 'Version marker for safe schema evolution.',
15
+ },
16
+ summary: {
17
+ type: 'string',
18
+ minLength: 1,
19
+ maxLength: 4000,
20
+ description: 'Required high-level run retrospective summary.',
21
+ },
22
+ what_went_well: {
23
+ type: 'array',
24
+ maxItems: 25,
25
+ items: {
26
+ type: 'string',
27
+ minLength: 1,
28
+ maxLength: 1000,
29
+ },
30
+ },
31
+ what_went_wrong: {
32
+ type: 'array',
33
+ maxItems: 25,
34
+ items: {
35
+ type: 'string',
36
+ minLength: 1,
37
+ maxLength: 1000,
38
+ },
39
+ },
40
+ decisions: {
41
+ type: 'array',
42
+ maxItems: 25,
43
+ items: {
44
+ type: 'string',
45
+ minLength: 1,
46
+ maxLength: 1000,
47
+ },
48
+ },
49
+ follow_ups: {
50
+ type: 'array',
51
+ maxItems: 25,
52
+ items: {
53
+ type: 'object',
54
+ additionalProperties: false,
55
+ required: ['title'],
56
+ properties: {
57
+ title: {
58
+ type: 'string',
59
+ minLength: 1,
60
+ maxLength: 500,
61
+ },
62
+ priority: {
63
+ type: 'string',
64
+ enum: ['p0', 'p1', 'p2'],
65
+ },
66
+ reason: {
67
+ type: 'string',
68
+ minLength: 1,
69
+ maxLength: 2000,
70
+ },
71
+ },
72
+ },
73
+ },
74
+ signals: {
75
+ type: 'object',
76
+ additionalProperties: true,
77
+ description: 'Telemetry-style structured metadata for analytics and drill-down.',
78
+ },
79
+ },
80
+ };
@@ -42,6 +42,12 @@ export interface RuntimeInstance {
42
42
  metadata: Record<string, unknown> | null;
43
43
  }
44
44
  export type LiveActivityType = 'run_started' | 'run_completed' | 'run_failed' | 'artifact_created' | 'decision_requested' | 'decision_resolved' | 'handoff_requested' | 'handoff_claimed' | 'handoff_fulfilled' | 'blocker_created' | 'milestone_completed' | 'delegation';
45
+ /**
46
+ * Canonical event names set in `metadata.event` on activity items.
47
+ * Keep in sync with emitters in auto-continue-engine.ts, autopilot-operations.ts,
48
+ * dispatch-lifecycle.ts, and http/index.ts.
49
+ */
50
+ export type ActivityEventName = 'autopilot_slice_dispatched' | 'autopilot_slice_started' | 'autopilot_slice_heartbeat' | 'autopilot_slice_finished' | 'autopilot_slice_result' | 'autopilot_slice_handoff' | 'autopilot_slice_mcp_handshake_failed' | 'autopilot_slice_timeout' | 'autopilot_slice_log_stall' | 'autopilot_slice_artifact_buffered' | 'autopilot_slice_status_updates_buffered' | 'auto_continue_started' | 'auto_continue_stopped' | 'auto_continue_spawn_guard_blocked' | 'auto_continue_spawn_guard_rate_limited' | 'auto_continue_spawn_guard_rate_limit_overridden' | 'auto_continue_behavior_config_drift_detected' | 'auto_continue_behavior_config_approval_required' | 'auto_continue_behavior_automation_manual_blocked' | 'auto_continue_behavior_automation_supervised_one_shot' | 'autopilot_autofix_scheduled' | 'autopilot_autofix_executed' | 'autopilot_autofix_skipped' | 'orchestrator_dispatch' | 'autopilot_transition' | 'next_up_manual_dispatch_started' | 'scope_completed' | 'session_start' | 'session_stop' | 'heartbeat' | 'decision_buffered' | 'decision_resolved' | 'question_asked' | 'question_timeout_started' | 'question_auto_answered' | 'question_answer_applied' | 'question_answer_failed' | 'review_item_created' | 'review_item_resolved' | 'decision_auto_answer_scheduled' | 'decision_auto_answer_timeout' | 'decision_auto_answer_applied' | 'decision_auto_answer_skipped' | 'spawn_guard_degraded' | 'dashboard_run_mark_completed' | 'proof_gate_warning' | 'artifact_registered';
45
51
  export interface LiveActivityItem {
46
52
  id: string;
47
53
  type: LiveActivityType;
@@ -69,16 +75,94 @@ export interface LiveActivityItem {
69
75
  lastHeartbeatAt?: string | null;
70
76
  metadata?: Record<string, unknown>;
71
77
  }
78
+ export declare const KNOWN_ACTIVITY_ACTION_TYPES: readonly ["orchestrator_dispatch", "dispatch_slice", "spawn_worker", "run_heartbeat", "run_state_transition", "run_started", "run_completed", "run_failed", "slice_handoff", "question_asked", "question_timeout_started", "question_auto_answered", "question_answer_applied", "question_answer_failed", "decision_requested", "decision_resolved", "review_item_created", "review_item_resolved", "status_updates_applied", "status_updates_buffered", "artifact_registered", "spawn_guard_blocked", "spawn_guard_rate_limited", "behavior_config_review", "auto_fix", "auto_continue_started", "auto_continue_stopped", "autopilot_resumed", "autopilot_paused", "autopilot_blocked", "milestone_completed", "workflow_error"];
79
+ export type KnownActivityActionType = (typeof KNOWN_ACTIVITY_ACTION_TYPES)[number];
80
+ export type ActivityActionType = KnownActivityActionType | (string & {});
81
+ export declare const KNOWN_ACTIVITY_ACTION_PHASES: readonly ["intent", "dispatch", "execution", "handoff", "review", "completed", "blocked", "error"];
82
+ export type ActivityActionPhase = (typeof KNOWN_ACTIVITY_ACTION_PHASES)[number];
83
+ export declare function normalizeActivityActionType(value: unknown): ActivityActionType | null;
84
+ export declare function isKnownActivityActionType(value: unknown): value is KnownActivityActionType;
85
+ export declare function normalizeActivityActionPhase(value: unknown): ActivityActionPhase | null;
86
+ export declare const KNOWN_DECISION_ACTION_TYPES: readonly ["approve", "reject", "provide_context", "request_info", "confirm_scope", "retry", "resume", "start", "pause", "defer", "cancel", "queue_top", "queue_bottom", "remove_from_queue", "reassign", "assign", "notify", "escalate", "handoff", "spawn", "execute_task", "review_blocker", "review_decision", "open_artifact", "open_logs", "open_session", "open_run", "open_workstream", "open_task", "open_initiative", "open_pr", "open_diff", "open_branch", "open_deal", "update_deal", "open_settings", "open_workspace", "connect_provider", "refresh_credentials", "auto_fix", "ignore_once"];
87
+ export type KnownDecisionActionType = (typeof KNOWN_DECISION_ACTION_TYPES)[number];
88
+ export type DecisionActionType = KnownDecisionActionType | (string & {});
89
+ export declare function normalizeDecisionActionType(value: unknown): DecisionActionType | null;
90
+ export declare function isKnownDecisionActionType(value: unknown): value is KnownDecisionActionType;
91
+ export type LiveDecisionOptionStatus = 'approved' | 'declined' | 'cancelled';
92
+ export interface LiveDecisionOption {
93
+ id: string;
94
+ label: string;
95
+ description: string | null;
96
+ impliedStatus: LiveDecisionOptionStatus | null;
97
+ actionType: DecisionActionType | null;
98
+ requiresNote: boolean;
99
+ }
100
+ export interface LiveDecisionEvidenceRef {
101
+ evidenceType: string | null;
102
+ title: string | null;
103
+ summary: string | null;
104
+ sourceUrl: string | null;
105
+ sourcePointer: string | null;
106
+ freshness: string | null;
107
+ confidence: number | null;
108
+ payload: Record<string, unknown> | null;
109
+ }
72
110
  export interface LiveDecision {
73
111
  id: string;
74
112
  title: string;
75
113
  context: string | null;
76
114
  status: string;
115
+ priority?: string | null;
116
+ decisionType?: string | null;
77
117
  agentName: string | null;
118
+ agentId?: string | null;
119
+ initiativeId?: string | null;
120
+ workstreamId?: string | null;
121
+ dueAt?: string | null;
78
122
  requestedAt: string | null;
79
123
  updatedAt: string | null;
124
+ sourceSystem?: string | null;
125
+ conflictSource?: string | null;
126
+ dedupeKey?: string | null;
127
+ recommendedAction?: string | null;
128
+ occurrenceCount?: number | null;
129
+ firstSeenAt?: string | null;
130
+ lastSeenAt?: string | null;
131
+ sourceRunId?: string | null;
132
+ sourceSessionId?: string | null;
133
+ sourceStreamId?: string | null;
134
+ evidenceRefs?: LiveDecisionEvidenceRef[];
80
135
  waitingMinutes: number;
81
136
  metadata?: Record<string, unknown>;
137
+ options?: LiveDecisionOption[];
138
+ selectedOptionId?: string | null;
139
+ }
140
+ export interface SessionBlockerContext {
141
+ initiativeId: string | null;
142
+ initiativeIds?: string[];
143
+ workstreamId: string | null;
144
+ workstreamIds?: string[];
145
+ workstreamTitle: string | null;
146
+ taskIds: string[];
147
+ milestoneIds: string[];
148
+ iwmtId?: string | null;
149
+ iwmtIds?: string[];
150
+ sliceRunId: string | null;
151
+ parallelMode: string | null;
152
+ logPath: string | null;
153
+ outputPath: string | null;
154
+ }
155
+ export interface SessionBlockerDiagnostics {
156
+ reason: string | null;
157
+ source: string | null;
158
+ errorCode: string | null;
159
+ errorCategory: string | null;
160
+ retryable: boolean | null;
161
+ suggestedActions: string[];
162
+ eventId: string | null;
163
+ eventType: string | null;
164
+ eventTimestamp: string | null;
165
+ context: SessionBlockerContext;
82
166
  }
83
167
  export interface SessionTreeNode {
84
168
  id: string;
@@ -109,6 +193,7 @@ export interface SessionTreeNode {
109
193
  runtimeProvider?: RuntimeProviderLogo | null;
110
194
  instanceId?: string | null;
111
195
  lastHeartbeatAt?: string | null;
196
+ blockerDiagnostics?: SessionBlockerDiagnostics | null;
112
197
  }
113
198
  export interface SessionTreeEdge {
114
199
  parentId: string;
@@ -145,3 +230,77 @@ export interface HandoffSummary {
145
230
  updatedAt: string;
146
231
  events: HandoffEvent[];
147
232
  }
233
+ export type TriageItemKind = 'decision_required' | 'blocked_intervention' | 'review_required' | 'failure_diagnostic';
234
+ export type TriageItemStatus = 'open' | 'snoozed' | 'resolved' | 'dismissed';
235
+ export type TriageSeverity = 'critical' | 'high' | 'medium' | 'low';
236
+ export type TriageActionType = 'approve' | 'reject' | 'retry' | 'autofix' | 'defer' | 'snooze' | 'dismiss';
237
+ export interface TriageAction {
238
+ action: TriageActionType;
239
+ label: string;
240
+ description: string;
241
+ consequences: string;
242
+ requiresNote: boolean;
243
+ available: boolean;
244
+ }
245
+ export interface ProofBundle {
246
+ artifactRefs: string[];
247
+ fileChanges: string[];
248
+ prRefs: string[];
249
+ logRefs: string[];
250
+ decisionRefs: string[];
251
+ }
252
+ export interface TriageImpact {
253
+ initiativeCount: number;
254
+ workstreamCount: number;
255
+ downstreamBlockedCount: number;
256
+ }
257
+ export interface LiveTriageItem {
258
+ id: string;
259
+ kind: TriageItemKind;
260
+ status: TriageItemStatus;
261
+ title: string;
262
+ summary: string;
263
+ initiativeId: string | null;
264
+ initiativeTitle: string | null;
265
+ workstreamId: string | null;
266
+ workstreamTitle: string | null;
267
+ taskId: string | null;
268
+ taskTitle: string | null;
269
+ sourceSystem: string | null;
270
+ conflictSource: string | null;
271
+ dedupeKey: string | null;
272
+ occurrenceCount: number;
273
+ severity: TriageSeverity;
274
+ blocking: boolean;
275
+ recommendedAction: string | null;
276
+ agentId: string | null;
277
+ impact: TriageImpact;
278
+ proofBundle: ProofBundle;
279
+ actionContract: TriageAction[];
280
+ createdAt: string;
281
+ updatedAt: string;
282
+ firstSeenAt: string;
283
+ lastSeenAt: string;
284
+ snoozedUntil: string | null;
285
+ sourceDecisionId: string | null;
286
+ sourceActivityId: string | null;
287
+ }
288
+ export interface TriageActionRequest {
289
+ action: string;
290
+ note?: string;
291
+ optionId?: string;
292
+ snoozeDurationMinutes?: number;
293
+ }
294
+ export interface TriageActionResponse {
295
+ ok: boolean;
296
+ itemStatus: TriageItemStatus;
297
+ continuationPlan: string | null;
298
+ sideEffects: string[];
299
+ }
300
+ export interface TriageListResponse {
301
+ ok: boolean;
302
+ items: LiveTriageItem[];
303
+ total: number;
304
+ generatedAt: string;
305
+ degraded?: string[];
306
+ }