gennady 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/README.md +2 -15
  2. package/ai/agents/agent-resolve-conflicts.xml +6 -0
  3. package/ai/agents/agent-review-verifier.xml +6 -0
  4. package/ai/directives/architecture/README.md +21 -0
  5. package/ai/directives/coding/README.md +23 -0
  6. package/ai/directives/coding/result-conventions.xml +55 -0
  7. package/ai/directives/coding/svelte5-runes.xml +248 -0
  8. package/ai/directives/coding/sveltekit-rules.xml +247 -0
  9. package/ai/directives/coding/typescript-rules.xml +589 -0
  10. package/ai/directives/coding/uikit-component-storybook.xml +347 -0
  11. package/ai/directives/coding/uikit-component-svelte.xml +344 -0
  12. package/ai/directives/coding/uikit-spec-drafting.xml +243 -0
  13. package/ai/directives/dbc-audit.directive.xml +131 -0
  14. package/ai/directives/dev-review.directive.xml +148 -0
  15. package/ai/directives/infra/README.md +11 -0
  16. package/ai/directives/infra/eslint-setup.xml +467 -0
  17. package/ai/directives/infra/git-setup.xml +261 -0
  18. package/ai/directives/infra/nodejs-npm-setup.xml +354 -0
  19. package/ai/directives/infra/storybook-setup.xml +153 -0
  20. package/ai/directives/knowledge.xml +206 -0
  21. package/ai/directives/perf-auditor/perf-auditor.directive.xml +75 -0
  22. package/ai/directives/perf-auditor/rules/async-latency.xml +101 -0
  23. package/ai/directives/perf-auditor/rules/data-structures.xml +103 -0
  24. package/ai/directives/perf-auditor/rules/iteration-fusion.xml +96 -0
  25. package/ai/directives/perf-auditor/rules/memory-gc.xml +102 -0
  26. package/ai/directives/sdd/README.md +49 -0
  27. package/ai/directives/sdd/audit.directive.xml +543 -0
  28. package/ai/directives/sdd/discovery.directive.xml +824 -0
  29. package/ai/directives/sdd/fix.directive.xml +249 -0
  30. package/ai/directives/sdd/module-decomposition.directive.xml +666 -0
  31. package/ai/directives/sdd/phase-execution-protocol.xml +339 -0
  32. package/ai/directives/sdd/scaffold.directive.xml +717 -0
  33. package/ai/directives/sdd/setup.directive.xml +213 -0
  34. package/ai/directives/sdd/svelte-ui-discovery.directive.xml +263 -0
  35. package/ai/directives/semantic-change-extractor.directive.xml +99 -0
  36. package/ai/directives/testing/README.md +25 -0
  37. package/ai/directives/testing/common.xml +234 -0
  38. package/ai/directives/testing/node-test.xml +288 -0
  39. package/ai/directives/testing/playwright-cli.xml +199 -0
  40. package/ai/directives/testing/playwright-e2e.xml +292 -0
  41. package/ai/directives/testing/storybook-usage.xml +173 -0
  42. package/ai/directives/testing/svelte-testing.xml +237 -0
  43. package/ai/directives/testing/vitest-rules.xml +326 -0
  44. package/ai/docs/README.md +17 -0
  45. package/ai/docs/ai-icl.md +538 -0
  46. package/ai/docs/ai-priming.md +548 -0
  47. package/ai/docs/ai-prompt-formats.md +406 -0
  48. package/ai/docs/ai-promting.md +572 -0
  49. package/ai/drafts/DRAFT.md +120 -0
  50. package/ai/drafts/agent-devgen-class-from-description.rules.xml +123 -0
  51. package/ai/drafts/agent-typescript-devgen.v1.xml +303 -0
  52. package/ai/drafts/d.md +65 -0
  53. package/ai/drafts/music-posts.md +105 -0
  54. package/ai/fw/v1/architecture/blueprint-factory.xml +77 -0
  55. package/ai/fw/v1/core/mental-model.xml +50 -0
  56. package/ai/fw/v1/discovery/intent-reactor.xml +92 -0
  57. package/ai/fw/v1/production/swarm-protocol.xml +122 -0
  58. package/ai/fw/v1/review/quality-pipeline.xml +102 -0
  59. package/ai/fw/v2/arch-universal.xml +73 -0
  60. package/ai/fw-draft/README.md +79 -0
  61. package/ai/fw-draft/bin/discovery.sh +116 -0
  62. package/ai/fw-draft/gennady.xml +58 -0
  63. package/ai/fw-draft/provider/claude.xml +16 -0
  64. package/ai/fw-draft/provider/cursor.xml +23 -0
  65. package/ai/fw-draft/provider/default.xml +12 -0
  66. package/ai/fw-draft/roles/developer.xml +18 -0
  67. package/ai/fw-draft/router.xml +39 -0
  68. package/ai/fw-draft/routes/development.xml +32 -0
  69. package/ai/fw-draft/routes/universal.xml +58 -0
  70. package/ai/fw-draft/rules/dev/base/file-structure-rules.xml +89 -0
  71. package/ai/fw-draft/rules/dev/typescript/contacts.xml +194 -0
  72. package/dist/ai/agents/agent-resolve-conflicts.xml +6 -0
  73. package/dist/ai/agents/agent-review-verifier.xml +6 -0
  74. package/dist/ai/directives/architecture/README.md +21 -0
  75. package/dist/ai/directives/coding/README.md +23 -0
  76. package/dist/ai/directives/coding/result-conventions.xml +55 -0
  77. package/dist/ai/directives/coding/svelte5-runes.xml +248 -0
  78. package/dist/ai/directives/coding/sveltekit-rules.xml +247 -0
  79. package/dist/ai/directives/coding/typescript-rules.xml +589 -0
  80. package/dist/ai/directives/coding/uikit-component-storybook.xml +347 -0
  81. package/dist/ai/directives/coding/uikit-component-svelte.xml +344 -0
  82. package/dist/ai/directives/coding/uikit-spec-drafting.xml +243 -0
  83. package/dist/ai/directives/dbc-audit.directive.xml +131 -0
  84. package/dist/ai/directives/dev-review.directive.xml +148 -0
  85. package/dist/ai/directives/infra/README.md +11 -0
  86. package/dist/ai/directives/infra/eslint-setup.xml +467 -0
  87. package/dist/ai/directives/infra/git-setup.xml +261 -0
  88. package/dist/ai/directives/infra/nodejs-npm-setup.xml +354 -0
  89. package/dist/ai/directives/infra/storybook-setup.xml +153 -0
  90. package/dist/ai/directives/knowledge.xml +206 -0
  91. package/dist/ai/directives/perf-auditor/perf-auditor.directive.xml +75 -0
  92. package/dist/ai/directives/perf-auditor/rules/async-latency.xml +101 -0
  93. package/dist/ai/directives/perf-auditor/rules/data-structures.xml +103 -0
  94. package/dist/ai/directives/perf-auditor/rules/iteration-fusion.xml +96 -0
  95. package/dist/ai/directives/perf-auditor/rules/memory-gc.xml +102 -0
  96. package/dist/ai/directives/sdd/README.md +49 -0
  97. package/dist/ai/directives/sdd/audit.directive.xml +543 -0
  98. package/dist/ai/directives/sdd/discovery.directive.xml +824 -0
  99. package/dist/ai/directives/sdd/fix.directive.xml +249 -0
  100. package/dist/ai/directives/sdd/module-decomposition.directive.xml +666 -0
  101. package/dist/ai/directives/sdd/phase-execution-protocol.xml +339 -0
  102. package/dist/ai/directives/sdd/scaffold.directive.xml +717 -0
  103. package/dist/ai/directives/sdd/setup.directive.xml +213 -0
  104. package/dist/ai/directives/sdd/svelte-ui-discovery.directive.xml +263 -0
  105. package/dist/ai/directives/semantic-change-extractor.directive.xml +99 -0
  106. package/dist/ai/directives/testing/README.md +25 -0
  107. package/dist/ai/directives/testing/common.xml +234 -0
  108. package/dist/ai/directives/testing/node-test.xml +288 -0
  109. package/dist/ai/directives/testing/playwright-cli.xml +199 -0
  110. package/dist/ai/directives/testing/playwright-e2e.xml +292 -0
  111. package/dist/ai/directives/testing/storybook-usage.xml +173 -0
  112. package/dist/ai/directives/testing/svelte-testing.xml +237 -0
  113. package/dist/ai/directives/testing/vitest-rules.xml +326 -0
  114. package/dist/ai/docs/README.md +17 -0
  115. package/dist/ai/docs/ai-icl.md +538 -0
  116. package/dist/ai/docs/ai-priming.md +548 -0
  117. package/dist/ai/docs/ai-prompt-formats.md +406 -0
  118. package/dist/ai/docs/ai-promting.md +572 -0
  119. package/dist/ai/drafts/DRAFT.md +120 -0
  120. package/dist/ai/drafts/agent-devgen-class-from-description.rules.xml +123 -0
  121. package/dist/ai/drafts/agent-typescript-devgen.v1.xml +303 -0
  122. package/dist/ai/drafts/d.md +65 -0
  123. package/dist/ai/drafts/music-posts.md +105 -0
  124. package/dist/ai/fw/v1/architecture/blueprint-factory.xml +77 -0
  125. package/dist/ai/fw/v1/core/mental-model.xml +50 -0
  126. package/dist/ai/fw/v1/discovery/intent-reactor.xml +92 -0
  127. package/dist/ai/fw/v1/production/swarm-protocol.xml +122 -0
  128. package/dist/ai/fw/v1/review/quality-pipeline.xml +102 -0
  129. package/dist/ai/fw/v2/arch-universal.xml +73 -0
  130. package/dist/ai/fw-draft/README.md +79 -0
  131. package/dist/ai/fw-draft/bin/discovery.sh +116 -0
  132. package/dist/ai/fw-draft/gennady.xml +58 -0
  133. package/dist/ai/fw-draft/provider/claude.xml +16 -0
  134. package/dist/ai/fw-draft/provider/cursor.xml +23 -0
  135. package/dist/ai/fw-draft/provider/default.xml +12 -0
  136. package/dist/ai/fw-draft/roles/developer.xml +18 -0
  137. package/dist/ai/fw-draft/router.xml +39 -0
  138. package/dist/ai/fw-draft/routes/development.xml +32 -0
  139. package/dist/ai/fw-draft/routes/universal.xml +58 -0
  140. package/dist/ai/fw-draft/rules/dev/base/file-structure-rules.xml +89 -0
  141. package/dist/ai/fw-draft/rules/dev/typescript/contacts.xml +194 -0
  142. package/dist/chunks/devtools-B-7ugZhF.js +79 -0
  143. package/dist/chunks/{help.cmd-CWasx25o.js → help.cmd-B_G7EWzF.js} +9 -2
  144. package/dist/chunks/{index-B63fYXL2.js → index-BeL1Zcbg.js} +1 -1
  145. package/dist/chunks/index-CVR66voe.js +26963 -0
  146. package/dist/chunks/index-CXuhZzS3.js +16979 -0
  147. package/dist/chunks/{index-B5bA2T7A.js → index-CaahtXiM.js} +33 -9
  148. package/dist/chunks/{index-iqg0w_pE.js → index-CiEM-8nJ.js} +35 -19
  149. package/dist/chunks/{index-B4m0-PAT.js → index-D1qsi0Uc.js} +57 -33
  150. package/dist/chunks/index-D9ceRUyB.js +443 -0
  151. package/dist/chunks/index-DJpVmyp2.js +176 -0
  152. package/dist/chunks/{index-C0andxna.js → index-DU6jD7SS.js} +1 -1
  153. package/dist/chunks/index-KxSZKmZn.js +540 -0
  154. package/dist/chunks/{index-Dqe1TdW4.js → index-UbHoePfr.js} +12 -12
  155. package/dist/chunks/{index-5xIgwwKx.js → index-g1LXlp77.js} +2 -2
  156. package/dist/chunks/index-zBnnuvLA.js +3788 -0
  157. package/dist/chunks/{run-review-command.logic-a_M3CkeZ.js → run-review-command.logic-DpkRoEi8.js} +2 -2
  158. package/dist/chunks/services-CaLOhuLV.js +2889 -0
  159. package/dist/chunks/shared-Bjy30TeM.js +665 -0
  160. package/dist/cli/cmd/_shared/prompt/io/load-agent-template.io.d.ts +3 -3
  161. package/dist/cli/cmd/_shared/prompt/logic/build-ai-first-knowledge-block.logic.d.ts +3 -3
  162. package/dist/cli/cmd/_shared/prompt/logic/build-ai-verify-placeholders.logic.d.ts +7 -4
  163. package/dist/cli/cmd/_shared/prompt/logic/verify-commands/resolve-verify-commands.logic.d.ts +5 -0
  164. package/dist/cli/cmd/_shared/update-check-worker.d.ts +1 -0
  165. package/dist/cli/cmd/_shared/update-check.d.ts +38 -0
  166. package/dist/cli/cmd/agent-mon/cmd/create-providers.d.ts +15 -0
  167. package/dist/cli/cmd/agent-mon/cmd/index.d.ts +1 -0
  168. package/dist/cli/cmd/agent-mon/cmd/run.d.ts +12 -0
  169. package/dist/cli/cmd/agent-mon/state/create-state-manager.d.ts +32 -0
  170. package/dist/cli/cmd/agent-mon/state/group-by-provider.d.ts +14 -0
  171. package/dist/cli/cmd/agent-mon/state/index.d.ts +5 -0
  172. package/dist/cli/cmd/agent-mon/state/is-waiting.d.ts +9 -0
  173. package/dist/cli/cmd/agent-mon/state/view-model.type.d.ts +74 -0
  174. package/dist/cli/cmd/agent-mon/ui/app.d.ts +16 -0
  175. package/dist/cli/cmd/agent-mon/ui/column-view.d.ts +14 -0
  176. package/dist/cli/cmd/agent-mon/ui/index.d.ts +10 -0
  177. package/dist/cli/cmd/agent-mon/ui/provider-column.d.ts +14 -0
  178. package/dist/cli/cmd/agent-mon/ui/session-card.d.ts +12 -0
  179. package/dist/cli/cmd/agent-mon/ui/status-badge.d.ts +10 -0
  180. package/dist/cli/cmd/alt-opinion/alt-opinion-parser.d.ts +18 -0
  181. package/dist/cli/cmd/alt-opinion/alt-opinion-runner.d.ts +32 -0
  182. package/dist/cli/cmd/alt-opinion/alt-opinion.cmd.d.ts +34 -0
  183. package/dist/cli/cmd/alt-opinion/alt-opinion.types.d.ts +88 -0
  184. package/dist/cli/cmd/alt-opinion/index.d.ts +1 -0
  185. package/dist/cli/cmd/cat/cat-url.fn.d.ts +19 -0
  186. package/dist/cli/cmd/lint/checks/anchor.check.d.ts +11 -0
  187. package/dist/cli/cmd/lint/checks/dbc-contract.check.d.ts +16 -0
  188. package/dist/cli/cmd/lint/checks/disables.check.d.ts +12 -0
  189. package/dist/cli/cmd/lint/checks/file-header.check.d.ts +10 -0
  190. package/dist/cli/cmd/lint/checks/language.check.d.ts +11 -0
  191. package/dist/cli/cmd/lint/index.d.ts +1 -0
  192. package/dist/cli/cmd/lint/lint.cmd.d.ts +18 -0
  193. package/dist/cli/cmd/lint/lint.types.d.ts +72 -0
  194. package/dist/cli/cmd/lint/utils/resolve-references.fn.d.ts +32 -0
  195. package/dist/cli/cmd/remote-console/index.d.ts +2 -0
  196. package/dist/cli/cmd/remote-console/remote-console.cmd.d.ts +55 -0
  197. package/dist/cli/cmd/resolve-conflicts/_core/io/resolve-conflicts-template-load.io.d.ts +2 -2
  198. package/dist/cli/cmd/resolve-conflicts/_core/logic/resolve-conflicts-command-args-parse.logic.d.ts +3 -3
  199. package/dist/cli/cmd/resolve-conflicts/_core/logic/resolve-conflicts-command-run.logic.d.ts +3 -3
  200. package/dist/cli/cmd/resolve-conflicts/_core/logic/resolve-conflicts-context-git-build.logic.d.ts +4 -4
  201. package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-artifact.type.d.ts +3 -1
  202. package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-command-args.type.d.ts +3 -1
  203. package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-command-result.type.d.ts +5 -1
  204. package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-context-git.type.d.ts +18 -2
  205. package/dist/cli/cmd/resolve-conflicts/_core/xml/resolve-conflicts-artifact-build.xml.d.ts +6 -6
  206. package/dist/cli/cmd/resolve-conflicts/_core/xml/resolve-conflicts-render.xml.d.ts +4 -4
  207. package/dist/cli/cmd/review/_core/io/load-review-verify-template.io.d.ts +2 -2
  208. package/dist/cli/cmd/review/_core/logic/build-review-context-git.logic.d.ts +3 -3
  209. package/dist/cli/cmd/review/_core/logic/build-review-context-vcs.logic.d.ts +2 -2
  210. package/dist/cli/cmd/review/_core/logic/load-review-context-mr.logic.d.ts +5 -5
  211. package/dist/cli/cmd/review/_core/logic/parse-review-command-args.logic.d.ts +3 -3
  212. package/dist/cli/cmd/review/_core/logic/resolve-review-intent.logic.d.ts +3 -3
  213. package/dist/cli/cmd/review/_core/logic/run-review-command.logic.d.ts +3 -3
  214. package/dist/cli/cmd/review/_core/types/review-artifact.type.d.ts +4 -1
  215. package/dist/cli/cmd/review/_core/types/review-command-args.type.d.ts +7 -1
  216. package/dist/cli/cmd/review/_core/types/review-command-mode.type.d.ts +1 -1
  217. package/dist/cli/cmd/review/_core/types/review-command-options.type.d.ts +3 -1
  218. package/dist/cli/cmd/review/_core/types/review-command-result.type.d.ts +5 -1
  219. package/dist/cli/cmd/review/_core/types/review-context-git.type.d.ts +3 -1
  220. package/dist/cli/cmd/review/_core/types/review-context-mr.type.d.ts +22 -3
  221. package/dist/cli/cmd/review/_core/types/review-context-vcs.type.d.ts +4 -1
  222. package/dist/cli/cmd/review/_core/types/review-intent.type.d.ts +1 -1
  223. package/dist/cli/cmd/review/_core/xml/build-review-artifact.xml.d.ts +10 -10
  224. package/dist/cli/cmd/review/_core/xml/render-review-issues.xml.d.ts +3 -3
  225. package/dist/cli/cmd/review/_core/xml/render-review-verify.xml.d.ts +4 -4
  226. package/dist/cli/cmd/sync/index.d.ts +1 -0
  227. package/dist/cli/cmd/sync/sync-core.d.ts +65 -0
  228. package/dist/cli/cmd/sync/sync-formatter.d.ts +12 -0
  229. package/dist/cli/cmd/sync/sync.cmd.d.ts +33 -0
  230. package/dist/cli/cmd/sync/sync.types.d.ts +50 -0
  231. package/dist/cli/cmd/vcs-reply/vcs-reply.cmd.d.ts +4 -4
  232. package/dist/cli/utils/ai-legacy/ai-legacy-agent.d.ts +12 -11
  233. package/dist/cli/utils/ai-legacy/ai-legacy-core.d.ts +33 -17
  234. package/dist/cli/utils/ai-legacy/ai-legacy-model.d.ts +42 -23
  235. package/dist/cli/utils/cat-gen/cat-gen.d.ts +19 -8
  236. package/dist/cli/utils/commit-gen/commit-gen.d.ts +39 -15
  237. package/dist/cli/utils/prompts/index.d.ts +6 -6
  238. package/dist/cli/utils/review-gen/review-gen.d.ts +33 -9
  239. package/dist/gennady.js +30 -10
  240. package/dist/index.d.ts +1 -0
  241. package/dist/index.js +44 -23
  242. package/dist/services/agent-mon/diff/diff.d.ts +9 -0
  243. package/dist/services/agent-mon/diff/index.d.ts +1 -0
  244. package/dist/services/agent-mon/index.d.ts +10 -0
  245. package/dist/services/agent-mon/model/agent-provider.type.d.ts +20 -0
  246. package/dist/services/agent-mon/model/agent-session.type.d.ts +49 -0
  247. package/dist/services/agent-mon/model/errors.d.ts +20 -0
  248. package/dist/services/agent-mon/model/index.d.ts +7 -0
  249. package/dist/services/agent-mon/model/observe-opts.type.d.ts +7 -0
  250. package/dist/services/agent-mon/model/scan-opts.type.d.ts +7 -0
  251. package/dist/services/agent-mon/model/session-changes.type.d.ts +10 -0
  252. package/dist/services/agent-mon/monitor/agent-monitor.d.ts +44 -0
  253. package/dist/services/agent-mon/monitor/create-monitor.d.ts +6 -0
  254. package/dist/services/agent-mon/monitor/index.d.ts +2 -0
  255. package/dist/services/agent-mon/observe/index.d.ts +1 -0
  256. package/dist/services/agent-mon/observe/observe.d.ts +12 -0
  257. package/dist/services/agent-mon/providers/claude/claude-provider.d.ts +50 -0
  258. package/dist/services/agent-mon/providers/claude/index.d.ts +5 -0
  259. package/dist/services/agent-mon/providers/claude/ps.d.ts +36 -0
  260. package/dist/services/agent-mon/providers/claude/session-json.d.ts +37 -0
  261. package/dist/services/agent-mon/providers/opencode/db.d.ts +41 -0
  262. package/dist/services/agent-mon/providers/opencode/index.d.ts +3 -0
  263. package/dist/services/agent-mon/providers/opencode/model-parser.d.ts +6 -0
  264. package/dist/services/agent-mon/providers/opencode/opencode-provider.d.ts +45 -0
  265. package/dist/services/ai-client/providers/ai-model.type.d.ts +14 -0
  266. package/dist/services/ai-client/providers/open-router/open-router-model.type.d.ts +1 -4
  267. package/dist/services/ai-client/providers/open-router/open-router-provider.d.ts +17 -0
  268. package/dist/services/ai-client/providers/openai-like-provider.d.ts +1 -0
  269. package/dist/services/data-ore/telegram/telegram-data-ore.d.ts +17 -0
  270. package/dist/services/data-ore/telegram/telegram-data-ore.types.d.ts +4 -0
  271. package/dist/services/data-ore/telegram/telegram-demo-music-helper.d.ts +1 -0
  272. package/dist/services/data-ore/telegram/telegram-demo.d.ts +1 -0
  273. package/dist/services/dbc/linter/dbc-ast-adapter.types.d.ts +82 -0
  274. package/dist/services/dbc/linter/dbc-linter.types.d.ts +95 -0
  275. package/dist/services/dbc/linter/implementations/ts/dbc-ts-ast-adapter.d.ts +183 -0
  276. package/dist/services/dbc/linter/implementations/ts/dbc-ts-linter.d.ts +152 -0
  277. package/dist/services/dbc/parser/dbc-parser.types.d.ts +16 -16
  278. package/dist/services/dbc/parser/implementations/jsdoc/dbc-jsdoc-parser.d.ts +14 -4
  279. package/dist/services/logger/logger.d.ts +26 -6
  280. package/dist/services/remote-console/client/remote-console-client-serializer.d.ts +7 -0
  281. package/dist/services/remote-console/client/remote-console-client.d.ts +20 -0
  282. package/dist/services/remote-console/client/remote-console-client.types.d.ts +88 -0
  283. package/dist/services/remote-console/remote-console.d.ts +6 -0
  284. package/dist/services/remote-console/server/remote-console-server.d.ts +10 -0
  285. package/dist/services/remote-console/server/remote-console-server.types.d.ts +44 -0
  286. package/dist/services/remote-console/server/remote-console-stdout-writer.d.ts +26 -0
  287. package/dist/services/vcs-client/abstract/vcs-client-merge-discussions.d.ts +22 -14
  288. package/dist/services/vcs-client/abstract/vcs-client-merge-requests.d.ts +31 -14
  289. package/dist/services/vcs-client/abstract/vcs-client-repository-files.d.ts +16 -0
  290. package/dist/services/vcs-client/abstract/vcs-client.d.ts +9 -5
  291. package/dist/services/vcs-client/entities/vcs-file-content.type.d.ts +24 -0
  292. package/dist/services/vcs-client/entities/vcs-merge-request-changes.type.d.ts +32 -0
  293. package/dist/services/vcs-client/entities/vcs-url.type.d.ts +14 -0
  294. package/dist/services/vcs-client/entities/vcs-user.type.d.ts +3 -0
  295. package/dist/services/vcs-client/github/vcs-github-client.d.ts +31 -0
  296. package/dist/services/vcs-client/github/vcs-github-merge-requests.d.ts +40 -0
  297. package/dist/services/vcs-client/github/vcs-github-repository-files.d.ts +27 -0
  298. package/dist/services/vcs-client/gitlab/vcs-gitlab-client.d.ts +13 -4
  299. package/dist/services/vcs-client/gitlab/vcs-gitlab-merge-discussions.d.ts +16 -5
  300. package/dist/services/vcs-client/gitlab/vcs-gitlab-merge-requests.d.ts +24 -5
  301. package/dist/services/vcs-client/gitlab/vcs-gitlab-repository-files.d.ts +27 -0
  302. package/dist/services/vcs-client/parse-vcs-url.d.ts +3 -0
  303. package/dist/shared/backend/git/git-core.d.ts +24 -22
  304. package/dist/shared/backend/git/git-diff.d.ts +16 -5
  305. package/dist/shared/backend/rc/rc-config.d.ts +27 -15
  306. package/dist/shared/common/exec.d.ts +4 -6
  307. package/dist/shared/common/files.d.ts +1 -3
  308. package/dist/shared/common/language.d.ts +3 -6
  309. package/dist/shared/common/parse-args.d.ts +1 -4
  310. package/dist/shared/common/style.d.ts +3 -3
  311. package/dist/shared/common/think.d.ts +1 -5
  312. package/dist/shared/common/tokens.d.ts +1 -5
  313. package/dist/shared/common/unguard.d.ts +4 -8
  314. package/dist/shared/common/xml.d.ts +16 -12
  315. package/package.json +20 -4
  316. package/dist/.ai/agents/agent-review-verifier.xml +0 -181
  317. package/dist/chunks/index-CNbmXK8M.js +0 -3548
  318. package/dist/chunks/services-Sb7TwLxt.js +0 -122
  319. package/dist/chunks/shared-BgLzFWMH.js +0 -577
