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,443 @@
|
|
|
1
|
+
import l from "node:process";
|
|
2
|
+
import k from "node:path";
|
|
3
|
+
import { fileURLToPath as D } from "node:url";
|
|
4
|
+
import L, { execFile as B } from "node:child_process";
|
|
5
|
+
import E, { constants as O } from "node:fs/promises";
|
|
6
|
+
import { promisify as h } from "node:util";
|
|
7
|
+
import z from "node:os";
|
|
8
|
+
import g from "node:fs";
|
|
9
|
+
import { Buffer as X } from "node:buffer";
|
|
10
|
+
import { p as G } from "./shared-Bjy30TeM.js";
|
|
11
|
+
import { c as K } from "./services-CaLOhuLV.js";
|
|
12
|
+
let F;
|
|
13
|
+
function q() {
|
|
14
|
+
try {
|
|
15
|
+
return g.statSync("/.dockerenv"), !0;
|
|
16
|
+
} catch {
|
|
17
|
+
return !1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function V() {
|
|
21
|
+
try {
|
|
22
|
+
return g.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
23
|
+
} catch {
|
|
24
|
+
return !1;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function Y() {
|
|
28
|
+
return F === void 0 && (F = q() || V()), F;
|
|
29
|
+
}
|
|
30
|
+
let _;
|
|
31
|
+
const J = () => {
|
|
32
|
+
try {
|
|
33
|
+
return g.statSync("/run/.containerenv"), !0;
|
|
34
|
+
} catch {
|
|
35
|
+
return !1;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
function b() {
|
|
39
|
+
return _ === void 0 && (_ = J() || Y()), _;
|
|
40
|
+
}
|
|
41
|
+
const T = () => {
|
|
42
|
+
if (l.platform !== "linux")
|
|
43
|
+
return !1;
|
|
44
|
+
if (z.release().toLowerCase().includes("microsoft"))
|
|
45
|
+
return !b();
|
|
46
|
+
try {
|
|
47
|
+
if (g.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft"))
|
|
48
|
+
return !b();
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
51
|
+
return g.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || g.existsSync("/run/WSL") ? !b() : !1;
|
|
52
|
+
}, p = l.env.__IS_WSL_TEST__ ? T : T(), Q = h(L.execFile), N = () => `${l.env.SYSTEMROOT || l.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, f = async (e, r = {}) => {
|
|
53
|
+
const {
|
|
54
|
+
powerShellPath: o,
|
|
55
|
+
...t
|
|
56
|
+
} = r, n = f.encodeCommand(e);
|
|
57
|
+
return Q(
|
|
58
|
+
o ?? N(),
|
|
59
|
+
[
|
|
60
|
+
...f.argumentsPrefix,
|
|
61
|
+
n
|
|
62
|
+
],
|
|
63
|
+
{
|
|
64
|
+
encoding: "utf8",
|
|
65
|
+
...t
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
f.argumentsPrefix = [
|
|
70
|
+
"-NoProfile",
|
|
71
|
+
"-NonInteractive",
|
|
72
|
+
"-ExecutionPolicy",
|
|
73
|
+
"Bypass",
|
|
74
|
+
"-EncodedCommand"
|
|
75
|
+
];
|
|
76
|
+
f.encodeCommand = (e) => X.from(e, "utf16le").toString("base64");
|
|
77
|
+
f.escapeArgument = (e) => `'${String(e).replaceAll("'", "''")}'`;
|
|
78
|
+
function Z(e) {
|
|
79
|
+
for (const r of e.split(`
|
|
80
|
+
`)) {
|
|
81
|
+
if (/^\s*#/.test(r))
|
|
82
|
+
continue;
|
|
83
|
+
const o = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(r);
|
|
84
|
+
if (o)
|
|
85
|
+
return o.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const j = h(L.execFile), ee = /* @__PURE__ */ (() => {
|
|
89
|
+
const e = "/mnt/";
|
|
90
|
+
let r;
|
|
91
|
+
return async function() {
|
|
92
|
+
if (r)
|
|
93
|
+
return r;
|
|
94
|
+
const o = "/etc/wsl.conf";
|
|
95
|
+
let t = !1;
|
|
96
|
+
try {
|
|
97
|
+
await E.access(o, O.F_OK), t = !0;
|
|
98
|
+
} catch {
|
|
99
|
+
}
|
|
100
|
+
if (!t)
|
|
101
|
+
return e;
|
|
102
|
+
const n = await E.readFile(o, { encoding: "utf8" }), s = Z(n);
|
|
103
|
+
return s === void 0 ? e : (r = s, r = r.endsWith("/") ? r : `${r}/`, r);
|
|
104
|
+
};
|
|
105
|
+
})(), re = async () => `${await ee()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`, M = p ? re : N;
|
|
106
|
+
let $;
|
|
107
|
+
const oe = async () => ($ ??= (async () => {
|
|
108
|
+
try {
|
|
109
|
+
const e = await M();
|
|
110
|
+
return await E.access(e, O.X_OK), !0;
|
|
111
|
+
} catch {
|
|
112
|
+
return !1;
|
|
113
|
+
}
|
|
114
|
+
})(), $), te = async () => {
|
|
115
|
+
const e = await M(), r = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { stdout: o } = await f(r, { powerShellPath: e });
|
|
116
|
+
return o.trim();
|
|
117
|
+
}, ne = async (e) => {
|
|
118
|
+
if (/^[a-z]+:\/\//i.test(e))
|
|
119
|
+
return e;
|
|
120
|
+
try {
|
|
121
|
+
const { stdout: r } = await j("wslpath", ["-aw", e], { encoding: "utf8" });
|
|
122
|
+
return r.trim();
|
|
123
|
+
} catch {
|
|
124
|
+
return e;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
function y(e, r, o) {
|
|
128
|
+
const t = (n) => Object.defineProperty(e, r, { value: n, enumerable: !0, writable: !0 });
|
|
129
|
+
return Object.defineProperty(e, r, {
|
|
130
|
+
configurable: !0,
|
|
131
|
+
enumerable: !0,
|
|
132
|
+
get() {
|
|
133
|
+
const n = o();
|
|
134
|
+
return t(n), n;
|
|
135
|
+
},
|
|
136
|
+
set(n) {
|
|
137
|
+
t(n);
|
|
138
|
+
}
|
|
139
|
+
}), e;
|
|
140
|
+
}
|
|
141
|
+
const se = h(B);
|
|
142
|
+
async function ae() {
|
|
143
|
+
if (l.platform !== "darwin")
|
|
144
|
+
throw new Error("macOS only");
|
|
145
|
+
const { stdout: e } = await se("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]), o = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id ?? "com.apple.Safari";
|
|
146
|
+
return o === "com.apple.safari" ? "com.apple.Safari" : o;
|
|
147
|
+
}
|
|
148
|
+
const ie = h(B);
|
|
149
|
+
async function ce(e, { humanReadableOutput: r = !0, signal: o } = {}) {
|
|
150
|
+
if (l.platform !== "darwin")
|
|
151
|
+
throw new Error("macOS only");
|
|
152
|
+
const t = r ? [] : ["-ss"], n = {};
|
|
153
|
+
o && (n.signal = o);
|
|
154
|
+
const { stdout: s } = await ie("osascript", ["-e", e, t], n);
|
|
155
|
+
return s.trim();
|
|
156
|
+
}
|
|
157
|
+
async function le(e) {
|
|
158
|
+
return ce(`tell application "Finder" to set app_path to application file id "${e}" as string
|
|
159
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
160
|
+
}
|
|
161
|
+
const me = h(B), C = {
|
|
162
|
+
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
163
|
+
// The missing `L` is correct.
|
|
164
|
+
MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
|
|
165
|
+
MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
|
|
166
|
+
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
167
|
+
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
168
|
+
ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
|
|
169
|
+
ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
|
|
170
|
+
ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
|
|
171
|
+
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
172
|
+
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
173
|
+
BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
|
|
174
|
+
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
|
|
175
|
+
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
176
|
+
OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
|
|
177
|
+
VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
|
|
178
|
+
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
|
|
179
|
+
}, fe = new Map(Object.entries(C));
|
|
180
|
+
class ue extends Error {
|
|
181
|
+
}
|
|
182
|
+
async function de(e = me) {
|
|
183
|
+
const { stdout: r } = await e("reg", [
|
|
184
|
+
"QUERY",
|
|
185
|
+
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
186
|
+
"/v",
|
|
187
|
+
"ProgId"
|
|
188
|
+
]), o = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(r);
|
|
189
|
+
if (!o)
|
|
190
|
+
throw new ue(`Cannot find Windows browser in stdout: ${JSON.stringify(r)}`);
|
|
191
|
+
const { id: t } = o.groups, n = t.lastIndexOf("."), s = t.lastIndexOf("-"), u = n === -1 ? void 0 : t.slice(0, n), d = s === -1 ? void 0 : t.slice(0, s);
|
|
192
|
+
return C[t] ?? C[u] ?? C[d] ?? { name: t, id: t };
|
|
193
|
+
}
|
|
194
|
+
const pe = h(B), we = (e) => e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (r) => r.toUpperCase());
|
|
195
|
+
async function ge() {
|
|
196
|
+
if (l.platform === "darwin") {
|
|
197
|
+
const e = await ae();
|
|
198
|
+
return { name: await le(e), id: e };
|
|
199
|
+
}
|
|
200
|
+
if (l.platform === "linux") {
|
|
201
|
+
const { stdout: e } = await pe("xdg-mime", ["query", "default", "x-scheme-handler/http"]), r = e.trim();
|
|
202
|
+
return { name: we(r.replace(/.desktop$/, "").replace("-", " ")), id: r };
|
|
203
|
+
}
|
|
204
|
+
if (l.platform === "win32")
|
|
205
|
+
return de();
|
|
206
|
+
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
207
|
+
}
|
|
208
|
+
const he = !!(l.env.SSH_CONNECTION || l.env.SSH_CLIENT || l.env.SSH_TTY), P = Symbol("fallbackAttempt"), I = import.meta.url ? k.dirname(D(import.meta.url)) : "", U = k.join(I, "xdg-open"), { platform: w, arch: H } = l, W = async (e, r) => {
|
|
209
|
+
if (e.length === 0)
|
|
210
|
+
return;
|
|
211
|
+
const o = [];
|
|
212
|
+
for (const t of e)
|
|
213
|
+
try {
|
|
214
|
+
return await r(t);
|
|
215
|
+
} catch (n) {
|
|
216
|
+
o.push(n);
|
|
217
|
+
}
|
|
218
|
+
throw new AggregateError(o, "Failed to open in all supported apps");
|
|
219
|
+
}, A = async (e) => {
|
|
220
|
+
e = {
|
|
221
|
+
wait: !1,
|
|
222
|
+
background: !1,
|
|
223
|
+
newInstance: !1,
|
|
224
|
+
allowNonzeroExitCode: !1,
|
|
225
|
+
...e
|
|
226
|
+
};
|
|
227
|
+
const r = e[P] === !0;
|
|
228
|
+
if (delete e[P], Array.isArray(e.app))
|
|
229
|
+
return W(e.app, (a) => A({
|
|
230
|
+
...e,
|
|
231
|
+
app: a,
|
|
232
|
+
[P]: !0
|
|
233
|
+
}));
|
|
234
|
+
let { name: o, arguments: t = [] } = e.app ?? {};
|
|
235
|
+
if (t = [...t], Array.isArray(o))
|
|
236
|
+
return W(o, (a) => A({
|
|
237
|
+
...e,
|
|
238
|
+
app: {
|
|
239
|
+
name: a,
|
|
240
|
+
arguments: t
|
|
241
|
+
},
|
|
242
|
+
[P]: !0
|
|
243
|
+
}));
|
|
244
|
+
if (o === "browser" || o === "browserPrivate") {
|
|
245
|
+
const a = {
|
|
246
|
+
"com.google.chrome": "chrome",
|
|
247
|
+
"google-chrome.desktop": "chrome",
|
|
248
|
+
"com.brave.browser": "brave",
|
|
249
|
+
"org.mozilla.firefox": "firefox",
|
|
250
|
+
"firefox.desktop": "firefox",
|
|
251
|
+
"com.microsoft.msedge": "edge",
|
|
252
|
+
"com.microsoft.edge": "edge",
|
|
253
|
+
"com.microsoft.edgemac": "edge",
|
|
254
|
+
"microsoft-edge.desktop": "edge",
|
|
255
|
+
"com.apple.safari": "safari"
|
|
256
|
+
}, i = {
|
|
257
|
+
chrome: "--incognito",
|
|
258
|
+
brave: "--incognito",
|
|
259
|
+
firefox: "--private-window",
|
|
260
|
+
edge: "--inPrivate"
|
|
261
|
+
// Safari doesn't support private mode via command line
|
|
262
|
+
};
|
|
263
|
+
let m;
|
|
264
|
+
if (p) {
|
|
265
|
+
const x = await te();
|
|
266
|
+
m = fe.get(x) ?? {};
|
|
267
|
+
} else
|
|
268
|
+
m = await ge();
|
|
269
|
+
if (m.id in a) {
|
|
270
|
+
const x = a[m.id.toLowerCase()];
|
|
271
|
+
if (o === "browserPrivate") {
|
|
272
|
+
if (x === "safari")
|
|
273
|
+
throw new Error("Safari doesn't support opening in private mode via command line");
|
|
274
|
+
t.push(i[x]);
|
|
275
|
+
}
|
|
276
|
+
return A({
|
|
277
|
+
...e,
|
|
278
|
+
app: {
|
|
279
|
+
name: v[x],
|
|
280
|
+
arguments: t
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
throw new Error(`${m.name} is not supported as a default browser`);
|
|
285
|
+
}
|
|
286
|
+
let n;
|
|
287
|
+
const s = [], u = {};
|
|
288
|
+
let d = !1;
|
|
289
|
+
if (p && !b() && !he && !o && (d = await oe()), w === "darwin")
|
|
290
|
+
n = "open", e.wait && s.push("--wait-apps"), e.background && s.push("--background"), e.newInstance && s.push("--new"), o && s.push("-a", o);
|
|
291
|
+
else if (w === "win32" || d) {
|
|
292
|
+
n = await M(), s.push(...f.argumentsPrefix), p || (u.windowsVerbatimArguments = !0), p && e.target && (e.target = await ne(e.target));
|
|
293
|
+
const a = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
|
|
294
|
+
e.wait && a.push("-Wait"), o ? (a.push(f.escapeArgument(o)), e.target && t.push(e.target)) : e.target && a.push(f.escapeArgument(e.target)), t.length > 0 && (t = t.map((i) => f.escapeArgument(i)), a.push("-ArgumentList", t.join(","))), e.target = f.encodeCommand(a.join(" ")), e.wait || (u.stdio = "ignore");
|
|
295
|
+
} else {
|
|
296
|
+
if (o)
|
|
297
|
+
n = o;
|
|
298
|
+
else {
|
|
299
|
+
const a = !I || I === "/";
|
|
300
|
+
let i = !1;
|
|
301
|
+
try {
|
|
302
|
+
await E.access(U, O.X_OK), i = !0;
|
|
303
|
+
} catch {
|
|
304
|
+
}
|
|
305
|
+
n = l.versions.electron ?? (w === "android" || a || !i) ? "xdg-open" : U;
|
|
306
|
+
}
|
|
307
|
+
t.length > 0 && s.push(...t), e.wait || (u.stdio = "ignore", u.detached = !0);
|
|
308
|
+
}
|
|
309
|
+
w === "darwin" && t.length > 0 && s.push("--args", ...t), e.target && s.push(e.target);
|
|
310
|
+
const c = L.spawn(n, s, u);
|
|
311
|
+
return e.wait ? new Promise((a, i) => {
|
|
312
|
+
c.once("error", i), c.once("close", (m) => {
|
|
313
|
+
if (!e.allowNonzeroExitCode && m !== 0) {
|
|
314
|
+
i(new Error(`Exited with code ${m}`));
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
a(c);
|
|
318
|
+
});
|
|
319
|
+
}) : r ? new Promise((a, i) => {
|
|
320
|
+
c.once("error", i), c.once("spawn", () => {
|
|
321
|
+
c.once("close", (m) => {
|
|
322
|
+
if (c.off("error", i), m !== 0) {
|
|
323
|
+
i(new Error(`Exited with code ${m}`));
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
c.unref(), a(c);
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
}) : (c.unref(), new Promise((a, i) => {
|
|
330
|
+
c.once("error", i), c.once("spawn", () => {
|
|
331
|
+
c.off("error", i), a(c);
|
|
332
|
+
});
|
|
333
|
+
}));
|
|
334
|
+
}, ve = (e, r) => {
|
|
335
|
+
if (typeof e != "string")
|
|
336
|
+
throw new TypeError("Expected a `target`");
|
|
337
|
+
return A({
|
|
338
|
+
...r,
|
|
339
|
+
target: e
|
|
340
|
+
});
|
|
341
|
+
};
|
|
342
|
+
function R(e) {
|
|
343
|
+
if (typeof e == "string" || Array.isArray(e))
|
|
344
|
+
return e;
|
|
345
|
+
const { [H]: r } = e;
|
|
346
|
+
if (!r)
|
|
347
|
+
throw new Error(`${H} is not supported`);
|
|
348
|
+
return r;
|
|
349
|
+
}
|
|
350
|
+
function S({ [w]: e }, { wsl: r } = {}) {
|
|
351
|
+
if (r && p)
|
|
352
|
+
return R(r);
|
|
353
|
+
if (!e)
|
|
354
|
+
throw new Error(`${w} is not supported`);
|
|
355
|
+
return R(e);
|
|
356
|
+
}
|
|
357
|
+
const v = {
|
|
358
|
+
browser: "browser",
|
|
359
|
+
browserPrivate: "browserPrivate"
|
|
360
|
+
};
|
|
361
|
+
y(v, "chrome", () => S({
|
|
362
|
+
darwin: "google chrome",
|
|
363
|
+
win32: "chrome",
|
|
364
|
+
// `chromium-browser` is the older deb package name used by Ubuntu/Debian before snap.
|
|
365
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]
|
|
366
|
+
}, {
|
|
367
|
+
wsl: {
|
|
368
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
369
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
370
|
+
}
|
|
371
|
+
}));
|
|
372
|
+
y(v, "brave", () => S({
|
|
373
|
+
darwin: "brave browser",
|
|
374
|
+
win32: "brave",
|
|
375
|
+
linux: ["brave-browser", "brave"]
|
|
376
|
+
}, {
|
|
377
|
+
wsl: {
|
|
378
|
+
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
379
|
+
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
380
|
+
}
|
|
381
|
+
}));
|
|
382
|
+
y(v, "firefox", () => S({
|
|
383
|
+
darwin: "firefox",
|
|
384
|
+
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
385
|
+
linux: "firefox"
|
|
386
|
+
}, {
|
|
387
|
+
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
388
|
+
}));
|
|
389
|
+
y(v, "edge", () => S({
|
|
390
|
+
darwin: "microsoft edge",
|
|
391
|
+
win32: "msedge",
|
|
392
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
393
|
+
}, {
|
|
394
|
+
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
395
|
+
}));
|
|
396
|
+
y(v, "safari", () => S({
|
|
397
|
+
darwin: "Safari"
|
|
398
|
+
}));
|
|
399
|
+
async function xe(e, r = {
|
|
400
|
+
startServer: K,
|
|
401
|
+
openBrowser: ve,
|
|
402
|
+
info: (...o) => console.info(...o),
|
|
403
|
+
warn: (...o) => console.warn(...o)
|
|
404
|
+
}) {
|
|
405
|
+
const o = ye(e), t = await r.startServer({
|
|
406
|
+
port: o.port ?? 43001,
|
|
407
|
+
host: o.host,
|
|
408
|
+
exitCode: 0
|
|
409
|
+
});
|
|
410
|
+
if (r.info(`[remote-console] listening on ${t.url}`), r.info("[remote-console] browser client: remoteConsoleClient.connect(console, { url })"), !!o.url)
|
|
411
|
+
try {
|
|
412
|
+
const n = Se(o.url);
|
|
413
|
+
await r.openBrowser(n), r.info(`[remote-console] opened ${n}`);
|
|
414
|
+
} catch (n) {
|
|
415
|
+
r.warn("[remote-console] failed to open browser URL, server is still running", { cause: n });
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function ye(e) {
|
|
419
|
+
const r = G(e, {
|
|
420
|
+
port: ["port", "p"],
|
|
421
|
+
host: ["host"],
|
|
422
|
+
url: ["url"]
|
|
423
|
+
}), o = r.port, t = r.host, n = r.url, s = e.slice(2).find((d) => d.startsWith("--url=") || d.startsWith("-url=")), u = s ? s.slice(s.indexOf("=") + 1) : void 0;
|
|
424
|
+
return {
|
|
425
|
+
port: typeof o == "string" ? Number(o) : void 0,
|
|
426
|
+
host: typeof t == "string" ? t : void 0,
|
|
427
|
+
url: u ?? (typeof n == "string" ? n : void 0)
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function Se(e) {
|
|
431
|
+
try {
|
|
432
|
+
const r = new URL(e);
|
|
433
|
+
return r.searchParams.set("__remote_console__", "1"), r.toString();
|
|
434
|
+
} catch (r) {
|
|
435
|
+
throw new Error(
|
|
436
|
+
"[composeRemoteConsoleActivationUrl] Invalid --url value: expected absolute URL",
|
|
437
|
+
{
|
|
438
|
+
cause: r
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
await xe(process.argv);
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { existsSync as E, readdirSync as D, statSync as m, mkdirSync as F, writeFileSync as P, readFileSync as C } from "node:fs";
|
|
2
|
+
import { join as u, sep as L } from "node:path";
|
|
3
|
+
import { fileURLToPath as v } from "node:url";
|
|
4
|
+
import { l as O } from "./services-CaLOhuLV.js";
|
|
5
|
+
import { p as x } from "./shared-Bjy30TeM.js";
|
|
6
|
+
class I {
|
|
7
|
+
/** @purpose List of all synced file entries. */
|
|
8
|
+
entries;
|
|
9
|
+
/**
|
|
10
|
+
* @purpose Construct a SyncResult from a list of entries.
|
|
11
|
+
* @param entries File entries.
|
|
12
|
+
*/
|
|
13
|
+
constructor(t) {
|
|
14
|
+
this.entries = t;
|
|
15
|
+
}
|
|
16
|
+
/** @purpose Files with status "added". | @returns Array of added entries. */
|
|
17
|
+
get added() {
|
|
18
|
+
return this.entries.filter((t) => t.status === "added");
|
|
19
|
+
}
|
|
20
|
+
/** @purpose Files with status "updated". | @returns Array of updated entries. */
|
|
21
|
+
get updated() {
|
|
22
|
+
return this.entries.filter((t) => t.status === "updated");
|
|
23
|
+
}
|
|
24
|
+
/** @purpose Files with status "unchanged". | @returns Array of unchanged entries. */
|
|
25
|
+
get unchanged() {
|
|
26
|
+
return this.entries.filter((t) => t.status === "unchanged");
|
|
27
|
+
}
|
|
28
|
+
/** @purpose Human-readable summary of added/updated/unchanged counts. | @returns Summary string. */
|
|
29
|
+
get summary() {
|
|
30
|
+
const t = this.added.length, n = this.updated.length, c = this.unchanged.length;
|
|
31
|
+
return `Synced: ${t} added, ${n} updated, ${c} skipped (unchanged)`;
|
|
32
|
+
}
|
|
33
|
+
/** @purpose Dry-run summary message. | @returns Dry-run message. */
|
|
34
|
+
get dryRunSummary() {
|
|
35
|
+
return "Dry-run: no files written.";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const w = "ERR_SYNC_SUBDIR_NOT_FOUND", T = "ERR_SYNC_SOURCE_NOT_FOUND", S = "ai/directives", N = /* @__PURE__ */ new Set([
|
|
39
|
+
"architecture",
|
|
40
|
+
"dbc-audit.directive.xml",
|
|
41
|
+
"dev-review.directive.xml",
|
|
42
|
+
"semantic-change-extractor.directive.xml"
|
|
43
|
+
]);
|
|
44
|
+
function B(e) {
|
|
45
|
+
const t = u(e, "node_modules", "gennady", S);
|
|
46
|
+
if (E(t)) return t;
|
|
47
|
+
try {
|
|
48
|
+
const n = import.meta.resolve("gennady"), s = v(n).replace(/[/\\]dist[/\\].*$/, ""), r = u(s, S);
|
|
49
|
+
if (E(r)) return r;
|
|
50
|
+
} catch {
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
function b(e, t) {
|
|
55
|
+
if (t && t.length > 0) {
|
|
56
|
+
const c = D(e).filter(
|
|
57
|
+
(r) => !N.has(r) && m(u(e, r)).isDirectory()
|
|
58
|
+
);
|
|
59
|
+
for (const r of t)
|
|
60
|
+
if (!c.includes(r)) {
|
|
61
|
+
const o = `ai/directives/${r}/ not found in package.
|
|
62
|
+
Available: ${c.join(", ")}`, i = new Error(o);
|
|
63
|
+
throw i.code = w, i;
|
|
64
|
+
}
|
|
65
|
+
const s = [];
|
|
66
|
+
for (const r of t)
|
|
67
|
+
y(u(e, r), r, s);
|
|
68
|
+
return s.sort();
|
|
69
|
+
}
|
|
70
|
+
const n = [];
|
|
71
|
+
return y(e, "", n), n.sort();
|
|
72
|
+
}
|
|
73
|
+
function y(e, t, n) {
|
|
74
|
+
let c;
|
|
75
|
+
try {
|
|
76
|
+
c = D(e);
|
|
77
|
+
} catch {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
for (const s of c) {
|
|
81
|
+
if (s.startsWith(".") || N.has(s)) continue;
|
|
82
|
+
const r = u(e, s), o = t ? u(t, s) : s, i = m(r, { throwIfNoEntry: !1 });
|
|
83
|
+
i && (i.isDirectory() ? y(r, o, n) : i.isFile() && n.push(o.split(L).join("/")));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function W(e, t) {
|
|
87
|
+
try {
|
|
88
|
+
e.stat(t.sourceDir);
|
|
89
|
+
} catch {
|
|
90
|
+
const s = `Source directory not found: ${t.sourceDir}`, r = new Error(s);
|
|
91
|
+
throw r.code = T, r;
|
|
92
|
+
}
|
|
93
|
+
const n = b(t.sourceDir, t.subdirs), c = [];
|
|
94
|
+
for (const s of n) {
|
|
95
|
+
const r = u(t.sourceDir, s), o = u(t.targetDir, s), i = e.readFile(r), l = i.length;
|
|
96
|
+
let d = null;
|
|
97
|
+
try {
|
|
98
|
+
d = e.readFile(o);
|
|
99
|
+
} catch {
|
|
100
|
+
}
|
|
101
|
+
let a;
|
|
102
|
+
d === null ? a = "added" : Buffer.compare(i, d) === 0 ? a = "unchanged" : a = "updated", c.push({
|
|
103
|
+
relativePath: s,
|
|
104
|
+
status: a,
|
|
105
|
+
sourceSize: l,
|
|
106
|
+
targetSize: d?.length
|
|
107
|
+
}), !t.dryRun && a !== "unchanged" && (e.mkdir(u(t.targetDir, s, ".."), { recursive: !0 }), e.writeFile(o, i));
|
|
108
|
+
}
|
|
109
|
+
return new I(c);
|
|
110
|
+
}
|
|
111
|
+
const K = "+", Y = "~", j = "=", G = "(unchanged)", H = "(would add)", M = "(would update)", z = "(unchanged, skip)";
|
|
112
|
+
function V(e, t = {}) {
|
|
113
|
+
const n = [];
|
|
114
|
+
for (const o of e) {
|
|
115
|
+
const { relativePath: i, status: l } = o;
|
|
116
|
+
let d, a;
|
|
117
|
+
l === "added" ? (d = K, a = t.dryRun ? H : "") : l === "updated" ? (d = Y, a = t.dryRun ? M : "") : (d = j, a = t.dryRun ? z : G);
|
|
118
|
+
const g = i.padEnd(64);
|
|
119
|
+
a ? n.push(` ${d} ${g} ${a}`) : n.push(` ${d} ${i}`);
|
|
120
|
+
}
|
|
121
|
+
const c = e.filter((o) => o.status === "added").length, s = e.filter((o) => o.status === "updated").length, r = e.filter((o) => o.status === "unchanged").length;
|
|
122
|
+
return t.dryRun ? n.push("Dry-run: no files written.") : n.push(`Synced: ${c} added, ${s} updated, ${r} skipped (unchanged)`), n;
|
|
123
|
+
}
|
|
124
|
+
function X(e, t, n, c) {
|
|
125
|
+
n.write(`Sync${t ? " (dry-run)" : ""}: ${c}
|
|
126
|
+
`);
|
|
127
|
+
const s = V(e, { dryRun: t });
|
|
128
|
+
for (const r of s)
|
|
129
|
+
n.write(r + `
|
|
130
|
+
`);
|
|
131
|
+
}
|
|
132
|
+
function A(e, t) {
|
|
133
|
+
const n = C, c = P, s = F, r = m, o = D, i = B, l = process.stdout, d = process.stderr, a = x(e, {
|
|
134
|
+
dryRun: ["dry-run"]
|
|
135
|
+
}), g = a.dryRun === !0 || a.dryRun === "true", _ = a._.filter(
|
|
136
|
+
(f) => typeof f == "string" && f !== "sync"
|
|
137
|
+
), p = process.cwd(), R = i(p);
|
|
138
|
+
if (!R)
|
|
139
|
+
return d.write(`Error: gennady package not found. Install it locally: npm i -D gennady
|
|
140
|
+
`), 1;
|
|
141
|
+
const U = u(p, "ai", "directives"), $ = {
|
|
142
|
+
sourceDir: R,
|
|
143
|
+
targetDir: U,
|
|
144
|
+
subdirs: _.length > 0 ? _ : void 0,
|
|
145
|
+
dryRun: g
|
|
146
|
+
};
|
|
147
|
+
try {
|
|
148
|
+
const h = W({
|
|
149
|
+
readFile: n,
|
|
150
|
+
writeFile: c,
|
|
151
|
+
mkdir: s,
|
|
152
|
+
stat: (k) => r(k),
|
|
153
|
+
readdir: o,
|
|
154
|
+
cwd: p
|
|
155
|
+
}, $);
|
|
156
|
+
return X(h.entries, g, l, p), 0;
|
|
157
|
+
} catch (f) {
|
|
158
|
+
const h = f;
|
|
159
|
+
if (h.code === w)
|
|
160
|
+
return d.write(`Error: ${h.message}
|
|
161
|
+
`), 1;
|
|
162
|
+
throw h;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (process.argv[1]) {
|
|
166
|
+
const e = v(import.meta.url);
|
|
167
|
+
if (e === process.argv[1] || e.endsWith(process.argv[1]))
|
|
168
|
+
try {
|
|
169
|
+
const t = A(process.argv);
|
|
170
|
+
process.exit(t);
|
|
171
|
+
} catch (t) {
|
|
172
|
+
const n = new Error("[syncCmd] Self-execution failed", { cause: t });
|
|
173
|
+
O.error("[syncCmd#run] [self-executing → failed]", { error: n }), process.exit(1);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
A(process.argv);
|