@shrkcrft/inspector 0.1.0-alpha.30 → 0.1.0-alpha.31
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/dist/acceptance-replay.js +1 -1
- package/dist/agent-contract-templates.js +6 -6
- package/dist/agent-contract.d.ts.map +1 -1
- package/dist/agent-contract.js +13 -8
- package/dist/agent-orchestration.js +2 -2
- package/dist/agent-task-prep.d.ts +16 -0
- package/dist/agent-task-prep.d.ts.map +1 -1
- package/dist/agent-task-prep.js +51 -4
- package/dist/ai-readiness.d.ts.map +1 -1
- package/dist/ai-readiness.js +21 -3
- package/dist/architecture-map.d.ts +16 -0
- package/dist/architecture-map.d.ts.map +1 -1
- package/dist/architecture-map.js +42 -26
- package/dist/area-explore.d.ts +2 -2
- package/dist/area-explore.d.ts.map +1 -1
- package/dist/area-explore.js +36 -16
- package/dist/area-map.d.ts +56 -11
- package/dist/area-map.d.ts.map +1 -1
- package/dist/area-map.js +106 -25
- package/dist/asset-doctor-proposed-exit.d.ts +21 -0
- package/dist/asset-doctor-proposed-exit.d.ts.map +1 -0
- package/dist/asset-doctor-proposed-exit.js +22 -0
- package/dist/asset-provenance.js +1 -1
- package/dist/boundaries-changed-only.d.ts +24 -1
- package/dist/boundaries-changed-only.d.ts.map +1 -1
- package/dist/boundaries-changed-only.js +12 -2
- package/dist/boundary-check-options.model.d.ts +40 -0
- package/dist/boundary-check-options.model.d.ts.map +1 -0
- package/dist/boundary-check-options.model.js +1 -0
- package/dist/boundary-check-result.model.d.ts +89 -0
- package/dist/boundary-check-result.model.d.ts.map +1 -0
- package/dist/boundary-check-result.model.js +1 -0
- package/dist/boundary-configuration-status.d.ts +38 -0
- package/dist/boundary-configuration-status.d.ts.map +1 -0
- package/dist/boundary-configuration-status.js +118 -0
- package/dist/boundary-configuration-status.model.d.ts +37 -0
- package/dist/boundary-configuration-status.model.d.ts.map +1 -0
- package/dist/boundary-configuration-status.model.js +1 -0
- package/dist/boundary-load-issue.model.d.ts +30 -0
- package/dist/boundary-load-issue.model.d.ts.map +1 -0
- package/dist/boundary-load-issue.model.js +1 -0
- package/dist/boundary-rule-check.model.d.ts +44 -0
- package/dist/boundary-rule-check.model.d.ts.map +1 -0
- package/dist/boundary-rule-check.model.js +1 -0
- package/dist/boundary-rule-invalidation.model.d.ts +31 -0
- package/dist/boundary-rule-invalidation.model.d.ts.map +1 -0
- package/dist/boundary-rule-invalidation.model.js +1 -0
- package/dist/boundary-rule-set-diff.model.d.ts +75 -0
- package/dist/boundary-rule-set-diff.model.d.ts.map +1 -0
- package/dist/boundary-rule-set-diff.model.js +1 -0
- package/dist/boundary-rule-sources.d.ts +28 -0
- package/dist/boundary-rule-sources.d.ts.map +1 -0
- package/dist/boundary-rule-sources.js +110 -0
- package/dist/boundary-stale-exception-finding.model.d.ts +12 -0
- package/dist/boundary-stale-exception-finding.model.d.ts.map +1 -0
- package/dist/boundary-stale-exception-finding.model.js +1 -0
- package/dist/boundary-unit-liveness.d.ts +35 -0
- package/dist/boundary-unit-liveness.d.ts.map +1 -0
- package/dist/boundary-unit-liveness.js +71 -0
- package/dist/change-intent.d.ts +3 -0
- package/dist/change-intent.d.ts.map +1 -1
- package/dist/change-intent.js +61 -27
- package/dist/changes-summary.d.ts.map +1 -1
- package/dist/changes-summary.js +19 -9
- package/dist/ci-integrity-report.js +1 -1
- package/dist/ci-predict.d.ts.map +1 -1
- package/dist/ci-predict.js +38 -5
- package/dist/code-intelligence-doctor.d.ts +6 -0
- package/dist/code-intelligence-doctor.d.ts.map +1 -1
- package/dist/code-intelligence-doctor.js +22 -7
- package/dist/command-recommender.d.ts +45 -2
- package/dist/command-recommender.d.ts.map +1 -1
- package/dist/command-recommender.js +41 -263
- package/dist/command-resolution-status.d.ts +44 -0
- package/dist/command-resolution-status.d.ts.map +1 -0
- package/dist/command-resolution-status.js +44 -0
- package/dist/command-safety-level.d.ts +15 -0
- package/dist/command-safety-level.d.ts.map +1 -0
- package/dist/command-safety-level.js +43 -0
- package/dist/command-taxonomy.js +1 -1
- package/dist/compliance-evidence.js +1 -1
- package/dist/compliance-profiles.js +1 -1
- package/dist/construct-registry.d.ts +40 -0
- package/dist/construct-registry.d.ts.map +1 -1
- package/dist/construct-registry.js +186 -82
- package/dist/context-tuning.d.ts +4 -0
- package/dist/context-tuning.d.ts.map +1 -1
- package/dist/context-tuning.js +10 -7
- package/dist/contract-template-registry.d.ts +10 -0
- package/dist/contract-template-registry.d.ts.map +1 -1
- package/dist/contract-template-registry.js +59 -33
- package/dist/contribution-kind.d.ts +52 -0
- package/dist/contribution-kind.d.ts.map +1 -0
- package/dist/contribution-kind.js +52 -0
- package/dist/contribution-load-failures.d.ts +106 -0
- package/dist/contribution-load-failures.d.ts.map +1 -0
- package/dist/contribution-load-failures.js +575 -0
- package/dist/contributions-report.d.ts +28 -0
- package/dist/contributions-report.d.ts.map +1 -0
- package/dist/contributions-report.js +242 -0
- package/dist/convention-registry.d.ts +22 -0
- package/dist/convention-registry.d.ts.map +1 -1
- package/dist/convention-registry.js +79 -39
- package/dist/coverage-report.d.ts.map +1 -1
- package/dist/coverage-report.js +6 -6
- package/dist/custom-checks.d.ts +60 -1
- package/dist/custom-checks.d.ts.map +1 -1
- package/dist/custom-checks.js +159 -6
- package/dist/dashboard/dashboard-data.d.ts +6 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -1
- package/dist/dashboard/dashboard-data.js +99 -8
- package/dist/dashboard/dashboard-knowledge.d.ts.map +1 -1
- package/dist/dashboard/dashboard-knowledge.js +14 -2
- package/dist/decision-records.d.ts +20 -0
- package/dist/decision-records.d.ts.map +1 -1
- package/dist/decision-records.js +68 -20
- package/dist/declared-cross-references.d.ts +61 -0
- package/dist/declared-cross-references.d.ts.map +1 -0
- package/dist/declared-cross-references.js +550 -0
- package/dist/declared-gate-plane-rules.d.ts +24 -0
- package/dist/declared-gate-plane-rules.d.ts.map +1 -0
- package/dist/declared-gate-plane-rules.js +39 -0
- package/dist/declared-reference-coverage.d.ts +27 -0
- package/dist/declared-reference-coverage.d.ts.map +1 -0
- package/dist/declared-reference-coverage.js +50 -0
- package/dist/declared-xref-status.d.ts +19 -0
- package/dist/declared-xref-status.d.ts.map +1 -0
- package/dist/declared-xref-status.js +19 -0
- package/dist/delegate-pack-recipes.d.ts +13 -2
- package/dist/delegate-pack-recipes.d.ts.map +1 -1
- package/dist/delegate-pack-recipes.js +45 -14
- package/dist/demo-package.js +2 -2
- package/dist/demo-script.js +2 -2
- package/dist/demo-workflow.js +3 -3
- package/dist/dev-cycle.js +1 -1
- package/dist/dev-session.js +1 -1
- package/dist/doc-references.d.ts +23 -2
- package/dist/doc-references.d.ts.map +1 -1
- package/dist/doc-references.js +96 -17
- package/dist/doctor-result.d.ts +8 -0
- package/dist/doctor-result.d.ts.map +1 -1
- package/dist/doctor-verdict-kind.d.ts +19 -0
- package/dist/doctor-verdict-kind.d.ts.map +1 -0
- package/dist/doctor-verdict-kind.js +19 -0
- package/dist/doctor-verdict.d.ts +18 -0
- package/dist/doctor-verdict.d.ts.map +1 -0
- package/dist/doctor-verdict.js +28 -0
- package/dist/drift.d.ts +17 -0
- package/dist/drift.d.ts.map +1 -1
- package/dist/drift.js +40 -10
- package/dist/entrypoint-matrix.d.ts.map +1 -1
- package/dist/entrypoint-matrix.js +4 -1
- package/dist/feedback-ingestion.d.ts +28 -2
- package/dist/feedback-ingestion.d.ts.map +1 -1
- package/dist/feedback-ingestion.js +68 -19
- package/dist/fix-preview.d.ts.map +1 -1
- package/dist/fix-preview.js +9 -5
- package/dist/framework-extractor-outcomes.d.ts +27 -0
- package/dist/framework-extractor-outcomes.d.ts.map +1 -0
- package/dist/framework-extractor-outcomes.js +83 -0
- package/dist/fuzzy-impact.js +1 -1
- package/dist/healing-plan.d.ts.map +1 -1
- package/dist/healing-plan.js +3 -4
- package/dist/helper-catalog.d.ts +25 -0
- package/dist/helper-catalog.d.ts.map +1 -0
- package/dist/helper-catalog.js +91 -0
- package/dist/helper-registry.d.ts.map +1 -1
- package/dist/helper-registry.js +17 -1
- package/dist/helper-view.d.ts +33 -0
- package/dist/helper-view.d.ts.map +1 -0
- package/dist/helper-view.js +1 -0
- package/dist/i-asset-doctor-flags.d.ts +16 -0
- package/dist/i-asset-doctor-flags.d.ts.map +1 -0
- package/dist/i-asset-doctor-flags.js +1 -0
- package/dist/i-command-resolution.d.ts +22 -0
- package/dist/i-command-resolution.d.ts.map +1 -0
- package/dist/i-command-resolution.js +1 -0
- package/dist/i-command-resolve-options.d.ts +24 -0
- package/dist/i-command-resolve-options.d.ts.map +1 -0
- package/dist/i-command-resolve-options.js +1 -0
- package/dist/i-command-safety.d.ts +13 -0
- package/dist/i-command-safety.d.ts.map +1 -0
- package/dist/i-command-safety.js +1 -0
- package/dist/i-contribution-accepted-entry.d.ts +18 -0
- package/dist/i-contribution-accepted-entry.d.ts.map +1 -0
- package/dist/i-contribution-accepted-entry.js +1 -0
- package/dist/i-contribution-entry-rejection.d.ts +21 -0
- package/dist/i-contribution-entry-rejection.d.ts.map +1 -0
- package/dist/i-contribution-entry-rejection.js +1 -0
- package/dist/i-contribution-file-issue.d.ts +18 -0
- package/dist/i-contribution-file-issue.d.ts.map +1 -0
- package/dist/i-contribution-file-issue.js +1 -0
- package/dist/i-contribution-file-report.d.ts +40 -0
- package/dist/i-contribution-file-report.d.ts.map +1 -0
- package/dist/i-contribution-file-report.js +1 -0
- package/dist/i-contribution-file-validation.d.ts +24 -0
- package/dist/i-contribution-file-validation.d.ts.map +1 -0
- package/dist/i-contribution-file-validation.js +1 -0
- package/dist/i-contributions-report.d.ts +31 -0
- package/dist/i-contributions-report.d.ts.map +1 -0
- package/dist/i-contributions-report.js +1 -0
- package/dist/i-declared-xref-field.d.ts +25 -0
- package/dist/i-declared-xref-field.d.ts.map +1 -0
- package/dist/i-declared-xref-field.js +1 -0
- package/dist/i-declared-xref-issue.d.ts +25 -0
- package/dist/i-declared-xref-issue.d.ts.map +1 -0
- package/dist/i-declared-xref-issue.js +1 -0
- package/dist/i-declared-xref-report.d.ts +48 -0
- package/dist/i-declared-xref-report.d.ts.map +1 -0
- package/dist/i-declared-xref-report.js +1 -0
- package/dist/i-declared-xref-row.d.ts +29 -0
- package/dist/i-declared-xref-row.d.ts.map +1 -0
- package/dist/i-declared-xref-row.js +1 -0
- package/dist/i-doctor-verdict.d.ts +10 -0
- package/dist/i-doctor-verdict.d.ts.map +1 -0
- package/dist/i-doctor-verdict.js +1 -0
- package/dist/i-kind-outcomes.d.ts +13 -0
- package/dist/i-kind-outcomes.d.ts.map +1 -0
- package/dist/i-kind-outcomes.js +1 -0
- package/dist/i-pack-doctor-verdict.d.ts +15 -0
- package/dist/i-pack-doctor-verdict.d.ts.map +1 -0
- package/dist/i-pack-doctor-verdict.js +1 -0
- package/dist/i-probed-id-field.d.ts +17 -0
- package/dist/i-probed-id-field.d.ts.map +1 -0
- package/dist/i-probed-id-field.js +1 -0
- package/dist/i-reference-kind-declaration.d.ts +38 -0
- package/dist/i-reference-kind-declaration.d.ts.map +1 -0
- package/dist/i-reference-kind-declaration.js +1 -0
- package/dist/i-reference-warm-options.d.ts +21 -0
- package/dist/i-reference-warm-options.d.ts.map +1 -0
- package/dist/i-reference-warm-options.js +1 -0
- package/dist/i-registry-outcomes.d.ts +16 -0
- package/dist/i-registry-outcomes.d.ts.map +1 -0
- package/dist/i-registry-outcomes.js +1 -0
- package/dist/i-scaffold-pattern-doctor-report.d.ts +35 -0
- package/dist/i-scaffold-pattern-doctor-report.d.ts.map +1 -0
- package/dist/i-scaffold-pattern-doctor-report.js +1 -0
- package/dist/i-search-tuning-key-probe.d.ts +30 -0
- package/dist/i-search-tuning-key-probe.d.ts.map +1 -0
- package/dist/i-search-tuning-key-probe.js +1 -0
- package/dist/i-search-tuning-lint-issue.d.ts +61 -0
- package/dist/i-search-tuning-lint-issue.d.ts.map +1 -0
- package/dist/i-search-tuning-lint-issue.js +1 -0
- package/dist/i-search-tuning-lint-report.d.ts +38 -0
- package/dist/i-search-tuning-lint-report.d.ts.map +1 -0
- package/dist/i-search-tuning-lint-report.js +1 -0
- package/dist/i-unresolvable-reference-scan.d.ts +14 -0
- package/dist/i-unresolvable-reference-scan.d.ts.map +1 -0
- package/dist/i-unresolvable-reference-scan.js +1 -0
- package/dist/i-unresolvable-reference.d.ts +29 -0
- package/dist/i-unresolvable-reference.d.ts.map +1 -0
- package/dist/i-unresolvable-reference.js +1 -0
- package/dist/i-workspace-profile-payload.d.ts +12 -0
- package/dist/i-workspace-profile-payload.d.ts.map +1 -0
- package/dist/i-workspace-profile-payload.js +1 -0
- package/dist/impact-analysis.d.ts +15 -0
- package/dist/impact-analysis.d.ts.map +1 -1
- package/dist/impact-analysis.js +58 -13
- package/dist/impact-render.d.ts.map +1 -1
- package/dist/impact-render.js +22 -0
- package/dist/import-hygiene.d.ts +35 -1
- package/dist/import-hygiene.d.ts.map +1 -1
- package/dist/import-hygiene.js +107 -13
- package/dist/index.d.ts +141 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +172 -0
- package/dist/inspection-discovery.d.ts +45 -0
- package/dist/inspection-discovery.d.ts.map +1 -0
- package/dist/inspection-discovery.js +70 -0
- package/dist/knowledge-advisory-code.d.ts +17 -0
- package/dist/knowledge-advisory-code.d.ts.map +1 -0
- package/dist/knowledge-advisory-code.js +17 -0
- package/dist/knowledge-aged-entry.d.ts +10 -0
- package/dist/knowledge-aged-entry.d.ts.map +1 -0
- package/dist/knowledge-aged-entry.js +1 -0
- package/dist/knowledge-authoring.d.ts +24 -1
- package/dist/knowledge-authoring.d.ts.map +1 -1
- package/dist/knowledge-authoring.js +46 -7
- package/dist/knowledge-entry-verdict-record.d.ts +22 -0
- package/dist/knowledge-entry-verdict-record.d.ts.map +1 -0
- package/dist/knowledge-entry-verdict-record.js +1 -0
- package/dist/knowledge-entry-verdict.d.ts +17 -0
- package/dist/knowledge-entry-verdict.d.ts.map +1 -0
- package/dist/knowledge-entry-verdict.js +17 -0
- package/dist/knowledge-graph.d.ts +6 -0
- package/dist/knowledge-graph.d.ts.map +1 -1
- package/dist/knowledge-graph.js +18 -7
- package/dist/knowledge-kind-bucket.d.ts +19 -0
- package/dist/knowledge-kind-bucket.d.ts.map +1 -0
- package/dist/knowledge-kind-bucket.js +1 -0
- package/dist/knowledge-load-failure.d.ts +23 -0
- package/dist/knowledge-load-failure.d.ts.map +1 -0
- package/dist/knowledge-load-failure.js +1 -0
- package/dist/knowledge-reference-kind-bucket.d.ts +11 -0
- package/dist/knowledge-reference-kind-bucket.d.ts.map +1 -0
- package/dist/knowledge-reference-kind-bucket.js +1 -0
- package/dist/knowledge-stale-advisory.d.ts +14 -0
- package/dist/knowledge-stale-advisory.d.ts.map +1 -0
- package/dist/knowledge-stale-advisory.js +1 -0
- package/dist/knowledge-stale-coverage.d.ts +19 -0
- package/dist/knowledge-stale-coverage.d.ts.map +1 -0
- package/dist/knowledge-stale-coverage.js +1 -0
- package/dist/knowledge-stale-gate-flags.d.ts +33 -0
- package/dist/knowledge-stale-gate-flags.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-flags.js +1 -0
- package/dist/knowledge-stale-gate-input.d.ts +46 -0
- package/dist/knowledge-stale-gate-input.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-input.js +1 -0
- package/dist/knowledge-stale-gate-result.d.ts +33 -0
- package/dist/knowledge-stale-gate-result.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-result.js +1 -0
- package/dist/knowledge-stale-gate-rule.d.ts +33 -0
- package/dist/knowledge-stale-gate-rule.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-rule.js +1 -0
- package/dist/knowledge-stale-gate-violation.d.ts +13 -0
- package/dist/knowledge-stale-gate-violation.d.ts.map +1 -0
- package/dist/knowledge-stale-gate-violation.js +1 -0
- package/dist/knowledge-stale-gate.d.ts +83 -0
- package/dist/knowledge-stale-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-gate.js +429 -0
- package/dist/knowledge-stale-quality-gate.d.ts +26 -0
- package/dist/knowledge-stale-quality-gate.d.ts.map +1 -0
- package/dist/knowledge-stale-quality-gate.js +110 -0
- package/dist/knowledge-stale.d.ts +122 -9
- package/dist/knowledge-stale.d.ts.map +1 -1
- package/dist/knowledge-stale.js +996 -291
- package/dist/knowledge-unverifiable-reason.d.ts +12 -0
- package/dist/knowledge-unverifiable-reason.d.ts.map +1 -0
- package/dist/knowledge-unverifiable-reason.js +12 -0
- package/dist/loader-diagnostics.d.ts +14 -2
- package/dist/loader-diagnostics.d.ts.map +1 -1
- package/dist/match-terms.d.ts +48 -0
- package/dist/match-terms.d.ts.map +1 -0
- package/dist/match-terms.js +155 -0
- package/dist/migration-profile-registry.d.ts +10 -0
- package/dist/migration-profile-registry.d.ts.map +1 -1
- package/dist/migration-profile-registry.js +57 -34
- package/dist/migration-readiness.d.ts.map +1 -1
- package/dist/migration-readiness.js +1 -3
- package/dist/nearest-id.d.ts +10 -26
- package/dist/nearest-id.d.ts.map +1 -1
- package/dist/nearest-id.js +9 -59
- package/dist/pack-asset-freshness.d.ts +65 -0
- package/dist/pack-asset-freshness.d.ts.map +1 -0
- package/dist/pack-asset-freshness.js +340 -0
- package/dist/pack-author-ux.d.ts +24 -3
- package/dist/pack-author-ux.d.ts.map +1 -1
- package/dist/pack-author-ux.js +87 -93
- package/dist/pack-contributions-inventory.d.ts +79 -39
- package/dist/pack-contributions-inventory.d.ts.map +1 -1
- package/dist/pack-contributions-inventory.js +443 -286
- package/dist/pack-doctor-verdict.d.ts +29 -0
- package/dist/pack-doctor-verdict.d.ts.map +1 -0
- package/dist/pack-doctor-verdict.js +45 -0
- package/dist/pack-doctor.d.ts +74 -1
- package/dist/pack-doctor.d.ts.map +1 -1
- package/dist/pack-doctor.js +281 -1
- package/dist/pack-helper-plan.d.ts +24 -0
- package/dist/pack-helper-plan.d.ts.map +1 -0
- package/dist/pack-helper-plan.js +77 -0
- package/dist/pack-helper-registry.d.ts +14 -0
- package/dist/pack-helper-registry.d.ts.map +1 -1
- package/dist/pack-helper-registry.js +76 -37
- package/dist/pack-manifest-reader.d.ts +8 -0
- package/dist/pack-manifest-reader.d.ts.map +1 -0
- package/dist/pack-manifest-reader.js +79 -0
- package/dist/pack-release-check.d.ts +14 -1
- package/dist/pack-release-check.d.ts.map +1 -1
- package/dist/pack-release-check.js +23 -1
- package/dist/pack-signature-status.d.ts +18 -6
- package/dist/pack-signature-status.d.ts.map +1 -1
- package/dist/pack-signature-status.js +59 -105
- package/dist/pack-test-runner.d.ts +27 -5
- package/dist/pack-test-runner.d.ts.map +1 -1
- package/dist/pack-test-runner.js +91 -35
- package/dist/pack-typecheck.d.ts +8 -0
- package/dist/pack-typecheck.d.ts.map +1 -0
- package/dist/pack-typecheck.js +76 -0
- package/dist/plan-review.d.ts +2 -0
- package/dist/plan-review.d.ts.map +1 -1
- package/dist/plan-review.js +17 -5
- package/dist/plan-simulation.d.ts.map +1 -1
- package/dist/plan-simulation.js +16 -5
- package/dist/playbook-load-issue.d.ts +16 -0
- package/dist/playbook-load-issue.d.ts.map +1 -0
- package/dist/playbook-load-issue.js +1 -0
- package/dist/playbook-registry.d.ts +32 -1
- package/dist/playbook-registry.d.ts.map +1 -1
- package/dist/playbook-registry.js +144 -55
- package/dist/policy-declaration.d.ts +18 -0
- package/dist/policy-declaration.d.ts.map +1 -0
- package/dist/policy-declaration.js +1 -0
- package/dist/policy-engine.d.ts +8 -0
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +26 -9
- package/dist/policy-overrides.d.ts.map +1 -1
- package/dist/policy-overrides.js +4 -4
- package/dist/policy-registry.d.ts +27 -0
- package/dist/policy-registry.d.ts.map +1 -1
- package/dist/policy-registry.js +87 -20
- package/dist/probed-id-fields.d.ts +21 -0
- package/dist/probed-id-fields.d.ts.map +1 -0
- package/dist/probed-id-fields.js +25 -0
- package/dist/probed-id-source.d.ts +11 -0
- package/dist/probed-id-source.d.ts.map +1 -0
- package/dist/probed-id-source.js +11 -0
- package/dist/profile-registry.d.ts +25 -2
- package/dist/profile-registry.d.ts.map +1 -1
- package/dist/profile-registry.js +59 -6
- package/dist/quality-gate-examination.d.ts +15 -0
- package/dist/quality-gate-examination.d.ts.map +1 -0
- package/dist/quality-gate-examination.js +15 -0
- package/dist/quality-gate-row-status.d.ts +19 -0
- package/dist/quality-gate-row-status.d.ts.map +1 -0
- package/dist/quality-gate-row-status.js +28 -0
- package/dist/quality-gate-status.d.ts +16 -0
- package/dist/quality-gate-status.d.ts.map +1 -0
- package/dist/quality-gate-status.js +16 -0
- package/dist/quality-html.d.ts.map +1 -1
- package/dist/quality-html.js +14 -3
- package/dist/quality-report-coverage.d.ts +26 -0
- package/dist/quality-report-coverage.d.ts.map +1 -0
- package/dist/quality-report-coverage.js +48 -0
- package/dist/quality-report.d.ts +28 -1
- package/dist/quality-report.d.ts.map +1 -1
- package/dist/quality-report.js +263 -35
- package/dist/query-intent-kind.d.ts +18 -0
- package/dist/query-intent-kind.d.ts.map +1 -0
- package/dist/query-intent-kind.js +18 -0
- package/dist/query-intent-result.d.ts +23 -0
- package/dist/query-intent-result.d.ts.map +1 -0
- package/dist/query-intent-result.js +1 -0
- package/dist/query-intent.d.ts +18 -0
- package/dist/query-intent.d.ts.map +1 -0
- package/dist/query-intent.js +336 -0
- package/dist/query-resolver.d.ts +18 -0
- package/dist/query-resolver.d.ts.map +1 -1
- package/dist/query-resolver.js +7 -4
- package/dist/ranked-recommendations.d.ts +36 -0
- package/dist/ranked-recommendations.d.ts.map +1 -0
- package/dist/ranked-recommendations.js +1 -0
- package/dist/ranker-explainability.d.ts.map +1 -1
- package/dist/ranker-explainability.js +38 -10
- package/dist/recommend-recipe.d.ts +17 -0
- package/dist/recommend-recipe.d.ts.map +1 -0
- package/dist/recommend-recipe.js +1 -0
- package/dist/recommend-recipes.d.ts +9 -0
- package/dist/recommend-recipes.d.ts.map +1 -0
- package/dist/recommend-recipes.js +106 -0
- package/dist/recommendation-candidate.d.ts +30 -0
- package/dist/recommendation-candidate.d.ts.map +1 -0
- package/dist/recommendation-candidate.js +1 -0
- package/dist/recommendation-confidence.d.ts +27 -0
- package/dist/recommendation-confidence.d.ts.map +1 -0
- package/dist/recommendation-confidence.js +1 -0
- package/dist/recommendation-ranking-options.d.ts +24 -0
- package/dist/recommendation-ranking-options.d.ts.map +1 -0
- package/dist/recommendation-ranking-options.js +1 -0
- package/dist/recommendation-ranking.d.ts +50 -0
- package/dist/recommendation-ranking.d.ts.map +1 -0
- package/dist/recommendation-ranking.js +527 -0
- package/dist/recommendation-source.d.ts +23 -0
- package/dist/recommendation-source.d.ts.map +1 -0
- package/dist/recommendation-source.js +23 -0
- package/dist/recommendation-suppression.d.ts +14 -0
- package/dist/recommendation-suppression.d.ts.map +1 -0
- package/dist/recommendation-suppression.js +14 -0
- package/dist/reference-asset-kind.d.ts +14 -0
- package/dist/reference-asset-kind.d.ts.map +1 -0
- package/dist/reference-asset-kind.js +14 -0
- package/dist/reference-content-check.d.ts +32 -0
- package/dist/reference-content-check.d.ts.map +1 -0
- package/dist/reference-content-check.js +143 -0
- package/dist/reference-failure.d.ts +31 -0
- package/dist/reference-failure.d.ts.map +1 -0
- package/dist/reference-failure.js +31 -0
- package/dist/reference-id-status.d.ts +15 -0
- package/dist/reference-id-status.d.ts.map +1 -0
- package/dist/reference-id-status.js +15 -0
- package/dist/reference-kind-declarations.d.ts +42 -0
- package/dist/reference-kind-declarations.d.ts.map +1 -0
- package/dist/reference-kind-declarations.js +142 -0
- package/dist/reference-lookup.d.ts +6 -0
- package/dist/reference-lookup.d.ts.map +1 -1
- package/dist/reference-lookup.js +13 -5
- package/dist/reference-registry.d.ts +109 -11
- package/dist/reference-registry.d.ts.map +1 -1
- package/dist/reference-registry.js +186 -30
- package/dist/reference-subject.d.ts +20 -0
- package/dist/reference-subject.d.ts.map +1 -0
- package/dist/reference-subject.js +1 -0
- package/dist/registration-hint-discovery-status.d.ts +25 -0
- package/dist/registration-hint-discovery-status.d.ts.map +1 -0
- package/dist/registration-hint-discovery-status.js +25 -0
- package/dist/registration-hint-registry.d.ts +80 -0
- package/dist/registration-hint-registry.d.ts.map +1 -1
- package/dist/registration-hint-registry.js +356 -138
- package/dist/registry-lifecycle.d.ts +200 -19
- package/dist/registry-lifecycle.d.ts.map +1 -1
- package/dist/registry-lifecycle.js +526 -136
- package/dist/release-readiness.d.ts.map +1 -1
- package/dist/release-readiness.js +10 -7
- package/dist/release-smoke.d.ts.map +1 -1
- package/dist/release-smoke.js +11 -7
- package/dist/report-site.d.ts.map +1 -1
- package/dist/report-site.js +25 -7
- package/dist/repository-intelligence.d.ts.map +1 -1
- package/dist/repository-intelligence.js +3 -2
- package/dist/repository-knowledge-model.d.ts.map +1 -1
- package/dist/repository-knowledge-model.js +18 -5
- package/dist/resolve-project-config.d.ts +64 -0
- package/dist/resolve-project-config.d.ts.map +1 -1
- package/dist/resolve-project-config.js +240 -32
- package/dist/reuse/compute-reuse-coverage.d.ts +29 -0
- package/dist/reuse/compute-reuse-coverage.d.ts.map +1 -0
- package/dist/reuse/compute-reuse-coverage.js +198 -0
- package/dist/reuse/rank-reuse-candidates.d.ts +38 -0
- package/dist/reuse/rank-reuse-candidates.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-candidates.js +212 -0
- package/dist/reuse/rank-reuse-options.d.ts +20 -0
- package/dist/reuse/rank-reuse-options.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-options.js +1 -0
- package/dist/reuse/rank-reuse-suggestions.d.ts +15 -0
- package/dist/reuse/rank-reuse-suggestions.d.ts.map +1 -0
- package/dist/reuse/rank-reuse-suggestions.js +31 -0
- package/dist/reuse/resolve-curated-reuse.d.ts +43 -0
- package/dist/reuse/resolve-curated-reuse.d.ts.map +1 -0
- package/dist/reuse/resolve-curated-reuse.js +115 -0
- package/dist/reuse/reuse-candidate.d.ts +29 -0
- package/dist/reuse/reuse-candidate.d.ts.map +1 -0
- package/dist/reuse/reuse-candidate.js +1 -0
- package/dist/reuse/reuse-coverage-report.d.ts +74 -0
- package/dist/reuse/reuse-coverage-report.d.ts.map +1 -0
- package/dist/reuse/reuse-coverage-report.js +1 -0
- package/dist/reuse/reuse-curated-coverage.d.ts +36 -0
- package/dist/reuse/reuse-curated-coverage.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-coverage.js +1 -0
- package/dist/reuse/reuse-curated-resolution.d.ts +36 -0
- package/dist/reuse/reuse-curated-resolution.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-resolution.js +1 -0
- package/dist/reuse/reuse-curated-status.d.ts +21 -0
- package/dist/reuse/reuse-curated-status.d.ts.map +1 -0
- package/dist/reuse/reuse-curated-status.js +21 -0
- package/dist/reuse/reuse-match-detail.d.ts +15 -0
- package/dist/reuse/reuse-match-detail.d.ts.map +1 -0
- package/dist/reuse/reuse-match-detail.js +1 -0
- package/dist/reuse/reuse-ranking.d.ts +37 -0
- package/dist/reuse/reuse-ranking.d.ts.map +1 -0
- package/dist/reuse/reuse-ranking.js +1 -0
- package/dist/reuse/reuse-suggestion.d.ts +19 -0
- package/dist/reuse/reuse-suggestion.d.ts.map +1 -0
- package/dist/reuse/reuse-suggestion.js +1 -0
- package/dist/reuse/reuse-symbol-lookup.d.ts +28 -0
- package/dist/reuse/reuse-symbol-lookup.d.ts.map +1 -0
- package/dist/reuse/reuse-symbol-lookup.js +1 -0
- package/dist/reuse/reuse-tokenize.d.ts +11 -0
- package/dist/reuse/reuse-tokenize.d.ts.map +1 -0
- package/dist/reuse/reuse-tokenize.js +26 -0
- package/dist/reuse/score-reuse-name.d.ts +16 -0
- package/dist/reuse/score-reuse-name.d.ts.map +1 -0
- package/dist/reuse/score-reuse-name.js +35 -0
- package/dist/reuse/score-reuse-primitive.d.ts +33 -0
- package/dist/reuse/score-reuse-primitive.d.ts.map +1 -0
- package/dist/reuse/score-reuse-primitive.js +92 -0
- package/dist/review-packet.d.ts +2 -0
- package/dist/review-packet.d.ts.map +1 -1
- package/dist/review-packet.js +13 -6
- package/dist/role-views.d.ts.map +1 -1
- package/dist/role-views.js +16 -16
- package/dist/routing-recommends-channels.d.ts +24 -0
- package/dist/routing-recommends-channels.d.ts.map +1 -0
- package/dist/routing-recommends-channels.js +19 -0
- package/dist/run-boundary-check.d.ts +118 -0
- package/dist/run-boundary-check.d.ts.map +1 -0
- package/dist/run-boundary-check.js +592 -0
- package/dist/safety-audit.js +1 -1
- package/dist/scaffold-coverage.js +1 -1
- package/dist/scaffold-pattern-doctor-report.d.ts +19 -0
- package/dist/scaffold-pattern-doctor-report.d.ts.map +1 -0
- package/dist/scaffold-pattern-doctor-report.js +54 -0
- package/dist/scaffold-patterns.d.ts +75 -1
- package/dist/scaffold-patterns.d.ts.map +1 -1
- package/dist/scaffold-patterns.js +375 -84
- package/dist/schema-inventory.d.ts.map +1 -1
- package/dist/schema-inventory.js +4 -3
- package/dist/search-document-id.d.ts +52 -0
- package/dist/search-document-id.d.ts.map +1 -0
- package/dist/search-document-id.js +72 -0
- package/dist/search-document-prefix.d.ts +7 -0
- package/dist/search-document-prefix.d.ts.map +1 -0
- package/dist/search-document-prefix.js +1 -0
- package/dist/search-index.d.ts.map +1 -1
- package/dist/search-index.js +20 -23
- package/dist/search-tuning-explain.d.ts +6 -0
- package/dist/search-tuning-explain.d.ts.map +1 -1
- package/dist/search-tuning-explain.js +19 -17
- package/dist/search-tuning-key-probes.d.ts +16 -0
- package/dist/search-tuning-key-probes.d.ts.map +1 -0
- package/dist/search-tuning-key-probes.js +65 -0
- package/dist/search-tuning-key-resolution.d.ts +25 -0
- package/dist/search-tuning-key-resolution.d.ts.map +1 -0
- package/dist/search-tuning-key-resolution.js +1 -0
- package/dist/search-tuning-key-resolver.d.ts +4 -0
- package/dist/search-tuning-key-resolver.d.ts.map +1 -0
- package/dist/search-tuning-key-resolver.js +107 -0
- package/dist/search-tuning-key-status.d.ts +24 -0
- package/dist/search-tuning-key-status.d.ts.map +1 -0
- package/dist/search-tuning-key-status.js +24 -0
- package/dist/search-tuning-lint.d.ts +9 -0
- package/dist/search-tuning-lint.d.ts.map +1 -0
- package/dist/search-tuning-lint.js +468 -0
- package/dist/search-tuning-registry.d.ts +43 -0
- package/dist/search-tuning-registry.d.ts.map +1 -1
- package/dist/search-tuning-registry.js +214 -49
- package/dist/self-audit.d.ts +12 -0
- package/dist/self-audit.d.ts.map +1 -1
- package/dist/self-audit.js +36 -10
- package/dist/self-config-doctor-v2.d.ts +145 -3
- package/dist/self-config-doctor-v2.d.ts.map +1 -1
- package/dist/self-config-doctor-v2.js +1304 -181
- package/dist/self-config-doctor.d.ts +20 -1
- package/dist/self-config-doctor.d.ts.map +1 -1
- package/dist/self-config-doctor.js +53 -280
- package/dist/settled-unit-states.d.ts +9 -0
- package/dist/settled-unit-states.d.ts.map +1 -0
- package/dist/settled-unit-states.js +14 -0
- package/dist/sharkcraft-inspector.d.ts +34 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -1
- package/dist/sharkcraft-inspector.js +273 -26
- package/dist/spec/spec-evidence.d.ts.map +1 -1
- package/dist/spec/spec-evidence.js +14 -20
- package/dist/split-identifier.d.ts +21 -0
- package/dist/split-identifier.d.ts.map +1 -0
- package/dist/split-identifier.js +27 -0
- package/dist/start-here.d.ts.map +1 -1
- package/dist/start-here.js +1 -2
- package/dist/substitute-placeholders.d.ts +8 -0
- package/dist/substitute-placeholders.d.ts.map +1 -0
- package/dist/substitute-placeholders.js +9 -0
- package/dist/symbol-index.d.ts +33 -0
- package/dist/symbol-index.d.ts.map +1 -1
- package/dist/symbol-index.js +241 -3
- package/dist/symbol-member-entry.d.ts +26 -0
- package/dist/symbol-member-entry.d.ts.map +1 -0
- package/dist/symbol-member-entry.js +1 -0
- package/dist/symbol-member-kind.d.ts +14 -0
- package/dist/symbol-member-kind.d.ts.map +1 -0
- package/dist/symbol-member-kind.js +14 -0
- package/dist/task-packet.d.ts.map +1 -1
- package/dist/task-packet.js +52 -9
- package/dist/task-ranker.d.ts +8 -0
- package/dist/task-ranker.d.ts.map +1 -1
- package/dist/task-ranker.js +25 -13
- package/dist/task-risk.js +1 -1
- package/dist/task-routing-hint-registry.d.ts +20 -1
- package/dist/task-routing-hint-registry.d.ts.map +1 -1
- package/dist/task-routing-hint-registry.js +186 -42
- package/dist/template-drift.d.ts.map +1 -1
- package/dist/template-drift.js +30 -9
- package/dist/template-lint.d.ts.map +1 -1
- package/dist/template-lint.js +160 -2
- package/dist/term-query.d.ts +10 -0
- package/dist/term-query.d.ts.map +1 -0
- package/dist/term-query.js +1 -0
- package/dist/test-definitions.d.ts +6 -3
- package/dist/test-definitions.d.ts.map +1 -1
- package/dist/test-runner.d.ts +95 -10
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +309 -308
- package/dist/tuning-query-tokens.d.ts +29 -0
- package/dist/tuning-query-tokens.d.ts.map +1 -0
- package/dist/tuning-query-tokens.js +51 -0
- package/dist/typecheck-files.d.ts +36 -0
- package/dist/typecheck-files.d.ts.map +1 -0
- package/dist/typecheck-files.js +158 -0
- package/dist/uncertainty.js +1 -1
- package/dist/universal-search.d.ts.map +1 -1
- package/dist/universal-search.js +5 -3
- package/dist/unregistered-exports.d.ts +19 -0
- package/dist/unregistered-exports.d.ts.map +1 -0
- package/dist/unregistered-exports.js +141 -0
- package/dist/unresolvable-reason.d.ts +11 -0
- package/dist/unresolvable-reason.d.ts.map +1 -0
- package/dist/unresolvable-reason.js +11 -0
- package/dist/upgrade-advisor.d.ts.map +1 -1
- package/dist/upgrade-advisor.js +16 -9
- package/dist/validate-contribution-file.d.ts +4 -0
- package/dist/validate-contribution-file.d.ts.map +1 -0
- package/dist/validate-contribution-file.js +228 -0
- package/dist/why-file.d.ts +3 -0
- package/dist/why-file.d.ts.map +1 -1
- package/dist/why-file.js +7 -3
- package/package.json +17 -17
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import * as nodePath from 'node:path';
|
|
3
|
-
import { importModuleViaLoader } from '@shrkcrft/core';
|
|
3
|
+
import { importModuleViaLoader, readContributionExport, RejectionCause, } from '@shrkcrft/core';
|
|
4
4
|
export const CONSTRUCT_REGISTRY_SCHEMA = 'sharkcraft.construct-registry/v1';
|
|
5
5
|
const CACHE = new Map();
|
|
6
6
|
function readJsonOrEmpty(file) {
|
|
@@ -13,16 +13,41 @@ function readJsonOrEmpty(file) {
|
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
async function importList(file) {
|
|
17
|
+
return readContributionExport(await importModuleViaLoader(file), { namedKeys: ['constructs'] });
|
|
18
|
+
}
|
|
19
|
+
function firstLine(s) {
|
|
20
|
+
return (s.split('\n')[0] ?? s).trim();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* THE construct acceptance predicate (round 12, 12.1 / 12.1d): a non-empty
|
|
24
|
+
* string `id` and a string `type` — `[]` means accepted. An id-less construct
|
|
25
|
+
* used to be dropped silently, and one without `type` was ACCEPTED and then
|
|
26
|
+
* crashed `constructs list` (`c.type.padEnd`).
|
|
27
|
+
*/
|
|
28
|
+
export function constructRejectionReasons(raw) {
|
|
29
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
30
|
+
return ['(entry): must be an object'];
|
|
31
|
+
const c = raw;
|
|
32
|
+
const out = [];
|
|
33
|
+
if (typeof c.id !== 'string' || c.id.length === 0)
|
|
34
|
+
out.push('id: must be a non-empty string');
|
|
35
|
+
if (typeof c.type !== 'string' || c.type.length === 0)
|
|
36
|
+
out.push('type: must be a non-empty string');
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* THE construct-facet SHAPE predicate: `id`, `constructId`, `kind`, `value`,
|
|
41
|
+
* each a string — `[]` means the shape is accepted. (A well-shaped facet whose
|
|
42
|
+
* `constructId` names no loaded construct is refused at fold time.)
|
|
43
|
+
*/
|
|
44
|
+
export function constructFacetRejectionReasons(raw) {
|
|
45
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
46
|
+
return ['(entry): must be an object'];
|
|
47
|
+
const f = raw;
|
|
48
|
+
return ['id', 'constructId', 'kind', 'value']
|
|
49
|
+
.filter((k) => typeof f[k] !== 'string')
|
|
50
|
+
.map((k) => `${k}: must be a string`);
|
|
26
51
|
}
|
|
27
52
|
function localConstructFiles(inspection) {
|
|
28
53
|
const out = [];
|
|
@@ -35,11 +60,9 @@ function localConstructFiles(inspection) {
|
|
|
35
60
|
if (existsSync(full))
|
|
36
61
|
out.push(full);
|
|
37
62
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
out.push(nodePath.join(dir, rel));
|
|
42
|
-
}
|
|
63
|
+
// More construct files come from pack manifests (`constructFiles`, loaded
|
|
64
|
+
// below; docs/constructs.md) — there is no local-config key for them; the
|
|
65
|
+
// strict config schema rejects one, so a local read here could never run.
|
|
43
66
|
return out;
|
|
44
67
|
}
|
|
45
68
|
function localFacetFiles(inspection) {
|
|
@@ -53,49 +76,101 @@ function localFacetFiles(inspection) {
|
|
|
53
76
|
if (existsSync(full))
|
|
54
77
|
out.push(full);
|
|
55
78
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
for (const rel of cfg.constructFacetFiles)
|
|
59
|
-
out.push(nodePath.join(dir, rel));
|
|
60
|
-
}
|
|
79
|
+
// Same for facets: pack manifests carry `constructFacetFiles`; local config
|
|
80
|
+
// has no such key.
|
|
61
81
|
return out;
|
|
62
82
|
}
|
|
63
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Load every local and pack construct (and fold loose facets into them), with
|
|
85
|
+
* what did not take effect: files that failed to import (they used to be
|
|
86
|
+
* swallowed — `catch { /* ignore *\/ }` — so a broken `constructs.ts` read as a
|
|
87
|
+
* smaller registry), and every declared construct / facet the loader refused
|
|
88
|
+
* (round 12, 12.1).
|
|
89
|
+
*/
|
|
90
|
+
export async function loadConstructsWithIssues(inspection) {
|
|
64
91
|
const cacheKey = `${inspection.projectRoot}:${inspection.packs.validPacks
|
|
65
92
|
.map((p) => p.packageName + '@' + p.packageVersion)
|
|
66
93
|
.join(',')}`;
|
|
67
94
|
const cached = CACHE.get(inspection.projectRoot);
|
|
68
|
-
if (cached && cached.cacheKey === cacheKey)
|
|
69
|
-
return
|
|
95
|
+
if (cached && cached.cacheKey === cacheKey) {
|
|
96
|
+
return {
|
|
97
|
+
constructs: cached.list,
|
|
98
|
+
facets: cached.facets,
|
|
99
|
+
issues: cached.issues,
|
|
100
|
+
rejected: cached.rejected,
|
|
101
|
+
facetIssues: cached.facetIssues,
|
|
102
|
+
facetRejected: cached.facetRejected,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
70
105
|
const out = [];
|
|
71
|
-
|
|
72
|
-
|
|
106
|
+
const constructIssues = [];
|
|
107
|
+
const constructRejected = [];
|
|
108
|
+
const facetIssues = [];
|
|
109
|
+
const facetRejected = [];
|
|
110
|
+
// Construct files and facet files are two contribution kinds: each keeps its own issues / refusals.
|
|
111
|
+
let issues = constructIssues;
|
|
112
|
+
let rejected = constructRejected;
|
|
113
|
+
const rel = (file) => nodePath.relative(inspection.projectRoot, file) || file;
|
|
114
|
+
const load = async (file, packageName) => {
|
|
73
115
|
try {
|
|
74
|
-
|
|
75
|
-
for (const c of list) {
|
|
76
|
-
if (!c?.id)
|
|
77
|
-
continue;
|
|
78
|
-
const entry = { ...c, source: 'local' };
|
|
79
|
-
entry.sourceFile = nodePath.relative(inspection.projectRoot, file);
|
|
80
|
-
out.push(entry);
|
|
81
|
-
}
|
|
116
|
+
return await importList(file);
|
|
82
117
|
}
|
|
83
|
-
catch {
|
|
84
|
-
|
|
118
|
+
catch (e) {
|
|
119
|
+
issues.push({
|
|
120
|
+
severity: 'warning',
|
|
121
|
+
code: 'load-failed',
|
|
122
|
+
message: `${packageName ? `Pack ${packageName} (${rel(file)})` : `Failed to load ${rel(file)}`}: ${firstLine(e.message ?? String(e))}`,
|
|
123
|
+
source: file,
|
|
124
|
+
...(packageName ? { packageName } : {}),
|
|
125
|
+
});
|
|
126
|
+
return null;
|
|
85
127
|
}
|
|
128
|
+
};
|
|
129
|
+
const reject = (exp, file, i, raw, reasons, cause = RejectionCause.Invalid) => {
|
|
130
|
+
const id = raw && typeof raw === 'object' ? raw.id : undefined;
|
|
131
|
+
rejected.push({
|
|
132
|
+
file,
|
|
133
|
+
index: exp.single ? -1 : i,
|
|
134
|
+
...(exp.exportName ? { exportName: exp.exportName } : {}),
|
|
135
|
+
...(typeof id === 'string' && id.length > 0 ? { entryId: id } : {}),
|
|
136
|
+
reasons,
|
|
137
|
+
cause,
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
const ingestConstructs = (exp, file, origin) => {
|
|
141
|
+
exp.items.forEach((c, i) => {
|
|
142
|
+
const reasons = constructRejectionReasons(c);
|
|
143
|
+
if (reasons.length > 0) {
|
|
144
|
+
reject(exp, file, i, c, reasons);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
out.push({ ...c, ...origin });
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
// Local definitions.
|
|
151
|
+
for (const file of localConstructFiles(inspection)) {
|
|
152
|
+
const exp = await load(file);
|
|
153
|
+
if (exp)
|
|
154
|
+
ingestConstructs(exp, file, { source: 'local', sourceFile: rel(file) });
|
|
86
155
|
}
|
|
87
156
|
// Standalone facet files (folded into matching constructs).
|
|
88
157
|
const looseFacets = [];
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
158
|
+
const ingestFacets = (exp, file, packageName) => {
|
|
159
|
+
exp.items.forEach((f, i) => {
|
|
160
|
+
const reasons = constructFacetRejectionReasons(f);
|
|
161
|
+
if (reasons.length > 0) {
|
|
162
|
+
reject(exp, file, i, f, reasons);
|
|
163
|
+
return;
|
|
94
164
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
165
|
+
looseFacets.push({ facet: f, exp, file, index: i, ...(packageName ? { packageName } : {}) });
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
issues = facetIssues;
|
|
169
|
+
rejected = facetRejected;
|
|
170
|
+
for (const file of localFacetFiles(inspection)) {
|
|
171
|
+
const exp = await load(file);
|
|
172
|
+
if (exp)
|
|
173
|
+
ingestFacets(exp, file);
|
|
99
174
|
}
|
|
100
175
|
// Pack contributions.
|
|
101
176
|
for (const pack of inspection.packs.validPacks ?? []) {
|
|
@@ -103,59 +178,88 @@ export async function loadConstructs(inspection) {
|
|
|
103
178
|
const packRoot = pack.packageRoot;
|
|
104
179
|
if (!packRoot)
|
|
105
180
|
continue;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
181
|
+
issues = constructIssues;
|
|
182
|
+
rejected = constructRejected;
|
|
183
|
+
for (const r of contributions.constructFiles ?? []) {
|
|
184
|
+
const file = nodePath.resolve(packRoot, r);
|
|
185
|
+
if (!existsSync(file)) {
|
|
186
|
+
issues.push({
|
|
187
|
+
severity: 'warning',
|
|
188
|
+
code: 'missing-file',
|
|
189
|
+
message: `Pack ${pack.packageName} declares ${r} but the file is missing.`,
|
|
190
|
+
source: file,
|
|
191
|
+
packageName: pack.packageName,
|
|
192
|
+
});
|
|
109
193
|
continue;
|
|
110
|
-
try {
|
|
111
|
-
const list = await importDefault(file);
|
|
112
|
-
for (const c of list) {
|
|
113
|
-
if (!c?.id)
|
|
114
|
-
continue;
|
|
115
|
-
out.push({
|
|
116
|
-
...c,
|
|
117
|
-
source: 'pack',
|
|
118
|
-
packageName: pack.packageName,
|
|
119
|
-
sourceFile: rel,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
catch {
|
|
124
|
-
/* ignore */
|
|
125
194
|
}
|
|
195
|
+
const exp = await load(file, pack.packageName);
|
|
196
|
+
if (exp)
|
|
197
|
+
ingestConstructs(exp, file, { source: 'pack', packageName: pack.packageName, sourceFile: r });
|
|
126
198
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
199
|
+
issues = facetIssues;
|
|
200
|
+
rejected = facetRejected;
|
|
201
|
+
for (const r of contributions.constructFacetFiles ?? []) {
|
|
202
|
+
const file = nodePath.resolve(packRoot, r);
|
|
203
|
+
if (!existsSync(file)) {
|
|
204
|
+
issues.push({
|
|
205
|
+
severity: 'warning',
|
|
206
|
+
code: 'missing-file',
|
|
207
|
+
message: `Pack ${pack.packageName} declares ${r} but the file is missing.`,
|
|
208
|
+
source: file,
|
|
209
|
+
packageName: pack.packageName,
|
|
210
|
+
});
|
|
130
211
|
continue;
|
|
131
|
-
try {
|
|
132
|
-
const list = await importDefault(file);
|
|
133
|
-
for (const f of list)
|
|
134
|
-
looseFacets.push(f);
|
|
135
|
-
}
|
|
136
|
-
catch {
|
|
137
|
-
/* ignore */
|
|
138
212
|
}
|
|
213
|
+
const exp = await load(file, pack.packageName);
|
|
214
|
+
if (exp)
|
|
215
|
+
ingestFacets(exp, file, pack.packageName);
|
|
139
216
|
}
|
|
140
217
|
}
|
|
141
|
-
// Fold loose facets into their target construct.
|
|
142
|
-
|
|
218
|
+
// Fold loose facets into their target construct. A facet whose target is
|
|
219
|
+
// not loaded never takes effect — refused, never silently dropped.
|
|
220
|
+
issues = facetIssues;
|
|
221
|
+
rejected = facetRejected;
|
|
222
|
+
const facets = [];
|
|
223
|
+
for (const { facet: f, exp, file, index, packageName } of looseFacets) {
|
|
143
224
|
const target = out.find((c) => c.id === f.constructId);
|
|
144
|
-
if (!target)
|
|
225
|
+
if (!target) {
|
|
226
|
+
reject(exp, file, index, f, [`constructId: no construct "${f.constructId}" is loaded`]);
|
|
145
227
|
continue;
|
|
146
|
-
|
|
147
|
-
const
|
|
228
|
+
}
|
|
229
|
+
const byKind = (target.facets ?? {});
|
|
230
|
+
const list = byKind[f.kind] ?? [];
|
|
148
231
|
list.push({
|
|
149
232
|
id: f.id,
|
|
150
233
|
value: f.value,
|
|
151
234
|
...(f.description ? { description: f.description } : {}),
|
|
152
235
|
...(f.source ? { source: f.source } : {}),
|
|
236
|
+
// Dropping it here would silently turn a declared id back into free text.
|
|
237
|
+
...(f.resolvesAs ? { resolvesAs: f.resolvesAs } : {}),
|
|
153
238
|
});
|
|
154
|
-
|
|
155
|
-
target.facets =
|
|
239
|
+
byKind[f.kind] = list;
|
|
240
|
+
target.facets = byKind;
|
|
241
|
+
facets.push({ id: f.id, constructId: f.constructId, file, ...(packageName ? { packageName } : {}) });
|
|
156
242
|
}
|
|
157
|
-
CACHE.set(inspection.projectRoot, {
|
|
158
|
-
|
|
243
|
+
CACHE.set(inspection.projectRoot, {
|
|
244
|
+
cacheKey,
|
|
245
|
+
list: out,
|
|
246
|
+
facets,
|
|
247
|
+
issues: constructIssues,
|
|
248
|
+
rejected: constructRejected,
|
|
249
|
+
facetIssues,
|
|
250
|
+
facetRejected,
|
|
251
|
+
});
|
|
252
|
+
return {
|
|
253
|
+
constructs: out,
|
|
254
|
+
facets,
|
|
255
|
+
issues: constructIssues,
|
|
256
|
+
rejected: constructRejected,
|
|
257
|
+
facetIssues,
|
|
258
|
+
facetRejected,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
export async function loadConstructs(inspection) {
|
|
262
|
+
return (await loadConstructsWithIssues(inspection)).constructs;
|
|
159
263
|
}
|
|
160
264
|
/** Synchronous accessor — falls back to a snapshot cached from the last
|
|
161
265
|
* async load. Used by search-index which needs to be sync-friendly. */
|
package/dist/context-tuning.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
|
5
5
|
* (taskHint) boost only, scaled for the context score range; ambient boostTags
|
|
6
6
|
* are intentionally ignored here. Returns undefined when no tuning is loaded so
|
|
7
7
|
* buildContext skips the re-rank entirely.
|
|
8
|
+
*
|
|
9
|
+
* The document id comes from THE search-document codec and the trigger tokens
|
|
10
|
+
* from THE tuning tokenizer, so a key or trigger that fires in `shrk search`
|
|
11
|
+
* fires here too (a hyphenated `changed-only` trigger used to fire only there).
|
|
8
12
|
*/
|
|
9
13
|
export declare function contextTuningBoostFor(inspection: ISharkcraftInspection, task: string): ((entry: {
|
|
10
14
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-tuning.d.ts","sourceRoot":"","sources":["../src/context-tuning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"context-tuning.d.ts","sourceRoot":"","sources":["../src/context-tuning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAcvE;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,qBAAqB,EACjC,IAAI,EAAE,MAAM,GAEV,CAAC,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,KAAK,MAAM,CAAC,GACxG,SAAS,CAiBZ"}
|
package/dist/context-tuning.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { listSearchTuning, tuningBoostFor } from "./search-tuning-registry.js";
|
|
2
|
+
import { searchDocumentId, searchKindForPrefix } from "./search-document-id.js";
|
|
3
|
+
import { tuningQueryTokens } from "./tuning-query-tokens.js";
|
|
2
4
|
// Context relevance scores are on a large scale (priority × weights, ~100–190),
|
|
3
5
|
// so the pack's small ambient boostTags (±2–3) are noise there. The meaningful
|
|
4
6
|
// signal for "this entry must surface" is a TASK-SPECIFIC taskHint boost
|
|
@@ -13,20 +15,21 @@ const TASK_HINT_SCALE = 100;
|
|
|
13
15
|
* (taskHint) boost only, scaled for the context score range; ambient boostTags
|
|
14
16
|
* are intentionally ignored here. Returns undefined when no tuning is loaded so
|
|
15
17
|
* buildContext skips the re-rank entirely.
|
|
18
|
+
*
|
|
19
|
+
* The document id comes from THE search-document codec and the trigger tokens
|
|
20
|
+
* from THE tuning tokenizer, so a key or trigger that fires in `shrk search`
|
|
21
|
+
* fires here too (a hyphenated `changed-only` trigger used to fire only there).
|
|
16
22
|
*/
|
|
17
23
|
export function contextTuningBoostFor(inspection, task) {
|
|
18
24
|
const tuning = listSearchTuning(inspection);
|
|
19
25
|
if (tuning.length === 0)
|
|
20
26
|
return undefined;
|
|
21
|
-
const tokens = task
|
|
22
|
-
.toLowerCase()
|
|
23
|
-
.split(/[^a-z0-9]+/)
|
|
24
|
-
.filter((t) => t.length > 1);
|
|
27
|
+
const tokens = tuningQueryTokens(task);
|
|
25
28
|
return (entry) => {
|
|
26
|
-
const
|
|
29
|
+
const prefix = String(entry.type).toLowerCase() === 'rule' ? 'rule' : 'knowledge';
|
|
27
30
|
const doc = {
|
|
28
|
-
id:
|
|
29
|
-
kind:
|
|
31
|
+
id: searchDocumentId(prefix, entry.id),
|
|
32
|
+
kind: searchKindForPrefix(prefix) ?? prefix,
|
|
30
33
|
...(entry.tags ? { tags: entry.tags } : {}),
|
|
31
34
|
source: 'local',
|
|
32
35
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type IAgentContractTemplate } from './agent-contract-templates.js';
|
|
2
2
|
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
3
|
+
import { type IRejectedEntry } from '@shrkcrft/core';
|
|
3
4
|
export declare const CONTRACT_TEMPLATE_REGISTRY_SCHEMA = "sharkcraft.contract-template-registry/v1";
|
|
4
5
|
export declare enum ContractTemplateSource {
|
|
5
6
|
Builtin = "builtin",
|
|
@@ -19,9 +20,18 @@ export interface IContractTemplateRegistryIssue {
|
|
|
19
20
|
readonly templateId?: string;
|
|
20
21
|
readonly source?: string;
|
|
21
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* THE contract-template acceptance predicate (round 12, 12.1): one
|
|
25
|
+
* `<field>: <message>` per failing field — `[]` means accepted. It used to be a
|
|
26
|
+
* boolean, and a refused template read `Invalid contract template at <file>;
|
|
27
|
+
* skipped.` with no id and no field.
|
|
28
|
+
*/
|
|
29
|
+
export declare function contractTemplateRejectionReasons(raw: unknown): readonly string[];
|
|
22
30
|
export declare function loadAllContractTemplates(inspection: ISharkcraftInspection): Promise<{
|
|
23
31
|
entries: readonly IContractTemplateEntry[];
|
|
24
32
|
issues: readonly IContractTemplateRegistryIssue[];
|
|
33
|
+
/** Every declared template the loader refused — invalid or a duplicate id (round 12, 12.1). */
|
|
34
|
+
rejected: readonly IRejectedEntry[];
|
|
25
35
|
}>;
|
|
26
36
|
export declare function listAllContractTemplates(inspection: ISharkcraftInspection): Promise<readonly IAgentContractTemplate[]>;
|
|
27
37
|
export declare function clearContractTemplateRegistryCache(projectRoot?: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-template-registry.d.ts","sourceRoot":"","sources":["../src/contract-template-registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"contract-template-registry.d.ts","sourceRoot":"","sources":["../src/contract-template-registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,iCAAiC,6CAA6C,CAAC;AAE5F,oBAAY,sBAAsB;IAChC,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AA6BD;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAWhF;AAED,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC;IACT,OAAO,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC3C,MAAM,EAAE,SAAS,8BAA8B,EAAE,CAAC;IAClD,+FAA+F;IAC/F,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;CACrC,CAAC,CAmID;AAED,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,SAAS,sBAAsB,EAAE,CAAC,CAG5C;AAED,wBAAgB,kCAAkC,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAG7E"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
6
6
|
import * as nodePath from 'node:path';
|
|
7
7
|
import { ALL_CONTRACT_TEMPLATES, AGENT_CONTRACT_TEMPLATE_SCHEMA, } from "./agent-contract-templates.js";
|
|
8
|
-
import { importModuleViaLoader } from '@shrkcrft/core';
|
|
8
|
+
import { importModuleViaLoader, readContributionExport, RejectionCause, } from '@shrkcrft/core';
|
|
9
9
|
export const CONTRACT_TEMPLATE_REGISTRY_SCHEMA = 'sharkcraft.contract-template-registry/v1';
|
|
10
10
|
export var ContractTemplateSource;
|
|
11
11
|
(function (ContractTemplateSource) {
|
|
@@ -14,15 +14,8 @@ export var ContractTemplateSource;
|
|
|
14
14
|
ContractTemplateSource["Pack"] = "pack";
|
|
15
15
|
})(ContractTemplateSource || (ContractTemplateSource = {}));
|
|
16
16
|
const CACHE = new Map();
|
|
17
|
-
async function
|
|
18
|
-
|
|
19
|
-
if (Array.isArray(mod.default))
|
|
20
|
-
return mod.default;
|
|
21
|
-
if (mod.default && typeof mod.default === 'object')
|
|
22
|
-
return [mod.default];
|
|
23
|
-
if (Array.isArray(mod.contractTemplates))
|
|
24
|
-
return mod.contractTemplates;
|
|
25
|
-
return [];
|
|
17
|
+
async function importTemplates(file) {
|
|
18
|
+
return readContributionExport(await importModuleViaLoader(file), { namedKeys: ['contractTemplates'] });
|
|
26
19
|
}
|
|
27
20
|
function localFiles(inspection) {
|
|
28
21
|
const out = [];
|
|
@@ -34,20 +27,32 @@ function localFiles(inspection) {
|
|
|
34
27
|
if (existsSync(full))
|
|
35
28
|
out.push(full);
|
|
36
29
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
30
|
+
// More template files come from pack manifests (`contractTemplateFiles`,
|
|
31
|
+
// loaded below) — there is no local-config key for them; the strict config
|
|
32
|
+
// schema rejects one, so a local read here could never be reached.
|
|
41
33
|
return out;
|
|
42
34
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
/**
|
|
36
|
+
* THE contract-template acceptance predicate (round 12, 12.1): one
|
|
37
|
+
* `<field>: <message>` per failing field — `[]` means accepted. It used to be a
|
|
38
|
+
* boolean, and a refused template read `Invalid contract template at <file>;
|
|
39
|
+
* skipped.` with no id and no field.
|
|
40
|
+
*/
|
|
41
|
+
export function contractTemplateRejectionReasons(raw) {
|
|
42
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
43
|
+
return ['(entry): must be an object'];
|
|
46
44
|
const o = raw;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(
|
|
50
|
-
|
|
45
|
+
const out = [];
|
|
46
|
+
if (typeof o.id !== 'string')
|
|
47
|
+
out.push('id: must be a string');
|
|
48
|
+
if (typeof o.title !== 'string')
|
|
49
|
+
out.push('title: must be a string');
|
|
50
|
+
if (!(o.schema === AGENT_CONTRACT_TEMPLATE_SCHEMA || o.schema === undefined)) {
|
|
51
|
+
out.push(`schema: must be "${AGENT_CONTRACT_TEMPLATE_SCHEMA}" or unset`);
|
|
52
|
+
}
|
|
53
|
+
if (!Array.isArray(o.defaultForbiddenFilesDetailed))
|
|
54
|
+
out.push('defaultForbiddenFilesDetailed: must be an array');
|
|
55
|
+
return out;
|
|
51
56
|
}
|
|
52
57
|
export async function loadAllContractTemplates(inspection) {
|
|
53
58
|
const cacheKey = `${inspection.projectRoot}:${(inspection.packs.validPacks ?? [])
|
|
@@ -55,19 +60,26 @@ export async function loadAllContractTemplates(inspection) {
|
|
|
55
60
|
.join(',')}`;
|
|
56
61
|
const cached = CACHE.get(inspection.projectRoot);
|
|
57
62
|
if (cached && cached.cacheKey === cacheKey) {
|
|
58
|
-
return { entries: cached.entries, issues: cached.issues };
|
|
63
|
+
return { entries: cached.entries, issues: cached.issues, rejected: cached.rejected };
|
|
59
64
|
}
|
|
60
65
|
const seen = new Map();
|
|
61
66
|
const entries = [];
|
|
62
67
|
const issues = [];
|
|
63
|
-
const
|
|
64
|
-
|
|
68
|
+
const rejected = [];
|
|
69
|
+
const ingest = (raw, source, packageName, sourceFile, at) => {
|
|
70
|
+
const rawId = raw && typeof raw === 'object' ? raw.id : undefined;
|
|
71
|
+
const id = typeof rawId === 'string' ? rawId : undefined;
|
|
72
|
+
const reasons = contractTemplateRejectionReasons(raw);
|
|
73
|
+
if (reasons.length > 0) {
|
|
65
74
|
issues.push({
|
|
66
75
|
severity: 'warning',
|
|
67
76
|
code: 'invalid-template',
|
|
68
|
-
message: `Invalid contract template at ${sourceFile ?? source}; skipped.`,
|
|
77
|
+
message: `Invalid contract template${id ? ` "${id}"` : ''} at ${sourceFile ?? source}${at ? ` (${at.exportName ?? 'default'}[${at.index}])` : ''}; skipped — ${reasons.join('; ')}.`,
|
|
78
|
+
...(id ? { templateId: id } : {}),
|
|
69
79
|
source: sourceFile,
|
|
70
80
|
});
|
|
81
|
+
if (at)
|
|
82
|
+
rejected.push({ ...at, ...(id ? { entryId: id } : {}), reasons, cause: RejectionCause.Invalid });
|
|
71
83
|
return;
|
|
72
84
|
}
|
|
73
85
|
const tpl = raw;
|
|
@@ -80,6 +92,16 @@ export async function loadAllContractTemplates(inspection) {
|
|
|
80
92
|
templateId: tpl.id,
|
|
81
93
|
source: sourceFile,
|
|
82
94
|
});
|
|
95
|
+
if (at) {
|
|
96
|
+
rejected.push({
|
|
97
|
+
...at,
|
|
98
|
+
entryId: tpl.id,
|
|
99
|
+
reasons: [
|
|
100
|
+
`id: "${tpl.id}" is already declared by ${existing.source}${existing.sourceFile ? ` (${existing.sourceFile})` : ''}`,
|
|
101
|
+
],
|
|
102
|
+
cause: RejectionCause.DuplicateId,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
83
105
|
return;
|
|
84
106
|
}
|
|
85
107
|
const entry = {
|
|
@@ -91,15 +113,21 @@ export async function loadAllContractTemplates(inspection) {
|
|
|
91
113
|
seen.set(tpl.id, entry);
|
|
92
114
|
entries.push(entry);
|
|
93
115
|
};
|
|
116
|
+
const ingestAll = (exp, file, source, packageName, sourceFile) => {
|
|
117
|
+
exp.items.forEach((raw, i) => ingest(raw, source, packageName, sourceFile, {
|
|
118
|
+
file,
|
|
119
|
+
index: exp.single ? -1 : i,
|
|
120
|
+
...(exp.exportName ? { exportName: exp.exportName } : {}),
|
|
121
|
+
}));
|
|
122
|
+
};
|
|
94
123
|
for (const t of ALL_CONTRACT_TEMPLATES) {
|
|
95
124
|
ingest(t, ContractTemplateSource.Builtin, undefined, undefined);
|
|
96
125
|
}
|
|
97
126
|
for (const file of localFiles(inspection)) {
|
|
98
127
|
try {
|
|
99
|
-
const
|
|
128
|
+
const exp = await importTemplates(file);
|
|
100
129
|
const rel = nodePath.relative(inspection.projectRoot, file) || file;
|
|
101
|
-
|
|
102
|
-
ingest(raw, ContractTemplateSource.Local, undefined, rel);
|
|
130
|
+
ingestAll(exp, file, ContractTemplateSource.Local, undefined, rel);
|
|
103
131
|
}
|
|
104
132
|
catch (e) {
|
|
105
133
|
issues.push({
|
|
@@ -124,9 +152,7 @@ export async function loadAllContractTemplates(inspection) {
|
|
|
124
152
|
continue;
|
|
125
153
|
}
|
|
126
154
|
try {
|
|
127
|
-
|
|
128
|
-
for (const raw of list)
|
|
129
|
-
ingest(raw, ContractTemplateSource.Pack, pack.packageName, rel);
|
|
155
|
+
ingestAll(await importTemplates(file), file, ContractTemplateSource.Pack, pack.packageName, rel);
|
|
130
156
|
}
|
|
131
157
|
catch (e) {
|
|
132
158
|
issues.push({
|
|
@@ -138,8 +164,8 @@ export async function loadAllContractTemplates(inspection) {
|
|
|
138
164
|
}
|
|
139
165
|
}
|
|
140
166
|
}
|
|
141
|
-
CACHE.set(inspection.projectRoot, { cacheKey, entries, issues });
|
|
142
|
-
return { entries, issues };
|
|
167
|
+
CACHE.set(inspection.projectRoot, { cacheKey, entries, issues, rejected });
|
|
168
|
+
return { entries, issues, rejected };
|
|
143
169
|
}
|
|
144
170
|
export async function listAllContractTemplates(inspection) {
|
|
145
171
|
const { entries } = await loadAllContractTemplates(inspection);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every contribution kind the engine loads — one per manifest contribution
|
|
3
|
+
* slot that has a loader (`CONTRIBUTION_FILE_KEYS`, @shrkcrft/plugin-api), plus
|
|
4
|
+
* `path-convention` / `docs`, whose slots feed the path / knowledge loaders.
|
|
5
|
+
*
|
|
6
|
+
* Round 12 (12.1e): the inventory knew only the knowledge family and six
|
|
7
|
+
* registries, so a registration hint, a gate-plane rule, a delegate recipe or
|
|
8
|
+
* a construct facet contributed by a pack appeared on no contributions surface
|
|
9
|
+
* — and neither did a rejected one. Every loader-backed slot now has a kind
|
|
10
|
+
* (the inventory's `KIND_TO_SLOT` is a `Record` over this enum, so a kind
|
|
11
|
+
* without a slot is a compile error, and an r76 lock holds every loader-backed
|
|
12
|
+
* slot to a kind).
|
|
13
|
+
*/
|
|
14
|
+
export declare enum ContributionKind {
|
|
15
|
+
Knowledge = "knowledge",
|
|
16
|
+
Rule = "rule",
|
|
17
|
+
Path = "path",
|
|
18
|
+
PathConvention = "path-convention",
|
|
19
|
+
Template = "template",
|
|
20
|
+
Pipeline = "pipeline",
|
|
21
|
+
Preset = "preset",
|
|
22
|
+
Boundary = "boundary",
|
|
23
|
+
ScaffoldPattern = "scaffold-pattern",
|
|
24
|
+
Policy = "policy",
|
|
25
|
+
Construct = "construct",
|
|
26
|
+
ConstructFacet = "construct-facet",
|
|
27
|
+
Playbook = "playbook",
|
|
28
|
+
SearchTuning = "search-tuning",
|
|
29
|
+
FeedbackRule = "feedback-rule",
|
|
30
|
+
Decision = "decision",
|
|
31
|
+
ContractTemplate = "contract-template",
|
|
32
|
+
MigrationProfile = "migration-profile",
|
|
33
|
+
ContextTest = "context-test",
|
|
34
|
+
AgentTest = "agent-test",
|
|
35
|
+
Helper = "helper",
|
|
36
|
+
TaskRoutingHint = "task-routing-hint",
|
|
37
|
+
RegistrationHint = "registration-hint",
|
|
38
|
+
Convention = "convention",
|
|
39
|
+
Docs = "docs",
|
|
40
|
+
DelegateRecipe = "delegate-recipe",
|
|
41
|
+
FrameworkExtractor = "framework-extractor",
|
|
42
|
+
WiringRule = "wiring-rule",
|
|
43
|
+
Registry = "registry",
|
|
44
|
+
RegistrationIdiom = "registration-idiom",
|
|
45
|
+
PolicyRule = "policy-rule",
|
|
46
|
+
ReusePrimitive = "reuse-primitive",
|
|
47
|
+
Baseline = "baseline",
|
|
48
|
+
GeneratedArtifact = "generated-artifact",
|
|
49
|
+
/** `docReferenceFiles` — the prose doc-reference plane (round 13: a declared slot). */
|
|
50
|
+
DocReference = "doc-reference"
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=contribution-kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contribution-kind.d.ts","sourceRoot":"","sources":["../src/contribution-kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,oBAAY,gBAAgB;IAC1B,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,cAAc,oBAAoB;IAClC,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,eAAe,qBAAqB;IACpC,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,cAAc,oBAAoB;IAClC,QAAQ,aAAa;IACrB,YAAY,kBAAkB;IAC9B,YAAY,kBAAkB;IAC9B,QAAQ,aAAa;IACrB,gBAAgB,sBAAsB;IACtC,gBAAgB,sBAAsB;IACtC,WAAW,iBAAiB;IAC5B,SAAS,eAAe;IACxB,MAAM,WAAW;IACjB,eAAe,sBAAsB;IACrC,gBAAgB,sBAAsB;IACtC,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,cAAc,oBAAoB;IAClC,kBAAkB,wBAAwB;IAC1C,UAAU,gBAAgB;IAC1B,QAAQ,aAAa;IACrB,iBAAiB,uBAAuB;IACxC,UAAU,gBAAgB;IAC1B,cAAc,oBAAoB;IAClC,QAAQ,aAAa;IACrB,iBAAiB,uBAAuB;IACxC,uFAAuF;IACvF,YAAY,kBAAkB;CAC/B"}
|