oh-my-knowledge 0.32.0 → 0.34.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 +29 -14
- package/README.zh.md +32 -17
- package/dist/analysis/coverage-analyzer.d.ts +0 -1
- package/dist/analysis/coverage-analyzer.js +0 -1
- package/dist/analysis/failure-clusterer.d.ts +0 -1
- package/dist/analysis/failure-clusterer.js +0 -1
- package/dist/analysis/gap-analyzer.d.ts +0 -1
- package/dist/analysis/gap-analyzer.js +0 -1
- package/dist/analysis/hedging-classifier.d.ts +0 -1
- package/dist/analysis/hedging-classifier.js +1 -2
- package/dist/analysis/report-diagnostics.d.ts +0 -1
- package/dist/analysis/report-diagnostics.js +0 -1
- package/dist/analysis/sample-diagnostics.d.ts +1 -2
- package/dist/analysis/sample-diagnostics.js +18 -19
- package/dist/analysis/saturation.d.ts +8 -1
- package/dist/analysis/saturation.js +12 -5
- package/dist/assets/agent-skills/omk/SKILL.md +197 -0
- package/dist/assets/agent-skills/omk/references/commands.md +547 -0
- package/dist/authoring/evolver.d.ts +169 -4
- package/dist/authoring/evolver.js +287 -15
- package/dist/authoring/generator.d.ts +29 -2
- package/dist/authoring/generator.js +113 -1
- package/dist/authoring/sample-fixer.d.ts +0 -1
- package/dist/authoring/sample-fixer.js +0 -1
- package/dist/cli/commands/doctor.d.ts +2 -1
- package/dist/cli/commands/doctor.js +24 -6
- package/dist/cli/commands/eval/gold/compare.d.ts +0 -1
- package/dist/cli/commands/eval/gold/compare.js +0 -1
- package/dist/cli/commands/eval/gold/index.d.ts +0 -1
- package/dist/cli/commands/eval/gold/index.js +0 -1
- package/dist/cli/commands/eval/gold/init.d.ts +0 -1
- package/dist/cli/commands/eval/gold/init.js +0 -1
- package/dist/cli/commands/eval/gold/validate.d.ts +0 -1
- package/dist/cli/commands/eval/gold/validate.js +0 -1
- package/dist/cli/commands/eval/index.d.ts +2 -1
- package/dist/cli/commands/eval/index.js +23 -11
- package/dist/cli/commands/evolve.d.ts +7 -1
- package/dist/cli/commands/evolve.js +93 -6
- package/dist/cli/commands/init.d.ts +0 -1
- package/dist/cli/commands/init.js +0 -1
- package/dist/cli/commands/install.d.ts +22 -0
- package/dist/cli/commands/install.js +411 -0
- package/dist/cli/commands/observe/inbox.d.ts +0 -1
- package/dist/cli/commands/observe/inbox.js +0 -1
- package/dist/cli/commands/observe/index.d.ts +0 -1
- package/dist/cli/commands/observe/index.js +6 -3
- package/dist/cli/commands/observe/ingest.d.ts +0 -1
- package/dist/cli/commands/observe/ingest.js +0 -1
- package/dist/cli/commands/observe/show.d.ts +0 -1
- package/dist/cli/commands/observe/show.js +0 -1
- package/dist/cli/commands/sample.d.ts +2 -1
- package/dist/cli/commands/sample.js +100 -9
- package/dist/cli/commands/studio.d.ts +0 -1
- package/dist/cli/commands/studio.js +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +1 -2
- package/dist/cli/lib/cli-exit.d.ts +0 -1
- package/dist/cli/lib/cli-exit.js +0 -1
- package/dist/cli/lib/cmd-flags.d.ts +11 -1
- package/dist/cli/lib/cmd-flags.js +0 -1
- package/dist/cli/lib/i18n-dict/common.d.ts +1 -2
- package/dist/cli/lib/i18n-dict/common.js +18 -3
- package/dist/cli/lib/i18n-dict/evolve.d.ts +1 -2
- package/dist/cli/lib/i18n-dict/evolve.js +24 -1
- package/dist/cli/lib/i18n-dict/gen.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/gen.js +0 -1
- package/dist/cli/lib/i18n-dict/help.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/help.js +0 -1
- package/dist/cli/lib/i18n-dict/init.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/init.js +0 -1
- package/dist/cli/lib/i18n-dict/install.d.ts +3 -0
- package/dist/cli/lib/i18n-dict/install.js +90 -0
- package/dist/cli/lib/i18n-dict/run.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/run.js +0 -1
- package/dist/cli/lib/i18n-dict/types.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/types.js +0 -1
- package/dist/cli/lib/i18n-dict.d.ts +2 -2
- package/dist/cli/lib/i18n-dict.js +2 -1
- package/dist/cli/lib/i18n.d.ts +0 -1
- package/dist/cli/lib/i18n.js +0 -1
- package/dist/cli/lib/parse-run-config/judge-models.d.ts +0 -1
- package/dist/cli/lib/parse-run-config/judge-models.js +0 -1
- package/dist/cli/lib/parse-run-config/samples-discovery.d.ts +0 -1
- package/dist/cli/lib/parse-run-config/samples-discovery.js +1 -4
- package/dist/cli/lib/parse-run-config/variant-resolution.d.ts +8 -4
- package/dist/cli/lib/parse-run-config/variant-resolution.js +46 -14
- package/dist/cli/lib/parse-run-config.d.ts +0 -1
- package/dist/cli/lib/parse-run-config.js +1 -2
- package/dist/cli/lib/progress.d.ts +0 -1
- package/dist/cli/lib/progress.js +0 -1
- package/dist/cli/lib/resolve-skill-input.d.ts +0 -1
- package/dist/cli/lib/resolve-skill-input.js +7 -6
- package/dist/cli/lib/run-tally.d.ts +0 -1
- package/dist/cli/lib/run-tally.js +1 -2
- package/dist/cli/lib/shared.d.ts +0 -1
- package/dist/cli/lib/shared.js +1 -2
- package/dist/cli/lib/update-check.d.ts +65 -1
- package/dist/cli/lib/update-check.js +220 -32
- package/dist/cli/lib/update-fetch-worker.d.ts +1 -0
- package/dist/cli/lib/update-fetch-worker.js +34 -0
- package/dist/cli/oclif/base-command.d.ts +0 -1
- package/dist/cli/oclif/base-command.js +0 -1
- package/dist/cli/oclif/help.d.ts +0 -1
- package/dist/cli/oclif/help.js +0 -1
- package/dist/cli/oclif/i18n.d.ts +0 -1
- package/dist/cli/oclif/i18n.js +0 -1
- package/dist/cli/oclif/parsers.d.ts +0 -1
- package/dist/cli/oclif/parsers.js +0 -1
- package/dist/cli/oclif/projection.d.ts +0 -1
- package/dist/cli/oclif/projection.js +0 -1
- package/dist/cli/oclif/run.d.ts +0 -1
- package/dist/cli/oclif/run.js +0 -1
- package/dist/diagnosis/observe-mapper.d.ts +2 -3
- package/dist/diagnosis/observe-mapper.js +6 -7
- package/dist/diagnosis/observe-producer.d.ts +0 -1
- package/dist/diagnosis/observe-producer.js +3 -4
- package/dist/diagnosis/studio-projection.d.ts +0 -1
- package/dist/diagnosis/studio-projection.js +0 -1
- package/dist/diagnosis/types.d.ts +0 -1
- package/dist/diagnosis/types.js +0 -1
- package/dist/doctor/fixer.d.ts +0 -1
- package/dist/doctor/fixer.js +0 -1
- package/dist/doctor/health/builtin-dimensions.d.ts +0 -1
- package/dist/doctor/health/builtin-dimensions.js +0 -1
- package/dist/doctor/health/composer.d.ts +0 -1
- package/dist/doctor/health/composer.js +1 -2
- package/dist/doctor/health/dimension-registry.d.ts +0 -1
- package/dist/doctor/health/dimension-registry.js +0 -1
- package/dist/doctor/health/dimension-spec.d.ts +0 -1
- package/dist/doctor/health/dimension-spec.js +0 -1
- package/dist/doctor/health/load-custom-dimensions.d.ts +1 -0
- package/dist/doctor/health/load-custom-dimensions.js +30 -0
- package/dist/doctor/health/parser.d.ts +0 -1
- package/dist/doctor/health/parser.js +0 -1
- package/dist/doctor/health/prompt-builder.d.ts +0 -1
- package/dist/doctor/health/prompt-builder.js +0 -1
- package/dist/doctor/health/register.d.ts +0 -1
- package/dist/doctor/health/register.js +0 -1
- package/dist/doctor/index.d.ts +0 -1
- package/dist/doctor/index.js +1 -2
- package/dist/doctor/messages.d.ts +0 -1
- package/dist/doctor/messages.js +1 -2
- package/dist/doctor/preflight.d.ts +0 -1
- package/dist/doctor/preflight.js +0 -1
- package/dist/doctor/renderer.d.ts +0 -1
- package/dist/doctor/renderer.js +0 -1
- package/dist/doctor/rules.d.ts +0 -1
- package/dist/doctor/rules.js +0 -1
- package/dist/eval-core/bootstrap.d.ts +8 -1
- package/dist/eval-core/bootstrap.js +11 -4
- package/dist/eval-core/cache.d.ts +0 -1
- package/dist/eval-core/cache.js +0 -1
- package/dist/eval-core/comparability.d.ts +0 -1
- package/dist/eval-core/comparability.js +3 -4
- package/dist/eval-core/dependency-checker.d.ts +0 -1
- package/dist/eval-core/dependency-checker.js +2 -2
- package/dist/eval-core/evaluation-execution.d.ts +0 -1
- package/dist/eval-core/evaluation-execution.js +0 -1
- package/dist/eval-core/evaluation-job.d.ts +0 -1
- package/dist/eval-core/evaluation-job.js +0 -1
- package/dist/eval-core/evaluation-reporting.d.ts +0 -1
- package/dist/eval-core/evaluation-reporting.js +9 -8
- package/dist/eval-core/execution-strategy.d.ts +0 -1
- package/dist/eval-core/execution-strategy.js +6 -3
- package/dist/eval-core/fact-checker.d.ts +0 -1
- package/dist/eval-core/fact-checker.js +0 -1
- package/dist/eval-core/layer-gates.d.ts +0 -1
- package/dist/eval-core/layer-gates.js +0 -1
- package/dist/eval-core/mocks-runtime.d.ts +0 -1
- package/dist/eval-core/mocks-runtime.js +0 -1
- package/dist/eval-core/schema.d.ts +0 -1
- package/dist/eval-core/schema.js +0 -1
- package/dist/eval-core/statistics.d.ts +0 -1
- package/dist/eval-core/statistics.js +0 -1
- package/dist/eval-core/task-planner.d.ts +0 -1
- package/dist/eval-core/task-planner.js +0 -1
- package/dist/eval-core/verdict.d.ts +21 -4
- package/dist/eval-core/verdict.js +54 -5
- package/dist/eval-workflows/batch-evaluation-workflow.d.ts +18 -3
- package/dist/eval-workflows/batch-evaluation-workflow.js +31 -15
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.d.ts +0 -1
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.js +0 -1
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.d.ts +0 -1
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.js +0 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.d.ts +0 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.js +0 -1
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.d.ts +0 -1
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.js +0 -1
- package/dist/eval-workflows/evaluation-pipeline.d.ts +0 -1
- package/dist/eval-workflows/evaluation-pipeline.js +0 -1
- package/dist/eval-workflows/evaluation-preparation.d.ts +1 -5
- package/dist/eval-workflows/evaluation-preparation.js +20 -16
- package/dist/eval-workflows/messages.d.ts +0 -1
- package/dist/eval-workflows/messages.js +0 -1
- package/dist/eval-workflows/run-evaluation.d.ts +4 -9
- package/dist/eval-workflows/run-evaluation.js +16 -26
- package/dist/executors/anthropic-api.d.ts +0 -1
- package/dist/executors/anthropic-api.js +1 -2
- package/dist/executors/claude-cli.d.ts +0 -1
- package/dist/executors/claude-cli.js +0 -1
- package/dist/executors/claude-sdk-trace.d.ts +0 -1
- package/dist/executors/claude-sdk-trace.js +0 -1
- package/dist/executors/claude-sdk.d.ts +0 -1
- package/dist/executors/claude-sdk.js +0 -1
- package/dist/executors/codex-cli-trace.d.ts +0 -1
- package/dist/executors/codex-cli-trace.js +0 -1
- package/dist/executors/codex-cli.d.ts +0 -1
- package/dist/executors/codex-cli.js +0 -1
- package/dist/executors/codex-sdk.d.ts +0 -1
- package/dist/executors/codex-sdk.js +0 -1
- package/dist/executors/gemini.d.ts +0 -1
- package/dist/executors/gemini.js +0 -1
- package/dist/executors/index.d.ts +0 -1
- package/dist/executors/index.js +0 -1
- package/dist/executors/openai-api.d.ts +0 -1
- package/dist/executors/openai-api.js +0 -1
- package/dist/executors/runtime-fingerprint.d.ts +0 -1
- package/dist/executors/runtime-fingerprint.js +2 -3
- package/dist/executors/script.d.ts +0 -1
- package/dist/executors/script.js +0 -1
- package/dist/executors/shared.d.ts +0 -2
- package/dist/executors/shared.js +0 -1
- package/dist/grading/assertions.d.ts +0 -1
- package/dist/grading/assertions.js +0 -1
- package/dist/grading/debias-validate.d.ts +0 -1
- package/dist/grading/debias-validate.js +0 -1
- package/dist/grading/diagnostic.d.ts +0 -1
- package/dist/grading/diagnostic.js +0 -1
- package/dist/grading/gold-cli.d.ts +0 -1
- package/dist/grading/gold-cli.js +0 -1
- package/dist/grading/gold-dataset.d.ts +0 -1
- package/dist/grading/gold-dataset.js +0 -1
- package/dist/grading/human-gold.d.ts +0 -1
- package/dist/grading/human-gold.js +0 -1
- package/dist/grading/index.d.ts +0 -1
- package/dist/grading/index.js +0 -1
- package/dist/grading/judge.d.ts +0 -1
- package/dist/grading/judge.js +0 -1
- package/dist/grading/layered-scores.d.ts +0 -1
- package/dist/grading/layered-scores.js +0 -1
- package/dist/inputs/eval-config.d.ts +0 -1
- package/dist/inputs/eval-config.js +3 -2
- package/dist/inputs/load-samples.d.ts +0 -1
- package/dist/inputs/load-samples.js +0 -1
- package/dist/inputs/mcp-resolver.d.ts +0 -1
- package/dist/inputs/mcp-resolver.js +0 -1
- package/dist/inputs/skill-loader.d.ts +99 -7
- package/dist/inputs/skill-loader.js +325 -45
- package/dist/inputs/source-resolver.d.ts +28 -0
- package/dist/inputs/source-resolver.js +125 -0
- package/dist/inputs/url-fetcher.d.ts +0 -1
- package/dist/inputs/url-fetcher.js +0 -1
- package/dist/managed/index.d.ts +5 -0
- package/dist/managed/index.js +5 -0
- package/dist/managed/store.d.ts +76 -0
- package/dist/managed/store.js +260 -0
- package/dist/observability/experience-frontmatter.d.ts +0 -1
- package/dist/observability/experience-frontmatter.js +0 -1
- package/dist/observability/experience.d.ts +1 -2
- package/dist/observability/experience.js +1 -2
- package/dist/observability/feedback-matchers.d.ts +0 -1
- package/dist/observability/feedback-matchers.js +0 -1
- package/dist/observability/feedback-projection.d.ts +0 -1
- package/dist/observability/feedback-projection.js +0 -1
- package/dist/observability/inbox-view-model.d.ts +0 -1
- package/dist/observability/inbox-view-model.js +0 -1
- package/dist/observability/inbox.d.ts +0 -1
- package/dist/observability/inbox.js +2 -3
- package/dist/observability/problem-patterns.d.ts +0 -1
- package/dist/observability/problem-patterns.js +0 -1
- package/dist/observability/resolved-review.d.ts +0 -1
- package/dist/observability/resolved-review.js +4 -5
- package/dist/observability/review-state.d.ts +0 -1
- package/dist/observability/review-state.js +3 -4
- package/dist/observability/skill-chain-advisories.d.ts +0 -1
- package/dist/observability/skill-chain-advisories.js +0 -1
- package/dist/observability/skill-chain.d.ts +0 -1
- package/dist/observability/skill-chain.js +5 -6
- package/dist/observability/skill-health-analyzer.d.ts +13 -1
- package/dist/observability/skill-health-analyzer.js +17 -3
- package/dist/observability/soft-standards/constants.d.ts +0 -1
- package/dist/observability/soft-standards/constants.js +0 -1
- package/dist/observability/soft-standards/index.d.ts +0 -1
- package/dist/observability/soft-standards/index.js +0 -1
- package/dist/observability/soft-standards/llm-extractor.d.ts +0 -1
- package/dist/observability/soft-standards/llm-extractor.js +7 -8
- package/dist/observability/soft-standards/runtime-evaluator.d.ts +0 -1
- package/dist/observability/soft-standards/runtime-evaluator.js +2 -3
- package/dist/observability/soft-standards/skill-standards-store.d.ts +0 -1
- package/dist/observability/soft-standards/skill-standards-store.js +5 -6
- package/dist/observability/soft-standards/types.d.ts +10 -11
- package/dist/observability/soft-standards/types.js +0 -1
- package/dist/observability/text-signals.d.ts +0 -1
- package/dist/observability/text-signals.js +0 -1
- package/dist/observability/trace-adapter.d.ts +0 -1
- package/dist/observability/trace-adapter.js +0 -1
- package/dist/observability/trace-attribution.d.ts +0 -1
- package/dist/observability/trace-attribution.js +0 -1
- package/dist/observability/trace-segmenter.d.ts +0 -1
- package/dist/observability/trace-segmenter.js +0 -1
- package/dist/observability/trace-source.d.ts +0 -1
- package/dist/observability/trace-source.js +0 -1
- package/dist/renderer/html-renderer.d.ts +0 -1
- package/dist/renderer/html-renderer.js +4 -5
- package/dist/renderer/layout.d.ts +0 -1
- package/dist/renderer/layout.js +2 -1
- package/dist/renderer/observation-inbox/helpers.d.ts +0 -1
- package/dist/renderer/observation-inbox/helpers.js +0 -1
- package/dist/renderer/observation-inbox/styles.d.ts +0 -1
- package/dist/renderer/observation-inbox/styles.js +0 -1
- package/dist/renderer/observation-inbox-renderer.d.ts +0 -1
- package/dist/renderer/observation-inbox-renderer.js +13 -14
- package/dist/renderer/skill-detail-renderer.d.ts +0 -1
- package/dist/renderer/skill-detail-renderer.js +101 -23
- package/dist/renderer/skill-health-renderer.d.ts +0 -1
- package/dist/renderer/skill-health-renderer.js +33 -5
- package/dist/renderer/skill-list-renderer.d.ts +0 -1
- package/dist/renderer/skill-list-renderer.js +18 -7
- package/dist/renderer/summary.d.ts +0 -1
- package/dist/renderer/summary.js +21 -10
- package/dist/renderer/table.d.ts +0 -1
- package/dist/renderer/table.js +0 -1
- package/dist/renderer/test-view.d.ts +0 -1
- package/dist/renderer/test-view.js +0 -1
- package/dist/renderer/trends.d.ts +0 -1
- package/dist/renderer/trends.js +0 -1
- package/dist/server/job-store.d.ts +0 -1
- package/dist/server/job-store.js +0 -1
- package/dist/server/report-server.d.ts +0 -1
- package/dist/server/report-server.js +10 -4
- package/dist/server/report-store.d.ts +1 -2
- package/dist/server/report-store.js +6 -7
- package/dist/server/skill-index.d.ts +0 -1
- package/dist/server/skill-index.js +7 -5
- package/dist/server/skill-insights.d.ts +0 -1
- package/dist/server/skill-insights.js +41 -14
- package/dist/shared/hard-rules.d.ts +0 -1
- package/dist/shared/hard-rules.js +0 -1
- package/dist/shared/llm-prompts/index.d.ts +0 -1
- package/dist/shared/llm-prompts/index.js +0 -1
- package/dist/shared/llm-prompts/skill-health.d.ts +0 -1
- package/dist/shared/llm-prompts/skill-health.js +0 -1
- package/dist/shared/time.d.ts +0 -1
- package/dist/shared/time.js +0 -1
- package/dist/shared/tool-search.d.ts +0 -1
- package/dist/shared/tool-search.js +0 -1
- package/dist/types/dependencies.d.ts +0 -1
- package/dist/types/dependencies.js +0 -1
- package/dist/types/diagnosis.d.ts +0 -1
- package/dist/types/diagnosis.js +0 -1
- package/dist/types/doctor.d.ts +4 -5
- package/dist/types/doctor.js +2 -3
- package/dist/types/eval.d.ts +2 -1
- package/dist/types/eval.js +0 -1
- package/dist/types/executor.d.ts +1 -2
- package/dist/types/executor.js +0 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/judge.d.ts +0 -1
- package/dist/types/judge.js +0 -1
- package/dist/types/managed.d.ts +85 -0
- package/dist/types/managed.js +1 -0
- package/dist/types/observability.d.ts +5 -6
- package/dist/types/observability.js +0 -1
- package/dist/types/report.d.ts +2 -3
- package/dist/types/report.js +0 -1
- package/dist/types/shared.d.ts +0 -1
- package/dist/types/shared.js +0 -1
- package/dist/types/skill-index.d.ts +3 -1
- package/dist/types/skill-index.js +0 -1
- package/dist/types/storage.d.ts +0 -1
- package/dist/types/storage.js +0 -1
- package/dist/util/safe-slice.d.ts +0 -1
- package/dist/util/safe-slice.js +0 -1
- package/package.json +10 -5
- package/dist/analysis/coverage-analyzer.d.ts.map +0 -1
- package/dist/analysis/coverage-analyzer.js.map +0 -1
- package/dist/analysis/failure-clusterer.d.ts.map +0 -1
- package/dist/analysis/failure-clusterer.js.map +0 -1
- package/dist/analysis/gap-analyzer.d.ts.map +0 -1
- package/dist/analysis/gap-analyzer.js.map +0 -1
- package/dist/analysis/hedging-classifier.d.ts.map +0 -1
- package/dist/analysis/hedging-classifier.js.map +0 -1
- package/dist/analysis/report-diagnostics.d.ts.map +0 -1
- package/dist/analysis/report-diagnostics.js.map +0 -1
- package/dist/analysis/sample-diagnostics.d.ts.map +0 -1
- package/dist/analysis/sample-diagnostics.js.map +0 -1
- package/dist/analysis/saturation.d.ts.map +0 -1
- package/dist/analysis/saturation.js.map +0 -1
- package/dist/authoring/evolver.d.ts.map +0 -1
- package/dist/authoring/evolver.js.map +0 -1
- package/dist/authoring/generator.d.ts.map +0 -1
- package/dist/authoring/generator.js.map +0 -1
- package/dist/authoring/sample-fixer.d.ts.map +0 -1
- package/dist/authoring/sample-fixer.js.map +0 -1
- package/dist/cli/commands/doctor.d.ts.map +0 -1
- package/dist/cli/commands/doctor.js.map +0 -1
- package/dist/cli/commands/eval/gold/compare.d.ts.map +0 -1
- package/dist/cli/commands/eval/gold/compare.js.map +0 -1
- package/dist/cli/commands/eval/gold/index.d.ts.map +0 -1
- package/dist/cli/commands/eval/gold/index.js.map +0 -1
- package/dist/cli/commands/eval/gold/init.d.ts.map +0 -1
- package/dist/cli/commands/eval/gold/init.js.map +0 -1
- package/dist/cli/commands/eval/gold/validate.d.ts.map +0 -1
- package/dist/cli/commands/eval/gold/validate.js.map +0 -1
- package/dist/cli/commands/eval/index.d.ts.map +0 -1
- package/dist/cli/commands/eval/index.js.map +0 -1
- package/dist/cli/commands/evolve.d.ts.map +0 -1
- package/dist/cli/commands/evolve.js.map +0 -1
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/observe/inbox.d.ts.map +0 -1
- package/dist/cli/commands/observe/inbox.js.map +0 -1
- package/dist/cli/commands/observe/index.d.ts.map +0 -1
- package/dist/cli/commands/observe/index.js.map +0 -1
- package/dist/cli/commands/observe/ingest.d.ts.map +0 -1
- package/dist/cli/commands/observe/ingest.js.map +0 -1
- package/dist/cli/commands/observe/show.d.ts.map +0 -1
- package/dist/cli/commands/observe/show.js.map +0 -1
- package/dist/cli/commands/sample.d.ts.map +0 -1
- package/dist/cli/commands/sample.js.map +0 -1
- package/dist/cli/commands/studio.d.ts.map +0 -1
- package/dist/cli/commands/studio.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/lib/cli-exit.d.ts.map +0 -1
- package/dist/cli/lib/cli-exit.js.map +0 -1
- package/dist/cli/lib/cmd-flags.d.ts.map +0 -1
- package/dist/cli/lib/cmd-flags.js.map +0 -1
- package/dist/cli/lib/i18n-dict/common.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/common.js.map +0 -1
- package/dist/cli/lib/i18n-dict/evolve.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/evolve.js.map +0 -1
- package/dist/cli/lib/i18n-dict/gen.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/gen.js.map +0 -1
- package/dist/cli/lib/i18n-dict/help.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/help.js.map +0 -1
- package/dist/cli/lib/i18n-dict/init.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/init.js.map +0 -1
- package/dist/cli/lib/i18n-dict/run.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/run.js.map +0 -1
- package/dist/cli/lib/i18n-dict/types.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict/types.js.map +0 -1
- package/dist/cli/lib/i18n-dict.d.ts.map +0 -1
- package/dist/cli/lib/i18n-dict.js.map +0 -1
- package/dist/cli/lib/i18n.d.ts.map +0 -1
- package/dist/cli/lib/i18n.js.map +0 -1
- package/dist/cli/lib/parse-run-config/judge-models.d.ts.map +0 -1
- package/dist/cli/lib/parse-run-config/judge-models.js.map +0 -1
- package/dist/cli/lib/parse-run-config/samples-discovery.d.ts.map +0 -1
- package/dist/cli/lib/parse-run-config/samples-discovery.js.map +0 -1
- package/dist/cli/lib/parse-run-config/variant-resolution.d.ts.map +0 -1
- package/dist/cli/lib/parse-run-config/variant-resolution.js.map +0 -1
- package/dist/cli/lib/parse-run-config.d.ts.map +0 -1
- package/dist/cli/lib/parse-run-config.js.map +0 -1
- package/dist/cli/lib/progress.d.ts.map +0 -1
- package/dist/cli/lib/progress.js.map +0 -1
- package/dist/cli/lib/resolve-skill-input.d.ts.map +0 -1
- package/dist/cli/lib/resolve-skill-input.js.map +0 -1
- package/dist/cli/lib/run-tally.d.ts.map +0 -1
- package/dist/cli/lib/run-tally.js.map +0 -1
- package/dist/cli/lib/shared.d.ts.map +0 -1
- package/dist/cli/lib/shared.js.map +0 -1
- package/dist/cli/lib/update-check.d.ts.map +0 -1
- package/dist/cli/lib/update-check.js.map +0 -1
- package/dist/cli/oclif/base-command.d.ts.map +0 -1
- package/dist/cli/oclif/base-command.js.map +0 -1
- package/dist/cli/oclif/help.d.ts.map +0 -1
- package/dist/cli/oclif/help.js.map +0 -1
- package/dist/cli/oclif/i18n.d.ts.map +0 -1
- package/dist/cli/oclif/i18n.js.map +0 -1
- package/dist/cli/oclif/parsers.d.ts.map +0 -1
- package/dist/cli/oclif/parsers.js.map +0 -1
- package/dist/cli/oclif/projection.d.ts.map +0 -1
- package/dist/cli/oclif/projection.js.map +0 -1
- package/dist/cli/oclif/run.d.ts.map +0 -1
- package/dist/cli/oclif/run.js.map +0 -1
- package/dist/diagnosis/observe-mapper.d.ts.map +0 -1
- package/dist/diagnosis/observe-mapper.js.map +0 -1
- package/dist/diagnosis/observe-producer.d.ts.map +0 -1
- package/dist/diagnosis/observe-producer.js.map +0 -1
- package/dist/diagnosis/studio-projection.d.ts.map +0 -1
- package/dist/diagnosis/studio-projection.js.map +0 -1
- package/dist/diagnosis/types.d.ts.map +0 -1
- package/dist/diagnosis/types.js.map +0 -1
- package/dist/doctor/fixer.d.ts.map +0 -1
- package/dist/doctor/fixer.js.map +0 -1
- package/dist/doctor/health/builtin-dimensions.d.ts.map +0 -1
- package/dist/doctor/health/builtin-dimensions.js.map +0 -1
- package/dist/doctor/health/composer.d.ts.map +0 -1
- package/dist/doctor/health/composer.js.map +0 -1
- package/dist/doctor/health/dimension-registry.d.ts.map +0 -1
- package/dist/doctor/health/dimension-registry.js.map +0 -1
- package/dist/doctor/health/dimension-spec.d.ts.map +0 -1
- package/dist/doctor/health/dimension-spec.js.map +0 -1
- package/dist/doctor/health/parser.d.ts.map +0 -1
- package/dist/doctor/health/parser.js.map +0 -1
- package/dist/doctor/health/prompt-builder.d.ts.map +0 -1
- package/dist/doctor/health/prompt-builder.js.map +0 -1
- package/dist/doctor/health/register.d.ts.map +0 -1
- package/dist/doctor/health/register.js.map +0 -1
- package/dist/doctor/index.d.ts.map +0 -1
- package/dist/doctor/index.js.map +0 -1
- package/dist/doctor/messages.d.ts.map +0 -1
- package/dist/doctor/messages.js.map +0 -1
- package/dist/doctor/preflight.d.ts.map +0 -1
- package/dist/doctor/preflight.js.map +0 -1
- package/dist/doctor/renderer.d.ts.map +0 -1
- package/dist/doctor/renderer.js.map +0 -1
- package/dist/doctor/rules.d.ts.map +0 -1
- package/dist/doctor/rules.js.map +0 -1
- package/dist/eval-core/bootstrap.d.ts.map +0 -1
- package/dist/eval-core/bootstrap.js.map +0 -1
- package/dist/eval-core/cache.d.ts.map +0 -1
- package/dist/eval-core/cache.js.map +0 -1
- package/dist/eval-core/comparability.d.ts.map +0 -1
- package/dist/eval-core/comparability.js.map +0 -1
- package/dist/eval-core/dependency-checker.d.ts.map +0 -1
- package/dist/eval-core/dependency-checker.js.map +0 -1
- package/dist/eval-core/evaluation-execution.d.ts.map +0 -1
- package/dist/eval-core/evaluation-execution.js.map +0 -1
- package/dist/eval-core/evaluation-job.d.ts.map +0 -1
- package/dist/eval-core/evaluation-job.js.map +0 -1
- package/dist/eval-core/evaluation-reporting.d.ts.map +0 -1
- package/dist/eval-core/evaluation-reporting.js.map +0 -1
- package/dist/eval-core/execution-strategy.d.ts.map +0 -1
- package/dist/eval-core/execution-strategy.js.map +0 -1
- package/dist/eval-core/fact-checker.d.ts.map +0 -1
- package/dist/eval-core/fact-checker.js.map +0 -1
- package/dist/eval-core/layer-gates.d.ts.map +0 -1
- package/dist/eval-core/layer-gates.js.map +0 -1
- package/dist/eval-core/mocks-runtime.d.ts.map +0 -1
- package/dist/eval-core/mocks-runtime.js.map +0 -1
- package/dist/eval-core/schema.d.ts.map +0 -1
- package/dist/eval-core/schema.js.map +0 -1
- package/dist/eval-core/statistics.d.ts.map +0 -1
- package/dist/eval-core/statistics.js.map +0 -1
- package/dist/eval-core/task-planner.d.ts.map +0 -1
- package/dist/eval-core/task-planner.js.map +0 -1
- package/dist/eval-core/verdict.d.ts.map +0 -1
- package/dist/eval-core/verdict.js.map +0 -1
- package/dist/eval-workflows/batch-evaluation-workflow.d.ts.map +0 -1
- package/dist/eval-workflows/batch-evaluation-workflow.js.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.js.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.js.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.js.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.js.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-pipeline.js.map +0 -1
- package/dist/eval-workflows/evaluation-preparation.d.ts.map +0 -1
- package/dist/eval-workflows/evaluation-preparation.js.map +0 -1
- package/dist/eval-workflows/messages.d.ts.map +0 -1
- package/dist/eval-workflows/messages.js.map +0 -1
- package/dist/eval-workflows/run-evaluation.d.ts.map +0 -1
- package/dist/eval-workflows/run-evaluation.js.map +0 -1
- package/dist/executors/anthropic-api.d.ts.map +0 -1
- package/dist/executors/anthropic-api.js.map +0 -1
- package/dist/executors/claude-cli.d.ts.map +0 -1
- package/dist/executors/claude-cli.js.map +0 -1
- package/dist/executors/claude-sdk-trace.d.ts.map +0 -1
- package/dist/executors/claude-sdk-trace.js.map +0 -1
- package/dist/executors/claude-sdk.d.ts.map +0 -1
- package/dist/executors/claude-sdk.js.map +0 -1
- package/dist/executors/codex-cli-trace.d.ts.map +0 -1
- package/dist/executors/codex-cli-trace.js.map +0 -1
- package/dist/executors/codex-cli.d.ts.map +0 -1
- package/dist/executors/codex-cli.js.map +0 -1
- package/dist/executors/codex-sdk.d.ts.map +0 -1
- package/dist/executors/codex-sdk.js.map +0 -1
- package/dist/executors/gemini.d.ts.map +0 -1
- package/dist/executors/gemini.js.map +0 -1
- package/dist/executors/index.d.ts.map +0 -1
- package/dist/executors/index.js.map +0 -1
- package/dist/executors/openai-api.d.ts.map +0 -1
- package/dist/executors/openai-api.js.map +0 -1
- package/dist/executors/runtime-fingerprint.d.ts.map +0 -1
- package/dist/executors/runtime-fingerprint.js.map +0 -1
- package/dist/executors/script.d.ts.map +0 -1
- package/dist/executors/script.js.map +0 -1
- package/dist/executors/shared.d.ts.map +0 -1
- package/dist/executors/shared.js.map +0 -1
- package/dist/grading/assertions.d.ts.map +0 -1
- package/dist/grading/assertions.js.map +0 -1
- package/dist/grading/debias-validate.d.ts.map +0 -1
- package/dist/grading/debias-validate.js.map +0 -1
- package/dist/grading/diagnostic.d.ts.map +0 -1
- package/dist/grading/diagnostic.js.map +0 -1
- package/dist/grading/gold-cli.d.ts.map +0 -1
- package/dist/grading/gold-cli.js.map +0 -1
- package/dist/grading/gold-dataset.d.ts.map +0 -1
- package/dist/grading/gold-dataset.js.map +0 -1
- package/dist/grading/human-gold.d.ts.map +0 -1
- package/dist/grading/human-gold.js.map +0 -1
- package/dist/grading/index.d.ts.map +0 -1
- package/dist/grading/index.js.map +0 -1
- package/dist/grading/judge.d.ts.map +0 -1
- package/dist/grading/judge.js.map +0 -1
- package/dist/grading/layered-scores.d.ts.map +0 -1
- package/dist/grading/layered-scores.js.map +0 -1
- package/dist/inputs/eval-config.d.ts.map +0 -1
- package/dist/inputs/eval-config.js.map +0 -1
- package/dist/inputs/load-samples.d.ts.map +0 -1
- package/dist/inputs/load-samples.js.map +0 -1
- package/dist/inputs/mcp-resolver.d.ts.map +0 -1
- package/dist/inputs/mcp-resolver.js.map +0 -1
- package/dist/inputs/skill-loader.d.ts.map +0 -1
- package/dist/inputs/skill-loader.js.map +0 -1
- package/dist/inputs/url-fetcher.d.ts.map +0 -1
- package/dist/inputs/url-fetcher.js.map +0 -1
- package/dist/observability/experience-frontmatter.d.ts.map +0 -1
- package/dist/observability/experience-frontmatter.js.map +0 -1
- package/dist/observability/experience.d.ts.map +0 -1
- package/dist/observability/experience.js.map +0 -1
- package/dist/observability/feedback-matchers.d.ts.map +0 -1
- package/dist/observability/feedback-matchers.js.map +0 -1
- package/dist/observability/feedback-projection.d.ts.map +0 -1
- package/dist/observability/feedback-projection.js.map +0 -1
- package/dist/observability/inbox-view-model.d.ts.map +0 -1
- package/dist/observability/inbox-view-model.js.map +0 -1
- package/dist/observability/inbox.d.ts.map +0 -1
- package/dist/observability/inbox.js.map +0 -1
- package/dist/observability/problem-patterns.d.ts.map +0 -1
- package/dist/observability/problem-patterns.js.map +0 -1
- package/dist/observability/resolved-review.d.ts.map +0 -1
- package/dist/observability/resolved-review.js.map +0 -1
- package/dist/observability/review-state.d.ts.map +0 -1
- package/dist/observability/review-state.js.map +0 -1
- package/dist/observability/skill-chain-advisories.d.ts.map +0 -1
- package/dist/observability/skill-chain-advisories.js.map +0 -1
- package/dist/observability/skill-chain.d.ts.map +0 -1
- package/dist/observability/skill-chain.js.map +0 -1
- package/dist/observability/skill-health-analyzer.d.ts.map +0 -1
- package/dist/observability/skill-health-analyzer.js.map +0 -1
- package/dist/observability/soft-standards/constants.d.ts.map +0 -1
- package/dist/observability/soft-standards/constants.js.map +0 -1
- package/dist/observability/soft-standards/index.d.ts.map +0 -1
- package/dist/observability/soft-standards/index.js.map +0 -1
- package/dist/observability/soft-standards/llm-extractor.d.ts.map +0 -1
- package/dist/observability/soft-standards/llm-extractor.js.map +0 -1
- package/dist/observability/soft-standards/runtime-evaluator.d.ts.map +0 -1
- package/dist/observability/soft-standards/runtime-evaluator.js.map +0 -1
- package/dist/observability/soft-standards/skill-standards-store.d.ts.map +0 -1
- package/dist/observability/soft-standards/skill-standards-store.js.map +0 -1
- package/dist/observability/soft-standards/types.d.ts.map +0 -1
- package/dist/observability/soft-standards/types.js.map +0 -1
- package/dist/observability/text-signals.d.ts.map +0 -1
- package/dist/observability/text-signals.js.map +0 -1
- package/dist/observability/trace-adapter.d.ts.map +0 -1
- package/dist/observability/trace-adapter.js.map +0 -1
- package/dist/observability/trace-attribution.d.ts.map +0 -1
- package/dist/observability/trace-attribution.js.map +0 -1
- package/dist/observability/trace-segmenter.d.ts.map +0 -1
- package/dist/observability/trace-segmenter.js.map +0 -1
- package/dist/observability/trace-source.d.ts.map +0 -1
- package/dist/observability/trace-source.js.map +0 -1
- package/dist/renderer/html-renderer.d.ts.map +0 -1
- package/dist/renderer/html-renderer.js.map +0 -1
- package/dist/renderer/layout.d.ts.map +0 -1
- package/dist/renderer/layout.js.map +0 -1
- package/dist/renderer/observation-inbox/helpers.d.ts.map +0 -1
- package/dist/renderer/observation-inbox/helpers.js.map +0 -1
- package/dist/renderer/observation-inbox/styles.d.ts.map +0 -1
- package/dist/renderer/observation-inbox/styles.js.map +0 -1
- package/dist/renderer/observation-inbox-renderer.d.ts.map +0 -1
- package/dist/renderer/observation-inbox-renderer.js.map +0 -1
- package/dist/renderer/skill-detail-renderer.d.ts.map +0 -1
- package/dist/renderer/skill-detail-renderer.js.map +0 -1
- package/dist/renderer/skill-health-renderer.d.ts.map +0 -1
- package/dist/renderer/skill-health-renderer.js.map +0 -1
- package/dist/renderer/skill-list-renderer.d.ts.map +0 -1
- package/dist/renderer/skill-list-renderer.js.map +0 -1
- package/dist/renderer/summary.d.ts.map +0 -1
- package/dist/renderer/summary.js.map +0 -1
- package/dist/renderer/table.d.ts.map +0 -1
- package/dist/renderer/table.js.map +0 -1
- package/dist/renderer/test-view.d.ts.map +0 -1
- package/dist/renderer/test-view.js.map +0 -1
- package/dist/renderer/trends.d.ts.map +0 -1
- package/dist/renderer/trends.js.map +0 -1
- package/dist/server/job-store.d.ts.map +0 -1
- package/dist/server/job-store.js.map +0 -1
- package/dist/server/report-server.d.ts.map +0 -1
- package/dist/server/report-server.js.map +0 -1
- package/dist/server/report-store.d.ts.map +0 -1
- package/dist/server/report-store.js.map +0 -1
- package/dist/server/skill-index.d.ts.map +0 -1
- package/dist/server/skill-index.js.map +0 -1
- package/dist/server/skill-insights.d.ts.map +0 -1
- package/dist/server/skill-insights.js.map +0 -1
- package/dist/shared/hard-rules.d.ts.map +0 -1
- package/dist/shared/hard-rules.js.map +0 -1
- package/dist/shared/llm-prompts/index.d.ts.map +0 -1
- package/dist/shared/llm-prompts/index.js.map +0 -1
- package/dist/shared/llm-prompts/skill-health.d.ts.map +0 -1
- package/dist/shared/llm-prompts/skill-health.js.map +0 -1
- package/dist/shared/time.d.ts.map +0 -1
- package/dist/shared/time.js.map +0 -1
- package/dist/shared/tool-search.d.ts.map +0 -1
- package/dist/shared/tool-search.js.map +0 -1
- package/dist/types/dependencies.d.ts.map +0 -1
- package/dist/types/dependencies.js.map +0 -1
- package/dist/types/diagnosis.d.ts.map +0 -1
- package/dist/types/diagnosis.js.map +0 -1
- package/dist/types/doctor.d.ts.map +0 -1
- package/dist/types/doctor.js.map +0 -1
- package/dist/types/eval.d.ts.map +0 -1
- package/dist/types/eval.js.map +0 -1
- package/dist/types/executor.d.ts.map +0 -1
- package/dist/types/executor.js.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/judge.d.ts.map +0 -1
- package/dist/types/judge.js.map +0 -1
- package/dist/types/observability.d.ts.map +0 -1
- package/dist/types/observability.js.map +0 -1
- package/dist/types/report.d.ts.map +0 -1
- package/dist/types/report.js.map +0 -1
- package/dist/types/shared.d.ts.map +0 -1
- package/dist/types/shared.js.map +0 -1
- package/dist/types/skill-index.d.ts.map +0 -1
- package/dist/types/skill-index.js.map +0 -1
- package/dist/types/storage.d.ts.map +0 -1
- package/dist/types/storage.js.map +0 -1
- package/dist/util/safe-slice.d.ts.map +0 -1
- package/dist/util/safe-slice.js.map +0 -1
package/dist/cli/lib/shared.js
CHANGED
|
@@ -5,7 +5,7 @@ export function requireEvaluationReport(report, id, lang) {
|
|
|
5
5
|
console.error(tCli('cli.common.report_not_found', lang, { id }));
|
|
6
6
|
throw new CliExit(1);
|
|
7
7
|
}
|
|
8
|
-
if (report.
|
|
8
|
+
if (report.reportKind === 'batch-evaluation') {
|
|
9
9
|
console.error(lang === 'zh'
|
|
10
10
|
? `报告 ${id} 是 BatchEvaluationReport。该命令需要单次 EvaluationReport;请使用其中的 child reportId。`
|
|
11
11
|
: `Report ${id} is a BatchEvaluationReport. This command requires an EvaluationReport; use a child reportId from the batch.`);
|
|
@@ -23,4 +23,3 @@ export function parseLastWindow(spec) {
|
|
|
23
23
|
const ms = unit === 'd' ? n * 86400_000 : unit === 'h' ? n * 3600_000 : n * 60_000;
|
|
24
24
|
return new Date(Date.now() - ms).toISOString();
|
|
25
25
|
}
|
|
26
|
-
//# sourceMappingURL=shared.js.map
|
|
@@ -5,5 +5,69 @@ import { type CliLang } from './i18n.js';
|
|
|
5
5
|
* - release > prerelease(同 MAJOR.MINOR.PATCH)
|
|
6
6
|
* - prerelease 之间按 dot-separated identifier 比较(数字段当数字,字母段当字符串) */
|
|
7
7
|
export declare function isSemverGt(a: string, b: string): boolean;
|
|
8
|
+
/** 落盘缓存。展示只读它(热路径零网络);registry 抓取在后台写它,供下次运行用。 */
|
|
9
|
+
export interface UpdateCache {
|
|
10
|
+
/** 上次抓到的 registry latest 版本。后台抓取成功才有;只发起过、还没成功时缺位。 */
|
|
11
|
+
latestVersion?: string;
|
|
12
|
+
/** 上次「发起检查」的时间(ISO)—— 成功失败都更新,是 20h 重抓节流的锚点。
|
|
13
|
+
* 父进程在 spawn 刷新前就写它,这样 registry 不通时也不会每条命令都重新拉起后台检查。 */
|
|
14
|
+
lastCheckedAt: string;
|
|
15
|
+
/** 上次提示过的版本,用于「同版本 20h 内不重复提示」。 */
|
|
16
|
+
lastNotifiedVersion?: string;
|
|
17
|
+
/** 上次提示时间(ISO)。 */
|
|
18
|
+
lastNotifiedAt?: string;
|
|
19
|
+
}
|
|
20
|
+
interface BoxParts {
|
|
21
|
+
current: string;
|
|
22
|
+
latest: string;
|
|
23
|
+
upgradeCmd: string;
|
|
24
|
+
silenceHint: string;
|
|
25
|
+
}
|
|
26
|
+
/** 缓存落盘走仓库既有约定 `~/.oh-my-knowledge/<...>`(见 src/eval-core/cache.ts、
|
|
27
|
+
* src/server/job-store.ts)。home 可注入,方便测试传 tmp 目录。 */
|
|
28
|
+
export declare function defaultCachePath(home?: string): string;
|
|
29
|
+
/** 读缓存。缺失 / 损坏 / 非对象 / 缺时间锚点一律返回 null,调用方按「无缓存」处理。
|
|
30
|
+
* lastCheckedAt(节流锚点)必须有;latestVersion 可缺(只发起过、还没抓成功的记录)。 */
|
|
31
|
+
export declare function readCache(path: string): UpdateCache | null;
|
|
32
|
+
/** 原子写(temp + rename),避免两个 omk 进程并发写出半截 JSON。homedir 不可写时
|
|
33
|
+
* 整体静默失败 — 退化为「每次后台重抓」,不崩。 */
|
|
34
|
+
export declare function writeCache(path: string, data: UpdateCache): void;
|
|
35
|
+
/** 是否该提示:有缓存的 latest 严格高于当前版本,且(没提示过这个版本 / 距上次提示超 20h)。
|
|
36
|
+
* 纯函数,now 外部注入,便于确定性测试。 */
|
|
37
|
+
export declare function shouldNotify(cache: UpdateCache | null, currentVersion: string, now: Date, throttleMs?: number): boolean;
|
|
38
|
+
/** 缓存是否过期(需后台重抓):无缓存 / 时间戳缺失或不可解析 / 超 ttl。 */
|
|
39
|
+
export declare function isStale(cache: UpdateCache | null, now: Date, ttlMs?: number): boolean;
|
|
40
|
+
/** 一次运行该做什么(纯函数,now 注入,便于确定性测试):
|
|
41
|
+
* - notify:是否展示提示(仅凭缓存,无网络)。
|
|
42
|
+
* - refresh:是否发起后台刷新。
|
|
43
|
+
* - nextCache:需要落盘的新缓存,null 表示无需写。
|
|
44
|
+
*
|
|
45
|
+
* 关键:refresh 为真时,nextCache 一定带上 `lastCheckedAt = now` —— 即「发起检查」这件事本身
|
|
46
|
+
* 会立即落盘,所以 registry 持续不通时,下一次运行看到新鲜的 lastCheckedAt 就不再重复 spawn,
|
|
47
|
+
* 20h 节流对离线/失败同样生效(不退化成每条命令拉起后台检查)。 */
|
|
48
|
+
export declare function planUpdateActions(cache: UpdateCache | null, currentVersion: string, now: Date): {
|
|
49
|
+
notify: boolean;
|
|
50
|
+
refresh: boolean;
|
|
51
|
+
nextCache: UpdateCache | null;
|
|
52
|
+
};
|
|
53
|
+
/** 终端可视宽度:全角 / CJK codepoint 计 2,其余计 1。用 [...str] 逐 codepoint
|
|
54
|
+
* 迭代以正确处理代理对。框内只用 width-1 的 ↑(U+2191)/→(U+2192),不放 emoji,
|
|
55
|
+
* 避免 emoji 宽度歧义破坏右边框对齐。 */
|
|
56
|
+
export declare function visualWidth(str: string): number;
|
|
57
|
+
/** 右补空格到目标可视宽度(已超宽则原样返回)。 */
|
|
58
|
+
export declare function padToWidth(str: string, target: number): string;
|
|
59
|
+
/** 渲染多行高亮边框(纯函数,可快照测试)。内宽取各行最大可视宽度,逐行用
|
|
60
|
+
* padToWidth 对齐后画 ┌┐└┘─│ 框,返回前后留白、以 \n 结尾的整串。 */
|
|
61
|
+
export declare function renderUpdateBox(parts: BoxParts, lang: CliLang): string;
|
|
62
|
+
/** 选染提示文案:TTY 下多行高亮框,管道 / 非 TTY 退回单行(不污染输出)。纯函数,
|
|
63
|
+
* isTty 注入便于测试两条分支。 */
|
|
64
|
+
export declare function renderNotice(parts: BoxParts, pkgName: string, lang: CliLang, isTty: boolean): string;
|
|
65
|
+
/** spawn 一个 detached + unref 的子进程跑 worker。子进程启动失败(ENOENT / EACCES /
|
|
66
|
+
* EAGAIN)是异步 `error` 事件 —— 不挂 listener 的话 Node 会当 uncaught exception 抛出、
|
|
67
|
+
* 反过来拖垮主命令,所以必须挂个空 handler 吞掉,维持升级检查全程 fail-silent。 */
|
|
68
|
+
export declare function spawnDetached(scriptPath: string, args: string[]): void;
|
|
69
|
+
/** 升级提示:展示与抓取解耦。本次运行只读缓存即时决定是否提示(热路径零网络);
|
|
70
|
+
* 缓存过期时后台抓一次写回,供下次用。首次运行(无缓存)不提示。全程 fail-silent,
|
|
71
|
+
* 由 index.ts 在非短路径下 fire-and-forget 调用。 */
|
|
8
72
|
export declare function checkUpdate(lang: CliLang): Promise<void>;
|
|
9
|
-
|
|
73
|
+
export {};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
1
6
|
import { tCli } from './i18n.js';
|
|
2
7
|
/** 严格按 SemVer 2.0 precedence 判断 `a > b`(只覆盖本仓库实际使用的形态:
|
|
3
8
|
* MAJOR.MINOR.PATCH 可选 `-prerelease`)。非法字符串直接返回 false,update-check
|
|
@@ -71,43 +76,226 @@ function shouldSkipUpdateCheck() {
|
|
|
71
76
|
return true;
|
|
72
77
|
return false;
|
|
73
78
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
/** 统一的 20h 时间窗,两处共用:同一新版本最多提示一次的节流窗口、registry 重抓的过期窗口。
|
|
80
|
+
* 够长,高频命令下既不反复打网络也不反复 nag;又短于一天,用户隔天能再被提醒一次。 */
|
|
81
|
+
const UPDATE_WINDOW_MS = 20 * 3600_000;
|
|
82
|
+
/** 缓存落盘走仓库既有约定 `~/.oh-my-knowledge/<...>`(见 src/eval-core/cache.ts、
|
|
83
|
+
* src/server/job-store.ts)。home 可注入,方便测试传 tmp 目录。 */
|
|
84
|
+
export function defaultCachePath(home = homedir()) {
|
|
85
|
+
return join(home, '.oh-my-knowledge', 'update-check.json');
|
|
86
|
+
}
|
|
87
|
+
/** 读缓存。缺失 / 损坏 / 非对象 / 缺时间锚点一律返回 null,调用方按「无缓存」处理。
|
|
88
|
+
* lastCheckedAt(节流锚点)必须有;latestVersion 可缺(只发起过、还没抓成功的记录)。 */
|
|
89
|
+
export function readCache(path) {
|
|
77
90
|
try {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
// 装到 npm 跑 dist/cli/lib/ 时 3 层到 oh-my-knowledge/。5 次给点 buffer。
|
|
84
|
-
const findPackageJson = (startDir) => {
|
|
85
|
-
let dir = startDir;
|
|
86
|
-
for (let i = 0; i < 5; i++) {
|
|
87
|
-
const candidate = join(dir, 'package.json');
|
|
88
|
-
if (existsSync(candidate))
|
|
89
|
-
return candidate;
|
|
90
|
-
dir = dirname(dir);
|
|
91
|
-
}
|
|
91
|
+
const parsed = JSON.parse(readFileSync(path, 'utf-8'));
|
|
92
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
93
|
+
return null;
|
|
94
|
+
const obj = parsed;
|
|
95
|
+
if (typeof obj.lastCheckedAt !== 'string')
|
|
92
96
|
return null;
|
|
97
|
+
const str = (v) => (typeof v === 'string' ? v : undefined);
|
|
98
|
+
return {
|
|
99
|
+
latestVersion: str(obj.latestVersion),
|
|
100
|
+
lastCheckedAt: obj.lastCheckedAt,
|
|
101
|
+
lastNotifiedVersion: str(obj.lastNotifiedVersion),
|
|
102
|
+
lastNotifiedAt: str(obj.lastNotifiedAt),
|
|
93
103
|
};
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** 原子写(temp + rename),避免两个 omk 进程并发写出半截 JSON。homedir 不可写时
|
|
110
|
+
* 整体静默失败 — 退化为「每次后台重抓」,不崩。 */
|
|
111
|
+
export function writeCache(path, data) {
|
|
112
|
+
try {
|
|
113
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
114
|
+
const tmp = `${path}.tmp.${process.pid}`;
|
|
115
|
+
writeFileSync(tmp, JSON.stringify(data, null, 2));
|
|
116
|
+
renameSync(tmp, path);
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
/* 静默:缓存是装饰性状态,写不进去不影响功能 */
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** 是否该提示:有缓存的 latest 严格高于当前版本,且(没提示过这个版本 / 距上次提示超 20h)。
|
|
123
|
+
* 纯函数,now 外部注入,便于确定性测试。 */
|
|
124
|
+
export function shouldNotify(cache, currentVersion, now, throttleMs = UPDATE_WINDOW_MS) {
|
|
125
|
+
if (!cache?.latestVersion || !isSemverGt(cache.latestVersion, currentVersion))
|
|
126
|
+
return false;
|
|
127
|
+
if (cache.lastNotifiedVersion !== cache.latestVersion)
|
|
128
|
+
return true;
|
|
129
|
+
if (!cache.lastNotifiedAt)
|
|
130
|
+
return true;
|
|
131
|
+
const last = Date.parse(cache.lastNotifiedAt);
|
|
132
|
+
if (Number.isNaN(last))
|
|
133
|
+
return true;
|
|
134
|
+
return now.getTime() - last > throttleMs;
|
|
135
|
+
}
|
|
136
|
+
/** 缓存是否过期(需后台重抓):无缓存 / 时间戳缺失或不可解析 / 超 ttl。 */
|
|
137
|
+
export function isStale(cache, now, ttlMs = UPDATE_WINDOW_MS) {
|
|
138
|
+
if (!cache?.lastCheckedAt)
|
|
139
|
+
return true;
|
|
140
|
+
const last = Date.parse(cache.lastCheckedAt);
|
|
141
|
+
if (Number.isNaN(last))
|
|
142
|
+
return true;
|
|
143
|
+
return now.getTime() - last > ttlMs;
|
|
144
|
+
}
|
|
145
|
+
/** 一次运行该做什么(纯函数,now 注入,便于确定性测试):
|
|
146
|
+
* - notify:是否展示提示(仅凭缓存,无网络)。
|
|
147
|
+
* - refresh:是否发起后台刷新。
|
|
148
|
+
* - nextCache:需要落盘的新缓存,null 表示无需写。
|
|
149
|
+
*
|
|
150
|
+
* 关键:refresh 为真时,nextCache 一定带上 `lastCheckedAt = now` —— 即「发起检查」这件事本身
|
|
151
|
+
* 会立即落盘,所以 registry 持续不通时,下一次运行看到新鲜的 lastCheckedAt 就不再重复 spawn,
|
|
152
|
+
* 20h 节流对离线/失败同样生效(不退化成每条命令拉起后台检查)。 */
|
|
153
|
+
export function planUpdateActions(cache, currentVersion, now) {
|
|
154
|
+
const nowIso = now.toISOString();
|
|
155
|
+
const notify = shouldNotify(cache, currentVersion, now);
|
|
156
|
+
const refresh = isStale(cache, now);
|
|
157
|
+
let nextCache = null;
|
|
158
|
+
if (notify && cache) {
|
|
159
|
+
nextCache = { ...cache, lastNotifiedVersion: cache.latestVersion, lastNotifiedAt: nowIso };
|
|
160
|
+
}
|
|
161
|
+
if (refresh) {
|
|
162
|
+
nextCache = { ...(nextCache ?? cache ?? {}), lastCheckedAt: nowIso };
|
|
163
|
+
}
|
|
164
|
+
return { notify, refresh, nextCache };
|
|
165
|
+
}
|
|
166
|
+
/** 终端可视宽度:全角 / CJK codepoint 计 2,其余计 1。用 [...str] 逐 codepoint
|
|
167
|
+
* 迭代以正确处理代理对。框内只用 width-1 的 ↑(U+2191)/→(U+2192),不放 emoji,
|
|
168
|
+
* 避免 emoji 宽度歧义破坏右边框对齐。 */
|
|
169
|
+
export function visualWidth(str) {
|
|
170
|
+
let width = 0;
|
|
171
|
+
for (const ch of str) {
|
|
172
|
+
const cp = ch.codePointAt(0) ?? 0;
|
|
173
|
+
width += isWideCodePoint(cp) ? 2 : 1;
|
|
174
|
+
}
|
|
175
|
+
return width;
|
|
176
|
+
}
|
|
177
|
+
function isWideCodePoint(cp) {
|
|
178
|
+
return ((cp >= 0x1100 && cp <= 0x115f) || // Hangul Jamo
|
|
179
|
+
(cp >= 0x2e80 && cp <= 0xa4cf) || // CJK 部首 … 彝文;含 CJK 标点(3000-303F「。、」)与统一表意(4E00-9FFF)
|
|
180
|
+
(cp >= 0xac00 && cp <= 0xd7a3) || // Hangul 音节
|
|
181
|
+
(cp >= 0xf900 && cp <= 0xfaff) || // CJK 兼容表意
|
|
182
|
+
(cp >= 0xfe30 && cp <= 0xfe4f) || // CJK 兼容形式
|
|
183
|
+
(cp >= 0xff00 && cp <= 0xff60) || // 全角 ASCII / 标点
|
|
184
|
+
(cp >= 0xffe0 && cp <= 0xffe6) // 全角符号
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
/** 右补空格到目标可视宽度(已超宽则原样返回)。 */
|
|
188
|
+
export function padToWidth(str, target) {
|
|
189
|
+
const pad = target - visualWidth(str);
|
|
190
|
+
return pad > 0 ? str + ' '.repeat(pad) : str;
|
|
191
|
+
}
|
|
192
|
+
/** 渲染多行高亮边框(纯函数,可快照测试)。内宽取各行最大可视宽度,逐行用
|
|
193
|
+
* padToWidth 对齐后画 ┌┐└┘─│ 框,返回前后留白、以 \n 结尾的整串。 */
|
|
194
|
+
export function renderUpdateBox(parts, lang) {
|
|
195
|
+
const lines = [
|
|
196
|
+
tCli('cli.update.box_title', lang),
|
|
197
|
+
tCli('cli.update.box_version_line', lang, { old: parts.current, new: parts.latest }),
|
|
198
|
+
tCli('cli.update.box_upgrade_line', lang, { cmd: parts.upgradeCmd }),
|
|
199
|
+
tCli('cli.update.box_silence_line', lang, { env: parts.silenceHint }),
|
|
200
|
+
];
|
|
201
|
+
const inner = Math.max(...lines.map(visualWidth));
|
|
202
|
+
const top = `┌${'─'.repeat(inner + 2)}┐`;
|
|
203
|
+
const bottom = `└${'─'.repeat(inner + 2)}┘`;
|
|
204
|
+
const body = lines.map((l) => `│ ${padToWidth(l, inner)} │`);
|
|
205
|
+
return `\n${[top, ...body, bottom].join('\n')}\n\n`;
|
|
206
|
+
}
|
|
207
|
+
/** 选染提示文案:TTY 下多行高亮框,管道 / 非 TTY 退回单行(不污染输出)。纯函数,
|
|
208
|
+
* isTty 注入便于测试两条分支。 */
|
|
209
|
+
export function renderNotice(parts, pkgName, lang, isTty) {
|
|
210
|
+
if (isTty)
|
|
211
|
+
return renderUpdateBox(parts, lang);
|
|
212
|
+
return tCli('cli.update.new_version_available', lang, {
|
|
213
|
+
old: parts.current,
|
|
214
|
+
new: parts.latest,
|
|
215
|
+
pkg: pkgName,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
/** 从当前文件位置向上找 package.json:dev 跑 src/cli/lib/ 时 3 层到根,
|
|
219
|
+
* 装到 npm 跑 dist/cli/lib/ 时 3 层到 oh-my-knowledge/。5 次给点 buffer。 */
|
|
220
|
+
function readLocalPkg() {
|
|
221
|
+
try {
|
|
222
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
223
|
+
for (let i = 0; i < 5; i++) {
|
|
224
|
+
const candidate = join(dir, 'package.json');
|
|
225
|
+
if (existsSync(candidate)) {
|
|
226
|
+
const pkg = JSON.parse(readFileSync(candidate, 'utf-8'));
|
|
227
|
+
if (!pkg.name || !pkg.version)
|
|
228
|
+
return null;
|
|
229
|
+
return {
|
|
230
|
+
name: pkg.name,
|
|
231
|
+
version: pkg.version,
|
|
232
|
+
// 优先用用户实际安装源(npm 从 .npmrc 注入 npm_config_registry),再退 publish 目标,最后兜底官方源
|
|
233
|
+
registry: process.env.npm_config_registry || pkg.publishConfig?.registry || 'https://registry.npmjs.org',
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
dir = dirname(dir);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
/* fall through */
|
|
241
|
+
}
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
/** 后台刷新:spawn 一个 detached + unref 的子进程去抓 registry latest 写回缓存,跟父进程
|
|
245
|
+
* 生命周期解耦 —— native fetch 的网络 handle 会让进程存活到请求完成 / 3s abort,留在父进程里
|
|
246
|
+
* 会拖住快命令的退出;丢给独立子进程后,父进程发完 spawn 立即返回、可正常退出,热路径零网络。
|
|
247
|
+
* worker 只在编译产物(dist/cli/lib/)里有 `.js`;dev 直接跑源码时不存在,existsSync 兜底跳过。 */
|
|
248
|
+
function fetchAndStore(path, pkg) {
|
|
249
|
+
try {
|
|
250
|
+
const worker = join(dirname(fileURLToPath(import.meta.url)), 'update-fetch-worker.js');
|
|
251
|
+
if (!existsSync(worker))
|
|
96
252
|
return;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
253
|
+
spawnDetached(worker, [path, pkg.registry, pkg.name]);
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
/* 静默:spawn 同步抛错(罕见)不影响正常使用 */
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/** spawn 一个 detached + unref 的子进程跑 worker。子进程启动失败(ENOENT / EACCES /
|
|
260
|
+
* EAGAIN)是异步 `error` 事件 —— 不挂 listener 的话 Node 会当 uncaught exception 抛出、
|
|
261
|
+
* 反过来拖垮主命令,所以必须挂个空 handler 吞掉,维持升级检查全程 fail-silent。 */
|
|
262
|
+
export function spawnDetached(scriptPath, args) {
|
|
263
|
+
const child = spawn(process.execPath, [scriptPath, ...args], { detached: true, stdio: 'ignore' });
|
|
264
|
+
child.on('error', () => {
|
|
265
|
+
/* 静默:子进程起不来不影响主命令 */
|
|
266
|
+
});
|
|
267
|
+
child.unref();
|
|
268
|
+
}
|
|
269
|
+
/** 升级提示:展示与抓取解耦。本次运行只读缓存即时决定是否提示(热路径零网络);
|
|
270
|
+
* 缓存过期时后台抓一次写回,供下次用。首次运行(无缓存)不提示。全程 fail-silent,
|
|
271
|
+
* 由 index.ts 在非短路径下 fire-and-forget 调用。 */
|
|
272
|
+
export async function checkUpdate(lang) {
|
|
273
|
+
if (shouldSkipUpdateCheck())
|
|
274
|
+
return;
|
|
275
|
+
try {
|
|
276
|
+
const pkg = readLocalPkg();
|
|
277
|
+
if (!pkg)
|
|
101
278
|
return;
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
279
|
+
const path = defaultCachePath();
|
|
280
|
+
const cache = readCache(path);
|
|
281
|
+
const plan = planUpdateActions(cache, pkg.version, new Date());
|
|
282
|
+
// 展示:仅凭缓存,无网络
|
|
283
|
+
if (plan.notify && cache?.latestVersion) {
|
|
284
|
+
const parts = {
|
|
285
|
+
current: pkg.version,
|
|
286
|
+
latest: cache.latestVersion,
|
|
287
|
+
upgradeCmd: 'npm i -g oh-my-knowledge@latest',
|
|
288
|
+
silenceHint: 'OMK_SKIP_UPDATE_CHECK=1',
|
|
289
|
+
};
|
|
290
|
+
process.stderr.write(renderNotice(parts, pkg.name, lang, process.stderr.isTTY === true));
|
|
109
291
|
}
|
|
292
|
+
// 先把「发起检查」落盘(节流锚点),再 spawn 后台刷新 —— 失败/离线也不会每条命令重来
|
|
293
|
+
if (plan.nextCache)
|
|
294
|
+
writeCache(path, plan.nextCache);
|
|
295
|
+
if (plan.refresh)
|
|
296
|
+
fetchAndStore(path, pkg);
|
|
297
|
+
}
|
|
298
|
+
catch {
|
|
299
|
+
/* 静默失败,不影响正常使用 */
|
|
110
300
|
}
|
|
111
|
-
catch { /* 静默失败,不影响正常使用 */ }
|
|
112
301
|
}
|
|
113
|
-
//# sourceMappingURL=update-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 升级检查的后台刷新 worker。由 update-check.ts 的 fetchAndStore 以 detached + unref
|
|
3
|
+
* spawn,独立于父 CLI 进程运行:抓 registry latest 写回 ~/.oh-my-knowledge/update-check.json,
|
|
4
|
+
* 供下次运行展示用。父进程不等它,所以这里阻塞式 await fetch 没关系。全程 fail-silent。
|
|
5
|
+
*
|
|
6
|
+
* argv: [node, update-fetch-worker.js, cachePath, registry, pkgName]
|
|
7
|
+
*/
|
|
8
|
+
import { readCache, writeCache } from './update-check.js';
|
|
9
|
+
async function main() {
|
|
10
|
+
const [cachePath, registry, name] = process.argv.slice(2);
|
|
11
|
+
if (!cachePath || !registry || !name)
|
|
12
|
+
return;
|
|
13
|
+
try {
|
|
14
|
+
const res = await fetch(`${registry.replace(/\/$/, '')}/${name}/latest`, {
|
|
15
|
+
signal: AbortSignal.timeout(3000),
|
|
16
|
+
});
|
|
17
|
+
if (!res.ok)
|
|
18
|
+
return;
|
|
19
|
+
const data = (await res.json());
|
|
20
|
+
if (!data.version)
|
|
21
|
+
return;
|
|
22
|
+
const prev = readCache(cachePath); // 重读以保留展示侧写的 notify 节流字段,别覆盖
|
|
23
|
+
writeCache(cachePath, {
|
|
24
|
+
latestVersion: data.version,
|
|
25
|
+
lastCheckedAt: new Date().toISOString(),
|
|
26
|
+
lastNotifiedVersion: prev?.lastNotifiedVersion,
|
|
27
|
+
lastNotifiedAt: prev?.lastNotifiedAt,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
/* 静默:网络 / 超时 / 解析 / 磁盘任一失败都不影响 */
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
void main();
|
package/dist/cli/oclif/help.d.ts
CHANGED
package/dist/cli/oclif/help.js
CHANGED
package/dist/cli/oclif/i18n.d.ts
CHANGED
|
@@ -13,4 +13,3 @@ export declare const LANG_FLAG: import("@oclif/core/interfaces").OptionFlag<stri
|
|
|
13
13
|
export declare function pickLang(text: string | undefined, lang: Lang): string | undefined;
|
|
14
14
|
/** 从 process.argv 解析 lang,优先级跟 ../i18n.ts 的 getCliLang 一致:CLI flag > OMK_LANG > zh。 */
|
|
15
15
|
export declare function resolveLang(argv?: readonly string[]): Lang;
|
|
16
|
-
//# sourceMappingURL=i18n.d.ts.map
|
package/dist/cli/oclif/i18n.js
CHANGED
|
@@ -7,4 +7,3 @@ export declare function integerStringParser(flag: string, options?: NumericStrin
|
|
|
7
7
|
export declare function numberStringParser(flag: string, options?: NumericStringParserOptions): (input: string) => Promise<string>;
|
|
8
8
|
export declare function enumStringParser(flag: string, values: readonly string[]): (input: string) => Promise<string>;
|
|
9
9
|
export {};
|
|
10
|
-
//# sourceMappingURL=parsers.d.ts.map
|
package/dist/cli/oclif/run.d.ts
CHANGED
package/dist/cli/oclif/run.js
CHANGED
|
@@ -18,7 +18,7 @@ export interface SkillChainAdvisorySource {
|
|
|
18
18
|
export interface ObservationRuntimeCheckSource {
|
|
19
19
|
skillName: string;
|
|
20
20
|
id: string;
|
|
21
|
-
|
|
21
|
+
nodeKind: 'hardRule' | 'workflowNode';
|
|
22
22
|
status: 'passed' | 'attention' | 'manual_review';
|
|
23
23
|
title?: string;
|
|
24
24
|
expectation?: string;
|
|
@@ -53,7 +53,7 @@ export interface ExperienceReviewerReportFindingSource {
|
|
|
53
53
|
export interface SkillDerivedStandardSource {
|
|
54
54
|
skillName: string;
|
|
55
55
|
id: string;
|
|
56
|
-
|
|
56
|
+
standardKind: 'hard_rule_candidate' | 'workflow_candidate';
|
|
57
57
|
status: 'pending_review' | 'author_confirmed' | 'rejected' | 'stale';
|
|
58
58
|
title: string;
|
|
59
59
|
body?: string;
|
|
@@ -65,4 +65,3 @@ export interface SkillDerivedStandardSource {
|
|
|
65
65
|
}
|
|
66
66
|
export declare function buildObserveDiagnostics(input: ObserveDiagnosisInput): DiagnosisBundle;
|
|
67
67
|
export declare function maxLifecycle(a: DiagnosisLifecycle, b: DiagnosisLifecycle): DiagnosisLifecycle;
|
|
68
|
-
//# sourceMappingURL=observe-mapper.d.ts.map
|
|
@@ -71,13 +71,13 @@ function advisoryToDiagnosis(generatedAt, advisory) {
|
|
|
71
71
|
function runtimeCheckToDiagnosis(generatedAt, check) {
|
|
72
72
|
if (check.status === 'passed')
|
|
73
73
|
return null;
|
|
74
|
-
const target = check.
|
|
74
|
+
const target = check.nodeKind === 'hardRule' ? `runtime:hardRule:${check.id}` : `runtime:workflowNode:${check.id}`;
|
|
75
75
|
return makeDiagnosis(generatedAt, {
|
|
76
76
|
skillName: check.skillName,
|
|
77
77
|
type: 'runtime_issue',
|
|
78
|
-
signal: check.
|
|
78
|
+
signal: check.nodeKind === 'hardRule' ? 'runtime_hard_rule_review' : 'runtime_workflow_review',
|
|
79
79
|
target,
|
|
80
|
-
title: check.title ?? (check.
|
|
80
|
+
title: check.title ?? (check.nodeKind === 'hardRule' ? 'Hard rule runtime check needs review' : 'Workflow runtime check needs review'),
|
|
81
81
|
summary: check.reason ?? check.expectation,
|
|
82
82
|
severity: check.status === 'manual_review' ? 'medium' : 'low',
|
|
83
83
|
audience: 'reviewer',
|
|
@@ -135,14 +135,14 @@ function derivedStandardToDiagnosis(generatedAt, standard) {
|
|
|
135
135
|
return makeDiagnosis(generatedAt, {
|
|
136
136
|
skillName: standard.skillName,
|
|
137
137
|
type: 'standard_candidate',
|
|
138
|
-
signal: standard.
|
|
139
|
-
target: `standard:${standard.
|
|
138
|
+
signal: standard.standardKind,
|
|
139
|
+
target: `standard:${standard.standardKind}:${standard.id}`,
|
|
140
140
|
title: standard.title,
|
|
141
141
|
summary: standard.body,
|
|
142
142
|
severity: standard.status === 'author_confirmed' ? 'info' : 'low',
|
|
143
143
|
audience: 'skill-author',
|
|
144
144
|
lifecycle: lifecycleFromStandardStatus(standard.status),
|
|
145
|
-
sourceKind: standard.
|
|
145
|
+
sourceKind: standard.standardKind,
|
|
146
146
|
sourceId: standard.id,
|
|
147
147
|
evidenceRefs: [],
|
|
148
148
|
producer: standard.source === 'manual' ? 'manual' : 'llm_soft',
|
|
@@ -273,4 +273,3 @@ function severityRank(severity) {
|
|
|
273
273
|
function hashParts(...parts) {
|
|
274
274
|
return createHash('sha256').update(parts.join('\u0000')).digest('hex').slice(0, 16);
|
|
275
275
|
}
|
|
276
|
-
//# sourceMappingURL=observe-mapper.js.map
|
|
@@ -6,4 +6,3 @@ export interface BuildObserveDiagnosticsFromReportOptions {
|
|
|
6
6
|
skillChains?: Record<string, ObservationSkillChain>;
|
|
7
7
|
}
|
|
8
8
|
export declare function buildObserveDiagnosticsFromReport(report: ObservationInboxReport, options?: BuildObserveDiagnosticsFromReportOptions): DiagnosisBundle;
|
|
9
|
-
//# sourceMappingURL=observe-producer.d.ts.map
|
|
@@ -112,7 +112,7 @@ function chainRuntimeChecks(chain) {
|
|
|
112
112
|
.map((check) => ({
|
|
113
113
|
skillName: chain.skillName,
|
|
114
114
|
id: check.id,
|
|
115
|
-
|
|
115
|
+
nodeKind: check.nodeKind,
|
|
116
116
|
status: check.status,
|
|
117
117
|
title: check.title,
|
|
118
118
|
expectation: check.expectation,
|
|
@@ -123,8 +123,8 @@ function chainRuntimeChecks(chain) {
|
|
|
123
123
|
}
|
|
124
124
|
function evidenceRefsFromRuntimeCheck(check, skillName) {
|
|
125
125
|
return (check.evidenceSnippets ?? []).map((snippet, index) => ({
|
|
126
|
-
id: `runtime:${skillName}:${check.
|
|
127
|
-
kind: check.
|
|
126
|
+
id: `runtime:${skillName}:${check.nodeKind}:${check.id}:${index}`,
|
|
127
|
+
kind: check.nodeKind,
|
|
128
128
|
label: check.title,
|
|
129
129
|
snippet,
|
|
130
130
|
}));
|
|
@@ -196,4 +196,3 @@ function evidenceRef(ref) {
|
|
|
196
196
|
snippet: ref.snippet,
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
//# sourceMappingURL=observe-producer.js.map
|
|
@@ -4,4 +4,3 @@ export declare function buildStudioDiagnosisSummary(bundle?: DiagnosisBundle): S
|
|
|
4
4
|
export declare function countDiagnostics(bundle?: DiagnosisBundle): number;
|
|
5
5
|
export declare function mergeDiagnosisBundles(bundles: DiagnosisBundle[], generatedAt?: string): DiagnosisBundle;
|
|
6
6
|
export declare function activeStudioDiagnostics(bundle?: DiagnosisBundle): Diagnosis[];
|
|
7
|
-
//# sourceMappingURL=studio-projection.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export type { Diagnosis, DiagnosisAudience, DiagnosisBundle, DiagnosisEvidenceRef, DiagnosisLifecycle, DiagnosisOccurrence, DiagnosisPatch, DiagnosisScope, DiagnosisSeverity, DiagnosisSource, DiagnosisSourceCoverage, DiagnosisType, StudioDiagnosisSummary, } from '../types/diagnosis.js';
|
|
2
2
|
import type { DiagnosisLifecycle } from '../types/diagnosis.js';
|
|
3
3
|
export declare function isActiveDiagnosisLifecycle(lifecycle: DiagnosisLifecycle): boolean;
|
|
4
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/diagnosis/types.js
CHANGED
package/dist/doctor/fixer.d.ts
CHANGED
package/dist/doctor/fixer.js
CHANGED
|
@@ -16,4 +16,3 @@ import type { ComposerRule } from '../../types/doctor.js';
|
|
|
16
16
|
export declare const SKILL_HEALTH_COMPOSER_ID = "skill_health";
|
|
17
17
|
export type ExecutorFactory = (name: string) => ExecutorFn;
|
|
18
18
|
export declare function makeSkillHealthComposer(execFactory?: ExecutorFactory): ComposerRule;
|
|
19
|
-
//# sourceMappingURL=composer.d.ts.map
|
|
@@ -130,7 +130,7 @@ function listSiblingSkills(skillRoot) {
|
|
|
130
130
|
export function makeSkillHealthComposer(execFactory = defaultExecutorFactory) {
|
|
131
131
|
return {
|
|
132
132
|
id: SKILL_HEALTH_COMPOSER_ID,
|
|
133
|
-
|
|
133
|
+
ruleKind: 'composer',
|
|
134
134
|
severity: 'fatal',
|
|
135
135
|
labelKey: 'cli.doctor.rule.skill_health_check',
|
|
136
136
|
checkAll: (ctx) => composerCheckAll(ctx, execFactory),
|
|
@@ -293,4 +293,3 @@ function errorSummaryOutcome(ctx, phase, errMsg, extra = {}) {
|
|
|
293
293
|
detail: { phase, error: errMsg, ...extra },
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
|
-
//# sourceMappingURL=composer.js.map
|
|
@@ -10,4 +10,3 @@ import type { HealthDimensionSpec } from './dimension-spec.js';
|
|
|
10
10
|
export declare function registerHealthDimension(spec: HealthDimensionSpec): void;
|
|
11
11
|
export declare function getRegisteredHealthDimensions(): HealthDimensionSpec[];
|
|
12
12
|
export declare function __resetHealthDimensionsForTest(): void;
|
|
13
|
-
//# sourceMappingURL=dimension-registry.d.ts.map
|