pi-harness-runtime 1.1.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 (612) hide show
  1. package/.pi/plugins/herdr-clipboard/herdr-plugin.toml +22 -0
  2. package/.pi/plugins/herdr-clipboard/start-bridge.sh +29 -0
  3. package/.pi/plugins/herdr-clipboard/tmux-watch.sh +39 -0
  4. package/CHANGELOG.md +175 -13
  5. package/README.md +87 -1
  6. package/config.toml.example +35 -0
  7. package/harness/autonomous-review.ts +5 -2
  8. package/harness/e2e/chatgpt-quota-scraper.ts +478 -0
  9. package/harness/e2e/glm-quota-scraper.ts +449 -0
  10. package/harness/herdr-agents.ts +6 -2
  11. package/harness/loop-code-agent.ts +4 -1
  12. package/harness/loop-review-agent.ts +5 -6
  13. package/harness/notification-events.ts +2 -2
  14. package/harness/task-graph.d.ts +51 -0
  15. package/index.ts +147 -2
  16. package/package.json +17 -16
  17. package/packages/a2a-adapter/dist/index.d.ts +1 -0
  18. package/packages/a2a-adapter/dist/index.d.ts.map +1 -1
  19. package/packages/a2a-adapter/dist/index.js +1 -0
  20. package/packages/a2a-adapter/dist/index.js.map +1 -1
  21. package/packages/a2a-adapter/package.json +1 -1
  22. package/packages/a2a-adapter/src/discovery.ts +106 -0
  23. package/packages/a2a-adapter/src/index.ts +8 -0
  24. package/packages/architecture-generator/package.json +21 -0
  25. package/packages/architecture-generator/src/adr.ts +51 -0
  26. package/packages/architecture-generator/src/index.ts +9 -0
  27. package/packages/architecture-generator/src/mermaid.ts +76 -0
  28. package/packages/architecture-generator/src/types.ts +30 -0
  29. package/packages/auth/package.json +1 -1
  30. package/packages/autonomous-refactor/package.json +1 -1
  31. package/packages/autonomous-runtime/package.json +1 -1
  32. package/packages/cache-strategy/package.json +1 -1
  33. package/packages/capability-registry/package.json +1 -1
  34. package/packages/checkpoint/package.json +1 -1
  35. package/packages/cli-plugin-sdk/package.json +2 -2
  36. package/packages/clipboard/package.json +1 -1
  37. package/packages/clipboard/src/copy-sync.ts +52 -3
  38. package/packages/clipboard/src/index.ts +1 -0
  39. package/packages/clipboard/src/paste-bridge.ts +86 -0
  40. package/packages/clipboard-plugin/package.json +17 -0
  41. package/packages/clipboard-plugin/src/index.ts +74 -0
  42. package/packages/clipboard-plugin/src/types.ts +30 -0
  43. package/packages/code-generation/package.json +1 -1
  44. package/packages/code-review/package.json +1 -1
  45. package/packages/codex-adapter/package.json +2 -2
  46. package/packages/config-capture/package.json +23 -0
  47. package/packages/config-capture/src/index.ts +357 -0
  48. package/packages/context-compiler/package.json +1 -1
  49. package/packages/context-discovery/package.json +1 -1
  50. package/packages/context-manager/package.json +1 -1
  51. package/packages/cookie-sanitizer/package.json +1 -1
  52. package/packages/cost-optimizer/package.json +1 -1
  53. package/packages/dependency-analyzer/package.json +1 -1
  54. package/packages/django-plugin/package.json +1 -1
  55. package/packages/doc-generator/package.json +1 -1
  56. package/packages/evaluation-engine/package.json +1 -1
  57. package/packages/evaluation-runner/package.json +1 -1
  58. package/packages/event-bus/package.json +1 -1
  59. package/packages/event-bus/src/herdr-bus.ts +4 -1
  60. package/packages/event-store/package.json +1 -1
  61. package/packages/experience-replay/package.json +1 -1
  62. package/packages/feedback-collector/package.json +1 -1
  63. package/packages/file-copy-helper/package.json +17 -0
  64. package/packages/file-copy-helper/src/extension.debug.ts +226 -0
  65. package/packages/file-copy-helper/src/extension.ts +226 -0
  66. package/packages/file-copy-helper/src/index.ts +1 -0
  67. package/packages/framework-detector/package.json +1 -1
  68. package/packages/framework-plugin-sdk/package.json +1 -1
  69. package/packages/frappe-plugin/package.json +1 -1
  70. package/packages/generic-web-plugin/package.json +1 -1
  71. package/packages/health-monitor/package.json +1 -1
  72. package/packages/intent-analyzer/package.json +1 -1
  73. package/packages/knowledge-graph/package.json +24 -0
  74. package/packages/knowledge-graph/src/graph-extractor.ts +338 -0
  75. package/packages/knowledge-graph/src/index.ts +27 -0
  76. package/packages/knowledge-graph/src/mcp-client.ts +237 -0
  77. package/packages/knowledge-graph/src/provenance-linker.ts +101 -0
  78. package/packages/knowledge-graph/src/types.ts +86 -0
  79. package/packages/knowledge-retrieval/package.json +25 -0
  80. package/packages/knowledge-retrieval/src/index.ts +18 -0
  81. package/packages/knowledge-retrieval/src/mcp-client.ts +212 -0
  82. package/packages/knowledge-retrieval/src/types.ts +112 -0
  83. package/packages/laravel-plugin/package.json +1 -1
  84. package/packages/learning-engine/package.json +1 -1
  85. package/packages/mcp-adapter/package.json +1 -1
  86. package/packages/memory-engine/package.json +1 -1
  87. package/packages/milestone-manager/package.json +21 -0
  88. package/packages/milestone-manager/src/engine.ts +105 -0
  89. package/packages/milestone-manager/src/index.ts +6 -0
  90. package/packages/milestone-manager/src/types.ts +28 -0
  91. package/packages/model-registry/package.json +1 -1
  92. package/packages/nextjs-plugin/package.json +1 -1
  93. package/packages/notification/package.json +1 -1
  94. package/packages/notification/src/adapters/line-adapter.ts +119 -0
  95. package/packages/notification/src/index.ts +1 -0
  96. package/packages/notification/src/notification-center.ts +6 -0
  97. package/packages/notification/src/types.ts +7 -2
  98. package/packages/observability/package.json +1 -1
  99. package/packages/okf-indexer/package.json +12 -0
  100. package/packages/okf-indexer/src/cli.ts +25 -0
  101. package/packages/okf-indexer/src/indexer.ts +186 -0
  102. package/packages/performance-optimizer/package.json +1 -1
  103. package/packages/privilege-broker/package.json +1 -1
  104. package/packages/project-analyzer/package.json +1 -1
  105. package/packages/project-bootstrap/package.json +24 -0
  106. package/packages/project-bootstrap/src/bootstrap.ts +166 -0
  107. package/packages/project-bootstrap/src/frappe.ts +97 -0
  108. package/packages/project-bootstrap/src/index.ts +27 -0
  109. package/packages/project-bootstrap/src/minimal.ts +45 -0
  110. package/packages/project-bootstrap/src/types.ts +66 -0
  111. package/packages/project-bootstrap/src/typescript.ts +114 -0
  112. package/packages/projection-engine/package.json +1 -1
  113. package/packages/prompt-compiler/package.json +1 -1
  114. package/packages/prompt-versioning/package.json +1 -1
  115. package/packages/provider-adapter-sdk/package.json +1 -1
  116. package/packages/provider-router/dist/src/types.js +1 -1
  117. package/packages/provider-router/package.json +1 -1
  118. package/packages/provider-selector/package.json +1 -1
  119. package/packages/providers/package.json +1 -1
  120. package/packages/providers/src/adapters.ts +1 -1
  121. package/packages/providers/src/deepagents-adapter.ts +2 -2
  122. package/packages/quota-manager/package.json +1 -1
  123. package/packages/quota-manager/src/quota-manager.ts +1 -4
  124. package/packages/rate-limiter/package.json +1 -1
  125. package/packages/react-vite-plugin/package.json +1 -1
  126. package/packages/release-manager/package.json +1 -1
  127. package/packages/requirement-compiler/package.json +1 -1
  128. package/packages/runtime/package.json +1 -1
  129. package/packages/runtime/src/runtime-api.ts +16 -16
  130. package/packages/scheduler/package.json +1 -1
  131. package/packages/scheduler-adapter/package.json +1 -1
  132. package/packages/session/dist/manager.d.ts.map +1 -1
  133. package/packages/session/dist/manager.js +3 -1
  134. package/packages/session/dist/manager.js.map +1 -1
  135. package/packages/session/package.json +1 -1
  136. package/packages/session/src/manager.ts +4 -1
  137. package/packages/session-api/package.json +1 -1
  138. package/packages/session-export/package.json +1 -1
  139. package/packages/shared-context/package.json +1 -1
  140. package/packages/skill-registry/package.json +1 -1
  141. package/packages/sprint-planner/package.json +1 -1
  142. package/packages/subscription-engine/package.json +1 -1
  143. package/packages/task-compiler/package.json +1 -1
  144. package/packages/tencentdb-memory/package.json +23 -0
  145. package/packages/tencentdb-memory/src/client.ts +130 -0
  146. package/packages/tencentdb-memory/src/index.ts +32 -0
  147. package/packages/tencentdb-memory/src/loader.ts +150 -0
  148. package/packages/tencentdb-memory/src/mcp-tools.ts +213 -0
  149. package/packages/tencentdb-memory/src/types.ts +101 -0
  150. package/packages/tencentdb-sync/package.json +26 -0
  151. package/packages/tencentdb-sync/src/cli.ts +363 -0
  152. package/packages/tencentdb-sync/src/client.ts +268 -0
  153. package/packages/tencentdb-sync/src/config.ts +139 -0
  154. package/packages/tencentdb-sync/src/index.ts +15 -0
  155. package/packages/test-data-generator/package.json +1 -1
  156. package/packages/test-generator/package.json +1 -1
  157. package/packages/todo-bd-sync/package.json +1 -1
  158. package/packages/todo-bd-sync/src/detector.ts +25 -4
  159. package/packages/todo-bd-sync/src/extension.ts +8 -86
  160. package/packages/todo-bd-sync/src/task-analyzer.ts +314 -0
  161. package/packages/token-estimation/package.json +1 -1
  162. package/packages/token-optimizer/package.json +1 -1
  163. package/packages/tui/package.json +1 -1
  164. package/packages/types/package.json +1 -1
  165. package/packages/types/src/agent-worker-types.d.ts +206 -0
  166. package/packages/types/src/ai-providers.d.ts +36 -0
  167. package/packages/types/src/runtime-types.d.ts +6 -0
  168. package/packages/workflow-events/package.json +1 -1
  169. package/packages/workspace-scanner/package.json +1 -1
  170. package/packages/worktree/package.json +1 -1
  171. package/packages/worktree/src/worktree.ts +1 -4
  172. package/packages/write-review/package.json +22 -0
  173. package/packages/write-review/src/blackboard.ts +249 -0
  174. package/packages/write-review/src/gate.ts +169 -0
  175. package/packages/write-review/src/index.ts +65 -0
  176. package/packages/write-review/src/injection.ts +190 -0
  177. package/packages/write-review/src/review.ts +206 -0
  178. package/packages/write-review/src/trigger.ts +133 -0
  179. package/packages/write-review/src/types.ts +90 -0
  180. package/prompts/agents/reviewer.md +57 -0
  181. package/prompts/agents/writer.md +42 -0
  182. package/prompts/slash-commands.md +40 -0
  183. package/prompts/tencentdb-connect.md +35 -0
  184. package/prompts/tencentdb-setup.md +101 -0
  185. package/prompts/tencentdb.md +88 -0
  186. package/prompts/write-review.md +50 -0
  187. package/scripts/check-version-sync.ts +80 -0
  188. package/scripts/convert-skills-to-okf.ts +168 -0
  189. package/scripts/copy-plugins.js +56 -0
  190. package/scripts/gist-auth.ts +64 -0
  191. package/scripts/gist-poll.sh +127 -0
  192. package/scripts/release/actions-monitor.ts +357 -0
  193. package/scripts/release/adapters/base.ts +95 -0
  194. package/scripts/release/adapters/detector.ts +181 -0
  195. package/scripts/release/adapters/node-workspace.ts +230 -0
  196. package/scripts/release/adapters/python.ts +236 -0
  197. package/scripts/release/adapters/rust.ts +129 -0
  198. package/scripts/release/adapters/tauri.ts +298 -0
  199. package/scripts/release/orchestrator.ts +278 -0
  200. package/scripts/release-all.ts +211 -0
  201. package/scripts/scan-secrets.sh +68 -0
  202. package/scripts/skills-sync.ts +487 -0
  203. package/packages/a2a-adapter/tsconfig.json +0 -5
  204. package/packages/auth/dist/minimax-browser-auth.d.ts +0 -89
  205. package/packages/auth/dist/minimax-browser-auth.d.ts.map +0 -1
  206. package/packages/auth/dist/minimax-browser-auth.js +0 -890
  207. package/packages/auth/dist/minimax-browser-auth.js.map +0 -1
  208. package/packages/auth/dist/run-minimax-auth.d.ts +0 -19
  209. package/packages/auth/dist/run-minimax-auth.d.ts.map +0 -1
  210. package/packages/auth/dist/run-minimax-auth.js +0 -112
  211. package/packages/auth/dist/run-minimax-auth.js.map +0 -1
  212. package/packages/auth/tsconfig.json +0 -9
  213. package/packages/autonomous-refactor/tsconfig.json +0 -5
  214. package/packages/autonomous-runtime/test/inbox.test.mjs +0 -266
  215. package/packages/autonomous-runtime/tsconfig.json +0 -22
  216. package/packages/autonomous-runtime/tsconfig.tsbuildinfo +0 -1
  217. package/packages/cache-strategy/tsconfig.json +0 -5
  218. package/packages/capability-registry/src/types.d.ts.map +0 -1
  219. package/packages/capability-registry/src/types.js +0 -10
  220. package/packages/capability-registry/src/types.js.map +0 -1
  221. package/packages/capability-registry/tsconfig.json +0 -22
  222. package/packages/checkpoint/tsconfig.json +0 -33
  223. package/packages/checkpoint/tsconfig.tsbuildinfo +0 -1
  224. package/packages/cli-plugin-sdk/tsconfig.json +0 -11
  225. package/packages/clipboard/dist/src/clipboard.d.ts +0 -11
  226. package/packages/clipboard/dist/src/clipboard.d.ts.map +0 -1
  227. package/packages/clipboard/dist/src/clipboard.js +0 -51
  228. package/packages/clipboard/dist/src/clipboard.js.map +0 -1
  229. package/packages/clipboard/dist/src/copy-sync.d.ts +0 -27
  230. package/packages/clipboard/dist/src/copy-sync.d.ts.map +0 -1
  231. package/packages/clipboard/dist/src/copy-sync.js +0 -170
  232. package/packages/clipboard/dist/src/copy-sync.js.map +0 -1
  233. package/packages/clipboard/dist/src/gist-relay.d.ts +0 -48
  234. package/packages/clipboard/dist/src/gist-relay.d.ts.map +0 -1
  235. package/packages/clipboard/dist/src/gist-relay.js +0 -186
  236. package/packages/clipboard/dist/src/gist-relay.js.map +0 -1
  237. package/packages/clipboard/dist/src/github-login.d.ts +0 -16
  238. package/packages/clipboard/dist/src/github-login.d.ts.map +0 -1
  239. package/packages/clipboard/dist/src/github-login.js +0 -69
  240. package/packages/clipboard/dist/src/github-login.js.map +0 -1
  241. package/packages/clipboard/dist/src/index.d.ts +0 -4
  242. package/packages/clipboard/dist/src/index.d.ts.map +0 -1
  243. package/packages/clipboard/dist/src/index.js +0 -3
  244. package/packages/clipboard/dist/src/index.js.map +0 -1
  245. package/packages/clipboard/dist/src/types.d.ts +0 -13
  246. package/packages/clipboard/dist/src/types.d.ts.map +0 -1
  247. package/packages/clipboard/dist/src/types.js +0 -5
  248. package/packages/clipboard/dist/src/types.js.map +0 -1
  249. package/packages/clipboard/test/mojibake.test.mjs +0 -143
  250. package/packages/clipboard/tsconfig.json +0 -10
  251. package/packages/code-generation/tsconfig.json +0 -33
  252. package/packages/code-generation/tsconfig.tsbuildinfo +0 -1
  253. package/packages/code-review/tsconfig.json +0 -33
  254. package/packages/code-review/tsconfig.tsbuildinfo +0 -1
  255. package/packages/codex-adapter/tsconfig.json +0 -5
  256. package/packages/context-compiler/tsconfig.json +0 -17
  257. package/packages/context-discovery/dist/src/discover.d.ts +0 -3
  258. package/packages/context-discovery/dist/src/discover.d.ts.map +0 -1
  259. package/packages/context-discovery/dist/src/discover.js +0 -42
  260. package/packages/context-discovery/dist/src/discover.js.map +0 -1
  261. package/packages/context-discovery/dist/src/discovery.d.ts +0 -28
  262. package/packages/context-discovery/dist/src/discovery.d.ts.map +0 -1
  263. package/packages/context-discovery/dist/src/discovery.js +0 -21
  264. package/packages/context-discovery/dist/src/discovery.js.map +0 -1
  265. package/packages/context-discovery/dist/src/index.d.ts +0 -3
  266. package/packages/context-discovery/dist/src/index.d.ts.map +0 -1
  267. package/packages/context-discovery/dist/src/index.js +0 -2
  268. package/packages/context-discovery/dist/src/index.js.map +0 -1
  269. package/packages/context-discovery/dist/src/types.d.ts +0 -16
  270. package/packages/context-discovery/dist/src/types.d.ts.map +0 -1
  271. package/packages/context-discovery/dist/src/types.js +0 -2
  272. package/packages/context-discovery/dist/src/types.js.map +0 -1
  273. package/packages/context-discovery/tsconfig.json +0 -10
  274. package/packages/context-manager/tsconfig.json +0 -6
  275. package/packages/cookie-sanitizer/tsconfig.json +0 -8
  276. package/packages/cost-optimizer/tsconfig.json +0 -22
  277. package/packages/dependency-analyzer/dist/src/analyzer.d.ts +0 -17
  278. package/packages/dependency-analyzer/dist/src/analyzer.d.ts.map +0 -1
  279. package/packages/dependency-analyzer/dist/src/analyzer.js +0 -119
  280. package/packages/dependency-analyzer/dist/src/analyzer.js.map +0 -1
  281. package/packages/dependency-analyzer/dist/src/imports.d.ts +0 -12
  282. package/packages/dependency-analyzer/dist/src/imports.d.ts.map +0 -1
  283. package/packages/dependency-analyzer/dist/src/imports.js +0 -73
  284. package/packages/dependency-analyzer/dist/src/imports.js.map +0 -1
  285. package/packages/dependency-analyzer/dist/src/index.d.ts +0 -4
  286. package/packages/dependency-analyzer/dist/src/index.d.ts.map +0 -1
  287. package/packages/dependency-analyzer/dist/src/index.js +0 -3
  288. package/packages/dependency-analyzer/dist/src/index.js.map +0 -1
  289. package/packages/dependency-analyzer/dist/src/types.d.ts +0 -28
  290. package/packages/dependency-analyzer/dist/src/types.d.ts.map +0 -1
  291. package/packages/dependency-analyzer/dist/src/types.js +0 -5
  292. package/packages/dependency-analyzer/dist/src/types.js.map +0 -1
  293. package/packages/dependency-analyzer/test/analyzer.test.js +0 -37
  294. package/packages/dependency-analyzer/tsconfig.json +0 -10
  295. package/packages/django-plugin/tsconfig.json +0 -12
  296. package/packages/doc-generator/tsconfig.json +0 -6
  297. package/packages/evaluation-engine/tsconfig.json +0 -8
  298. package/packages/evaluation-runner/tsconfig.json +0 -5
  299. package/packages/event-bus/dist/src/bus.d.ts +0 -15
  300. package/packages/event-bus/dist/src/bus.d.ts.map +0 -1
  301. package/packages/event-bus/dist/src/bus.js +0 -98
  302. package/packages/event-bus/dist/src/bus.js.map +0 -1
  303. package/packages/event-bus/dist/src/herdr-bus.d.ts +0 -121
  304. package/packages/event-bus/dist/src/herdr-bus.d.ts.map +0 -1
  305. package/packages/event-bus/dist/src/herdr-bus.js +0 -322
  306. package/packages/event-bus/dist/src/herdr-bus.js.map +0 -1
  307. package/packages/event-bus/dist/src/index.d.ts +0 -6
  308. package/packages/event-bus/dist/src/index.d.ts.map +0 -1
  309. package/packages/event-bus/dist/src/index.js +0 -4
  310. package/packages/event-bus/dist/src/index.js.map +0 -1
  311. package/packages/event-bus/dist/src/types.d.ts +0 -27
  312. package/packages/event-bus/dist/src/types.d.ts.map +0 -1
  313. package/packages/event-bus/dist/src/types.js +0 -10
  314. package/packages/event-bus/dist/src/types.js.map +0 -1
  315. package/packages/event-bus/tsconfig.json +0 -10
  316. package/packages/event-store/dist/src/index.d.ts +0 -3
  317. package/packages/event-store/dist/src/index.d.ts.map +0 -1
  318. package/packages/event-store/dist/src/index.js +0 -2
  319. package/packages/event-store/dist/src/index.js.map +0 -1
  320. package/packages/event-store/dist/src/store.d.ts +0 -15
  321. package/packages/event-store/dist/src/store.d.ts.map +0 -1
  322. package/packages/event-store/dist/src/store.js +0 -139
  323. package/packages/event-store/dist/src/store.js.map +0 -1
  324. package/packages/event-store/dist/src/types.d.ts +0 -48
  325. package/packages/event-store/dist/src/types.d.ts.map +0 -1
  326. package/packages/event-store/dist/src/types.js +0 -5
  327. package/packages/event-store/dist/src/types.js.map +0 -1
  328. package/packages/event-store/src/types.d.ts.map +0 -1
  329. package/packages/event-store/src/types.js +0 -5
  330. package/packages/event-store/src/types.js.map +0 -1
  331. package/packages/event-store/tsconfig.json +0 -10
  332. package/packages/experience-replay/tsconfig.json +0 -8
  333. package/packages/feedback-collector/tsconfig.json +0 -5
  334. package/packages/framework-detector/tsconfig.json +0 -33
  335. package/packages/framework-detector/tsconfig.tsbuildinfo +0 -1
  336. package/packages/framework-plugin-sdk/tsconfig.json +0 -33
  337. package/packages/framework-plugin-sdk/tsconfig.tsbuildinfo +0 -1
  338. package/packages/frappe-plugin/tsconfig.json +0 -12
  339. package/packages/generic-web-plugin/tsconfig.json +0 -12
  340. package/packages/health-monitor/tsconfig.json +0 -5
  341. package/packages/intent-analyzer/dist/src/analyzer.d.ts +0 -13
  342. package/packages/intent-analyzer/dist/src/analyzer.d.ts.map +0 -1
  343. package/packages/intent-analyzer/dist/src/analyzer.js +0 -239
  344. package/packages/intent-analyzer/dist/src/analyzer.js.map +0 -1
  345. package/packages/intent-analyzer/dist/src/index.d.ts +0 -3
  346. package/packages/intent-analyzer/dist/src/index.d.ts.map +0 -1
  347. package/packages/intent-analyzer/dist/src/index.js +0 -2
  348. package/packages/intent-analyzer/dist/src/index.js.map +0 -1
  349. package/packages/intent-analyzer/dist/src/types.d.ts +0 -26
  350. package/packages/intent-analyzer/dist/src/types.d.ts.map +0 -1
  351. package/packages/intent-analyzer/dist/src/types.js +0 -7
  352. package/packages/intent-analyzer/dist/src/types.js.map +0 -1
  353. package/packages/intent-analyzer/tsconfig.json +0 -10
  354. package/packages/laravel-plugin/tsconfig.json +0 -12
  355. package/packages/learning-engine/tsconfig.json +0 -8
  356. package/packages/mcp-adapter/tsconfig.json +0 -8
  357. package/packages/memory-engine/tsconfig.json +0 -8
  358. package/packages/model-registry/src/types.d.ts.map +0 -1
  359. package/packages/model-registry/src/types.js +0 -5
  360. package/packages/model-registry/src/types.js.map +0 -1
  361. package/packages/model-registry/tsconfig.json +0 -22
  362. package/packages/nextjs-plugin/tsconfig.json +0 -12
  363. package/packages/notification/dist/adapters/email-adapter.d.ts +0 -17
  364. package/packages/notification/dist/adapters/email-adapter.d.ts.map +0 -1
  365. package/packages/notification/dist/adapters/email-adapter.js +0 -89
  366. package/packages/notification/dist/adapters/email-adapter.js.map +0 -1
  367. package/packages/notification/dist/adapters/ntfy-adapter.d.ts +0 -17
  368. package/packages/notification/dist/adapters/ntfy-adapter.d.ts.map +0 -1
  369. package/packages/notification/dist/adapters/ntfy-adapter.js +0 -84
  370. package/packages/notification/dist/adapters/ntfy-adapter.js.map +0 -1
  371. package/packages/notification/dist/adapters/telegram-adapter.d.ts +0 -17
  372. package/packages/notification/dist/adapters/telegram-adapter.d.ts.map +0 -1
  373. package/packages/notification/dist/adapters/telegram-adapter.js +0 -88
  374. package/packages/notification/dist/adapters/telegram-adapter.js.map +0 -1
  375. package/packages/notification/dist/adapters/webhook-adapter.d.ts +0 -15
  376. package/packages/notification/dist/adapters/webhook-adapter.d.ts.map +0 -1
  377. package/packages/notification/dist/adapters/webhook-adapter.js +0 -64
  378. package/packages/notification/dist/adapters/webhook-adapter.js.map +0 -1
  379. package/packages/notification/dist/base-adapter.d.ts +0 -36
  380. package/packages/notification/dist/base-adapter.d.ts.map +0 -1
  381. package/packages/notification/dist/base-adapter.js +0 -39
  382. package/packages/notification/dist/base-adapter.js.map +0 -1
  383. package/packages/notification/dist/index.d.ts +0 -9
  384. package/packages/notification/dist/index.d.ts.map +0 -1
  385. package/packages/notification/dist/index.js +0 -9
  386. package/packages/notification/dist/index.js.map +0 -1
  387. package/packages/notification/dist/notification-center.d.ts +0 -46
  388. package/packages/notification/dist/notification-center.d.ts.map +0 -1
  389. package/packages/notification/dist/notification-center.js +0 -228
  390. package/packages/notification/dist/notification-center.js.map +0 -1
  391. package/packages/notification/dist/types.d.ts +0 -65
  392. package/packages/notification/dist/types.d.ts.map +0 -1
  393. package/packages/notification/dist/types.js +0 -7
  394. package/packages/notification/dist/types.js.map +0 -1
  395. package/packages/notification/tsconfig.json +0 -8
  396. package/packages/observability/tsconfig.json +0 -33
  397. package/packages/observability/tsconfig.tsbuildinfo +0 -1
  398. package/packages/performance-optimizer/tsconfig.json +0 -8
  399. package/packages/privilege-broker/config/privileges.yaml.example +0 -172
  400. package/packages/privilege-broker/tsconfig.json +0 -22
  401. package/packages/privilege-broker/tsconfig.tsbuildinfo +0 -1
  402. package/packages/project-analyzer/tsconfig.json +0 -33
  403. package/packages/project-analyzer/tsconfig.tsbuildinfo +0 -1
  404. package/packages/projection-engine/dist/src/engine.d.ts +0 -61
  405. package/packages/projection-engine/dist/src/engine.d.ts.map +0 -1
  406. package/packages/projection-engine/dist/src/engine.js +0 -87
  407. package/packages/projection-engine/dist/src/engine.js.map +0 -1
  408. package/packages/projection-engine/dist/src/index.d.ts +0 -2
  409. package/packages/projection-engine/dist/src/index.d.ts.map +0 -1
  410. package/packages/projection-engine/dist/src/index.js +0 -2
  411. package/packages/projection-engine/dist/src/index.js.map +0 -1
  412. package/packages/projection-engine/dist/src/project.d.ts +0 -3
  413. package/packages/projection-engine/dist/src/project.d.ts.map +0 -1
  414. package/packages/projection-engine/dist/src/project.js +0 -24
  415. package/packages/projection-engine/dist/src/project.js.map +0 -1
  416. package/packages/projection-engine/dist/src/types.d.ts +0 -55
  417. package/packages/projection-engine/dist/src/types.d.ts.map +0 -1
  418. package/packages/projection-engine/dist/src/types.js +0 -5
  419. package/packages/projection-engine/dist/src/types.js.map +0 -1
  420. package/packages/projection-engine/src/types.d.ts.map +0 -1
  421. package/packages/projection-engine/src/types.js +0 -5
  422. package/packages/projection-engine/src/types.js.map +0 -1
  423. package/packages/projection-engine/tsconfig.json +0 -10
  424. package/packages/prompt-compiler/tsconfig.json +0 -19
  425. package/packages/prompt-versioning/tsconfig.json +0 -5
  426. package/packages/provider-adapter-sdk/dist/tsconfig.tsbuildinfo +0 -1
  427. package/packages/provider-adapter-sdk/tsconfig.json +0 -34
  428. package/packages/provider-adapter-sdk/tsconfig.tsbuildinfo +0 -1
  429. package/packages/provider-router/tsconfig.json +0 -20
  430. package/packages/provider-selector/tsconfig.json +0 -6
  431. package/packages/providers/dist/adapters.d.ts +0 -133
  432. package/packages/providers/dist/adapters.d.ts.map +0 -1
  433. package/packages/providers/dist/adapters.js +0 -236
  434. package/packages/providers/dist/adapters.js.map +0 -1
  435. package/packages/providers/dist/deepagents-adapter.d.ts +0 -78
  436. package/packages/providers/dist/deepagents-adapter.d.ts.map +0 -1
  437. package/packages/providers/dist/deepagents-adapter.js +0 -323
  438. package/packages/providers/dist/deepagents-adapter.js.map +0 -1
  439. package/packages/providers/dist/glm-usage.d.ts +0 -102
  440. package/packages/providers/dist/glm-usage.d.ts.map +0 -1
  441. package/packages/providers/dist/glm-usage.js +0 -197
  442. package/packages/providers/dist/glm-usage.js.map +0 -1
  443. package/packages/providers/dist/index.d.ts +0 -11
  444. package/packages/providers/dist/index.d.ts.map +0 -1
  445. package/packages/providers/dist/index.js +0 -11
  446. package/packages/providers/dist/index.js.map +0 -1
  447. package/packages/providers/dist/openai-usage.d.ts +0 -103
  448. package/packages/providers/dist/openai-usage.d.ts.map +0 -1
  449. package/packages/providers/dist/openai-usage.js +0 -208
  450. package/packages/providers/dist/openai-usage.js.map +0 -1
  451. package/packages/providers/dist/provider-id.d.ts +0 -46
  452. package/packages/providers/dist/provider-id.d.ts.map +0 -1
  453. package/packages/providers/dist/provider-id.js +0 -113
  454. package/packages/providers/dist/provider-id.js.map +0 -1
  455. package/packages/providers/tsconfig.json +0 -8
  456. package/packages/quota-manager/dist/examples/tui-usage-integration.d.ts +0 -35
  457. package/packages/quota-manager/dist/examples/tui-usage-integration.d.ts.map +0 -1
  458. package/packages/quota-manager/dist/examples/tui-usage-integration.js +0 -73
  459. package/packages/quota-manager/dist/examples/tui-usage-integration.js.map +0 -1
  460. package/packages/quota-manager/dist/index.d.ts +0 -8
  461. package/packages/quota-manager/dist/index.d.ts.map +0 -1
  462. package/packages/quota-manager/dist/index.js +0 -8
  463. package/packages/quota-manager/dist/index.js.map +0 -1
  464. package/packages/quota-manager/dist/quota-manager.d.ts +0 -70
  465. package/packages/quota-manager/dist/quota-manager.d.ts.map +0 -1
  466. package/packages/quota-manager/dist/quota-manager.js +0 -260
  467. package/packages/quota-manager/dist/quota-manager.js.map +0 -1
  468. package/packages/quota-manager/dist/tui-usage-monitor.d.ts +0 -96
  469. package/packages/quota-manager/dist/tui-usage-monitor.d.ts.map +0 -1
  470. package/packages/quota-manager/dist/tui-usage-monitor.js +0 -268
  471. package/packages/quota-manager/dist/tui-usage-monitor.js.map +0 -1
  472. package/packages/quota-manager/tsconfig.json +0 -8
  473. package/packages/rate-limiter/tsconfig.json +0 -5
  474. package/packages/react-vite-plugin/tsconfig.json +0 -12
  475. package/packages/release-manager/tsconfig.json +0 -5
  476. package/packages/requirement-compiler/tsconfig.json +0 -22
  477. package/packages/runtime/dist/command-executor.d.ts +0 -129
  478. package/packages/runtime/dist/command-executor.d.ts.map +0 -1
  479. package/packages/runtime/dist/command-executor.js +0 -383
  480. package/packages/runtime/dist/command-executor.js.map +0 -1
  481. package/packages/runtime/dist/index.d.ts +0 -11
  482. package/packages/runtime/dist/index.d.ts.map +0 -1
  483. package/packages/runtime/dist/index.js +0 -11
  484. package/packages/runtime/dist/index.js.map +0 -1
  485. package/packages/runtime/dist/local-runtime-agent.d.ts +0 -111
  486. package/packages/runtime/dist/local-runtime-agent.d.ts.map +0 -1
  487. package/packages/runtime/dist/local-runtime-agent.js +0 -356
  488. package/packages/runtime/dist/local-runtime-agent.js.map +0 -1
  489. package/packages/runtime/dist/policy-engine.d.ts +0 -203
  490. package/packages/runtime/dist/policy-engine.d.ts.map +0 -1
  491. package/packages/runtime/dist/policy-engine.js +0 -592
  492. package/packages/runtime/dist/policy-engine.js.map +0 -1
  493. package/packages/runtime/dist/runtime-api.d.ts +0 -137
  494. package/packages/runtime/dist/runtime-api.d.ts.map +0 -1
  495. package/packages/runtime/dist/runtime-api.js +0 -454
  496. package/packages/runtime/dist/runtime-api.js.map +0 -1
  497. package/packages/runtime/dist/workspace-manager.d.ts +0 -162
  498. package/packages/runtime/dist/workspace-manager.d.ts.map +0 -1
  499. package/packages/runtime/dist/workspace-manager.js +0 -451
  500. package/packages/runtime/dist/workspace-manager.js.map +0 -1
  501. package/packages/runtime/tsconfig.json +0 -8
  502. package/packages/scheduler-adapter/tsconfig.json +0 -22
  503. package/packages/scheduler-adapter/tsconfig.tsbuildinfo +0 -1
  504. package/packages/session/tsconfig.json +0 -33
  505. package/packages/session/tsconfig.tsbuildinfo +0 -1
  506. package/packages/session-api/dist/src/api.d.ts +0 -83
  507. package/packages/session-api/dist/src/api.d.ts.map +0 -1
  508. package/packages/session-api/dist/src/api.js +0 -49
  509. package/packages/session-api/dist/src/api.js.map +0 -1
  510. package/packages/session-api/dist/src/index.d.ts +0 -2
  511. package/packages/session-api/dist/src/index.d.ts.map +0 -1
  512. package/packages/session-api/dist/src/index.js +0 -2
  513. package/packages/session-api/dist/src/index.js.map +0 -1
  514. package/packages/session-api/dist/src/types.d.ts +0 -22
  515. package/packages/session-api/dist/src/types.d.ts.map +0 -1
  516. package/packages/session-api/dist/src/types.js +0 -5
  517. package/packages/session-api/dist/src/types.js.map +0 -1
  518. package/packages/session-api/tsconfig.json +0 -10
  519. package/packages/session-export/dist/src/exporter.d.ts +0 -28
  520. package/packages/session-export/dist/src/exporter.d.ts.map +0 -1
  521. package/packages/session-export/dist/src/exporter.js +0 -42
  522. package/packages/session-export/dist/src/exporter.js.map +0 -1
  523. package/packages/session-export/dist/src/index.d.ts +0 -2
  524. package/packages/session-export/dist/src/index.d.ts.map +0 -1
  525. package/packages/session-export/dist/src/index.js +0 -2
  526. package/packages/session-export/dist/src/index.js.map +0 -1
  527. package/packages/session-export/dist/src/types.d.ts +0 -20
  528. package/packages/session-export/dist/src/types.d.ts.map +0 -1
  529. package/packages/session-export/dist/src/types.js +0 -5
  530. package/packages/session-export/dist/src/types.js.map +0 -1
  531. package/packages/session-export/tsconfig.json +0 -10
  532. package/packages/skill-registry/tsconfig.json +0 -22
  533. package/packages/sprint-planner/tsconfig.json +0 -5
  534. package/packages/subscription-engine/dist/src/engine.d.ts +0 -13
  535. package/packages/subscription-engine/dist/src/engine.d.ts.map +0 -1
  536. package/packages/subscription-engine/dist/src/engine.js +0 -40
  537. package/packages/subscription-engine/dist/src/engine.js.map +0 -1
  538. package/packages/subscription-engine/dist/src/index.d.ts +0 -2
  539. package/packages/subscription-engine/dist/src/index.d.ts.map +0 -1
  540. package/packages/subscription-engine/dist/src/index.js +0 -2
  541. package/packages/subscription-engine/dist/src/index.js.map +0 -1
  542. package/packages/subscription-engine/dist/src/subscriptions.d.ts +0 -19
  543. package/packages/subscription-engine/dist/src/subscriptions.d.ts.map +0 -1
  544. package/packages/subscription-engine/dist/src/subscriptions.js +0 -39
  545. package/packages/subscription-engine/dist/src/subscriptions.js.map +0 -1
  546. package/packages/subscription-engine/dist/src/types.d.ts +0 -24
  547. package/packages/subscription-engine/dist/src/types.d.ts.map +0 -1
  548. package/packages/subscription-engine/dist/src/types.js +0 -5
  549. package/packages/subscription-engine/dist/src/types.js.map +0 -1
  550. package/packages/subscription-engine/tsconfig.json +0 -10
  551. package/packages/task-compiler/tsconfig.json +0 -24
  552. package/packages/test-data-generator/tsconfig.json +0 -33
  553. package/packages/test-data-generator/tsconfig.tsbuildinfo +0 -1
  554. package/packages/test-generator/tsconfig.json +0 -6
  555. package/packages/token-optimizer/tsconfig.json +0 -6
  556. package/packages/tui/tsconfig.json +0 -8
  557. package/packages/types/src/runtime-types.d.ts.map +0 -1
  558. package/packages/types/src/runtime-types.js +0 -2
  559. package/packages/types/src/runtime-types.js.map +0 -1
  560. package/packages/types/tsconfig.json +0 -21
  561. package/packages/types/tsconfig.tsbuildinfo +0 -1
  562. package/packages/workflow-events/dist/src/events.d.ts +0 -38
  563. package/packages/workflow-events/dist/src/events.d.ts.map +0 -1
  564. package/packages/workflow-events/dist/src/events.js +0 -55
  565. package/packages/workflow-events/dist/src/events.js.map +0 -1
  566. package/packages/workflow-events/dist/src/index.d.ts +0 -2
  567. package/packages/workflow-events/dist/src/index.d.ts.map +0 -1
  568. package/packages/workflow-events/dist/src/index.js +0 -2
  569. package/packages/workflow-events/dist/src/index.js.map +0 -1
  570. package/packages/workflow-events/dist/src/pipeline.d.ts +0 -21
  571. package/packages/workflow-events/dist/src/pipeline.d.ts.map +0 -1
  572. package/packages/workflow-events/dist/src/pipeline.js +0 -36
  573. package/packages/workflow-events/dist/src/pipeline.js.map +0 -1
  574. package/packages/workflow-events/dist/src/types.d.ts +0 -110
  575. package/packages/workflow-events/dist/src/types.d.ts.map +0 -1
  576. package/packages/workflow-events/dist/src/types.js +0 -5
  577. package/packages/workflow-events/dist/src/types.js.map +0 -1
  578. package/packages/workflow-events/src/types.d.ts.map +0 -1
  579. package/packages/workflow-events/src/types.js +0 -5
  580. package/packages/workflow-events/src/types.js.map +0 -1
  581. package/packages/workflow-events/tsconfig.json +0 -10
  582. package/packages/workspace-scanner/dist/src/detect.d.ts +0 -3
  583. package/packages/workspace-scanner/dist/src/detect.d.ts.map +0 -1
  584. package/packages/workspace-scanner/dist/src/detect.js +0 -60
  585. package/packages/workspace-scanner/dist/src/detect.js.map +0 -1
  586. package/packages/workspace-scanner/dist/src/git.d.ts +0 -7
  587. package/packages/workspace-scanner/dist/src/git.d.ts.map +0 -1
  588. package/packages/workspace-scanner/dist/src/git.js +0 -75
  589. package/packages/workspace-scanner/dist/src/git.js.map +0 -1
  590. package/packages/workspace-scanner/dist/src/index.d.ts +0 -5
  591. package/packages/workspace-scanner/dist/src/index.d.ts.map +0 -1
  592. package/packages/workspace-scanner/dist/src/index.js +0 -4
  593. package/packages/workspace-scanner/dist/src/index.js.map +0 -1
  594. package/packages/workspace-scanner/dist/src/scanner.d.ts +0 -11
  595. package/packages/workspace-scanner/dist/src/scanner.d.ts.map +0 -1
  596. package/packages/workspace-scanner/dist/src/scanner.js +0 -59
  597. package/packages/workspace-scanner/dist/src/scanner.js.map +0 -1
  598. package/packages/workspace-scanner/dist/src/types.d.ts +0 -35
  599. package/packages/workspace-scanner/dist/src/types.d.ts.map +0 -1
  600. package/packages/workspace-scanner/dist/src/types.js +0 -5
  601. package/packages/workspace-scanner/dist/src/types.js.map +0 -1
  602. package/packages/workspace-scanner/test/scanner.test.js +0 -31
  603. package/packages/workspace-scanner/tsconfig.json +0 -10
  604. package/packages/worktree/dist/index.d.ts +0 -7
  605. package/packages/worktree/dist/index.d.ts.map +0 -1
  606. package/packages/worktree/dist/index.js +0 -7
  607. package/packages/worktree/dist/index.js.map +0 -1
  608. package/packages/worktree/dist/worktree.d.ts +0 -88
  609. package/packages/worktree/dist/worktree.d.ts.map +0 -1
  610. package/packages/worktree/dist/worktree.js +0 -242
  611. package/packages/worktree/dist/worktree.js.map +0 -1
  612. package/packages/worktree/tsconfig.json +0 -8
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Review Integration
3
+ *
4
+ * Uses pi-subagents review-loop for multi-round code review.
5
+ */
6
+
7
+ import type { WriteReviewStatus } from "./types.js";
8
+
9
+ /**
10
+ * Review round result
11
+ */
12
+ export interface ReviewResult {
13
+ verdict: "approved" | "changes_requested" | "blocked";
14
+ iteration: number;
15
+ message: string;
16
+ changesNeeded?: string[];
17
+ issues?: ReviewIssue[];
18
+ }
19
+
20
+ /**
21
+ * Issue found during review
22
+ */
23
+ export interface ReviewIssue {
24
+ severity: "blocker" | "major" | "minor" | "suggestion";
25
+ type: "correctness" | "security" | "performance" | "style" | "test" | "docs";
26
+ location: string;
27
+ description: string;
28
+ suggestion?: string;
29
+ }
30
+
31
+ /**
32
+ * Build review task for pi-subagents
33
+ */
34
+ export function buildReviewTask(
35
+ status: WriteReviewStatus,
36
+ projectPath: string,
37
+ ): string {
38
+ const codeFiles = status.codeFiles ?? [];
39
+ const iteration = status.iteration;
40
+
41
+ const task = `## Review Task - Iteration ${iteration}
42
+
43
+ Review the code written in this iteration.
44
+
45
+ ### Code Files to Review:
46
+ ${codeFiles.map((f) => `- ${f}`).join("\n") || "No files recorded yet."}
47
+
48
+ ### Project Path: ${projectPath}
49
+
50
+ ### Review Instructions:
51
+ 1. Read the code files listed above.
52
+ 2. Run the review-loop workflow using pi-subagents.
53
+ 3. Focus on: correctness, security, performance, tests, and code style.
54
+ 4. Return a verdict: APPROVED, CHANGES_REQUESTED, or BLOCKED.
55
+
56
+ ### Verdict Format:
57
+ \`\`\`
58
+ ## Verdict: [APPROVED|CHANGES_REQUESTED|BLOCKED]
59
+ [Your detailed review message]
60
+ \`\`\`
61
+
62
+ For CHANGES_REQUESTED, list specific changes needed:
63
+ \`\`\`
64
+ ## Changes Needed:
65
+ 1. [Issue description] - [File:Line]
66
+ 2. [Issue description] - [File:Line]
67
+ \`\`\`
68
+ `;
69
+
70
+ return task;
71
+ }
72
+
73
+ /**
74
+ * Parse verdict from review output
75
+ */
76
+ export function parseVerdict(output: string): {
77
+ verdict: "approved" | "changes_requested" | "blocked";
78
+ message: string;
79
+ changes?: string[];
80
+ } | null {
81
+ const lines = output.split("\n");
82
+ let verdict: "approved" | "changes_requested" | "blocked" | null = null;
83
+ let message = "";
84
+ const changes: string[] = [];
85
+ let inChanges = false;
86
+
87
+ for (const line of lines) {
88
+ const lower = line.toLowerCase();
89
+
90
+ if (lower.includes("## verdict:")) {
91
+ if (lower.includes("approved")) {
92
+ verdict = "approved";
93
+ } else if (
94
+ lower.includes("changes_requested") ||
95
+ lower.includes("changes requested")
96
+ ) {
97
+ verdict = "changes_requested";
98
+ } else if (lower.includes("blocked")) {
99
+ verdict = "blocked";
100
+ }
101
+ continue;
102
+ }
103
+
104
+ if (lower.includes("## changes needed:") || lower.includes("changes:")) {
105
+ inChanges = true;
106
+ continue;
107
+ }
108
+
109
+ if (inChanges && line.trim().match(/^\d+\./)) {
110
+ changes.push(line.trim());
111
+ continue;
112
+ }
113
+
114
+ if (verdict && line.trim()) {
115
+ message += line + "\n";
116
+ }
117
+ }
118
+
119
+ if (!verdict) return null;
120
+
121
+ return {
122
+ verdict,
123
+ message: message.trim(),
124
+ changes: changes.length > 0 ? changes : undefined,
125
+ };
126
+ }
127
+
128
+ /**
129
+ * Review angles for parallel review
130
+ */
131
+ export const REVIEW_ANGLES = [
132
+ {
133
+ name: "correctness",
134
+ description:
135
+ "Verify implementation matches requirements and handles edge cases",
136
+ },
137
+ {
138
+ name: "tests",
139
+ description: "Check test coverage and validity",
140
+ },
141
+ {
142
+ name: "complexity",
143
+ description:
144
+ "Look for unnecessary complexity and opportunities to simplify",
145
+ },
146
+ ];
147
+
148
+ /**
149
+ * Build parallel review prompt
150
+ */
151
+ export function buildParallelReviewPrompt(
152
+ codeFiles: string[],
153
+ projectPath: string,
154
+ ): string {
155
+ return `Run parallel reviewers on this code:
156
+
157
+ 1. **correctness** - Verify implementation matches requirements and handles edge cases
158
+ 2. **tests** - Check test coverage and validity
159
+ 3. **complexity** - Look for unnecessary complexity
160
+
161
+ Files: ${codeFiles.join(", ")}
162
+ Project: ${projectPath}
163
+
164
+ Use pi-subagents to spawn 3 parallel reviewers. Wait for all results, then synthesize into a final verdict.`;
165
+ }
166
+
167
+ /**
168
+ * Format review summary for blackboard
169
+ */
170
+ export function formatReviewSummary(result: ReviewResult): string {
171
+ const lines = [
172
+ `## Review Result - Iteration ${result.iteration}`,
173
+ "",
174
+ `**Verdict:** ${result.verdict.toUpperCase()}`,
175
+ "",
176
+ ];
177
+
178
+ if (result.message) {
179
+ lines.push("### Message");
180
+ lines.push(result.message);
181
+ lines.push("");
182
+ }
183
+
184
+ if (result.changesNeeded && result.changesNeeded.length > 0) {
185
+ lines.push("### Changes Needed");
186
+ for (const change of result.changesNeeded) {
187
+ lines.push(`- ${change}`);
188
+ }
189
+ lines.push("");
190
+ }
191
+
192
+ if (result.issues && result.issues.length > 0) {
193
+ lines.push("### Issues Found");
194
+ for (const issue of result.issues) {
195
+ lines.push(`- [${issue.severity}] ${issue.type}: ${issue.description}`);
196
+ if (issue.location) {
197
+ lines.push(` Location: ${issue.location}`);
198
+ }
199
+ if (issue.suggestion) {
200
+ lines.push(` Suggestion: ${issue.suggestion}`);
201
+ }
202
+ }
203
+ }
204
+
205
+ return lines.join("\n");
206
+ }
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Wiki Prompt Trigger
3
+ *
4
+ * Detects when an agent reads a prompt from {project}/wiki/*
5
+ * This triggers the write-review loop.
6
+ */
7
+
8
+ import { existsSync } from "fs";
9
+ import { join, relative } from "path";
10
+ import type { ReviewTriggerContext } from "./types.js";
11
+
12
+ const DEFAULT_WIKI_DIR = "wiki";
13
+
14
+ /**
15
+ * Detect if a file path is a wiki prompt
16
+ */
17
+ export function isWikiPrompt(filePath: string, projectPath: string): boolean {
18
+ const wikiDir = join(projectPath, DEFAULT_WIKI_DIR);
19
+ const normalizedPath = filePath.replace(/\\/g, "/");
20
+ const normalizedWiki = wikiDir.replace(/\\/g, "/");
21
+
22
+ return (
23
+ normalizedPath.startsWith(normalizedWiki + "/") ||
24
+ normalizedPath.startsWith(normalizedWiki + "\\")
25
+ );
26
+ }
27
+
28
+ /**
29
+ * Extract prompt metadata from wiki path
30
+ */
31
+ export function parseWikiPrompt(
32
+ filePath: string,
33
+ projectPath: string,
34
+ ): { category: string; filename: string } | null {
35
+ const wikiDir = join(projectPath, DEFAULT_WIKI_DIR);
36
+ const rel = relative(wikiDir, filePath).replace(/\\/g, "/");
37
+
38
+ if (!rel || rel.startsWith("..")) return null;
39
+
40
+ const parts = rel.split("/");
41
+ if (parts.length >= 2) {
42
+ return {
43
+ category: parts[0],
44
+ filename: parts.slice(1).join("/"),
45
+ };
46
+ }
47
+ return {
48
+ category: "root",
49
+ filename: parts[0],
50
+ };
51
+ }
52
+
53
+ /**
54
+ * Get all wiki prompt files in a project
55
+ */
56
+ export function getWikiPrompts(
57
+ projectPath: string,
58
+ ): { path: string; category: string; filename: string }[] {
59
+ const wikiDir = join(projectPath, DEFAULT_WIKI_DIR);
60
+
61
+ if (!existsSync(wikiDir)) {
62
+ return [];
63
+ }
64
+
65
+ const prompts: { path: string; category: string; filename: string }[] = [];
66
+
67
+ function scanDir(dir: string): void {
68
+ const { readdirSync, statSync } = require("fs");
69
+ try {
70
+ for (const entry of readdirSync(dir)) {
71
+ const fullPath = join(dir, entry);
72
+ const stat = statSync(fullPath);
73
+ if (stat.isDirectory()) {
74
+ scanDir(fullPath);
75
+ } else if (
76
+ stat.isFile() &&
77
+ (entry.endsWith(".md") || entry.endsWith(".txt"))
78
+ ) {
79
+ const relPath = relative(wikiDir, fullPath).replace(/\\/g, "/");
80
+ const parts = relPath.split("/");
81
+ prompts.push({
82
+ path: fullPath,
83
+ category: parts[0],
84
+ filename: parts.slice(1).join("/"),
85
+ });
86
+ }
87
+ }
88
+ } catch {
89
+ // Ignore permission errors
90
+ }
91
+ }
92
+
93
+ scanDir(wikiDir);
94
+ return prompts;
95
+ }
96
+
97
+ /**
98
+ * Create trigger context from a wiki read event
99
+ */
100
+ export function createTriggerContext(
101
+ filePath: string,
102
+ projectPath: string,
103
+ triggerType: ReviewTriggerContext["triggerType"] = "wiki_read",
104
+ ): ReviewTriggerContext | null {
105
+ if (!isWikiPrompt(filePath, projectPath)) {
106
+ return null;
107
+ }
108
+
109
+ const parsed = parseWikiPrompt(filePath, projectPath);
110
+ if (!parsed) return null;
111
+
112
+ return {
113
+ projectPath,
114
+ promptFile: filePath,
115
+ promptContent: "", // Will be filled by caller
116
+ triggerType,
117
+ };
118
+ }
119
+
120
+ /**
121
+ * Check if current working directory has wiki prompts
122
+ */
123
+ export function hasWikiPrompts(projectPath: string): boolean {
124
+ const wikiDir = join(projectPath, DEFAULT_WIKI_DIR);
125
+ return existsSync(wikiDir);
126
+ }
127
+
128
+ /**
129
+ * Get wiki directory path
130
+ */
131
+ export function getWikiDir(projectPath: string): string {
132
+ return join(projectPath, DEFAULT_WIKI_DIR);
133
+ }
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Write-Review Loop Types
3
+ *
4
+ * State machine for two-agent write-review coordination.
5
+ */
6
+
7
+ /**
8
+ * Review phases
9
+ */
10
+ export type ReviewPhase =
11
+ | "idle"
12
+ | "writing"
13
+ | "pending_review"
14
+ | "reviewing"
15
+ | "approved"
16
+ | "blocked"
17
+ | "changes_requested";
18
+
19
+ /**
20
+ * Review verdict
21
+ */
22
+ export type Verdict = "approved" | "changes_requested" | "blocked";
23
+
24
+ /**
25
+ * Blackboard status record
26
+ */
27
+ export interface WriteReviewStatus {
28
+ projectPath: string;
29
+ phase: ReviewPhase;
30
+ writerDone: boolean;
31
+ writerMessage?: string;
32
+ iteration: number;
33
+ verdict?: Verdict;
34
+ verdictMessage?: string;
35
+ reviewerStarted?: string; // ISO timestamp
36
+ codeFiles?: string[]; // Files written
37
+ changesRequested?: string[]; // Changes needed
38
+ approvedAt?: string; // ISO timestamp
39
+ blockedAt?: string; // ISO timestamp
40
+ updatedAt: string;
41
+ createdAt: string;
42
+ }
43
+
44
+ /**
45
+ * Review trigger context
46
+ */
47
+ export interface ReviewTriggerContext {
48
+ projectPath: string;
49
+ promptFile: string;
50
+ promptContent: string;
51
+ triggerType: "wiki_read" | "manual" | "code_written";
52
+ }
53
+
54
+ /**
55
+ * Extension config
56
+ */
57
+ export interface WriteReviewConfig {
58
+ debug?: boolean;
59
+ blackboardDir?: string; // Default: "{project}/.write-review"
60
+ wikiDir?: string; // Default: "{project}/wiki"
61
+ enabled?: boolean;
62
+ }
63
+
64
+ /**
65
+ * Agent roles
66
+ */
67
+ export const AGENT_ROLES = {
68
+ WRITER: "writer", // Minimax - reads wiki, writes code
69
+ REVIEWER: "reviewer", // Uses pi-subagents review-loop
70
+ HELPER: "helper", // worker - notes tasks to todo
71
+ } as const;
72
+
73
+ export type AgentRole = (typeof AGENT_ROLES)[keyof typeof AGENT_ROLES];
74
+
75
+ /**
76
+ * State transition helpers
77
+ */
78
+ export function isTerminalPhase(phase: ReviewPhase): boolean {
79
+ return phase === "approved" || phase === "blocked";
80
+ }
81
+
82
+ export function needsReview(phase: ReviewPhase): boolean {
83
+ return phase === "pending_review" || phase === "reviewing";
84
+ }
85
+
86
+ export function canWrite(phase: ReviewPhase): boolean {
87
+ return (
88
+ phase === "idle" || phase === "writing" || phase === "changes_requested"
89
+ );
90
+ }
@@ -0,0 +1,57 @@
1
+ ---
2
+ description: Reviewer agent - evaluate code quality and request changes
3
+ argument-hint: "<task context>"
4
+ ---
5
+ # Reviewer Agent
6
+
7
+ You are the **REVIEWER** agent. Your job is to evaluate code quality and request fixes.
8
+
9
+ ## Review Criteria
10
+
11
+ 1. **Correctness** - Does it solve the problem?
12
+ 2. **Type Safety** - TypeScript types correct?
13
+ 3. **Edge Cases** - Handles null/undefined/empty?
14
+ 4. **Security** - No injection vulnerabilities?
15
+ 5. **Performance** - No obvious O(n^2) loops?
16
+ 6. **Testability** - Can be unit tested?
17
+
18
+ ## Your Workflow
19
+
20
+ 1. Read the code artifacts from blackboard
21
+ 2. Evaluate against review criteria
22
+ 3. Write your findings to the blackboard
23
+ 4. Issue verdict:
24
+ - `APPROVED` - Code is ready
25
+ - `CHANGES_REQUESTED` - Issues found
26
+ - `BLOCKED` - Critical issues
27
+
28
+ ## Blackboard Location
29
+
30
+ ```
31
+ {project}/.write-review/status.json
32
+ ```
33
+
34
+ ## Verdict Format
35
+
36
+ ```
37
+ ## REVIEW FINDINGS
38
+
39
+ ### Issues Found
40
+ - [issue description]
41
+
42
+ ## VERDICT: CHANGES_REQUESTED
43
+
44
+ Please fix the issues above.
45
+ ```
46
+
47
+ Or:
48
+
49
+ ```
50
+ ## REVIEW FINDINGS
51
+
52
+ No critical issues found.
53
+
54
+ ## VERDICT: APPROVED
55
+
56
+ Code is ready for build/commit.
57
+ ```
@@ -0,0 +1,42 @@
1
+ ---
2
+ description: Writer agent - implement code and wait for review verdict
3
+ argument-hint: "<task description>"
4
+ ---
5
+ # Writer Agent
6
+
7
+ You are the **WRITER** agent. Your job is to implement code based on the task.
8
+
9
+ ## Task
10
+
11
+ $@
12
+
13
+ ## Your Workflow
14
+
15
+ 1. Read and understand the task
16
+ 2. Implement the code
17
+ 3. Write your artifacts to the blackboard
18
+ 4. Write `## WRITER_DONE` when finished
19
+ 5. Wait for review verdict
20
+ 6. If `CHANGES_REQUESTED`, update code accordingly
21
+ 7. Acknowledge each verdict
22
+
23
+ ## Blackboard Location
24
+
25
+ ```
26
+ {project}/.write-review/status.json
27
+ ```
28
+
29
+ ## Important Rules
30
+
31
+ - Do NOT build or commit until you receive `APPROVED`
32
+ - Write code only in the assigned files
33
+ - Keep artifacts focused and complete
34
+ - Respond to each verdict acknowledgment
35
+
36
+ ## Verdict Response
37
+
38
+ When you receive a verdict:
39
+
40
+ - `APPROVED`: Acknowledge and proceed to build/commit
41
+ - `CHANGES_REQUESTED`: Update the code and rewrite `## WRITER_DONE`
42
+ - `BLOCKED`: Stop and wait for human intervention
@@ -0,0 +1,40 @@
1
+ ---
2
+ description: Show available slash commands and usage hints
3
+ ---
4
+ # Slash Commands Reference
5
+
6
+ Type `/` in the editor to see autocomplete.
7
+
8
+ ## Available Commands
9
+
10
+ | Command | Description |
11
+ |---------|-------------|
12
+ | `/wr` | Start write-review loop (writer + reviewer) |
13
+ | `/writer` | Activate writer agent for a task |
14
+ | `/reviewer` | Activate reviewer agent |
15
+ | `/tdb` | Connect to TencentDB |
16
+ | `/tdb-setup` | Setup TencentDB connection |
17
+ | `/cl` | Code review for changelog |
18
+
19
+ ## Write-Review Loop
20
+
21
+ ```
22
+ /wr Create a new API endpoint
23
+ ```
24
+
25
+ 1. Writer implements code
26
+ 2. Reviewer checks quality
27
+ 3. Loop until APPROVED
28
+ 4. Build/commit when ready
29
+
30
+ ## Status File
31
+
32
+ Check review status:
33
+
34
+ ```
35
+ cat .write-review/status.json
36
+ ```
37
+
38
+ ## More Info
39
+
40
+ See `prompts/write-review.md` for full documentation.
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Connect to your own TencentDB-Agent-Memory server
3
+ argument-hint: "<action>"
4
+ ---
5
+ # TencentDB-Agent-Memory Connection Setup
6
+
7
+ ## Available Actions
8
+
9
+ Use `/tencentdb-connect` with one of these actions:
10
+
11
+ | Action | Description |
12
+ |--------|-------------|
13
+ | `connect` | Connect to an existing server |
14
+ | `deploy` | Deploy a new server |
15
+ | `test` | Test current connection |
16
+ | `status` | Check server health |
17
+
18
+ ## Connect to Existing Server
19
+
20
+ Run `/tencentdb-connect connect` and provide:
21
+
22
+ 1. **Server URL** - Your TencentDB server address
23
+ - Example: `https://memory.your-domain.com`
24
+
25
+ 2. **Service ID** - Usually `default`
26
+
27
+ 3. **User Key** - Provided by server admin
28
+
29
+ ## Deploy New Server
30
+
31
+ Run `/tencentdb-connect deploy` for guided VPS deployment.
32
+
33
+ ## Test Connection
34
+
35
+ Run `/tencentdb-connect test` to verify your setup.
@@ -0,0 +1,101 @@
1
+ ---
2
+ description: Interactively configure TencentDB-Agent-Memory connection
3
+ argument-hint: "<server-url> [service-id] [user-key]"
4
+ ---
5
+ # Setup TencentDB-Agent-Memory Connection
6
+
7
+ ${1:---}
8
+
9
+ ## Configuration Options
10
+
11
+ **Arguments:**
12
+ - `$1` = Server URL (e.g., `https://memory.example.com`)
13
+ - `$2` = Service ID (default: `default`)
14
+ - `$3` = User Key (from server admin)
15
+
16
+ ## Step-by-Step Setup
17
+
18
+ ### Step 1: Enter Server URL
19
+
20
+ Please provide your TencentDB-Agent-Memory server URL:
21
+
22
+ ```
23
+ https://your-server.com
24
+ ```
25
+
26
+ ### Step 2: Enter Service ID
27
+
28
+ Enter your service ID (or press Enter for `default`):
29
+
30
+ ```
31
+ default
32
+ ```
33
+
34
+ ### Step 3: Enter User Key
35
+
36
+ Enter your user key:
37
+
38
+ ```
39
+ your-user-key-here
40
+ ```
41
+
42
+ ## Configuration Methods
43
+
44
+ ### Option A: Environment File (.env)
45
+
46
+ Create or update `.env` in your project:
47
+
48
+ ```bash
49
+ TENANTDB_URL=${1:-https://your-server.com}
50
+ TENANTDB_SERVICE_ID=${2:-default}
51
+ TENANTDB_USER_KEY=${3}
52
+ ```
53
+
54
+ ### Option B: Settings JSON
55
+
56
+ Add to `.pi/settings.json`:
57
+
58
+ ```json
59
+ {
60
+ "tencentdb": {
61
+ "url": "${1:-https://your-server.com}",
62
+ "serviceId": "${2:-default}",
63
+ "userKey": "${3}"
64
+ }
65
+ }
66
+ ```
67
+
68
+ ## Verification
69
+
70
+ Test your connection:
71
+
72
+ ```bash
73
+ curl -X GET "${1:-https://your-server.com}/health" \
74
+ -H "x-tdai-service-id: ${2:-default}" \
75
+ -H "x-tdai-user-key: ${3}"
76
+ ```
77
+
78
+ Expected response:
79
+ ```json
80
+ {"status": "ok", "version": "1.0.0"}
81
+ ```
82
+
83
+ ## Usage Examples
84
+
85
+ ### Search Knowledge
86
+ ```bash
87
+ curl -X POST "${1}/api/v1/memory/search" \
88
+ -H "x-tdai-service-id: ${2}" \
89
+ -H "x-tdai-user-key: ${3}" \
90
+ -H "Content-Type: application/json" \
91
+ -d '{"query": "your search query"}'
92
+ ```
93
+
94
+ ### Sync Skills
95
+ ```bash
96
+ curl -X POST "${1}/api/v1/skills/sync" \
97
+ -H "x-tdai-service-id: ${2}" \
98
+ -H "x-tdai-user-key: ${3}" \
99
+ -H "Content-Type: application/json" \
100
+ -d '{"skills": [...]}'
101
+ ```