@red-codes/agentguard 1.0.0 → 1.1.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 (434) hide show
  1. package/README.md +179 -298
  2. package/dist/args.d.ts.map +1 -0
  3. package/dist/args.js.map +1 -0
  4. package/dist/bin.d.ts.map +1 -0
  5. package/dist/bin.js +29185 -0
  6. package/dist/bin.js.map +7 -0
  7. package/dist/colors.d.ts.map +1 -0
  8. package/dist/colors.js.map +1 -0
  9. package/dist/commands/adoption.d.ts +2 -0
  10. package/dist/commands/adoption.d.ts.map +1 -0
  11. package/dist/commands/adoption.js +172 -0
  12. package/dist/commands/adoption.js.map +1 -0
  13. package/dist/commands/analytics.d.ts +3 -0
  14. package/dist/commands/analytics.d.ts.map +1 -0
  15. package/dist/commands/analytics.js +7 -0
  16. package/dist/commands/analytics.js.map +1 -0
  17. package/dist/commands/audit-verify.d.ts +3 -0
  18. package/dist/commands/audit-verify.d.ts.map +1 -0
  19. package/dist/commands/audit-verify.js +94 -0
  20. package/dist/commands/audit-verify.js.map +1 -0
  21. package/dist/commands/auto-setup.d.ts +28 -0
  22. package/dist/commands/auto-setup.d.ts.map +1 -0
  23. package/dist/commands/auto-setup.js +146 -0
  24. package/dist/commands/auto-setup.js.map +1 -0
  25. package/dist/commands/ci-check.d.ts +13 -0
  26. package/dist/commands/ci-check.d.ts.map +1 -0
  27. package/dist/commands/ci-check.js +286 -0
  28. package/dist/commands/ci-check.js.map +1 -0
  29. package/dist/commands/claude-hook.d.ts +2 -0
  30. package/dist/commands/claude-hook.d.ts.map +1 -0
  31. package/dist/commands/claude-hook.js +254 -0
  32. package/dist/commands/claude-hook.js.map +1 -0
  33. package/dist/commands/claude-init.d.ts.map +1 -0
  34. package/dist/commands/claude-init.js +401 -0
  35. package/dist/commands/claude-init.js.map +1 -0
  36. package/dist/commands/config.d.ts +39 -0
  37. package/dist/commands/config.d.ts.map +1 -0
  38. package/dist/commands/config.js +368 -0
  39. package/dist/commands/config.js.map +1 -0
  40. package/dist/commands/demo.d.ts +2 -0
  41. package/dist/commands/demo.d.ts.map +1 -0
  42. package/dist/commands/demo.js +100 -0
  43. package/dist/commands/demo.js.map +1 -0
  44. package/dist/commands/diff.d.ts +3 -0
  45. package/dist/commands/diff.d.ts.map +1 -0
  46. package/dist/commands/diff.js +364 -0
  47. package/dist/commands/diff.js.map +1 -0
  48. package/dist/commands/evidence-pr.d.ts +3 -0
  49. package/dist/commands/evidence-pr.d.ts.map +1 -0
  50. package/dist/commands/evidence-pr.js +162 -0
  51. package/dist/commands/evidence-pr.js.map +1 -0
  52. package/dist/commands/export.d.ts +22 -0
  53. package/dist/commands/export.d.ts.map +1 -0
  54. package/dist/commands/export.js +92 -0
  55. package/dist/commands/export.js.map +1 -0
  56. package/dist/commands/guard.d.ts +21 -0
  57. package/dist/commands/guard.d.ts.map +1 -0
  58. package/dist/commands/guard.js +272 -0
  59. package/dist/commands/guard.js.map +1 -0
  60. package/dist/commands/import.d.ts +3 -0
  61. package/dist/commands/import.d.ts.map +1 -0
  62. package/dist/{cli/commands → commands}/import.js +25 -26
  63. package/dist/commands/import.js.map +1 -0
  64. package/dist/commands/init.d.ts +5 -0
  65. package/dist/commands/init.d.ts.map +1 -0
  66. package/dist/commands/init.js +1288 -0
  67. package/dist/commands/init.js.map +1 -0
  68. package/dist/commands/inspect.d.ts +4 -0
  69. package/dist/commands/inspect.d.ts.map +1 -0
  70. package/dist/{cli/commands → commands}/inspect.js +97 -70
  71. package/dist/commands/inspect.js.map +1 -0
  72. package/dist/commands/learn.d.ts +2 -0
  73. package/dist/commands/learn.d.ts.map +1 -0
  74. package/dist/commands/learn.js +264 -0
  75. package/dist/commands/learn.js.map +1 -0
  76. package/dist/commands/migrate.d.ts +3 -0
  77. package/dist/commands/migrate.d.ts.map +1 -0
  78. package/dist/commands/migrate.js +270 -0
  79. package/dist/commands/migrate.js.map +1 -0
  80. package/dist/commands/plugin.d.ts.map +1 -0
  81. package/dist/{cli/commands → commands}/plugin.js +2 -2
  82. package/dist/commands/plugin.js.map +1 -0
  83. package/dist/commands/policy-verify.d.ts +46 -0
  84. package/dist/commands/policy-verify.d.ts.map +1 -0
  85. package/dist/commands/policy-verify.js +173 -0
  86. package/dist/commands/policy-verify.js.map +1 -0
  87. package/dist/commands/policy.d.ts +27 -0
  88. package/dist/commands/policy.d.ts.map +1 -0
  89. package/dist/commands/policy.js +590 -0
  90. package/dist/commands/policy.js.map +1 -0
  91. package/dist/{cli/commands → commands}/replay.d.ts +2 -1
  92. package/dist/commands/replay.d.ts.map +1 -0
  93. package/dist/{cli/commands → commands}/replay.js +78 -12
  94. package/dist/commands/replay.js.map +1 -0
  95. package/dist/commands/session-viewer.d.ts +5 -0
  96. package/dist/commands/session-viewer.d.ts.map +1 -0
  97. package/dist/commands/session-viewer.js +462 -0
  98. package/dist/commands/session-viewer.js.map +1 -0
  99. package/dist/commands/simulate.d.ts +7 -0
  100. package/dist/commands/simulate.d.ts.map +1 -0
  101. package/dist/commands/simulate.js +505 -0
  102. package/dist/commands/simulate.js.map +1 -0
  103. package/dist/commands/status.d.ts +2 -0
  104. package/dist/commands/status.d.ts.map +1 -0
  105. package/dist/commands/status.js +212 -0
  106. package/dist/commands/status.js.map +1 -0
  107. package/dist/commands/traces.d.ts +24 -0
  108. package/dist/commands/traces.d.ts.map +1 -0
  109. package/dist/commands/traces.js +282 -0
  110. package/dist/commands/traces.js.map +1 -0
  111. package/dist/commands/trust.d.ts +6 -0
  112. package/dist/commands/trust.d.ts.map +1 -0
  113. package/dist/commands/trust.js +129 -0
  114. package/dist/commands/trust.js.map +1 -0
  115. package/dist/evidence-summary.d.ts +35 -0
  116. package/dist/evidence-summary.d.ts.map +1 -0
  117. package/dist/evidence-summary.js +202 -0
  118. package/dist/evidence-summary.js.map +1 -0
  119. package/dist/{cli/file-event-store.d.ts → file-event-store.d.ts} +1 -1
  120. package/dist/file-event-store.d.ts.map +1 -0
  121. package/dist/{cli/file-event-store.js → file-event-store.js} +1 -1
  122. package/dist/file-event-store.js.map +1 -0
  123. package/{hooks → dist/hooks}/post-commit +3 -1
  124. package/{hooks → dist/hooks}/post-merge +3 -1
  125. package/dist/hooks/pre-commit +29 -0
  126. package/dist/policy-resolver.d.ts +32 -0
  127. package/dist/policy-resolver.d.ts.map +1 -0
  128. package/dist/policy-resolver.js +171 -0
  129. package/dist/policy-resolver.js.map +1 -0
  130. package/dist/{cli/recorder.d.ts → recorder.d.ts} +1 -1
  131. package/dist/recorder.d.ts.map +1 -0
  132. package/dist/{cli/recorder.js → recorder.js} +1 -1
  133. package/dist/recorder.js.map +1 -0
  134. package/dist/replay-timeline-html.d.ts +21 -0
  135. package/dist/replay-timeline-html.d.ts.map +1 -0
  136. package/dist/replay-timeline-html.js +414 -0
  137. package/dist/replay-timeline-html.js.map +1 -0
  138. package/dist/replay.d.ts.map +1 -0
  139. package/dist/{cli/replay.js → replay.js} +92 -1
  140. package/dist/replay.js.map +1 -0
  141. package/dist/{cli/session-store.d.ts → session-store.d.ts} +5 -0
  142. package/dist/session-store.d.ts.map +1 -0
  143. package/dist/{cli/session-store.js → session-store.js} +1 -0
  144. package/dist/session-store.js.map +1 -0
  145. package/dist/session-viewer-html.d.ts +10 -0
  146. package/dist/session-viewer-html.d.ts.map +1 -0
  147. package/dist/session-viewer-html.js +737 -0
  148. package/dist/session-viewer-html.js.map +1 -0
  149. package/dist/templates/ci-only.yaml +103 -0
  150. package/dist/templates/development.yaml +107 -0
  151. package/dist/templates/permissive.yaml +87 -0
  152. package/dist/templates/strict.yaml +112 -0
  153. package/dist/tui.d.ts +3 -0
  154. package/dist/tui.d.ts.map +1 -0
  155. package/dist/tui.js +2 -0
  156. package/dist/tui.js.map +1 -0
  157. package/package.json +42 -53
  158. package/dist/adapters/claude-code.d.ts +0 -24
  159. package/dist/adapters/claude-code.d.ts.map +0 -1
  160. package/dist/adapters/claude-code.js +0 -99
  161. package/dist/adapters/claude-code.js.map +0 -1
  162. package/dist/adapters/file.d.ts +0 -3
  163. package/dist/adapters/file.d.ts.map +0 -1
  164. package/dist/adapters/file.js +0 -35
  165. package/dist/adapters/file.js.map +0 -1
  166. package/dist/adapters/git.d.ts +0 -3
  167. package/dist/adapters/git.d.ts.map +0 -1
  168. package/dist/adapters/git.js +0 -61
  169. package/dist/adapters/git.js.map +0 -1
  170. package/dist/adapters/registry.d.ts +0 -5
  171. package/dist/adapters/registry.d.ts.map +0 -1
  172. package/dist/adapters/registry.js +0 -15
  173. package/dist/adapters/registry.js.map +0 -1
  174. package/dist/adapters/shell.d.ts +0 -8
  175. package/dist/adapters/shell.d.ts.map +0 -1
  176. package/dist/adapters/shell.js +0 -27
  177. package/dist/adapters/shell.js.map +0 -1
  178. package/dist/cli/args.d.ts.map +0 -1
  179. package/dist/cli/args.js.map +0 -1
  180. package/dist/cli/bin.d.ts.map +0 -1
  181. package/dist/cli/bin.js +0 -5769
  182. package/dist/cli/bin.js.map +0 -7
  183. package/dist/cli/colors.d.ts.map +0 -1
  184. package/dist/cli/colors.js.map +0 -1
  185. package/dist/cli/commands/claude-hook.d.ts +0 -2
  186. package/dist/cli/commands/claude-hook.d.ts.map +0 -1
  187. package/dist/cli/commands/claude-hook.js +0 -110
  188. package/dist/cli/commands/claude-hook.js.map +0 -1
  189. package/dist/cli/commands/claude-init.d.ts.map +0 -1
  190. package/dist/cli/commands/claude-init.js +0 -150
  191. package/dist/cli/commands/claude-init.js.map +0 -1
  192. package/dist/cli/commands/export.d.ts +0 -11
  193. package/dist/cli/commands/export.d.ts.map +0 -1
  194. package/dist/cli/commands/export.js +0 -113
  195. package/dist/cli/commands/export.js.map +0 -1
  196. package/dist/cli/commands/guard.d.ts +0 -12
  197. package/dist/cli/commands/guard.d.ts.map +0 -1
  198. package/dist/cli/commands/guard.js +0 -145
  199. package/dist/cli/commands/guard.js.map +0 -1
  200. package/dist/cli/commands/import.d.ts +0 -2
  201. package/dist/cli/commands/import.d.ts.map +0 -1
  202. package/dist/cli/commands/import.js.map +0 -1
  203. package/dist/cli/commands/inspect.d.ts +0 -3
  204. package/dist/cli/commands/inspect.d.ts.map +0 -1
  205. package/dist/cli/commands/inspect.js.map +0 -1
  206. package/dist/cli/commands/plugin.d.ts.map +0 -1
  207. package/dist/cli/commands/plugin.js.map +0 -1
  208. package/dist/cli/commands/replay.d.ts.map +0 -1
  209. package/dist/cli/commands/replay.js.map +0 -1
  210. package/dist/cli/file-event-store.d.ts.map +0 -1
  211. package/dist/cli/file-event-store.js.map +0 -1
  212. package/dist/cli/policy-resolver.d.ts +0 -4
  213. package/dist/cli/policy-resolver.d.ts.map +0 -1
  214. package/dist/cli/policy-resolver.js +0 -62
  215. package/dist/cli/policy-resolver.js.map +0 -1
  216. package/dist/cli/recorder.d.ts.map +0 -1
  217. package/dist/cli/recorder.js.map +0 -1
  218. package/dist/cli/replay.d.ts.map +0 -1
  219. package/dist/cli/replay.js.map +0 -1
  220. package/dist/cli/session-store.d.ts.map +0 -1
  221. package/dist/cli/session-store.js.map +0 -1
  222. package/dist/cli/tui.d.ts +0 -24
  223. package/dist/cli/tui.d.ts.map +0 -1
  224. package/dist/cli/tui.js +0 -197
  225. package/dist/cli/tui.js.map +0 -1
  226. package/dist/core/actions.d.ts +0 -11
  227. package/dist/core/actions.d.ts.map +0 -1
  228. package/dist/core/actions.js +0 -112
  229. package/dist/core/actions.js.map +0 -1
  230. package/dist/core/adapters.d.ts +0 -19
  231. package/dist/core/adapters.d.ts.map +0 -1
  232. package/dist/core/adapters.js +0 -85
  233. package/dist/core/adapters.js.map +0 -1
  234. package/dist/core/execution-log/bridge.d.ts +0 -12
  235. package/dist/core/execution-log/bridge.d.ts.map +0 -1
  236. package/dist/core/execution-log/bridge.js +0 -112
  237. package/dist/core/execution-log/bridge.js.map +0 -1
  238. package/dist/core/execution-log/event-log.d.ts +0 -7
  239. package/dist/core/execution-log/event-log.d.ts.map +0 -1
  240. package/dist/core/execution-log/event-log.js +0 -103
  241. package/dist/core/execution-log/event-log.js.map +0 -1
  242. package/dist/core/execution-log/event-projections.d.ts +0 -28
  243. package/dist/core/execution-log/event-projections.d.ts.map +0 -1
  244. package/dist/core/execution-log/event-projections.js +0 -272
  245. package/dist/core/execution-log/event-projections.js.map +0 -1
  246. package/dist/core/execution-log/event-schema.d.ts +0 -56
  247. package/dist/core/execution-log/event-schema.d.ts.map +0 -1
  248. package/dist/core/execution-log/event-schema.js +0 -160
  249. package/dist/core/execution-log/event-schema.js.map +0 -1
  250. package/dist/core/execution-log/index.d.ts +0 -7
  251. package/dist/core/execution-log/index.d.ts.map +0 -1
  252. package/dist/core/execution-log/index.js +0 -13
  253. package/dist/core/execution-log/index.js.map +0 -1
  254. package/dist/core/hash.d.ts +0 -5
  255. package/dist/core/hash.d.ts.map +0 -1
  256. package/dist/core/hash.js +0 -13
  257. package/dist/core/hash.js.map +0 -1
  258. package/dist/core/rng.d.ts +0 -29
  259. package/dist/core/rng.d.ts.map +0 -1
  260. package/dist/core/rng.js +0 -48
  261. package/dist/core/rng.js.map +0 -1
  262. package/dist/core/types.d.ts +0 -746
  263. package/dist/core/types.d.ts.map +0 -1
  264. package/dist/core/types.js +0 -8
  265. package/dist/core/types.js.map +0 -1
  266. package/dist/events/bus.d.ts +0 -24
  267. package/dist/events/bus.d.ts.map +0 -1
  268. package/dist/events/bus.js +0 -64
  269. package/dist/events/bus.js.map +0 -1
  270. package/dist/events/decision-jsonl.d.ts +0 -8
  271. package/dist/events/decision-jsonl.d.ts.map +0 -1
  272. package/dist/events/decision-jsonl.js +0 -44
  273. package/dist/events/decision-jsonl.js.map +0 -1
  274. package/dist/events/jsonl.d.ts +0 -8
  275. package/dist/events/jsonl.d.ts.map +0 -1
  276. package/dist/events/jsonl.js +0 -46
  277. package/dist/events/jsonl.js.map +0 -1
  278. package/dist/events/schema.d.ts +0 -59
  279. package/dist/events/schema.d.ts.map +0 -1
  280. package/dist/events/schema.js +0 -296
  281. package/dist/events/schema.js.map +0 -1
  282. package/dist/events/store.d.ts +0 -7
  283. package/dist/events/store.d.ts.map +0 -1
  284. package/dist/events/store.js +0 -64
  285. package/dist/events/store.js.map +0 -1
  286. package/dist/invariants/checker.d.ts +0 -15
  287. package/dist/invariants/checker.d.ts.map +0 -1
  288. package/dist/invariants/checker.js +0 -52
  289. package/dist/invariants/checker.js.map +0 -1
  290. package/dist/invariants/definitions.d.ts +0 -33
  291. package/dist/invariants/definitions.d.ts.map +0 -1
  292. package/dist/invariants/definitions.js +0 -168
  293. package/dist/invariants/definitions.js.map +0 -1
  294. package/dist/kernel/aab.d.ts +0 -26
  295. package/dist/kernel/aab.d.ts.map +0 -1
  296. package/dist/kernel/aab.js +0 -149
  297. package/dist/kernel/aab.js.map +0 -1
  298. package/dist/kernel/blast-radius.d.ts +0 -60
  299. package/dist/kernel/blast-radius.d.ts.map +0 -1
  300. package/dist/kernel/blast-radius.js +0 -146
  301. package/dist/kernel/blast-radius.js.map +0 -1
  302. package/dist/kernel/decision.d.ts +0 -40
  303. package/dist/kernel/decision.d.ts.map +0 -1
  304. package/dist/kernel/decision.js +0 -92
  305. package/dist/kernel/decision.js.map +0 -1
  306. package/dist/kernel/decisions/factory.d.ts +0 -12
  307. package/dist/kernel/decisions/factory.d.ts.map +0 -1
  308. package/dist/kernel/decisions/factory.js +0 -56
  309. package/dist/kernel/decisions/factory.js.map +0 -1
  310. package/dist/kernel/decisions/types.d.ts +0 -70
  311. package/dist/kernel/decisions/types.d.ts.map +0 -1
  312. package/dist/kernel/decisions/types.js +0 -5
  313. package/dist/kernel/decisions/types.js.map +0 -1
  314. package/dist/kernel/evidence.d.ts +0 -29
  315. package/dist/kernel/evidence.d.ts.map +0 -1
  316. package/dist/kernel/evidence.js +0 -61
  317. package/dist/kernel/evidence.js.map +0 -1
  318. package/dist/kernel/kernel.d.ts +0 -47
  319. package/dist/kernel/kernel.d.ts.map +0 -1
  320. package/dist/kernel/kernel.js +0 -377
  321. package/dist/kernel/kernel.js.map +0 -1
  322. package/dist/kernel/monitor.d.ts +0 -35
  323. package/dist/kernel/monitor.d.ts.map +0 -1
  324. package/dist/kernel/monitor.js +0 -144
  325. package/dist/kernel/monitor.js.map +0 -1
  326. package/dist/kernel/replay-comparator.d.ts +0 -72
  327. package/dist/kernel/replay-comparator.d.ts.map +0 -1
  328. package/dist/kernel/replay-comparator.js +0 -251
  329. package/dist/kernel/replay-comparator.js.map +0 -1
  330. package/dist/kernel/replay-engine.d.ts +0 -108
  331. package/dist/kernel/replay-engine.d.ts.map +0 -1
  332. package/dist/kernel/replay-engine.js +0 -241
  333. package/dist/kernel/replay-engine.js.map +0 -1
  334. package/dist/kernel/replay-processor.d.ts +0 -109
  335. package/dist/kernel/replay-processor.d.ts.map +0 -1
  336. package/dist/kernel/replay-processor.js +0 -118
  337. package/dist/kernel/replay-processor.js.map +0 -1
  338. package/dist/kernel/simulation/filesystem-simulator.d.ts +0 -3
  339. package/dist/kernel/simulation/filesystem-simulator.d.ts.map +0 -1
  340. package/dist/kernel/simulation/filesystem-simulator.js +0 -81
  341. package/dist/kernel/simulation/filesystem-simulator.js.map +0 -1
  342. package/dist/kernel/simulation/git-simulator.d.ts +0 -5
  343. package/dist/kernel/simulation/git-simulator.d.ts.map +0 -1
  344. package/dist/kernel/simulation/git-simulator.js +0 -115
  345. package/dist/kernel/simulation/git-simulator.js.map +0 -1
  346. package/dist/kernel/simulation/package-simulator.d.ts +0 -5
  347. package/dist/kernel/simulation/package-simulator.d.ts.map +0 -1
  348. package/dist/kernel/simulation/package-simulator.js +0 -164
  349. package/dist/kernel/simulation/package-simulator.js.map +0 -1
  350. package/dist/kernel/simulation/registry.d.ts +0 -3
  351. package/dist/kernel/simulation/registry.d.ts.map +0 -1
  352. package/dist/kernel/simulation/registry.js +0 -24
  353. package/dist/kernel/simulation/registry.js.map +0 -1
  354. package/dist/kernel/simulation/types.d.ts +0 -35
  355. package/dist/kernel/simulation/types.d.ts.map +0 -1
  356. package/dist/kernel/simulation/types.js +0 -4
  357. package/dist/kernel/simulation/types.js.map +0 -1
  358. package/dist/plugins/discovery.d.ts +0 -45
  359. package/dist/plugins/discovery.d.ts.map +0 -1
  360. package/dist/plugins/discovery.js +0 -89
  361. package/dist/plugins/discovery.js.map +0 -1
  362. package/dist/plugins/index.d.ts +0 -10
  363. package/dist/plugins/index.d.ts.map +0 -1
  364. package/dist/plugins/index.js +0 -7
  365. package/dist/plugins/index.js.map +0 -1
  366. package/dist/plugins/registry.d.ts +0 -52
  367. package/dist/plugins/registry.d.ts.map +0 -1
  368. package/dist/plugins/registry.js +0 -148
  369. package/dist/plugins/registry.js.map +0 -1
  370. package/dist/plugins/sandbox.d.ts +0 -87
  371. package/dist/plugins/sandbox.d.ts.map +0 -1
  372. package/dist/plugins/sandbox.js +0 -122
  373. package/dist/plugins/sandbox.js.map +0 -1
  374. package/dist/plugins/types.d.ts +0 -61
  375. package/dist/plugins/types.d.ts.map +0 -1
  376. package/dist/plugins/types.js +0 -16
  377. package/dist/plugins/types.js.map +0 -1
  378. package/dist/plugins/validator.d.ts +0 -36
  379. package/dist/plugins/validator.d.ts.map +0 -1
  380. package/dist/plugins/validator.js +0 -276
  381. package/dist/plugins/validator.js.map +0 -1
  382. package/dist/policy/evaluator.d.ts +0 -41
  383. package/dist/policy/evaluator.d.ts.map +0 -1
  384. package/dist/policy/evaluator.js +0 -111
  385. package/dist/policy/evaluator.js.map +0 -1
  386. package/dist/policy/loader.d.ts +0 -13
  387. package/dist/policy/loader.d.ts.map +0 -1
  388. package/dist/policy/loader.js +0 -118
  389. package/dist/policy/loader.js.map +0 -1
  390. package/dist/policy/pack-loader.d.ts +0 -40
  391. package/dist/policy/pack-loader.d.ts.map +0 -1
  392. package/dist/policy/pack-loader.js +0 -138
  393. package/dist/policy/pack-loader.js.map +0 -1
  394. package/dist/policy/yaml-loader.d.ts +0 -23
  395. package/dist/policy/yaml-loader.d.ts.map +0 -1
  396. package/dist/policy/yaml-loader.js +0 -222
  397. package/dist/policy/yaml-loader.js.map +0 -1
  398. package/dist/renderers/index.d.ts +0 -6
  399. package/dist/renderers/index.d.ts.map +0 -1
  400. package/dist/renderers/index.js +0 -4
  401. package/dist/renderers/index.js.map +0 -1
  402. package/dist/renderers/registry.d.ts +0 -39
  403. package/dist/renderers/registry.d.ts.map +0 -1
  404. package/dist/renderers/registry.js +0 -97
  405. package/dist/renderers/registry.js.map +0 -1
  406. package/dist/renderers/tui-renderer.d.ts +0 -18
  407. package/dist/renderers/tui-renderer.d.ts.map +0 -1
  408. package/dist/renderers/tui-renderer.js +0 -57
  409. package/dist/renderers/tui-renderer.js.map +0 -1
  410. package/dist/renderers/types.d.ts +0 -52
  411. package/dist/renderers/types.d.ts.map +0 -1
  412. package/dist/renderers/types.js +0 -4
  413. package/dist/renderers/types.js.map +0 -1
  414. package/dist/telemetry/index.d.ts +0 -3
  415. package/dist/telemetry/index.d.ts.map +0 -1
  416. package/dist/telemetry/index.js +0 -2
  417. package/dist/telemetry/index.js.map +0 -1
  418. package/dist/telemetry/runtimeLogger.d.ts +0 -9
  419. package/dist/telemetry/runtimeLogger.d.ts.map +0 -1
  420. package/dist/telemetry/runtimeLogger.js +0 -68
  421. package/dist/telemetry/runtimeLogger.js.map +0 -1
  422. package/dist/telemetry/types.d.ts +0 -22
  423. package/dist/telemetry/types.d.ts.map +0 -1
  424. package/dist/telemetry/types.js +0 -4
  425. package/dist/telemetry/types.js.map +0 -1
  426. package/hooks/pre-commit +0 -28
  427. /package/dist/{cli/args.d.ts → args.d.ts} +0 -0
  428. /package/dist/{cli/args.js → args.js} +0 -0
  429. /package/dist/{cli/bin.d.ts → bin.d.ts} +0 -0
  430. /package/dist/{cli/colors.d.ts → colors.d.ts} +0 -0
  431. /package/dist/{cli/colors.js → colors.js} +0 -0
  432. /package/dist/{cli/commands → commands}/claude-init.d.ts +0 -0
  433. /package/dist/{cli/commands → commands}/plugin.d.ts +0 -0
  434. /package/dist/{cli/replay.d.ts → replay.d.ts} +0 -0
