@useorgx/openclaw-plugin 0.4.8 → 0.7.0

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 (284) hide show
  1. package/README.md +35 -0
  2. package/dashboard/dist/assets/BJgZIVUQ.js +53 -0
  3. package/dashboard/dist/assets/BJgZIVUQ.js.br +0 -0
  4. package/dashboard/dist/assets/BJgZIVUQ.js.gz +0 -0
  5. package/dashboard/dist/assets/BXWDRGm-.js +1 -0
  6. package/dashboard/dist/assets/BXWDRGm-.js.br +0 -0
  7. package/dashboard/dist/assets/BXWDRGm-.js.gz +0 -0
  8. package/dashboard/dist/assets/BgOYB78t.js +4 -0
  9. package/dashboard/dist/assets/BgOYB78t.js.br +0 -0
  10. package/dashboard/dist/assets/BgOYB78t.js.gz +0 -0
  11. package/dashboard/dist/assets/C-KIc3Wc.js.br +0 -0
  12. package/dashboard/dist/assets/C-KIc3Wc.js.gz +0 -0
  13. package/dashboard/dist/assets/CE38zU4U.js +1 -0
  14. package/dashboard/dist/assets/CE38zU4U.js.br +0 -0
  15. package/dashboard/dist/assets/CE38zU4U.js.gz +0 -0
  16. package/dashboard/dist/assets/CFGKRAzG.js +1 -0
  17. package/dashboard/dist/assets/CFGKRAzG.js.br +0 -0
  18. package/dashboard/dist/assets/CFGKRAzG.js.gz +0 -0
  19. package/dashboard/dist/assets/CGGR2GZh.js +1 -0
  20. package/dashboard/dist/assets/CGGR2GZh.js.br +0 -0
  21. package/dashboard/dist/assets/CGGR2GZh.js.gz +0 -0
  22. package/dashboard/dist/assets/CL_wXqR7.js +1 -0
  23. package/dashboard/dist/assets/CL_wXqR7.js.br +0 -0
  24. package/dashboard/dist/assets/CL_wXqR7.js.gz +0 -0
  25. package/dashboard/dist/assets/CPFiTmlw.js +8 -0
  26. package/dashboard/dist/assets/CPFiTmlw.js.br +0 -0
  27. package/dashboard/dist/assets/CPFiTmlw.js.gz +0 -0
  28. package/dashboard/dist/assets/CZZTvkQZ.js +1 -0
  29. package/dashboard/dist/assets/CZZTvkQZ.js.br +0 -0
  30. package/dashboard/dist/assets/CZZTvkQZ.js.gz +0 -0
  31. package/dashboard/dist/assets/{CpJsfbXo.js → CxQ08qFN.js} +2 -2
  32. package/dashboard/dist/assets/CxQ08qFN.js.br +0 -0
  33. package/dashboard/dist/assets/CxQ08qFN.js.gz +0 -0
  34. package/dashboard/dist/assets/D-bf6hEI.js +213 -0
  35. package/dashboard/dist/assets/D-bf6hEI.js.br +0 -0
  36. package/dashboard/dist/assets/D-bf6hEI.js.gz +0 -0
  37. package/dashboard/dist/assets/DG6y9wJI.js +2 -0
  38. package/dashboard/dist/assets/DG6y9wJI.js.br +0 -0
  39. package/dashboard/dist/assets/DG6y9wJI.js.gz +0 -0
  40. package/dashboard/dist/assets/DNxKz-GV.js +1 -0
  41. package/dashboard/dist/assets/DNxKz-GV.js.br +0 -0
  42. package/dashboard/dist/assets/DNxKz-GV.js.gz +0 -0
  43. package/dashboard/dist/assets/DW_rKUic.js +11 -0
  44. package/dashboard/dist/assets/DW_rKUic.js.br +0 -0
  45. package/dashboard/dist/assets/DW_rKUic.js.gz +0 -0
  46. package/dashboard/dist/assets/DbNoijHm.js +1 -0
  47. package/dashboard/dist/assets/DbNoijHm.js.br +0 -0
  48. package/dashboard/dist/assets/DbNoijHm.js.gz +0 -0
  49. package/dashboard/dist/assets/DjcdE6jC.js +2 -0
  50. package/dashboard/dist/assets/DjcdE6jC.js.br +0 -0
  51. package/dashboard/dist/assets/DjcdE6jC.js.gz +0 -0
  52. package/dashboard/dist/assets/FZYuCDnt.js +1 -0
  53. package/dashboard/dist/assets/FZYuCDnt.js.br +0 -0
  54. package/dashboard/dist/assets/FZYuCDnt.js.gz +0 -0
  55. package/dashboard/dist/assets/PAUiij_z.js +1 -0
  56. package/dashboard/dist/assets/PAUiij_z.js.br +0 -0
  57. package/dashboard/dist/assets/PAUiij_z.js.gz +0 -0
  58. package/dashboard/dist/assets/cNrhgGc1.js +8 -0
  59. package/dashboard/dist/assets/cNrhgGc1.js.br +0 -0
  60. package/dashboard/dist/assets/cNrhgGc1.js.gz +0 -0
  61. package/dashboard/dist/assets/h5biQs2I.css +1 -0
  62. package/dashboard/dist/assets/h5biQs2I.css.br +0 -0
  63. package/dashboard/dist/assets/h5biQs2I.css.gz +0 -0
  64. package/dashboard/dist/assets/ic2FaMnh.js +1 -0
  65. package/dashboard/dist/assets/ic2FaMnh.js.br +0 -0
  66. package/dashboard/dist/assets/ic2FaMnh.js.gz +0 -0
  67. package/dashboard/dist/assets/nByHNHoW.js +1 -0
  68. package/dashboard/dist/assets/nByHNHoW.js.br +0 -0
  69. package/dashboard/dist/assets/nByHNHoW.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/tS9mbYZi.js +1 -0
  74. package/dashboard/dist/assets/tS9mbYZi.js.br +0 -0
  75. package/dashboard/dist/assets/tS9mbYZi.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 +38 -26
  88. package/dist/agent-context-store.js +84 -42
  89. package/dist/agent-run-store.js +49 -28
  90. package/dist/agent-suite.d.ts +9 -0
  91. package/dist/agent-suite.js +150 -17
  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/auth/flows.d.ts +47 -0
  97. package/dist/auth/flows.js +169 -0
  98. package/dist/auth-store.js +6 -26
  99. package/dist/byok-store.js +5 -19
  100. package/dist/chat-store.d.ts +157 -0
  101. package/dist/chat-store.js +586 -0
  102. package/dist/cli/orgx.d.ts +66 -0
  103. package/dist/cli/orgx.js +102 -0
  104. package/dist/config/refresh.d.ts +32 -0
  105. package/dist/config/refresh.js +55 -0
  106. package/dist/config/resolution.d.ts +37 -0
  107. package/dist/config/resolution.js +178 -0
  108. package/dist/contracts/client.d.ts +43 -3
  109. package/dist/contracts/client.js +159 -30
  110. package/dist/contracts/retro-schema.d.ts +81 -0
  111. package/dist/contracts/retro-schema.js +80 -0
  112. package/dist/contracts/shared-types.d.ts +306 -0
  113. package/dist/contracts/shared-types.js +179 -0
  114. package/dist/contracts/skill-pack-schema.d.ts +192 -0
  115. package/dist/contracts/skill-pack-schema.js +180 -0
  116. package/dist/contracts/types.d.ts +224 -132
  117. package/dist/contracts/types.js +5 -0
  118. package/dist/entities/auto-assignment.d.ts +36 -0
  119. package/dist/entities/auto-assignment.js +141 -0
  120. package/dist/entity-comment-store.js +5 -25
  121. package/dist/event-sanitization.d.ts +11 -0
  122. package/dist/event-sanitization.js +113 -0
  123. package/dist/fs-utils.js +13 -1
  124. package/dist/gateway-watchdog.d.ts +5 -0
  125. package/dist/gateway-watchdog.js +50 -0
  126. package/dist/hash-utils.d.ts +2 -0
  127. package/dist/hash-utils.js +12 -0
  128. package/dist/hooks/post-reporting-event.mjs +1 -5
  129. package/dist/http/helpers/activity-headline.d.ts +10 -0
  130. package/dist/http/helpers/activity-headline.js +73 -0
  131. package/dist/http/helpers/artifact-fallback.d.ts +13 -0
  132. package/dist/http/helpers/artifact-fallback.js +148 -0
  133. package/dist/http/helpers/auto-continue-engine.d.ts +486 -0
  134. package/dist/http/helpers/auto-continue-engine.js +3563 -0
  135. package/dist/http/helpers/autopilot-operations.d.ts +176 -0
  136. package/dist/http/helpers/autopilot-operations.js +554 -0
  137. package/dist/http/helpers/autopilot-runtime.d.ts +43 -0
  138. package/dist/http/helpers/autopilot-runtime.js +607 -0
  139. package/dist/http/helpers/autopilot-slice-utils.d.ts +56 -0
  140. package/dist/http/helpers/autopilot-slice-utils.js +899 -0
  141. package/dist/http/helpers/decision-mapper.d.ts +52 -0
  142. package/dist/http/helpers/decision-mapper.js +260 -0
  143. package/dist/http/helpers/dispatch-lifecycle.d.ts +119 -0
  144. package/dist/http/helpers/dispatch-lifecycle.js +809 -0
  145. package/dist/http/helpers/hash-utils.d.ts +1 -0
  146. package/dist/http/helpers/hash-utils.js +1 -0
  147. package/dist/http/helpers/kickoff-context.d.ts +12 -0
  148. package/dist/http/helpers/kickoff-context.js +228 -0
  149. package/dist/http/helpers/llm-client.d.ts +47 -0
  150. package/dist/http/helpers/llm-client.js +256 -0
  151. package/dist/http/helpers/mission-control.d.ts +193 -0
  152. package/dist/http/helpers/mission-control.js +1383 -0
  153. package/dist/http/helpers/openclaw-cli.d.ts +37 -0
  154. package/dist/http/helpers/openclaw-cli.js +283 -0
  155. package/dist/http/helpers/runtime-sse.d.ts +20 -0
  156. package/dist/http/helpers/runtime-sse.js +110 -0
  157. package/dist/http/helpers/sentinel-catalog.d.ts +23 -0
  158. package/dist/http/helpers/sentinel-catalog.js +193 -0
  159. package/dist/http/helpers/session-classification.d.ts +9 -0
  160. package/dist/http/helpers/session-classification.js +564 -0
  161. package/dist/http/helpers/slice-experience-v2.d.ts +137 -0
  162. package/dist/http/helpers/slice-experience-v2.js +677 -0
  163. package/dist/http/helpers/slice-run-projections.d.ts +72 -0
  164. package/dist/http/helpers/slice-run-projections.js +860 -0
  165. package/dist/http/helpers/triage-mapper.d.ts +43 -0
  166. package/dist/http/helpers/triage-mapper.js +549 -0
  167. package/dist/http/helpers/value-utils.d.ts +6 -0
  168. package/dist/http/helpers/value-utils.js +72 -0
  169. package/dist/http/helpers/workspace-scope.d.ts +15 -0
  170. package/dist/http/helpers/workspace-scope.js +170 -0
  171. package/dist/http/index.d.ts +88 -0
  172. package/dist/http/index.js +3610 -0
  173. package/dist/http/router.d.ts +23 -0
  174. package/dist/http/router.js +23 -0
  175. package/dist/http/routes/agent-control.d.ts +79 -0
  176. package/dist/http/routes/agent-control.js +684 -0
  177. package/dist/http/routes/agent-suite.d.ts +38 -0
  178. package/dist/http/routes/agent-suite.js +397 -0
  179. package/dist/http/routes/agents-catalog.d.ts +40 -0
  180. package/dist/http/routes/agents-catalog.js +128 -0
  181. package/dist/http/routes/billing.d.ts +23 -0
  182. package/dist/http/routes/billing.js +55 -0
  183. package/dist/http/routes/chat.d.ts +19 -0
  184. package/dist/http/routes/chat.js +522 -0
  185. package/dist/http/routes/debug.d.ts +14 -0
  186. package/dist/http/routes/debug.js +21 -0
  187. package/dist/http/routes/decision-actions.d.ts +20 -0
  188. package/dist/http/routes/decision-actions.js +103 -0
  189. package/dist/http/routes/delegation.d.ts +19 -0
  190. package/dist/http/routes/delegation.js +32 -0
  191. package/dist/http/routes/dispatch-gateway-envelope.d.ts +25 -0
  192. package/dist/http/routes/dispatch-gateway-envelope.js +26 -0
  193. package/dist/http/routes/entities.d.ts +63 -0
  194. package/dist/http/routes/entities.js +440 -0
  195. package/dist/http/routes/entity-dynamic.d.ts +25 -0
  196. package/dist/http/routes/entity-dynamic.js +191 -0
  197. package/dist/http/routes/health.d.ts +22 -0
  198. package/dist/http/routes/health.js +49 -0
  199. package/dist/http/routes/live-legacy.d.ts +115 -0
  200. package/dist/http/routes/live-legacy.js +112 -0
  201. package/dist/http/routes/live-misc.d.ts +81 -0
  202. package/dist/http/routes/live-misc.js +426 -0
  203. package/dist/http/routes/live-snapshot.d.ts +136 -0
  204. package/dist/http/routes/live-snapshot.js +916 -0
  205. package/dist/http/routes/live-terminal.d.ts +11 -0
  206. package/dist/http/routes/live-terminal.js +261 -0
  207. package/dist/http/routes/live-triage.d.ts +61 -0
  208. package/dist/http/routes/live-triage.js +248 -0
  209. package/dist/http/routes/mission-control-actions.d.ts +131 -0
  210. package/dist/http/routes/mission-control-actions.js +1791 -0
  211. package/dist/http/routes/mission-control-read.d.ts +73 -0
  212. package/dist/http/routes/mission-control-read.js +1640 -0
  213. package/dist/http/routes/onboarding.d.ts +34 -0
  214. package/dist/http/routes/onboarding.js +101 -0
  215. package/dist/http/routes/realtime-orchestrator.d.ts +10 -0
  216. package/dist/http/routes/realtime-orchestrator.js +74 -0
  217. package/dist/http/routes/run-control.d.ts +27 -0
  218. package/dist/http/routes/run-control.js +96 -0
  219. package/dist/http/routes/runtime-hooks.d.ts +69 -0
  220. package/dist/http/routes/runtime-hooks.js +437 -0
  221. package/dist/http/routes/sentinels-catalog.d.ts +7 -0
  222. package/dist/http/routes/sentinels-catalog.js +24 -0
  223. package/dist/http/routes/settings-byok.d.ts +23 -0
  224. package/dist/http/routes/settings-byok.js +163 -0
  225. package/dist/http/routes/summary.d.ts +18 -0
  226. package/dist/http/routes/summary.js +49 -0
  227. package/dist/http/routes/usage.d.ts +24 -0
  228. package/dist/http/routes/usage.js +362 -0
  229. package/dist/http/routes/work-artifacts.d.ts +9 -0
  230. package/dist/http/routes/work-artifacts.js +55 -0
  231. package/dist/http/shared-state.d.ts +16 -0
  232. package/dist/http/shared-state.js +1 -0
  233. package/dist/http-handler.d.ts +1 -88
  234. package/dist/http-handler.js +1 -10605
  235. package/dist/index.js +287 -2284
  236. package/dist/json-utils.d.ts +1 -0
  237. package/dist/json-utils.js +8 -0
  238. package/dist/local-openclaw.js +29 -6
  239. package/dist/mcp-client-setup.js +3 -3
  240. package/dist/mcp-http-handler.js +33 -59
  241. package/dist/next-up-queue-store.d.ts +16 -1
  242. package/dist/next-up-queue-store.js +93 -25
  243. package/dist/outbox.d.ts +5 -0
  244. package/dist/outbox.js +113 -9
  245. package/dist/paths.js +24 -5
  246. package/dist/reporting/rollups.d.ts +53 -0
  247. package/dist/reporting/rollups.js +148 -0
  248. package/dist/retro/domain-templates.d.ts +45 -0
  249. package/dist/retro/domain-templates.js +297 -0
  250. package/dist/retro/quality-rubric.d.ts +33 -0
  251. package/dist/retro/quality-rubric.js +213 -0
  252. package/dist/runtime-cleanup.d.ts +18 -0
  253. package/dist/runtime-cleanup.js +87 -0
  254. package/dist/runtime-instance-store.js +5 -31
  255. package/dist/services/background.d.ts +34 -0
  256. package/dist/services/background.js +45 -0
  257. package/dist/services/experiment-randomization.d.ts +21 -0
  258. package/dist/services/experiment-randomization.js +63 -0
  259. package/dist/services/instrumentation.d.ts +29 -0
  260. package/dist/services/instrumentation.js +136 -0
  261. package/dist/skill-pack-state.d.ts +36 -5
  262. package/dist/skill-pack-state.js +273 -29
  263. package/dist/snapshot-store.js +5 -25
  264. package/dist/stores/json-store.d.ts +11 -0
  265. package/dist/stores/json-store.js +42 -0
  266. package/dist/sync/local-agent-telemetry.d.ts +13 -0
  267. package/dist/sync/local-agent-telemetry.js +128 -0
  268. package/dist/sync/outbox-replay.d.ts +55 -0
  269. package/dist/sync/outbox-replay.js +621 -0
  270. package/dist/team-context-store.d.ts +23 -0
  271. package/dist/team-context-store.js +116 -0
  272. package/dist/telemetry/posthog.js +4 -2
  273. package/dist/tools/core-tools.d.ts +72 -0
  274. package/dist/tools/core-tools.js +2270 -0
  275. package/dist/types.d.ts +2 -0
  276. package/dist/types.js +2 -0
  277. package/dist/worker-supervisor.js +23 -0
  278. package/package.json +14 -4
  279. package/dashboard/dist/assets/B3ziCA02.js +0 -8
  280. package/dashboard/dist/assets/BNeJ0kpF.js +0 -1
  281. package/dashboard/dist/assets/BzkiMPmM.js +0 -215
  282. package/dashboard/dist/assets/CUV9IHHi.js +0 -1
  283. package/dashboard/dist/assets/Ie7d9Iq2.css +0 -1
  284. package/dashboard/dist/assets/sAhvFnpk.js +0 -4
