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.
- 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-B63fYXL2.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-B5bA2T7A.js → index-CaahtXiM.js} +33 -9
- package/dist/chunks/{index-iqg0w_pE.js → index-CiEM-8nJ.js} +35 -19
- package/dist/chunks/{index-B4m0-PAT.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-C0andxna.js → index-DU6jD7SS.js} +1 -1
- package/dist/chunks/index-KxSZKmZn.js +540 -0
- package/dist/chunks/{index-Dqe1TdW4.js → index-UbHoePfr.js} +12 -12
- package/dist/chunks/{index-5xIgwwKx.js → index-g1LXlp77.js} +2 -2
- package/dist/chunks/index-zBnnuvLA.js +3788 -0
- package/dist/chunks/{run-review-command.logic-a_M3CkeZ.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-review-verifier.xml +0 -181
- package/dist/chunks/index-CNbmXK8M.js +0 -3548
- package/dist/chunks/services-Sb7TwLxt.js +0 -122
- package/dist/chunks/shared-BgLzFWMH.js +0 -577
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
import { execSync as $ } from "node:child_process";
|
|
2
|
+
import { existsSync as O, readFileSync as M, readdirSync as y, statSync as P, lstatSync as B } from "node:fs";
|
|
3
|
+
import { resolve as _, relative as H, extname as k, join as K } from "node:path";
|
|
4
|
+
import { l as d, D as z, a as J, b as Z, s as j } from "./services-CaLOhuLV.js";
|
|
5
|
+
import { p as V } from "./shared-Bjy30TeM.js";
|
|
6
|
+
class E {
|
|
7
|
+
/** @purpose Collected lint errors — empty array when clean. */
|
|
8
|
+
errors;
|
|
9
|
+
/** @purpose Count of errors auto-fixed by DbcContractCheck. */
|
|
10
|
+
autoFixed;
|
|
11
|
+
/** @purpose Deduplicated task file paths resolved from @tasks annotations in linted files. */
|
|
12
|
+
taskPaths;
|
|
13
|
+
/** @purpose Deduplicated spec file paths resolved from task files. */
|
|
14
|
+
specPaths;
|
|
15
|
+
/**
|
|
16
|
+
* @purpose Creates a LintReport with collected errors, autoFixed count, and resolved references.
|
|
17
|
+
* @param errors Collected lint errors.
|
|
18
|
+
* @param [autoFixed] Count of auto-fixed errors, defaults to 0.
|
|
19
|
+
* @param [taskPaths] Resolved task file paths (deduplicated).
|
|
20
|
+
* @param [specPaths] Resolved spec file paths (deduplicated).
|
|
21
|
+
*/
|
|
22
|
+
constructor(t, e = 0, s = [], n = []) {
|
|
23
|
+
this.errors = t, this.autoFixed = e, this.taskPaths = s, this.specPaths = n;
|
|
24
|
+
}
|
|
25
|
+
/** @purpose Returns 0 when no errors, 1 otherwise — ESLint convention. | @returns 0 for clean, 1 for errors. */
|
|
26
|
+
get exitCode() {
|
|
27
|
+
return this.errors.length > 0 ? 1 : 0;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @purpose Formats errors in ESLint-compatible output with resolved task/spec references.
|
|
31
|
+
* @returns ESLint-compatible formatted string with References block.
|
|
32
|
+
*/
|
|
33
|
+
format() {
|
|
34
|
+
const t = [];
|
|
35
|
+
if (this.autoFixed > 0 && t.push(`Auto-fixed: ${this.autoFixed} error(s)`), this.errors.length > 0 && t.push(
|
|
36
|
+
...this.errors.map(
|
|
37
|
+
(e) => `${e.file}:${e.line}:${e.col}: ${e.severity}: ${e.code}: ${e.message}`
|
|
38
|
+
)
|
|
39
|
+
), this.specPaths.length > 0 || this.taskPaths.length > 0) {
|
|
40
|
+
t.push(""), t.push("---"), t.push("References:");
|
|
41
|
+
for (const e of this.specPaths)
|
|
42
|
+
t.push(` ${e}`);
|
|
43
|
+
for (const e of this.taskPaths)
|
|
44
|
+
t.push(` ${e}`);
|
|
45
|
+
}
|
|
46
|
+
return t.join(`
|
|
47
|
+
`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const x = "ERR_CLI_LINT_MISSING_FILE", A = "ERR_CLI_LINT_MISSING_CONSUMERS", X = "ERR_CLI_LINT_ANCHOR_UNPAIRED_START", Y = "ERR_CLI_LINT_ANCHOR_UNPAIRED_END", q = "ERR_CLI_LINT_ANCHOR_NESTING", C = "ERR_CLI_LINT_ANCHOR_MALFORMED", b = "ERR_CLI_LINT_NON_ENGLISH", Q = "ERR_CLI_LINT_RESOLVE_FAILED", ee = "ERR_CLI_LINT_STAGED_CONFLICT", te = "ERR_CLI_LINT_UNAUTHORIZED_DISABLE", se = "ERR_CLI_LINT_DISABLE_MISSING_PURPOSE";
|
|
51
|
+
function ne(i, t) {
|
|
52
|
+
const e = [];
|
|
53
|
+
if (i.length === 0)
|
|
54
|
+
return e.push({
|
|
55
|
+
file: t,
|
|
56
|
+
line: 1,
|
|
57
|
+
col: 1,
|
|
58
|
+
severity: "error",
|
|
59
|
+
code: x,
|
|
60
|
+
message: "[FileHeaderCheck#check] Missing // @file: directive"
|
|
61
|
+
}), e.push({
|
|
62
|
+
file: t,
|
|
63
|
+
line: 1,
|
|
64
|
+
col: 1,
|
|
65
|
+
severity: "error",
|
|
66
|
+
code: A,
|
|
67
|
+
message: "[FileHeaderCheck#check] Missing // @consumers: directive"
|
|
68
|
+
}), e;
|
|
69
|
+
const s = i.split(`
|
|
70
|
+
`);
|
|
71
|
+
let n = !1, r = !1;
|
|
72
|
+
for (const o of s) {
|
|
73
|
+
const c = o.trim();
|
|
74
|
+
if (c.startsWith("import ") || (c.startsWith("// @file:") && (n = !0), c.startsWith("// @consumers:") && (r = !0), n && r))
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
return n || e.push({
|
|
78
|
+
file: t,
|
|
79
|
+
line: 1,
|
|
80
|
+
col: 1,
|
|
81
|
+
severity: "error",
|
|
82
|
+
code: x,
|
|
83
|
+
message: "[FileHeaderCheck#check] Missing // @file: directive"
|
|
84
|
+
}), r || e.push({
|
|
85
|
+
file: t,
|
|
86
|
+
line: 1,
|
|
87
|
+
col: 1,
|
|
88
|
+
severity: "error",
|
|
89
|
+
code: A,
|
|
90
|
+
message: "[FileHeaderCheck#check] Missing // @consumers: directive"
|
|
91
|
+
}), e;
|
|
92
|
+
}
|
|
93
|
+
const re = /\/\/ #(region|endregion)\s+(START|END)_([A-Z0-9_]+)/, oe = /\/\/ #(region|endregion)\s*$/;
|
|
94
|
+
function ie(i, t) {
|
|
95
|
+
const e = i.split(`
|
|
96
|
+
`), s = [], n = [];
|
|
97
|
+
for (let r = 0; r < e.length; r++) {
|
|
98
|
+
const o = e[r], c = o.match(re);
|
|
99
|
+
if (c) {
|
|
100
|
+
const a = c[2], l = c[3], h = r + 1, p = c.index ?? 0, I = o.indexOf(a, p), L = (I >= 0 ? I : p) + 1;
|
|
101
|
+
if (a === "START") {
|
|
102
|
+
n.push({ name: l, line: h, col: L });
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const R = ce(n, (u) => u.name === l);
|
|
106
|
+
if (R === -1)
|
|
107
|
+
s.push({
|
|
108
|
+
file: t,
|
|
109
|
+
line: h,
|
|
110
|
+
col: L,
|
|
111
|
+
severity: "error",
|
|
112
|
+
code: Y,
|
|
113
|
+
message: `END_${l} without matching START_${l} — add the missing opening anchor or remove this closing one`
|
|
114
|
+
});
|
|
115
|
+
else {
|
|
116
|
+
for (let u = n.length - 1; u > R; u--) {
|
|
117
|
+
const g = n[u];
|
|
118
|
+
s.push({
|
|
119
|
+
file: t,
|
|
120
|
+
line: h,
|
|
121
|
+
col: L,
|
|
122
|
+
severity: "error",
|
|
123
|
+
code: q,
|
|
124
|
+
message: `END_${l} closes parent while START_${g.name} at line ${g.line} is still open — close inner block first`
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
n.length = R;
|
|
128
|
+
}
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const f = o.match(oe);
|
|
132
|
+
if (f) {
|
|
133
|
+
const a = r + 1, l = (f.index ?? 0) + 1;
|
|
134
|
+
if (f[1] === "endregion")
|
|
135
|
+
if (n.length > 0) {
|
|
136
|
+
const h = n[n.length - 1];
|
|
137
|
+
s.push({
|
|
138
|
+
file: t,
|
|
139
|
+
line: a,
|
|
140
|
+
col: l,
|
|
141
|
+
severity: "error",
|
|
142
|
+
code: C,
|
|
143
|
+
message: `#endregion without END_<NAME> — expected END_${h.name} (auto-closed by stack top START_${h.name} at line ${h.line})`
|
|
144
|
+
}), n.pop();
|
|
145
|
+
} else
|
|
146
|
+
s.push({
|
|
147
|
+
file: t,
|
|
148
|
+
line: a,
|
|
149
|
+
col: l,
|
|
150
|
+
severity: "error",
|
|
151
|
+
code: C,
|
|
152
|
+
message: "#endregion without END_<NAME> — no open block to close"
|
|
153
|
+
});
|
|
154
|
+
else
|
|
155
|
+
s.push({
|
|
156
|
+
file: t,
|
|
157
|
+
line: a,
|
|
158
|
+
col: l,
|
|
159
|
+
severity: "error",
|
|
160
|
+
code: C,
|
|
161
|
+
message: "#region without START_<NAME> — add START_ prefix with a block name"
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
for (const r of n)
|
|
166
|
+
s.push({
|
|
167
|
+
file: t,
|
|
168
|
+
line: r.line,
|
|
169
|
+
col: r.col,
|
|
170
|
+
severity: "error",
|
|
171
|
+
code: X,
|
|
172
|
+
message: `START_${r.name} without matching END_${r.name} — add the missing closing anchor`
|
|
173
|
+
});
|
|
174
|
+
return s.sort((r, o) => r.line - o.line || r.col - o.col), s;
|
|
175
|
+
}
|
|
176
|
+
function ce(i, t) {
|
|
177
|
+
for (let e = i.length - 1; e >= 0; e--)
|
|
178
|
+
if (t(i[e])) return e;
|
|
179
|
+
return -1;
|
|
180
|
+
}
|
|
181
|
+
async function ae(i, t, e) {
|
|
182
|
+
d.debug(`[DbcContractCheck#check] [idle → creating] ${t}`);
|
|
183
|
+
const s = new J(), n = new Z(), r = new z(s, n);
|
|
184
|
+
try {
|
|
185
|
+
if (!e) {
|
|
186
|
+
const c = await r.lint(t, { content: i });
|
|
187
|
+
return d.info(
|
|
188
|
+
`[DbcContractCheck#check] [creating → linted] ${t} (${c.errors.length} errors)`
|
|
189
|
+
), { errors: c.errors.map(v), autoFixed: 0 };
|
|
190
|
+
}
|
|
191
|
+
const o = await r.lintAndFix(t, { content: i });
|
|
192
|
+
return d.info(
|
|
193
|
+
`[DbcContractCheck#check] [creating → fixed] ${t} (autoFixed=${o.autoFixed}, remaining=${o.errors.length})`
|
|
194
|
+
), {
|
|
195
|
+
errors: o.errors.map(v),
|
|
196
|
+
autoFixed: o.autoFixed
|
|
197
|
+
};
|
|
198
|
+
} catch (o) {
|
|
199
|
+
const c = new Error(`[DbcContractCheck#check] Lint failed for ${t}`, { cause: o });
|
|
200
|
+
throw d.error(`[DbcContractCheck#check] [creating → failed] ${t}`, { error: c }), c;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function v(i) {
|
|
204
|
+
return {
|
|
205
|
+
file: i.file,
|
|
206
|
+
line: i.line,
|
|
207
|
+
col: i.col,
|
|
208
|
+
severity: "error",
|
|
209
|
+
code: i.code,
|
|
210
|
+
message: i.message
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const w = 8, le = /@ts-ignore|@ts-nocheck|@ts-expect-error|eslint-disable(?:-next-line|-line)?(?:-[a-z-]+)?\b/, ue = /\bd-\d+\b/i;
|
|
214
|
+
function fe(i) {
|
|
215
|
+
let t = !1, e = !1, s = !1;
|
|
216
|
+
for (let n = 0; n < i.length - 1; n++) {
|
|
217
|
+
const r = i[n], o = n > 0 ? i[n - 1] : "";
|
|
218
|
+
if (!t && !e && !s) {
|
|
219
|
+
if (r === "/" && (i[n + 1] === "/" || i[n + 1] === "*")) return n;
|
|
220
|
+
r === "'" ? t = !0 : r === '"' ? e = !0 : r === "`" && (s = !0);
|
|
221
|
+
} else o !== "\\" && (t && r === "'" ? t = !1 : e && r === '"' ? e = !1 : s && r === "`" && (s = !1));
|
|
222
|
+
}
|
|
223
|
+
return -1;
|
|
224
|
+
}
|
|
225
|
+
function de(i, t) {
|
|
226
|
+
const e = i.split(`
|
|
227
|
+
`), s = [];
|
|
228
|
+
for (let n = 0; n < e.length; n++) {
|
|
229
|
+
const r = e[n], o = fe(r);
|
|
230
|
+
if (o < 0) continue;
|
|
231
|
+
const c = r.slice(o), f = le.exec(c);
|
|
232
|
+
if (!f) continue;
|
|
233
|
+
const a = f[0], l = o + f.index + 1, h = ue.exec(r);
|
|
234
|
+
if (!h) {
|
|
235
|
+
s.push({
|
|
236
|
+
file: t,
|
|
237
|
+
line: n + 1,
|
|
238
|
+
col: l,
|
|
239
|
+
severity: "error",
|
|
240
|
+
code: te,
|
|
241
|
+
message: `Unauthorized disable: \`${a}\` has no Decision Log reference. Add \`D-NNN\` (e.g., \`D-042\`) in the same comment line pointing to a Decision Log entry that authorizes this disable. Policy: see specs/cli/cli.spec.md#d-007.`
|
|
242
|
+
});
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
const p = he(c, a, h[0]);
|
|
246
|
+
p < w && s.push({
|
|
247
|
+
file: t,
|
|
248
|
+
line: n + 1,
|
|
249
|
+
col: l,
|
|
250
|
+
severity: "error",
|
|
251
|
+
code: se,
|
|
252
|
+
message: `Disable lacks purpose: \`${a}\` cites \`${h[0]}\` but the explanation is too short (${p} non-whitespace chars; need ≥ ${w}). Add a purpose after the D-NNN reference, e.g., \`${a}: ${h[0]} — <why this disable is necessary>\`. Policy: see specs/cli/cli.spec.md#d-007.`
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
return s;
|
|
256
|
+
}
|
|
257
|
+
function he(i, t, e) {
|
|
258
|
+
let s = i.replace(t, "");
|
|
259
|
+
return s = s.replace(e, ""), s = s.replace(/\*\//g, ""), s = s.replace(/^\/\/|^\/\*/g, ""), s.replace(/\s/g, "").length;
|
|
260
|
+
}
|
|
261
|
+
const F = new RegExp("\\p{Script=Cyrillic}", "u");
|
|
262
|
+
function ge(i, t) {
|
|
263
|
+
const e = [], s = i.split(`
|
|
264
|
+
`), n = me(s);
|
|
265
|
+
for (let r = 0; r < s.length; r++) {
|
|
266
|
+
const o = s[r], c = r + 1, f = o.trim();
|
|
267
|
+
if (f.startsWith("// @file:") || f.startsWith("// @consumers:")) {
|
|
268
|
+
const a = [...o];
|
|
269
|
+
for (let l = 0; l < a.length; l++)
|
|
270
|
+
F.test(a[l]) && e.push({
|
|
271
|
+
file: t,
|
|
272
|
+
line: c,
|
|
273
|
+
col: l + 1,
|
|
274
|
+
severity: "error",
|
|
275
|
+
code: b,
|
|
276
|
+
message: `[LanguageCheck#check] Cyrillic character '${a[l]}' in file header — use English only`
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
if (n.has(r)) {
|
|
280
|
+
const a = [...o];
|
|
281
|
+
for (let l = 0; l < a.length; l++)
|
|
282
|
+
if (F.test(a[l])) {
|
|
283
|
+
e.push({
|
|
284
|
+
file: t,
|
|
285
|
+
line: c,
|
|
286
|
+
col: l + 1,
|
|
287
|
+
severity: "error",
|
|
288
|
+
code: b,
|
|
289
|
+
message: `[LanguageCheck#check] Cyrillic character '${a[l]}' in JSDoc contract — use English only`
|
|
290
|
+
});
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return e;
|
|
296
|
+
}
|
|
297
|
+
function me(i) {
|
|
298
|
+
const t = /* @__PURE__ */ new Set();
|
|
299
|
+
let e = !1;
|
|
300
|
+
for (let s = 0; s < i.length; s++) {
|
|
301
|
+
const n = i[s].trim();
|
|
302
|
+
if (n.startsWith("/**")) {
|
|
303
|
+
e = !0, t.add(s), n.endsWith("*/") && (e = !1);
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
e && (t.add(s), n.includes("*/") && (e = !1));
|
|
307
|
+
}
|
|
308
|
+
return t;
|
|
309
|
+
}
|
|
310
|
+
function pe(i, t = "tasks") {
|
|
311
|
+
const e = /* @__PURE__ */ new Map(), s = _(i, t);
|
|
312
|
+
if (!O(s))
|
|
313
|
+
return e;
|
|
314
|
+
const n = Le(s);
|
|
315
|
+
for (const r of n) {
|
|
316
|
+
let o;
|
|
317
|
+
try {
|
|
318
|
+
o = M(r, "utf-8");
|
|
319
|
+
} catch {
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
const c = o.match(/-\s+\*\*Task-ID:\*\*\s+(TSK-\d+)/);
|
|
323
|
+
if (!c) continue;
|
|
324
|
+
const f = c[1], a = H(i, r), l = _e(o, i);
|
|
325
|
+
e.set(f, { taskPath: a, specPaths: l });
|
|
326
|
+
}
|
|
327
|
+
return e;
|
|
328
|
+
}
|
|
329
|
+
function _e(i, t) {
|
|
330
|
+
const e = /* @__PURE__ */ new Set(), s = i.match(/\*\*Spec References:\*\*[\s\S]*?(?=\n- \*\*|$)/);
|
|
331
|
+
if (!s) return [];
|
|
332
|
+
const n = s[0], r = /\[([^\]]*)\]\(([^)]+\.md)[^)]*\)/g;
|
|
333
|
+
let o;
|
|
334
|
+
for (; (o = r.exec(n)) !== null; ) {
|
|
335
|
+
const c = o[2].split("/").pop();
|
|
336
|
+
if (!c) continue;
|
|
337
|
+
const f = Re(_(t, "specs"), c);
|
|
338
|
+
if (f) {
|
|
339
|
+
const a = H(t, f);
|
|
340
|
+
a.startsWith("..") || e.add(a);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return [...e].sort();
|
|
344
|
+
}
|
|
345
|
+
function Re(i, t) {
|
|
346
|
+
if (!O(i)) return null;
|
|
347
|
+
const e = [i];
|
|
348
|
+
for (; e.length > 0; ) {
|
|
349
|
+
const s = e.pop();
|
|
350
|
+
let n;
|
|
351
|
+
try {
|
|
352
|
+
n = y(s);
|
|
353
|
+
} catch {
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
for (const r of n) {
|
|
357
|
+
const o = _(s, r);
|
|
358
|
+
try {
|
|
359
|
+
const c = P(o);
|
|
360
|
+
if (c.isDirectory())
|
|
361
|
+
e.push(o);
|
|
362
|
+
else if (c.isFile() && r === t)
|
|
363
|
+
return o;
|
|
364
|
+
} catch {
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
function Le(i) {
|
|
371
|
+
const t = [], e = [i];
|
|
372
|
+
for (; e.length > 0; ) {
|
|
373
|
+
const s = e.pop();
|
|
374
|
+
let n;
|
|
375
|
+
try {
|
|
376
|
+
n = y(s);
|
|
377
|
+
} catch {
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
380
|
+
for (const r of n) {
|
|
381
|
+
const o = _(s, r);
|
|
382
|
+
try {
|
|
383
|
+
const c = P(o);
|
|
384
|
+
c.isDirectory() ? e.push(o) : c.isFile() && r.endsWith(".md") && t.push(o);
|
|
385
|
+
} catch {
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return t;
|
|
390
|
+
}
|
|
391
|
+
function Ie(i) {
|
|
392
|
+
const t = i.match(/@tasks:\s*(.+)/m);
|
|
393
|
+
return t ? t[1].split(/[,;\s]+/).map((e) => e.trim()).filter((e) => /^TSK-\d+$/.test(e)) : [];
|
|
394
|
+
}
|
|
395
|
+
function Ne(i, t) {
|
|
396
|
+
const e = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
397
|
+
for (const n of i) {
|
|
398
|
+
const r = t.get(n);
|
|
399
|
+
if (r) {
|
|
400
|
+
e.add(r.taskPath);
|
|
401
|
+
for (const o of r.specPaths)
|
|
402
|
+
s.add(o);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return {
|
|
406
|
+
taskPaths: [...e].sort(),
|
|
407
|
+
specPaths: [...s].sort()
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
async function Ee(i) {
|
|
411
|
+
const t = V(i, {
|
|
412
|
+
autofix: ["autofix"],
|
|
413
|
+
staged: ["staged"],
|
|
414
|
+
verbose: ["verbose", "v"]
|
|
415
|
+
}), e = t._.filter(
|
|
416
|
+
(u) => typeof u == "string" && u !== "lint"
|
|
417
|
+
), s = t.autofix === !0 || t.autofix === "true", n = t.staged === !0 || t.staged === "true";
|
|
418
|
+
(t.verbose === !0 || t.verbose === "true") && j("debug");
|
|
419
|
+
let o;
|
|
420
|
+
const c = [];
|
|
421
|
+
if (n) {
|
|
422
|
+
if (e.length > 0) {
|
|
423
|
+
const u = {
|
|
424
|
+
file: "",
|
|
425
|
+
line: 0,
|
|
426
|
+
col: 0,
|
|
427
|
+
severity: "error",
|
|
428
|
+
code: ee,
|
|
429
|
+
message: "--staged and positional targets are mutually exclusive. Use either --staged or provide file/directory paths, not both."
|
|
430
|
+
};
|
|
431
|
+
return d.warn("[LintCommand#run] --staged and positional targets are mutually exclusive"), new E([u]);
|
|
432
|
+
}
|
|
433
|
+
d.debug("[LintCommand#run] [idle → collecting] staged mode");
|
|
434
|
+
try {
|
|
435
|
+
const u = $("git diff --staged --name-only", { encoding: "utf-8" }).trim(), g = $("git ls-files --others --exclude-standard", {
|
|
436
|
+
encoding: "utf-8"
|
|
437
|
+
}).trim();
|
|
438
|
+
o = [...u.split(`
|
|
439
|
+
`), ...g.split(`
|
|
440
|
+
`)].filter(Boolean).filter((m) => m.endsWith(".ts")), o = [...new Set(o)];
|
|
441
|
+
} catch (u) {
|
|
442
|
+
const g = new Error("[LintCommand#run] Git scan failed — not a git repository?", {
|
|
443
|
+
cause: u
|
|
444
|
+
});
|
|
445
|
+
throw d.error("[LintCommand#run] [collecting → failed]", { error: g }), g;
|
|
446
|
+
}
|
|
447
|
+
} else if (e.length > 0) {
|
|
448
|
+
d.debug(`[LintCommand#run] [idle → resolving] ${e.length} target(s)`);
|
|
449
|
+
const u = ke(e);
|
|
450
|
+
o = u.files, c.push(...u.errors);
|
|
451
|
+
for (const g of u.errors)
|
|
452
|
+
d.warn(`[LintCommand#run] [resolving → failed] ${g.file}: ${g.message}`);
|
|
453
|
+
} else
|
|
454
|
+
o = [];
|
|
455
|
+
if (o.length === 0)
|
|
456
|
+
return d.debug("[LintCommand#run] [collecting → done] no files to lint"), new E(c);
|
|
457
|
+
d.debug(`[LintCommand#run] [collecting → linting] ${o.length} file(s)`);
|
|
458
|
+
const f = [...c];
|
|
459
|
+
let a = 0;
|
|
460
|
+
const l = _("."), h = pe(l), p = /* @__PURE__ */ new Set();
|
|
461
|
+
for (const u of o) {
|
|
462
|
+
const g = _(u);
|
|
463
|
+
let m;
|
|
464
|
+
try {
|
|
465
|
+
d.debug(`[LintCommand#run] [linting → reading] ${u}`), m = M(g, "utf-8");
|
|
466
|
+
} catch (N) {
|
|
467
|
+
const G = new Error(`[LintCommand#run] Cannot read file: ${u}`, { cause: N });
|
|
468
|
+
d.error(`[LintCommand#run] [reading → failed] ${u}`, { error: G });
|
|
469
|
+
continue;
|
|
470
|
+
}
|
|
471
|
+
f.push(...ne(m, u)), f.push(...ie(m, u)), f.push(...ge(m, u)), f.push(...de(m, u));
|
|
472
|
+
const W = Ie(m);
|
|
473
|
+
for (const N of W)
|
|
474
|
+
p.add(N);
|
|
475
|
+
const D = await ae(m, u, s);
|
|
476
|
+
f.push(...D.errors), a += D.autoFixed;
|
|
477
|
+
}
|
|
478
|
+
const { taskPaths: I, specPaths: L } = Ne([...p], h), R = new E(f, a, I, L);
|
|
479
|
+
return R.exitCode === 1 ? console.log(`[LintCommand#run] [linting → failed] ${f.length} error(s)`) : console.log("[LintCommand#run] [linting → clean] no errors"), R;
|
|
480
|
+
}
|
|
481
|
+
const S = [".ts", ".tsx"], Ce = /* @__PURE__ */ new Set(["node_modules", "dist", "coverage", "build", "out", "__tests__"]);
|
|
482
|
+
function ke(i) {
|
|
483
|
+
d.debug(`[resolveTargets] [idle → resolving] ${i.length} target(s)`);
|
|
484
|
+
const t = /* @__PURE__ */ new Set(), e = [];
|
|
485
|
+
for (const n of i) {
|
|
486
|
+
const r = k(n).toLowerCase();
|
|
487
|
+
if (r && !S.includes(r) && !n.endsWith("/"))
|
|
488
|
+
continue;
|
|
489
|
+
let o;
|
|
490
|
+
try {
|
|
491
|
+
o = B(n);
|
|
492
|
+
} catch (f) {
|
|
493
|
+
const a = f;
|
|
494
|
+
e.push({
|
|
495
|
+
file: n,
|
|
496
|
+
line: 0,
|
|
497
|
+
col: 0,
|
|
498
|
+
severity: "error",
|
|
499
|
+
code: Q,
|
|
500
|
+
message: `${n}: ${a.code ?? "UNKNOWN"}: ${a.message}`
|
|
501
|
+
});
|
|
502
|
+
continue;
|
|
503
|
+
}
|
|
504
|
+
if (o.isSymbolicLink())
|
|
505
|
+
continue;
|
|
506
|
+
const c = _(n);
|
|
507
|
+
if (o.isDirectory())
|
|
508
|
+
U(c, t);
|
|
509
|
+
else if (o.isFile()) {
|
|
510
|
+
const f = k(n).toLowerCase();
|
|
511
|
+
S.includes(f) && t.add(c);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
const s = [...t].sort();
|
|
515
|
+
return d.debug(
|
|
516
|
+
`[resolveTargets] [resolving → resolved] ${s.length} file(s), ${e.length} error(s)`
|
|
517
|
+
), { files: s, errors: e };
|
|
518
|
+
}
|
|
519
|
+
function U(i, t) {
|
|
520
|
+
let e;
|
|
521
|
+
try {
|
|
522
|
+
e = y(i, { withFileTypes: !0 });
|
|
523
|
+
} catch {
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
for (const s of e) {
|
|
527
|
+
const n = K(i, s.name);
|
|
528
|
+
if (!s.name.startsWith(".") && !Ce.has(s.name) && !s.isSymbolicLink()) {
|
|
529
|
+
if (s.isDirectory())
|
|
530
|
+
U(n, t);
|
|
531
|
+
else if (s.isFile()) {
|
|
532
|
+
const r = k(s.name).toLowerCase();
|
|
533
|
+
S.includes(r) && t.add(n);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
const T = await Ee(process.argv);
|
|
539
|
+
T.exitCode === 1 && console.log(T.format());
|
|
540
|
+
process.exit(T.exitCode);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as D, e as o, b as M, a as H,
|
|
1
|
+
import { p as D, e as o, b as M, a as H, d as B, l as U, f as O, h as k, s as F } from "./shared-Bjy30TeM.js";
|
|
2
2
|
import a from "node:fs";
|
|
3
3
|
import P from "node:path";
|
|
4
4
|
function C(e) {
|
|
@@ -147,11 +147,11 @@ function G(e) {
|
|
|
147
147
|
`).map((s) => s.trim()).filter(Boolean);
|
|
148
148
|
if (m.length === 0)
|
|
149
149
|
throw new Error("Конфликтующие файлы не найдены (`git diff --diff-filter=U` пуст).");
|
|
150
|
-
const b = o("git status --porcelain --untracked-files=no 2>/dev/null"), E = X(b),
|
|
150
|
+
const b = o("git status --porcelain --untracked-files=no 2>/dev/null"), E = X(b), g = x("MERGE_MSG").trim(), v = e.incoming?.trim() || T(g) || $(r) || r, w = e.branch?.trim() || M(), _ = H(), A = d(
|
|
151
151
|
o(`git rev-list --count ${r}..HEAD 2>/dev/null`)
|
|
152
|
-
),
|
|
152
|
+
), S = d(
|
|
153
153
|
o(`git rev-list --count HEAD..${r} 2>/dev/null`)
|
|
154
|
-
),
|
|
154
|
+
), R = m.map(
|
|
155
155
|
(s) => z(s, E.get(s) ?? "UU")
|
|
156
156
|
);
|
|
157
157
|
return {
|
|
@@ -160,11 +160,11 @@ function G(e) {
|
|
|
160
160
|
currentHead: c,
|
|
161
161
|
incomingHead: r,
|
|
162
162
|
mergeBase: l,
|
|
163
|
-
mergeMessage:
|
|
164
|
-
currentOnlyCommits:
|
|
165
|
-
incomingOnlyCommits:
|
|
166
|
-
remote:
|
|
167
|
-
conflictFiles:
|
|
163
|
+
mergeMessage: g,
|
|
164
|
+
currentOnlyCommits: A,
|
|
165
|
+
incomingOnlyCommits: S,
|
|
166
|
+
remote: _,
|
|
167
|
+
conflictFiles: R
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
function u(e) {
|
|
@@ -260,6 +260,6 @@ async function q(e) {
|
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
const J = C(process.argv),
|
|
264
|
-
|
|
265
|
-
process.exit(
|
|
263
|
+
const J = C(process.argv), f = await q(J);
|
|
264
|
+
f.output && console.info(f.output);
|
|
265
|
+
process.exit(f.code);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as $, s as e, a as k } from "./shared-
|
|
1
|
+
import { p as $, s as e, a as k } from "./shared-Bjy30TeM.js";
|
|
2
2
|
import I from "node:fs";
|
|
3
|
-
import { V as S } from "./services-
|
|
3
|
+
import { V as S } from "./services-CaLOhuLV.js";
|
|
4
4
|
async function m(r = {}) {
|
|
5
5
|
const l = r.project, a = r.iid, f = !!r.dryRun, B = r.stdinJsonArray;
|
|
6
6
|
if (!l)
|