@@ -1,16 +1,19 @@
1
1
  /**
2
- * @purpose Описать подстановки verify-блока для AI-шаблона.
2
+ * @purpose Describe verify-block substitutions for the AI template.
3
3
  * @consumer render-review-verify.xml, render-resolve-conflicts.xml
4
4
  */
5
5
  export type VerifyCommandPlaceholders = {
6
+ /** @purpose Hint for agent on which verification command to run. */
6
7
  axiomHint: string;
8
+ /** @purpose Example tool commands for the agent to reference. */
7
9
  toolsExample: string;
10
+ /** @purpose Step-by-step verification instruction for the agent. */
8
11
  verifyStep: string;
9
12
  };
10
13
  /**
11
- * @purpose Построить безопасные подстановки `<!--ai:verify-*-->` для шаблона.
14
+ * @purpose Build safe `<!--ai:verify-*-->` substitutions for the template.
15
+ * @param projectRoot Repository root for searching verification commands.
16
+ * @returns Set of strings for insertion into the template.
12
17
  * @consumer render-review-verify.xml, render-resolve-conflicts.xml
13
- * @param projectRoot Корень репозитория для поиска команд проверки.
14
- * @returns Набор строк для вставки в шаблон.
15
18
  */
16
19
  export declare function buildVerifyCommandPlaceholders(projectRoot: string): VerifyCommandPlaceholders;
