oh-my-knowledge 0.33.0 → 0.35.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 +21 -5
- package/README.zh.md +25 -9
- 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 +0 -1
- package/dist/analysis/saturation.js +0 -1
- package/dist/assets/agent-skills/omk/SKILL.md +197 -0
- package/dist/assets/agent-skills/omk/references/commands.md +556 -0
- package/dist/authoring/evolver.d.ts +130 -6
- package/dist/authoring/evolver.js +233 -35
- package/dist/authoring/generator.d.ts +0 -1
- package/dist/authoring/generator.js +0 -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 +0 -1
- package/dist/cli/commands/doctor.js +2 -3
- 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 +3 -1
- package/dist/cli/commands/eval/index.js +56 -11
- package/dist/cli/commands/evolve.d.ts +6 -1
- package/dist/cli/commands/evolve.js +77 -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 +24 -0
- package/dist/cli/commands/install.js +436 -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 +0 -1
- 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 +1 -2
- package/dist/cli/commands/sample.js +27 -15
- 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 +7 -1
- package/dist/cli/lib/cmd-flags.js +0 -1
- package/dist/cli/lib/i18n-dict/common.d.ts +0 -1
- package/dist/cli/lib/i18n-dict/common.js +0 -1
- package/dist/cli/lib/i18n-dict/evolve.d.ts +1 -2
- package/dist/cli/lib/i18n-dict/evolve.js +16 -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 +110 -0
- package/dist/cli/lib/i18n-dict/run.d.ts +1 -2
- package/dist/cli/lib/i18n-dict/run.js +8 -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 +0 -1
- package/dist/cli/lib/parse-run-config/variant-resolution.js +41 -8
- 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 +0 -1
- 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 +0 -1
- package/dist/cli/lib/update-check.js +0 -1
- package/dist/cli/lib/update-fetch-worker.d.ts +0 -1
- package/dist/cli/lib/update-fetch-worker.js +0 -1
- 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 +0 -1
- package/dist/doctor/health/load-custom-dimensions.js +0 -1
- 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 +6 -7
- 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 +0 -1
- package/dist/eval-core/bootstrap.js +0 -1
- package/dist/eval-core/cache.d.ts +11 -4
- package/dist/eval-core/cache.js +13 -6
- 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 +5 -3
- package/dist/eval-core/evaluation-execution.d.ts +0 -1
- package/dist/eval-core/evaluation-execution.js +4 -2
- 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 +18 -8
- package/dist/eval-core/execution-strategy.d.ts +0 -1
- package/dist/eval-core/execution-strategy.js +8 -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 +2 -2
- package/dist/eval-core/verdict.d.ts +0 -1
- package/dist/eval-core/verdict.js +0 -1
- 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 +22 -44
- 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 +3 -8
- package/dist/eval-workflows/run-evaluation.js +9 -19
- 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/content-hash.d.ts +28 -0
- package/dist/inputs/content-hash.js +106 -0
- package/dist/inputs/eval-config.d.ts +0 -1
- package/dist/inputs/eval-config.js +44 -11
- package/dist/inputs/load-samples.d.ts +0 -1
- package/dist/inputs/load-samples.js +0 -1
- package/dist/inputs/materialize-copy.d.ts +37 -0
- package/dist/inputs/materialize-copy.js +193 -0
- package/dist/inputs/mcp-resolver.d.ts +0 -1
- package/dist/inputs/mcp-resolver.js +0 -1
- package/dist/inputs/skill-loader.d.ts +145 -12
- package/dist/inputs/skill-loader.js +476 -60
- package/dist/inputs/source-resolver.d.ts +35 -0
- package/dist/inputs/source-resolver.js +105 -0
- package/dist/inputs/url-fetcher.d.ts +0 -1
- package/dist/inputs/url-fetcher.js +0 -1
- package/dist/managed/evidence.d.ts +22 -0
- package/dist/managed/evidence.js +143 -0
- package/dist/managed/index.d.ts +6 -0
- package/dist/managed/index.js +6 -0
- package/dist/managed/store.d.ts +72 -0
- package/dist/managed/store.js +224 -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 +0 -1
- package/dist/observability/skill-health-analyzer.js +0 -1
- 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 -3
- 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 +3 -4
- package/dist/renderer/skill-health-renderer.d.ts +0 -1
- package/dist/renderer/skill-health-renderer.js +0 -1
- package/dist/renderer/skill-list-renderer.d.ts +0 -1
- package/dist/renderer/skill-list-renderer.js +0 -1
- package/dist/renderer/summary.d.ts +0 -1
- package/dist/renderer/summary.js +1 -2
- 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 +1 -2
- 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 +4 -5
- package/dist/server/skill-insights.d.ts +0 -1
- package/dist/server/skill-insights.js +8 -9
- 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 +13 -2
- 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 +110 -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 +19 -6
- 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 +0 -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 +9 -4
- 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/lib/update-fetch-worker.d.ts.map +0 -1
- package/dist/cli/lib/update-fetch-worker.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/load-custom-dimensions.d.ts.map +0 -1
- package/dist/doctor/health/load-custom-dimensions.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
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import { copyFileSync, cpSync, existsSync, mkdirSync, realpathSync, rmSync, statSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { basename, dirname, resolve, join, sep } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { Args, Flags } from '@oclif/core';
|
|
6
|
+
import { LANG_FLAG, bilingual } from '../oclif/i18n.js';
|
|
7
|
+
import { BaseCommand } from '../oclif/base-command.js';
|
|
8
|
+
import { tCli } from '../lib/i18n.js';
|
|
9
|
+
import { resolveInstallSource, resolveRemoteGitSource, SourceResolveError } from '../../inputs/source-resolver.js';
|
|
10
|
+
import { buildManagedArtifactRecord, hashArtifactSource, distributableCopyFilter, managedDir, recordManagedArtifact } from '../../managed/index.js';
|
|
11
|
+
const BUILTIN_OMK_AGENT_SKILL_ID = 'omk-agent-skill';
|
|
12
|
+
const INSTALLABLE_KINDS = ['skill', 'prompt', 'agent', 'workflow'];
|
|
13
|
+
const TARGET_ORDER = ['codex', 'claude'];
|
|
14
|
+
const TARGET_SPECS = {
|
|
15
|
+
codex: {
|
|
16
|
+
label: 'Codex/AGENTS',
|
|
17
|
+
skillsDir: (home) => join(home, '.agents', 'skills'),
|
|
18
|
+
detectDirs: (home) => [join(home, '.agents'), join(home, '.codex')],
|
|
19
|
+
},
|
|
20
|
+
claude: {
|
|
21
|
+
label: 'Claude Code',
|
|
22
|
+
skillsDir: (home) => join(home, '.claude', 'skills'),
|
|
23
|
+
detectDirs: (home) => [join(home, '.claude')],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
function packagedOmkAgentSkillDir() {
|
|
27
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
28
|
+
return resolve(here, '..', '..', 'assets', 'agent-skills', 'omk');
|
|
29
|
+
}
|
|
30
|
+
function knownTarget(target) {
|
|
31
|
+
const home = homedir();
|
|
32
|
+
const spec = TARGET_SPECS[target];
|
|
33
|
+
return { label: spec.label, skillsDir: spec.skillsDir(home) };
|
|
34
|
+
}
|
|
35
|
+
function directoryExists(path) {
|
|
36
|
+
try {
|
|
37
|
+
return statSync(path).isDirectory();
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function parseTargets(raw, lang) {
|
|
44
|
+
const parts = [...new Set(raw.split(',').map((part) => part.trim()).filter(Boolean))];
|
|
45
|
+
if (parts.length === 0)
|
|
46
|
+
return autoTargets();
|
|
47
|
+
if (parts.includes('auto')) {
|
|
48
|
+
if (parts.length > 1)
|
|
49
|
+
throw new Error(tCli('cli.install.invalid_target_combo', lang, { target: raw }));
|
|
50
|
+
return autoTargets();
|
|
51
|
+
}
|
|
52
|
+
if (parts.includes('all')) {
|
|
53
|
+
if (parts.length > 1)
|
|
54
|
+
throw new Error(tCli('cli.install.invalid_target_combo', lang, { target: raw }));
|
|
55
|
+
return TARGET_ORDER;
|
|
56
|
+
}
|
|
57
|
+
const out = [];
|
|
58
|
+
for (const part of parts) {
|
|
59
|
+
if (part !== 'codex' && part !== 'claude') {
|
|
60
|
+
throw new Error(tCli('cli.install.unknown_target', lang, { target: part }));
|
|
61
|
+
}
|
|
62
|
+
out.push(part);
|
|
63
|
+
}
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
function autoTargets() {
|
|
67
|
+
const home = homedir();
|
|
68
|
+
return TARGET_ORDER.filter((target) => TARGET_SPECS[target].detectDirs(home).some(directoryExists));
|
|
69
|
+
}
|
|
70
|
+
function resolveInstallTargets(params) {
|
|
71
|
+
if (params.dest) {
|
|
72
|
+
return [{ label: 'custom', skillsDir: resolve(params.dest) }];
|
|
73
|
+
}
|
|
74
|
+
const targets = parseTargets(params.to, params.lang);
|
|
75
|
+
if (targets.length === 0) {
|
|
76
|
+
throw new Error(tCli('cli.install.no_detected_targets', params.lang));
|
|
77
|
+
}
|
|
78
|
+
const seen = new Set();
|
|
79
|
+
return targets
|
|
80
|
+
.map(knownTarget)
|
|
81
|
+
.filter((target) => {
|
|
82
|
+
const key = resolve(target.skillsDir);
|
|
83
|
+
if (seen.has(key))
|
|
84
|
+
return false;
|
|
85
|
+
seen.add(key);
|
|
86
|
+
return true;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/** 目标落点:目录-skill → {skillsDir}/{name};文件-skill → {skillsDir}/{name}.md。 */
|
|
90
|
+
function targetArtifactPath(target, name, isDirectorySkill) {
|
|
91
|
+
return isDirectorySkill ? join(target.skillsDir, name) : join(target.skillsDir, `${name}.md`);
|
|
92
|
+
}
|
|
93
|
+
/** 内置 omk Agent Skill 固定落到 {skillsDir}/omk(目录-skill)。 */
|
|
94
|
+
function targetSkillDir(target) {
|
|
95
|
+
return targetArtifactPath(target, 'omk', true);
|
|
96
|
+
}
|
|
97
|
+
/** 全部目标预检通过才拷任何一个(无部分安装)。源就是目标(就地接管)的目标跳过存在性检查。 */
|
|
98
|
+
function validateInstallTargets(params) {
|
|
99
|
+
if (params.dryRun || params.force)
|
|
100
|
+
return;
|
|
101
|
+
for (const targetPath of params.targetPaths) {
|
|
102
|
+
if (params.source && classifyPaths(params.source, targetPath) === 'same')
|
|
103
|
+
continue;
|
|
104
|
+
if (existsSync(targetPath)) {
|
|
105
|
+
throw new Error(tCli('cli.install.target_exists', params.lang, { path: targetPath }));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** 解析路径的物理形态:对存在的最长前缀做 realpath、余下保持字面,使尚不存在的目标也能比较。 */
|
|
110
|
+
function realPathBestEffort(p) {
|
|
111
|
+
let cur = resolve(p);
|
|
112
|
+
const tail = [];
|
|
113
|
+
while (!existsSync(cur)) {
|
|
114
|
+
tail.unshift(basename(cur));
|
|
115
|
+
const parent = dirname(cur);
|
|
116
|
+
if (parent === cur)
|
|
117
|
+
break;
|
|
118
|
+
cur = parent;
|
|
119
|
+
}
|
|
120
|
+
const base = existsSync(cur) ? realpathSync(cur) : cur;
|
|
121
|
+
return tail.length ? join(base, ...tail) : base;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 源与目标的物理关系(解析软链):
|
|
125
|
+
* - same:同一节点 → 就地接管(绝不删/拷);
|
|
126
|
+
* - overlap:一个是另一个的祖先 → rmSync(target) 会删掉源、或 cpSync 把目录拷进自身子目录,数据损坏,必须拒;
|
|
127
|
+
* - disjoint:正常拷贝。
|
|
128
|
+
*/
|
|
129
|
+
function classifyPaths(source, targetPath) {
|
|
130
|
+
const rs = realPathBestEffort(source);
|
|
131
|
+
const rt = realPathBestEffort(targetPath);
|
|
132
|
+
if (rs === rt)
|
|
133
|
+
return 'same';
|
|
134
|
+
if (rs.startsWith(rt + sep) || rt.startsWith(rs + sep))
|
|
135
|
+
return 'overlap';
|
|
136
|
+
return 'disjoint';
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 通用拷贝:目录递归 cp(过滤 .omk / .git / evolve 等非分发产物 + 软链)、单文件 copyFile。
|
|
140
|
+
* 不打印——由调用方决定文案。dry-run 不写。源即目标 → 就地接管(inPlace);源与目标互为祖先 → 拒绝(防自毁)。
|
|
141
|
+
*/
|
|
142
|
+
function copyArtifactToTarget(params) {
|
|
143
|
+
if (!existsSync(params.source)) {
|
|
144
|
+
throw new Error(tCli('cli.install.asset_missing', params.lang, { path: params.source }));
|
|
145
|
+
}
|
|
146
|
+
if (params.dryRun) {
|
|
147
|
+
return { targetPath: params.targetPath, planned: true, inPlace: false };
|
|
148
|
+
}
|
|
149
|
+
const relation = classifyPaths(params.source, params.targetPath);
|
|
150
|
+
// 就地接管:源就是目标(接管已安装的 skill),绝不 rmSync 源。
|
|
151
|
+
if (relation === 'same') {
|
|
152
|
+
return { targetPath: params.targetPath, planned: false, inPlace: true };
|
|
153
|
+
}
|
|
154
|
+
// 互为祖先:删除目标会删掉源、或自拷进子目录 —— 数据损坏,直接拒,哪怕带 --force。
|
|
155
|
+
if (relation === 'overlap') {
|
|
156
|
+
throw new Error(tCli('cli.install.target_overlaps_source', params.lang, { source: params.source, target: params.targetPath }));
|
|
157
|
+
}
|
|
158
|
+
if (existsSync(params.targetPath) && !params.force) {
|
|
159
|
+
throw new Error(tCli('cli.install.target_exists', params.lang, { path: params.targetPath }));
|
|
160
|
+
}
|
|
161
|
+
mkdirSync(params.skillsDir, { recursive: true });
|
|
162
|
+
rmSync(params.targetPath, { recursive: true, force: true });
|
|
163
|
+
if (params.isDirectorySkill) {
|
|
164
|
+
cpSync(params.source, params.targetPath, {
|
|
165
|
+
recursive: true,
|
|
166
|
+
// 与 hashArtifactSource / eval 隔离副本共用同一处过滤(distributableCopyFilter),保证
|
|
167
|
+
// "分发出去的 == 算进 hash 的 == 测量的副本":源根永远拷;软链跳过;evolve 仅源根第一层排除、
|
|
168
|
+
// .omk/.git/node_modules 任意层级排除。
|
|
169
|
+
filter: distributableCopyFilter(params.source),
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
copyFileSync(params.source, params.targetPath);
|
|
174
|
+
}
|
|
175
|
+
return { targetPath: params.targetPath, planned: false, inPlace: false };
|
|
176
|
+
}
|
|
177
|
+
function installOmkAgentSkill(params) {
|
|
178
|
+
const targetDir = targetSkillDir(params.target);
|
|
179
|
+
const { planned } = copyArtifactToTarget({
|
|
180
|
+
source: params.sourceDir,
|
|
181
|
+
isDirectorySkill: true,
|
|
182
|
+
targetPath: targetDir,
|
|
183
|
+
skillsDir: params.target.skillsDir,
|
|
184
|
+
force: params.force,
|
|
185
|
+
dryRun: params.dryRun,
|
|
186
|
+
lang: params.lang,
|
|
187
|
+
});
|
|
188
|
+
console.log(tCli(planned ? 'cli.install.plan' : 'cli.install.installed', params.lang, { path: targetDir }));
|
|
189
|
+
return targetDir;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* 是否当作用户 artifact 路径(否则按 typo 的内置 id 处理,报 unknown_input)。
|
|
193
|
+
* - 显式路径意图(含 `/`)或 `.md` 结尾 → 是(后续 installManagedSkill 经 resolver 给出精确的存在性 / SKILL.md 报错);
|
|
194
|
+
* - 裸短名 → 仅当它确实解析到一个含 SKILL.md 的目录才算;裸的同名普通文件(如 cwd 里恰好有个
|
|
195
|
+
* `omk-agnt-skill` 文件)不该被当成 skill 安装,落回 unknown_input。
|
|
196
|
+
*/
|
|
197
|
+
function looksLikeArtifactPath(input) {
|
|
198
|
+
if (input.includes('/') || /\.md$/i.test(input))
|
|
199
|
+
return true;
|
|
200
|
+
try {
|
|
201
|
+
const abs = resolve(input);
|
|
202
|
+
return statSync(abs).isDirectory() && existsSync(join(abs, 'SKILL.md'));
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
export default class Install extends BaseCommand {
|
|
209
|
+
static description = bilingual({
|
|
210
|
+
zh: '安装 omk 官方 Agent Skill,或登记并分发用户自己的 skill(内置 id omk-agent-skill,本地路径,或 git:<ref>:<name> 取当前仓库某个 ref 的 skill)。默认写入本机已检测 agent 目标;安装用户 skill 时同时登记一条受管记录。',
|
|
211
|
+
en: 'Install the official omk Agent Skill, or register and distribute your own skill (built-in id omk-agent-skill, a local path, or git:<ref>:<name> for a skill at a ref of the current repo). Defaults to detected local agent targets; installing a user skill also records a managed entry.',
|
|
212
|
+
});
|
|
213
|
+
static examples = [
|
|
214
|
+
{
|
|
215
|
+
description: bilingual({
|
|
216
|
+
zh: '安装 omk 官方 Agent Skill 到默认本机目标',
|
|
217
|
+
en: 'Install the official omk Agent Skill into default local targets',
|
|
218
|
+
}),
|
|
219
|
+
command: '<%= config.bin %> install omk-agent-skill',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
description: bilingual({
|
|
223
|
+
zh: '强制安装到当前 omk 已知的所有目标',
|
|
224
|
+
en: 'Install into every target currently known to omk',
|
|
225
|
+
}),
|
|
226
|
+
command: '<%= config.bin %> install omk-agent-skill --to all',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
description: bilingual({
|
|
230
|
+
zh: '安装到自定义 skill 根目录',
|
|
231
|
+
en: 'Install into a custom skill root',
|
|
232
|
+
}),
|
|
233
|
+
command: '<%= config.bin %> install omk-agent-skill --dest ~/.my-agent/skills',
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
description: bilingual({
|
|
237
|
+
zh: '登记并分发用户自己的 skill(--kind 可省,命中 SKILL.md 自动推导)',
|
|
238
|
+
en: 'Register and distribute your own skill (--kind optional; inferred from SKILL.md)',
|
|
239
|
+
}),
|
|
240
|
+
command: '<%= config.bin %> install ./skills/review',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
description: bilingual({
|
|
244
|
+
zh: '从当前仓库某个 ref 安装 skill(可复现;SHA 不可变、分支会随 ref 漂移)',
|
|
245
|
+
en: 'Install a skill from a ref of the current repo (reproducible; a SHA is immutable, a branch drifts with the ref)',
|
|
246
|
+
}),
|
|
247
|
+
command: '<%= config.bin %> install git:main:skills/review',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
description: bilingual({
|
|
251
|
+
zh: '从远端 git 仓库安装 skill(位置参数是仓库内路径;认证用本机 git 凭证;记录钉实际 SHA)',
|
|
252
|
+
en: 'Install a skill from a remote git repo (positional arg is the in-repo path; auth via local git credentials; record pins the actual SHA)',
|
|
253
|
+
}),
|
|
254
|
+
command: '<%= config.bin %> install --git-url https://github.com/org/repo.git --git-ref v1.0.0 skills/review',
|
|
255
|
+
},
|
|
256
|
+
];
|
|
257
|
+
static args = {
|
|
258
|
+
input: Args.string({
|
|
259
|
+
description: bilingual({
|
|
260
|
+
zh: '要安装的知识输入:内置 id omk-agent-skill,本地 skill 路径(目录或 .md),或 git:<ref>:<name>(当前仓库某 ref 的 skill)。',
|
|
261
|
+
en: 'Knowledge input to install: built-in id omk-agent-skill, a local skill path (directory or .md), or git:<ref>:<name> (a skill at a ref of the current repo).',
|
|
262
|
+
}),
|
|
263
|
+
required: true,
|
|
264
|
+
}),
|
|
265
|
+
};
|
|
266
|
+
static flags = {
|
|
267
|
+
lang: LANG_FLAG,
|
|
268
|
+
kind: Flags.string({
|
|
269
|
+
description: bilingual({
|
|
270
|
+
zh: '用户 artifact 的 kind(对齐 Artifact.kind)。可省:命中 SKILL.md 自动推导,当前仅支持 skill。',
|
|
271
|
+
en: 'Kind of the user artifact (aligns with Artifact.kind). Optional: inferred from SKILL.md; only skill is supported today.',
|
|
272
|
+
}),
|
|
273
|
+
options: INSTALLABLE_KINDS,
|
|
274
|
+
}),
|
|
275
|
+
to: Flags.string({
|
|
276
|
+
description: bilingual({
|
|
277
|
+
zh: '安装目标:auto(默认,本机已检测目标) / codex / claude / all。',
|
|
278
|
+
en: 'Install target: auto (default, detected local targets) / codex / claude / all.',
|
|
279
|
+
}),
|
|
280
|
+
default: 'auto',
|
|
281
|
+
}),
|
|
282
|
+
dest: Flags.string({
|
|
283
|
+
description: bilingual({
|
|
284
|
+
zh: '自定义 skill 根目录;skill 安装到 <dir>/<name>(内置 omk-agent-skill 为 <dir>/omk)。',
|
|
285
|
+
en: 'Custom skill root; a skill installs into <dir>/<name> (the built-in omk-agent-skill into <dir>/omk).',
|
|
286
|
+
}),
|
|
287
|
+
}),
|
|
288
|
+
force: Flags.boolean({
|
|
289
|
+
description: bilingual({
|
|
290
|
+
zh: '覆盖目标位置已存在的 skill。',
|
|
291
|
+
en: 'Overwrite an existing skill at the target location.',
|
|
292
|
+
}),
|
|
293
|
+
default: false,
|
|
294
|
+
}),
|
|
295
|
+
'dry-run': Flags.boolean({
|
|
296
|
+
description: bilingual({
|
|
297
|
+
zh: '只打印安装目标,不写文件。',
|
|
298
|
+
en: 'Print install targets without writing files.',
|
|
299
|
+
}),
|
|
300
|
+
default: false,
|
|
301
|
+
}),
|
|
302
|
+
'git-url': Flags.string({
|
|
303
|
+
description: bilingual({
|
|
304
|
+
zh: '远端 git 仓库 URL(https / ssh / git@host:path)。给了它时,位置参数当作仓库内 skill 路径(spec)。',
|
|
305
|
+
en: 'Remote git repository URL (https / ssh / git@host:path). When set, the positional arg is the in-repo skill path (spec).',
|
|
306
|
+
}),
|
|
307
|
+
}),
|
|
308
|
+
'git-ref': Flags.string({
|
|
309
|
+
description: bilingual({
|
|
310
|
+
zh: '远端 git 的 ref(分支 / tag / SHA),默认 HEAD。仅配合 --git-url 使用。',
|
|
311
|
+
en: 'Remote git ref (branch / tag / SHA), default HEAD. Only with --git-url.',
|
|
312
|
+
}),
|
|
313
|
+
}),
|
|
314
|
+
};
|
|
315
|
+
async run() {
|
|
316
|
+
const { args, flags } = await this.parse(Install);
|
|
317
|
+
const lang = this.lang;
|
|
318
|
+
await this.runWithCliExit(async () => {
|
|
319
|
+
// --git-ref 必须配 --git-url(否则静默丢弃、误把 spec 当本地路径解析,报错令人困惑)。
|
|
320
|
+
if (flags['git-ref'] && !flags['git-url']) {
|
|
321
|
+
throw new Error(tCli('cli.install.git_ref_needs_url', lang));
|
|
322
|
+
}
|
|
323
|
+
// 远端 git:--git-url 在场时,位置参数是仓库内 spec(repo 相对路径),先于其它分支判定。
|
|
324
|
+
if (flags['git-url']) {
|
|
325
|
+
this.installManagedSkill(args.input, flags.kind, flags, lang, {
|
|
326
|
+
url: flags['git-url'],
|
|
327
|
+
ref: flags['git-ref'] || 'HEAD',
|
|
328
|
+
});
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
if (args.input === BUILTIN_OMK_AGENT_SKILL_ID) {
|
|
332
|
+
this.installBuiltinAgentSkill(flags, lang);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (args.input.startsWith('git:') || looksLikeArtifactPath(args.input)) {
|
|
336
|
+
this.installManagedSkill(args.input, flags.kind, flags, lang);
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
throw new Error(tCli('cli.install.unknown_input', lang, { input: args.input }));
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
installBuiltinAgentSkill(flags, lang) {
|
|
343
|
+
const sourceDir = packagedOmkAgentSkillDir();
|
|
344
|
+
const targets = resolveInstallTargets({ to: flags.to, dest: flags.dest, lang });
|
|
345
|
+
validateInstallTargets({
|
|
346
|
+
targetPaths: targets.map(targetSkillDir),
|
|
347
|
+
force: flags.force,
|
|
348
|
+
dryRun: flags['dry-run'],
|
|
349
|
+
lang,
|
|
350
|
+
});
|
|
351
|
+
for (const target of targets) {
|
|
352
|
+
installOmkAgentSkill({ sourceDir, target, force: flags.force, dryRun: flags['dry-run'], lang });
|
|
353
|
+
}
|
|
354
|
+
if (!flags['dry-run'])
|
|
355
|
+
console.log(tCli('cli.install.next_hint', lang));
|
|
356
|
+
}
|
|
357
|
+
installManagedSkill(input, kindFlag, flags, lang, remote) {
|
|
358
|
+
// kind 推导:--kind 显式优先;否则缺省 skill(Phase 1 仅 skill)。
|
|
359
|
+
const kind = kindFlag ?? 'skill';
|
|
360
|
+
if (kind !== 'skill') {
|
|
361
|
+
throw new Error(tCli('cli.install.kind_unsupported', lang, { kind }));
|
|
362
|
+
}
|
|
363
|
+
// 源解析委托给 source-resolver(file / 本地 git / 远端 git),install 主干源无关。
|
|
364
|
+
// 远端走结构化 resolveRemoteGitSource(url/ref/spec 分字段,URL 不经任何字符串切分);
|
|
365
|
+
// resolver 不依赖 CLI,错误以 SourceResolveError(messageKey) 抛出,这里映射成本地化文案。
|
|
366
|
+
let src;
|
|
367
|
+
try {
|
|
368
|
+
src = remote ? resolveRemoteGitSource(remote.url, remote.ref, input) : resolveInstallSource(input);
|
|
369
|
+
}
|
|
370
|
+
catch (err) {
|
|
371
|
+
if (err instanceof SourceResolveError) {
|
|
372
|
+
throw new Error(tCli(err.messageKey, lang, err.params));
|
|
373
|
+
}
|
|
374
|
+
throw err;
|
|
375
|
+
}
|
|
376
|
+
try {
|
|
377
|
+
const { localRoot, name, isDirectorySkill, sourceKind, locator, ref, url } = src;
|
|
378
|
+
// 目录-skill 哈整棵可分发树(排除 .omk/.git/evolve);git 源哈的是物化后的临时树。
|
|
379
|
+
const contentHash = hashArtifactSource(localRoot, isDirectorySkill);
|
|
380
|
+
const targets = resolveInstallTargets({ to: flags.to, dest: flags.dest, lang });
|
|
381
|
+
validateInstallTargets({
|
|
382
|
+
targetPaths: targets.map((t) => targetArtifactPath(t, name, isDirectorySkill)),
|
|
383
|
+
force: flags.force,
|
|
384
|
+
dryRun: flags['dry-run'],
|
|
385
|
+
lang,
|
|
386
|
+
source: localRoot,
|
|
387
|
+
});
|
|
388
|
+
const now = new Date().toISOString();
|
|
389
|
+
const distribution = [];
|
|
390
|
+
const dir = managedDir();
|
|
391
|
+
// 即便多目标中途失败,也把已成功分发的落点登记进记录,保持"磁盘 == 记录"一致;
|
|
392
|
+
// 重跑 --force 时 upsert 会按 path 去重并补齐其余目标。
|
|
393
|
+
const writeRecordIfAny = () => {
|
|
394
|
+
if (flags['dry-run'] || distribution.length === 0)
|
|
395
|
+
return;
|
|
396
|
+
const record = buildManagedArtifactRecord({
|
|
397
|
+
name,
|
|
398
|
+
kind,
|
|
399
|
+
source: { sourceKind, locator, ...(ref ? { ref } : {}), ...(url ? { url } : {}), isDirectorySkill },
|
|
400
|
+
contentHash,
|
|
401
|
+
installedAt: now,
|
|
402
|
+
distribution,
|
|
403
|
+
});
|
|
404
|
+
recordManagedArtifact(record, { dir });
|
|
405
|
+
console.log(tCli('cli.install.registered', lang, { id: record.id, store: dir }));
|
|
406
|
+
};
|
|
407
|
+
try {
|
|
408
|
+
for (const target of targets) {
|
|
409
|
+
const targetPath = targetArtifactPath(target, name, isDirectorySkill);
|
|
410
|
+
const { planned, inPlace } = copyArtifactToTarget({
|
|
411
|
+
source: localRoot,
|
|
412
|
+
isDirectorySkill,
|
|
413
|
+
targetPath,
|
|
414
|
+
skillsDir: target.skillsDir,
|
|
415
|
+
force: flags.force,
|
|
416
|
+
dryRun: flags['dry-run'],
|
|
417
|
+
lang,
|
|
418
|
+
});
|
|
419
|
+
if (planned) {
|
|
420
|
+
console.log(tCli('cli.install.plan_skill', lang, { name, path: targetPath }));
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
console.log(tCli(inPlace ? 'cli.install.adopted' : 'cli.install.copied', lang, { name, path: targetPath }));
|
|
424
|
+
distribution.push({ label: target.label, path: targetPath, contentHash, copiedAt: now });
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
finally {
|
|
429
|
+
writeRecordIfAny();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
finally {
|
|
433
|
+
src.cleanup(); // git 删临时物化目录;file noop
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
@@ -6,7 +6,7 @@ export declare function collectSampleDesignFailureIds(report: Pick<Report, 'resu
|
|
|
6
6
|
export declare function assertFixReportMatchesCurrentInputs(params: {
|
|
7
7
|
report: Pick<Report, 'meta'>;
|
|
8
8
|
treatmentName: string;
|
|
9
|
-
|
|
9
|
+
currentContentHash: string;
|
|
10
10
|
samples: SampleType[];
|
|
11
11
|
sampleIds: Set<string>;
|
|
12
12
|
lang?: CliLang;
|
|
@@ -37,4 +37,3 @@ export default class Sample extends BaseCommand {
|
|
|
37
37
|
};
|
|
38
38
|
run(): Promise<void>;
|
|
39
39
|
}
|
|
40
|
-
//# sourceMappingURL=sample.d.ts.map
|
|
@@ -9,7 +9,8 @@ import { CliExit } from '../lib/cli-exit.js';
|
|
|
9
9
|
import { tCli } from '../lib/i18n.js';
|
|
10
10
|
import { DEFAULT_REPORTS_DIR } from '../lib/parse-run-config.js';
|
|
11
11
|
import { loadSamples, parseYaml } from '../../inputs/load-samples.js';
|
|
12
|
-
import { hashSample
|
|
12
|
+
import { hashSample } from '../../eval-core/evaluation-reporting.js';
|
|
13
|
+
import { hashArtifactSource } from '../../inputs/content-hash.js';
|
|
13
14
|
function isRecord(value) {
|
|
14
15
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
15
16
|
}
|
|
@@ -48,20 +49,29 @@ export function collectSampleDesignFailureIds(report, treatmentName) {
|
|
|
48
49
|
return ids;
|
|
49
50
|
}
|
|
50
51
|
export function assertFixReportMatchesCurrentInputs(params) {
|
|
51
|
-
const { report, treatmentName,
|
|
52
|
+
const { report, treatmentName, currentContentHash, samples, sampleIds } = params;
|
|
52
53
|
const lang = params.lang ?? 'zh';
|
|
53
54
|
const issues = [];
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
// schemaVersion < 2 的报告:artifactHashes 是旧「仅 SKILL.md 正文文本」哈,与当前「整棵可分发树」哈
|
|
56
|
+
// 不同空间,直接比对会必然误报不一致。识别后给可见提示(归入 issues → 触发「请先重跑 eval」),
|
|
57
|
+
// 不拿旧文本哈与当前树哈错配比对。sample 指纹口径未变,下面照常校。
|
|
58
|
+
if ((report.meta.schemaVersion ?? 0) < 2) {
|
|
57
59
|
issues.push(lang === 'zh'
|
|
58
|
-
?
|
|
59
|
-
: `Report
|
|
60
|
+
? `报告早于树哈纪元(skill 指纹口径已从「仅 SKILL.md 文本」改为「整棵可分发树」),无法与当前指纹比对。`
|
|
61
|
+
: `Report predates the tree-hash era (skill fingerprint changed from SKILL.md-body-text to whole-tree); cannot compare against the current fingerprint.`);
|
|
60
62
|
}
|
|
61
|
-
else
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
else {
|
|
64
|
+
const expectedSkillHash = report.meta.artifactHashes?.[treatmentName];
|
|
65
|
+
if (!expectedSkillHash) {
|
|
66
|
+
issues.push(lang === 'zh'
|
|
67
|
+
? `报告缺少 ${treatmentName} 的 skill 指纹,无法确认诊断对应当前 SKILL.md。`
|
|
68
|
+
: `Report is missing the skill hash for ${treatmentName}; cannot verify it matches the current SKILL.md.`);
|
|
69
|
+
}
|
|
70
|
+
else if (expectedSkillHash !== currentContentHash) {
|
|
71
|
+
issues.push(lang === 'zh'
|
|
72
|
+
? `skill 指纹不一致:报告 ${expectedSkillHash},当前 ${currentContentHash}。`
|
|
73
|
+
: `Skill hash mismatch: report ${expectedSkillHash}, current ${currentContentHash}.`);
|
|
74
|
+
}
|
|
65
75
|
}
|
|
66
76
|
const reportSampleHashes = report.meta.sampleHashes;
|
|
67
77
|
if (!reportSampleHashes) {
|
|
@@ -196,11 +206,14 @@ async function runSampleFix(args, flags, lang) {
|
|
|
196
206
|
process.stderr.write(lang === 'zh' ? '✅ 没有 sample_design 类型的失败,无需修复\n' : '✅ No sample_design failures found, nothing to fix\n');
|
|
197
207
|
return;
|
|
198
208
|
}
|
|
209
|
+
// 当前内容指纹走整树哈,与 eval 报告口径一致:dir-skill(用户传 .../SKILL.md)哈整棵 skill 目录、
|
|
210
|
+
// 单文件 .md 哈单文件字节。
|
|
211
|
+
const currentContentHash = hashArtifactSource(isDir ? skillDir : resolvedSkillPath, isDir);
|
|
199
212
|
try {
|
|
200
213
|
assertFixReportMatchesCurrentInputs({
|
|
201
214
|
report,
|
|
202
215
|
treatmentName,
|
|
203
|
-
|
|
216
|
+
currentContentHash,
|
|
204
217
|
samples,
|
|
205
218
|
sampleIds: sampleDesignIds,
|
|
206
219
|
lang,
|
|
@@ -456,7 +469,7 @@ export default class Sample extends BaseCommand {
|
|
|
456
469
|
static examples = [
|
|
457
470
|
{
|
|
458
471
|
description: bilingual({
|
|
459
|
-
zh: '为单个 skill
|
|
472
|
+
zh: '为单个 skill 生成默认数量的用例',
|
|
460
473
|
en: 'Generate default-count samples for a single skill',
|
|
461
474
|
}),
|
|
462
475
|
command: '<%= config.bin %> sample skills/my-skill/SKILL.md',
|
|
@@ -503,7 +516,7 @@ export default class Sample extends BaseCommand {
|
|
|
503
516
|
}),
|
|
504
517
|
count: Flags.string({
|
|
505
518
|
description: bilingual({
|
|
506
|
-
zh: '
|
|
519
|
+
zh: '生成用例条数。不传由 LLM 按 skill 类型自动决定。',
|
|
507
520
|
en: 'Number of samples to generate. Defaults to LLM auto-selection by skill type.',
|
|
508
521
|
}),
|
|
509
522
|
parse: integerStringParser('--count', { min: 1 }),
|
|
@@ -576,4 +589,3 @@ export default class Sample extends BaseCommand {
|
|
|
576
589
|
});
|
|
577
590
|
}
|
|
578
591
|
}
|
|
579
|
-
//# sourceMappingURL=sample.js.map
|
package/dist/cli/index.d.ts
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { getCliLang, parseLangFromArgv } from './lib/i18n.js';
|
|
3
|
-
import { checkUpdate } from './lib/update-check.js';
|
|
4
3
|
import { CliExit } from './lib/cli-exit.js';
|
|
5
4
|
// CLI 入口:lang / 版本提醒等共享前置逻辑跑完,把控制权交给 oclif dispatcher。
|
|
6
5
|
// 所有命令统一走 src/cli/commands/* 下的 oclif Command。
|
|
@@ -14,6 +13,7 @@ function isShortPath(argv) {
|
|
|
14
13
|
async function main() {
|
|
15
14
|
const lang = getCliLang(parseLangFromArgv(process.argv));
|
|
16
15
|
if (!isShortPath(process.argv)) {
|
|
16
|
+
const { checkUpdate } = await import('./lib/update-check.js');
|
|
17
17
|
checkUpdate(lang);
|
|
18
18
|
}
|
|
19
19
|
const { runOclifPath } = await import('./oclif/run.js');
|
|
@@ -26,4 +26,3 @@ main().catch((err) => {
|
|
|
26
26
|
console.error(err);
|
|
27
27
|
process.exit(1);
|
|
28
28
|
});
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cli/lib/cli-exit.js
CHANGED
|
@@ -108,6 +108,7 @@ export interface EvalFlags {
|
|
|
108
108
|
'trivial-diff'?: string;
|
|
109
109
|
'report-only'?: boolean;
|
|
110
110
|
'no-gate'?: boolean;
|
|
111
|
+
'no-evidence'?: boolean;
|
|
111
112
|
}
|
|
112
113
|
export interface EvolveArgs {
|
|
113
114
|
skillPath: string;
|
|
@@ -133,6 +134,12 @@ export interface EvolveFlags {
|
|
|
133
134
|
'reuse-latest-eval': boolean;
|
|
134
135
|
'improve-mode': string;
|
|
135
136
|
'holdout-ratio': string;
|
|
137
|
+
'no-significance-gate': boolean;
|
|
138
|
+
'significance-alpha': string;
|
|
139
|
+
'test-ratio': string;
|
|
140
|
+
'edit-budget': string;
|
|
141
|
+
'no-edit-budget': boolean;
|
|
142
|
+
'no-reject-memory': boolean;
|
|
136
143
|
}
|
|
137
144
|
export interface SampleArgs {
|
|
138
145
|
skillPath?: string;
|
|
@@ -226,4 +233,3 @@ export interface StudioFlags {
|
|
|
226
233
|
'no-open': boolean;
|
|
227
234
|
dev: boolean;
|
|
228
235
|
}
|
|
229
|
-
//# sourceMappingURL=cmd-flags.d.ts.map
|