oxe-cc 0.9.3 → 1.2.1

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 (319) hide show
  1. package/.cursor/commands/oxe-ask.md +1 -1
  2. package/.cursor/commands/oxe-capabilities.md +1 -1
  3. package/.cursor/commands/oxe-checkpoint.md +1 -1
  4. package/.cursor/commands/oxe-compact.md +1 -1
  5. package/.cursor/commands/oxe-dashboard.md +1 -1
  6. package/.cursor/commands/oxe-debug.md +1 -1
  7. package/.cursor/commands/oxe-discuss.md +1 -1
  8. package/.cursor/commands/oxe-execute.md +2 -2
  9. package/.cursor/commands/oxe-forensics.md +1 -1
  10. package/.cursor/commands/oxe-help.md +1 -1
  11. package/.cursor/commands/oxe-loop.md +1 -1
  12. package/.cursor/commands/oxe-milestone.md +1 -1
  13. package/.cursor/commands/oxe-next.md +1 -1
  14. package/.cursor/commands/oxe-obs.md +1 -1
  15. package/.cursor/commands/oxe-plan-agent.md +1 -1
  16. package/.cursor/commands/oxe-plan.md +1 -1
  17. package/.cursor/commands/oxe-project.md +1 -1
  18. package/.cursor/commands/oxe-quick.md +1 -1
  19. package/.cursor/commands/oxe-research.md +1 -1
  20. package/.cursor/commands/oxe-retro.md +1 -1
  21. package/.cursor/commands/oxe-review-pr.md +1 -1
  22. package/.cursor/commands/oxe-route.md +1 -1
  23. package/.cursor/commands/oxe-scan.md +1 -1
  24. package/.cursor/commands/oxe-security.md +1 -1
  25. package/.cursor/commands/oxe-session.md +2 -2
  26. package/.cursor/commands/oxe-ship.md +45 -0
  27. package/.cursor/commands/oxe-skill.md +1 -1
  28. package/.cursor/commands/oxe-spec.md +1 -1
  29. package/.cursor/commands/oxe-ui-review.md +1 -1
  30. package/.cursor/commands/oxe-ui-spec.md +1 -1
  31. package/.cursor/commands/oxe-update.md +1 -1
  32. package/.cursor/commands/oxe-validate-gaps.md +1 -1
  33. package/.cursor/commands/oxe-verify.md +1 -1
  34. package/.cursor/commands/oxe-workstream.md +1 -1
  35. package/.cursor/commands/oxe.md +4 -4
  36. package/.github/copilot-instructions.md +91 -1
  37. package/.github/prompts/oxe-ask.prompt.md +1 -1
  38. package/.github/prompts/oxe-capabilities.prompt.md +1 -1
  39. package/.github/prompts/oxe-checkpoint.prompt.md +1 -1
  40. package/.github/prompts/oxe-compact.prompt.md +1 -1
  41. package/.github/prompts/oxe-dashboard.prompt.md +1 -1
  42. package/.github/prompts/oxe-debug.prompt.md +1 -1
  43. package/.github/prompts/oxe-discuss.prompt.md +1 -1
  44. package/.github/prompts/oxe-execute.prompt.md +2 -2
  45. package/.github/prompts/oxe-forensics.prompt.md +1 -1
  46. package/.github/prompts/oxe-help.prompt.md +1 -1
  47. package/.github/prompts/oxe-loop.prompt.md +1 -1
  48. package/.github/prompts/oxe-milestone.prompt.md +1 -1
  49. package/.github/prompts/oxe-next.prompt.md +1 -1
  50. package/.github/prompts/oxe-obs.prompt.md +1 -1
  51. package/.github/prompts/oxe-plan-agent.prompt.md +1 -1
  52. package/.github/prompts/oxe-plan.prompt.md +1 -1
  53. package/.github/prompts/oxe-project.prompt.md +1 -1
  54. package/.github/prompts/oxe-quick.prompt.md +1 -1
  55. package/.github/prompts/oxe-research.prompt.md +1 -1
  56. package/.github/prompts/oxe-retro.prompt.md +1 -1
  57. package/.github/prompts/oxe-review-pr.prompt.md +1 -1
  58. package/.github/prompts/oxe-route.prompt.md +1 -1
  59. package/.github/prompts/oxe-scan.prompt.md +1 -1
  60. package/.github/prompts/oxe-security.prompt.md +1 -1
  61. package/.github/prompts/oxe-session.prompt.md +2 -2
  62. package/.github/prompts/oxe-ship.prompt.md +45 -0
  63. package/.github/prompts/oxe-skill.prompt.md +1 -1
  64. package/.github/prompts/oxe-spec.prompt.md +1 -1
  65. package/.github/prompts/oxe-ui-review.prompt.md +1 -1
  66. package/.github/prompts/oxe-ui-spec.prompt.md +1 -1
  67. package/.github/prompts/oxe-update.prompt.md +1 -1
  68. package/.github/prompts/oxe-validate-gaps.prompt.md +1 -1
  69. package/.github/prompts/oxe-verify.prompt.md +1 -1
  70. package/.github/prompts/oxe-workstream.prompt.md +1 -1
  71. package/.github/prompts/oxe.prompt.md +3 -3
  72. package/AGENTS.md +43 -28
  73. package/CHANGELOG.md +158 -0
  74. package/README.md +72 -50
  75. package/bin/banner.txt +1 -1
  76. package/bin/lib/oxe-dashboard.cjs +9 -7
  77. package/bin/lib/oxe-operational.cjs +569 -4
  78. package/bin/lib/oxe-project-health.cjs +1 -1
  79. package/bin/oxe-cc.js +141 -57
  80. package/commands/oxe/ask.md +5 -1
  81. package/commands/oxe/checkpoint.md +1 -1
  82. package/commands/oxe/compact.md +1 -1
  83. package/commands/oxe/debug.md +1 -1
  84. package/commands/oxe/execute.md +2 -2
  85. package/commands/oxe/forensics.md +1 -1
  86. package/commands/oxe/loop.md +1 -1
  87. package/commands/oxe/milestone.md +1 -1
  88. package/commands/oxe/next.md +1 -1
  89. package/commands/oxe/obs.md +1 -1
  90. package/commands/oxe/oxe.md +3 -3
  91. package/commands/oxe/project.md +1 -1
  92. package/commands/oxe/research.md +1 -1
  93. package/commands/oxe/retro.md +1 -1
  94. package/commands/oxe/review-pr.md +1 -1
  95. package/commands/oxe/route.md +1 -1
  96. package/commands/oxe/scan.md +1 -1
  97. package/commands/oxe/security.md +1 -1
  98. package/commands/oxe/session.md +2 -2
  99. package/commands/oxe/ship.md +49 -0
  100. package/commands/oxe/spec.md +2 -2
  101. package/commands/oxe/ui-review.md +1 -1
  102. package/commands/oxe/ui-spec.md +1 -1
  103. package/commands/oxe/validate-gaps.md +1 -1
  104. package/commands/oxe/verify.md +2 -2
  105. package/commands/oxe/workstream.md +1 -1
  106. package/lib/runtime/audit/audit-trail.d.ts +71 -0
  107. package/lib/runtime/audit/audit-trail.js +154 -0
  108. package/lib/runtime/audit/index.d.ts +2 -0
  109. package/lib/runtime/audit/index.js +18 -0
  110. package/lib/runtime/audit/policy-pack.d.ts +15 -0
  111. package/lib/runtime/audit/policy-pack.js +57 -0
  112. package/lib/runtime/compiler/graph-compiler.d.ts +83 -0
  113. package/lib/runtime/compiler/graph-compiler.js +135 -0
  114. package/lib/runtime/compiler/index.d.ts +1 -0
  115. package/lib/runtime/compiler/index.js +17 -0
  116. package/lib/runtime/context/context-pack-builder.d.ts +51 -0
  117. package/lib/runtime/context/context-pack-builder.js +178 -0
  118. package/lib/runtime/context/context-pack-store.d.ts +38 -0
  119. package/lib/runtime/context/context-pack-store.js +142 -0
  120. package/lib/runtime/context/context-profiles.d.ts +11 -0
  121. package/lib/runtime/context/context-profiles.js +51 -0
  122. package/lib/runtime/context/index.d.ts +3 -0
  123. package/lib/runtime/context/index.js +19 -0
  124. package/lib/runtime/decision/decision-engine.d.ts +43 -0
  125. package/lib/runtime/decision/decision-engine.js +127 -0
  126. package/lib/runtime/decision/decision-memo.d.ts +53 -0
  127. package/lib/runtime/decision/decision-memo.js +173 -0
  128. package/lib/runtime/decision/index.d.ts +2 -0
  129. package/lib/runtime/decision/index.js +18 -0
  130. package/lib/runtime/delivery/branch-manager.d.ts +19 -0
  131. package/lib/runtime/delivery/branch-manager.js +78 -0
  132. package/lib/runtime/delivery/ci-checks.d.ts +34 -0
  133. package/lib/runtime/delivery/ci-checks.js +209 -0
  134. package/lib/runtime/delivery/index.d.ts +4 -0
  135. package/lib/runtime/delivery/index.js +20 -0
  136. package/lib/runtime/delivery/pr-manager.d.ts +30 -0
  137. package/lib/runtime/delivery/pr-manager.js +82 -0
  138. package/lib/runtime/delivery/promotion-pipeline.d.ts +39 -0
  139. package/lib/runtime/delivery/promotion-pipeline.js +127 -0
  140. package/lib/runtime/events/bus.d.ts +9 -0
  141. package/lib/runtime/events/bus.js +63 -0
  142. package/lib/runtime/events/catalog.d.ts +3 -0
  143. package/lib/runtime/events/catalog.js +30 -0
  144. package/lib/runtime/events/envelope.d.ts +13 -0
  145. package/lib/runtime/events/envelope.js +2 -0
  146. package/lib/runtime/events/index.d.ts +3 -0
  147. package/lib/runtime/events/index.js +19 -0
  148. package/lib/runtime/evidence/evidence-store.d.ts +22 -0
  149. package/lib/runtime/evidence/evidence-store.js +106 -0
  150. package/lib/runtime/evidence/index.d.ts +1 -0
  151. package/lib/runtime/evidence/index.js +17 -0
  152. package/lib/runtime/gate/gate-manager.d.ts +39 -0
  153. package/lib/runtime/gate/gate-manager.js +104 -0
  154. package/lib/runtime/gate/index.d.ts +1 -0
  155. package/lib/runtime/gate/index.js +17 -0
  156. package/lib/runtime/index.d.ts +19 -0
  157. package/lib/runtime/index.js +44 -0
  158. package/lib/runtime/models/attempt.d.ts +12 -0
  159. package/lib/runtime/models/attempt.js +2 -0
  160. package/lib/runtime/models/evidence.d.ts +9 -0
  161. package/lib/runtime/models/evidence.js +2 -0
  162. package/lib/runtime/models/gate-decision.d.ts +10 -0
  163. package/lib/runtime/models/gate-decision.js +2 -0
  164. package/lib/runtime/models/index.d.ts +8 -0
  165. package/lib/runtime/models/index.js +24 -0
  166. package/lib/runtime/models/run.d.ts +13 -0
  167. package/lib/runtime/models/run.js +2 -0
  168. package/lib/runtime/models/session.d.ts +10 -0
  169. package/lib/runtime/models/session.js +2 -0
  170. package/lib/runtime/models/verification-result.d.ts +9 -0
  171. package/lib/runtime/models/verification-result.js +2 -0
  172. package/lib/runtime/models/work-item.d.ts +15 -0
  173. package/lib/runtime/models/work-item.js +2 -0
  174. package/lib/runtime/models/workspace.d.ts +25 -0
  175. package/lib/runtime/models/workspace.js +2 -0
  176. package/lib/runtime/plugins/capability-matrix.d.ts +20 -0
  177. package/lib/runtime/plugins/capability-matrix.js +59 -0
  178. package/lib/runtime/plugins/index.d.ts +4 -0
  179. package/lib/runtime/plugins/index.js +20 -0
  180. package/lib/runtime/plugins/plugin-abi.d.ts +76 -0
  181. package/lib/runtime/plugins/plugin-abi.js +2 -0
  182. package/lib/runtime/plugins/plugin-manifest.d.ts +22 -0
  183. package/lib/runtime/plugins/plugin-manifest.js +91 -0
  184. package/lib/runtime/plugins/plugin-registry.d.ts +21 -0
  185. package/lib/runtime/plugins/plugin-registry.js +119 -0
  186. package/lib/runtime/policy/index.d.ts +1 -0
  187. package/lib/runtime/policy/index.js +17 -0
  188. package/lib/runtime/policy/policy-engine.d.ts +67 -0
  189. package/lib/runtime/policy/policy-engine.js +171 -0
  190. package/lib/runtime/projection/index.d.ts +1 -0
  191. package/lib/runtime/projection/index.js +17 -0
  192. package/lib/runtime/projection/projection-engine.d.ts +11 -0
  193. package/lib/runtime/projection/projection-engine.js +218 -0
  194. package/lib/runtime/reducers/debug-reducer.d.ts +10 -0
  195. package/lib/runtime/reducers/debug-reducer.js +30 -0
  196. package/lib/runtime/reducers/index.d.ts +2 -0
  197. package/lib/runtime/reducers/index.js +18 -0
  198. package/lib/runtime/reducers/run-state-reducer.d.ts +46 -0
  199. package/lib/runtime/reducers/run-state-reducer.js +226 -0
  200. package/lib/runtime/scheduler/agent-registry.d.ts +44 -0
  201. package/lib/runtime/scheduler/agent-registry.js +96 -0
  202. package/lib/runtime/scheduler/agent-roles.d.ts +54 -0
  203. package/lib/runtime/scheduler/agent-roles.js +62 -0
  204. package/lib/runtime/scheduler/index.d.ts +4 -0
  205. package/lib/runtime/scheduler/index.js +20 -0
  206. package/lib/runtime/scheduler/multi-agent-coordinator.d.ts +36 -0
  207. package/lib/runtime/scheduler/multi-agent-coordinator.js +253 -0
  208. package/lib/runtime/scheduler/run-journal.d.ts +18 -0
  209. package/lib/runtime/scheduler/run-journal.js +54 -0
  210. package/lib/runtime/scheduler/scheduler.d.ts +49 -0
  211. package/lib/runtime/scheduler/scheduler.js +324 -0
  212. package/lib/runtime/verification/index.d.ts +2 -0
  213. package/lib/runtime/verification/index.js +18 -0
  214. package/lib/runtime/verification/verification-compiler.d.ts +56 -0
  215. package/lib/runtime/verification/verification-compiler.js +147 -0
  216. package/lib/runtime/verification/verification-manifest.d.ts +58 -0
  217. package/lib/runtime/verification/verification-manifest.js +129 -0
  218. package/lib/runtime/workspace/index.d.ts +5 -0
  219. package/lib/runtime/workspace/index.js +24 -0
  220. package/lib/runtime/workspace/strategies/ephemeral-container.d.ts +22 -0
  221. package/lib/runtime/workspace/strategies/ephemeral-container.js +109 -0
  222. package/lib/runtime/workspace/strategies/git-worktree.d.ts +12 -0
  223. package/lib/runtime/workspace/strategies/git-worktree.js +79 -0
  224. package/lib/runtime/workspace/strategies/inplace.d.ts +10 -0
  225. package/lib/runtime/workspace/strategies/inplace.js +37 -0
  226. package/lib/runtime/workspace/workspace-manager.d.ts +13 -0
  227. package/lib/runtime/workspace/workspace-manager.js +2 -0
  228. package/lib/sdk/index.cjs +24 -7
  229. package/lib/sdk/index.d.ts +17 -7
  230. package/oxe/workflows/ask.md +4 -0
  231. package/oxe/workflows/checkpoint.md +14 -10
  232. package/oxe/workflows/debug.md +19 -15
  233. package/oxe/workflows/execute.md +30 -2
  234. package/oxe/workflows/forensics.md +13 -9
  235. package/oxe/workflows/help.md +97 -49
  236. package/oxe/workflows/loop.md +17 -13
  237. package/oxe/workflows/obs.md +4 -0
  238. package/oxe/workflows/oxe.md +64 -31
  239. package/oxe/workflows/project.md +6 -1
  240. package/oxe/workflows/references/workflow-runtime-contracts.json +23 -0
  241. package/oxe/workflows/research.md +32 -28
  242. package/oxe/workflows/retro.md +4 -0
  243. package/oxe/workflows/review-pr.md +15 -11
  244. package/oxe/workflows/scan.md +4 -0
  245. package/oxe/workflows/security.md +14 -10
  246. package/oxe/workflows/session.md +17 -1
  247. package/oxe/workflows/ship.md +142 -0
  248. package/oxe/workflows/spec.md +15 -0
  249. package/oxe/workflows/ui-review.md +20 -16
  250. package/oxe/workflows/ui-spec.md +7 -3
  251. package/oxe/workflows/validate-gaps.md +13 -9
  252. package/oxe/workflows/verify.md +42 -3
  253. package/package.json +9 -3
  254. package/packages/runtime/package.json +17 -0
  255. package/packages/runtime/src/audit/audit-trail.ts +243 -0
  256. package/packages/runtime/src/audit/index.ts +2 -0
  257. package/packages/runtime/src/audit/policy-pack.ts +62 -0
  258. package/packages/runtime/src/compiler/graph-compiler.ts +245 -0
  259. package/packages/runtime/src/compiler/index.ts +1 -0
  260. package/packages/runtime/src/context/context-pack-builder.ts +259 -0
  261. package/packages/runtime/src/context/context-pack-store.ts +197 -0
  262. package/packages/runtime/src/context/context-profiles.ts +60 -0
  263. package/packages/runtime/src/context/index.ts +3 -0
  264. package/packages/runtime/src/decision/decision-engine.ts +174 -0
  265. package/packages/runtime/src/decision/decision-memo.ts +211 -0
  266. package/packages/runtime/src/decision/index.ts +2 -0
  267. package/packages/runtime/src/delivery/branch-manager.ts +84 -0
  268. package/packages/runtime/src/delivery/ci-checks.ts +252 -0
  269. package/packages/runtime/src/delivery/index.ts +4 -0
  270. package/packages/runtime/src/delivery/pr-manager.ts +112 -0
  271. package/packages/runtime/src/delivery/promotion-pipeline.ts +180 -0
  272. package/packages/runtime/src/events/bus.ts +92 -0
  273. package/packages/runtime/src/events/catalog.ts +29 -0
  274. package/packages/runtime/src/events/envelope.ts +14 -0
  275. package/packages/runtime/src/events/index.ts +3 -0
  276. package/packages/runtime/src/evidence/evidence-store.ts +130 -0
  277. package/packages/runtime/src/evidence/index.ts +1 -0
  278. package/packages/runtime/src/gate/gate-manager.ts +137 -0
  279. package/packages/runtime/src/gate/index.ts +1 -0
  280. package/packages/runtime/src/index.ts +37 -0
  281. package/packages/runtime/src/models/attempt.ts +19 -0
  282. package/packages/runtime/src/models/evidence.ts +21 -0
  283. package/packages/runtime/src/models/gate-decision.ts +21 -0
  284. package/packages/runtime/src/models/index.ts +8 -0
  285. package/packages/runtime/src/models/run.ts +24 -0
  286. package/packages/runtime/src/models/session.ts +11 -0
  287. package/packages/runtime/src/models/verification-result.ts +10 -0
  288. package/packages/runtime/src/models/work-item.ts +25 -0
  289. package/packages/runtime/src/models/workspace.ts +28 -0
  290. package/packages/runtime/src/plugins/capability-matrix.ts +83 -0
  291. package/packages/runtime/src/plugins/index.ts +4 -0
  292. package/packages/runtime/src/plugins/plugin-abi.ts +95 -0
  293. package/packages/runtime/src/plugins/plugin-manifest.ts +113 -0
  294. package/packages/runtime/src/plugins/plugin-registry.ts +124 -0
  295. package/packages/runtime/src/policy/index.ts +1 -0
  296. package/packages/runtime/src/policy/policy-engine.ts +244 -0
  297. package/packages/runtime/src/projection/index.ts +1 -0
  298. package/packages/runtime/src/projection/projection-engine.ts +249 -0
  299. package/packages/runtime/src/reducers/debug-reducer.ts +36 -0
  300. package/packages/runtime/src/reducers/index.ts +2 -0
  301. package/packages/runtime/src/reducers/run-state-reducer.ts +269 -0
  302. package/packages/runtime/src/scheduler/agent-registry.ts +132 -0
  303. package/packages/runtime/src/scheduler/agent-roles.ts +109 -0
  304. package/packages/runtime/src/scheduler/index.ts +4 -0
  305. package/packages/runtime/src/scheduler/multi-agent-coordinator.ts +333 -0
  306. package/packages/runtime/src/scheduler/run-journal.ts +62 -0
  307. package/packages/runtime/src/scheduler/scheduler.ts +441 -0
  308. package/packages/runtime/src/verification/index.ts +2 -0
  309. package/packages/runtime/src/verification/verification-compiler.ts +225 -0
  310. package/packages/runtime/src/verification/verification-manifest.ts +192 -0
  311. package/packages/runtime/src/workspace/index.ts +5 -0
  312. package/packages/runtime/src/workspace/strategies/ephemeral-container.ts +121 -0
  313. package/packages/runtime/src/workspace/strategies/git-worktree.ts +77 -0
  314. package/packages/runtime/src/workspace/strategies/inplace.ts +35 -0
  315. package/packages/runtime/src/workspace/workspace-manager.ts +15 -0
  316. package/packages/runtime/tsconfig.json +17 -0
  317. package/vscode-extension/oxe-agents-0.9.2.vsix +0 -0
  318. package/vscode-extension/oxe-agents-1.0.0.vsix +0 -0
  319. package/vscode-extension/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ export * from './session';