@@ -0,0 +1,180 @@
1
+ export const OPENCLAW_SKILL_PACK_SCHEMA_VERSION = "openclaw-skill-pack.v1";
2
+ export const ORGX_AGENT_DOMAINS = [
3
+ "engineering",
4
+ "product",
5
+ "design",
6
+ "marketing",
7
+ "sales",
8
+ "operations",
9
+ "orchestration",
10
+ ];
11
+ const DOMAIN_SET = new Set(ORGX_AGENT_DOMAINS);
12
+ function isRecord(value) {
13
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
14
+ }
15
+ function hasOwn(record, key) {
16
+ return Object.prototype.hasOwnProperty.call(record, key);
17
+ }
18
+ const DOMAIN_STRING_SCHEMA = {
19
+ type: "string",
20
+ minLength: 1,
21
+ };
22
+ export const OPENCLAW_SKILLS_MAP_JSON_SCHEMA = {
23
+ type: "object",
24
+ additionalProperties: false,
25
+ properties: {
26
+ engineering: DOMAIN_STRING_SCHEMA,
27
+ product: DOMAIN_STRING_SCHEMA,
28
+ design: DOMAIN_STRING_SCHEMA,
29
+ marketing: DOMAIN_STRING_SCHEMA,
30
+ sales: DOMAIN_STRING_SCHEMA,
31
+ operations: DOMAIN_STRING_SCHEMA,
32
+ orchestration: DOMAIN_STRING_SCHEMA,
33
+ },
34
+ };
35
+ export const OPENCLAW_SKILL_PACK_MANIFEST_JSON_SCHEMA = {
36
+ $schema: "https://json-schema.org/draft/2020-12/schema",
37
+ $id: "https://schemas.useorgx.com/openclaw-skill-pack/v1.json",
38
+ title: "OrgX OpenClaw Skill Pack Manifest",
39
+ description: "Behavior config manifest for OpenClaw skill overrides by domain.",
40
+ type: "object",
41
+ additionalProperties: true,
42
+ oneOf: [
43
+ {
44
+ type: "object",
45
+ additionalProperties: true,
46
+ properties: {
47
+ schema_version: { type: "string", const: OPENCLAW_SKILL_PACK_SCHEMA_VERSION },
48
+ openclaw_skills: OPENCLAW_SKILLS_MAP_JSON_SCHEMA,
49
+ },
50
+ required: ["openclaw_skills"],
51
+ },
52
+ {
53
+ type: "object",
54
+ additionalProperties: true,
55
+ properties: {
56
+ schema_version: { type: "string", const: OPENCLAW_SKILL_PACK_SCHEMA_VERSION },
57
+ openclawSkills: OPENCLAW_SKILLS_MAP_JSON_SCHEMA,
58
+ },
59
+ required: ["openclawSkills"],
60
+ },
61
+ {
62
+ type: "object",
63
+ additionalProperties: true,
64
+ properties: {
65
+ schema_version: { type: "string", const: OPENCLAW_SKILL_PACK_SCHEMA_VERSION },
66
+ openclaw: {
67
+ type: "object",
68
+ additionalProperties: true,
69
+ properties: {
70
+ skills: OPENCLAW_SKILLS_MAP_JSON_SCHEMA,
71
+ },
72
+ required: ["skills"],
73
+ },
74
+ },
75
+ required: ["openclaw"],
76
+ },
77
+ ],
78
+ };
79
+ function resolveManifestConfigType(manifest) {
80
+ const hasOpenclawSkills = hasOwn(manifest, "openclaw_skills");
81
+ const hasOpenclawSkillsCamel = hasOwn(manifest, "openclawSkills");
82
+ const openclaw = manifest.openclaw;
83
+ const hasOpenclawNestedSkills = isRecord(openclaw) && hasOwn(openclaw, "skills");
84
+ const errors = [];
85
+ const selectedConfigTypes = [
86
+ hasOpenclawSkills ? "openclaw_skills" : null,
87
+ hasOpenclawSkillsCamel ? "openclawSkills" : null,
88
+ hasOpenclawNestedSkills ? "openclaw.skills" : null,
89
+ ].filter((value) => value !== null);
90
+ if (selectedConfigTypes.length > 1) {
91
+ errors.push("manifest must define only one config container: openclaw_skills, openclawSkills, or openclaw.skills");
92
+ }
93
+ if (hasOpenclawSkills) {
94
+ const value = manifest.openclaw_skills;
95
+ if (!isRecord(value)) {
96
+ return {
97
+ type: "openclaw_skills",
98
+ rawMap: null,
99
+ errors: [...errors, "manifest.openclaw_skills must be an object"],
100
+ };
101
+ }
102
+ return { type: "openclaw_skills", rawMap: value, errors };
103
+ }
104
+ if (hasOpenclawSkillsCamel) {
105
+ const value = manifest.openclawSkills;
106
+ if (!isRecord(value)) {
107
+ return {
108
+ type: "openclawSkills",
109
+ rawMap: null,
110
+ errors: [...errors, "manifest.openclawSkills must be an object"],
111
+ };
112
+ }
113
+ return { type: "openclawSkills", rawMap: value, errors };
114
+ }
115
+ if (hasOpenclawNestedSkills) {
116
+ const value = openclaw.skills;
117
+ if (!isRecord(value)) {
118
+ return {
119
+ type: "openclaw.skills",
120
+ rawMap: null,
121
+ errors: [...errors, "manifest.openclaw.skills must be an object"],
122
+ };
123
+ }
124
+ return { type: "openclaw.skills", rawMap: value, errors };
125
+ }
126
+ return { type: "none", rawMap: null, errors };
127
+ }
128
+ export function validateOpenClawSkillPackManifest(manifest) {
129
+ if (!isRecord(manifest)) {
130
+ return {
131
+ ok: false,
132
+ configType: "none",
133
+ openclaw_skills: {},
134
+ errors: ["manifest must be an object"],
135
+ };
136
+ }
137
+ const errors = [];
138
+ if ("schema_version" in manifest) {
139
+ const version = manifest.schema_version;
140
+ if (typeof version !== "string") {
141
+ errors.push("manifest.schema_version must be a string");
142
+ }
143
+ else if (version.trim() !== OPENCLAW_SKILL_PACK_SCHEMA_VERSION) {
144
+ errors.push(`manifest.schema_version must equal "${OPENCLAW_SKILL_PACK_SCHEMA_VERSION}"`);
145
+ }
146
+ }
147
+ const { type, rawMap, errors: manifestConfigErrors } = resolveManifestConfigType(manifest);
148
+ errors.push(...manifestConfigErrors);
149
+ if (!rawMap) {
150
+ return {
151
+ ok: errors.length === 0,
152
+ configType: type,
153
+ openclaw_skills: {},
154
+ errors,
155
+ };
156
+ }
157
+ const openclaw_skills = {};
158
+ for (const [domain, rawValue] of Object.entries(rawMap)) {
159
+ if (!DOMAIN_SET.has(domain)) {
160
+ errors.push(`unknown domain key "${domain}" in manifest ${type}`);
161
+ continue;
162
+ }
163
+ if (typeof rawValue !== "string") {
164
+ errors.push(`manifest ${type}.${domain} must be a string`);
165
+ continue;
166
+ }
167
+ const normalized = rawValue.trim();
168
+ if (!normalized) {
169
+ errors.push(`manifest ${type}.${domain} must not be empty`);
170
+ continue;
171
+ }
172
+ openclaw_skills[domain] = normalized;
173
+ }
174
+ return {
175
+ ok: errors.length === 0,
176
+ configType: type,
177
+ openclaw_skills,
178
+ errors,
179
+ };
180
+ }
@@ -4,6 +4,9 @@
4
4
  * Types for the plugin's API client and tool interfaces.
