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,152 @@
|
|
|
1
|
+
import type { DbcParser, DbcEntrySchema } from '../../../parser/dbc-parser.types.js';
|
|
2
|
+
import type { DbcAstAdapter, DbcExportedEntity, DbcSignatureInfo } from '../../dbc-ast-adapter.types.js';
|
|
3
|
+
import type { DbcLinter, DbcLintReport, DbcLintFixReport, DbcLintError, DbcLintOptions } from '../../dbc-linter.types.js';
|
|
4
|
+
/**
|
|
5
|
+
* @purpose Pure-function validator that compares parsed contract entries against | a code signature and returns structural mismatches.
|
|
6
|
+
* @invariant Never throws. Unknown `kind` returns an empty error array.
|
|
7
|
+
* @invariant Errors are returned in stable order: PARAM_MISSING → PARAM_EXTRA → | PARAM_ORDER → RETURNS_MISSING → RETURNS_UNEXPECTED → TYPE_REDUNDANT.
|
|
8
|
+
* @param entries Parsed contract entries from `DbcParser.parse()`.
|
|
9
|
+
* @param signature Signature information extracted from AST.
|
|
10
|
+
* @param kind Entity or member kind — drives the validation matrix (FR-24).
|
|
11
|
+
* @returns Array of lint errors (empty when contract matches signature).
|
|
12
|
+
*/
|
|
13
|
+
export declare function validate(entries: DbcEntrySchema[], signature: DbcSignatureInfo, kind: string): DbcLintError[];
|
|
14
|
+
/**
|
|
15
|
+
* @purpose TypeScript adapter implementing the DbcLinter contract. | Pass 1: AST extraction. Pass 2: contract validation + signature matching. | Pass 3: ESLint report. Pass 4: autofix chain.
|
|
16
|
+
* @implements {DbcLinter} in ../../dbc-linter.types.ts
|
|
17
|
+
* @invariant Never throws — all errors are returned via report objects.
|
|
18
|
+
* @invariant Error order is stable (top-to-bottom by entity position).
|
|
19
|
+
*/
|
|
20
|
+
export declare class DbcTsLinter implements DbcLinter {
|
|
21
|
+
/** @purpose DBC parser for parsing contract text */
|
|
22
|
+
protected _parser: DbcParser;
|
|
23
|
+
/** @purpose AST adapter for parsing TypeScript source files */
|
|
24
|
+
protected _astAdapter: DbcAstAdapter;
|
|
25
|
+
/**
|
|
26
|
+
* @purpose Construct a linter with injected parser and AST adapter.
|
|
27
|
+
* @param parser DbcParser instance for contract parsing.
|
|
28
|
+
* @param astAdapter DbcAstAdapter instance for source file parsing.
|
|
29
|
+
*/
|
|
30
|
+
constructor(parser: DbcParser, astAdapter: DbcAstAdapter);
|
|
31
|
+
/**
|
|
32
|
+
* @param filePath Path to the source file to check.
|
|
33
|
+
* @param [options] Optional lint configuration.
|
|
34
|
+
* @returns Full lint report with errors and a formatting function.
|
|
35
|
+
* @see {DbcLinter#lint} in ../../dbc-linter.types.ts
|
|
36
|
+
*/
|
|
37
|
+
lint(filePath: string, options?: DbcLintOptions): Promise<DbcLintReport>;
|
|
38
|
+
/**
|
|
39
|
+
* @param filePath Path to the source file to check.
|
|
40
|
+
* @param [options] Optional lint configuration.
|
|
41
|
+
* @returns Combined report with errors and count of auto-fixed issues.
|
|
42
|
+
* @see {DbcLinter#lintAndFix} in ../../dbc-linter.types.ts
|
|
43
|
+
*/
|
|
44
|
+
lintAndFix(filePath: string, options?: DbcLintOptions): Promise<DbcLintFixReport>;
|
|
45
|
+
/**
|
|
46
|
+
* @purpose Walk all exported entities and their members, collecting lint errors.
|
|
47
|
+
* @param entities Exported entities from AST parse result.
|
|
48
|
+
* @param filePath Source file path for error attribution.
|
|
49
|
+
* @returns Array of lint errors collected from entities and members.
|
|
50
|
+
*/
|
|
51
|
+
protected _lintEntities(entities: DbcExportedEntity[], filePath: string): DbcLintError[];
|
|
52
|
+
/**
|
|
53
|
+
* @purpose Parse a contract text and validate it, returning both parser issues
|
|
54
|
+
* (translated per FR-23) and structural mismatches via DbcContractMatchValidator.
|
|
55
|
+
* @param contractText Raw JSDoc contract text to parse and validate.
|
|
56
|
+
* @param signature Signature info from AST for parameter/returns matching.
|
|
57
|
+
* @param kind Entity or member kind for validation matrix lookup.
|
|
58
|
+
* @param filePath Source file path for error attribution.
|
|
59
|
+
* @param startLine Contract start line in source for error position.
|
|
60
|
+
* @param startCol Contract start column in source for error position.
|
|
61
|
+
* @returns Array of lint errors from parser issues and structural mismatches.
|
|
62
|
+
*/
|
|
63
|
+
protected _validateContract(contractText: string, signature: DbcSignatureInfo, kind: string, filePath: string, startLine: number, startCol: number): DbcLintError[];
|
|
64
|
+
/** @purpose Internal record of a contract block with context for autofix. */
|
|
65
|
+
protected _ContractBlock: {
|
|
66
|
+
new (text: string, kind: string, signature: DbcSignatureInfo): {
|
|
67
|
+
text: string;
|
|
68
|
+
kind: string;
|
|
69
|
+
signature: DbcSignatureInfo;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* @purpose Walk entities and members, collecting all JSDoc contract blocks
|
|
74
|
+
* with their associated kind and signature for autofix processing.
|
|
75
|
+
* @param entities Exported entities from AST parse result.
|
|
76
|
+
* @returns Array of contract blocks with kind and signature context.
|
|
77
|
+
*/
|
|
78
|
+
protected _collectContracts(entities: DbcExportedEntity[]): InstanceType<typeof this._ContractBlock>[];
|
|
79
|
+
/**
|
|
80
|
+
* @purpose Expand single-line pipe contracts to multi-line for callable kinds or >3 tags.
|
|
81
|
+
* @param jsdocText Raw JSDoc comment text.
|
|
82
|
+
* @param [kind] Entity kind — callable kinds or pipe with >3 tags are expanded.
|
|
83
|
+
* @returns JSDoc text in multi-line format if applicable.
|
|
84
|
+
*/
|
|
85
|
+
protected _expandToMultiline(jsdocText: string, kind?: string): string;
|
|
86
|
+
/**
|
|
87
|
+
* @purpose Remove redundant `{dataType}` annotations from @param and @returns tags.
|
|
88
|
+
* @param jsdocText Raw JSDoc comment text.
|
|
89
|
+
* @returns JSDoc text with types stripped.
|
|
90
|
+
*/
|
|
91
|
+
protected _removeRedundantTypes(jsdocText: string): string;
|
|
92
|
+
/**
|
|
93
|
+
* @purpose Adjust @param specifiers to wrap optional params in `[brackets]` and remove brackets from required params.
|
|
94
|
+
* @param jsdocText Raw JSDoc comment text.
|
|
95
|
+
* @param signature Signature with optionality flags.
|
|
96
|
+
* @returns JSDoc text with normalized brackets.
|
|
97
|
+
*/
|
|
98
|
+
protected _normalizeParamBrackets(jsdocText: string, signature: DbcSignatureInfo): string;
|
|
99
|
+
/**
|
|
100
|
+
* @purpose Remove @param entries whose specifier does not match any signature parameter. | Handles both multi-line and single-line contracts.
|
|
101
|
+
* @param jsdocText Raw JSDoc comment text.
|
|
102
|
+
* @param signature Signature to match against.
|
|
103
|
+
* @returns JSDoc text with extra params removed.
|
|
104
|
+
*/
|
|
105
|
+
protected _removeExtraParams(jsdocText: string, signature: DbcSignatureInfo): string;
|
|
106
|
+
/**
|
|
107
|
+
* @purpose Remove @returns tag when the kind does not allow it or return type is void.
|
|
108
|
+
* @param jsdocText Raw JSDoc comment text.
|
|
109
|
+
* @param kind Entity or member kind.
|
|
110
|
+
* @param [signature] Optional signature info to check void return type.
|
|
111
|
+
* @returns JSDoc text with unexpected @returns removed.
|
|
112
|
+
*/
|
|
113
|
+
protected _removeUnexpectedReturns(jsdocText: string, kind: string, signature?: DbcSignatureInfo): string;
|
|
114
|
+
/**
|
|
115
|
+
* @purpose Reorder @param entries to match the signature parameter order.
|
|
116
|
+
* @param jsdocText Raw JSDoc comment text.
|
|
117
|
+
* @param signature Signature with desired parameter order.
|
|
118
|
+
* @returns JSDoc text with params reordered.
|
|
119
|
+
*/
|
|
120
|
+
protected _reorderParams(jsdocText: string, signature: DbcSignatureInfo): string;
|
|
121
|
+
/**
|
|
122
|
+
* @purpose Reorder contract tags to canonical DBC order. | Order: description → purpose → implements → invariant → pre → param(*) → | throws → returns → post → sideEffect → other tags.
|
|
123
|
+
* @param jsdocText Raw JSDoc comment text.
|
|
124
|
+
* @returns JSDoc text with tags in canonical order.
|
|
125
|
+
*/
|
|
126
|
+
protected _reorderTags(jsdocText: string): string;
|
|
127
|
+
/**
|
|
128
|
+
* @purpose Normalize multi-line JSDoc format: ensure closing marker is on its own line | and opening marker is bare (no content after it). | Preserves original indentation by patching specific format issues | rather than reconstructing the entire block.
|
|
129
|
+
* @invariant Single-line contracts pass through unchanged.
|
|
130
|
+
* @param jsdocText Raw JSDoc comment text.
|
|
131
|
+
* @returns Normalized JSDoc text.
|
|
132
|
+
*/
|
|
133
|
+
protected _normalizeMultiLine(jsdocText: string): string;
|
|
134
|
+
/**
|
|
135
|
+
* @purpose Detect the indentation pattern used by content lines. | Returns the whitespace prefix before `*` on the first content line, | or the indent of the opening line as fallback.
|
|
136
|
+
* @param lines All lines of the JSDoc block (may be mutated by Step 1).
|
|
137
|
+
* @returns Indent string for `*`-prefixed content lines.
|
|
138
|
+
*/
|
|
139
|
+
protected _detectContentIndent(lines: string[]): string;
|
|
140
|
+
/**
|
|
141
|
+
* @purpose Attempt to convert a multi-line JSDoc comment to single-line format. | Inlines only single-tag contracts (1 @tag); multi-tag contracts stay multi-line. | Performs a dry-run through the parser: if the inline version introduces new | parse errors, the original multi-line text is returned unchanged.
|
|
142
|
+
* @param jsdocText Raw JSDoc comment text.
|
|
143
|
+
* @returns Inline text if safe, otherwise the original text.
|
|
144
|
+
*/
|
|
145
|
+
protected _inlineIfSafe(jsdocText: string): string;
|
|
146
|
+
/**
|
|
147
|
+
* @purpose Extract the specifier (parameter name) from a @param tag line. | Example: `@param userId Description` → `userId`
|
|
148
|
+
* @param line Trimmed line content starting with `@param`.
|
|
149
|
+
* @returns The specifier or empty string.
|
|
150
|
+
*/
|
|
151
|
+
protected _extractParamSpecifier(line: string): string;
|
|
152
|
+
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
/** @purpose Signal whether contract was authored in a single compressed line or multi-line block. */
|
|
2
|
+
export type DbcSchemaFormat = 'single-line' | 'multi-line';
|
|
1
3
|
/**
|
|
2
4
|
* @purpose Defines the universal contract schema and parser interface for DBC parsers.
|
|
3
|
-
* @consumer DbcParserImplementations
|
|
4
5
|
* @invariant Any implementation must return an entries array for every parse invocation.
|
|
5
6
|
*/
|
|
6
7
|
export type DbcSchema = {
|
|
7
8
|
/** @purpose Parsed contract entries normalized into the universal shape. */
|
|
8
9
|
entries: DbcEntrySchema[];
|
|
10
|
+
/** @purpose Format of the original input contract */
|
|
11
|
+
format: DbcSchemaFormat;
|
|
9
12
|
};
|
|
10
13
|
/**
|
|
11
14
|
* @purpose Represents a single parsed contract tag or inferred description block.
|
|
12
|
-
* @consumer DbcSchema
|
|
13
15
|
* @invariant Every entry always contains an `issues` array, even when it is empty.
|
|
16
|
+
* @consumer DbcSchema
|
|
14
17
|
*/
|
|
15
18
|
export type DbcEntrySchema = {
|
|
16
19
|
/** @purpose Tag type without leading at-sign, for example `param` or `returns`. */
|
|
@@ -25,6 +28,8 @@ export type DbcEntrySchema = {
|
|
|
25
28
|
value: string;
|
|
26
29
|
/** @purpose Validation issues related to this entry. */
|
|
27
30
|
issues: DbcDbcEntryIssue[];
|
|
31
|
+
/** @purpose Inline child tags extracted from pipe-delimited single-line contracts */
|
|
32
|
+
inline?: DbcEntrySchema[];
|
|
28
33
|
};
|
|
29
34
|
/**
|
|
30
35
|
* @purpose Represents a single validation issue bound to an issue code and optional source line.
|
|
@@ -36,30 +41,25 @@ export type DbcDbcEntryIssue = {
|
|
|
36
41
|
/** @purpose One-based line number in the input contract where the issue was detected. */
|
|
37
42
|
line?: number;
|
|
38
43
|
};
|
|
39
|
-
/**
|
|
40
|
-
* @purpose Signals a forbidden combination: `@purpose` and `@see` are used together.
|
|
41
|
-
*/
|
|
44
|
+
/** @purpose Signals a forbidden combination: `@purpose` and `@see` are used together. */
|
|
42
45
|
export declare const ERR_DBC_PURPOSE_CONFLICT = "ERR_DBC_PURPOSE_CONFLICT";
|
|
43
|
-
/**
|
|
44
|
-
* @purpose Signals that contract tags violate the required ordering.
|
|
45
|
-
*/
|
|
46
|
+
/** @purpose Signals that contract tags violate the required ordering. */
|
|
46
47
|
export declare const ERR_DBC_ORDER = "ERR_DBC_ORDER";
|
|
47
|
-
/**
|
|
48
|
-
* @purpose Signals that a `@param` tag misses its specifier.
|
|
49
|
-
*/
|
|
48
|
+
/** @purpose Signals that a `@param` tag misses its specifier. */
|
|
50
49
|
export declare const ERR_DBC_PARAM_NAME_MISSING = "ERR_DBC_PARAM_NAME_MISSING";
|
|
51
|
-
/**
|
|
52
|
-
* @purpose Signals that a `@see` tag misses a valid `{specifier}` payload.
|
|
53
|
-
*/
|
|
50
|
+
/** @purpose Signals that a `@see` tag misses a valid `{specifier}` payload. */
|
|
54
51
|
export declare const ERR_DBC_SEE_FORMAT_INVALID = "ERR_DBC_SEE_FORMAT_INVALID";
|
|
55
52
|
/** @purpose Union of all supported parser issue codes. */
|
|
56
53
|
export type DbcIssueCode = typeof ERR_DBC_PURPOSE_CONFLICT | typeof ERR_DBC_ORDER | typeof ERR_DBC_PARAM_NAME_MISSING | typeof ERR_DBC_SEE_FORMAT_INVALID;
|
|
57
54
|
/**
|
|
58
55
|
* @purpose Defines the universal parser contract for textual Design by Contract blocks.
|
|
59
56
|
* @consumer Any parser implementation in `services/dbc/parser/implementations/*`
|
|
60
|
-
* @param inputContract Raw contract text in plain or JSDoc-like syntax.
|
|
61
|
-
* @returns Parsed entries with entry-local validation diagnostics in the universal schema.
|
|
62
57
|
*/
|
|
63
58
|
export interface DbcParser {
|
|
59
|
+
/**
|
|
60
|
+
* @purpose Parse a raw contract text block into a universal DBC schema with entries and issues.
|
|
61
|
+
* @param inputContract Raw JSDoc-like contract text block to parse.
|
|
62
|
+
* @returns Parsed schema containing normalized entries and format info.
|
|
63
|
+
*/
|
|
64
64
|
parse(inputContract: string): DbcSchema;
|
|
65
65
|
}
|
|
@@ -4,11 +4,13 @@ type ParsedEntryWithLine = DbcEntrySchema & {
|
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
6
|
* @purpose Parses JSDoc-like contract blocks into a universal DBC schema and validates contract rules.
|
|
7
|
-
* @
|
|
7
|
+
* @implements {DbcParser} in ../../dbc-parser.types.ts
|
|
8
8
|
* @invariant Input is handled line-by-line with explicit support for leading `*` markers.
|
|
9
9
|
*/
|
|
10
10
|
export declare class DbcJsDocParser implements DbcParser {
|
|
11
11
|
/**
|
|
12
|
+
* @param inputContract Raw contract text to parse.
|
|
13
|
+
* @returns Parsed DBC schema with entries and format metadata.
|
|
12
14
|
* @see {DbcParser#parse} in ../../dbc-parser.types.ts
|
|
13
15
|
*/
|
|
14
16
|
parse(inputContract: string): DbcSchema;
|
|
@@ -45,10 +47,18 @@ export declare class DbcJsDocParser implements DbcParser {
|
|
|
45
47
|
* @purpose Parses `@see` into required `{specifier}` and optional trailing value.
|
|
46
48
|
* @param type Tag type.
|
|
47
49
|
* @param tail Content after `@see`.
|
|
48
|
-
* @param line
|
|
50
|
+
* @param line Source line number.
|
|
49
51
|
* @returns Parsed entry.
|
|
50
52
|
*/
|
|
51
53
|
protected parseSeeTag(type: string, tail: string, line: number): ParsedEntryWithLine;
|
|
54
|
+
/**
|
|
55
|
+
* @purpose Parses `@implements` into required `{ContractName}` and optional trailing value.
|
|
56
|
+
* @param type Tag type.
|
|
57
|
+
* @param tail Content after `@implements`.
|
|
58
|
+
* @param line One-based source line number.
|
|
59
|
+
* @returns Parsed entry.
|
|
60
|
+
*/
|
|
61
|
+
protected parseImplementsTag(type: string, tail: string, line: number): ParsedEntryWithLine;
|
|
52
62
|
/**
|
|
53
63
|
* @purpose Emits a conflict issue when `purpose` and `see` are both present in the parsed entries.
|
|
54
64
|
* @param entries Parsed entries with source lines.
|
|
@@ -65,8 +75,8 @@ export declare class DbcJsDocParser implements DbcParser {
|
|
|
65
75
|
*/
|
|
66
76
|
protected validateParamSpecifier(entries: ParsedEntryWithLine[]): void;
|
|
67
77
|
/**
|
|
68
|
-
* @purpose Emits invalid-see-format issues for `@see` entries
|
|
69
|
-
* @param entries Parsed entries
|
|
78
|
+
* @purpose Emits invalid-see-format issues for `@see` entries.
|
|
79
|
+
* @param entries Parsed entries to validate.
|
|
70
80
|
*/
|
|
71
81
|
protected validateSeeSpecifier(entries: ParsedEntryWithLine[]): void;
|
|
72
82
|
/**
|
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
/** @purpose Project-wide logger contract with a stable debug/info/warn/error API. */
|
|
2
2
|
export type SimpleLogger = {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @purpose Emits a debug-level message for development diagnostics.
|
|
5
|
+
* @param message Log message with Trace-Prefix and state transition.
|
|
6
|
+
* @param [detail] Optional structured payload.
|
|
7
|
+
*/
|
|
4
8
|
debug: (message: string, detail?: unknown) => void;
|
|
5
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @purpose Emits an info-level message for normal operational events.
|
|
11
|
+
* @param message Log message with Trace-Prefix and state transition.
|
|
12
|
+
* @param [detail] Optional structured payload.
|
|
13
|
+
*/
|
|
6
14
|
info: (message: string, detail?: unknown) => void;
|
|
7
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @purpose Emits a warning-level message for non-fatal issues.
|
|
17
|
+
* @param message Log message with Trace-Prefix and state transition.
|
|
18
|
+
* @param [detail] Optional structured payload.
|
|
19
|
+
*/
|
|
8
20
|
warn: (message: string, detail?: unknown) => void;
|
|
9
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @purpose Emits an error-level message for failures requiring investigation.
|
|
23
|
+
* @param message Log message with Trace-Prefix and state transition.
|
|
24
|
+
* @param [detail] Optional structured payload.
|
|
25
|
+
*/
|
|
10
26
|
error: (message: string, detail?: unknown) => void;
|
|
11
27
|
};
|
|
28
|
+
/** @purpose Ordered log levels — lower index = more verbose. */
|
|
29
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
30
|
+
/** @purpose Set the minimum log level for the global logger instance. */
|
|
31
|
+
export declare const setLogLevel: (level: LogLevel) => void;
|
|
12
32
|
/**
|
|
13
|
-
* @purpose Logger implementation bound to the runtime console.
|
|
14
|
-
* @sideEffect Console: writes log entries to
|
|
33
|
+
* @purpose Logger implementation bound to the runtime console, filtered by the active log level.
|
|
34
|
+
* @sideEffect Console: writes log entries to stderr via console methods.
|
|
15
35
|
*/
|
|
16
36
|
export declare const logger: SimpleLogger;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RemoteConsoleSerializedArg } from './remote-console-client.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* @purpose Converts unknown console arguments into deterministic, printable transport-safe descriptors.
|
|
4
|
+
* @param value Single console argument value from browser runtime.
|
|
5
|
+
* @returns Serialized representation that never throws and can always be rendered by stdout writer.
|
|
6
|
+
*/
|
|
7
|
+
export declare function serializeRemoteConsoleArg(value: unknown): RemoteConsoleSerializedArg;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RemoteConsoleClientConnectConfig, RemoteConsoleClientRuntime, RemoteConsoleClientTarget } from './remote-console-client.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* @purpose Connects a console-like browser target to a remote endpoint without breaking local console behavior.
|
|
4
|
+
* @param consoleTarget Console-like target to patch for log mirroring.
|
|
5
|
+
* @param config URL-centric transport configuration for remote endpoint and optional source tag.
|
|
6
|
+
* @throws {Error} When URL is invalid or console target does not expose required logging methods.
|
|
7
|
+
* @returns Runtime controls attached to console target under `__remote__.disconnect`.
|
|
8
|
+
* @sideEffect Monkey patch: replaces log/info/warn/error/debug methods on target.
|
|
9
|
+
* @sideEffect Timer: starts periodic batch flush every five seconds.
|
|
10
|
+
* @sideEffect Network: sends envelope commands to configured URL.
|
|
11
|
+
* @sideEffect Browser lifecycle: subscribes to pagehide and beforeunload for unload-safe shutdown.
|
|
12
|
+
*/
|
|
13
|
+
export declare function connectRemoteConsoleClient(consoleTarget: RemoteConsoleClientTarget, config: RemoteConsoleClientConnectConfig): RemoteConsoleClientRuntime;
|
|
14
|
+
/**
|
|
15
|
+
* @purpose Public client facade exposing only browser connect API for remote-console domain.
|
|
16
|
+
* @consumer Browser page runtime
|
|
17
|
+
*/
|
|
18
|
+
export declare const remoteConsoleClient: {
|
|
19
|
+
connect: typeof connectRemoteConsoleClient;
|
|
20
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** @purpose Defines the supported browser console levels for remote mirroring. */
|
|
2
|
+
export type RemoteConsoleLevel = 'log' | 'info' | 'warn' | 'error' | 'debug';
|
|
3
|
+
/**
|
|
4
|
+
* @purpose Describes one serialized console argument in a transport-safe and printable form.
|
|
5
|
+
* @consumer RemoteConsoleClient, RemoteConsoleStdoutWriter
|
|
6
|
+
*/
|
|
7
|
+
export type RemoteConsoleSerializedArg = {
|
|
8
|
+
/** @purpose Declares whether the value was primitive or required a tagged fallback descriptor. */
|
|
9
|
+
kind: 'primitive' | 'tagged';
|
|
10
|
+
/** @purpose Stores the deterministic text representation for stdout rendering. */
|
|
11
|
+
text: string;
|
|
12
|
+
/** @purpose Carries Object.prototype.toString tag for tagged values when available. */
|
|
13
|
+
tag?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @purpose Captures one browser console invocation as an ordered transport entry.
|
|
17
|
+
* @consumer RemoteConsoleHttpServer
|
|
18
|
+
*/
|
|
19
|
+
export type RemoteConsoleLogEntry = {
|
|
20
|
+
/** @purpose Mirrors the source logging level used in console call. */
|
|
21
|
+
level: RemoteConsoleLevel;
|
|
22
|
+
/** @purpose Stores event time as Unix epoch milliseconds for stable ordering in a batch. */
|
|
23
|
+
timestamp: number;
|
|
24
|
+
/** @purpose Preserves source argument order after safe serialization. */
|
|
25
|
+
args: RemoteConsoleSerializedArg[];
|
|
26
|
+
/** @purpose Optionally marks originating tab identity for diagnostics correlation. */
|
|
27
|
+
tabId?: string;
|
|
28
|
+
/** @purpose Optionally marks source branch identity for diagnostics correlation. */
|
|
29
|
+
branch?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* @purpose Provides URL-centric browser connection options for remote console transport.
|
|
33
|
+
* @consumer Browser page runtime
|
|
34
|
+
*/
|
|
35
|
+
export type RemoteConsoleClientConnectConfig = {
|
|
36
|
+
/** @purpose Stores absolute endpoint used for both logs and disconnect envelopes. */
|
|
37
|
+
url: string;
|
|
38
|
+
/** @purpose Carries optional source marker copied into outgoing log entries. */
|
|
39
|
+
tabId?: string;
|
|
40
|
+
/** @purpose Carries optional branch marker copied into outgoing log entries. */
|
|
41
|
+
branch?: string;
|
|
42
|
+
};
|
|
43
|
+
/** @purpose Declares runtime controls published on patched console targets. */
|
|
44
|
+
export type RemoteConsoleClientRuntime = {
|
|
45
|
+
/**
|
|
46
|
+
* @purpose Stops batching, attempts final flush and sends disconnect envelope exactly once.
|
|
47
|
+
* @returns Promise that resolves after disconnect.
|
|
48
|
+
*/
|
|
49
|
+
disconnect: () => Promise<void>;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @purpose Describes a console-compatible patch target that can expose remote runtime controls.
|
|
53
|
+
* @consumer remoteConsoleClient.connect
|
|
54
|
+
*/
|
|
55
|
+
export type RemoteConsoleClientTarget = {
|
|
56
|
+
/**
|
|
57
|
+
* @purpose Receives plain log-level messages while patched runtime mirrors entries remotely.
|
|
58
|
+
* @param args Log arguments to mirror remotely.
|
|
59
|
+
* @returns Result of the underlying console call.
|
|
60
|
+
*/
|
|
61
|
+
log: (...args: unknown[]) => unknown;
|
|
62
|
+
/**
|
|
63
|
+
* @purpose Receives info-level messages while patched runtime mirrors entries remotely.
|
|
64
|
+
* @param args Info arguments to mirror remotely.
|
|
65
|
+
* @returns Result of the underlying console call.
|
|
66
|
+
*/
|
|
67
|
+
info: (...args: unknown[]) => unknown;
|
|
68
|
+
/**
|
|
69
|
+
* @purpose Receives warning-level messages while patched runtime mirrors entries remotely.
|
|
70
|
+
* @param args Warning arguments to mirror remotely.
|
|
71
|
+
* @returns Result of the underlying console call.
|
|
72
|
+
*/
|
|
73
|
+
warn: (...args: unknown[]) => unknown;
|
|
74
|
+
/**
|
|
75
|
+
* @purpose Receives error-level messages while patched runtime mirrors entries remotely.
|
|
76
|
+
* @param args Error arguments to mirror remotely.
|
|
77
|
+
* @returns Result of the underlying console call.
|
|
78
|
+
*/
|
|
79
|
+
error: (...args: unknown[]) => unknown;
|
|
80
|
+
/**
|
|
81
|
+
* @purpose Receives debug-level messages while patched runtime mirrors entries remotely.
|
|
82
|
+
* @param args Debug arguments to mirror remotely.
|
|
83
|
+
* @returns Result of the underlying console call.
|
|
84
|
+
*/
|
|
85
|
+
debug: (...args: unknown[]) => unknown;
|
|
86
|
+
/** @purpose Exposes injected remote runtime controls after successful connect. */
|
|
87
|
+
__remote__?: RemoteConsoleClientRuntime;
|
|
88
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { remoteConsoleClient, connectRemoteConsoleClient } from './client/remote-console-client.js';
|
|
2
|
+
export { serializeRemoteConsoleArg } from './client/remote-console-client-serializer.js';
|
|
3
|
+
export type { RemoteConsoleClientConnectConfig, RemoteConsoleClientRuntime, RemoteConsoleClientTarget, RemoteConsoleLevel, RemoteConsoleLogEntry, RemoteConsoleSerializedArg, } from './client/remote-console-client.types.js';
|
|
4
|
+
export { startRemoteConsoleServer } from './server/remote-console-server.js';
|
|
5
|
+
export { RemoteConsoleStdoutWriter } from './server/remote-console-stdout-writer.js';
|
|
6
|
+
export type { RemoteConsoleCommandEnvelope, RemoteConsoleServerLifecycle, RemoteConsoleServerOptions, } from './server/remote-console-server.types.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RemoteConsoleServerLifecycle, RemoteConsoleServerOptions } from './remote-console-server.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* @purpose Starts a single-endpoint HTTP runtime that accepts remote log and disconnect envelopes.
|
|
4
|
+
* @param options Runtime startup options with bind address, exit policy and optional test adapters.
|
|
5
|
+
* @throws {Error} When options are invalid or server startup fails.
|
|
6
|
+
* @returns Lifecycle handle exposing resolved endpoint URL and graceful close routine.
|
|
7
|
+
* @sideEffect Network: opens an HTTP listening socket.
|
|
8
|
+
* @sideEffect IO: writes incoming log payloads to stdout via normalized writer.
|
|
9
|
+
*/
|
|
10
|
+
export declare function startRemoteConsoleServer(options: RemoteConsoleServerOptions): Promise<RemoteConsoleServerLifecycle>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { RemoteConsoleLogEntry } from '../client/remote-console-client.types.js';
|
|
2
|
+
/** @purpose Describes accepted command envelope variants handled by the single remote-console endpoint. */
|
|
3
|
+
export type RemoteConsoleCommandEnvelope = {
|
|
4
|
+
/** @purpose Selects log-batch dispatch branch for the single endpoint. */
|
|
5
|
+
type: 'logs';
|
|
6
|
+
/** @purpose Optionally identifies source tab for downstream diagnostics. */
|
|
7
|
+
tabId?: string;
|
|
8
|
+
/** @purpose Carries ordered log entries to be rendered as stdout lines. */
|
|
9
|
+
items: RemoteConsoleLogEntry[];
|
|
10
|
+
} | {
|
|
11
|
+
/** @purpose Selects controlled shutdown dispatch branch for the single endpoint. */
|
|
12
|
+
type: 'disconnect';
|
|
13
|
+
/** @purpose Optionally identifies source tab that requested shutdown. */
|
|
14
|
+
tabId?: string;
|
|
15
|
+
};
|
|
16
|
+
/** @purpose Defines startup options for the remote console HTTP runtime. */
|
|
17
|
+
export type RemoteConsoleServerOptions = {
|
|
18
|
+
/** @purpose Configures the listening port for local server runtime. */
|
|
19
|
+
port: number;
|
|
20
|
+
/** @purpose Overrides bind host; defaults to loopback-safe host when omitted. */
|
|
21
|
+
host?: string;
|
|
22
|
+
/** @purpose Defines process exit code used after controlled disconnect shutdown. */
|
|
23
|
+
exitCode?: number;
|
|
24
|
+
/**
|
|
25
|
+
* @purpose Custom line writer for tests or integration embeddings.
|
|
26
|
+
* @param line Text line to write.
|
|
27
|
+
*/
|
|
28
|
+
stdoutWrite?: (line: string) => void;
|
|
29
|
+
/**
|
|
30
|
+
* @purpose Custom exit strategy for tests; defaults to process.exit in production runtime.
|
|
31
|
+
* @param code Exit code to use.
|
|
32
|
+
*/
|
|
33
|
+
exit?: (code: number) => void;
|
|
34
|
+
};
|
|
35
|
+
/** @purpose Describes the lifecycle handle returned by the server startup API. */
|
|
36
|
+
export type RemoteConsoleServerLifecycle = {
|
|
37
|
+
/** @purpose Exposes fully resolved endpoint URL for browser client configuration. */
|
|
38
|
+
url: string;
|
|
39
|
+
/**
|
|
40
|
+
* @purpose Closes the listening server without forcing process termination.
|
|
41
|
+
* @returns Promise that resolves when server is closed.
|
|
42
|
+
*/
|
|
43
|
+
close: () => Promise<void>;
|
|
44
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RemoteConsoleLogEntry } from '../client/remote-console-client.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* @purpose Renders remote log entries into deterministic flat stdout lines for terminal consumers.
|
|
4
|
+
* @consumer RemoteConsoleHttpServer
|
|
5
|
+
*/
|
|
6
|
+
export declare class RemoteConsoleStdoutWriter {
|
|
7
|
+
/** @purpose Stores low-level line sink used to emit already-rendered stdout entries. */
|
|
8
|
+
protected readonly _writeLine: (line: string) => void;
|
|
9
|
+
/**
|
|
10
|
+
* @purpose Configures writer with injected sink or defaults to process.stdout line output.
|
|
11
|
+
* @param [writeLine] Optional custom line writer function.
|
|
12
|
+
*/
|
|
13
|
+
constructor(writeLine?: (line: string) => void);
|
|
14
|
+
/**
|
|
15
|
+
* @purpose Prints ordered log entries as one normalized line per entry.
|
|
16
|
+
* @param items Parsed log entry list from command envelope payload.
|
|
17
|
+
* @sideEffect IO: writes rendered lines into stdout stream (or injected writer).
|
|
18
|
+
*/
|
|
19
|
+
write(items: RemoteConsoleLogEntry[]): void;
|
|
20
|
+
/**
|
|
21
|
+
* @purpose Creates stable text format independent from platform util.inspect behavior.
|
|
22
|
+
* @param item Single remote log entry with serialized args.
|
|
23
|
+
* @returns Flat line in format `[console.<level>] <arg1> <arg2> ...`.
|
|
24
|
+
*/
|
|
25
|
+
render(item: RemoteConsoleLogEntry): string;
|
|
26
|
+
}
|
|
@@ -1,48 +1,56 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @purpose
|
|
2
|
+
* @purpose Parameters for creating a note in an MR discussion: project, MR IID, discussion ID, text.
|
|
3
3
|
* @consumer VcsClientMergeDiscussions
|
|
4
4
|
*/
|
|
5
5
|
export type VcsAddNoteQuery = {
|
|
6
|
+
/** @purpose GitLab project path or ID */
|
|
6
7
|
project: string;
|
|
8
|
+
/** @purpose Merge request internal ID */
|
|
7
9
|
iid: string | number;
|
|
10
|
+
/** @purpose Target discussion identifier */
|
|
8
11
|
discussionId: string;
|
|
12
|
+
/** @purpose Note body text in Markdown */
|
|
9
13
|
body: string;
|
|
10
14
|
};
|
|
11
15
|
/**
|
|
12
|
-
* @purpose
|
|
16
|
+
* @purpose Parameters for querying MR discussion list: project, MR IID, pagination.
|
|
13
17
|
* @consumer VcsClientMergeDiscussions
|
|
14
18
|
*/
|
|
15
19
|
export type VcsDiscussionsListQuery = {
|
|
20
|
+
/** @purpose GitLab project path or ID */
|
|
16
21
|
project: string;
|
|
22
|
+
/** @purpose Merge request internal ID */
|
|
17
23
|
iid: string | number;
|
|
24
|
+
/** @purpose Page size | @invariant Default: GitLab default when absent */
|
|
18
25
|
perPage?: number;
|
|
26
|
+
/** @purpose Page number starting from 1 */
|
|
19
27
|
page?: number;
|
|
20
28
|
};
|
|
21
29
|
/**
|
|
22
|
-
* @purpose
|
|
30
|
+
* @purpose Access to Discussions for Merge Requests in GitLab.
|
|
31
|
+
* @invariant Error Policy: Network/status errors are thrown outward from request().
|
|
23
32
|
* @consumer VcsClient
|
|
24
|
-
* @invariant Error Policy: Ошибки сети/статуса пробрасываются наружу из request().
|
|
25
33
|
*/
|
|
26
34
|
export declare abstract class VcsClientMergeDiscussions {
|
|
27
35
|
/**
|
|
28
|
-
* @purpose
|
|
29
|
-
* @param query
|
|
30
|
-
* @returns
|
|
36
|
+
* @purpose Create a reply (note) in an existing Merge Request discussion.
|
|
37
|
+
* @param query Query parameters.
|
|
38
|
+
* @returns Created note object (JSON), as returned by GitLab API.
|
|
31
39
|
* @sideEffect Network: POST /projects/:project/merge_requests/:iid/discussions/:discussion_id/notes
|
|
32
40
|
*/
|
|
33
41
|
abstract addNote(query: VcsAddNoteQuery): Promise<unknown>;
|
|
34
42
|
/**
|
|
35
|
-
* @purpose
|
|
36
|
-
* @param query
|
|
37
|
-
* @returns
|
|
43
|
+
* @purpose Get a page of MR discussions.
|
|
44
|
+
* @param query Parameters: { project, iid, perPage?, page? }.
|
|
45
|
+
* @returns List of discussions for the current page.
|
|
38
46
|
* @sideEffect Network: GET /projects/:project/merge_requests/:iid/discussions
|
|
39
47
|
*/
|
|
40
48
|
abstract getList(query: VcsDiscussionsListQuery): Promise<unknown[]>;
|
|
41
49
|
/**
|
|
42
|
-
* @purpose
|
|
43
|
-
* @param query
|
|
44
|
-
* @returns
|
|
45
|
-
* @sideEffect Network:
|
|
50
|
+
* @purpose Collect all pages of MR discussions.
|
|
51
|
+
* @param query Parameters: { project, iid }.
|
|
52
|
+
* @returns Complete list of MR discussions.
|
|
53
|
+
* @sideEffect Network: Multiple GET requests for paginated loading.
|
|
46
54
|
*/
|
|
47
55
|
abstract getAll(query: {
|
|
48
56
|
project: string;
|