2
+ export * from './run';
3
+ export * from './work-item';
4
+ export * from './attempt';
5
+ export * from './workspace';
6
+ export * from './evidence';
7
+ export * from './gate-decision';
8
+ export * from './verification-result';
@@ -0,0 +1,24 @@
1
+ export type RunStatus =
2
+ | 'planned'
3
+ | 'running'
4
+ | 'paused'
5
+ | 'waiting_approval'
6
+ | 'failed'
7
+ | 'completed'
8
+ | 'replaying'
9
+ | 'aborted'
10
+ | 'cancelled';
11
+
12
+ export type RunMode = 'completo' | 'por_onda' | 'por_tarefa';
13
+ export type RunInitiator = 'user' | 'scheduler' | 'retry' | 'replay';
14
+
15
+ export interface Run {
16
+ run_id: string;
17
+ session_id: string | null;
18
+ graph_version: string;
19
+ started_at: string;
20
+ ended_at: string | null;
21
+ status: RunStatus;
22
+ initiator: RunInitiator;
23
+ mode: RunMode;
24
+ }
@@ -0,0 +1,11 @@
1
+ export type SessionStatus = 'active' | 'archived' | 'closed';
2
+
3
+ export interface Session {
4
+ session_id: string;
5
+ title: string;
6
+ created_at: string;
7
+ status: SessionStatus;
8
+ repo_root: string;
9
+ baseline_commit: string | null;
10
+ active_run_id: string | null;
11
+ }
@@ -0,0 +1,10 @@
1
+ export type VerificationStatus = 'pass' | 'fail' | 'skip' | 'error';
2
+
3
+ export interface VerificationResult {
4
+ verification_id: string;
5
+ work_item_id: string;
6
+ check_id: string;
7
+ status: VerificationStatus;
8
+ evidence_refs: string[];
9
+ summary: string | null;
10
+ }
@@ -0,0 +1,25 @@
1
+ import type { WorkspaceStrategy } from './workspace';
2
+
3
+ export type WorkItemStatus =
4
+ | 'pending'
5
+ | 'ready'
6
+ | 'running'
7
+ | 'completed'
8
+ | 'failed'
9
+ | 'blocked'
10
+ | 'skipped';
11
+
12
+ export type WorkItemType = 'task' | 'checkpoint' | 'gate' | 'verification';
13
+
14
+ export interface WorkItem {
15
+ work_item_id: string;
16
+ run_id: string;
17
+ title: string;
18
+ type: WorkItemType;
19
+ depends_on: string[];
20
+ mutation_scope: string[];
21
+ policy_ref: string | null;
22
+ verify_ref: string[];
23
+ status: WorkItemStatus;
24
+ workspace_strategy: WorkspaceStrategy;
25
+ }
@@ -0,0 +1,28 @@
1
+ export type WorkspaceStrategy = 'inplace' | 'git_worktree' | 'ephemeral_container';
2
+ export type WorkspaceStatus = 'allocating' | 'ready' | 'dirty' | 'disposed' | 'error';
3
+
4
+ export interface Workspace {
5
+ workspace_id: string;
6
+ strategy: WorkspaceStrategy;
7
+ base_commit: string | null;
8
+ branch: string | null;
9
+ container_ref: string | null;
10
+ status: WorkspaceStatus;
11
+ root_path: string;
12
+ }
13
+
14
+ export interface WorkspaceLease {
15
+ workspace_id: string;
16
+ strategy: WorkspaceStrategy;
17
+ branch: string | null;
18
+ base_commit: string | null;
19
+ root_path: string;
20
+ ttl_minutes: number;
21
+ }
22
+
23
+ export interface SnapshotRef {
24
+ snapshot_id: string;
25
+ workspace_id: string;
26
+ commit: string;
27
+ created_at: string;
28
+ }
@@ -0,0 +1,83 @@
1
+ import type { PluginRegistry } from './plugin-registry';
2
+ import { CURRENT_ABI_VERSION } from './plugin-manifest';
3
+
4
+ export type ApiStability = 'stable' | 'experimental' | 'deprecated';
5
+
6
+ export interface ProviderCapabilityEntry {
7
+ name: string;
8
+ provider_type: 'tool' | 'workspace' | 'verifier' | 'context';
9
+ stability: ApiStability;
10
+ since_abi_version: string;
11
+ deprecated_in?: string;
12
+ replacement?: string;
13
+ }
14
+
15
+ export interface CapabilityMatrix {
16
+ abi_version: string;
17
+ entries: ProviderCapabilityEntry[];
18
+ }
19
+
20
+ export function buildMatrix(registry: PluginRegistry): CapabilityMatrix {
21
+ const entries: ProviderCapabilityEntry[] = [];
22
+
23
+ for (const plugin of registry.list()) {
24
+ const providers = plugin.providers ?? [];
25
+
26
+ for (const prov of providers) {
27
+ let provider_type: ProviderCapabilityEntry['provider_type'];
28
+ if (prov.startsWith('tool:')) provider_type = 'tool';
29
+ else if (prov.startsWith('workspace:')) provider_type = 'workspace';
30
+ else if (prov.startsWith('verifier:')) provider_type = 'verifier';
31
+ else if (prov.startsWith('context:')) provider_type = 'context';
32
+ else continue;
33
+
34
+ const name = prov.slice(prov.indexOf(':') + 1);
35
+ entries.push({
36
+ name,
37
+ provider_type,
38
+ stability: 'stable',
39
+ since_abi_version: CURRENT_ABI_VERSION,
40
+ });
41
+ }
42
+ }
43
+
44
+ return { abi_version: CURRENT_ABI_VERSION, entries };
45
+ }
46
+
47
+ export function getStableEntries(matrix: CapabilityMatrix): ProviderCapabilityEntry[] {
48
+ return matrix.entries.filter((e) => e.stability === 'stable');
49
+ }
50
+
51
+ export function getExperimentalEntries(matrix: CapabilityMatrix): ProviderCapabilityEntry[] {
52
+ return matrix.entries.filter((e) => e.stability === 'experimental');
53
+ }
54
+
55
+ export function getDeprecatedEntries(matrix: CapabilityMatrix): ProviderCapabilityEntry[] {
56
+ return matrix.entries.filter((e) => e.stability === 'deprecated');
57
+ }
58
+
59
+ export function markDeprecated(
60
+ matrix: CapabilityMatrix,
61
+ name: string,
62
+ deprecatedIn: string,
63
+ replacement?: string
64
+ ): CapabilityMatrix {
65
+ return {
66
+ ...matrix,
67
+ entries: matrix.entries.map((e) =>
68
+ e.name === name
69
+ ? { ...e, stability: 'deprecated', deprecated_in: deprecatedIn, replacement }
70
+ : e
71
+ ),
72
+ };
73
+ }
74
+
75
+ export function addEntry(
76
+ matrix: CapabilityMatrix,
77
+ entry: ProviderCapabilityEntry
78
+ ): CapabilityMatrix {
79
+ if (matrix.entries.some((e) => e.name === entry.name && e.provider_type === entry.provider_type)) {
80
+ return matrix;
81
+ }
82
+ return { ...matrix, entries: [...matrix.entries, entry] };
83
+ }
@@ -0,0 +1,4 @@
1
+ export * from './plugin-abi';
2
+ export * from './plugin-registry';
3
+ export * from './plugin-manifest';
4
+ export * from './capability-matrix';
@@ -0,0 +1,95 @@
1
+ import type { WorkspaceRequest, WorkspaceManager } from '../workspace/workspace-manager';
2
+ import type { WorkspaceLease, SnapshotRef } from '../models/workspace';
3
+ import type { VerificationResult } from '../models/verification-result';
4
+
5
+ // ─── ToolProvider ────────────────────────────────────────────────────────────
6
+
7
+ export interface ToolInvocationInput {
8
+ action_type: string;
9
+ work_item_id: string;
10
+ run_id: string;
11
+ attempt_id: string;
12
+ params: Record<string, unknown>;
13
+ workspace_root: string;
14
+ }
15
+
16
+ export interface ToolInvocationResult {
17
+ success: boolean;
18
+ output: string;
19
+ evidence_paths: string[];
20
+ side_effects_applied: string[];
21
+ error?: string;
22
+ }
23
+
24
+ export interface ToolProvider {
25
+ readonly name: string;
26
+ readonly kind: 'read' | 'mutation' | 'verification' | 'analysis' | 'external_operation';
27
+ readonly idempotent: boolean;
28
+ supports(actionType: string): boolean;
29
+ invoke(input: ToolInvocationInput): Promise<ToolInvocationResult>;
30
+ }
31
+
32
+ // ─── WorkspaceProvider ───────────────────────────────────────────────────────
33
+
34
+ export interface WorkspaceProvider extends WorkspaceManager {
35
+ readonly name: string;
36
+ supportsStrategy(strategy: string): boolean;
37
+ }
38
+
39
+ // ─── VerifierProvider ────────────────────────────────────────────────────────
40
+
41
+ export interface VerificationInput {
42
+ check_id: string;
43
+ check_type: string;
44
+ command: string | null;
45
+ work_item_id: string;
46
+ workspace_root: string;
47
+ evidence_dir: string;
48
+ }
49
+
50
+ export interface VerifierProvider {
51
+ readonly name: string;
52
+ supports(checkType: string): boolean;
53
+ execute(input: VerificationInput): Promise<VerificationResult>;
54
+ }
55
+
56
+ // ─── ContextProvider ─────────────────────────────────────────────────────────
57
+
58
+ export interface ContextRequest {
59
+ work_item_id: string;
60
+ run_id: string;
61
+ decision_type: 'execute' | 'verify' | 'plan' | 'review';
62
+ artifact_paths: string[];
63
+ project_root: string;
64
+ }
65
+
66
+ export interface PluginContextArtifact {
67
+ source: string;
68
+ weight: number;
69
+ reason: string;
70
+ content?: string;
71
+ }
72
+
73
+ export interface PluginContextArtifacts {
74
+ included: PluginContextArtifact[];
75
+ excluded: Array<{ source: string; reason: string }>;
76
+ total_weight: number;
77
+ }
78
+
79
+ export interface ContextProvider {
80
+ readonly name: string;
81
+ collect(input: ContextRequest): Promise<PluginContextArtifacts>;
82
+ }
83
+
84
+ // ─── OxePlugin (unified) ─────────────────────────────────────────────────────
85
+
86
+ export interface OxePlugin {
87
+ readonly name: string;
88
+ readonly version?: string;
89
+ toolProviders?: ToolProvider[];
90
+ workspaceProviders?: WorkspaceProvider[];
91
+ verifierProviders?: VerifierProvider[];
92
+ contextProviders?: ContextProvider[];
93
+ /** Legacy lifecycle hooks (compatible with oxe-plugins.cjs) */
94
+ hooks?: Record<string, (ctx: Record<string, unknown>) => Promise<void> | void>;
95
+ }
@@ -0,0 +1,113 @@
1
+ import type { OxePlugin } from './plugin-abi';
2
+
3
+ export const CURRENT_ABI_VERSION = '1.0.0';
4
+
5
+ export interface PluginManifest {
6
+ name: string;
7
+ version: string;
8
+ abi_version: string;
9
+ capabilities: Array<'tool' | 'workspace' | 'verifier' | 'context' | 'hooks'>;
10
+ tool_action_types?: string[];
11
+ workspace_strategies?: string[];
12
+ verifier_check_types?: string[];
13
+ context_provider_names?: string[];
14
+ hook_names?: string[];
15
+ }
16
+
17
+ export interface PluginValidationResult {
18
+ valid: boolean;
19
+ errors: string[];
20
+ warnings: string[];
21
+ }
22
+
23
+ export function extractManifest(plugin: OxePlugin): PluginManifest {
24
+ const capabilities: PluginManifest['capabilities'] = [];
25
+ if (plugin.toolProviders?.length) capabilities.push('tool');
26
+ if (plugin.workspaceProviders?.length) capabilities.push('workspace');
27
+ if (plugin.verifierProviders?.length) capabilities.push('verifier');
28
+ if (plugin.contextProviders?.length) capabilities.push('context');
29
+ if (plugin.hooks && Object.keys(plugin.hooks).length > 0) capabilities.push('hooks');
30
+
31
+ return {
32
+ name: plugin.name,
33
+ version: plugin.version ?? '0.0.0',
34
+ abi_version: CURRENT_ABI_VERSION,
35
+ capabilities,
36
+ tool_action_types: plugin.toolProviders?.flatMap((p) =>
37
+ ['read_code', 'generate_patch', 'run_tests', 'collect_evidence', 'custom'].filter((t) => p.supports(t))
38
+ ) ?? [],
39
+ workspace_strategies: plugin.workspaceProviders?.map((p) => p.name) ?? [],
40
+ verifier_check_types: plugin.verifierProviders?.flatMap((p) =>
41
+ ['unit', 'integration', 'smoke', 'policy', 'security', 'custom'].filter((t) => p.supports(t))
42
+ ) ?? [],
43
+ context_provider_names: plugin.contextProviders?.map((p) => p.name) ?? [],
44
+ hook_names: plugin.hooks ? Object.keys(plugin.hooks) : [],
45
+ };
46
+ }
47
+
48
+ export function validatePlugin(plugin: OxePlugin): PluginValidationResult {
49
+ const errors: string[] = [];
50
+ const warnings: string[] = [];
51
+
52
+ if (!plugin.name || typeof plugin.name !== 'string') {
53
+ errors.push('Plugin must have a non-empty string name');
54
+ }
55
+
56
+ if (plugin.version && !/^\d+\.\d+\.\d+/.test(plugin.version)) {
57
+ warnings.push(`Plugin version "${plugin.version}" does not follow semver`);
58
+ }
59
+
60
+ if (!plugin.toolProviders?.length &&
61
+ !plugin.workspaceProviders?.length &&
62
+ !plugin.verifierProviders?.length &&
63
+ !plugin.contextProviders?.length &&
64
+ !plugin.hooks) {
65
+ warnings.push('Plugin declares no providers or hooks — it has no effect');
66
+ }
67
+
68
+ // Validate each tool provider
69
+ for (const tp of plugin.toolProviders ?? []) {
70
+ if (!tp.name) errors.push('ToolProvider missing name');
71
+ if (typeof tp.supports !== 'function') errors.push(`ToolProvider "${tp.name}" missing supports() method`);
72
+ if (typeof tp.invoke !== 'function') errors.push(`ToolProvider "${tp.name}" missing invoke() method`);
73
+ }
74
+
75
+ // Validate each workspace provider
76
+ for (const wp of plugin.workspaceProviders ?? []) {
77
+ if (!wp.name) errors.push('WorkspaceProvider missing name');
78
+ if (typeof wp.supportsStrategy !== 'function') errors.push(`WorkspaceProvider "${wp.name}" missing supportsStrategy()`);
79
+ if (typeof wp.allocate !== 'function') errors.push(`WorkspaceProvider "${wp.name}" missing allocate()`);
80
+ }
81
+
82
+ // Validate each verifier provider
83
+ for (const vp of plugin.verifierProviders ?? []) {
84
+ if (!vp.name) errors.push('VerifierProvider missing name');
85
+ if (typeof vp.supports !== 'function') errors.push(`VerifierProvider "${vp.name}" missing supports()`);
86
+ if (typeof vp.execute !== 'function') errors.push(`VerifierProvider "${vp.name}" missing execute()`);
87
+ }
88
+
89
+ return { valid: errors.length === 0, errors, warnings };
90
+ }
91
+
92
+ export function isAbiCompatible(pluginAbiVersion: string): boolean {
93
+ // Major version must match; minor/patch are backwards-compatible
94
+ const [currMajor] = CURRENT_ABI_VERSION.split('.').map(Number);
95
+ const [plugMajor] = pluginAbiVersion.split('.').map(Number);
96
+ return currMajor === plugMajor;
97
+ }
98
+
99
+ export function sandboxInvoke<T>(
100
+ fn: () => Promise<T>,
101
+ timeoutMs = 10_000
102
+ ): Promise<T> {
103
+ return new Promise<T>((resolve, reject) => {
104
+ const timer = setTimeout(() => {
105
+ reject(new Error(`Plugin invocation timed out after ${timeoutMs}ms`));
106
+ }, timeoutMs);
107
+
108
+ fn().then(
109
+ (result) => { clearTimeout(timer); resolve(result); },
110
+ (err) => { clearTimeout(timer); reject(err instanceof Error ? err : new Error(String(err))); }
111
+ );
112
+ });
113
+ }
@@ -0,0 +1,124 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import type {
4
+ OxePlugin,
5
+ ToolProvider,
6
+ WorkspaceProvider,
7
+ VerifierProvider,
8
+ ContextProvider,
9
+ } from './plugin-abi';
10
+ import { validatePlugin } from './plugin-manifest';
11
+
12
+ export class PluginRegistry {
13
+ private plugins: OxePlugin[] = [];
14
+
15
+ register(plugin: OxePlugin): void {
16
+ if (this.plugins.some((p) => p.name === plugin.name)) {
17
+ throw new Error(`Plugin "${plugin.name}" is already registered`);
18
+ }
19
+ const validation = validatePlugin(plugin);
20
+ if (!validation.valid && validation.errors.length > 0) {
21
+ throw new Error(`Plugin "${plugin.name}" failed validation: ${validation.errors.join('; ')}`);
22
+ }
23
+ this.plugins.push(plugin);
24
+ }
25
+
26
+ unregister(name: string): void {
27
+ this.plugins = this.plugins.filter((p) => p.name !== name);
28
+ }
29
+
30
+ loadFromDirectory(dir: string): string[] {
31
+ if (!fs.existsSync(dir)) return [];
32
+ const loaded: string[] = [];
33
+ for (const file of fs.readdirSync(dir)) {
34
+ if (!file.endsWith('.cjs') && !file.endsWith('.js')) continue;
35
+ const fullPath = path.resolve(dir, file);
36
+ try {
37
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
38
+ const mod = require(fullPath) as OxePlugin | { default?: OxePlugin };
39
+ const plugin = 'default' in mod && mod.default ? mod.default : (mod as OxePlugin);
40
+ if (plugin && plugin.name) {
41
+ this.register(plugin);
42
+ loaded.push(plugin.name);
43
+ }
44
+ } catch {
45
+ // skip invalid plugin files
46
+ }
47
+ }
48
+ return loaded;
49
+ }
50
+
51
+ toolProviderFor(actionType: string): ToolProvider | null {
52
+ for (const plugin of this.plugins) {
53
+ const provider = plugin.toolProviders?.find((p) => p.supports(actionType));
54
+ if (provider) return provider;
55
+ }
56
+ return null;
57
+ }
58
+
59
+ workspaceProviderFor(strategy: string): WorkspaceProvider | null {
60
+ for (const plugin of this.plugins) {
61
+ const provider = plugin.workspaceProviders?.find((p) => p.supportsStrategy(strategy));
62
+ if (provider) return provider;
63
+ }
64
+ return null;
65
+ }
66
+
67
+ verifierProviderFor(checkType: string): VerifierProvider | null {
68
+ for (const plugin of this.plugins) {
69
+ const provider = plugin.verifierProviders?.find((p) => p.supports(checkType));
70
+ if (provider) return provider;
71
+ }
72
+ return null;
73
+ }
74
+
75
+ contextProviderFor(name: string): ContextProvider | null {
76
+ for (const plugin of this.plugins) {
77
+ const provider = plugin.contextProviders?.find((p) => p.name === name);
78
+ if (provider) return provider;
79
+ }
80
+ return null;
81
+ }
82
+
83
+ allContextProviders(): ContextProvider[] {
84
+ return this.plugins.flatMap((p) => p.contextProviders ?? []);
85
+ }
86
+
87
+ allToolProviders(): ToolProvider[] {
88
+ return this.plugins.flatMap((p) => p.toolProviders ?? []);
89
+ }
90
+
91
+ async runHook(
92
+ hookName: string,
93
+ ctx: Record<string, unknown>
94
+ ): Promise<void> {
95
+ for (const plugin of this.plugins) {
96
+ const hook = plugin.hooks?.[hookName];
97
+ if (hook) await hook(ctx);
98
+ }
99
+ }
100
+
101
+ list(): Array<{ name: string; version?: string; providers: string[] }> {
102
+ return this.plugins.map((p) => ({
103
+ name: p.name,
104
+ version: p.version,
105
+ providers: [
106
+ ...(p.toolProviders?.map((tp) => `tool:${tp.name}`) ?? []),
107
+ ...(p.workspaceProviders?.map((wp) => `workspace:${wp.name}`) ?? []),
108
+ ...(p.verifierProviders?.map((vp) => `verifier:${vp.name}`) ?? []),
109
+ ...(p.contextProviders?.map((cp) => `context:${cp.name}`) ?? []),
110
+ ],
111
+ }));
112
+ }
113
+ }
114
+
115
+ let _globalRegistry: PluginRegistry | null = null;
116
+
117
+ export function globalRegistry(): PluginRegistry {
118
+ if (!_globalRegistry) _globalRegistry = new PluginRegistry();
119
+ return _globalRegistry;
120
+ }
121
+
122
+ export function resetGlobalRegistry(): void {
123
+ _globalRegistry = null;
124
+ }
@@ -0,0 +1 @@
1
+ export * from './policy-engine';