5
5
  * Mirrors the server-side types in orgx/lib/client-integration/types.ts
6
6
  */
7
+ import type { DecisionActionType } from './shared-types.js';
8
+ import type { RetroArtifactSchemaVersion } from './retro-schema.js';
9
+ export type { ActivityEventName, HandoffEvent, HandoffSummary, LiveActivityItem, LiveActivityType, LiveDecision, OnboardingKeySource, OnboardingNextAction, OnboardingState, OnboardingStatus, RunPhase, RuntimeInstance, RuntimeInstanceState, RuntimeProviderLogo, RuntimeSourceClient, SessionBlockerContext, SessionBlockerDiagnostics, SessionTreeEdge, SessionTreeGroup, SessionTreeNode, SessionTreeResponse, } from './shared-types.js';
7
10
  export interface OrgXConfig {
8
11
  /** OrgX API key */
9
12
  apiKey: string;
@@ -24,23 +27,6 @@ export interface OrgXConfig {
24
27
  */
25
28
  autoInstallAgentSuiteOnConnect?: boolean;
26
29
  }
27
- export type OnboardingStatus = 'idle' | 'starting' | 'awaiting_browser_auth' | 'pairing' | 'connected' | 'error' | 'manual_key';
28
- export type OnboardingNextAction = 'connect' | 'wait_for_browser' | 'open_dashboard' | 'enter_manual_key' | 'retry' | 'reconnect';
29
- export interface OnboardingState {
30
- status: OnboardingStatus;
31
- hasApiKey: boolean;
32
- connectionVerified: boolean;
33
- workspaceName: string | null;
34
- lastError: string | null;
35
- nextAction: OnboardingNextAction;
36
- docsUrl: string;
37
- keySource: 'config' | 'environment' | 'persisted' | 'openclaw-config-file' | 'legacy-dev' | 'none';
38
- installationId: string | null;
39
- connectUrl: string | null;
40
- pairingId: string | null;
41
- expiresAt: string | null;
42
- pollIntervalMs: number | null;
43
- }
44
30
  export interface OrgSnapshot {
45
31
  /** Active initiatives */
46
32
  initiatives: Initiative[];
@@ -97,6 +83,29 @@ export interface KickoffContext {
97
83
  collaboration_style?: string | null;
98
84
  defaults?: string[] | null;
99
85
  } | null;
86
+ runtime_settings?: {
87
+ decision_v2_enabled?: boolean;
88
+ decision_dedupe_enabled?: boolean;
89
+ decision_evidence_required_for_blocking?: boolean;
90
+ decision_auto_resolve_guarded_enabled?: boolean;
91
+ custom_run_instructions?: string | null;
92
+ } | null;
93
+ /** Recent team activity for cross-agent awareness. */
94
+ team_context?: {
95
+ recent_completions?: Array<{
96
+ domain: string;
97
+ task_title: string;
98
+ summary: string;
99
+ key_outputs?: string[];
100
+ completed_at: string;
101
+ }>;
102
+ recent_decisions?: Array<{
103
+ title: string;
104
+ resolution: string;
105
+ affected_domains?: string[];
106
+ resolved_at: string;
107
+ }>;
108
+ } | null;
100
109
  }
101
110
  export type KickoffContextRequest = KickoffContextScope & {
102
111
  agent_id?: string | null;
@@ -140,6 +149,42 @@ export type OrgxAgentPack = {
140
149
  agents: OrgxAgentProfile[];
141
150
  managed_files: string[];
142
151
  };
152
+ export interface AgentRuntimeSettingsPayload {
153
+ decision_v2_enabled?: boolean;
154
+ decision_dedupe_enabled?: boolean;
155
+ decision_evidence_required_for_blocking?: boolean;
156
+ decision_auto_resolve_guarded_enabled?: boolean;
157
+ custom_run_instructions?: string | null;
158
+ }
159
+ export interface ClientRuntimeSettingsAgent {
160
+ id: string;
161
+ name: string;
162
+ type: string;
163
+ status: string;
164
+ model: string | null;
165
+ runtime_settings: AgentRuntimeSettingsPayload;
166
+ }
167
+ export type ClientRuntimeSettingsResponse = {
168
+ ok: true;
169
+ workspace_id?: string | null;
170
+ /** Legacy alias retained for backward compatibility */
171
+ project_id?: string | null;
172
+ agents?: ClientRuntimeSettingsAgent[];
173
+ agent?: ClientRuntimeSettingsAgent;
174
+ } | {
175
+ ok: false;
176
+ error: string;
177
+ };
178
+ export interface ClientRuntimeSettingsUpdateRequest {
179
+ /** Canonical workspace scope */
180
+ workspace_id?: string;
181
+ /** Legacy alias retained for backward compatibility */
182
+ command_center_id?: string;
183
+ /** Legacy alias retained for backward compatibility */
184
+ project_id?: string;
185
+ agent_id: string;
186
+ runtime_settings: AgentRuntimeSettingsPayload;
187
+ }
143
188
  export type SkillPack = {
144
189
  name: string;
145
190
  version: string;
@@ -200,6 +245,8 @@ export interface SyncPayload {
200
245
  memory?: string;
201
246
  /** Today's session log */
202
247
  dailyLog?: string;
248
+ /** Local OpenClaw agent states to mirror into OrgX */
249
+ agents?: AgentState[];
203
250
  /** Workspace state for local↔cloud handoff continuity */
204
251
  workspaceState?: HandoffWorkspaceState;
205
252
  /** Decisions made this session */
@@ -221,6 +268,8 @@ export interface SyncResponse {
221
268
  title: string;
222
269
  status: string;
223
270
  }>;
271
+ /** Agent states (optional for backward compatibility with older servers) */
272
+ agents?: AgentState[];
224
273
  /** In-progress tasks */
225
274
  activeTasks: Array<{
226
275
  id: string;
@@ -265,7 +314,80 @@ export interface BillingUrlResult {
265
314
  url: string | null;
266
315
  checkout_url?: string | null;
267
316
  }
268
- export type RunPhase = 'intent' | 'execution' | 'blocked' | 'review' | 'handoff' | 'completed';
317
+ export type UsageRiskLevel = "safe" | "watch" | "at_risk" | "over_limit";
318
+ export type UsageBreakdownBucket = {
319
+ key: string;
320
+ label: string;
321
+ runs: number;
322
+ tokens: number;
323
+ minutes: number;
324
+ costCents: number;
325
+ };
326
+ export type UsagePrediction = {
327
+ agentRuns: number;
328
+ agentMinutes: number;
329
+ tokens: number;
330
+ costCents: number;
331
+ confidence: number;
332
+ method: string;
333
+ remainingAgentRuns: number;
334
+ remainingAgentMinutes: number;
335
+ remainingTokens: number;
336
+ remainingCostCents: number;
337
+ };
338
+ export type UsageControlPlaneSummary = {
339
+ generatedAt: string;
340
+ period: {
341
+ start: string;
342
+ end: string;
343
+ daysTotal: number;
344
+ daysElapsed: number;
345
+ daysRemaining: number;
346
+ };
347
+ plan: {
348
+ id: string;
349
+ name: string;
350
+ allowsOverage: boolean;
351
+ includedBudgetCents: number;
352
+ overageBudgetCents: number;
353
+ agentRunsLimit: number;
354
+ agentMinutesLimit: number;
355
+ scaffoldsLimit: number;
356
+ };
357
+ actual: {
358
+ agentRuns: number;
359
+ agentMinutes: number;
360
+ tokens: number;
361
+ costCents: number;
362
+ scaffoldsUsed: number;
363
+ scaffoldsRemaining: number;
364
+ };
365
+ predicted: UsagePrediction;
366
+ utilization: {
367
+ runsPct: number | null;
368
+ minutesPct: number | null;
369
+ budgetPct: number | null;
370
+ };
371
+ headroom: {
372
+ agentRunsRemaining: number;
373
+ agentMinutesRemaining: number;
374
+ budgetRemainingCents: number;
375
+ };
376
+ risk: UsageRiskLevel;
377
+ breakdown: {
378
+ provider: UsageBreakdownBucket[];
379
+ executionTarget: UsageBreakdownBucket[];
380
+ sourceClient: UsageBreakdownBucket[];
381
+ model: UsageBreakdownBucket[];
382
+ };
383
+ velocity: {
384
+ windowDays: number;
385
+ dailyAvgRuns: number;
386
+ dailyAvgMinutes: number;
387
+ dailyAvgTokens: number;
388
+ dailyAvgCostCents: number;
389
+ };
390
+ };
269
391
  export interface HandoffWorkspaceState {
270
392
  git?: {
271
393
  branch?: string | null;
@@ -394,15 +516,61 @@ export interface EntityUpdatePayload {
394
516
  export interface EntityListFilters {
395
517
  status?: string;
396
518
  limit?: number;
519
+ offset?: number;
520
+ search?: string;
521
+ id?: string;
522
+ ids?: string[] | string;
523
+ initiative_id?: string;
524
+ project_id?: string;
525
+ /** Canonical workspace scope */
526
+ workspace_id?: string;
527
+ /** Legacy alias for workspace_id */
528
+ command_center_id?: string;
397
529
  [key: string]: unknown;
398
530
  }
531
+ export interface WorkstreamReassignmentStatus {
532
+ scheduled: boolean;
533
+ requestId?: string | null;
534
+ dueAt?: string | null;
535
+ reason?: string;
536
+ }
537
+ export interface InitiativeReassignmentStatus {
538
+ triggered: boolean;
539
+ requested: number;
540
+ scheduled: number;
541
+ skipped: number;
542
+ failures: string[];
543
+ }
544
+ export interface EntityUpdateResult {
545
+ entity: Entity;
546
+ reassignment?: WorkstreamReassignmentStatus | null;
547
+ initiative_reassignment?: InitiativeReassignmentStatus | null;
548
+ }
399
549
  export type ReportingSourceClient = 'openclaw' | 'codex' | 'claude-code' | 'api';
400
- export type RuntimeSourceClient = ReportingSourceClient | 'unknown';
401
550
  export type ReportingPhase = 'intent' | 'execution' | 'blocked' | 'review' | 'handoff' | 'completed';
402
551
  export type ReportingLevel = 'info' | 'warn' | 'error';
403
552
  export type TaskStatus = 'todo' | 'in_progress' | 'done' | 'blocked';
404
553
  export type MilestoneStatus = 'planned' | 'in_progress' | 'completed' | 'at_risk' | 'cancelled';
405
554
  export type DecisionUrgency = 'low' | 'medium' | 'high' | 'urgent';
555
+ export type DecisionOptionImpliedStatus = 'approved' | 'declined' | 'cancelled' | 'rejected';
556
+ export interface DecisionCreateOption {
557
+ id?: string;
558
+ label: string;
559
+ description?: string;
560
+ implied_status?: DecisionOptionImpliedStatus;
561
+ action_type?: DecisionActionType;
562
+ requires_note?: boolean;
563
+ }
564
+ export interface DecisionEvidenceRef {
565
+ evidence_type?: string;
566
+ title?: string;
567
+ summary?: string;
568
+ source_url?: string;
569
+ source_pointer?: string;
570
+ freshness?: string;
571
+ confidence?: number;
572
+ payload?: Record<string, unknown>;
573
+ }
406
574
  export interface EmitActivityRequest {
407
575
  initiative_id: string;
408
576
  message: string;
@@ -449,8 +617,22 @@ export type ChangesetOperation = {
449
617
  title: string;
450
618
  summary?: string;
451
619
  urgency?: DecisionUrgency;
452
- options?: string[];
620
+ options?: Array<string | DecisionCreateOption>;
453
621
  blocking?: boolean;
622
+ decision_type?: string;
623
+ workstream_id?: string;
624
+ agent_id?: string;
625
+ due_at?: string;
626
+ source_system?: string;
627
+ conflict_source?: string;
628
+ dedupe_key?: string;
629
+ recommended_action?: string;
630
+ source_run_id?: string;
631
+ source_session_id?: string;
632
+ source_stream_id?: string;
633
+ source_ref?: Record<string, unknown>;
634
+ evidence_refs?: DecisionEvidenceRef[];
635
+ metadata?: Record<string, unknown>;
454
636
  };
455
637
  export interface ApplyChangesetRequest {
456
638
  initiative_id: string;
@@ -504,6 +686,7 @@ export interface RecordRunOutcomeResponse {
504
686
  }
505
687
  export type RetroFollowUpPriority = 'p0' | 'p1' | 'p2';
506
688
  export interface RetroJson {
689
+ schema_version: RetroArtifactSchemaVersion;
507
690
  summary: string;
508
691
  what_went_well?: string[];
509
692
  what_went_wrong?: string[];
@@ -538,118 +721,27 @@ export interface RecordRunRetroResponse {
538
721
  event_id: string | null;
539
722
  auth_mode?: 'service' | 'api_key';
540
723
  }
541
- 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';
542
- export type RuntimeInstanceState = 'active' | 'stale' | 'stopped' | 'error';
543
- export interface RuntimeInstance {
544
- id: string;
545
- sourceClient: RuntimeSourceClient;
546
- displayName: string;
547
- providerLogo: 'codex' | 'openai' | 'anthropic' | 'openclaw' | 'orgx' | 'unknown';
548
- state: RuntimeInstanceState;
549
- runId: string | null;
550
- correlationId: string | null;
551
- initiativeId: string | null;
552
- workstreamId: string | null;
553
- taskId: string | null;
554
- agentId: string | null;
555
- agentName: string | null;
556
- phase: string | null;
557
- progressPct: number | null;
558
- currentTask: string | null;
559
- lastHeartbeatAt: string | null;
560
- lastEventAt: string;
561
- lastMessage: string | null;
562
- metadata: Record<string, unknown> | null;
563
- }
564
- export interface LiveActivityItem {
565
- id: string;
566
- type: LiveActivityType;
567
- title: string;
568
- description: string | null;
569
- agentId: string | null;
570
- agentName: string | null;
571
- requesterAgentId: string | null;
572
- requesterAgentName: string | null;
573
- executorAgentId: string | null;
574
- executorAgentName: string | null;
575
- runId: string | null;
576
- initiativeId: string | null;
577
- timestamp: string;
578
- phase?: RunPhase | null;
579
- state?: string | null;
580
- kind?: string | null;
581
- summary?: string | null;
582
- decisionRequired?: boolean;
583
- costDelta?: number | null;
584
- runtimeClient?: RuntimeSourceClient | null;
585
- runtimeLabel?: string | null;
586
- runtimeProvider?: RuntimeInstance['providerLogo'] | null;
587
- instanceId?: string | null;
588
- lastHeartbeatAt?: string | null;
589
- metadata?: Record<string, unknown>;
590
- }
591
- export interface SessionTreeNode {
592
- id: string;
593
- parentId: string | null;
594
- runId: string;
595
- title: string;
596
- agentId: string | null;
597
- agentName: string | null;
598
- status: string;
599
- progress: number | null;
600
- initiativeId: string | null;
601
- workstreamId: string | null;
602
- groupId: string;
603
- groupLabel: string;
604
- startedAt: string | null;
605
- updatedAt: string | null;
606
- lastEventAt: string | null;
607
- lastEventSummary: string | null;
608
- blockers: string[];
609
- phase?: RunPhase | null;
610
- state?: string | null;
611
- eta?: string | null;
612
- cost?: number | null;
613
- checkpointCount?: number | null;
614
- blockerReason?: string | null;
615
- runtimeClient?: RuntimeSourceClient | null;
616
- runtimeLabel?: string | null;
617
- runtimeProvider?: RuntimeInstance['providerLogo'] | null;
618
- instanceId?: string | null;
619
- lastHeartbeatAt?: string | null;
620
- }
621
- export interface SessionTreeEdge {
622
- parentId: string;
623
- childId: string;
624
- }
625
- export interface SessionTreeGroup {
626
- id: string;
724
+ export type ProofLevel = "L1_traceability" | "L2_correctness" | "L3_completion" | "L4_adoption" | "L5_impact" | "L6_economics" | "L7_repeatability";
725
+ export type ProofEnforcement = "hard_block" | "soft_warn" | "reporting_only";
726
+ export interface ProofLevelStatus {
727
+ level: ProofLevel;
627
728
  label: string;
628
- status: string | null;
629
- }
630
- export interface SessionTreeResponse {
631
- nodes: SessionTreeNode[];
632
- edges: SessionTreeEdge[];
633
- groups: SessionTreeGroup[];
729
+ passed: boolean;
730
+ enforcement: ProofEnforcement;
731
+ missingFields: string[];
732
+ details?: string;
634
733
  }
635
- export interface HandoffEvent {
636
- id: string;
637
- handoffId: string;
638
- eventType: string;
639
- actorType: string | null;
640
- actorId: string | null;
641
- payload: Record<string, unknown> | null;
642
- createdAt: string;
643
- }
644
- export interface HandoffSummary {
645
- id: string;
646
- title: string;
647
- status: string;
648
- priority: string | null;
649
- summary: string | null;
650
- currentActorType: string | null;
651
- currentActorId: string | null;
652
- createdAt: string;
653
- updatedAt: string;
654
- events: HandoffEvent[];
734
+ export interface ProofChainStatus {
735
+ task_id?: string;
736
+ run_id?: string;
737
+ domain?: OrgxAgentDomain;
738
+ levels: ProofLevelStatus[];
739
+ overall_passed: boolean;
740
+ missing_count: number;
741
+ /** Codes like "no_artifact", "no_quality_gate", "no_outcome" etc. */
742
+ reason_codes: string[];
743
+ }
744
+ export interface ProofStatusRequest {
745
+ task_id?: string;
746
+ run_id?: string;
655
747
  }
@@ -5,3 +5,8 @@
5
5
  * Mirrors the server-side types in orgx/lib/client-integration/types.ts
6
6
  */
7
7
  export {};
8
+ // =============================================================================
9
+ // LIVE SESSION GRAPH + HANDOFFS
10
+ // =============================================================================
11
+ // Live/session/handoff activity shapes are imported and re-exported from
12
+ // ./shared-types.ts to keep dashboard and plugin contracts in lockstep.
@@ -0,0 +1,36 @@
1
+ export type AutoAssignedAgent = {
2
+ id: string;
3
+ name: string;
4
+ domain: string | null;
5
+ };
6
+ export declare function autoAssignEntityForCreate(input: {
7
+ client: {
8
+ getLiveAgents: (payload: {
9
+ initiative: string | null;
10
+ includeIdle: boolean;
11
+ }) => Promise<{
12
+ agents?: unknown[];
13
+ }>;
14
+ delegationPreflight: (payload: {
15
+ intent: string;
16
+ }) => Promise<{
17
+ data?: {
18
+ recommended_split?: Array<{
19
+ owner_domain?: string | null;
20
+ }>;
21
+ };
22
+ }>;
23
+ updateEntity: (entityType: string, entityId: string, payload: Record<string, unknown>) => Promise<unknown>;
24
+ };
25
+ toErrorMessage: (err: unknown) => string;
26
+ entityType: string;
27
+ entityId: string;
28
+ initiativeId: string | null;
29
+ title: string;
30
+ summary: string | null;
31
+ }): Promise<{
32
+ assignmentSource: "orchestrator" | "fallback" | "manual";
33
+ assignedAgents: AutoAssignedAgent[];
34
+ warnings: string[];
35
+ updatedEntity: Record<string, unknown> | null;
36
+ }>;