@@ -1 +1,6 @@
1
+ /**
2
+ * @purpose Return safe code verification commands for the current project (tests, lint, types).
3
+ * @param projectRoot Repository root for searching markers and package.json.
4
+ * @returns List of commands in priority order; empty list if the detector did not find a safe set.
5
+ */
1
6
  export declare function resolveSafeVerifyCommands(projectRoot: string): string[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ import { spawn } from 'node:child_process';
2
+ /** @purpose Serialized cache structure persisted by the update-check worker. */
3
+ export type UpdateCheckCache = {
4
+ /** @purpose ISO8601 timestamp of the most recent registry check */
5
+ lastCheck: string;
6
+ /** @purpose Latest version string from npm registry response */
7
+ latestVersion: string;
8
+ };
9
+ /** @purpose Configuration driving the update-check service behaviour. */
10
+ export type UpdateCheckOptions = {
11
+ /** @purpose Package identity — name and semver version */
12
+ pkg: {
13
+ name: string;
14
+ version: string;
15
+ };
16
+ /** @purpose Minimum interval between checks in ms | @invariant Default 24h (86_400_000 ms) */
17
+ interval?: number;
18
+ /** @purpose Suppress stderr notification when stderr is not a TTY | @invariant Default true — suppresses display only, never the check */
19
+ skipNotificationIfNoTty?: boolean;
20
+ /** @purpose Directory for the update-check cache file | @invariant Must exist before worker spawn */
21
+ cacheDir?: string;
22
+ /** @purpose Inject a custom spawn implementation for testing | @invariant Test seam only — not used in production */
23
+ _spawnFn?: typeof spawn;
24
+ };
25
+ /**
26
+ * @purpose Orchestrate a non-blocking update check — read cache, spawn worker if stale, register deferred notification.
27
+ * @implements {UpdateCheck} in specs/cli/update-check/update-check.spec.md#updatecheck
28
+ * @invariant Never throws — all failure paths are silent.
29
+ * @invariant Never blocks process.exit — spawn uses unref().
30
+ * @param pkg Package identity with name and semver version.
31
+ * @param [opts] Optional configuration overrides.
32
+ * @post Returns synchronously without blocking; if stale/missing cache: detached worker spawned via unref(); if fresh cache with newer version: beforeExit hook registered.
33
+ * @sideEffect FS: reads and writes cache directory. Subprocess: may spawn UpdateCheckWorker.
34
+ */
35
+ export declare function checkForUpdates(pkg: {
36
+ name: string;
37
+ version: string;
38
+ }, opts?: Partial<UpdateCheckOptions>): void;
@@ -0,0 +1,15 @@
1
+ import { AgentMonitor } from '../../../../services/agent-mon/monitor/index.js';
2
+ /** @purpose Options controlling which providers are registered. */
3
+ export type CreateProvidersOpts = {
4
+ /** @purpose Register Claude provider | @invariant Default true when absent */
5
+ claude?: boolean;
6
+ /** @purpose Register OpenCode provider | @invariant Default true when absent */
7
+ opencode?: boolean;
8
+ };
9
+ /**
10
+ * @purpose Create an AgentMonitor and register Claude and OpenCode providers according to options.
11
+ * @invariant Stateless — each call creates a fresh monitor instance.
12
+ * @param [opts] Provider selection — both enabled by default.
13
+ * @returns AgentMonitor with selected providers registered and ready for scanning.
14
+ */
15
+ export declare function createProviders(opts?: CreateProvidersOpts): AgentMonitor;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @purpose CLI entry point for `gennady agent-mon` — parse flags, wire providers, render the dashboard.
3
+ * @invariant --once mode: single scan → build ViewModel → render + exit.
4
+ * @invariant Live mode: observe → state manager → render, process kept alive by ink.
5
+ * @pre argv contains CLI flags per the agent-mon subcommand contract.
6
+ * @param argv Argument vector (excluding the command name 'agent-mon').
7
+ * @throws Never — on invalid input, prints usage and exits with code 1.
8
+ * @returns void (process is kept alive by ink in live mode or exits after snapshot in --once).
9
+ * @post Process is kept alive by ink (live mode) or exits after snapshot (--once).
10
+ * @sideEffect Starts ink renderer; registers providers; may spawn observe polling loop.
11
+ */
12
+ export declare function run(argv: string[]): Promise<void>;
@@ -0,0 +1,32 @@
1
+ import type { SessionChanges } from '../../../../services/agent-mon/model/session-changes.type.js';
2
+ import type { ViewModel } from './view-model.type.js';
3
+ /**
4
+ * @purpose Public interface of the state manager — query current ViewModel and subscribe to updates.
5
+ * @invariant getViewModel() always returns the latest snapshot; subscribe fires immediately with current state.
6
+ */
7
+ export type StateManager = {
8
+ /**
9
+ * @purpose Retrieve the current ViewModel snapshot.
10
+ * @returns Current immutable copy.
11
+ */
12
+ getViewModel(): ViewModel;
13
+ /**
14
+ * @purpose Register a callback invoked on every ViewModel update, including the current state immediately.
15
+ * @param fn Callback receiving the updated ViewModel.
16
+ * @returns Unsubscribe function — call to stop receiving updates.
17
+ */
18
+ subscribe(fn: (vm: ViewModel) => void): () => void;
19
+ };
20
+ /**
21
+ * @purpose Create a state manager that consumes SessionChanges from an async iterable.
22
+ * @implements {StateManager} in ./create-state-manager.ts
23
+ * @invariant Subscribers receive the current ViewModel immediately on subscribe; status='loading' until first iteration.
24
+ * @invariant On observer error: status transitions to 'error', data preserves last successful scan.
25
+ * @param changes Async iterable of SessionChanges — produced by the agent-mon observe() pipeline.
26
+ * @param [opts] Optional configuration to control per-provider session limit.
27
+ * @returns StateManager instance with getViewModel and subscribe methods.
28
+ * @sideEffect Spawns background async iteration over changes; notifies subscribers on each update.
29
+ */
30
+ export declare function createStateManager(changes: AsyncIterable<SessionChanges>, opts?: {
31
+ limit?: number;
32
+ }): StateManager;
@@ -0,0 +1,14 @@
1
+ import type { AgentSession } from '../../../../services/agent-mon/model/agent-session.type.js';
2
+ import type { ProviderColumn } from './view-model.type.js';
3
+ /**
4
+ * @purpose Group sessions by provider, compute per-column counts, and sort sessions within each column.
5
+ * @invariant Sessions within each column are sorted: active → waiting → idle → completed.
6
+ * @param sessions Flat array of agent sessions across all providers.
7
+ * @param [opts] Optional overrides — isWaitingFn replaces default isWaitingForUser for testing.
8
+ * @returns One ProviderColumn per unique provider, with sessions sorted by status priority.
9
+ * @sideEffect None — pure transformation.
10
+ */
11
+ export declare function groupByProvider(sessions: AgentSession[], opts?: {
12
+ isWaitingFn?: (s: AgentSession) => boolean;
13
+ limit?: number;
14
+ }): ProviderColumn[];
@@ -0,0 +1,5 @@
1
+ export { createStateManager } from './create-state-manager.js';
2
+ export type { StateManager } from './create-state-manager.js';
3
+ export type { ViewModel, ProviderColumn, SessionCard } from './view-model.type.js';
4
+ export { groupByProvider } from './group-by-provider.js';
5
+ export { isWaitingForUser } from './is-waiting.js';
@@ -0,0 +1,9 @@
1
+ import type { AgentSession } from '../../../../services/agent-mon/model/agent-session.type.js';
2
+ /**
3
+ * @purpose Determine whether an agent session is waiting for operator input based on last message content.
4
+ * @invariant Pure function — no side effects, no I/O, deterministic given same inputs.
5
+ * @param session Agent session data — uses only lastMessage field for detection.
6
+ * @param [patterns] Regex patterns for waiting detection; uses DEFAULT_WAIT_PATTERNS when falsy.
7
+ * @returns true if lastMessage matches any pattern, false otherwise (including when lastMessage is absent).
8
+ */
9
+ export declare function isWaitingForUser(session: AgentSession, patterns?: RegExp[]): boolean;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * @purpose Full dashboard state snapshot consumed by the UI layer.
3
+ * @invariant status transitions: loading → ready | error; on error, data preserves last successful scan.
4
+ */
5
+ export type ViewModel = {
6
+ /** @purpose Current lifecycle state of the dashboard | @invariant 'loading' before first iteration, 'ready' after, 'error' on observer failure */
7
+ status: 'loading' | 'ready' | 'error';
8
+ /** @purpose Aggregated dashboard data — columns and summary | @invariant Present only after first successful scan */
9
+ data?: {
10
+ /** @purpose Per-provider columns with grouped sessions */
11
+ columns: ProviderColumn[];
12
+ /** @purpose Aggregate counts across all providers */
13
+ summary: {
14
+ /** @purpose Total session count across all providers */
15
+ total: number;
16
+ /** @purpose Session count per provider key */
17
+ byProvider: Record<string, number>;
18
+ };
19
+ };
20
+ /** @purpose Error object captured on observer failure | @invariant Set only when status='error' */
21
+ error?: Error;
22
+ /** @purpose Timestamp of the last ViewModel update | @invariant Epoch milliseconds */
23
+ lastUpdated: number;
24
+ };
25
+ /**
26
+ * @purpose Column data for one provider — sessions grouped and sorted.
27
+ * @invariant sessions are sorted: active → waiting → idle → completed.
28
+ */
29
+ export type ProviderColumn = {
30
+ /** @purpose Provider identifier (claude, opencode, etc.) */
31
+ provider: string;
32
+ /** @purpose Count of sessions in active state */
33
+ activeCount: number;
34
+ /** @purpose Count of sessions waiting for operator input */
35
+ waitingCount: number;
36
+ /** @purpose Count of idle sessions */
37
+ idleCount: number;
38
+ /** @purpose Sessions in this column, sorted by status priority */
39
+ sessions: SessionCard[];
40
+ };
41
+ /**
42
+ * @purpose Rendering data for one session card in the dashboard.
43
+ * @invariant isWaitingForOperator is derived from isWaitingForUser heuristic applied to lastMessage.
44
+ */
45
+ export type SessionCard = {
46
+ /** @purpose Stable session identifier */
47
+ sessionId: string;
48
+ /** @purpose Display title of the session */
49
+ title: string;
50
+ /** @purpose AI model name used in the session */
51
+ model?: string;
52
+ /** @purpose Current session status — 'waiting' derived from isWaitingForUser heuristic */
53
+ status: 'active' | 'waiting' | 'idle' | 'completed';
54
+ /** @purpose Human-readable elapsed time string (e.g. '33m', '2.1h') */
55
+ elapsed: string;
56
+ /** @purpose Last message content, truncated for display */
57
+ lastMessage?: string;
58
+ /** @purpose Input token count */
59
+ tokensIn?: number;
60
+ /** @purpose Output token count */
61
+ tokensOut?: number;
62
+ /** @purpose CPU usage percentage | @invariant Provider-specific */
63
+ cpuPercent?: number;
64
+ /** @purpose Memory usage in megabytes | @invariant Provider-specific */
65
+ memoryMb?: number;
66
+ /** @purpose Active tasks within the session | @invariant V1 not populated, deferred */
67
+ tasks?: {
68
+ id: string;
69
+ status: string;
70
+ subject: string;
71
+ }[];
72
+ /** @purpose Whether the session appears to be waiting for operator input */
73
+ isWaitingForOperator: boolean;
74
+ };
@@ -0,0 +1,16 @@
1
+ import type { StateManager } from '../state/create-state-manager.js';
2
+ /** @purpose Props for the AgentMonApp root component. */
3
+ export type AgentMonAppProps = {
4
+ /** @purpose State manager providing ViewModel snapshots and subscription lifecycle */
5
+ stateManager: StateManager;
6
+ /** @purpose Dashboard view variant — 'column' renders ColumnView (default) */
7
+ view?: 'column' | 'compact';
8
+ };
9
+ /**
10
+ * @purpose Root ink component — subscribes to state manager, handles keyboard exit, selects the active view.
11
+ * @invariant Subscribes on mount, unsubscribes on unmount — no leaks.
12
+ * @invariant Loading → "Scanning for active sessions..."; error → red message + last data if available.
13
+ * @param props Component properties from AgentMonAppProps.
14
+ * @sideEffect Keyboard input capture for exit (Esc, q, Ctrl+C).
15
+ */
16
+ export declare function AgentMonApp(props: AgentMonAppProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { ViewModel } from '../state/view-model.type.js';
2
+ /** @purpose Props for the ColumnView component — dashboard ViewModel. */
3
+ export type ColumnViewProps = {
4
+ /** @purpose Dashboard ViewModel containing columns data. */
5
+ viewModel: ViewModel;
6
+ /** @purpose Max rows per column for terminal height adaptation. */
7
+ maxRows?: number;
8
+ };
9
+ /**
10
+ * @purpose Dashboard view that renders provider columns horizontally.
11
+ * @invariant Empty columns → "No active sessions." message (degradation per spec).
12
+ * @param props Component properties from ColumnViewProps.
13
+ */
14
+ export declare function ColumnView(props: ColumnViewProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ export { AgentMonApp } from './app.tsx';
2
+ export type { AgentMonAppProps } from './app.tsx';
3
+ export { ColumnView } from './column-view.tsx';
4
+ export type { ColumnViewProps } from './column-view.tsx';
5
+ export { ProviderColumn } from './provider-column.tsx';
6
+ export type { ProviderColumnProps } from './provider-column.tsx';
7
+ export { SessionCard } from './session-card.tsx';
8
+ export type { SessionCardProps } from './session-card.tsx';
9
+ export { StatusBadge } from './status-badge.tsx';
10
+ export type { StatusBadgeProps } from './status-badge.tsx';
@@ -0,0 +1,14 @@
1
+ import type { ProviderColumn as ProviderColumnData } from '../state/view-model.type.js';
2
+ /** @purpose Props for the ProviderColumn component — column data to render. */
3
+ export type ProviderColumnProps = {
4
+ /** @purpose Provider column data from the ViewModel. */
5
+ column: ProviderColumnData;
6
+ /** @purpose Max session cards to render in this column. */
7
+ maxCards?: number;
8
+ };
9
+ /**
10
+ * @purpose Renders one provider column — header with status counts, then stacked session cards.
11
+ * @invariant Sessions within the column are pre-sorted by status priority (active → waiting → idle → completed) by groupByProvider; no re-sort needed here.
12
+ * @param props Component properties from ProviderColumnProps.
13
+ */
14
+ export declare function ProviderColumn(props: ProviderColumnProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { SessionCard as SessionCardData } from '../state/view-model.type.js';
2
+ /** @purpose Props for the SessionCard component — session data to render. */
3
+ export type SessionCardProps = {
4
+ /** @purpose Session card data from the ViewModel */
5
+ card: SessionCardData;
6
+ };
7
+ /**
8
+ * @purpose Renders one agent session as a bordered card with status badge and metadata.
9
+ * @invariant Absent optional fields (tokens, cpu, memory) are not rendered — degradation per spec.
10
+ * @param props Component properties from SessionCardProps.
11
+ */
12
+ export declare function SessionCard(props: SessionCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ /** @purpose Props for the StatusBadge component — status selector. */
2
+ export type StatusBadgeProps = {
3
+ /** @purpose Session status driving the visual indicator */
4
+ status: 'active' | 'waiting' | 'idle' | 'completed';
5
+ };
6
+ /**
7
+ * @purpose Visual indicator of agent session status — emoji icon + text label.
8
+ * @param props Component properties from StatusBadgeProps.
9
+ */
10
+ export declare function StatusBadge(props: StatusBadgeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type { AltOpinionParsedArgs } from './alt-opinion.types.js';
2
+ /**
3
+ * @purpose Parse CLI arguments for the alt-opinion command.
4
+ * *
5
+ * Parses repeated --model, optional --synthModel, --file, --modelPrompt, --synthPrompt, --strict.
6
+ * Validates provider names, mutual exclusion of stdin/--file, :: syntax for per-model prompts,
7
+ * and minimum model count.
8
+ * *
9
+ * @param rawArgs Raw CLI arguments (typically process.argv).
10
+ * @param [opts] Options bag carrying pre-read stdin content for test injection.
11
+ * When omitted and stdin is not a TTY, the parser reads stdin synchronously.
12
+ * @throws {Error} On validation failures (missing model, unknown provider, mutual exclusion, etc.).
13
+ * @returns Parsed arguments with resolved artifact content.
14
+ * @sideEffect FS: reads stdin when not TTY and opts.stdinContent not provided. Actual data presence is determined by non-empty trimmed content.
15
+ */
16
+ export declare function parseAltOpinionArgs(rawArgs: string[], opts?: {
17
+ stdinContent?: string;
18
+ }): AltOpinionParsedArgs;
@@ -0,0 +1,32 @@
1
+ import type { AltOpinionModelPort, AltOpinionParsedArgs, AltOpinionReport } from './alt-opinion.types.js';
2
+ /** @purpose Dependencies for the alt-opinion runner, injected by the cmd layer. */
3
+ export type RunAltOpinionDeps = {
4
+ /** @purpose Model ports keyed by `provider/model` string (e.g. "llmproxy/deepseek-v4-pro") */
5
+ models: Map<string, AltOpinionModelPort>;
6
+ /** @purpose Optional synthesis model port */
7
+ synth?: AltOpinionModelPort;
8
+ /**
9
+ * @purpose Synchronous file reader for resolving --file, per-model prompts, and shared prompts.
10
+ * @param path Filesystem path to read.
11
+ * @returns File contents as a string.
12
+ */
13
+ readFile: (path: string) => string;
14
+ };
15
+ /**
16
+ * @purpose Core alt-opinion runner — polls models in parallel and optionally synthesizes results.
17
+ * *
18
+ * Resolves artifact content (from --file or pre-resolved stdin), sanitizes it against prompt injection,
19
+ * queries all models in parallel via Promise.allSettled with per-model prompts, and optionally runs
20
+ * synthesis when --synthModel is provided.
21
+ * *
22
+ * @invariant Model results preserve the order of --model arguments (Promise.allSettled insertion order).
23
+ * @invariant Timeout per model: 5 minutes via AbortSignal. Timeout → error in model block, not thrown.
24
+ * @invariant Exit code: strict mode → 1 if ANY model failed; non-strict → 1 only if ALL failed.
25
+ * @param args Parsed CLI arguments from parseAltOpinionArgs.
26
+ * @param deps Runner dependencies: model port registry, optional synth port, and file reader.
27
+ * @throws {Error} When artifact is empty — validation before any model call.
28
+ * @returns AltOpinionReport with per-model results, exit code, and optional synthesis block.
29
+ * @sideEffect FS: readFile for --file artifact resolution and prompt file loading.
30
+ * @sideEffect Network: AI model API calls via injected ports.
31
+ */
32
+ export declare function runAltOpinion(args: AltOpinionParsedArgs, deps: RunAltOpinionDeps): Promise<AltOpinionReport>;
@@ -0,0 +1,34 @@
1
+ import { createOpenAI } from '@ai-sdk/openai';
2
+ import { generateText } from 'ai';
3
+ import type { AltOpinionReport } from './alt-opinion.types.js';
4
+ /** @purpose Injectable dependencies for the alt-opinion CLI command — enables testing without real stdin/fs. */
5
+ export type AltOpinionCmdDeps = {
6
+ /** @purpose Pre-read stdin content bypassing process.stdin */
7
+ stdinContent?: string;
8
+ /**
9
+ * @purpose Sync file reader override — defaults to readFileSync
10
+ * @param path File path to read.
11
+ * @returns File content as string.
12
+ */
13
+ readFile?: (path: string) => string;
14
+ /** @purpose AI SDK generateText override for testing */
15
+ generateText?: typeof generateText;
16
+ /** @purpose AI SDK createOpenAI override for testing */
17
+ createOpenAI?: typeof createOpenAI;
18
+ };
19
+ /**
20
+ * @purpose CLI entry point for the alt-opinion command.
21
+ * *
22
+ * Parses CLI arguments, creates AI SDK providers from environment variables,
23
+ * builds a Map of AltOpinionModelPort keyed by "provider/model", calls the core runner,
24
+ * and formats the results to stdout with anchor-wrapped blocks or synthesis output.
25
+ * *
26
+ * @param rawArgs Raw CLI arguments (typically process.argv).
27
+ * @param [deps] Optional injectable dependencies for testing.
28
+ * @throws {Error} On parsing failures (missing model, unknown provider, empty input).
29
+ * @returns AltOpinionReport with per-model results, exit code, and optional synthesis block.
30
+ * @sideEffect FS: readFile for prompt files and --file resolution.
31
+ * @sideEffect Env: reads LLM_PROXY_API_KEY, LLM_PROXY_BASE_URL, OPENROUTER_API_KEY.
32
+ * @sideEffect Network: AI model API calls via @ai-sdk/openai.
33
+ */
34
+ export declare function run(rawArgs: string[], deps?: AltOpinionCmdDeps): Promise<AltOpinionReport>;
@@ -0,0 +1,88 @@
1
+ /** @purpose Supported AI model providers for alt-opinion. */
2
+ export type AltOpinionProvider = 'llmproxy' | 'openrouter';
3
+ /**
4
+ * @purpose Descriptor of a single AI model for opinion generation.
5
+ * @invariant `provider` is validated against AltOpinionProvider at parse time.
6
+ */
7
+ export type AltOpinionModel = {
8
+ /** @purpose AI provider identifier | @invariant 'llmproxy' or 'openrouter' */
9
+ provider: AltOpinionProvider;
10
+ /** @purpose Model name in provider/{model-id} format */
11
+ model: string;
12
+ /** @purpose Optional per-model prompt file path (from :: syntax) */
13
+ promptPath?: string;
14
+ };
15
+ /** @purpose Telemetry data for a model call — wall time, token usage, and finish reason. */
16
+ export type AltOpinionTelemetry = {
17
+ /** @purpose Wall-clock time elapsed in milliseconds */
18
+ wallMs: number;
19
+ /** @purpose Prompt token count from provider response */
20
+ promptTokens?: number;
21
+ /** @purpose Completion token count from provider response */
22
+ completionTokens?: number;
23
+ /** @purpose Finish reason from provider (e.g. 'stop', 'length') */
24
+ finishReason?: string;
25
+ };
26
+ /** @purpose Result of a single model call — either success with content or failure with error. */
27
+ export type AltOpinionResult = {
28
+ model: AltOpinionModel;
29
+ success: true;
30
+ content: string;
31
+ telemetry?: AltOpinionTelemetry;
32
+ } | {
33
+ model: AltOpinionModel;
34
+ success: false;
35
+ error: string;
36
+ telemetry?: AltOpinionTelemetry;
37
+ };
38
+ /**
39
+ * @purpose Aggregated report from the alt-opinion runner.
40
+ * @invariant exitCode is 0 when at least one model succeeded (non-strict) or all succeeded (strict); 1 otherwise.
41
+ */
42
+ export type AltOpinionReport = {
43
+ /** @purpose Per-model results in the same order as --model arguments */
44
+ results: AltOpinionResult[];
45
+ /** @purpose Exit code: 0 for success, 1 for failure */
46
+ exitCode: 0 | 1;
47
+ /** @purpose Synthesized opinion content when --synthModel is used */
48
+ synthContent?: string;
49
+ /** @purpose Telemetry for the synthesis model call | @invariant Present only when --synthModel was used */
50
+ synthTelemetry?: AltOpinionTelemetry;
51
+ };
52
+ /** @purpose Parsed CLI arguments ready for the runner. */
53
+ export type AltOpinionParsedArgs = {
54
+ /** @purpose Ordered list of models to query */
55
+ models: AltOpinionModel[];
56
+ /** @purpose Optional synthesis model */
57
+ synthModel?: AltOpinionModel;
58
+ /** @purpose --file argument value */
59
+ file?: string;
60
+ /** @purpose Resolved artifact content (from stdin or --file) */
61
+ artifact?: string;
62
+ /** @purpose Path to shared model prompt file */
63
+ modelPromptPath?: string;
64
+ /** @purpose Path to synthesis prompt file */
65
+ synthPromptPath?: string;
66
+ /** @purpose --strict flag: exit 1 on any model error */
67
+ strict: boolean;
68
+ };
69
+ /**
70
+ * @purpose DI port for AI model calls — allows mocking in tests without monkey-patching the AI SDK.
71
+ * @invariant Implementations must resolve with the generated content and optional usage metadata, or reject with a descriptive error.
72
+ */
73
+ export interface AltOpinionModelPort {
74
+ /**
75
+ * @purpose Generate a text response from the AI model for the given prompt.
76
+ * @param prompt Complete prompt string to send to the model.
77
+ * @throws {Error} On network failure, timeout, or API error.
78
+ * @returns Generated text with optional usage and finish reason metadata.
79
+ */
80
+ generate(prompt: string): Promise<{
81
+ content: string;
82
+ usage?: {
83
+ promptTokens: number;
84
+ completionTokens: number;
85
+ };
86
+ finishReason?: string;
87
+ }>;
88
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { CatGenResult } from '../../utils/cat-gen/cat-gen.js';
2
+ /** @purpose Result of resolving a VCS URL to cat-gen file list — either successful with files or failed with an error. */
3
+ export type CatUrlResult = {
4
+ ok: true;
5
+ files: CatGenResult[];
6
+ } | {
7
+ ok: false;
8
+ error: string;
9
+ };
10
+ /**
11
+ * @purpose Resolve a VCS URL (GitLab MR or GitHub PR) into CatGenResult files for cat output.
12
+ * @param url VCS URL to parse and resolve.
13
+ * @param [options] Optional filtering by exclude patterns or file extensions.
14
+ * @returns CatUrlResult with either fetched files or a user-facing error message.
15
+ */
16
+ export declare function resolveCatUrl(url: string, options?: {
17
+ exclude?: string | string[];
18
+ extensions?: string[];
19
+ }): Promise<CatUrlResult>;
@@ -0,0 +1,11 @@
1
+ import type { LintError } from '../lint.types.js';
2
+ /**
3
+ * @purpose Validates anchor pairing and nesting in TypeScript source per DbC contract.
4
+ * @invariant Stack-based: START_X pushes; END_X finds matching START_X in stack and reports nesting for any unclosed blocks above the match.
5
+ * @invariant Bare #region/#endregion without START_/END_ → ERR_CLI_LINT_ANCHOR_MALFORMED. Bare #endregion auto-closes with stack top.
6
+ * @invariant Pure function — no I/O, no exceptions. Errors returned in ascending line order.
7
+ * @param content Source text to validate.
8
+ * @param filePath File path for error messages.
9
+ * @returns List of lint errors in line order, empty when anchors are correctly paired and nested.
10
+ */
11
+ export declare function check(content: string, filePath: string): LintError[];
@@ -0,0 +1,16 @@
1
+ import type { LintError } from '../lint.types.js';
2
+ /**
3
+ * @purpose Adapts DbcTsLinter result into the lint pipeline — translates DbcLintError → LintError.
4
+ * @implements {DbcContractCheck} in specs/cli/lint/lint.spec.md
5
+ * @invariant When autofix=false, calls lint(); when autofix=true, calls lintAndFix() with disk mutation.
6
+ * @param content Pre-read source text — avoids redundant fs.read.
7
+ * @param filePath Path to the source file for error reporting.
8
+ * @param autofix When true, auto-fixes are applied to the file on disk via DbcTsLinter.
9
+ * @throws {Error} Wraps unexpected linter failure with cause-chain.
10
+ * @returns Object with translated LintError[] and autoFixed count.
11
+ * @sideEffect When autofix=true, mutates the source file on disk through DbcTsLinter.
12
+ */
13
+ export declare function check(content: string, filePath: string, autofix: boolean): Promise<{
14
+ errors: LintError[];
15
+ autoFixed: number;
16
+ }>;
@@ -0,0 +1,12 @@
1
+ import type { LintError } from '../lint.types.js';
2
+ /**
3
+ * @purpose Validates that every TypeScript / linter disable marker in source is accompanied by a Decision Log reference (`D-\d+`) in the same comment line.
4
+ * @implements {DisablesCheck} in specs/cli/lint/lint.spec.md
5
+ * @invariant Marker is counted ONLY when preceded by `//` or `/*` on the same line — string literals containing marker text are not flagged.
6
+ * @invariant `D-\d+` is searched anywhere on the same line as the marker; multi-line block comments are NOT extended (MVP simplification — see lint.spec.md DisablesCheck DbC).
7
+ * @invariant Pure function — no I/O, no exceptions. Errors returned in ascending line order.
8
+ * @param content Source text to validate.
9
+ * @param filePath File path for error messages.
10
+ * @returns List of lint errors in line order; empty when every disable carries a `D-\d+` reference or no disables exist.
11
+ */
12
+ export declare function check(content: string, filePath: string): LintError[];
@@ -0,0 +1,10 @@
1
+ import type { LintError } from '../lint.types.js';
2
+ /**
3
+ * @purpose Validate presence of // @file: and // @consumers: directives at file top before first import.
4
+ * @implements {FileHeaderCheck} in specs/cli/lint/lint.spec.md
5
+ * @invariant Scans only lines before the first import statement; tags after import are ignored.
6
+ * @param content Raw file content as string.
7
+ * @param filePath Path to the file for error reporting.
8
+ * @returns Empty array when both directives are present.
9
+ */
10
+ export declare function check(content: string, filePath: string): LintError[];
@@ -0,0 +1,11 @@
1
+ import type { LintError } from '../lint.types.js';
2
+ /**
3
+ * @purpose Validates that JSDoc contracts and file headers use English, not Russian/Cyrillic.
4
+ * @implements {LanguageCheck} in specs/cli/lint/lint.spec.md
5
+ * @invariant Scans JSDoc blocks and file header lines (// @file:, // @consumers:).
6
+ * @invariant Pure function — no I/O, no exceptions.
7
+ * @param content Source text to validate.
8
+ * @param filePath File path for error messages.
9
+ * @returns List of lint errors in ascending line order, empty when no Cyrillic found.
10
+ */
11
+ export declare function check(content: string, filePath: string): LintError[];
@@ -0,0 +1 @@
1
+ import './lint.cmd.ts';
@@ -0,0 +1,18 @@
1
+ import { LintReport } from './lint.types.js';
2
+ import type { LintError } from './lint.types.js';
3
+ /**
4
+ * @purpose Execute the gennady lint command — collect files, run 4 checks, output ESLint-format report.
5
+ * @implements {LintCommand} in specs/cli/lint/lint.spec.md
6
+ * @param rawArgs Raw command-line arguments (process.argv).
7
+ * @returns LintReport with aggregated errors and exit code.
8
+ */
9
+ export declare function run(rawArgs: string[]): Promise<LintReport>;
10
+ /**
11
+ * @purpose Resolve user-provided target paths to a flat list of .ts/.tsx files.
12
+ * @param targets Paths or glob patterns from CLI arguments.
13
+ * @returns Resolved file list and any resolution errors.
14
+ */
15
+ export declare function resolveTargets(targets: string[]): {
16
+ files: string[];
17
+ errors: LintError[];
18
+ };