@ai-primitives-hub/core 0.2.1 → 0.2.2-next.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/dist/domain/bundle/version.d.ts +13 -0
- package/dist/domain/bundle/version.d.ts.map +1 -1
- package/dist/domain/bundle/version.js +27 -0
- package/dist/domain/bundle/version.js.map +1 -1
- package/dist/domain/collection/apm-release-plan.d.ts +39 -0
- package/dist/domain/collection/apm-release-plan.d.ts.map +1 -0
- package/dist/domain/collection/apm-release-plan.js +185 -0
- package/dist/domain/collection/apm-release-plan.js.map +1 -0
- package/dist/domain/collection/contribution.d.ts +126 -0
- package/dist/domain/collection/contribution.d.ts.map +1 -0
- package/dist/domain/collection/contribution.js +462 -0
- package/dist/domain/collection/contribution.js.map +1 -0
- package/dist/domain/collection/diagnostics.d.ts +166 -0
- package/dist/domain/collection/diagnostics.d.ts.map +1 -0
- package/dist/domain/collection/diagnostics.js +3 -0
- package/dist/domain/collection/diagnostics.js.map +1 -0
- package/dist/domain/collection/manifest-validator.d.ts +3 -2
- package/dist/domain/collection/manifest-validator.d.ts.map +1 -1
- package/dist/domain/collection/manifest-validator.js +99 -17
- package/dist/domain/collection/manifest-validator.js.map +1 -1
- package/dist/domain/collection/release-manifest-plan.d.ts +9 -0
- package/dist/domain/collection/release-manifest-plan.d.ts.map +1 -1
- package/dist/domain/collection/release-manifest-plan.js +45 -14
- package/dist/domain/collection/release-manifest-plan.js.map +1 -1
- package/dist/domain/collection/validate.d.ts +5 -0
- package/dist/domain/collection/validate.d.ts.map +1 -1
- package/dist/domain/collection/validate.js +7 -2
- package/dist/domain/collection/validate.js.map +1 -1
- package/dist/domain/diagnostics/primitives/catalogue.d.ts +40 -0
- package/dist/domain/diagnostics/primitives/catalogue.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/catalogue.js +78 -0
- package/dist/domain/diagnostics/primitives/catalogue.js.map +1 -0
- package/dist/domain/diagnostics/primitives/classifier.d.ts +81 -0
- package/dist/domain/diagnostics/primitives/classifier.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/classifier.js +138 -0
- package/dist/domain/diagnostics/primitives/classifier.js.map +1 -0
- package/dist/domain/diagnostics/primitives/evaluators.d.ts +138 -0
- package/dist/domain/diagnostics/primitives/evaluators.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/evaluators.js +485 -0
- package/dist/domain/diagnostics/primitives/evaluators.js.map +1 -0
- package/dist/domain/diagnostics/primitives/fixture.d.ts +97 -0
- package/dist/domain/diagnostics/primitives/fixture.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/fixture.js +265 -0
- package/dist/domain/diagnostics/primitives/fixture.js.map +1 -0
- package/dist/domain/diagnostics/primitives/index.d.ts +18 -0
- package/dist/domain/diagnostics/primitives/index.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/index.js +34 -0
- package/dist/domain/diagnostics/primitives/index.js.map +1 -0
- package/dist/domain/diagnostics/primitives/known-gaps.d.ts +50 -0
- package/dist/domain/diagnostics/primitives/known-gaps.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/known-gaps.js +148 -0
- package/dist/domain/diagnostics/primitives/known-gaps.js.map +1 -0
- package/dist/domain/diagnostics/primitives/manifest-view.d.ts +28 -0
- package/dist/domain/diagnostics/primitives/manifest-view.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/manifest-view.js +50 -0
- package/dist/domain/diagnostics/primitives/manifest-view.js.map +1 -0
- package/dist/domain/diagnostics/primitives/placements.d.ts +51 -0
- package/dist/domain/diagnostics/primitives/placements.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/placements.js +76 -0
- package/dist/domain/diagnostics/primitives/placements.js.map +1 -0
- package/dist/domain/diagnostics/primitives/planner.d.ts +60 -0
- package/dist/domain/diagnostics/primitives/planner.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/planner.js +60 -0
- package/dist/domain/diagnostics/primitives/planner.js.map +1 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.d.ts +38 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.js +173 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.js.map +1 -0
- package/dist/domain/diagnostics/primitives/report.d.ts +122 -0
- package/dist/domain/diagnostics/primitives/report.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/report.js +85 -0
- package/dist/domain/diagnostics/primitives/report.js.map +1 -0
- package/dist/domain/diagnostics/primitives/sandbox.d.ts +59 -0
- package/dist/domain/diagnostics/primitives/sandbox.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/sandbox.js +193 -0
- package/dist/domain/diagnostics/primitives/sandbox.js.map +1 -0
- package/dist/domain/diagnostics/primitives/support-matrix.d.ts +36 -0
- package/dist/domain/diagnostics/primitives/support-matrix.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/support-matrix.js +69 -0
- package/dist/domain/diagnostics/primitives/support-matrix.js.map +1 -0
- package/dist/domain/diagnostics/primitives/types.d.ts +117 -0
- package/dist/domain/diagnostics/primitives/types.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/types.js +62 -0
- package/dist/domain/diagnostics/primitives/types.js.map +1 -0
- package/dist/domain/governance/catalogue.d.ts +11 -0
- package/dist/domain/governance/catalogue.d.ts.map +1 -0
- package/dist/domain/governance/catalogue.js +45 -0
- package/dist/domain/governance/catalogue.js.map +1 -0
- package/dist/domain/governance/effective-rules.d.ts +19 -0
- package/dist/domain/governance/effective-rules.d.ts.map +1 -0
- package/dist/domain/governance/effective-rules.js +49 -0
- package/dist/domain/governance/effective-rules.js.map +1 -0
- package/dist/domain/governance/evaluate.d.ts +16 -0
- package/dist/domain/governance/evaluate.d.ts.map +1 -0
- package/dist/domain/governance/evaluate.js +34 -0
- package/dist/domain/governance/evaluate.js.map +1 -0
- package/dist/domain/governance/hub-scope.d.ts +74 -0
- package/dist/domain/governance/hub-scope.d.ts.map +1 -0
- package/dist/domain/governance/hub-scope.js +202 -0
- package/dist/domain/governance/hub-scope.js.map +1 -0
- package/dist/domain/governance/hub-scoped-inventory.d.ts +22 -0
- package/dist/domain/governance/hub-scoped-inventory.d.ts.map +1 -0
- package/dist/domain/governance/hub-scoped-inventory.js +59 -0
- package/dist/domain/governance/hub-scoped-inventory.js.map +1 -0
- package/dist/domain/governance/index.d.ts +15 -0
- package/dist/domain/governance/index.d.ts.map +1 -0
- package/dist/domain/governance/index.js +31 -0
- package/dist/domain/governance/index.js.map +1 -0
- package/dist/domain/governance/rule-registry.d.ts +20 -0
- package/dist/domain/governance/rule-registry.d.ts.map +1 -0
- package/dist/domain/governance/rule-registry.js +40 -0
- package/dist/domain/governance/rule-registry.js.map +1 -0
- package/dist/domain/governance/rules/collection.d.ts +32 -0
- package/dist/domain/governance/rules/collection.d.ts.map +1 -0
- package/dist/domain/governance/rules/collection.js +153 -0
- package/dist/domain/governance/rules/collection.js.map +1 -0
- package/dist/domain/governance/rules/config.d.ts +15 -0
- package/dist/domain/governance/rules/config.d.ts.map +1 -0
- package/dist/domain/governance/rules/config.js +38 -0
- package/dist/domain/governance/rules/config.js.map +1 -0
- package/dist/domain/governance/rules/hub.d.ts +7 -0
- package/dist/domain/governance/rules/hub.d.ts.map +1 -0
- package/dist/domain/governance/rules/hub.js +10 -0
- package/dist/domain/governance/rules/hub.js.map +1 -0
- package/dist/domain/governance/types.d.ts +70 -0
- package/dist/domain/governance/types.d.ts.map +1 -0
- package/dist/domain/governance/types.js +7 -0
- package/dist/domain/governance/types.js.map +1 -0
- package/dist/domain/hub/diagnostics.d.ts +92 -0
- package/dist/domain/hub/diagnostics.d.ts.map +1 -0
- package/dist/domain/hub/diagnostics.js +11 -0
- package/dist/domain/hub/diagnostics.js.map +1 -0
- package/dist/domain/hub/profile-requirements.d.ts +16 -0
- package/dist/domain/hub/profile-requirements.d.ts.map +1 -0
- package/dist/domain/hub/profile-requirements.js +16 -0
- package/dist/domain/hub/profile-requirements.js.map +1 -0
- package/dist/domain/hub/replicate.d.ts +23 -0
- package/dist/domain/hub/replicate.d.ts.map +1 -1
- package/dist/domain/hub/replicate.js +13 -0
- package/dist/domain/hub/replicate.js.map +1 -1
- package/dist/domain/hub/types.d.ts +2 -0
- package/dist/domain/hub/types.d.ts.map +1 -1
- package/dist/domain/hub/validate.d.ts +150 -2
- package/dist/domain/hub/validate.d.ts.map +1 -1
- package/dist/domain/hub/validate.js +421 -37
- package/dist/domain/hub/validate.js.map +1 -1
- package/dist/domain/index.d.ts +17 -0
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +17 -0
- package/dist/domain/index.js.map +1 -1
- package/dist/domain/install/category.d.ts +31 -0
- package/dist/domain/install/category.d.ts.map +1 -0
- package/dist/domain/install/category.js +33 -0
- package/dist/domain/install/category.js.map +1 -0
- package/dist/domain/install/file-mode.d.ts +49 -0
- package/dist/domain/install/file-mode.d.ts.map +1 -0
- package/dist/domain/install/file-mode.js +54 -0
- package/dist/domain/install/file-mode.js.map +1 -0
- package/dist/domain/install/git-exclude.d.ts +22 -0
- package/dist/domain/install/git-exclude.d.ts.map +1 -0
- package/dist/domain/install/git-exclude.js +56 -0
- package/dist/domain/install/git-exclude.js.map +1 -0
- package/dist/domain/install/installable.d.ts +2 -0
- package/dist/domain/install/installable.d.ts.map +1 -1
- package/dist/domain/install/kind-route.d.ts +80 -0
- package/dist/domain/install/kind-route.d.ts.map +1 -0
- package/dist/domain/install/kind-route.js +135 -0
- package/dist/domain/install/kind-route.js.map +1 -0
- package/dist/domain/install/record-errors.d.ts +53 -0
- package/dist/domain/install/record-errors.d.ts.map +1 -0
- package/dist/domain/install/record-errors.js +104 -0
- package/dist/domain/install/record-errors.js.map +1 -0
- package/dist/domain/install/record-object.d.ts +21 -0
- package/dist/domain/install/record-object.d.ts.map +1 -0
- package/dist/domain/install/record-object.js +38 -0
- package/dist/domain/install/record-object.js.map +1 -0
- package/dist/domain/install/record-parse.d.ts +23 -0
- package/dist/domain/install/record-parse.d.ts.map +1 -0
- package/dist/domain/install/record-parse.js +73 -0
- package/dist/domain/install/record-parse.js.map +1 -0
- package/dist/domain/install/record-path.d.ts +26 -0
- package/dist/domain/install/record-path.d.ts.map +1 -0
- package/dist/domain/install/record-path.js +130 -0
- package/dist/domain/install/record-path.js.map +1 -0
- package/dist/domain/install/record-types.d.ts +183 -0
- package/dist/domain/install/record-types.d.ts.map +1 -0
- package/dist/domain/install/record-types.js +92 -0
- package/dist/domain/install/record-types.js.map +1 -0
- package/dist/domain/install/types.d.ts +2 -0
- package/dist/domain/install/types.d.ts.map +1 -1
- package/dist/domain/mcp/index.d.ts +1 -0
- package/dist/domain/mcp/index.d.ts.map +1 -1
- package/dist/domain/mcp/index.js +1 -0
- package/dist/domain/mcp/index.js.map +1 -1
- package/dist/domain/mcp/server-key.d.ts +35 -0
- package/dist/domain/mcp/server-key.d.ts.map +1 -0
- package/dist/domain/mcp/server-key.js +44 -0
- package/dist/domain/mcp/server-key.js.map +1 -0
- package/dist/domain/plugin/agent-plugin-spec.d.ts +8 -0
- package/dist/domain/plugin/agent-plugin-spec.d.ts.map +1 -1
- package/dist/domain/plugin/agent-plugin-spec.js +22 -8
- package/dist/domain/plugin/agent-plugin-spec.js.map +1 -1
- package/dist/domain/registry-error.d.ts +1 -1
- package/dist/domain/registry-error.d.ts.map +1 -1
- package/dist/domain/registry-error.js +2 -1
- package/dist/domain/registry-error.js.map +1 -1
- package/dist/domain/security/fingerprint.d.ts +18 -0
- package/dist/domain/security/fingerprint.d.ts.map +1 -0
- package/dist/domain/security/fingerprint.js +34 -0
- package/dist/domain/security/fingerprint.js.map +1 -0
- package/dist/domain/security/high-impact-rules.d.ts +30 -0
- package/dist/domain/security/high-impact-rules.d.ts.map +1 -0
- package/dist/domain/security/high-impact-rules.js +160 -0
- package/dist/domain/security/high-impact-rules.js.map +1 -0
- package/dist/domain/security/index.d.ts +10 -0
- package/dist/domain/security/index.d.ts.map +1 -0
- package/dist/domain/security/index.js +26 -0
- package/dist/domain/security/index.js.map +1 -0
- package/dist/domain/security/markdown-context.d.ts +17 -0
- package/dist/domain/security/markdown-context.d.ts.map +1 -0
- package/dist/domain/security/markdown-context.js +74 -0
- package/dist/domain/security/markdown-context.js.map +1 -0
- package/dist/domain/security/policy.d.ts +17 -0
- package/dist/domain/security/policy.d.ts.map +1 -0
- package/dist/domain/security/policy.js +31 -0
- package/dist/domain/security/policy.js.map +1 -0
- package/dist/domain/security/rating/findings-document.d.ts +22 -0
- package/dist/domain/security/rating/findings-document.d.ts.map +1 -0
- package/dist/domain/security/rating/findings-document.js +57 -0
- package/dist/domain/security/rating/findings-document.js.map +1 -0
- package/dist/domain/security/rating/index.d.ts +5 -0
- package/dist/domain/security/rating/index.d.ts.map +1 -0
- package/dist/domain/security/rating/index.js +21 -0
- package/dist/domain/security/rating/index.js.map +1 -0
- package/dist/domain/security/rating/scoring.d.ts +83 -0
- package/dist/domain/security/rating/scoring.d.ts.map +1 -0
- package/dist/domain/security/rating/scoring.js +115 -0
- package/dist/domain/security/rating/scoring.js.map +1 -0
- package/dist/domain/security/rating/security-rating-report.d.ts +111 -0
- package/dist/domain/security/rating/security-rating-report.d.ts.map +1 -0
- package/dist/domain/security/rating/security-rating-report.js +152 -0
- package/dist/domain/security/rating/security-rating-report.js.map +1 -0
- package/dist/domain/security/rating/types.d.ts +22 -0
- package/dist/domain/security/rating/types.d.ts.map +1 -0
- package/dist/domain/security/rating/types.js +11 -0
- package/dist/domain/security/rating/types.js.map +1 -0
- package/dist/domain/security/remediations.d.ts +17 -0
- package/dist/domain/security/remediations.d.ts.map +1 -0
- package/dist/domain/security/remediations.js +61 -0
- package/dist/domain/security/remediations.js.map +1 -0
- package/dist/domain/security/rule-engine.d.ts +8 -0
- package/dist/domain/security/rule-engine.d.ts.map +1 -0
- package/dist/domain/security/rule-engine.js +875 -0
- package/dist/domain/security/rule-engine.js.map +1 -0
- package/dist/domain/security/suppression.d.ts +19 -0
- package/dist/domain/security/suppression.d.ts.map +1 -0
- package/dist/domain/security/suppression.js +78 -0
- package/dist/domain/security/suppression.js.map +1 -0
- package/dist/domain/security/types.d.ts +91 -0
- package/dist/domain/security/types.d.ts.map +1 -0
- package/dist/domain/security/types.js +10 -0
- package/dist/domain/security/types.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/ports/app-storage.d.ts +11 -15
- package/dist/ports/app-storage.d.ts.map +1 -1
- package/dist/ports/app-storage.js +8 -8
- package/dist/ports/argv-process-runner.d.ts +6 -0
- package/dist/ports/argv-process-runner.d.ts.map +1 -0
- package/dist/ports/argv-process-runner.js +3 -0
- package/dist/ports/argv-process-runner.js.map +1 -0
- package/dist/ports/bundle-extractor.d.ts +16 -3
- package/dist/ports/bundle-extractor.d.ts.map +1 -1
- package/dist/ports/collection-contribution.d.ts +36 -0
- package/dist/ports/collection-contribution.d.ts.map +1 -0
- package/dist/ports/collection-contribution.js +3 -0
- package/dist/ports/collection-contribution.js.map +1 -0
- package/dist/ports/filesystem.d.ts +12 -0
- package/dist/ports/filesystem.d.ts.map +1 -1
- package/dist/ports/hub-collection-index.d.ts +27 -0
- package/dist/ports/hub-collection-index.d.ts.map +1 -0
- package/dist/ports/hub-collection-index.js +3 -0
- package/dist/ports/hub-collection-index.js.map +1 -0
- package/dist/ports/hub-contribution.d.ts +158 -0
- package/dist/ports/hub-contribution.d.ts.map +1 -0
- package/dist/ports/hub-contribution.js +3 -0
- package/dist/ports/hub-contribution.js.map +1 -0
- package/dist/ports/index.d.ts +12 -0
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js +12 -0
- package/dist/ports/index.js.map +1 -1
- package/dist/ports/primitive-diagnostics-driver.d.ts +96 -0
- package/dist/ports/primitive-diagnostics-driver.d.ts.map +1 -0
- package/dist/ports/primitive-diagnostics-driver.js +3 -0
- package/dist/ports/primitive-diagnostics-driver.js.map +1 -0
- package/dist/ports/record-fs.d.ts +46 -0
- package/dist/ports/record-fs.d.ts.map +1 -0
- package/dist/ports/record-fs.js +9 -0
- package/dist/ports/record-fs.js.map +1 -0
- package/dist/ports/registry-operations.d.ts +3 -2
- package/dist/ports/registry-operations.d.ts.map +1 -1
- package/dist/ports/release-lookup.d.ts +24 -0
- package/dist/ports/release-lookup.d.ts.map +1 -0
- package/dist/ports/release-lookup.js +7 -0
- package/dist/ports/release-lookup.js.map +1 -0
- package/dist/ports/release-source.d.ts +17 -3
- package/dist/ports/release-source.d.ts.map +1 -1
- package/dist/ports/repository-exclusion.d.ts +30 -0
- package/dist/ports/repository-exclusion.d.ts.map +1 -0
- package/dist/ports/repository-exclusion.js +3 -0
- package/dist/ports/repository-exclusion.js.map +1 -0
- package/dist/ports/schema-validator.d.ts +25 -0
- package/dist/ports/schema-validator.d.ts.map +1 -0
- package/dist/ports/schema-validator.js +7 -0
- package/dist/ports/schema-validator.js.map +1 -0
- package/dist/ports/security-report-store.d.ts +9 -0
- package/dist/ports/security-report-store.d.ts.map +1 -0
- package/dist/ports/security-report-store.js +4 -0
- package/dist/ports/security-report-store.js.map +1 -0
- package/dist/ports/security-scan-engine.d.ts +32 -0
- package/dist/ports/security-scan-engine.d.ts.map +1 -0
- package/dist/ports/security-scan-engine.js +6 -0
- package/dist/ports/security-scan-engine.js.map +1 -0
- package/dist/ports/security-scan-input.d.ts +63 -0
- package/dist/ports/security-scan-input.d.ts.map +1 -0
- package/dist/ports/security-scan-input.js +3 -0
- package/dist/ports/security-scan-input.js.map +1 -0
- package/dist/ports/source-adapter.d.ts +11 -0
- package/dist/ports/source-adapter.d.ts.map +1 -1
- package/dist/public/schemas/collection.schema.json +0 -1
- package/dist/public/schemas/hub-governance.schema.json +21 -0
- package/dist/public/schemas/install-record.schema.json +343 -0
- package/dist/public/schemas/security-rating-report.schema.json +113 -0
- package/package.json +2 -2
package/dist/domain/index.js
CHANGED
|
@@ -24,8 +24,11 @@ __exportStar(require("./bundle/version"), exports);
|
|
|
24
24
|
__exportStar(require("./bundle/identity-matcher"), exports);
|
|
25
25
|
__exportStar(require("./collection/types"), exports);
|
|
26
26
|
__exportStar(require("./collection/validate"), exports);
|
|
27
|
+
__exportStar(require("./collection/diagnostics"), exports);
|
|
28
|
+
__exportStar(require("./collection/contribution"), exports);
|
|
27
29
|
__exportStar(require("./collection/manifest-validator"), exports);
|
|
28
30
|
__exportStar(require("./collection/release-manifest-plan"), exports);
|
|
31
|
+
__exportStar(require("./collection/apm-release-plan"), exports);
|
|
29
32
|
__exportStar(require("./scaffold"), exports);
|
|
30
33
|
__exportStar(require("./discovery/types"), exports);
|
|
31
34
|
__exportStar(require("./errors"), exports);
|
|
@@ -40,16 +43,30 @@ __exportStar(require("./install/target"), exports);
|
|
|
40
43
|
__exportStar(require("./install/installable"), exports);
|
|
41
44
|
__exportStar(require("./install/copilot-file-type"), exports);
|
|
42
45
|
__exportStar(require("./install/layout"), exports);
|
|
46
|
+
__exportStar(require("./install/category"), exports);
|
|
47
|
+
__exportStar(require("./install/kind-route"), exports);
|
|
43
48
|
__exportStar(require("./install/integrity"), exports);
|
|
49
|
+
__exportStar(require("./install/file-mode"), exports);
|
|
44
50
|
__exportStar(require("./install/transform"), exports);
|
|
51
|
+
__exportStar(require("./install/record-types"), exports);
|
|
52
|
+
__exportStar(require("./install/record-object"), exports);
|
|
53
|
+
__exportStar(require("./install/record-errors"), exports);
|
|
54
|
+
__exportStar(require("./install/record-path"), exports);
|
|
55
|
+
__exportStar(require("./install/git-exclude"), exports);
|
|
56
|
+
__exportStar(require("./install/record-parse"), exports);
|
|
45
57
|
__exportStar(require("./registry/types"), exports);
|
|
46
58
|
__exportStar(require("./registry/guards"), exports);
|
|
47
59
|
__exportStar(require("./registry/settings"), exports);
|
|
48
60
|
__exportStar(require("./hub/types"), exports);
|
|
49
61
|
__exportStar(require("./hub/validate"), exports);
|
|
62
|
+
__exportStar(require("./hub/diagnostics"), exports);
|
|
50
63
|
__exportStar(require("./hub/replicate"), exports);
|
|
64
|
+
__exportStar(require("./hub/profile-requirements"), exports);
|
|
65
|
+
__exportStar(require("./governance"), exports);
|
|
51
66
|
__exportStar(require("./primitive/types"), exports);
|
|
52
67
|
__exportStar(require("./skill/validate"), exports);
|
|
53
68
|
__exportStar(require("./plugin/agent-plugin-spec"), exports);
|
|
54
69
|
__exportStar(require("./mcp"), exports);
|
|
70
|
+
__exportStar(require("./diagnostics/primitives"), exports);
|
|
71
|
+
__exportStar(require("./security"), exports);
|
|
55
72
|
//# sourceMappingURL=index.js.map
|
package/dist/domain/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,iDAA+B;AAC/B,8CAA4B;AAC5B,mDAAiC;AACjC,4DAA0C;AAC1C,qDAAmC;AACnC,wDAAsC;AACtC,kEAAgD;AAChD,qEAAmD;AACnD,6CAA2B;AAC3B,oDAAkC;AAClC,2CAAyB;AACzB,mDAAiC;AACjC,iDAA+B;AAC/B,oEAAkD;AAClD,oEAAkD;AAClD,wEAAsD;AACtD,8CAA4B;AAC5B,kDAAgC;AAChC,mDAAiC;AACjC,wDAAsC;AACtC,8DAA4C;AAC5C,mDAAiC;AACjC,sDAAoC;AACpC,sDAAoC;AACpC,mDAAiC;AACjC,oDAAkC;AAClC,sDAAoC;AACpC,8CAA4B;AAC5B,iDAA+B;AAC/B,kDAAgC;AAChC,oDAAkC;AAClC,mDAAiC;AACjC,6DAA2C;AAC3C,wCAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,iDAA+B;AAC/B,8CAA4B;AAC5B,mDAAiC;AACjC,4DAA0C;AAC1C,qDAAmC;AACnC,wDAAsC;AACtC,2DAAyC;AACzC,4DAA0C;AAC1C,kEAAgD;AAChD,qEAAmD;AACnD,gEAA8C;AAC9C,6CAA2B;AAC3B,oDAAkC;AAClC,2CAAyB;AACzB,mDAAiC;AACjC,iDAA+B;AAC/B,oEAAkD;AAClD,oEAAkD;AAClD,wEAAsD;AACtD,8CAA4B;AAC5B,kDAAgC;AAChC,mDAAiC;AACjC,wDAAsC;AACtC,8DAA4C;AAC5C,mDAAiC;AACjC,qDAAmC;AACnC,uDAAqC;AACrC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,0DAAwC;AACxC,0DAAwC;AACxC,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,mDAAiC;AACjC,oDAAkC;AAClC,sDAAoC;AACpC,8CAA4B;AAC5B,iDAA+B;AAC/B,oDAAkC;AAClC,kDAAgC;AAChC,6DAA2C;AAC3C,+CAA6B;AAC7B,oDAAkC;AAClC,mDAAiC;AACjC,6DAA2C;AAC3C,wCAAsB;AACtB,2DAAyC;AACzC,6CAA2B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primitive install categories (ADR-0009).
|
|
3
|
+
*
|
|
4
|
+
* Every primitive kind belongs to exactly one install category, which
|
|
5
|
+
* decides how a bundle item of that kind is packaged and placed:
|
|
6
|
+
*
|
|
7
|
+
* - `file`: the item is one file.
|
|
8
|
+
* - `directory`: the item is its whole directory (`dirname(item.path)`),
|
|
9
|
+
* installed as one unit named after that directory.
|
|
10
|
+
* - `config`: the item is merged into a target's configuration file.
|
|
11
|
+
*
|
|
12
|
+
* The table reflects today's behaviour. It is a `Record` over every kind,
|
|
13
|
+
* so adding a kind does not compile without its category.
|
|
14
|
+
*
|
|
15
|
+
* Pure domain: no IO.
|
|
16
|
+
* @module domain/install/category
|
|
17
|
+
*/
|
|
18
|
+
import type { PrimitiveKind } from '../primitive/types';
|
|
19
|
+
/** The install categories, in ADR-0009 order. */
|
|
20
|
+
export declare const INSTALL_CATEGORIES: readonly ["file", "directory", "config"];
|
|
21
|
+
/** How a primitive kind is packaged and installed. */
|
|
22
|
+
export type InstallCategory = typeof INSTALL_CATEGORIES[number];
|
|
23
|
+
/** Install category of every primitive kind. */
|
|
24
|
+
export declare const KIND_INSTALL_CATEGORIES: Readonly<Record<PrimitiveKind, InstallCategory>>;
|
|
25
|
+
/**
|
|
26
|
+
* Install category of a primitive kind.
|
|
27
|
+
* @param kind - Canonical primitive kind.
|
|
28
|
+
* @returns The kind's install category.
|
|
29
|
+
*/
|
|
30
|
+
export declare const categoryOf: (kind: PrimitiveKind) => InstallCategory;
|
|
31
|
+
//# sourceMappingURL=category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../../src/domain/install/category.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EACV,aAAa,EACd,MAAM,oBAAoB,CAAC;AAE5B,iDAAiD;AACjD,eAAO,MAAM,kBAAkB,0CAA2C,CAAC;AAE3E,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAEhE,gDAAgD;AAChD,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,CAkBpF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,aAAa,KAAG,eAAgD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.categoryOf = exports.KIND_INSTALL_CATEGORIES = exports.INSTALL_CATEGORIES = void 0;
|
|
4
|
+
/** The install categories, in ADR-0009 order. */
|
|
5
|
+
exports.INSTALL_CATEGORIES = ['file', 'directory', 'config'];
|
|
6
|
+
/** Install category of every primitive kind. */
|
|
7
|
+
exports.KIND_INSTALL_CATEGORIES = {
|
|
8
|
+
prompt: 'file',
|
|
9
|
+
instruction: 'file',
|
|
10
|
+
'chat-mode': 'file',
|
|
11
|
+
agent: 'file',
|
|
12
|
+
skill: 'directory',
|
|
13
|
+
plugin: 'directory',
|
|
14
|
+
hook: 'file',
|
|
15
|
+
'mcp-server': 'config',
|
|
16
|
+
steering: 'file',
|
|
17
|
+
spec: 'file',
|
|
18
|
+
command: 'file',
|
|
19
|
+
rule: 'file',
|
|
20
|
+
'output-style': 'file',
|
|
21
|
+
tool: 'file',
|
|
22
|
+
power: 'file',
|
|
23
|
+
knowledge: 'file',
|
|
24
|
+
playbook: 'file'
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Install category of a primitive kind.
|
|
28
|
+
* @param kind - Canonical primitive kind.
|
|
29
|
+
* @returns The kind's install category.
|
|
30
|
+
*/
|
|
31
|
+
const categoryOf = (kind) => exports.KIND_INSTALL_CATEGORIES[kind];
|
|
32
|
+
exports.categoryOf = categoryOf;
|
|
33
|
+
//# sourceMappingURL=category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../../src/domain/install/category.ts"],"names":[],"mappings":";;;AAqBA,iDAAiD;AACpC,QAAA,kBAAkB,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAK3E,gDAAgD;AACnC,QAAA,uBAAuB,GAAqD;IACvF,MAAM,EAAE,MAAM;IACd,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,MAAM;IACnB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,QAAQ;IACtB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,MAAM;IACf,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,MAAM;IACtB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF;;;;GAIG;AACI,MAAM,UAAU,GAAG,CAAC,IAAmB,EAAmB,EAAE,CAAC,+BAAuB,CAAC,IAAI,CAAC,CAAC;AAArF,QAAA,UAAU,cAA2E"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain layer — install-time file modes (issue #577).
|
|
3
|
+
*
|
|
4
|
+
* A bundle archive records each file's Unix permission bits; a committed
|
|
5
|
+
* `100755` script is stored as a `0755` entry. Extractors attach that mode
|
|
6
|
+
* to the extracted bytes with {@link withFileMode}; the install writers call
|
|
7
|
+
* {@link applyFileMode} after every verified write, which is the single place
|
|
8
|
+
* the executable bit of an installed file is decided.
|
|
9
|
+
*
|
|
10
|
+
* Pure domain logic over an injected port subset: no `node:fs`, no IO of
|
|
11
|
+
* its own.
|
|
12
|
+
* @module domain/install/file-mode
|
|
13
|
+
*/
|
|
14
|
+
import type { ExtractedFile } from '../../ports/bundle-extractor';
|
|
15
|
+
/**
|
|
16
|
+
* Attach the permission bits recorded for a file to its bytes.
|
|
17
|
+
*
|
|
18
|
+
* Sets a non-enumerable, read-only `mode` on the given object and returns it,
|
|
19
|
+
* so map copies (`new Map(files)`, filtered maps) keep the mode while the
|
|
20
|
+
* bytes themselves (and equality checks on them) are unchanged. Setuid,
|
|
21
|
+
* setgid and sticky bits are dropped: they are untrusted archive metadata.
|
|
22
|
+
* @param bytes File contents; tagged in place.
|
|
23
|
+
* @param mode Unix mode recorded by the source.
|
|
24
|
+
* @returns The same bytes, now carrying `mode`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function withFileMode(bytes: Uint8Array, mode: number): ExtractedFile;
|
|
27
|
+
/**
|
|
28
|
+
* Whether a recorded mode grants execute permission to anyone.
|
|
29
|
+
* @param mode Unix permission bits.
|
|
30
|
+
* @returns True when any execute bit is set.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isExecutableMode(mode: number): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The filesystem subset {@link applyFileMode} needs. Optional, so adapters
|
|
35
|
+
* that cannot set modes (in-memory doubles, editor filesystems) still fit.
|
|
36
|
+
*/
|
|
37
|
+
export interface ExecutableBitSetter {
|
|
38
|
+
setExecutable?(path: string, executable: boolean): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Give an installed file the executable bit its source recorded.
|
|
42
|
+
*
|
|
43
|
+
* No-op when the source carries no mode or the filesystem cannot set one.
|
|
44
|
+
* @param fs Filesystem the file was written through.
|
|
45
|
+
* @param filePath Absolute path of the installed file.
|
|
46
|
+
* @param source Source bytes the file was written from.
|
|
47
|
+
*/
|
|
48
|
+
export declare function applyFileMode(fs: ExecutableBitSetter, filePath: string, source: ExtractedFile): Promise<void>;
|
|
49
|
+
//# sourceMappingURL=file-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-mode.d.ts","sourceRoot":"","sources":["../../../src/domain/install/file-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EACV,aAAa,EACd,MAAM,8BAA8B,CAAC;AAQtC;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAS3E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGtD;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,EAAE,EAAE,mBAAmB,EACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withFileMode = withFileMode;
|
|
4
|
+
exports.isExecutableMode = isExecutableMode;
|
|
5
|
+
exports.applyFileMode = applyFileMode;
|
|
6
|
+
/** `rwxrwxrwx` — the only permission bits an archive mode may carry over. */
|
|
7
|
+
const PERMISSION_BITS = 0o777;
|
|
8
|
+
/** `--x--x--x`. */
|
|
9
|
+
const EXECUTE_BITS = 0o111;
|
|
10
|
+
/**
|
|
11
|
+
* Attach the permission bits recorded for a file to its bytes.
|
|
12
|
+
*
|
|
13
|
+
* Sets a non-enumerable, read-only `mode` on the given object and returns it,
|
|
14
|
+
* so map copies (`new Map(files)`, filtered maps) keep the mode while the
|
|
15
|
+
* bytes themselves (and equality checks on them) are unchanged. Setuid,
|
|
16
|
+
* setgid and sticky bits are dropped: they are untrusted archive metadata.
|
|
17
|
+
* @param bytes File contents; tagged in place.
|
|
18
|
+
* @param mode Unix mode recorded by the source.
|
|
19
|
+
* @returns The same bytes, now carrying `mode`.
|
|
20
|
+
*/
|
|
21
|
+
function withFileMode(bytes, mode) {
|
|
22
|
+
Object.defineProperty(bytes, 'mode', {
|
|
23
|
+
// eslint-disable-next-line no-bitwise -- keep only the permission bits
|
|
24
|
+
value: mode & PERMISSION_BITS,
|
|
25
|
+
enumerable: false,
|
|
26
|
+
writable: false,
|
|
27
|
+
configurable: true
|
|
28
|
+
});
|
|
29
|
+
return bytes;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Whether a recorded mode grants execute permission to anyone.
|
|
33
|
+
* @param mode Unix permission bits.
|
|
34
|
+
* @returns True when any execute bit is set.
|
|
35
|
+
*/
|
|
36
|
+
function isExecutableMode(mode) {
|
|
37
|
+
// eslint-disable-next-line no-bitwise -- test the execute bits
|
|
38
|
+
return (mode & EXECUTE_BITS) !== 0;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Give an installed file the executable bit its source recorded.
|
|
42
|
+
*
|
|
43
|
+
* No-op when the source carries no mode or the filesystem cannot set one.
|
|
44
|
+
* @param fs Filesystem the file was written through.
|
|
45
|
+
* @param filePath Absolute path of the installed file.
|
|
46
|
+
* @param source Source bytes the file was written from.
|
|
47
|
+
*/
|
|
48
|
+
async function applyFileMode(fs, filePath, source) {
|
|
49
|
+
if (source.mode === undefined || fs.setExecutable === undefined) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await fs.setExecutable(filePath, isExecutableMode(source.mode));
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=file-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-mode.js","sourceRoot":"","sources":["../../../src/domain/install/file-mode.ts"],"names":[],"mappings":";;AAkCA,oCASC;AAOD,4CAGC;AAkBD,sCASC;AA/DD,6EAA6E;AAC7E,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,mBAAmB;AACnB,MAAM,YAAY,GAAG,KAAK,CAAC;AAE3B;;;;;;;;;;GAUG;AACH,SAAgB,YAAY,CAAC,KAAiB,EAAE,IAAY;IAC1D,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE;QACnC,uEAAuE;QACvE,KAAK,EAAE,IAAI,GAAG,eAAe;QAC7B,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,+DAA+D;IAC/D,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC;AAUD;;;;;;;GAOG;AACI,KAAK,UAAU,aAAa,CACjC,EAAuB,EACvB,QAAgB,EAChB,MAAqB;IAErB,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QAChE,OAAO;IACT,CAAC;IACD,MAAM,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hub's section of a repository's `info/exclude` file. Every writer of the
|
|
3
|
+
* section edits the text through these pure functions so they agree.
|
|
4
|
+
* @module domain/install/git-exclude
|
|
5
|
+
*/
|
|
6
|
+
/** Header line written above the hub's `info/exclude` entries. */
|
|
7
|
+
export declare const GIT_EXCLUDE_SECTION_HEADER = "# Prompt Registry (local)";
|
|
8
|
+
/**
|
|
9
|
+
* Add entries below the hub's header in an `info/exclude` text, skipping ones already listed.
|
|
10
|
+
* @param text - Current contents; `''` when the file does not exist.
|
|
11
|
+
* @param entries - Root-relative paths.
|
|
12
|
+
* @returns The new text, or `undefined` when nothing changes.
|
|
13
|
+
*/
|
|
14
|
+
export declare const addExcludeEntries: (text: string, entries: readonly string[]) => string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Remove entries listed below the hub's header; the header and lines above it stay.
|
|
17
|
+
* @param text - Current contents.
|
|
18
|
+
* @param entries - Root-relative paths.
|
|
19
|
+
* @returns The new text, or `undefined` when nothing changes.
|
|
20
|
+
*/
|
|
21
|
+
export declare const removeExcludeEntries: (text: string, entries: readonly string[]) => string | undefined;
|
|
22
|
+
//# sourceMappingURL=git-exclude.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-exclude.d.ts","sourceRoot":"","sources":["../../../src/domain/install/git-exclude.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kEAAkE;AAClE,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AAStE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,EAAE,SAAS,SAAS,MAAM,EAAE,KAAG,MAAM,GAAG,SAgBrF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,EAAE,SAAS,SAAS,MAAM,EAAE,KAAG,MAAM,GAAG,SAQxF,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The hub's section of a repository's `info/exclude` file. Every writer of the
|
|
4
|
+
* section edits the text through these pure functions so they agree.
|
|
5
|
+
* @module domain/install/git-exclude
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.removeExcludeEntries = exports.addExcludeEntries = exports.GIT_EXCLUDE_SECTION_HEADER = void 0;
|
|
9
|
+
/** Header line written above the hub's `info/exclude` entries. */
|
|
10
|
+
exports.GIT_EXCLUDE_SECTION_HEADER = '# Prompt Registry (local)';
|
|
11
|
+
const isHeaderLine = (line) => line.trim() === exports.GIT_EXCLUDE_SECTION_HEADER;
|
|
12
|
+
const listsEntry = (line, entry) => {
|
|
13
|
+
const trimmed = line.trim();
|
|
14
|
+
return trimmed === entry || trimmed === `/${entry}`;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Add entries below the hub's header in an `info/exclude` text, skipping ones already listed.
|
|
18
|
+
* @param text - Current contents; `''` when the file does not exist.
|
|
19
|
+
* @param entries - Root-relative paths.
|
|
20
|
+
* @returns The new text, or `undefined` when nothing changes.
|
|
21
|
+
*/
|
|
22
|
+
const addExcludeEntries = (text, entries) => {
|
|
23
|
+
if (text === '') {
|
|
24
|
+
return [exports.GIT_EXCLUDE_SECTION_HEADER, ...new Set(entries)].join('\n');
|
|
25
|
+
}
|
|
26
|
+
const lines = text.split('\n');
|
|
27
|
+
const missing = [...new Set(entries)].filter((entry) => !lines.some((line) => listsEntry(line, entry)));
|
|
28
|
+
let headerIndex = lines.findIndex((line) => isHeaderLine(line));
|
|
29
|
+
if (missing.length === 0 && (entries.length > 0 || headerIndex !== -1)) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
if (headerIndex === -1) {
|
|
33
|
+
headerIndex = lines.length;
|
|
34
|
+
lines.push(exports.GIT_EXCLUDE_SECTION_HEADER);
|
|
35
|
+
}
|
|
36
|
+
lines.splice(headerIndex + 1, 0, ...missing.toReversed());
|
|
37
|
+
return lines.join('\n');
|
|
38
|
+
};
|
|
39
|
+
exports.addExcludeEntries = addExcludeEntries;
|
|
40
|
+
/**
|
|
41
|
+
* Remove entries listed below the hub's header; the header and lines above it stay.
|
|
42
|
+
* @param text - Current contents.
|
|
43
|
+
* @param entries - Root-relative paths.
|
|
44
|
+
* @returns The new text, or `undefined` when nothing changes.
|
|
45
|
+
*/
|
|
46
|
+
const removeExcludeEntries = (text, entries) => {
|
|
47
|
+
const lines = text.split('\n');
|
|
48
|
+
const headerIndex = lines.findIndex((line) => isHeaderLine(line));
|
|
49
|
+
if (headerIndex === -1) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
const kept = lines.filter((line, index) => index <= headerIndex || !entries.some((entry) => listsEntry(line, entry)));
|
|
53
|
+
return kept.length === lines.length ? undefined : kept.join('\n');
|
|
54
|
+
};
|
|
55
|
+
exports.removeExcludeEntries = removeExcludeEntries;
|
|
56
|
+
//# sourceMappingURL=git-exclude.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-exclude.js","sourceRoot":"","sources":["../../../src/domain/install/git-exclude.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,kEAAkE;AACrD,QAAA,0BAA0B,GAAG,2BAA2B,CAAC;AAEtE,MAAM,YAAY,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,kCAA0B,CAAC;AAE3F,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,KAAa,EAAW,EAAE;IAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,OAAO,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,IAAI,KAAK,EAAE,CAAC;AACtD,CAAC,CAAC;AAEF;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,OAA0B,EAAsB,EAAE;IAChG,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChB,OAAO,CAAC,kCAA0B,EAAE,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACxG,IAAI,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAChE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,WAAW,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;QACvB,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,kCAA0B,CAAC,CAAC;IACzC,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC;AAhBW,QAAA,iBAAiB,qBAgB5B;AAEF;;;;;GAKG;AACI,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,OAA0B,EAAsB,EAAE;IACnG,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAClE,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,WAAW,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACtH,OAAO,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC,CAAC;AARW,QAAA,oBAAoB,wBAQ/B"}
|
|
@@ -52,6 +52,8 @@ export interface Installable {
|
|
|
52
52
|
inlineBytes?: Uint8Array;
|
|
53
53
|
/** Optional canonical archive integrity (`sha256:<64 lowercase hexadecimal characters>`). */
|
|
54
54
|
integrity?: string;
|
|
55
|
+
/** Source repository namespace from published metadata, used to validate qualified bundle IDs. */
|
|
56
|
+
sourceRepoSlug?: string;
|
|
55
57
|
/** Optional pre-fetched manifest. */
|
|
56
58
|
manifest?: Record<string, unknown>;
|
|
57
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installable.d.ts","sourceRoot":"","sources":["../../../src/domain/install/installable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EACV,SAAS,EACV,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,UAmB7C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,SAAS,CAAC;IACf,qFAAqF;IACrF,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
|
|
1
|
+
{"version":3,"file":"installable.d.ts","sourceRoot":"","sources":["../../../src/domain/install/installable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EACV,SAAS,EACV,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,UAmB7C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,SAAS,CAAC;IACf,qFAAqF;IACrF,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kGAAkG;IAClG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout routes and the primitive kind they install (ADR-0009).
|
|
3
|
+
*
|
|
4
|
+
* A target layout maps bundle path prefixes (`kindRoutes` keys such as
|
|
5
|
+
* `prompts/` or `.kiro/steering/`) to output directories. The kind a route
|
|
6
|
+
* installs follows from its key alone, so path-routed writers, preflight
|
|
7
|
+
* and author-side validation share one derivation.
|
|
8
|
+
*
|
|
9
|
+
* Pure domain: no IO.
|
|
10
|
+
* @module domain/install/kind-route
|
|
11
|
+
*/
|
|
12
|
+
import { type PrimitiveKind } from '../primitive/types';
|
|
13
|
+
import type { KindRoutes } from './layout';
|
|
14
|
+
/**
|
|
15
|
+
* A layout route matched by a bundle path: the matched `kindRoutes` key,
|
|
16
|
+
* its output prefix and the rest of the path below the key.
|
|
17
|
+
*/
|
|
18
|
+
export interface KindRouteMatch {
|
|
19
|
+
prefix: string;
|
|
20
|
+
outPrefix: string;
|
|
21
|
+
tail: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Pick the longest layout route whose key prefixes a bundle path.
|
|
25
|
+
* @param bundlePath - Bundle-relative path.
|
|
26
|
+
* @param routes - Layout `kindRoutes`.
|
|
27
|
+
* @returns The matched route, or `null` when no key prefixes the path.
|
|
28
|
+
*/
|
|
29
|
+
export declare const matchKindRoute: (bundlePath: string, routes: KindRoutes) => KindRouteMatch | null;
|
|
30
|
+
/**
|
|
31
|
+
* Map a layout prefix back to the primitive kind it represents.
|
|
32
|
+
* Used to honor `target.allowedKinds`.
|
|
33
|
+
* @param prefix - Layout prefix (e.g., "prompts/").
|
|
34
|
+
* @returns Kind name without trailing slash.
|
|
35
|
+
*/
|
|
36
|
+
export declare const ROUTE_PREFIX_KINDS: Record<string, PrimitiveKind>;
|
|
37
|
+
/**
|
|
38
|
+
* The primitive kind a layout route installs: a single-segment key names
|
|
39
|
+
* its kind (`prompts/`, `chat-modes/`, `mcp/` …); a nested key is looked up
|
|
40
|
+
* in {@link ROUTE_PREFIX_KINDS}.
|
|
41
|
+
* @param prefix - Layout `kindRoutes` key, with or without trailing `/`.
|
|
42
|
+
* @returns The route's kind, or `null` for an unknown key.
|
|
43
|
+
*/
|
|
44
|
+
export declare const routeKindOf: (prefix: string) => PrimitiveKind | null;
|
|
45
|
+
/** A layout route whose kind differs from an item's declared kind. */
|
|
46
|
+
export interface KindRouteMismatch {
|
|
47
|
+
/** Kind the matched route installs. */
|
|
48
|
+
routeKind: PrimitiveKind;
|
|
49
|
+
/** Matched `kindRoutes` key (`chat-modes/` for a `chatmodes/…` path). */
|
|
50
|
+
routePrefix: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Compare an item's declared kind with the kind of the layout route its
|
|
54
|
+
* path matches. Path-routed targets install the file as the route's kind,
|
|
55
|
+
* so a difference means the item lands somewhere its author did not ask
|
|
56
|
+
* for.
|
|
57
|
+
* @param itemPath - Bundle-relative item path.
|
|
58
|
+
* @param declaredKind - Canonical declared kind (no alias normalisation).
|
|
59
|
+
* @param kindRoutes - Routes to match against.
|
|
60
|
+
* @returns The mismatch, or `null` when no route matches, the route's key
|
|
61
|
+
* names no kind, or the kinds agree.
|
|
62
|
+
*/
|
|
63
|
+
export declare const findKindRouteMismatch: (itemPath: string, declaredKind: PrimitiveKind, kindRoutes: KindRoutes) => KindRouteMismatch | null;
|
|
64
|
+
/**
|
|
65
|
+
* Warning text for a kind/route mismatch of one collection item.
|
|
66
|
+
* @param collectionRel - Repository-relative collection file.
|
|
67
|
+
* @param index - Item index in `items[]`.
|
|
68
|
+
* @param itemPath - Item path as declared.
|
|
69
|
+
* @param declaredKind - Item kind as the author wrote it.
|
|
70
|
+
* @param mismatch - The mismatch found by {@link findKindRouteMismatch}.
|
|
71
|
+
* @returns The warning message.
|
|
72
|
+
*/
|
|
73
|
+
export declare const formatKindRouteMismatch: (collectionRel: string, index: number, itemPath: string, declaredKind: string, mismatch: KindRouteMismatch) => string;
|
|
74
|
+
/**
|
|
75
|
+
* Whether a validation warning was built by {@link formatKindRouteMismatch}.
|
|
76
|
+
* @param message - Warning message.
|
|
77
|
+
* @returns True for a kind/route mismatch warning.
|
|
78
|
+
*/
|
|
79
|
+
export declare const isKindRouteMismatchWarning: (message: string) => boolean;
|
|
80
|
+
//# sourceMappingURL=kind-route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kind-route.d.ts","sourceRoot":"","sources":["../../../src/domain/install/kind-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,UAAU,EACX,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,MAAM,EAAE,QAAQ,UAAU,KAAG,cAAc,GAAG,IASxF,CAAC;AAgBF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAyB5D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,KAAG,aAAa,GAAG,IAK5D,CAAC;AAEF,sEAAsE;AACtE,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,SAAS,EAAE,aAAa,CAAC;IACzB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,EAChB,cAAc,aAAa,EAC3B,YAAY,UAAU,KACrB,iBAAiB,GAAG,IAUtB,CAAC;AAKF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,GAClC,eAAe,MAAM,EACrB,OAAO,MAAM,EACb,UAAU,MAAM,EAChB,cAAc,MAAM,EACpB,UAAU,iBAAiB,KAC1B,MAEuG,CAAC;AAE3G;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GAAI,SAAS,MAAM,KAAG,OACf,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isKindRouteMismatchWarning = exports.formatKindRouteMismatch = exports.findKindRouteMismatch = exports.routeKindOf = exports.ROUTE_PREFIX_KINDS = exports.matchKindRoute = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Layout routes and the primitive kind they install (ADR-0009).
|
|
6
|
+
*
|
|
7
|
+
* A target layout maps bundle path prefixes (`kindRoutes` keys such as
|
|
8
|
+
* `prompts/` or `.kiro/steering/`) to output directories. The kind a route
|
|
9
|
+
* installs follows from its key alone, so path-routed writers, preflight
|
|
10
|
+
* and author-side validation share one derivation.
|
|
11
|
+
*
|
|
12
|
+
* Pure domain: no IO.
|
|
13
|
+
* @module domain/install/kind-route
|
|
14
|
+
*/
|
|
15
|
+
const types_1 = require("../primitive/types");
|
|
16
|
+
/**
|
|
17
|
+
* Pick the longest layout route whose key prefixes a bundle path.
|
|
18
|
+
* @param bundlePath - Bundle-relative path.
|
|
19
|
+
* @param routes - Layout `kindRoutes`.
|
|
20
|
+
* @returns The matched route, or `null` when no key prefixes the path.
|
|
21
|
+
*/
|
|
22
|
+
const matchKindRoute = (bundlePath, routes) => {
|
|
23
|
+
const normalizedBundlePath = normalizeBundlePath(bundlePath);
|
|
24
|
+
const sorted = Object.entries(routes).toSorted((a, b) => b[0].length - a[0].length);
|
|
25
|
+
for (const [prefix, outPrefix] of sorted) {
|
|
26
|
+
if (normalizedBundlePath.startsWith(prefix)) {
|
|
27
|
+
return { prefix, outPrefix, tail: normalizedBundlePath.slice(prefix.length) };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
};
|
|
32
|
+
exports.matchKindRoute = matchKindRoute;
|
|
33
|
+
/**
|
|
34
|
+
* Normalize legacy bundle directory aliases before route matching.
|
|
35
|
+
*
|
|
36
|
+
* `chatmodes/` was the historical authoring path while the canonical
|
|
37
|
+
* vocabulary uses `chat-modes/`. Keep accepting both on disk without
|
|
38
|
+
* duplicating aliases in every target layout. The original path remains in
|
|
39
|
+
* lockfile/checksum data; only the routing view is normalized.
|
|
40
|
+
* @param bundlePath
|
|
41
|
+
*/
|
|
42
|
+
const normalizeBundlePath = (bundlePath) => bundlePath.startsWith('chatmodes/')
|
|
43
|
+
? `chat-modes/${bundlePath.slice('chatmodes/'.length)}`
|
|
44
|
+
: bundlePath;
|
|
45
|
+
/**
|
|
46
|
+
* Map a layout prefix back to the primitive kind it represents.
|
|
47
|
+
* Used to honor `target.allowedKinds`.
|
|
48
|
+
* @param prefix - Layout prefix (e.g., "prompts/").
|
|
49
|
+
* @returns Kind name without trailing slash.
|
|
50
|
+
*/
|
|
51
|
+
exports.ROUTE_PREFIX_KINDS = {
|
|
52
|
+
'.kiro/steering/': 'steering',
|
|
53
|
+
'.kiro/specs/': 'spec',
|
|
54
|
+
'.claude/commands/': 'command',
|
|
55
|
+
'.claude/output-styles/': 'output-style',
|
|
56
|
+
'.cursor/rules/': 'rule',
|
|
57
|
+
'.cursor/agents/': 'agent',
|
|
58
|
+
'.cursor/skills/': 'skill',
|
|
59
|
+
'.cursor/commands/': 'command',
|
|
60
|
+
'.opencode/tools/': 'tool',
|
|
61
|
+
'.opencode/commands/': 'command',
|
|
62
|
+
'.opencode/agents/': 'agent',
|
|
63
|
+
'.opencode/skills/': 'skill',
|
|
64
|
+
'.opencode/rules/': 'rule',
|
|
65
|
+
'.opencode/hooks/': 'hook',
|
|
66
|
+
'.opencode/plugins/': 'plugin',
|
|
67
|
+
'.devin/knowledge/': 'knowledge',
|
|
68
|
+
'.devin/playbooks/': 'playbook',
|
|
69
|
+
'.devin/powers/': 'power',
|
|
70
|
+
'.devin/prompts/': 'prompt',
|
|
71
|
+
'.devin/instructions/': 'instruction',
|
|
72
|
+
'.devin/agents/': 'agent',
|
|
73
|
+
'.devin/skills/': 'skill',
|
|
74
|
+
'.devin/hooks/': 'hook',
|
|
75
|
+
'.devin/plugins/': 'plugin'
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* The primitive kind a layout route installs: a single-segment key names
|
|
79
|
+
* its kind (`prompts/`, `chat-modes/`, `mcp/` …); a nested key is looked up
|
|
80
|
+
* in {@link ROUTE_PREFIX_KINDS}.
|
|
81
|
+
* @param prefix - Layout `kindRoutes` key, with or without trailing `/`.
|
|
82
|
+
* @returns The route's kind, or `null` for an unknown key.
|
|
83
|
+
*/
|
|
84
|
+
const routeKindOf = (prefix) => {
|
|
85
|
+
const normalizedPrefix = prefix.endsWith('/') ? prefix : `${prefix}/`;
|
|
86
|
+
return (0, types_1.normalizePrimitiveKind)(prefix.replace(/\/$/, ''))
|
|
87
|
+
?? exports.ROUTE_PREFIX_KINDS[normalizedPrefix]
|
|
88
|
+
?? null;
|
|
89
|
+
};
|
|
90
|
+
exports.routeKindOf = routeKindOf;
|
|
91
|
+
/**
|
|
92
|
+
* Compare an item's declared kind with the kind of the layout route its
|
|
93
|
+
* path matches. Path-routed targets install the file as the route's kind,
|
|
94
|
+
* so a difference means the item lands somewhere its author did not ask
|
|
95
|
+
* for.
|
|
96
|
+
* @param itemPath - Bundle-relative item path.
|
|
97
|
+
* @param declaredKind - Canonical declared kind (no alias normalisation).
|
|
98
|
+
* @param kindRoutes - Routes to match against.
|
|
99
|
+
* @returns The mismatch, or `null` when no route matches, the route's key
|
|
100
|
+
* names no kind, or the kinds agree.
|
|
101
|
+
*/
|
|
102
|
+
const findKindRouteMismatch = (itemPath, declaredKind, kindRoutes) => {
|
|
103
|
+
const match = (0, exports.matchKindRoute)(itemPath, kindRoutes);
|
|
104
|
+
if (match === null) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
const routeKind = (0, exports.routeKindOf)(match.prefix);
|
|
108
|
+
if (routeKind === null || routeKind === declaredKind) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
return { routeKind, routePrefix: match.prefix };
|
|
112
|
+
};
|
|
113
|
+
exports.findKindRouteMismatch = findKindRouteMismatch;
|
|
114
|
+
/** Fragment that identifies a {@link formatKindRouteMismatch} message. */
|
|
115
|
+
const KIND_ROUTE_MISMATCH_MARKER = 'of the install route "';
|
|
116
|
+
/**
|
|
117
|
+
* Warning text for a kind/route mismatch of one collection item.
|
|
118
|
+
* @param collectionRel - Repository-relative collection file.
|
|
119
|
+
* @param index - Item index in `items[]`.
|
|
120
|
+
* @param itemPath - Item path as declared.
|
|
121
|
+
* @param declaredKind - Item kind as the author wrote it.
|
|
122
|
+
* @param mismatch - The mismatch found by {@link findKindRouteMismatch}.
|
|
123
|
+
* @returns The warning message.
|
|
124
|
+
*/
|
|
125
|
+
const formatKindRouteMismatch = (collectionRel, index, itemPath, declaredKind, mismatch) => `${collectionRel}: items[${String(index)}] ${itemPath}: kind "${declaredKind}" differs from the kind `
|
|
126
|
+
+ `"${mismatch.routeKind}" ${KIND_ROUTE_MISMATCH_MARKER}${mismatch.routePrefix}" that this path matches`;
|
|
127
|
+
exports.formatKindRouteMismatch = formatKindRouteMismatch;
|
|
128
|
+
/**
|
|
129
|
+
* Whether a validation warning was built by {@link formatKindRouteMismatch}.
|
|
130
|
+
* @param message - Warning message.
|
|
131
|
+
* @returns True for a kind/route mismatch warning.
|
|
132
|
+
*/
|
|
133
|
+
const isKindRouteMismatchWarning = (message) => message.includes(KIND_ROUTE_MISMATCH_MARKER);
|
|
134
|
+
exports.isKindRouteMismatchWarning = isKindRouteMismatchWarning;
|
|
135
|
+
//# sourceMappingURL=kind-route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kind-route.js","sourceRoot":"","sources":["../../../src/domain/install/kind-route.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install record error codes and helpers. Record failures are plain
|
|
3
|
+
* `RegistryError`s in the `RECORD` namespace; the file and detail travel in
|
|
4
|
+
* `context`. Messages never include file contents.
|
|
5
|
+
* @module domain/install/record-errors
|
|
6
|
+
*/
|
|
7
|
+
import { RegistryError } from '../registry-error';
|
|
8
|
+
/** Stable `RECORD.*` codes. New codes may be added; none are renamed or removed. */
|
|
9
|
+
export declare const RECORD_ERROR_CODES: readonly ["RECORD.MALFORMED", "RECORD.NEWER_FORMAT", "RECORD.PATH_OUTSIDE_ROOT", "RECORD.LEGACY_UNMIGRATED", "RECORD.UNKNOWN_TOOL", "RECORD.WRITE_FAILED", "RECORD.CLI_MANAGED", "RECORD.ENTRY_NOT_FOUND", "RECORD.HUB_CONFLICT", "RECORD.MCP_CONFLICT", "RECORD.MCP_CONFIG_UNREADABLE"];
|
|
10
|
+
/** One of the {@link RECORD_ERROR_CODES}. */
|
|
11
|
+
export type RecordErrorCode = typeof RECORD_ERROR_CODES[number];
|
|
12
|
+
/** Details attached to a record error. */
|
|
13
|
+
export interface RecordErrorDetails {
|
|
14
|
+
/** Record or installed file the error is about, relative to the root where possible. */
|
|
15
|
+
file?: string;
|
|
16
|
+
/** Short reason, e.g. `forbidden key __proto__`; never file contents. */
|
|
17
|
+
detail?: string;
|
|
18
|
+
/** What the user can do next; defaults to a per-code hint. */
|
|
19
|
+
hint?: string;
|
|
20
|
+
/** Overrides the default per-code message. */
|
|
21
|
+
message?: string;
|
|
22
|
+
/** Underlying error, kept for logs (not serialized). */
|
|
23
|
+
cause?: unknown;
|
|
24
|
+
/** Extra context fields, merged after `file` and `detail`. */
|
|
25
|
+
context?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Build a `RegistryError` for a record failure.
|
|
29
|
+
* @param code - `RECORD.*` code.
|
|
30
|
+
* @param details - File, detail, hint and overrides.
|
|
31
|
+
*/
|
|
32
|
+
export declare const recordError: (code: RecordErrorCode, details?: RecordErrorDetails) => RegistryError;
|
|
33
|
+
/**
|
|
34
|
+
* Whether a value is a record error.
|
|
35
|
+
* @param value - Anything thrown.
|
|
36
|
+
* @param code - Code to match; any `RECORD.*` code when omitted.
|
|
37
|
+
*/
|
|
38
|
+
export declare const isRecordError: (value: unknown, code?: RecordErrorCode) => value is RegistryError;
|
|
39
|
+
/**
|
|
40
|
+
* The `file` and `detail` a record error carries in its context.
|
|
41
|
+
* @param error - A record error.
|
|
42
|
+
*/
|
|
43
|
+
export declare const recordErrorDetails: (error: RegistryError) => {
|
|
44
|
+
file?: string;
|
|
45
|
+
detail?: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* User text for a record error: the message plus ` File: <file>.` and ` Reason: <detail>.` when known.
|
|
49
|
+
* @param error - A record error.
|
|
50
|
+
* @param fileLabel - File to name instead of the one in the error's context.
|
|
51
|
+
*/
|
|
52
|
+
export declare const describeRecordError: (error: RegistryError, fileLabel?: string) => string;
|
|
53
|
+
//# sourceMappingURL=record-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-errors.d.ts","sourceRoot":"","sources":["../../../src/domain/install/record-errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,0RAYrB,CAAC;AAEX,6CAA6C;AAC7C,MAAM,MAAM,eAAe,GAAG,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAEhE,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AA8BD;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,eAAe,EAAE,UAAS,kBAAuB,KAAG,aAkBrF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,EAAE,OAAO,eAAe,KAAG,KAAK,IAAI,aAEgC,CAAC;AAEjH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,aAAa,KAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAGxF,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,aAAa,EAAE,YAAY,MAAM,KAAG,MAI9E,CAAC"}
|