gennady 0.6.1 → 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.
- package/README.md +2 -15
- package/ai/agents/agent-resolve-conflicts.xml +6 -0
- package/ai/agents/agent-review-verifier.xml +6 -0
- package/ai/directives/architecture/README.md +21 -0
- package/ai/directives/coding/README.md +23 -0
- package/ai/directives/coding/result-conventions.xml +55 -0
- package/ai/directives/coding/svelte5-runes.xml +248 -0
- package/ai/directives/coding/sveltekit-rules.xml +247 -0
- package/ai/directives/coding/typescript-rules.xml +589 -0
- package/ai/directives/coding/uikit-component-storybook.xml +347 -0
- package/ai/directives/coding/uikit-component-svelte.xml +344 -0
- package/ai/directives/coding/uikit-spec-drafting.xml +243 -0
- package/ai/directives/dbc-audit.directive.xml +131 -0
- package/ai/directives/dev-review.directive.xml +148 -0
- package/ai/directives/infra/README.md +11 -0
- package/ai/directives/infra/eslint-setup.xml +467 -0
- package/ai/directives/infra/git-setup.xml +261 -0
- package/ai/directives/infra/nodejs-npm-setup.xml +354 -0
- package/ai/directives/infra/storybook-setup.xml +153 -0
- package/ai/directives/knowledge.xml +206 -0
- package/ai/directives/perf-auditor/perf-auditor.directive.xml +75 -0
- package/ai/directives/perf-auditor/rules/async-latency.xml +101 -0
- package/ai/directives/perf-auditor/rules/data-structures.xml +103 -0
- package/ai/directives/perf-auditor/rules/iteration-fusion.xml +96 -0
- package/ai/directives/perf-auditor/rules/memory-gc.xml +102 -0
- package/ai/directives/sdd/README.md +49 -0
- package/ai/directives/sdd/audit.directive.xml +543 -0
- package/ai/directives/sdd/discovery.directive.xml +824 -0
- package/ai/directives/sdd/fix.directive.xml +249 -0
- package/ai/directives/sdd/module-decomposition.directive.xml +666 -0
- package/ai/directives/sdd/phase-execution-protocol.xml +339 -0
- package/ai/directives/sdd/scaffold.directive.xml +717 -0
- package/ai/directives/sdd/setup.directive.xml +213 -0
- package/ai/directives/sdd/svelte-ui-discovery.directive.xml +263 -0
- package/ai/directives/semantic-change-extractor.directive.xml +99 -0
- package/ai/directives/testing/README.md +25 -0
- package/ai/directives/testing/common.xml +234 -0
- package/ai/directives/testing/node-test.xml +288 -0
- package/ai/directives/testing/playwright-cli.xml +199 -0
- package/ai/directives/testing/playwright-e2e.xml +292 -0
- package/ai/directives/testing/storybook-usage.xml +173 -0
- package/ai/directives/testing/svelte-testing.xml +237 -0
- package/ai/directives/testing/vitest-rules.xml +326 -0
- package/ai/docs/README.md +17 -0
- package/ai/docs/ai-icl.md +538 -0
- package/ai/docs/ai-priming.md +548 -0
- package/ai/docs/ai-prompt-formats.md +406 -0
- package/ai/docs/ai-promting.md +572 -0
- package/ai/drafts/DRAFT.md +120 -0
- package/ai/drafts/agent-devgen-class-from-description.rules.xml +123 -0
- package/ai/drafts/agent-typescript-devgen.v1.xml +303 -0
- package/ai/drafts/d.md +65 -0
- package/ai/drafts/music-posts.md +105 -0
- package/ai/fw/v1/architecture/blueprint-factory.xml +77 -0
- package/ai/fw/v1/core/mental-model.xml +50 -0
- package/ai/fw/v1/discovery/intent-reactor.xml +92 -0
- package/ai/fw/v1/production/swarm-protocol.xml +122 -0
- package/ai/fw/v1/review/quality-pipeline.xml +102 -0
- package/ai/fw/v2/arch-universal.xml +73 -0
- package/ai/fw-draft/README.md +79 -0
- package/ai/fw-draft/bin/discovery.sh +116 -0
- package/ai/fw-draft/gennady.xml +58 -0
- package/ai/fw-draft/provider/claude.xml +16 -0
- package/ai/fw-draft/provider/cursor.xml +23 -0
- package/ai/fw-draft/provider/default.xml +12 -0
- package/ai/fw-draft/roles/developer.xml +18 -0
- package/ai/fw-draft/router.xml +39 -0
- package/ai/fw-draft/routes/development.xml +32 -0
- package/ai/fw-draft/routes/universal.xml +58 -0
- package/ai/fw-draft/rules/dev/base/file-structure-rules.xml +89 -0
- package/ai/fw-draft/rules/dev/typescript/contacts.xml +194 -0
- package/dist/ai/agents/agent-resolve-conflicts.xml +6 -0
- package/dist/ai/agents/agent-review-verifier.xml +6 -0
- package/dist/ai/directives/architecture/README.md +21 -0
- package/dist/ai/directives/coding/README.md +23 -0
- package/dist/ai/directives/coding/result-conventions.xml +55 -0
- package/dist/ai/directives/coding/svelte5-runes.xml +248 -0
- package/dist/ai/directives/coding/sveltekit-rules.xml +247 -0
- package/dist/ai/directives/coding/typescript-rules.xml +589 -0
- package/dist/ai/directives/coding/uikit-component-storybook.xml +347 -0
- package/dist/ai/directives/coding/uikit-component-svelte.xml +344 -0
- package/dist/ai/directives/coding/uikit-spec-drafting.xml +243 -0
- package/dist/ai/directives/dbc-audit.directive.xml +131 -0
- package/dist/ai/directives/dev-review.directive.xml +148 -0
- package/dist/ai/directives/infra/README.md +11 -0
- package/dist/ai/directives/infra/eslint-setup.xml +467 -0
- package/dist/ai/directives/infra/git-setup.xml +261 -0
- package/dist/ai/directives/infra/nodejs-npm-setup.xml +354 -0
- package/dist/ai/directives/infra/storybook-setup.xml +153 -0
- package/dist/ai/directives/knowledge.xml +206 -0
- package/dist/ai/directives/perf-auditor/perf-auditor.directive.xml +75 -0
- package/dist/ai/directives/perf-auditor/rules/async-latency.xml +101 -0
- package/dist/ai/directives/perf-auditor/rules/data-structures.xml +103 -0
- package/dist/ai/directives/perf-auditor/rules/iteration-fusion.xml +96 -0
- package/dist/ai/directives/perf-auditor/rules/memory-gc.xml +102 -0
- package/dist/ai/directives/sdd/README.md +49 -0
- package/dist/ai/directives/sdd/audit.directive.xml +543 -0
- package/dist/ai/directives/sdd/discovery.directive.xml +824 -0
- package/dist/ai/directives/sdd/fix.directive.xml +249 -0
- package/dist/ai/directives/sdd/module-decomposition.directive.xml +666 -0
- package/dist/ai/directives/sdd/phase-execution-protocol.xml +339 -0
- package/dist/ai/directives/sdd/scaffold.directive.xml +717 -0
- package/dist/ai/directives/sdd/setup.directive.xml +213 -0
- package/dist/ai/directives/sdd/svelte-ui-discovery.directive.xml +263 -0
- package/dist/ai/directives/semantic-change-extractor.directive.xml +99 -0
- package/dist/ai/directives/testing/README.md +25 -0
- package/dist/ai/directives/testing/common.xml +234 -0
- package/dist/ai/directives/testing/node-test.xml +288 -0
- package/dist/ai/directives/testing/playwright-cli.xml +199 -0
- package/dist/ai/directives/testing/playwright-e2e.xml +292 -0
- package/dist/ai/directives/testing/storybook-usage.xml +173 -0
- package/dist/ai/directives/testing/svelte-testing.xml +237 -0
- package/dist/ai/directives/testing/vitest-rules.xml +326 -0
- package/dist/ai/docs/README.md +17 -0
- package/dist/ai/docs/ai-icl.md +538 -0
- package/dist/ai/docs/ai-priming.md +548 -0
- package/dist/ai/docs/ai-prompt-formats.md +406 -0
- package/dist/ai/docs/ai-promting.md +572 -0
- package/dist/ai/drafts/DRAFT.md +120 -0
- package/dist/ai/drafts/agent-devgen-class-from-description.rules.xml +123 -0
- package/dist/ai/drafts/agent-typescript-devgen.v1.xml +303 -0
- package/dist/ai/drafts/d.md +65 -0
- package/dist/ai/drafts/music-posts.md +105 -0
- package/dist/ai/fw/v1/architecture/blueprint-factory.xml +77 -0
- package/dist/ai/fw/v1/core/mental-model.xml +50 -0
- package/dist/ai/fw/v1/discovery/intent-reactor.xml +92 -0
- package/dist/ai/fw/v1/production/swarm-protocol.xml +122 -0
- package/dist/ai/fw/v1/review/quality-pipeline.xml +102 -0
- package/dist/ai/fw/v2/arch-universal.xml +73 -0
- package/dist/ai/fw-draft/README.md +79 -0
- package/dist/ai/fw-draft/bin/discovery.sh +116 -0
- package/dist/ai/fw-draft/gennady.xml +58 -0
- package/dist/ai/fw-draft/provider/claude.xml +16 -0
- package/dist/ai/fw-draft/provider/cursor.xml +23 -0
- package/dist/ai/fw-draft/provider/default.xml +12 -0
- package/dist/ai/fw-draft/roles/developer.xml +18 -0
- package/dist/ai/fw-draft/router.xml +39 -0
- package/dist/ai/fw-draft/routes/development.xml +32 -0
- package/dist/ai/fw-draft/routes/universal.xml +58 -0
- package/dist/ai/fw-draft/rules/dev/base/file-structure-rules.xml +89 -0
- package/dist/ai/fw-draft/rules/dev/typescript/contacts.xml +194 -0
- package/dist/chunks/devtools-B-7ugZhF.js +79 -0
- package/dist/chunks/{help.cmd-CWasx25o.js → help.cmd-B_G7EWzF.js} +9 -2
- package/dist/chunks/{index-Gy1n7hRU.js → index-BeL1Zcbg.js} +1 -1
- package/dist/chunks/index-CVR66voe.js +26963 -0
- package/dist/chunks/index-CXuhZzS3.js +16979 -0
- package/dist/chunks/{index-Bh0p7rJg.js → index-CaahtXiM.js} +33 -9
- package/dist/chunks/{index-BrobNwbS.js → index-CiEM-8nJ.js} +35 -19
- package/dist/chunks/{index-D1Hurfwu.js → index-D1qsi0Uc.js} +57 -33
- package/dist/chunks/index-D9ceRUyB.js +443 -0
- package/dist/chunks/index-DJpVmyp2.js +176 -0
- package/dist/chunks/{index-B3r-YFvt.js → index-DU6jD7SS.js} +1 -1
- package/dist/chunks/index-KxSZKmZn.js +540 -0
- package/dist/chunks/{index-DgAmONSz.js → index-UbHoePfr.js} +12 -12
- package/dist/chunks/{index-Bx_P7mlL.js → index-g1LXlp77.js} +2 -2
- package/dist/chunks/index-zBnnuvLA.js +3788 -0
- package/dist/chunks/{run-review-command.logic-BQDGxh0f.js → run-review-command.logic-DpkRoEi8.js} +2 -2
- package/dist/chunks/services-CaLOhuLV.js +2889 -0
- package/dist/chunks/shared-Bjy30TeM.js +665 -0
- package/dist/cli/cmd/_shared/prompt/io/load-agent-template.io.d.ts +3 -3
- package/dist/cli/cmd/_shared/prompt/logic/build-ai-first-knowledge-block.logic.d.ts +3 -3
- package/dist/cli/cmd/_shared/prompt/logic/build-ai-verify-placeholders.logic.d.ts +7 -4
- package/dist/cli/cmd/_shared/prompt/logic/verify-commands/resolve-verify-commands.logic.d.ts +5 -0
- package/dist/cli/cmd/_shared/update-check-worker.d.ts +1 -0
- package/dist/cli/cmd/_shared/update-check.d.ts +38 -0
- package/dist/cli/cmd/agent-mon/cmd/create-providers.d.ts +15 -0
- package/dist/cli/cmd/agent-mon/cmd/index.d.ts +1 -0
- package/dist/cli/cmd/agent-mon/cmd/run.d.ts +12 -0
- package/dist/cli/cmd/agent-mon/state/create-state-manager.d.ts +32 -0
- package/dist/cli/cmd/agent-mon/state/group-by-provider.d.ts +14 -0
- package/dist/cli/cmd/agent-mon/state/index.d.ts +5 -0
- package/dist/cli/cmd/agent-mon/state/is-waiting.d.ts +9 -0
- package/dist/cli/cmd/agent-mon/state/view-model.type.d.ts +74 -0
- package/dist/cli/cmd/agent-mon/ui/app.d.ts +16 -0
- package/dist/cli/cmd/agent-mon/ui/column-view.d.ts +14 -0
- package/dist/cli/cmd/agent-mon/ui/index.d.ts +10 -0
- package/dist/cli/cmd/agent-mon/ui/provider-column.d.ts +14 -0
- package/dist/cli/cmd/agent-mon/ui/session-card.d.ts +12 -0
- package/dist/cli/cmd/agent-mon/ui/status-badge.d.ts +10 -0
- package/dist/cli/cmd/alt-opinion/alt-opinion-parser.d.ts +18 -0
- package/dist/cli/cmd/alt-opinion/alt-opinion-runner.d.ts +32 -0
- package/dist/cli/cmd/alt-opinion/alt-opinion.cmd.d.ts +34 -0
- package/dist/cli/cmd/alt-opinion/alt-opinion.types.d.ts +88 -0
- package/dist/cli/cmd/alt-opinion/index.d.ts +1 -0
- package/dist/cli/cmd/cat/cat-url.fn.d.ts +19 -0
- package/dist/cli/cmd/lint/checks/anchor.check.d.ts +11 -0
- package/dist/cli/cmd/lint/checks/dbc-contract.check.d.ts +16 -0
- package/dist/cli/cmd/lint/checks/disables.check.d.ts +12 -0
- package/dist/cli/cmd/lint/checks/file-header.check.d.ts +10 -0
- package/dist/cli/cmd/lint/checks/language.check.d.ts +11 -0
- package/dist/cli/cmd/lint/index.d.ts +1 -0
- package/dist/cli/cmd/lint/lint.cmd.d.ts +18 -0
- package/dist/cli/cmd/lint/lint.types.d.ts +72 -0
- package/dist/cli/cmd/lint/utils/resolve-references.fn.d.ts +32 -0
- package/dist/cli/cmd/remote-console/index.d.ts +2 -0
- package/dist/cli/cmd/remote-console/remote-console.cmd.d.ts +55 -0
- package/dist/cli/cmd/resolve-conflicts/_core/io/resolve-conflicts-template-load.io.d.ts +2 -2
- package/dist/cli/cmd/resolve-conflicts/_core/logic/resolve-conflicts-command-args-parse.logic.d.ts +3 -3
- package/dist/cli/cmd/resolve-conflicts/_core/logic/resolve-conflicts-command-run.logic.d.ts +3 -3
- package/dist/cli/cmd/resolve-conflicts/_core/logic/resolve-conflicts-context-git-build.logic.d.ts +4 -4
- package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-artifact.type.d.ts +3 -1
- package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-command-args.type.d.ts +3 -1
- package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-command-result.type.d.ts +5 -1
- package/dist/cli/cmd/resolve-conflicts/_core/types/resolve-conflicts-context-git.type.d.ts +18 -2
- package/dist/cli/cmd/resolve-conflicts/_core/xml/resolve-conflicts-artifact-build.xml.d.ts +6 -6
- package/dist/cli/cmd/resolve-conflicts/_core/xml/resolve-conflicts-render.xml.d.ts +4 -4
- package/dist/cli/cmd/review/_core/io/load-review-verify-template.io.d.ts +2 -2
- package/dist/cli/cmd/review/_core/logic/build-review-context-git.logic.d.ts +3 -3
- package/dist/cli/cmd/review/_core/logic/build-review-context-vcs.logic.d.ts +2 -2
- package/dist/cli/cmd/review/_core/logic/load-review-context-mr.logic.d.ts +5 -5
- package/dist/cli/cmd/review/_core/logic/parse-review-command-args.logic.d.ts +3 -3
- package/dist/cli/cmd/review/_core/logic/resolve-review-intent.logic.d.ts +3 -3
- package/dist/cli/cmd/review/_core/logic/run-review-command.logic.d.ts +3 -3
- package/dist/cli/cmd/review/_core/types/review-artifact.type.d.ts +4 -1
- package/dist/cli/cmd/review/_core/types/review-command-args.type.d.ts +7 -1
- package/dist/cli/cmd/review/_core/types/review-command-mode.type.d.ts +1 -1
- package/dist/cli/cmd/review/_core/types/review-command-options.type.d.ts +3 -1
- package/dist/cli/cmd/review/_core/types/review-command-result.type.d.ts +5 -1
- package/dist/cli/cmd/review/_core/types/review-context-git.type.d.ts +3 -1
- package/dist/cli/cmd/review/_core/types/review-context-mr.type.d.ts +22 -3
- package/dist/cli/cmd/review/_core/types/review-context-vcs.type.d.ts +4 -1
- package/dist/cli/cmd/review/_core/types/review-intent.type.d.ts +1 -1
- package/dist/cli/cmd/review/_core/xml/build-review-artifact.xml.d.ts +10 -10
- package/dist/cli/cmd/review/_core/xml/render-review-issues.xml.d.ts +3 -3
- package/dist/cli/cmd/review/_core/xml/render-review-verify.xml.d.ts +4 -4
- package/dist/cli/cmd/sync/index.d.ts +1 -0
- package/dist/cli/cmd/sync/sync-core.d.ts +65 -0
- package/dist/cli/cmd/sync/sync-formatter.d.ts +12 -0
- package/dist/cli/cmd/sync/sync.cmd.d.ts +33 -0
- package/dist/cli/cmd/sync/sync.types.d.ts +50 -0
- package/dist/cli/cmd/vcs-reply/vcs-reply.cmd.d.ts +4 -4
- package/dist/cli/utils/ai-legacy/ai-legacy-agent.d.ts +12 -11
- package/dist/cli/utils/ai-legacy/ai-legacy-core.d.ts +33 -17
- package/dist/cli/utils/ai-legacy/ai-legacy-model.d.ts +42 -23
- package/dist/cli/utils/cat-gen/cat-gen.d.ts +19 -8
- package/dist/cli/utils/commit-gen/commit-gen.d.ts +39 -15
- package/dist/cli/utils/prompts/index.d.ts +6 -6
- package/dist/cli/utils/review-gen/review-gen.d.ts +33 -9
- package/dist/gennady.js +30 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +44 -23
- package/dist/services/agent-mon/diff/diff.d.ts +9 -0
- package/dist/services/agent-mon/diff/index.d.ts +1 -0
- package/dist/services/agent-mon/index.d.ts +10 -0
- package/dist/services/agent-mon/model/agent-provider.type.d.ts +20 -0
- package/dist/services/agent-mon/model/agent-session.type.d.ts +49 -0
- package/dist/services/agent-mon/model/errors.d.ts +20 -0
- package/dist/services/agent-mon/model/index.d.ts +7 -0
- package/dist/services/agent-mon/model/observe-opts.type.d.ts +7 -0
- package/dist/services/agent-mon/model/scan-opts.type.d.ts +7 -0
- package/dist/services/agent-mon/model/session-changes.type.d.ts +10 -0
- package/dist/services/agent-mon/monitor/agent-monitor.d.ts +44 -0
- package/dist/services/agent-mon/monitor/create-monitor.d.ts +6 -0
- package/dist/services/agent-mon/monitor/index.d.ts +2 -0
- package/dist/services/agent-mon/observe/index.d.ts +1 -0
- package/dist/services/agent-mon/observe/observe.d.ts +12 -0
- package/dist/services/agent-mon/providers/claude/claude-provider.d.ts +50 -0
- package/dist/services/agent-mon/providers/claude/index.d.ts +5 -0
- package/dist/services/agent-mon/providers/claude/ps.d.ts +36 -0
- package/dist/services/agent-mon/providers/claude/session-json.d.ts +37 -0
- package/dist/services/agent-mon/providers/opencode/db.d.ts +41 -0
- package/dist/services/agent-mon/providers/opencode/index.d.ts +3 -0
- package/dist/services/agent-mon/providers/opencode/model-parser.d.ts +6 -0
- package/dist/services/agent-mon/providers/opencode/opencode-provider.d.ts +45 -0
- package/dist/services/ai-client/providers/ai-model.type.d.ts +14 -0
- package/dist/services/ai-client/providers/open-router/open-router-model.type.d.ts +1 -4
- package/dist/services/ai-client/providers/open-router/open-router-provider.d.ts +17 -0
- package/dist/services/ai-client/providers/openai-like-provider.d.ts +1 -0
- package/dist/services/data-ore/telegram/telegram-data-ore.d.ts +17 -0
- package/dist/services/data-ore/telegram/telegram-data-ore.types.d.ts +4 -0
- package/dist/services/data-ore/telegram/telegram-demo-music-helper.d.ts +1 -0
- package/dist/services/data-ore/telegram/telegram-demo.d.ts +1 -0
- package/dist/services/dbc/linter/dbc-ast-adapter.types.d.ts +82 -0
- package/dist/services/dbc/linter/dbc-linter.types.d.ts +95 -0
- package/dist/services/dbc/linter/implementations/ts/dbc-ts-ast-adapter.d.ts +183 -0
- package/dist/services/dbc/linter/implementations/ts/dbc-ts-linter.d.ts +152 -0
- package/dist/services/dbc/parser/dbc-parser.types.d.ts +16 -16
- package/dist/services/dbc/parser/implementations/jsdoc/dbc-jsdoc-parser.d.ts +14 -4
- package/dist/services/logger/logger.d.ts +26 -6
- package/dist/services/remote-console/client/remote-console-client-serializer.d.ts +7 -0
- package/dist/services/remote-console/client/remote-console-client.d.ts +20 -0
- package/dist/services/remote-console/client/remote-console-client.types.d.ts +88 -0
- package/dist/services/remote-console/remote-console.d.ts +6 -0
- package/dist/services/remote-console/server/remote-console-server.d.ts +10 -0
- package/dist/services/remote-console/server/remote-console-server.types.d.ts +44 -0
- package/dist/services/remote-console/server/remote-console-stdout-writer.d.ts +26 -0
- package/dist/services/vcs-client/abstract/vcs-client-merge-discussions.d.ts +22 -14
- package/dist/services/vcs-client/abstract/vcs-client-merge-requests.d.ts +31 -14
- package/dist/services/vcs-client/abstract/vcs-client-repository-files.d.ts +16 -0
- package/dist/services/vcs-client/abstract/vcs-client.d.ts +9 -5
- package/dist/services/vcs-client/entities/vcs-file-content.type.d.ts +24 -0
- package/dist/services/vcs-client/entities/vcs-merge-request-changes.type.d.ts +32 -0
- package/dist/services/vcs-client/entities/vcs-url.type.d.ts +14 -0
- package/dist/services/vcs-client/entities/vcs-user.type.d.ts +3 -0
- package/dist/services/vcs-client/github/vcs-github-client.d.ts +31 -0
- package/dist/services/vcs-client/github/vcs-github-merge-requests.d.ts +40 -0
- package/dist/services/vcs-client/github/vcs-github-repository-files.d.ts +27 -0
- package/dist/services/vcs-client/gitlab/vcs-gitlab-client.d.ts +13 -4
- package/dist/services/vcs-client/gitlab/vcs-gitlab-merge-discussions.d.ts +16 -5
- package/dist/services/vcs-client/gitlab/vcs-gitlab-merge-requests.d.ts +24 -5
- package/dist/services/vcs-client/gitlab/vcs-gitlab-repository-files.d.ts +27 -0
- package/dist/services/vcs-client/parse-vcs-url.d.ts +3 -0
- package/dist/shared/backend/git/git-core.d.ts +24 -22
- package/dist/shared/backend/git/git-diff.d.ts +16 -5
- package/dist/shared/backend/rc/rc-config.d.ts +27 -15
- package/dist/shared/common/exec.d.ts +4 -6
- package/dist/shared/common/files.d.ts +1 -3
- package/dist/shared/common/language.d.ts +3 -6
- package/dist/shared/common/parse-args.d.ts +1 -4
- package/dist/shared/common/style.d.ts +3 -3
- package/dist/shared/common/think.d.ts +1 -5
- package/dist/shared/common/tokens.d.ts +1 -5
- package/dist/shared/common/unguard.d.ts +4 -8
- package/dist/shared/common/xml.d.ts +16 -12
- package/package.json +20 -4
- package/dist/.ai/agents/agent-resolve-conflicts.xml +0 -148
- package/dist/.ai/agents/agent-review-verifier.xml +0 -181
- package/dist/chunks/index-C4jt5WBP.js +0 -3548
- package/dist/chunks/services-Sb7TwLxt.js +0 -122
- package/dist/chunks/shared-D0kSJB49.js +0 -601
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
import type { ScanOpts } from '../../model/scan-opts.type.js';
|
|
3
|
+
/** @purpose Raw row shape from the OpenCode session table. */
|
|
4
|
+
export type SessionRow = {
|
|
5
|
+
/** @purpose Unique session identifier */
|
|
6
|
+
id: string;
|
|
7
|
+
/** @purpose URL-friendly unique slug for the session */
|
|
8
|
+
slug: string;
|
|
9
|
+
/** @purpose Human-readable session title */
|
|
10
|
+
title: string | null;
|
|
11
|
+
/** @purpose Working directory the session was started in */
|
|
12
|
+
directory: string;
|
|
13
|
+
/** @purpose Session creation timestamp in epoch ms */
|
|
14
|
+
time_created: number;
|
|
15
|
+
/** @purpose Session last update timestamp in epoch ms */
|
|
16
|
+
time_updated: number;
|
|
17
|
+
/** @purpose Agent name used for the session */
|
|
18
|
+
agent: string | null;
|
|
19
|
+
/** @purpose Model name used for the session */
|
|
20
|
+
model: string | null;
|
|
21
|
+
/** @purpose Input token count for the session */
|
|
22
|
+
tokens_input: number | null;
|
|
23
|
+
/** @purpose Output token count for the session */
|
|
24
|
+
tokens_output: number | null;
|
|
25
|
+
/** @purpose Parent session ID for forked sessions */
|
|
26
|
+
parent_id: string | null;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* @purpose Query active (non-archived) sessions from the OpenCode database.
|
|
30
|
+
* @param db Open SQLite database connection.
|
|
31
|
+
* @param [opts] Optional scan filtering parameters.
|
|
32
|
+
* @returns Rows matching the active session criteria, ordered by most recently updated.
|
|
33
|
+
*/
|
|
34
|
+
export declare function querySessions(db: DatabaseSync, opts?: ScanOpts): SessionRow[];
|
|
35
|
+
/**
|
|
36
|
+
* @purpose Retrieve the last message data for a session.
|
|
37
|
+
* @param db Open SQLite database connection.
|
|
38
|
+
* @param sessionId The session identifier to look up.
|
|
39
|
+
* @returns The raw message data string, or null if no messages found.
|
|
40
|
+
*/
|
|
41
|
+
export declare function queryLastMessage(db: DatabaseSync, sessionId: string): string | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @purpose Extract the model id from a raw OpenCode model JSON string.
|
|
3
|
+
* @param raw The model JSON string or null.
|
|
4
|
+
* @returns The extracted model id, 'unknown' on parse failure, undefined for null input.
|
|
5
|
+
*/
|
|
6
|
+
export declare function parseModelJson(raw: string | null): string | undefined;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AgentSession } from '../../model/agent-session.type.js';
|
|
2
|
+
import type { ScanOpts } from '../../model/scan-opts.type.js';
|
|
3
|
+
import type { AgentProvider } from '../../model/agent-provider.type.js';
|
|
4
|
+
import { querySessions as defaultQuerySessions, queryLastMessage as defaultQueryLastMessage } from './db.js';
|
|
5
|
+
import { parseModelJson as defaultParseModelJson } from './model-parser.js';
|
|
6
|
+
/** @purpose Injectable constructor dependencies for OpenCodeProvider testing and customization. */
|
|
7
|
+
export type OpenCodeProviderDeps = {
|
|
8
|
+
/** @purpose Custom SQLite database path override */
|
|
9
|
+
dbPath?: string;
|
|
10
|
+
/** @purpose Session query function injectable for testing */
|
|
11
|
+
querySessions?: typeof defaultQuerySessions;
|
|
12
|
+
/** @purpose Last message query function injectable for testing */
|
|
13
|
+
queryLastMessage?: typeof defaultQueryLastMessage;
|
|
14
|
+
/** @purpose Model JSON parser injectable for testing */
|
|
15
|
+
parseModelJson?: typeof defaultParseModelJson;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @purpose Adapter scanning OpenCode agent sessions via SQLite.
|
|
19
|
+
* @implements {AgentProvider} in ../../model/agent-provider.type.ts
|
|
20
|
+
*/
|
|
21
|
+
export declare class OpenCodeProvider implements AgentProvider {
|
|
22
|
+
/** @purpose Provider identifier key ('opencode') */
|
|
23
|
+
readonly key = "opencode";
|
|
24
|
+
/** @purpose Resolved dependency injection container */
|
|
25
|
+
protected _deps: Required<OpenCodeProviderDeps>;
|
|
26
|
+
/** @purpose Logger instance for structured logging */
|
|
27
|
+
protected _logger: import("#logger").SimpleLogger;
|
|
28
|
+
/**
|
|
29
|
+
* @purpose Construct with optional dependency injection for testing.
|
|
30
|
+
* @param [deps] Injectable query functions and db path overrides.
|
|
31
|
+
*/
|
|
32
|
+
constructor(deps?: OpenCodeProviderDeps);
|
|
33
|
+
/**
|
|
34
|
+
* @param [opts] Optional scan filtering parameters.
|
|
35
|
+
* @returns Parsed agent sessions array.
|
|
36
|
+
* @see {AgentProvider#scan} in ../../model/agent-provider.type.ts
|
|
37
|
+
*/
|
|
38
|
+
scan(opts?: ScanOpts): Promise<AgentSession[]>;
|
|
39
|
+
/**
|
|
40
|
+
* @purpose Resolve tilde-prefixed path to an absolute path using the home directory.
|
|
41
|
+
* @param raw Raw path string potentially starting with ~/.
|
|
42
|
+
* @returns Absolute path with ~ resolved to os.homedir().
|
|
43
|
+
*/
|
|
44
|
+
protected _resolvePath(raw: string): string;
|
|
45
|
+
}
|
|
@@ -3,22 +3,32 @@
|
|
|
3
3
|
* @behavior Only id and name are guaranteed; other fields depend on the source.
|
|
4
4
|
*/
|
|
5
5
|
export type AIModel = {
|
|
6
|
+
/** @purpose Unique model identifier string */
|
|
6
7
|
id: string;
|
|
8
|
+
/** @purpose Human-readable model name */
|
|
7
9
|
name: string;
|
|
10
|
+
/** @purpose Optional model description text */
|
|
8
11
|
description?: string;
|
|
12
|
+
/** @purpose Pricing info with optional prompt and completion costs */
|
|
9
13
|
pricing?: {
|
|
10
14
|
prompt?: string;
|
|
11
15
|
completion?: string;
|
|
12
16
|
};
|
|
17
|
+
/** @purpose Top provider metadata */
|
|
13
18
|
top_provider?: {
|
|
14
19
|
context_length?: number;
|
|
15
20
|
max_completion_tokens?: number | null;
|
|
16
21
|
is_moderated?: boolean;
|
|
17
22
|
};
|
|
23
|
+
/** @purpose Canonical slug for the model */
|
|
18
24
|
canonical_slug?: string;
|
|
25
|
+
/** @purpose Hugging Face model identifier */
|
|
19
26
|
hugging_face_id?: string;
|
|
27
|
+
/** @purpose Model creation timestamp */
|
|
20
28
|
created?: number;
|
|
29
|
+
/** @purpose Context window length in tokens */
|
|
21
30
|
context_length?: number;
|
|
31
|
+
/** @purpose Model architecture details */
|
|
22
32
|
architecture?: {
|
|
23
33
|
modality?: string;
|
|
24
34
|
tokenizer?: string;
|
|
@@ -26,8 +36,12 @@ export type AIModel = {
|
|
|
26
36
|
input_modalities?: string[];
|
|
27
37
|
output_modalities?: string[];
|
|
28
38
|
};
|
|
39
|
+
/** @purpose Per-request rate limiting info */
|
|
29
40
|
per_request_limits?: unknown;
|
|
41
|
+
/** @purpose Supported generation parameters */
|
|
30
42
|
supported_parameters?: string[];
|
|
43
|
+
/** @purpose Default parameter overrides */
|
|
31
44
|
default_parameters?: Record<string, unknown>;
|
|
45
|
+
/** @purpose Model expiration date info */
|
|
32
46
|
expiration_date?: unknown;
|
|
33
47
|
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { AIModel } from '../ai-model.type.js';
|
|
2
|
-
/**
|
|
3
|
-
* @purpose Open Router GET /models API response item (full schema).
|
|
4
|
-
* @see {AIModel} in ./ai-model.type.ts
|
|
5
|
-
*/
|
|
2
|
+
/** @purpose Open Router GET /models API response item (full schema). */
|
|
6
3
|
export type OpenRouterModel = AIModel & {
|
|
7
4
|
canonical_slug: string;
|
|
8
5
|
context_length: number;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { type OpenAIProvider, type OpenAIProviderSettings } from '@ai-sdk/openai';
|
|
2
2
|
import type { AIModel } from '../ai-model.type.js';
|
|
3
|
+
/** @purpose Provider adapter for Open Router API, wrapping OpenAI-compatible SDK. */
|
|
3
4
|
export declare class OpenRouterProvider {
|
|
5
|
+
/** @purpose OpenAI provider settings */
|
|
4
6
|
protected _settings: OpenAIProviderSettings;
|
|
7
|
+
/** @purpose OpenAI provider instance */
|
|
5
8
|
protected _provider: OpenAIProvider;
|
|
9
|
+
/**
|
|
10
|
+
* @purpose Initialize the provider with OpenAI-compatible settings.
|
|
11
|
+
* @param settings Provider configuration settings.
|
|
12
|
+
*/
|
|
6
13
|
constructor(settings: OpenAIProviderSettings);
|
|
14
|
+
/**
|
|
15
|
+
* @purpose Fetch available AI models from the Open Router API.
|
|
16
|
+
* @returns Array of available AI models.
|
|
17
|
+
*/
|
|
7
18
|
getModels(): Promise<AIModel[]>;
|
|
19
|
+
/**
|
|
20
|
+
* @purpose Generate text completion using a specified model.
|
|
21
|
+
* @param model Model identifier string.
|
|
22
|
+
* @param prompt Text prompt to generate from.
|
|
23
|
+
* @returns Generated text output.
|
|
24
|
+
*/
|
|
8
25
|
generateText(model: string, prompt: string): Promise<string>;
|
|
9
26
|
}
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import { Dialog, TelegramClient, User, type TelegramClientOptions } from '@mtcute/node';
|
|
2
2
|
import { Dispatcher, MessageContext } from '@mtcute/dispatcher';
|
|
3
3
|
import type { DialogsQuery } from './telegram-data-ore.types.js';
|
|
4
|
+
/** @purpose Telegram client wrapper providing authentication and dialog retrieval. */
|
|
4
5
|
export declare class TelegramDataOre {
|
|
6
|
+
/** @purpose Underlying mtcute Telegram client instance */
|
|
5
7
|
protected _client: TelegramClient;
|
|
8
|
+
/** @purpose Message dispatcher for routing incoming updates */
|
|
6
9
|
protected _dispatcher: Dispatcher;
|
|
10
|
+
/**
|
|
11
|
+
* @purpose Initialize the Telegram client with given options and wire up message handler.
|
|
12
|
+
* @param options Telegram client configuration options.
|
|
13
|
+
*/
|
|
7
14
|
constructor(options: TelegramClientOptions);
|
|
15
|
+
/**
|
|
16
|
+
* @purpose Authorize the Telegram client, using QR login as fallback.
|
|
17
|
+
* @returns Authenticated user object.
|
|
18
|
+
*/
|
|
8
19
|
authorize(): Promise<User>;
|
|
20
|
+
/**
|
|
21
|
+
* @purpose Retrieve dialogs from Telegram with optional query filters.
|
|
22
|
+
* @param [query] Optional query parameters for filtering and pagination.
|
|
23
|
+
* @returns Async iterable iterator of dialogs.
|
|
24
|
+
*/
|
|
9
25
|
getDialogs(query?: DialogsQuery): Promise<AsyncIterableIterator<Dialog>>;
|
|
26
|
+
/** @purpose Handler for incoming Telegram messages, formats and prints them. */
|
|
10
27
|
protected _handleNewMessage: (update: MessageContext, _state: never) => Promise<void>;
|
|
11
28
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
/** @purpose Query parameters for fetching Telegram dialogs. */
|
|
1
2
|
export type DialogsQuery = {
|
|
3
|
+
/** @purpose Maximum number of dialogs to return */
|
|
2
4
|
limit?: number;
|
|
5
|
+
/** @purpose Whether to include archived chats */
|
|
3
6
|
includedArchived?: boolean;
|
|
4
7
|
};
|
|
8
|
+
/** @purpose Query parameters for date-range based filtering (placeholder for future use). */
|
|
5
9
|
export type RangeQuery = {};
|
|
@@ -4,6 +4,7 @@ type TelegramSource = Dialog | MessageContext;
|
|
|
4
4
|
/**
|
|
5
5
|
* @purpose Generate structured music release description from Telegram data.
|
|
6
6
|
* @param source Telegram dialog or message context.
|
|
7
|
+
* @returns Promise that resolves when music description has been generated and saved.
|
|
7
8
|
*/
|
|
8
9
|
export declare function generateMusicDescription(source: TelegramSource): Promise<void>;
|
|
9
10
|
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** @purpose Describes a single parameter in a function or method signature. */
|
|
2
|
+
export type DbcParamInfo = {
|
|
3
|
+
/** @purpose Parameter name as declared in source */
|
|
4
|
+
name: string;
|
|
5
|
+
/** @purpose TypeScript type annotation as written in source */
|
|
6
|
+
type: string;
|
|
7
|
+
/** @purpose Whether the parameter is optional (`x?: T`) */
|
|
8
|
+
optional: boolean;
|
|
9
|
+
/** @purpose Whether the parameter is a rest parameter (`...args`) */
|
|
10
|
+
isRest: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** @purpose Describes the full signature of a callable entity: parameters and return type. */
|
|
13
|
+
export type DbcSignatureInfo = {
|
|
14
|
+
/** @purpose Ordered list of parameters in the signature */
|
|
15
|
+
params: DbcParamInfo[];
|
|
16
|
+
/** @purpose Return type annotation as written in source, or 'void' */
|
|
17
|
+
returnType: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @purpose Compact representation of a raw JSDoc contract comment associated with an AST node.
|
|
21
|
+
*/
|
|
22
|
+
type DbcContractInfo = {
|
|
23
|
+
/** @purpose Full text of the JSDoc comment between /** and */ */
|
|
24
|
+
text: string;
|
|
25
|
+
/** @purpose One-based line number where the comment starts */
|
|
26
|
+
startLine: number;
|
|
27
|
+
/** @purpose One-based column number where the comment starts */
|
|
28
|
+
startCol: number;
|
|
29
|
+
};
|
|
30
|
+
/** @purpose A member of an exported entity: field, method, getter, setter, constructor, or interface/enum member. */
|
|
31
|
+
export type DbcMember = {
|
|
32
|
+
/** @purpose Member name as declared in source */
|
|
33
|
+
name: string;
|
|
34
|
+
/** @purpose Kind of member: 'field' | 'method' | 'getter' | 'setter' | 'constructor' | 'interface-method' | 'interface-property' | 'enum-member' */
|
|
35
|
+
kind: string;
|
|
36
|
+
/** @purpose JSDoc contract associated with this member, if any */
|
|
37
|
+
contract?: DbcContractInfo;
|
|
38
|
+
/** @purpose Extracted signature information for callable members */
|
|
39
|
+
signature: DbcSignatureInfo;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @purpose An exported entity extracted from a source file: const, function, class, interface, type, enum, or default export.
|
|
43
|
+
* @invariant Every exported entity has a `kind` from the closed set.
|
|
44
|
+
* @invariant `members` is non-empty only for class, interface, and enum entities.
|
|
45
|
+
*/
|
|
46
|
+
export type DbcExportedEntity = {
|
|
47
|
+
/** @purpose Entity name as declared in source */
|
|
48
|
+
name: string;
|
|
49
|
+
/** @purpose Kind of exported entity: 'const' | 'function' | 'class' | 'interface' | 'type' | 'enum' | 'export-default' */
|
|
50
|
+
kind: string;
|
|
51
|
+
/** @purpose Members of the entity (fields, methods, etc.) — populated for class, interface, enum */
|
|
52
|
+
members: DbcMember[];
|
|
53
|
+
/** @purpose JSDoc contract associated with this entity, if any */
|
|
54
|
+
contract?: DbcContractInfo;
|
|
55
|
+
/** @purpose Extracted signature information for callable entities */
|
|
56
|
+
signature: DbcSignatureInfo;
|
|
57
|
+
/** @purpose Whether the class declaration has `implements` clause */
|
|
58
|
+
implementsInterfaces?: boolean;
|
|
59
|
+
};
|
|
60
|
+
/** @purpose Result of parsing a source file: either a list of exported entities or a parse error. */
|
|
61
|
+
export type DbcParseResult = {
|
|
62
|
+
ok: true;
|
|
63
|
+
exported: DbcExportedEntity[];
|
|
64
|
+
} | {
|
|
65
|
+
ok: false;
|
|
66
|
+
error: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* @purpose Abstraction for parsing a source file and extracting exported entities with their contracts and signatures.
|
|
70
|
+
* @invariant The adapter never throws — all error paths are represented via DbcParseResult.
|
|
71
|
+
* @invariant `exported` contains all top-level exported entities, excluding re-exports.
|
|
72
|
+
*/
|
|
73
|
+
export interface DbcAstAdapter {
|
|
74
|
+
/**
|
|
75
|
+
* @purpose Parse a source file and extract all exported entities with their contracts and signatures.
|
|
76
|
+
* @param filePath Absolute or relative path to the source file.
|
|
77
|
+
* @param [content] Pre-read file content. When passed, the adapter uses this instead of reading from disk.
|
|
78
|
+
* @returns On success: exported entities list. On failure: error description.
|
|
79
|
+
*/
|
|
80
|
+
parseFile(filePath: string, content?: string): Promise<DbcParseResult>;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { DbcIssueCode } from '../parser/dbc-parser.types.js';
|
|
2
|
+
/** @purpose Configuration options for linting passes. */
|
|
3
|
+
export type DbcLintOptions = {
|
|
4
|
+
/** @purpose Linting strategy — only 'full' is supported in v1 */
|
|
5
|
+
strategy?: 'full';
|
|
6
|
+
/** @purpose Pre-read file content. When passed, the linter uses this instead of reading from disk. */
|
|
7
|
+
content?: string;
|
|
8
|
+
};
|
|
9
|
+
/** @purpose Stable string codes for dbc-linter errors. */
|
|
10
|
+
export declare const ERR_DBC_LINT_MISSING_CONTRACT = "ERR_DBC_LINT_MISSING_CONTRACT";
|
|
11
|
+
/** @purpose Stable string code: file could not be parsed syntactically. */
|
|
12
|
+
export declare const ERR_DBC_LINT_PARSE_FAILED = "ERR_DBC_LINT_PARSE_FAILED";
|
|
13
|
+
/** @purpose Stable string code: parameter exists in signature but not in contract. */
|
|
14
|
+
export declare const ERR_DBC_LINT_PARAM_MISSING = "ERR_DBC_LINT_PARAM_MISSING";
|
|
15
|
+
/** @purpose Stable string code: @param in contract has no matching signature parameter. */
|
|
16
|
+
export declare const ERR_DBC_LINT_PARAM_EXTRA = "ERR_DBC_LINT_PARAM_EXTRA";
|
|
17
|
+
/** @purpose Stable string code: @param order in contract does not match signature. */
|
|
18
|
+
export declare const ERR_DBC_LINT_PARAM_ORDER = "ERR_DBC_LINT_PARAM_ORDER";
|
|
19
|
+
/** @purpose Stable string code: non-void return type lacks @returns in contract. */
|
|
20
|
+
export declare const ERR_DBC_LINT_RETURNS_MISSING = "ERR_DBC_LINT_RETURNS_MISSING";
|
|
21
|
+
/** @purpose Stable string code: @returns present where not applicable (void, constructor, setter, field, const). */
|
|
22
|
+
export declare const ERR_DBC_LINT_RETURNS_UNEXPECTED = "ERR_DBC_LINT_RETURNS_UNEXPECTED";
|
|
23
|
+
/** @purpose Stable string code: {dataType} annotation in @param or @returns is redundant in a typed language. */
|
|
24
|
+
export declare const ERR_DBC_LINT_TYPE_REDUNDANT = "ERR_DBC_LINT_TYPE_REDUNDANT";
|
|
25
|
+
/** @purpose Stable string code: @param optionality (brackets) does not match signature optionality. */
|
|
26
|
+
export declare const ERR_DBC_LINT_PARAM_OPTIONAL_MISMATCH = "ERR_DBC_LINT_PARAM_OPTIONAL_MISMATCH";
|
|
27
|
+
/** @purpose Stable string code: @param/@returns present in implements-method contract (redundant — described in interface). */
|
|
28
|
+
export declare const ERR_DBC_LINT_PARAM_REDUNDANT_IN_IMPLEMENTS = "ERR_DBC_LINT_PARAM_REDUNDANT_IN_IMPLEMENTS";
|
|
29
|
+
/** @purpose Union of all supported dbc-linter issue codes. */
|
|
30
|
+
export type DbcLintIssueCode = typeof ERR_DBC_LINT_MISSING_CONTRACT | typeof ERR_DBC_LINT_PARSE_FAILED | typeof ERR_DBC_LINT_PARAM_MISSING | typeof ERR_DBC_LINT_PARAM_EXTRA | typeof ERR_DBC_LINT_PARAM_ORDER | typeof ERR_DBC_LINT_RETURNS_MISSING | typeof ERR_DBC_LINT_RETURNS_UNEXPECTED | typeof ERR_DBC_LINT_TYPE_REDUNDANT | typeof ERR_DBC_LINT_PARAM_OPTIONAL_MISMATCH | typeof ERR_DBC_LINT_PARAM_REDUNDANT_IN_IMPLEMENTS;
|
|
31
|
+
/** @purpose A single lint error bound to a specific file location and issue code. */
|
|
32
|
+
export type DbcLintError = {
|
|
33
|
+
/** @purpose Absolute or relative path to the source file */
|
|
34
|
+
file: string;
|
|
35
|
+
/** @purpose One-based line number where the error was detected */
|
|
36
|
+
line: number;
|
|
37
|
+
/** @purpose One-based column number where the error was detected */
|
|
38
|
+
col: number;
|
|
39
|
+
/** @purpose Severity level — always 'error' in v1 */
|
|
40
|
+
severity: 'error';
|
|
41
|
+
/** @purpose Stable issue code identifying the error category — widened to accept parser codes (FR-23) */
|
|
42
|
+
code: DbcLintIssueCode | DbcIssueCode;
|
|
43
|
+
/** @purpose Human-readable description of the error */
|
|
44
|
+
message: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @purpose Result of a lint pass — carries discovered errors and provides ESLint-compatible formatting.
|
|
48
|
+
* @invariant `errors` is never null; empty array signals no errors detected.
|
|
49
|
+
*/
|
|
50
|
+
export type DbcLintReport = {
|
|
51
|
+
/** @purpose All errors discovered during the lint pass, in file-order */
|
|
52
|
+
errors: DbcLintError[];
|
|
53
|
+
/**
|
|
54
|
+
* @purpose Formats errors in ESLint-compatible output.
|
|
55
|
+
* @returns Multi-line string in `file:line:col: severity: code: message` format.
|
|
56
|
+
*/
|
|
57
|
+
format(): string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* @purpose Result of a lint-and-fix pass — carries remaining unfixable errors and the count of auto-fixed issues.
|
|
61
|
+
* @invariant `autoFixed >= 0`. `autoFixed` = errors_before.length - errors_after.length.
|
|
62
|
+
*/
|
|
63
|
+
export type DbcLintFixReport = {
|
|
64
|
+
/** @purpose Errors that could not be auto-fixed */
|
|
65
|
+
errors: DbcLintError[];
|
|
66
|
+
/** @purpose Number of errors that were automatically resolved */
|
|
67
|
+
autoFixed: number;
|
|
68
|
+
/**
|
|
69
|
+
* @purpose Formats remaining errors in ESLint-compatible output.
|
|
70
|
+
* @returns Multi-line string in `file:line:col: severity: code: message` format.
|
|
71
|
+
*/
|
|
72
|
+
format(): string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* @purpose Abstraction for linting: checks contract coverage, validates contracts, verifies signatures, and auto-fixes fixable errors.
|
|
76
|
+
* @invariant All errors are returned via report objects — the linter never throws.
|
|
77
|
+
* @invariant error order is stable (top-to-bottom by file position).
|
|
78
|
+
*/
|
|
79
|
+
export interface DbcLinter {
|
|
80
|
+
/**
|
|
81
|
+
* @purpose Run a full lint pass on a source file.
|
|
82
|
+
* @param filePath Path to the source file to lint.
|
|
83
|
+
* @param [options] Optional linting configuration (strategy selection).
|
|
84
|
+
* @returns A report with all discovered errors.
|
|
85
|
+
*/
|
|
86
|
+
lint(filePath: string, options?: DbcLintOptions): Promise<DbcLintReport>;
|
|
87
|
+
/**
|
|
88
|
+
* @purpose Run lint and auto-fix fixable errors, mutating the source file.
|
|
89
|
+
* @param filePath Path to the source file to lint and fix.
|
|
90
|
+
* @param [options] Optional linting configuration (strategy selection).
|
|
91
|
+
* @returns A report with remaining unfixable errors and auto-fix count.
|
|
92
|
+
* @sideEffect Mutates the source file on disk to apply auto-fixes.
|
|
93
|
+
*/
|
|
94
|
+
lintAndFix(filePath: string, options?: DbcLintOptions): Promise<DbcLintFixReport>;
|
|
95
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import Parser from 'tree-sitter';
|
|
2
|
+
import type { SyntaxNode } from 'tree-sitter';
|
|
3
|
+
import type { DbcAstAdapter, DbcExportedEntity, DbcMember, DbcParamInfo, DbcParseResult, DbcSignatureInfo } from '../../dbc-ast-adapter.types.js';
|
|
4
|
+
/** @purpose In-memory representation of JSDoc contract info before attaching to entities. */
|
|
5
|
+
type RawContract = {
|
|
6
|
+
text: string;
|
|
7
|
+
startLine: number;
|
|
8
|
+
startCol: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @purpose Parses TypeScript source files via tree-sitter to extract exported entities,
|
|
12
|
+
* their members, JSDoc contracts, and signatures.
|
|
13
|
+
* @implements {DbcAstAdapter} in ../../dbc-ast-adapter.types.ts
|
|
14
|
+
* @invariant Adapter never throws — all error paths are represented via DbcParseResult.
|
|
15
|
+
* @invariant `exported` contains all top-level exported entities, excluding re-exports.
|
|
16
|
+
*/
|
|
17
|
+
export declare class DbcTsAstAdapter implements DbcAstAdapter {
|
|
18
|
+
/** @purpose Lazy-initialized tree-sitter parser instance */
|
|
19
|
+
protected _parser: Parser | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* @param filePath Absolute path to the TypeScript source file.
|
|
22
|
+
* @param [content] Optional pre-loaded file content, bypasses disk read.
|
|
23
|
+
* @returns Parse result with exported entities or an error.
|
|
24
|
+
* @see {DbcAstAdapter#parseFile} in ../../dbc-ast-adapter.types.ts
|
|
25
|
+
*/
|
|
26
|
+
parseFile(filePath: string, content?: string): Promise<DbcParseResult>;
|
|
27
|
+
/**
|
|
28
|
+
* @purpose Lazy-initializes the tree-sitter Parser with the TypeScript grammar.
|
|
29
|
+
* @returns Configured Parser instance.
|
|
30
|
+
*/
|
|
31
|
+
protected _initializeParser(): Parser;
|
|
32
|
+
/**
|
|
33
|
+
* @purpose Walks the root AST node and extracts all exported entities,
|
|
34
|
+
* skipping re-exports.
|
|
35
|
+
* @param root Root CST node.
|
|
36
|
+
* @param source Full source text for slicing.
|
|
37
|
+
* @returns Array of exported entities.
|
|
38
|
+
*/
|
|
39
|
+
protected _extractExported(root: SyntaxNode, source: string): DbcExportedEntity[];
|
|
40
|
+
/**
|
|
41
|
+
* @purpose Extracts a single exported entity from an export_statement node.
|
|
42
|
+
* Skips re-exports.
|
|
43
|
+
* @param node export_statement node.
|
|
44
|
+
* @param source Full source text.
|
|
45
|
+
* @param pendingContract JSDoc contract that precedes this export, if any.
|
|
46
|
+
* @returns Exported entity or undefined for re-exports.
|
|
47
|
+
*/
|
|
48
|
+
protected _extractExportEntity(node: SyntaxNode, source: string, pendingContract: RawContract | undefined): DbcExportedEntity | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* @purpose Determines whether an export_statement is a re-export.
|
|
51
|
+
* @param node export_statement node.
|
|
52
|
+
* @returns True if the export is a re-export that should be skipped.
|
|
53
|
+
*/
|
|
54
|
+
protected _isReExport(node: SyntaxNode): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* @purpose Maps a declaration node type to an entity kind string.
|
|
57
|
+
* @param nodeType tree-sitter node type.
|
|
58
|
+
* @param isDefault Whether this is a default export.
|
|
59
|
+
* @returns Entity kind.
|
|
60
|
+
*/
|
|
61
|
+
protected _mapKind(nodeType: string, isDefault: boolean): string;
|
|
62
|
+
/**
|
|
63
|
+
* @purpose Extracts the entity name from a declaration node.
|
|
64
|
+
* @param node Declaration node.
|
|
65
|
+
* @param source Full source text.
|
|
66
|
+
* @param isDefault Whether this is a default export.
|
|
67
|
+
* @returns Entity name.
|
|
68
|
+
*/
|
|
69
|
+
protected _extractName(node: SyntaxNode, source: string, isDefault: boolean): string;
|
|
70
|
+
/**
|
|
71
|
+
* @purpose Extracts signature info (params + returnType) from a callable declaration.
|
|
72
|
+
* @param node Declaration node.
|
|
73
|
+
* @param source Full source text.
|
|
74
|
+
* @returns Signature info with empty arrays for non-callable entities.
|
|
75
|
+
*/
|
|
76
|
+
protected _extractSignature(node: SyntaxNode, source: string): DbcSignatureInfo;
|
|
77
|
+
/**
|
|
78
|
+
* @purpose Extracts a single parameter (required or optional) from the formal_parameters list.
|
|
79
|
+
* @param paramNode required_parameter or optional_parameter node.
|
|
80
|
+
* @param source Full source text.
|
|
81
|
+
* @returns Parameter info.
|
|
82
|
+
*/
|
|
83
|
+
protected _extractParam(paramNode: SyntaxNode, source: string): DbcParamInfo;
|
|
84
|
+
/**
|
|
85
|
+
* @purpose Extracts members of a class, interface, or enum entity.
|
|
86
|
+
* @param node Declaration node.
|
|
87
|
+
* @param source Full source text.
|
|
88
|
+
* @param kind Entity kind.
|
|
89
|
+
* @returns Array of members (empty for non-collection entities).
|
|
90
|
+
*/
|
|
91
|
+
protected _extractMembers(node: SyntaxNode, source: string, kind: string): DbcMember[];
|
|
92
|
+
/**
|
|
93
|
+
* @purpose Extracts members from a class declaration body.
|
|
94
|
+
* @param node class_declaration node.
|
|
95
|
+
* @param source Full source text.
|
|
96
|
+
* @returns Array of class members.
|
|
97
|
+
*/
|
|
98
|
+
protected _extractClassMembers(node: SyntaxNode, source: string): DbcMember[];
|
|
99
|
+
/**
|
|
100
|
+
* @purpose Extracts members from an interface declaration body.
|
|
101
|
+
* @param node interface_declaration node.
|
|
102
|
+
* @param source Full source text.
|
|
103
|
+
* @returns Array of interface members.
|
|
104
|
+
*/
|
|
105
|
+
protected _extractInterfaceMembers(node: SyntaxNode, source: string): DbcMember[];
|
|
106
|
+
/**
|
|
107
|
+
* @purpose Extracts members from a type alias with an object type literal body.
|
|
108
|
+
* Delegates to the same logic as interface members since object_type ≡ interface body.
|
|
109
|
+
* @param node type_alias_declaration node.
|
|
110
|
+
* @param source Full source text.
|
|
111
|
+
* @returns Array of object type members.
|
|
112
|
+
*/
|
|
113
|
+
protected _extractTypeAliasMembers(node: SyntaxNode, source: string): DbcMember[];
|
|
114
|
+
/**
|
|
115
|
+
* @purpose Extracts members from an object_type or interface body node.
|
|
116
|
+
* Shared by type alias (object_type) and interface declarations.
|
|
117
|
+
* @param body object_type or interface_body node.
|
|
118
|
+
* @param source Full source text.
|
|
119
|
+
* @returns Array of members.
|
|
120
|
+
*/
|
|
121
|
+
protected _extractObjectTypeMembers(body: SyntaxNode, source: string): DbcMember[];
|
|
122
|
+
/**
|
|
123
|
+
* @purpose Checks if a property_signature node has a function type annotation.
|
|
124
|
+
* @param node property_signature node.
|
|
125
|
+
* @returns True if the property is function-typed.
|
|
126
|
+
*/
|
|
127
|
+
protected _isFunctionTypedProperty(node: SyntaxNode): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* @purpose Finds the function_type node inside a property_signature's type annotation.
|
|
130
|
+
* @param node property_signature node.
|
|
131
|
+
* @returns The function_type node, or null.
|
|
132
|
+
*/
|
|
133
|
+
protected _findFunctionTypeNode(node: SyntaxNode): SyntaxNode | null;
|
|
134
|
+
/**
|
|
135
|
+
* @purpose Extracts members from an enum declaration body.
|
|
136
|
+
* @param node enum_declaration node.
|
|
137
|
+
* @param source Full source text.
|
|
138
|
+
* @returns Array of enum members.
|
|
139
|
+
*/
|
|
140
|
+
protected _extractEnumMembers(node: SyntaxNode, source: string): DbcMember[];
|
|
141
|
+
/**
|
|
142
|
+
* @purpose Extracts the method name from a method_definition node,
|
|
143
|
+
* handling getter/setter property names.
|
|
144
|
+
* @param node method_definition node.
|
|
145
|
+
* @param source Full source text.
|
|
146
|
+
* @returns Method name.
|
|
147
|
+
*/
|
|
148
|
+
protected _extractMethodName(node: SyntaxNode, source: string): string;
|
|
149
|
+
/**
|
|
150
|
+
* @purpose Extracts the field name from a public_field_definition node.
|
|
151
|
+
* @param node public_field_definition node.
|
|
152
|
+
* @param source Full source text.
|
|
153
|
+
* @returns Field name.
|
|
154
|
+
*/
|
|
155
|
+
protected _extractFieldName(node: SyntaxNode, source: string): string;
|
|
156
|
+
/**
|
|
157
|
+
* @purpose Checks if a method_definition has a given token (e.g., 'get', 'set').
|
|
158
|
+
* @param node method_definition node.
|
|
159
|
+
* @param token Token text to search for.
|
|
160
|
+
* @returns True if the token is present.
|
|
161
|
+
*/
|
|
162
|
+
protected _hasToken(node: SyntaxNode, token: string): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* @purpose Checks if a class_declaration node has an implements clause.
|
|
165
|
+
* @param node class_declaration node.
|
|
166
|
+
* @returns True if the class has `implements` clause.
|
|
167
|
+
*/
|
|
168
|
+
protected _hasImplements(node: SyntaxNode): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* @purpose Finds a direct child node by type, returning first match.
|
|
171
|
+
* @param parent Parent node.
|
|
172
|
+
* @param type Child node type to find.
|
|
173
|
+
* @returns First matching child or null.
|
|
174
|
+
*/
|
|
175
|
+
protected _findChild(parent: SyntaxNode, type: string): SyntaxNode | null;
|
|
176
|
+
/**
|
|
177
|
+
* @purpose Recursively searches for the first ERROR node in the tree.
|
|
178
|
+
* @param node Root node to search from.
|
|
179
|
+
* @returns First ERROR node found, or undefined.
|
|
180
|
+
*/
|
|
181
|
+
protected _findErrorNode(node: SyntaxNode): SyntaxNode | undefined;
|
|
182
|
+
}
|
|
183
|
+
export {};
|