mustflow 1.15.97
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/LICENSE +16 -0
- package/README.md +422 -0
- package/dist/cli/commands/check.js +73 -0
- package/dist/cli/commands/classify.js +104 -0
- package/dist/cli/commands/context.js +95 -0
- package/dist/cli/commands/contract-lint.js +74 -0
- package/dist/cli/commands/dashboard.js +654 -0
- package/dist/cli/commands/docs.js +382 -0
- package/dist/cli/commands/doctor.js +232 -0
- package/dist/cli/commands/explain.js +293 -0
- package/dist/cli/commands/help.js +148 -0
- package/dist/cli/commands/impact.js +120 -0
- package/dist/cli/commands/index.js +70 -0
- package/dist/cli/commands/init.js +986 -0
- package/dist/cli/commands/line-endings.js +102 -0
- package/dist/cli/commands/map.js +95 -0
- package/dist/cli/commands/run.js +442 -0
- package/dist/cli/commands/search.js +166 -0
- package/dist/cli/commands/status.js +65 -0
- package/dist/cli/commands/update.js +443 -0
- package/dist/cli/commands/verify.js +448 -0
- package/dist/cli/commands/version-sources.js +79 -0
- package/dist/cli/commands/version.js +57 -0
- package/dist/cli/i18n/en.js +702 -0
- package/dist/cli/i18n/es.js +702 -0
- package/dist/cli/i18n/fr.js +702 -0
- package/dist/cli/i18n/hi.js +702 -0
- package/dist/cli/i18n/ko.js +702 -0
- package/dist/cli/i18n/zh.js +702 -0
- package/dist/cli/index.js +218 -0
- package/dist/cli/lib/agent-context.js +342 -0
- package/dist/cli/lib/browser-open.js +58 -0
- package/dist/cli/lib/cli-output.js +36 -0
- package/dist/cli/lib/command-contract.js +1 -0
- package/dist/cli/lib/command-registry.js +107 -0
- package/dist/cli/lib/dashboard-html.js +1866 -0
- package/dist/cli/lib/dashboard-locale.js +309 -0
- package/dist/cli/lib/dashboard-preferences.js +405 -0
- package/dist/cli/lib/doc-review-ledger.js +226 -0
- package/dist/cli/lib/filesystem.js +125 -0
- package/dist/cli/lib/git-changes.js +13 -0
- package/dist/cli/lib/i18n.js +55 -0
- package/dist/cli/lib/local-index.js +1014 -0
- package/dist/cli/lib/locale-tags.js +4 -0
- package/dist/cli/lib/manifest-lock.js +131 -0
- package/dist/cli/lib/npm-version-check.js +97 -0
- package/dist/cli/lib/package-info.js +13 -0
- package/dist/cli/lib/preferences-options.js +8 -0
- package/dist/cli/lib/project-root.js +23 -0
- package/dist/cli/lib/repo-map.js +635 -0
- package/dist/cli/lib/reporter.js +8 -0
- package/dist/cli/lib/run-receipt.js +1 -0
- package/dist/cli/lib/template-i18n.js +265 -0
- package/dist/cli/lib/templates.js +188 -0
- package/dist/cli/lib/toml.js +1 -0
- package/dist/cli/lib/validation.js +1639 -0
- package/dist/cli/lib/version-sources.js +1 -0
- package/dist/core/authority-resolution.js +155 -0
- package/dist/core/change-classification.js +122 -0
- package/dist/core/change-verification.js +80 -0
- package/dist/core/check-issues.js +67 -0
- package/dist/core/command-classification.js +22 -0
- package/dist/core/command-contract-rules.js +27 -0
- package/dist/core/command-contract-validation.js +197 -0
- package/dist/core/command-cwd.js +12 -0
- package/dist/core/command-effects.js +182 -0
- package/dist/core/command-explanation.js +135 -0
- package/dist/core/command-intent-eligibility.js +76 -0
- package/dist/core/config-loading.js +54 -0
- package/dist/core/contract-lint.js +110 -0
- package/dist/core/contract-models.js +53 -0
- package/dist/core/dashboard-verification.js +132 -0
- package/dist/core/doc-review-triage.js +92 -0
- package/dist/core/line-endings.js +144 -0
- package/dist/core/public-json-contracts.js +112 -0
- package/dist/core/public-surface-explanation.js +49 -0
- package/dist/core/release-version-validation.js +53 -0
- package/dist/core/retention-explanation.js +74 -0
- package/dist/core/retention-policy.js +57 -0
- package/dist/core/run-receipt.js +77 -0
- package/dist/core/skill-route-alignment.js +100 -0
- package/dist/core/skill-route-explanation.js +117 -0
- package/dist/core/source-anchor-explanation.js +33 -0
- package/dist/core/source-anchor-status.js +269 -0
- package/dist/core/source-anchor-symbols.js +181 -0
- package/dist/core/source-anchor-validation.js +158 -0
- package/dist/core/source-anchors.js +194 -0
- package/dist/core/surface-decision-model.js +18 -0
- package/dist/core/toml.js +11 -0
- package/dist/core/verification-plan.js +41 -0
- package/dist/core/verification-scheduler.js +92 -0
- package/dist/core/version-impact.js +54 -0
- package/dist/core/version-sources.js +235 -0
- package/dist/core/version-sync-policy.js +85 -0
- package/examples/README.md +13 -0
- package/examples/docs-only/README.md +72 -0
- package/examples/host-instruction-conflicts/README.md +47 -0
- package/examples/minimal-js/README.md +98 -0
- package/examples/missing-command-contracts/README.md +70 -0
- package/examples/nested-repos/README.md +62 -0
- package/package.json +80 -0
- package/schemas/README.md +32 -0
- package/schemas/change-verification-report.schema.json +319 -0
- package/schemas/classify-report.schema.json +113 -0
- package/schemas/commands.schema.json +116 -0
- package/schemas/context-report.schema.json +341 -0
- package/schemas/contract-lint-report.schema.json +61 -0
- package/schemas/docs-review-list.schema.json +72 -0
- package/schemas/doctor-report.schema.json +175 -0
- package/schemas/explain-report.schema.json +471 -0
- package/schemas/impact-report.schema.json +121 -0
- package/schemas/line-endings-report.schema.json +63 -0
- package/schemas/run-receipt.schema.json +75 -0
- package/schemas/verify-report.schema.json +67 -0
- package/schemas/version-sources-report.schema.json +42 -0
- package/templates/default/common/.mustflow/config/commands.toml +251 -0
- package/templates/default/common/.mustflow/config/mustflow.toml +424 -0
- package/templates/default/common/.mustflow/config/preferences.toml +125 -0
- package/templates/default/common/gitignore.mustflow +9 -0
- package/templates/default/i18n.toml +483 -0
- package/templates/default/locales/en/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/en/.mustflow/context/PROJECT.md +66 -0
- package/templates/default/locales/en/.mustflow/docs/agent-workflow.md +345 -0
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/en/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/en/.mustflow/skills/artifact-integrity-check/SKILL.md +121 -0
- package/templates/default/locales/en/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/en/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/en/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/en/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/en/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/en/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/en/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/diff-risk-review/SKILL.md +143 -0
- package/templates/default/locales/en/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/en/.mustflow/skills/docs-update/SKILL.md +100 -0
- package/templates/default/locales/en/.mustflow/skills/external-prompt-injection-defense/SKILL.md +124 -0
- package/templates/default/locales/en/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/en/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/en/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/en/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/en/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/en/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/en/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/en/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/en/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/en/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/en/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/en/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/en/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/en/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/en/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/en/.mustflow/skills/security-privacy-review/SKILL.md +130 -0
- package/templates/default/locales/en/.mustflow/skills/security-regression-tests/SKILL.md +157 -0
- package/templates/default/locales/en/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/en/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/en/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/en/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/en/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/en/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/en/.mustflow/skills/ui-quality-gate/SKILL.md +119 -0
- package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/en/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/en/AGENTS.md +114 -0
- package/templates/default/locales/es/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/es/.mustflow/context/PROJECT.md +63 -0
- package/templates/default/locales/es/.mustflow/docs/agent-workflow.md +365 -0
- package/templates/default/locales/es/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/es/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/es/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/es/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/es/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/es/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/es/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/es/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/es/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/es/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/es/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/es/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/es/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/es/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/es/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/es/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/es/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/es/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/es/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/es/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/es/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/es/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/es/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/es/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/es/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/es/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/es/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/es/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/es/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/es/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/es/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/es/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/es/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/es/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/es/AGENTS.md +83 -0
- package/templates/default/locales/fr/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/fr/.mustflow/context/PROJECT.md +63 -0
- package/templates/default/locales/fr/.mustflow/docs/agent-workflow.md +368 -0
- package/templates/default/locales/fr/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/fr/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/fr/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/fr/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/fr/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/fr/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/fr/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/fr/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/fr/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/fr/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/fr/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/fr/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/fr/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/fr/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/fr/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/fr/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/fr/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/fr/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/fr/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/fr/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/fr/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/fr/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/fr/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/fr/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/fr/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/fr/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/fr/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/fr/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/fr/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/fr/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/fr/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/fr/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/fr/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/fr/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/fr/AGENTS.md +84 -0
- package/templates/default/locales/hi/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/hi/.mustflow/context/PROJECT.md +65 -0
- package/templates/default/locales/hi/.mustflow/docs/agent-workflow.md +359 -0
- package/templates/default/locales/hi/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/hi/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/hi/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/hi/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/hi/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/hi/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/hi/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/hi/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/hi/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/hi/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/hi/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/hi/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/hi/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/hi/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/hi/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/hi/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/hi/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/hi/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/hi/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/hi/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/hi/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/hi/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/hi/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/hi/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/hi/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/hi/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/hi/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/hi/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/hi/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/hi/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/hi/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/hi/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/hi/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/hi/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/hi/AGENTS.md +83 -0
- package/templates/default/locales/ko/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/ko/.mustflow/context/PROJECT.md +66 -0
- package/templates/default/locales/ko/.mustflow/docs/agent-workflow.md +506 -0
- package/templates/default/locales/ko/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/ko/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/ko/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/ko/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/ko/.mustflow/skills/code-review/SKILL.md +118 -0
- package/templates/default/locales/ko/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/ko/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/ko/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/ko/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/ko/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/ko/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/ko/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/ko/.mustflow/skills/docs-update/SKILL.md +107 -0
- package/templates/default/locales/ko/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/ko/.mustflow/skills/failure-triage/SKILL.md +119 -0
- package/templates/default/locales/ko/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/ko/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/ko/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/ko/.mustflow/skills/multi-agent-work-coordination/SKILL.md +259 -0
- package/templates/default/locales/ko/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/ko/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/ko/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/ko/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/ko/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/ko/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/ko/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/ko/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/ko/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/ko/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/ko/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/ko/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/ko/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/ko/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/ko/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/ko/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/ko/.mustflow/skills/test-maintenance/SKILL.md +130 -0
- package/templates/default/locales/ko/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/ko/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/ko/AGENTS.md +85 -0
- package/templates/default/locales/zh/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/zh/.mustflow/context/PROJECT.md +64 -0
- package/templates/default/locales/zh/.mustflow/docs/agent-workflow.md +310 -0
- package/templates/default/locales/zh/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/zh/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/zh/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/zh/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/zh/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/zh/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/zh/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/zh/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/zh/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/zh/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/zh/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/zh/.mustflow/skills/failure-triage/SKILL.md +96 -0
- package/templates/default/locales/zh/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/zh/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/zh/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/zh/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/zh/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/zh/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/zh/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/zh/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/zh/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/zh/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/zh/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/zh/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/zh/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/zh/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/zh/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/zh/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/zh/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/zh/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/zh/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/zh/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/zh/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/zh/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/zh/AGENTS.md +86 -0
- package/templates/default/manifest.toml +339 -0
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import http from 'node:http';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { openPathInFileManager, openUrlInBrowser } from '../lib/browser-open.js';
|
|
6
|
+
import { printUsageError, renderHelp } from '../lib/cli-output.js';
|
|
7
|
+
import { renderDashboardHtml } from '../lib/dashboard-html.js';
|
|
8
|
+
import { DASHBOARD_VERIFICATION_MAX_FILE_MATCHES, createDashboardVerificationSnapshot, } from '../../core/dashboard-verification.js';
|
|
9
|
+
import { parseSkillIndexRoutes } from '../../core/skill-route-alignment.js';
|
|
10
|
+
import { getAgentContext } from '../lib/agent-context.js';
|
|
11
|
+
import { readGitChangedFiles } from '../lib/git-changes.js';
|
|
12
|
+
import { isRecord, readCommandContract, readPositiveInteger, readString, readStringArray, } from '../lib/command-contract.js';
|
|
13
|
+
import { readDashboardPreferences, updateDashboardPreferences, } from '../lib/dashboard-preferences.js';
|
|
14
|
+
import { DOC_REVIEW_LEDGER_RELATIVE_PATH, isDocReviewStatus, isReviewerKind, listDocReviewEntries, markDocReviewEntry, } from '../lib/doc-review-ledger.js';
|
|
15
|
+
import { inspectManifestLock } from '../lib/manifest-lock.js';
|
|
16
|
+
import { readPackageMetadata } from '../lib/package-info.js';
|
|
17
|
+
import { t } from '../lib/i18n.js';
|
|
18
|
+
import { resolveMustflowRoot } from '../lib/project-root.js';
|
|
19
|
+
import { detectVersionSources } from '../../core/version-sources.js';
|
|
20
|
+
import { planUpdate, summarizePlan } from './update.js';
|
|
21
|
+
const DEFAULT_DASHBOARD_HOST = '127.0.0.1';
|
|
22
|
+
const DEFAULT_DASHBOARD_PORT = 0;
|
|
23
|
+
const MAX_REQUEST_BYTES = 64 * 1024;
|
|
24
|
+
const LOCAL_DASHBOARD_HOSTS = new Set(['127.0.0.1', 'localhost', '::1']);
|
|
25
|
+
const RELEASE_FILE_PATTERNS = [
|
|
26
|
+
/^package\.json$/u,
|
|
27
|
+
/^bun\.lockb?$/u,
|
|
28
|
+
/^templates\//u,
|
|
29
|
+
/^schemas\//u,
|
|
30
|
+
/^src\/cli\/lib\/package-info\.ts$/u,
|
|
31
|
+
/^src\/cli\/lib\/version-sources\.ts$/u,
|
|
32
|
+
];
|
|
33
|
+
const SKILL_INDEX_RELATIVE_PATH = '.mustflow/skills/INDEX.md';
|
|
34
|
+
const LATEST_RUN_RELATIVE_PATH = '.mustflow/state/runs/latest.json';
|
|
35
|
+
function readFrontmatterLines(content) {
|
|
36
|
+
if (!content.startsWith('---')) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
const end = content.indexOf('\n---', 3);
|
|
40
|
+
if (end < 0) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
return content.slice(3, end).split(/\r?\n/u);
|
|
44
|
+
}
|
|
45
|
+
function readFrontmatterList(content, key) {
|
|
46
|
+
const lines = readFrontmatterLines(content);
|
|
47
|
+
const values = [];
|
|
48
|
+
let keyIndent;
|
|
49
|
+
for (const line of lines) {
|
|
50
|
+
const keyMatch = /^(\s*)([^:#]+):\s*$/u.exec(line);
|
|
51
|
+
if (keyMatch) {
|
|
52
|
+
keyIndent = keyMatch[2].trim() === key ? keyMatch[1].length : undefined;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (keyIndent === undefined) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const valueMatch = /^(\s*)-\s*(.+?)\s*$/u.exec(line);
|
|
59
|
+
if (!valueMatch || valueMatch[1].length <= keyIndent) {
|
|
60
|
+
keyIndent = undefined;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
values.push(valueMatch[2].trim().replace(/^["']|["']$/gu, ''));
|
|
64
|
+
}
|
|
65
|
+
return values;
|
|
66
|
+
}
|
|
67
|
+
function skillNameFromPath(skillPath) {
|
|
68
|
+
const match = /^\.mustflow\/skills\/([^/]+)\/SKILL\.md$/u.exec(skillPath);
|
|
69
|
+
return match?.[1] ?? skillPath;
|
|
70
|
+
}
|
|
71
|
+
export function getDashboardHelp(lang = 'en') {
|
|
72
|
+
return renderHelp({
|
|
73
|
+
usage: 'mf dashboard [options]',
|
|
74
|
+
summary: t(lang, 'dashboard.help.summary'),
|
|
75
|
+
options: [
|
|
76
|
+
{ label: '--host <host>', description: t(lang, 'dashboard.help.option.host') },
|
|
77
|
+
{ label: '--port <port>', description: t(lang, 'dashboard.help.option.port') },
|
|
78
|
+
{ label: '--open', description: t(lang, 'dashboard.help.option.open') },
|
|
79
|
+
{ label: '--no-open', description: t(lang, 'dashboard.help.option.noOpen') },
|
|
80
|
+
{ label: '--json', description: t(lang, 'cli.option.json') },
|
|
81
|
+
{ label: '-h, --help', description: t(lang, 'cli.option.help') },
|
|
82
|
+
],
|
|
83
|
+
examples: ['mf dashboard', 'mf dashboard --open', 'mf dashboard --port 4173', 'mf dashboard --json'],
|
|
84
|
+
exitCodes: [
|
|
85
|
+
{
|
|
86
|
+
label: '0',
|
|
87
|
+
description: t(lang, 'dashboard.help.exit.ok'),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: '1',
|
|
91
|
+
description: t(lang, 'dashboard.help.exit.fail'),
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
}, lang);
|
|
95
|
+
}
|
|
96
|
+
function parseDashboardOptions(args, lang) {
|
|
97
|
+
let host = DEFAULT_DASHBOARD_HOST;
|
|
98
|
+
let port = DEFAULT_DASHBOARD_PORT;
|
|
99
|
+
let json = false;
|
|
100
|
+
let openBrowser = false;
|
|
101
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
102
|
+
const arg = args[index];
|
|
103
|
+
if (!arg) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (arg === '--json') {
|
|
107
|
+
json = true;
|
|
108
|
+
openBrowser = false;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (arg === '--open') {
|
|
112
|
+
openBrowser = true;
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (arg === '--no-open') {
|
|
116
|
+
openBrowser = false;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (arg === '--host') {
|
|
120
|
+
const value = args[index + 1];
|
|
121
|
+
if (!value || value.startsWith('-')) {
|
|
122
|
+
return { error: t(lang, 'cli.error.missingValue', { option: '--host' }) };
|
|
123
|
+
}
|
|
124
|
+
host = value;
|
|
125
|
+
index += 1;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (arg.startsWith('--host=')) {
|
|
129
|
+
host = arg.slice('--host='.length);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (arg === '--port') {
|
|
133
|
+
const value = args[index + 1];
|
|
134
|
+
if (!value || value.startsWith('-')) {
|
|
135
|
+
return { error: t(lang, 'cli.error.missingValue', { option: '--port' }) };
|
|
136
|
+
}
|
|
137
|
+
const parsedPort = Number(value);
|
|
138
|
+
if (!Number.isInteger(parsedPort) || parsedPort < 0 || parsedPort > 65_535) {
|
|
139
|
+
return { error: t(lang, 'dashboard.error.invalidPort', { port: value }) };
|
|
140
|
+
}
|
|
141
|
+
port = parsedPort;
|
|
142
|
+
index += 1;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (arg.startsWith('--port=')) {
|
|
146
|
+
const value = arg.slice('--port='.length);
|
|
147
|
+
const parsedPort = Number(value);
|
|
148
|
+
if (!Number.isInteger(parsedPort) || parsedPort < 0 || parsedPort > 65_535) {
|
|
149
|
+
return { error: t(lang, 'dashboard.error.invalidPort', { port: value }) };
|
|
150
|
+
}
|
|
151
|
+
port = parsedPort;
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (arg.startsWith('-')) {
|
|
155
|
+
return { error: t(lang, 'cli.error.unknownOption', { option: arg }) };
|
|
156
|
+
}
|
|
157
|
+
return { error: t(lang, 'cli.error.unexpectedArgument', { argument: arg }) };
|
|
158
|
+
}
|
|
159
|
+
if (!LOCAL_DASHBOARD_HOSTS.has(host)) {
|
|
160
|
+
return { error: t(lang, 'dashboard.error.nonLocalHost', { host }) };
|
|
161
|
+
}
|
|
162
|
+
if (json) {
|
|
163
|
+
openBrowser = false;
|
|
164
|
+
}
|
|
165
|
+
return { options: { host, port, json, openBrowser } };
|
|
166
|
+
}
|
|
167
|
+
function sendJson(response, statusCode, value) {
|
|
168
|
+
response.writeHead(statusCode, {
|
|
169
|
+
'cache-control': 'no-store',
|
|
170
|
+
'content-type': 'application/json; charset=utf-8',
|
|
171
|
+
});
|
|
172
|
+
response.end(JSON.stringify(value));
|
|
173
|
+
}
|
|
174
|
+
function sendText(response, statusCode, value) {
|
|
175
|
+
response.writeHead(statusCode, {
|
|
176
|
+
'cache-control': 'no-store',
|
|
177
|
+
'content-type': 'text/plain; charset=utf-8',
|
|
178
|
+
});
|
|
179
|
+
response.end(value);
|
|
180
|
+
}
|
|
181
|
+
function sendBadRequest(response) {
|
|
182
|
+
sendText(response, 400, 'Bad request');
|
|
183
|
+
}
|
|
184
|
+
function isAuthorized(request, token) {
|
|
185
|
+
return request.headers['x-mustflow-dashboard-token'] === token;
|
|
186
|
+
}
|
|
187
|
+
async function readRequestJson(request) {
|
|
188
|
+
const chunks = [];
|
|
189
|
+
let totalBytes = 0;
|
|
190
|
+
for await (const chunk of request) {
|
|
191
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
192
|
+
totalBytes += buffer.byteLength;
|
|
193
|
+
if (totalBytes > MAX_REQUEST_BYTES) {
|
|
194
|
+
throw new Error('Request body is too large.');
|
|
195
|
+
}
|
|
196
|
+
chunks.push(buffer);
|
|
197
|
+
}
|
|
198
|
+
const rawBody = Buffer.concat(chunks).toString('utf8');
|
|
199
|
+
return rawBody.trim().length === 0 ? {} : JSON.parse(rawBody);
|
|
200
|
+
}
|
|
201
|
+
function readUpdatePayload(value) {
|
|
202
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
203
|
+
throw new Error('Request body must be a JSON object.');
|
|
204
|
+
}
|
|
205
|
+
const updates = value.updates;
|
|
206
|
+
if (!Array.isArray(updates)) {
|
|
207
|
+
throw new Error('Request body must include an updates array.');
|
|
208
|
+
}
|
|
209
|
+
return updates.map((entry) => {
|
|
210
|
+
if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) {
|
|
211
|
+
throw new Error('Each update must be a JSON object.');
|
|
212
|
+
}
|
|
213
|
+
const update = entry;
|
|
214
|
+
if (typeof update.id !== 'string' || update.id.trim().length === 0) {
|
|
215
|
+
throw new Error('Each update must include an id.');
|
|
216
|
+
}
|
|
217
|
+
return { id: update.id, value: update.value };
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
function readOptionalStringField(value, key) {
|
|
221
|
+
const field = value[key];
|
|
222
|
+
return typeof field === 'string' && field.trim().length > 0 ? field.trim() : undefined;
|
|
223
|
+
}
|
|
224
|
+
function readRequiredStringField(value, key) {
|
|
225
|
+
const field = readOptionalStringField(value, key);
|
|
226
|
+
if (!field) {
|
|
227
|
+
throw new Error(`${key} is required.`);
|
|
228
|
+
}
|
|
229
|
+
return field;
|
|
230
|
+
}
|
|
231
|
+
function readDocReviewPayload(value) {
|
|
232
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
233
|
+
throw new Error('Request body must be a JSON object.');
|
|
234
|
+
}
|
|
235
|
+
const payload = value;
|
|
236
|
+
const status = readRequiredStringField(payload, 'status');
|
|
237
|
+
if (status !== 'approved' && status !== 'needs_human' && status !== 'ignored') {
|
|
238
|
+
throw new Error('status must be approved, needs_human, or ignored.');
|
|
239
|
+
}
|
|
240
|
+
const reviewerKind = readRequiredStringField(payload, 'reviewerKind');
|
|
241
|
+
if (!isReviewerKind(reviewerKind)) {
|
|
242
|
+
throw new Error('reviewerKind must be human, llm, tool, or external.');
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
path: readRequiredStringField(payload, 'path'),
|
|
246
|
+
status,
|
|
247
|
+
reviewerKind,
|
|
248
|
+
reviewerId: readRequiredStringField(payload, 'reviewerId'),
|
|
249
|
+
reviewerLabel: readOptionalStringField(payload, 'reviewerLabel'),
|
|
250
|
+
reviewerProvider: readOptionalStringField(payload, 'reviewerProvider'),
|
|
251
|
+
reviewerModel: readOptionalStringField(payload, 'reviewerModel'),
|
|
252
|
+
reviewerCommandIntent: readOptionalStringField(payload, 'reviewerCommandIntent'),
|
|
253
|
+
summary: readOptionalStringField(payload, 'summary'),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function renderDocReviewResponse(projectRoot, requestUrl) {
|
|
257
|
+
const status = requestUrl.searchParams.get('status');
|
|
258
|
+
if (status && !isDocReviewStatus(status)) {
|
|
259
|
+
throw new Error('Invalid review status.');
|
|
260
|
+
}
|
|
261
|
+
const documents = listDocReviewEntries(projectRoot, {
|
|
262
|
+
includeAll: requestUrl.searchParams.get('all') === '1',
|
|
263
|
+
status: status,
|
|
264
|
+
});
|
|
265
|
+
return {
|
|
266
|
+
schema_version: '1',
|
|
267
|
+
command: 'docs review list',
|
|
268
|
+
ledger_path: DOC_REVIEW_LEDGER_RELATIVE_PATH,
|
|
269
|
+
count: documents.length,
|
|
270
|
+
documents,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function readDashboardCommandContract(projectRoot) {
|
|
274
|
+
try {
|
|
275
|
+
return readCommandContract(projectRoot);
|
|
276
|
+
}
|
|
277
|
+
catch {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function renderCommandContractResponse(contract) {
|
|
282
|
+
if (!contract) {
|
|
283
|
+
return {
|
|
284
|
+
path: '.mustflow/config/commands.toml',
|
|
285
|
+
exists: false,
|
|
286
|
+
intents: [],
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
const intents = Object.entries(contract.intents)
|
|
290
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
291
|
+
.flatMap(([name, intent]) => {
|
|
292
|
+
if (!isRecord(intent)) {
|
|
293
|
+
return [];
|
|
294
|
+
}
|
|
295
|
+
const status = readString(intent, 'status') ?? 'unknown';
|
|
296
|
+
const lifecycle = readString(intent, 'lifecycle') ?? null;
|
|
297
|
+
const runPolicy = readString(intent, 'run_policy') ?? null;
|
|
298
|
+
const stdin = readString(intent, 'stdin') ?? null;
|
|
299
|
+
const timeoutSeconds = readPositiveInteger(intent, 'timeout_seconds') ?? null;
|
|
300
|
+
const runnable = status === 'configured' &&
|
|
301
|
+
lifecycle === 'oneshot' &&
|
|
302
|
+
runPolicy === 'agent_allowed' &&
|
|
303
|
+
stdin === 'closed' &&
|
|
304
|
+
timeoutSeconds !== null &&
|
|
305
|
+
(readStringArray(intent, 'argv') !== undefined || readString(intent, 'cmd') !== undefined);
|
|
306
|
+
return [
|
|
307
|
+
{
|
|
308
|
+
name,
|
|
309
|
+
status,
|
|
310
|
+
lifecycle,
|
|
311
|
+
run_policy: runPolicy,
|
|
312
|
+
stdin,
|
|
313
|
+
timeout_seconds: timeoutSeconds,
|
|
314
|
+
cwd: readString(intent, 'cwd') ?? null,
|
|
315
|
+
description: readString(intent, 'description') ?? null,
|
|
316
|
+
reason: readString(intent, 'reason') ?? null,
|
|
317
|
+
agent_action: readString(intent, 'agent_action') ?? null,
|
|
318
|
+
writes: readStringArray(intent, 'writes') ?? [],
|
|
319
|
+
required_after: readStringArray(intent, 'required_after') ?? [],
|
|
320
|
+
runnable,
|
|
321
|
+
},
|
|
322
|
+
];
|
|
323
|
+
});
|
|
324
|
+
return {
|
|
325
|
+
path: '.mustflow/config/commands.toml',
|
|
326
|
+
exists: true,
|
|
327
|
+
intents,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function pathMatches(filePath, patterns) {
|
|
331
|
+
return patterns.some((pattern) => pattern.test(filePath));
|
|
332
|
+
}
|
|
333
|
+
function matchingFiles(files, patterns) {
|
|
334
|
+
return files.filter((filePath) => pathMatches(filePath, patterns)).slice(0, DASHBOARD_VERIFICATION_MAX_FILE_MATCHES);
|
|
335
|
+
}
|
|
336
|
+
function arraysEqual(left, right) {
|
|
337
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
338
|
+
}
|
|
339
|
+
function renderSkillsResponse(projectRoot) {
|
|
340
|
+
const indexPath = path.join(projectRoot, ...SKILL_INDEX_RELATIVE_PATH.split('/'));
|
|
341
|
+
if (!existsSync(indexPath)) {
|
|
342
|
+
return {
|
|
343
|
+
index_path: SKILL_INDEX_RELATIVE_PATH,
|
|
344
|
+
exists: false,
|
|
345
|
+
count: 0,
|
|
346
|
+
routes: [],
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
const routes = parseSkillIndexRoutes(readFileSync(indexPath, 'utf8')).map((route) => {
|
|
350
|
+
const skillPath = path.join(projectRoot, ...route.skillPath.split('/'));
|
|
351
|
+
const exists = existsSync(skillPath);
|
|
352
|
+
const declaredCommandIntents = exists ? readFrontmatterList(readFileSync(skillPath, 'utf8'), 'command_intents') : [];
|
|
353
|
+
const sortedRouteIntents = [...route.commandIntents].sort((left, right) => left.localeCompare(right));
|
|
354
|
+
const sortedDeclaredIntents = [...declaredCommandIntents].sort((left, right) => left.localeCompare(right));
|
|
355
|
+
return {
|
|
356
|
+
skill: skillNameFromPath(route.skillPath),
|
|
357
|
+
skill_path: route.skillPath,
|
|
358
|
+
trigger: route.trigger,
|
|
359
|
+
required_input: route.requiredInput,
|
|
360
|
+
edit_scope: route.editScope,
|
|
361
|
+
risk: route.risk,
|
|
362
|
+
verification_intents: route.commandIntents,
|
|
363
|
+
declared_command_intents: declaredCommandIntents,
|
|
364
|
+
expected_output: route.expectedOutput,
|
|
365
|
+
exists,
|
|
366
|
+
aligned: exists && arraysEqual(sortedRouteIntents, sortedDeclaredIntents),
|
|
367
|
+
};
|
|
368
|
+
});
|
|
369
|
+
return {
|
|
370
|
+
index_path: SKILL_INDEX_RELATIVE_PATH,
|
|
371
|
+
exists: true,
|
|
372
|
+
count: routes.length,
|
|
373
|
+
routes,
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
function renderUpdateResponse(projectRoot) {
|
|
377
|
+
const plan = planUpdate(projectRoot);
|
|
378
|
+
if (plan.error) {
|
|
379
|
+
return {
|
|
380
|
+
command: 'update',
|
|
381
|
+
mode: 'dry-run',
|
|
382
|
+
dry_run_command: 'mf update --dry-run',
|
|
383
|
+
apply_command: 'mf update --apply',
|
|
384
|
+
ok: false,
|
|
385
|
+
apply_ready: false,
|
|
386
|
+
error: plan.error,
|
|
387
|
+
summary: {
|
|
388
|
+
blockedLocalChanges: 0,
|
|
389
|
+
manualReview: 0,
|
|
390
|
+
wouldUpdate: 0,
|
|
391
|
+
wouldCreate: 0,
|
|
392
|
+
unchanged: 0,
|
|
393
|
+
},
|
|
394
|
+
blockers: [],
|
|
395
|
+
changes: [],
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
const summary = summarizePlan(plan.items);
|
|
399
|
+
const blockers = plan.items.filter((item) => item.action === 'blocked-local-change' || item.action === 'manual-review');
|
|
400
|
+
const changes = plan.items.filter((item) => item.action === 'create' || item.action === 'update');
|
|
401
|
+
return {
|
|
402
|
+
command: 'update',
|
|
403
|
+
mode: 'dry-run',
|
|
404
|
+
dry_run_command: 'mf update --dry-run',
|
|
405
|
+
apply_command: 'mf update --apply',
|
|
406
|
+
ok: true,
|
|
407
|
+
apply_ready: blockers.length === 0,
|
|
408
|
+
summary,
|
|
409
|
+
blockers,
|
|
410
|
+
changes,
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
function readRunOutput(value) {
|
|
414
|
+
if (!isRecord(value)) {
|
|
415
|
+
return { bytes: 0, truncated: false, tail: '' };
|
|
416
|
+
}
|
|
417
|
+
return {
|
|
418
|
+
bytes: typeof value.bytes === 'number' ? value.bytes : 0,
|
|
419
|
+
truncated: value.truncated === true,
|
|
420
|
+
tail: typeof value.tail === 'string' ? value.tail : '',
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function readNumberArray(value) {
|
|
424
|
+
return Array.isArray(value) ? value.filter((entry) => Number.isInteger(entry)) : [];
|
|
425
|
+
}
|
|
426
|
+
function renderRunHistoryResponse(projectRoot) {
|
|
427
|
+
const receiptPath = path.join(projectRoot, ...LATEST_RUN_RELATIVE_PATH.split('/'));
|
|
428
|
+
if (!existsSync(receiptPath)) {
|
|
429
|
+
return {
|
|
430
|
+
path: LATEST_RUN_RELATIVE_PATH,
|
|
431
|
+
exists: false,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
try {
|
|
435
|
+
const receipt = JSON.parse(readFileSync(receiptPath, 'utf8'));
|
|
436
|
+
if (!isRecord(receipt)) {
|
|
437
|
+
throw new Error('Run receipt must be a JSON object.');
|
|
438
|
+
}
|
|
439
|
+
const mode = typeof receipt.mode === 'string' ? receipt.mode : '';
|
|
440
|
+
const argv = Array.isArray(receipt.argv) ? receipt.argv.filter((entry) => typeof entry === 'string') : [];
|
|
441
|
+
const cmd = typeof receipt.cmd === 'string' && receipt.cmd.length > 0 ? [receipt.cmd] : [];
|
|
442
|
+
return {
|
|
443
|
+
path: LATEST_RUN_RELATIVE_PATH,
|
|
444
|
+
exists: true,
|
|
445
|
+
valid: true,
|
|
446
|
+
intent: typeof receipt.intent === 'string' ? receipt.intent : '',
|
|
447
|
+
status: typeof receipt.status === 'string' ? receipt.status : '',
|
|
448
|
+
timed_out: receipt.timed_out === true,
|
|
449
|
+
started_at: typeof receipt.started_at === 'string' ? receipt.started_at : '',
|
|
450
|
+
finished_at: typeof receipt.finished_at === 'string' ? receipt.finished_at : '',
|
|
451
|
+
duration_ms: typeof receipt.duration_ms === 'number' ? receipt.duration_ms : 0,
|
|
452
|
+
cwd: typeof receipt.cwd === 'string' ? receipt.cwd : '',
|
|
453
|
+
lifecycle: typeof receipt.lifecycle === 'string' ? receipt.lifecycle : '',
|
|
454
|
+
run_policy: typeof receipt.run_policy === 'string' ? receipt.run_policy : '',
|
|
455
|
+
mode,
|
|
456
|
+
command_line: mode === 'shell' ? cmd : argv,
|
|
457
|
+
timeout_seconds: typeof receipt.timeout_seconds === 'number' ? receipt.timeout_seconds : 0,
|
|
458
|
+
max_output_bytes: typeof receipt.max_output_bytes === 'number' ? receipt.max_output_bytes : 0,
|
|
459
|
+
success_exit_codes: readNumberArray(receipt.success_exit_codes),
|
|
460
|
+
exit_code: typeof receipt.exit_code === 'number' ? receipt.exit_code : null,
|
|
461
|
+
signal: typeof receipt.signal === 'string' ? receipt.signal : null,
|
|
462
|
+
error: typeof receipt.error === 'string' ? receipt.error : null,
|
|
463
|
+
kill_method: typeof receipt.kill_method === 'string' ? receipt.kill_method : null,
|
|
464
|
+
receipt_path: typeof receipt.receipt_path === 'string' ? receipt.receipt_path : LATEST_RUN_RELATIVE_PATH,
|
|
465
|
+
stdout: readRunOutput(receipt.stdout),
|
|
466
|
+
stderr: readRunOutput(receipt.stderr),
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
catch (error) {
|
|
470
|
+
return {
|
|
471
|
+
path: LATEST_RUN_RELATIVE_PATH,
|
|
472
|
+
exists: true,
|
|
473
|
+
valid: false,
|
|
474
|
+
error: 'Invalid latest run receipt.',
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
function renderStatusResponse(projectRoot) {
|
|
479
|
+
const context = getAgentContext(projectRoot);
|
|
480
|
+
const manifest = inspectManifestLock(projectRoot);
|
|
481
|
+
const lock = manifest.readResult.kind === 'present' ? manifest.readResult.lock : undefined;
|
|
482
|
+
const activeDocuments = listDocReviewEntries(projectRoot);
|
|
483
|
+
const rawCommandContract = readDashboardCommandContract(projectRoot);
|
|
484
|
+
const commandContract = renderCommandContractResponse(rawCommandContract);
|
|
485
|
+
const gitChangedFiles = readGitChangedFiles(projectRoot);
|
|
486
|
+
const packageMetadata = readPackageMetadata();
|
|
487
|
+
return {
|
|
488
|
+
schema_version: '1',
|
|
489
|
+
command: 'dashboard status',
|
|
490
|
+
installed: context.installed,
|
|
491
|
+
manifest_lock: context.manifest_lock,
|
|
492
|
+
template: context.template,
|
|
493
|
+
release: {
|
|
494
|
+
package_name: packageMetadata.name,
|
|
495
|
+
package_version: packageMetadata.version,
|
|
496
|
+
version_sources: detectVersionSources(projectRoot),
|
|
497
|
+
release_sensitive_changed_files: matchingFiles(gitChangedFiles, RELEASE_FILE_PATTERNS),
|
|
498
|
+
},
|
|
499
|
+
update: renderUpdateResponse(projectRoot),
|
|
500
|
+
run_history: renderRunHistoryResponse(projectRoot),
|
|
501
|
+
skills: renderSkillsResponse(projectRoot),
|
|
502
|
+
tracked_files: lock?.files.length ?? 0,
|
|
503
|
+
changed_files: manifest.changedFiles,
|
|
504
|
+
missing_files: manifest.missingFiles,
|
|
505
|
+
issues: manifest.issues,
|
|
506
|
+
runnable_intents: context.command_contract.runnable_intents,
|
|
507
|
+
command_contract: commandContract,
|
|
508
|
+
verification: createDashboardVerificationSnapshot(projectRoot, rawCommandContract, commandContract.intents, gitChangedFiles, manifest.changedFiles, manifest.missingFiles),
|
|
509
|
+
latest_run: context.latest_run,
|
|
510
|
+
active_review_documents: activeDocuments.length,
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
function toDashboardUrl(host, port) {
|
|
514
|
+
const formattedHost = host === '::1' ? '[::1]' : host;
|
|
515
|
+
return `http://${formattedHost}:${port}/`;
|
|
516
|
+
}
|
|
517
|
+
export async function runDashboard(args, reporter, lang = 'en') {
|
|
518
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
519
|
+
reporter.stdout(getDashboardHelp(lang));
|
|
520
|
+
return 0;
|
|
521
|
+
}
|
|
522
|
+
const parsed = parseDashboardOptions(args, lang);
|
|
523
|
+
if (parsed.error || !parsed.options) {
|
|
524
|
+
printUsageError(reporter, parsed.error ?? t(lang, 'cli.common.invalidInput'), 'mf dashboard --help', getDashboardHelp(lang), lang);
|
|
525
|
+
return 1;
|
|
526
|
+
}
|
|
527
|
+
const options = parsed.options;
|
|
528
|
+
const projectRoot = resolveMustflowRoot();
|
|
529
|
+
const token = randomBytes(18).toString('base64url');
|
|
530
|
+
const initialSnapshot = readDashboardPreferences(projectRoot);
|
|
531
|
+
const server = http.createServer(async (request, response) => {
|
|
532
|
+
const requestUrl = new URL(request.url ?? '/', 'http://localhost');
|
|
533
|
+
try {
|
|
534
|
+
if (request.method === 'GET' && requestUrl.pathname === '/') {
|
|
535
|
+
response.writeHead(200, {
|
|
536
|
+
'cache-control': 'no-store',
|
|
537
|
+
'content-type': 'text/html; charset=utf-8',
|
|
538
|
+
});
|
|
539
|
+
response.end(renderDashboardHtml(readDashboardPreferences(projectRoot), token, renderStatusResponse(projectRoot), renderDocReviewResponse(projectRoot, new URL('/api/docs/review', 'http://localhost'))));
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
if (request.method === 'GET' && requestUrl.pathname === '/favicon.ico') {
|
|
543
|
+
response.writeHead(204, { 'cache-control': 'no-store' });
|
|
544
|
+
response.end();
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
if (requestUrl.pathname === '/api/status') {
|
|
548
|
+
if (!isAuthorized(request, token)) {
|
|
549
|
+
sendText(response, 403, 'Forbidden');
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
if (request.method === 'GET') {
|
|
553
|
+
sendJson(response, 200, renderStatusResponse(projectRoot));
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
if (requestUrl.pathname === '/api/preferences') {
|
|
558
|
+
if (!isAuthorized(request, token)) {
|
|
559
|
+
sendText(response, 403, 'Forbidden');
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
if (request.method === 'GET') {
|
|
563
|
+
sendJson(response, 200, readDashboardPreferences(projectRoot));
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
if (request.method === 'POST') {
|
|
567
|
+
const body = await readRequestJson(request);
|
|
568
|
+
sendJson(response, 200, updateDashboardPreferences(projectRoot, readUpdatePayload(body)));
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
if (requestUrl.pathname === '/api/open-mustflow') {
|
|
573
|
+
if (!isAuthorized(request, token)) {
|
|
574
|
+
sendText(response, 403, 'Forbidden');
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
if (request.method !== 'POST') {
|
|
578
|
+
sendText(response, 405, 'Method not allowed');
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
const mustflowPath = path.join(projectRoot, '.mustflow');
|
|
582
|
+
if (!existsSync(mustflowPath)) {
|
|
583
|
+
sendText(response, 404, '.mustflow folder not found');
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
if (!openPathInFileManager(mustflowPath)) {
|
|
587
|
+
sendText(response, 500, 'No file manager opener is available for this platform');
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
sendJson(response, 200, { opened: true });
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
if (requestUrl.pathname === '/api/docs/review') {
|
|
594
|
+
if (!isAuthorized(request, token)) {
|
|
595
|
+
sendText(response, 403, 'Forbidden');
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
if (request.method === 'GET') {
|
|
599
|
+
sendJson(response, 200, renderDocReviewResponse(projectRoot, requestUrl));
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
if (request.method === 'POST') {
|
|
603
|
+
const body = await readRequestJson(request);
|
|
604
|
+
markDocReviewEntry(projectRoot, readDocReviewPayload(body));
|
|
605
|
+
sendJson(response, 200, renderDocReviewResponse(projectRoot, requestUrl));
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
sendText(response, 404, 'Not found');
|
|
610
|
+
}
|
|
611
|
+
catch {
|
|
612
|
+
sendBadRequest(response);
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
return new Promise((resolve) => {
|
|
616
|
+
let resolved = false;
|
|
617
|
+
const close = () => {
|
|
618
|
+
if (resolved) {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
resolved = true;
|
|
622
|
+
server.close(() => resolve(0));
|
|
623
|
+
};
|
|
624
|
+
server.on('error', (error) => {
|
|
625
|
+
if (!resolved) {
|
|
626
|
+
resolved = true;
|
|
627
|
+
reporter.stderr(error instanceof Error ? error.message : String(error));
|
|
628
|
+
resolve(1);
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
server.listen(options.port, options.host, () => {
|
|
632
|
+
const address = server.address();
|
|
633
|
+
const url = toDashboardUrl(options.host, address.port);
|
|
634
|
+
if (options.json) {
|
|
635
|
+
reporter.stdout(JSON.stringify({
|
|
636
|
+
schema_version: '1',
|
|
637
|
+
command: 'dashboard',
|
|
638
|
+
status: 'listening',
|
|
639
|
+
url,
|
|
640
|
+
project_root: projectRoot,
|
|
641
|
+
preferences_path: initialSnapshot.preferencesPath,
|
|
642
|
+
}));
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
reporter.stdout(t(lang, 'dashboard.listening', { url }));
|
|
646
|
+
}
|
|
647
|
+
if (options.openBrowser) {
|
|
648
|
+
openUrlInBrowser(url);
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
process.once('SIGINT', close);
|
|
652
|
+
process.once('SIGTERM', close);
|
|
653
|
+
});
|
|
654
|
+
}
|