@@ -1,746 +0,0 @@
1
- /**
2
- * AgentGuard Core Type Definitions
3
- *
4
- * All shared types for the AgentGuard TypeScript system.
5
- * This is the single source of truth for type contracts across modules.
6
- */
7
- /** Bug severity: 1 (trivial) to 5 (critical) */
8
- export type Severity = 1 | 2 | 3 | 4 | 5;
9
- /** Channel through which a bug was detected */
10
- export type BugSource = 'console' | 'test' | 'build';
11
- /** Monster element types — mirrors ecosystem/data/types.json */
12
- export type MonsterType = 'frontend' | 'backend' | 'devops' | 'testing' | 'architecture' | 'security' | 'ai';
13
- /** Game phase state machine */
14
- export type GamePhase = 'idle' | 'encounter' | 'battle' | 'victory' | 'defeat';
15
- /** A detected bug — the canonical input to the system */
16
- export interface BugEvent {
17
- readonly id: string;
18
- readonly type: string;
19
- readonly source: BugSource;
20
- readonly errorMessage: string;
21
- readonly timestamp: number;
22
- readonly severity: Severity;
23
- readonly file?: string;
24
- readonly line?: number;
25
- readonly fingerprint?: string;
26
- }
27
- /** A BugMon enemy creature */
28
- export interface Monster {
29
- readonly id: number;
30
- readonly name: string;
31
- readonly type: MonsterType;
32
- hp: number;
33
- readonly maxHp: number;
34
- readonly attack: number;
35
- readonly defense: number;
36
- readonly speed: number;
37
- readonly moves: readonly string[];
38
- }
39
- /** A combat move */
40
- export interface Move {
41
- readonly id: string;
42
- readonly name: string;
43
- readonly power: number;
44
- readonly type: MonsterType;
45
- }
46
- /** The player character */
47
- export interface Player {
48
- hp: number;
49
- readonly maxHp: number;
50
- readonly attack: number;
51
- readonly defense: number;
52
- readonly speed: number;
53
- level: number;
54
- xp: number;
55
- }
56
- /** Top-level game state snapshot */
57
- export interface GameState {
58
- readonly player: Player;
59
- readonly activeBugs: Map<string, BugEvent>;
60
- defeatedCount: number;
61
- }
62
- /** All events that flow through the EventBus */
63
- export interface EventMap {
64
- BugDetected: {
65
- bug: BugEvent;
66
- };
67
- BugResolved: {
68
- bugId: string;
69
- resolvedAt: number;
70
- };
71
- MonsterSpawned: {
72
- monster: Monster;
73
- bug: BugEvent;
74
- };
75
- MonsterDefeated: {
76
- monsterId: number;
77
- xp: number;
78
- };
79
- PlayerDamage: {
80
- amount: number;
81
- source: string;
82
- };
83
- BugAnalyzed: {
84
- bugId: string;
85
- suggestion: string;
86
- };
87
- }
88
- /** Result of a damage calculation */
89
- export interface DamageResult {
90
- readonly damage: number;
91
- readonly effectiveness: number;
92
- readonly isCritical: boolean;
93
- }
94
- /** Result of an AI bug analysis */
95
- export interface BugAnalysis {
96
- readonly suggestedFix: string;
97
- readonly confidence: number;
98
- readonly category: string;
99
- readonly relatedPatterns: readonly string[];
100
- }
101
- /** Contract for AI bug analyzers */
102
- export interface BugAnalyzer {
103
- analyzeBug(bug: BugEvent): Promise<BugAnalysis>;
104
- }
105
- /** Common interface for all watchers */
106
- export interface Watcher {
107
- start(): void;
108
- stop(): void;
109
- }
110
- /** Generic validation result */
111
- export interface ValidationResult {
112
- readonly valid: boolean;
113
- readonly errors: string[];
114
- }
115
- /** All canonical event kind constants */
116
- export type EventKind = 'ErrorObserved' | 'BugClassified' | 'ENCOUNTER_STARTED' | 'MOVE_USED' | 'DAMAGE_DEALT' | 'HEALING_APPLIED' | 'PASSIVE_ACTIVATED' | 'BUGMON_FAINTED' | 'CACHE_ATTEMPTED' | 'CACHE_SUCCESS' | 'BATTLE_ENDED' | 'ActivityRecorded' | 'EvolutionTriggered' | 'StateChanged' | 'RunStarted' | 'RunEnded' | 'CheckpointReached' | 'PolicyDenied' | 'UnauthorizedAction' | 'InvariantViolation' | 'BlastRadiusExceeded' | 'MergeGuardFailure' | 'EvidencePackGenerated' | 'ActionRequested' | 'ActionAllowed' | 'ActionDenied' | 'ActionEscalated' | 'ActionExecuted' | 'ActionFailed' | 'DecisionRecorded' | 'SimulationCompleted' | 'PipelineStarted' | 'StageCompleted' | 'StageFailed' | 'PipelineCompleted' | 'PipelineFailed' | 'FileScopeViolation' | 'FileSaved' | 'TestCompleted' | 'BuildCompleted' | 'CommitCreated' | 'CodeReviewed' | 'DeployCompleted' | 'LintCompleted';
117
- /** Event schema definition — required and optional field names */
118
- export interface EventSchema {
119
- readonly required: readonly string[];
120
- readonly optional: readonly string[];
121
- }
122
- /** A canonical domain event */
123
- export interface DomainEvent {
124
- readonly id: string;
125
- readonly kind: EventKind;
126
- readonly timestamp: number;
127
- readonly fingerprint: string;
128
- [key: string]: unknown;
129
- }
130
- /** Filter for querying events */
131
- export interface EventFilter {
132
- readonly kind?: EventKind;
133
- readonly since?: number;
134
- readonly until?: number;
135
- readonly fingerprint?: string;
136
- }
137
- /** Event store interface */
138
- export interface EventStore {
139
- append(event: DomainEvent): void;
140
- query(filter?: EventFilter): DomainEvent[];
141
- replay(fromId?: string): DomainEvent[];
142
- count(): number;
143
- clear(): void;
144
- toNDJSON(): string;
145
- fromNDJSON(ndjson: string): number;
146
- }
147
- /** Expected type strings for runtime shape checking */
148
- export type ShapeFieldType = 'string' | 'number' | 'boolean' | 'array' | 'object';
149
- /** Shape definition with required and optional field type mappings */
150
- export interface ShapeDefinition {
151
- readonly required: Record<string, ShapeFieldType>;
152
- readonly optional: Record<string, ShapeFieldType>;
153
- }
154
- /** Monster rarity tier */
155
- export type Rarity = 'common' | 'uncommon' | 'rare' | 'legendary' | 'evolved';
156
- /** A BugMon creature in battle (mutable HP tracking) */
157
- export interface Bugmon {
158
- readonly id: number;
159
- readonly name: string;
160
- readonly type: string;
161
- readonly hp: number;
162
- currentHP: number;
163
- readonly attack: number;
164
- readonly defense: number;
165
- readonly speed: number;
166
- readonly moves: readonly string[];
167
- readonly passive?: {
168
- readonly name: string;
169
- } | null;
170
- readonly rarity?: Rarity;
171
- readonly color?: string;
172
- readonly sprite?: string;
173
- readonly theme?: string;
174
- readonly description?: string;
175
- readonly evolvesTo?: number;
176
- readonly errorPatterns?: readonly string[];
177
- }
178
- /** A combat move (extended for heal moves) */
179
- export interface BattleMove {
180
- readonly id: string;
181
- readonly name: string;
182
- readonly power: number;
183
- readonly type: string;
184
- readonly category?: string;
185
- }
186
- /** Battle damage result */
187
- export interface BattleDamageResult {
188
- readonly damage: number;
189
- readonly effectiveness: number;
190
- readonly critical: boolean;
191
- }
192
- /** Move resolution result (damage or healing) */
193
- export interface MoveResult {
194
- readonly damage: number;
195
- readonly effectiveness: number;
196
- readonly critical: boolean;
197
- readonly healing?: number;
198
- }
199
- /** Battle state */
200
- export interface BattleState {
201
- readonly playerMon: Bugmon;
202
- readonly enemy: Bugmon;
203
- readonly turn: number;
204
- readonly log: readonly BattleEvent[];
205
- readonly outcome: BattleOutcome;
206
- }
207
- /** Battle outcome */
208
- export type BattleOutcome = 'win' | 'lose' | 'run' | 'cache' | null;
209
- /** Battle event entry in the log */
210
- export interface BattleEvent {
211
- readonly type: string;
212
- readonly side: string;
213
- [key: string]: unknown;
214
- }
215
- /** Type effectiveness chart: attackerType -> defenderType -> multiplier */
216
- export type TypeChart = Record<string, Record<string, number>>;
217
- /** Injectable RNG for deterministic battle testing */
218
- export interface BattleRNG {
219
- random?: () => number;
220
- passive?: () => number;
221
- seed?: number;
222
- }
223
- /** Encounter context for difficulty scaling */
224
- export interface EncounterContext {
225
- readonly playerLevel?: number;
226
- readonly encounterCount?: number;
227
- }
228
- /** Evolution trigger condition */
229
- export interface EvolutionCondition {
230
- readonly event: string;
231
- readonly count: number;
232
- }
233
- /** Evolution trigger linking two monster stages */
234
- export interface EvolutionTrigger {
235
- readonly from: number;
236
- readonly to: number;
237
- readonly condition: EvolutionCondition;
238
- readonly description?: string;
239
- }
240
- /** An evolution chain with stages and triggers */
241
- export interface EvolutionChain {
242
- readonly id: string;
243
- readonly name: string;
244
- readonly stages: readonly {
245
- readonly monsterId: number;
246
- readonly name: string;
247
- }[];
248
- readonly triggers: readonly EvolutionTrigger[];
249
- }
250
- /** Evolution data container */
251
- export interface EvolutionData {
252
- readonly chains: readonly EvolutionChain[];
253
- readonly events?: Record<string, {
254
- readonly label: string;
255
- }>;
256
- }
257
- /** Result of a successful evolution check */
258
- export interface EvolutionResult {
259
- readonly from: Bugmon;
260
- readonly to: Bugmon;
261
- readonly trigger: EvolutionTrigger;
262
- readonly chain: EvolutionChain;
263
- readonly partyIndex?: number;
264
- }
265
- /** Evolution progress for HUD display */
266
- export interface EvolutionProgress {
267
- readonly chainName: string;
268
- readonly eventType: string;
269
- readonly eventLabel: string;
270
- readonly current: number;
271
- readonly required: number;
272
- readonly percentage: number;
273
- readonly evolvesTo: string;
274
- }
275
- /** Combo/streak state */
276
- export interface ComboState {
277
- readonly streak: number;
278
- readonly maxStreak: number;
279
- readonly totalBonusXP: number;
280
- }
281
- /** XP multiplier tier based on combo count */
282
- export interface ComboTier {
283
- readonly min: number;
284
- readonly multiplier: number;
285
- readonly label: string;
286
- }
287
- /** Run status */
288
- export type RunStatus = 'active' | 'completed' | 'abandoned';
289
- /** Encounter mode */
290
- export type EncounterMode = 'idle' | 'active';
291
- /** Encounter entry in a run */
292
- export interface RunEncounter {
293
- readonly monsterId: number;
294
- readonly monsterName: string;
295
- readonly error: string;
296
- readonly file?: string;
297
- readonly line?: number;
298
- readonly timestamp: number;
299
- readonly resolved: boolean;
300
- }
301
- /** Resolution entry in a run */
302
- export interface RunResolution {
303
- readonly monsterId: number;
304
- readonly monsterName: string;
305
- readonly baseXP: number;
306
- readonly totalXP: number;
307
- readonly bonusXP: number;
308
- readonly multiplier: number;
309
- readonly comboStreak: number;
310
- readonly timestamp: number;
311
- }
312
- /** Boss defeat entry in a run */
313
- export interface BossDefeat {
314
- readonly bossId: string;
315
- readonly bossName: string;
316
- readonly xp: number;
317
- readonly timestamp: number;
318
- }
319
- /** Run session state */
320
- export interface RunSession {
321
- readonly runId: string;
322
- readonly startedAt: number;
323
- readonly endedAt: number | null;
324
- readonly repo: string | null;
325
- readonly playerLevel: number;
326
- readonly idleThreshold: number;
327
- readonly encounters: readonly RunEncounter[];
328
- readonly resolutions: readonly RunResolution[];
329
- readonly bossesDefeated: readonly BossDefeat[];
330
- readonly combo: ComboState;
331
- readonly score: number;
332
- readonly totalXP: number;
333
- readonly totalBonusXP: number;
334
- readonly status: RunStatus;
335
- readonly duration?: number;
336
- readonly summary?: RunSummary;
337
- }
338
- /** Run summary stats */
339
- export interface RunSummary {
340
- readonly duration: number;
341
- readonly totalEncounters: number;
342
- readonly totalResolved: number;
343
- readonly unresolvedCount: number;
344
- readonly bossesDefeated: number;
345
- readonly maxCombo: number;
346
- readonly totalXP: number;
347
- readonly totalBonusXP: number;
348
- readonly score: number;
349
- readonly uniqueMonsters: number;
350
- }
351
- /** Current run stats for display */
352
- export interface RunStats {
353
- readonly elapsed: number;
354
- readonly encounters: number;
355
- readonly resolved: number;
356
- readonly unresolved: number;
357
- readonly comboStreak: number;
358
- readonly maxCombo: number;
359
- readonly comboTier: ComboTier | null;
360
- readonly score: number;
361
- readonly totalXP: number;
362
- readonly bossesDefeated: number;
363
- }
364
- /** All-time aggregated stats */
365
- export interface AllTimeStats {
366
- readonly totalRuns: number;
367
- readonly totalEncounters: number;
368
- readonly totalResolved: number;
369
- readonly totalBossesDefeated: number;
370
- readonly totalXP: number;
371
- readonly totalBonusXP: number;
372
- readonly bestScore: number;
373
- readonly bestCombo: number;
374
- readonly totalDuration: number;
375
- readonly uniqueMonsters: Set<number>;
376
- }
377
- /** Run history state */
378
- export interface RunHistory {
379
- readonly runs: readonly RunSummaryEntry[];
380
- readonly allTime: AllTimeStats;
381
- }
382
- /** Serialized run history entry */
383
- export interface RunSummaryEntry extends RunSummary {
384
- readonly runId: string;
385
- readonly startedAt: number;
386
- readonly endedAt: number | null;
387
- readonly status: RunStatus;
388
- readonly repo: string | null;
389
- readonly playerLevel: number;
390
- }
391
- /** Action class categories */
392
- export type ActionClass = 'file' | 'test' | 'git' | 'shell' | 'npm' | 'http' | 'deploy' | 'infra';
393
- /** Action type definition */
394
- export interface ActionDefinition {
395
- readonly class: ActionClass;
396
- readonly description: string;
397
- }
398
- /** Authorization decision */
399
- export type Decision = 'allow' | 'deny' | 'escalate';
400
- /** A canonical action object */
401
- export interface CanonicalAction {
402
- readonly id: string;
403
- readonly type: string;
404
- readonly target: string;
405
- readonly justification: string;
406
- readonly class: ActionClass;
407
- readonly timestamp: number;
408
- readonly fingerprint: string;
409
- [key: string]: unknown;
410
- }
411
- /** Policy capability grant */
412
- export interface Capability {
413
- readonly actions: readonly string[];
414
- readonly scope: string;
415
- }
416
- /** Policy definition */
417
- export interface Policy {
418
- readonly capabilities: readonly string[];
419
- readonly deny?: readonly string[];
420
- readonly maxBlastRadius?: number;
421
- readonly protectedPaths?: readonly string[];
422
- readonly protectedBranches?: readonly string[];
423
- }
424
- /** Policy evaluation result */
425
- export interface PolicyEvalResult {
426
- readonly decision: Decision;
427
- readonly reason: string;
428
- readonly capability?: Capability;
429
- }
430
- /** Invariant type */
431
- export type InvariantType = 'test_result' | 'action' | 'dependency';
432
- /** Invariant definition for domain/invariants.js */
433
- export interface DomainInvariantDef {
434
- readonly id: string;
435
- readonly name?: string;
436
- readonly type: InvariantType;
437
- readonly description: string;
438
- readonly severity: Severity;
439
- readonly condition: {
440
- readonly field: string;
441
- readonly operator: string;
442
- readonly value: unknown;
443
- };
444
- }
445
- /** Invariant evaluation result */
446
- export interface InvariantEvalResult {
447
- readonly holds: boolean;
448
- readonly invariantId: string;
449
- readonly expected: string;
450
- readonly actual: string;
451
- }
452
- /** Reference monitor decision record */
453
- export interface DecisionRecord {
454
- readonly actionId: string;
455
- readonly decision: Decision;
456
- readonly reason: string;
457
- readonly timestamp: number;
458
- readonly policyHash: string;
459
- readonly capability?: Capability;
460
- }
461
- /** Source config for event source registry */
462
- export interface SourceConfig {
463
- readonly name: string;
464
- start(onRawSignal: (raw: string) => void): void;
465
- stop(): void;
466
- readonly meta?: Record<string, unknown>;
467
- }
468
- /** Parsed error from the error parser */
469
- export interface ParsedError {
470
- readonly type: string;
471
- readonly message: string;
472
- readonly rawLines: readonly string[];
473
- fingerprint?: string;
474
- readonly file?: string;
475
- readonly line?: number;
476
- }
477
- /** Bug event from the classifier */
478
- export interface ClassifiedBugEvent {
479
- readonly id: string;
480
- readonly severity: Severity;
481
- readonly type: string;
482
- readonly message: string;
483
- readonly file?: string | null;
484
- readonly line?: number | null;
485
- readonly frequency?: number;
486
- }
487
- /** Pipeline stage ID */
488
- export type StageId = 'plan' | 'build' | 'test' | 'optimize' | 'audit';
489
- /** Agent role */
490
- export type AgentRole = 'architect' | 'builder' | 'tester' | 'optimizer' | 'auditor';
491
- /** Pipeline stage status */
492
- export type StageStatus = 'pending' | 'running' | 'passed' | 'failed' | 'skipped';
493
- /** Stage result */
494
- export interface StageResult {
495
- readonly stageId: StageId;
496
- readonly status: StageStatus;
497
- readonly output?: Record<string, unknown>;
498
- readonly errors?: readonly string[];
499
- readonly duration?: number;
500
- }
501
- /** Pipeline run state */
502
- export interface PipelineRun {
503
- readonly runId: string;
504
- readonly task: string;
505
- readonly stages: Record<StageId, StageResult>;
506
- readonly context: Record<string, unknown>;
507
- readonly events: readonly DomainEvent[];
508
- readonly startedAt: number;
509
- readonly status: 'running' | 'completed' | 'failed';
510
- }
511
- /** Role definition */
512
- export interface RoleDefinition {
513
- readonly name: AgentRole;
514
- readonly description: string;
515
- readonly responsibilities: readonly string[];
516
- readonly allowedOutputs: readonly string[];
517
- readonly canModifyFiles: boolean;
518
- readonly canRunTests: boolean;
519
- readonly canRefactor: boolean;
520
- }
521
- /** Stage definition */
522
- export interface StageDefinition {
523
- readonly id: StageId;
524
- readonly name: string;
525
- readonly requiredRole: AgentRole;
526
- readonly inputRequirements: readonly string[];
527
- readonly outputContract: readonly string[];
528
- }
529
- /** Execution result from an adapter */
530
- export interface ExecutionResult {
531
- readonly success: boolean;
532
- readonly result?: unknown;
533
- readonly error?: string;
534
- }
535
- /** Adapter handler function */
536
- export type AdapterHandler = (action: CanonicalAction) => unknown | Promise<unknown>;
537
- /** Adapter registry interface */
538
- export interface AdapterRegistry {
539
- register(actionClass: string, handler: AdapterHandler): void;
540
- execute(action: CanonicalAction, decisionRecord: DecisionRecord): Promise<ExecutionResult>;
541
- has(actionClass: string): boolean;
542
- listRegistered(): string[];
543
- }
544
- /** Raw agent action before normalization */
545
- export interface RawAgentAction {
546
- readonly tool?: string;
547
- readonly command?: string;
548
- readonly file?: string;
549
- readonly content?: string;
550
- readonly branch?: string;
551
- readonly agent?: string;
552
- [key: string]: unknown;
553
- }
554
- /** Normalized intent from AAB */
555
- export interface NormalizedIntent {
556
- readonly action: string;
557
- readonly target: string;
558
- readonly agent: string;
559
- readonly branch?: string;
560
- readonly command?: string;
561
- readonly filesAffected?: number;
562
- readonly destructive: boolean;
563
- }
564
- /** AAB authorization result */
565
- export interface AuthorizationResult {
566
- readonly allowed: boolean;
567
- readonly decision: Decision;
568
- readonly matchedRule?: string;
569
- readonly matchedPolicy?: string;
570
- readonly reason: string;
571
- readonly severity?: number;
572
- }
573
- /** Intervention mode */
574
- export type Intervention = 'deny' | 'rollback' | 'pause' | 'test-only';
575
- /** Full engine decision */
576
- export interface EngineDecision {
577
- readonly allowed: boolean;
578
- readonly intent: NormalizedIntent;
579
- readonly decision: AuthorizationResult;
580
- readonly violations: readonly {
581
- readonly invariantId: string;
582
- readonly name: string;
583
- readonly severity: number;
584
- readonly expected: string;
585
- readonly actual: string;
586
- }[];
587
- readonly events: readonly DomainEvent[];
588
- readonly evidencePack: EvidencePack | null;
589
- readonly intervention: Intervention | null;
590
- }
591
- /** AgentGuard invariant definition (different from domain/invariants.js) */
592
- export interface AgentGuardInvariant {
593
- readonly id: string;
594
- readonly name: string;
595
- readonly description: string;
596
- readonly severity: number;
597
- check(state: SystemState): InvariantCheckResult;
598
- }
599
- /** System state snapshot for invariant checking */
600
- export interface SystemState {
601
- readonly modifiedFiles?: readonly string[];
602
- readonly filesAffected?: number;
603
- readonly targetBranch?: string;
604
- readonly protectedBranches?: readonly string[];
605
- readonly directPush?: boolean;
606
- readonly forcePush?: boolean;
607
- readonly isPush?: boolean;
608
- readonly testsPass?: boolean;
609
- readonly blastRadiusLimit?: number;
610
- /** File path targeted by the current action */
611
- readonly currentTarget?: string;
612
- /** Shell command of the current action (for shell.exec detection) */
613
- readonly currentCommand?: string;
614
- [key: string]: unknown;
615
- }
616
- /** Result of an invariant check */
617
- export interface InvariantCheckResult {
618
- readonly holds: boolean;
619
- readonly expected: string;
620
- readonly actual: string;
621
- }
622
- /** Evidence pack for audit trail */
623
- export interface EvidencePack {
624
- readonly packId: string;
625
- readonly timestamp: number;
626
- readonly intent: NormalizedIntent;
627
- readonly decision: AuthorizationResult;
628
- readonly violations: readonly unknown[];
629
- readonly events: readonly DomainEvent[];
630
- readonly summary: string;
631
- readonly severity: number;
632
- }
633
- /** Policy rule for AgentGuard */
634
- export interface PolicyRule {
635
- readonly action: string;
636
- readonly effect: Decision;
637
- readonly conditions?: Record<string, unknown>;
638
- readonly reason?: string;
639
- }
640
- /** Policy definition for AgentGuard */
641
- export interface PolicyDefinition {
642
- readonly id: string;
643
- readonly name: string;
644
- readonly description?: string;
645
- readonly rules: readonly PolicyRule[];
646
- readonly severity?: number;
647
- }
648
- /** Escalation level */
649
- export type EscalationLevel = 0 | 1 | 2 | 3;
650
- /** Monitor status */
651
- export interface MonitorStatus {
652
- readonly escalationLevel: EscalationLevel;
653
- readonly totalDenials: number;
654
- readonly totalViolations: number;
655
- readonly recentEvents: readonly DomainEvent[];
656
- }
657
- /** Contract export definition */
658
- export interface ContractExport {
659
- readonly params: readonly string[];
660
- readonly returns: string;
661
- }
662
- /** Module contract */
663
- export interface ModuleContract {
664
- readonly exports: Record<string, ContractExport>;
665
- readonly invariants: readonly string[];
666
- readonly dependencies: readonly string[];
667
- }
668
- /** Actor who caused the execution event */
669
- export type Actor = 'human' | 'agent' | 'system';
670
- /** Source system that produced the event */
671
- export type EventSource = 'cli' | 'ci' | 'git' | 'runtime' | 'editor' | 'governance';
672
- /** Context surrounding an execution event */
673
- export interface ExecutionContext {
674
- readonly repo?: string;
675
- readonly branch?: string;
676
- readonly commit?: string;
677
- readonly file?: string;
678
- readonly agentRunId?: string;
679
- }
680
- /** A universal execution event — the atomic unit of the execution log */
681
- export interface ExecutionEvent {
682
- readonly id: string;
683
- readonly timestamp: number;
684
- readonly actor: Actor;
685
- readonly source: EventSource;
686
- readonly kind: string;
687
- readonly context: ExecutionContext;
688
- readonly payload: Record<string, unknown>;
689
- readonly causedBy?: string;
690
- readonly fingerprint: string;
691
- }
692
- /** Filter for querying execution events */
693
- export interface ExecutionEventFilter {
694
- readonly kind?: string;
695
- readonly actor?: Actor;
696
- readonly source?: EventSource;
697
- readonly since?: number;
698
- readonly until?: number;
699
- readonly agentRunId?: string;
700
- readonly file?: string;
701
- }
702
- /** Execution event log interface */
703
- export interface ExecutionEventLog {
704
- append(event: ExecutionEvent): void;
705
- query(filter?: ExecutionEventFilter): ExecutionEvent[];
706
- replay(fromId?: string): ExecutionEvent[];
707
- trace(eventId: string): ExecutionEvent[];
708
- count(): number;
709
- clear(): void;
710
- toNDJSON(): string;
711
- fromNDJSON(ndjson: string): number;
712
- }
713
- /** Risk score for an agent run */
714
- export interface RiskScore {
715
- readonly agentRunId: string;
716
- readonly score: number;
717
- readonly level: 'low' | 'medium' | 'high' | 'critical';
718
- readonly factors: readonly RiskFactor[];
719
- readonly eventCount: number;
720
- readonly failureCount: number;
721
- readonly violationCount: number;
722
- }
723
- /** Individual risk factor contributing to a score */
724
- export interface RiskFactor {
725
- readonly name: string;
726
- readonly weight: number;
727
- readonly detail: string;
728
- }
729
- /** Cluster of related failures */
730
- export interface FailureCluster {
731
- readonly id: string;
732
- readonly rootEvent: ExecutionEvent;
733
- readonly events: readonly ExecutionEvent[];
734
- readonly commonFile?: string;
735
- readonly commonKind?: string;
736
- readonly severity: number;
737
- }
738
- /** Mapping from an execution event to a game encounter */
739
- export interface EncounterMapping {
740
- readonly eventId: string;
741
- readonly encounterType: 'monster' | 'boss' | 'evolution';
742
- readonly severity: Severity;
743
- readonly name: string;
744
- readonly description: string;
745
- }
746
- //# sourceMappingURL=types.d.ts.map