@ai-primitives-hub/app 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/README.md +5 -1
- package/dist/collection/affected-collections.d.ts +11 -0
- package/dist/collection/affected-collections.d.ts.map +1 -0
- package/dist/collection/affected-collections.js +90 -0
- package/dist/collection/affected-collections.js.map +1 -0
- package/dist/collection/create-plugin.d.ts +35 -0
- package/dist/collection/create-plugin.d.ts.map +1 -0
- package/dist/collection/create-plugin.js +118 -0
- package/dist/collection/create-plugin.js.map +1 -0
- package/dist/collection/index.d.ts +4 -2
- package/dist/collection/index.d.ts.map +1 -1
- package/dist/collection/index.js +8 -4
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/kind-route-warning.d.ts +13 -0
- package/dist/collection/kind-route-warning.d.ts.map +1 -0
- package/dist/collection/kind-route-warning.js +40 -0
- package/dist/collection/kind-route-warning.js.map +1 -0
- package/dist/collection/plugin-item-issues.d.ts +36 -0
- package/dist/collection/plugin-item-issues.d.ts.map +1 -0
- package/dist/collection/plugin-item-issues.js +31 -0
- package/dist/collection/plugin-item-issues.js.map +1 -0
- package/dist/collection/read-collection.d.ts +1 -1
- package/dist/collection/read-collection.d.ts.map +1 -1
- package/dist/collection/read-collection.js +14 -15
- package/dist/collection/read-collection.js.map +1 -1
- package/dist/collection-editor/collection-contribution-workflow.d.ts +96 -0
- package/dist/collection-editor/collection-contribution-workflow.d.ts.map +1 -0
- package/dist/collection-editor/collection-contribution-workflow.js +479 -0
- package/dist/collection-editor/collection-contribution-workflow.js.map +1 -0
- package/dist/collection-editor/collection-editor-service.d.ts +232 -0
- package/dist/collection-editor/collection-editor-service.d.ts.map +1 -0
- package/dist/collection-editor/collection-editor-service.js +868 -0
- package/dist/collection-editor/collection-editor-service.js.map +1 -0
- package/dist/collection-editor/index.d.ts +7 -0
- package/dist/collection-editor/index.d.ts.map +1 -0
- package/dist/collection-editor/index.js +12 -0
- package/dist/collection-editor/index.js.map +1 -0
- package/dist/diagnostics/find-ancestor-file.d.ts +13 -0
- package/dist/diagnostics/find-ancestor-file.d.ts.map +1 -0
- package/dist/diagnostics/find-ancestor-file.js +85 -0
- package/dist/diagnostics/find-ancestor-file.js.map +1 -0
- package/dist/diagnostics/index.d.ts +10 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +26 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/diagnostics/run-primitive-diagnostics.d.ts +43 -0
- package/dist/diagnostics/run-primitive-diagnostics.d.ts.map +1 -0
- package/dist/diagnostics/run-primitive-diagnostics.js +413 -0
- package/dist/diagnostics/run-primitive-diagnostics.js.map +1 -0
- package/dist/diagnostics/sandbox-snapshot.d.ts +20 -0
- package/dist/diagnostics/sandbox-snapshot.d.ts.map +1 -0
- package/dist/diagnostics/sandbox-snapshot.js +117 -0
- package/dist/diagnostics/sandbox-snapshot.js.map +1 -0
- package/dist/governance/generate-catalogue.d.ts +16 -0
- package/dist/governance/generate-catalogue.d.ts.map +1 -0
- package/dist/governance/generate-catalogue.js +67 -0
- package/dist/governance/generate-catalogue.js.map +1 -0
- package/dist/governance/hub-scoped-governance.d.ts +37 -0
- package/dist/governance/hub-scoped-governance.d.ts.map +1 -0
- package/dist/governance/hub-scoped-governance.js +110 -0
- package/dist/governance/hub-scoped-governance.js.map +1 -0
- package/dist/governance/index.d.ts +10 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +26 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/load-config.d.ts +45 -0
- package/dist/governance/load-config.d.ts.map +1 -0
- package/dist/governance/load-config.js +137 -0
- package/dist/governance/load-config.js.map +1 -0
- package/dist/governance/pr-scope.d.ts +23 -0
- package/dist/governance/pr-scope.d.ts.map +1 -0
- package/dist/governance/pr-scope.js +22 -0
- package/dist/governance/pr-scope.js.map +1 -0
- package/dist/governance/report.d.ts +23 -0
- package/dist/governance/report.d.ts.map +1 -0
- package/dist/governance/report.js +177 -0
- package/dist/governance/report.js.map +1 -0
- package/dist/governance/run-governance.d.ts +22 -0
- package/dist/governance/run-governance.d.ts.map +1 -0
- package/dist/governance/run-governance.js +78 -0
- package/dist/governance/run-governance.js.map +1 -0
- package/dist/governance/source-checks.d.ts +29 -0
- package/dist/governance/source-checks.d.ts.map +1 -0
- package/dist/governance/source-checks.js +80 -0
- package/dist/governance/source-checks.js.map +1 -0
- package/dist/governance/validate-collection-governance.d.ts +46 -0
- package/dist/governance/validate-collection-governance.d.ts.map +1 -0
- package/dist/governance/validate-collection-governance.js +291 -0
- package/dist/governance/validate-collection-governance.js.map +1 -0
- package/dist/hub-editor/hub-config-editor-service.d.ts +94 -0
- package/dist/hub-editor/hub-config-editor-service.d.ts.map +1 -0
- package/dist/hub-editor/hub-config-editor-service.js +289 -0
- package/dist/hub-editor/hub-config-editor-service.js.map +1 -0
- package/dist/hub-editor/hub-contribution-workflow.d.ts +99 -0
- package/dist/hub-editor/hub-contribution-workflow.d.ts.map +1 -0
- package/dist/hub-editor/hub-contribution-workflow.js +385 -0
- package/dist/hub-editor/hub-contribution-workflow.js.map +1 -0
- package/dist/hub-editor/index.d.ts +7 -0
- package/dist/hub-editor/index.d.ts.map +1 -0
- package/dist/hub-editor/index.js +23 -0
- package/dist/hub-editor/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/install/index.d.ts +2 -0
- package/dist/install/index.d.ts.map +1 -1
- package/dist/install/index.js +3 -1
- package/dist/install/index.js.map +1 -1
- package/dist/install/partial-target-write.d.ts +63 -0
- package/dist/install/partial-target-write.d.ts.map +1 -0
- package/dist/install/partial-target-write.js +128 -0
- package/dist/install/partial-target-write.js.map +1 -0
- package/dist/install/pipeline.d.ts +2 -1
- package/dist/install/pipeline.d.ts.map +1 -1
- package/dist/install/pipeline.js +4 -3
- package/dist/install/pipeline.js.map +1 -1
- package/dist/install/target-write.d.ts +10 -0
- package/dist/install/target-write.d.ts.map +1 -1
- package/dist/install/target-write.js +3 -2
- package/dist/install/target-write.js.map +1 -1
- package/dist/install/uninstall-pipeline.d.ts +11 -10
- package/dist/install/uninstall-pipeline.d.ts.map +1 -1
- package/dist/install/uninstall-pipeline.js +10 -11
- package/dist/install/uninstall-pipeline.js.map +1 -1
- package/dist/records/atomic-write.d.ts +11 -0
- package/dist/records/atomic-write.d.ts.map +1 -0
- package/dist/records/atomic-write.js +66 -0
- package/dist/records/atomic-write.js.map +1 -0
- package/dist/records/confine-path.d.ts +35 -0
- package/dist/records/confine-path.d.ts.map +1 -0
- package/dist/records/confine-path.js +140 -0
- package/dist/records/confine-path.js.map +1 -0
- package/dist/records/git-root.d.ts +66 -0
- package/dist/records/git-root.d.ts.map +1 -0
- package/dist/records/git-root.js +208 -0
- package/dist/records/git-root.js.map +1 -0
- package/dist/records/index.d.ts +30 -0
- package/dist/records/index.d.ts.map +1 -0
- package/dist/records/index.js +46 -0
- package/dist/records/index.js.map +1 -0
- package/dist/records/install-record-service.d.ts +496 -0
- package/dist/records/install-record-service.d.ts.map +1 -0
- package/dist/records/install-record-service.js +1365 -0
- package/dist/records/install-record-service.js.map +1 -0
- package/dist/records/install-record-services.d.ts +29 -0
- package/dist/records/install-record-services.d.ts.map +1 -0
- package/dist/records/install-record-services.js +17 -0
- package/dist/records/install-record-services.js.map +1 -0
- package/dist/records/legacy-shapes.d.ts +18 -0
- package/dist/records/legacy-shapes.d.ts.map +1 -0
- package/dist/records/legacy-shapes.js +30 -0
- package/dist/records/legacy-shapes.js.map +1 -0
- package/dist/records/map-tool-to-target.d.ts +33 -0
- package/dist/records/map-tool-to-target.d.ts.map +1 -0
- package/dist/records/map-tool-to-target.js +98 -0
- package/dist/records/map-tool-to-target.js.map +1 -0
- package/dist/records/mcp-servers.d.ts +116 -0
- package/dist/records/mcp-servers.d.ts.map +1 -0
- package/dist/records/mcp-servers.js +268 -0
- package/dist/records/mcp-servers.js.map +1 -0
- package/dist/records/modified-files.d.ts +32 -0
- package/dist/records/modified-files.d.ts.map +1 -0
- package/dist/records/modified-files.js +146 -0
- package/dist/records/modified-files.js.map +1 -0
- package/dist/records/plan-record-entries.d.ts +76 -0
- package/dist/records/plan-record-entries.d.ts.map +1 -0
- package/dist/records/plan-record-entries.js +84 -0
- package/dist/records/plan-record-entries.js.map +1 -0
- package/dist/records/read-record-text.d.ts +15 -0
- package/dist/records/read-record-text.d.ts.map +1 -0
- package/dist/records/read-record-text.js +36 -0
- package/dist/records/read-record-text.js.map +1 -0
- package/dist/records/record-entry.d.ts +31 -0
- package/dist/records/record-entry.d.ts.map +1 -0
- package/dist/records/record-entry.js +81 -0
- package/dist/records/record-entry.js.map +1 -0
- package/dist/records/record-file-shape.d.ts +90 -0
- package/dist/records/record-file-shape.d.ts.map +1 -0
- package/dist/records/record-file-shape.js +288 -0
- package/dist/records/record-file-shape.js.map +1 -0
- package/dist/records/record-hub.d.ts +42 -0
- package/dist/records/record-hub.d.ts.map +1 -0
- package/dist/records/record-hub.js +85 -0
- package/dist/records/record-hub.js.map +1 -0
- package/dist/records/record-identity.d.ts +14 -0
- package/dist/records/record-identity.d.ts.map +1 -0
- package/dist/records/record-identity.js +41 -0
- package/dist/records/record-identity.js.map +1 -0
- package/dist/records/record-migration.d.ts +118 -0
- package/dist/records/record-migration.d.ts.map +1 -0
- package/dist/records/record-migration.js +454 -0
- package/dist/records/record-migration.js.map +1 -0
- package/dist/records/record-store.d.ts +123 -0
- package/dist/records/record-store.d.ts.map +1 -0
- package/dist/records/record-store.js +291 -0
- package/dist/records/record-store.js.map +1 -0
- package/dist/records/resolve-record-source.d.ts +64 -0
- package/dist/records/resolve-record-source.d.ts.map +1 -0
- package/dist/records/resolve-record-source.js +160 -0
- package/dist/records/resolve-record-source.js.map +1 -0
- package/dist/records/sanitize-source.d.ts +18 -0
- package/dist/records/sanitize-source.d.ts.map +1 -0
- package/dist/records/sanitize-source.js +90 -0
- package/dist/records/sanitize-source.js.map +1 -0
- package/dist/records/select-record.d.ts +54 -0
- package/dist/records/select-record.d.ts.map +1 -0
- package/dist/records/select-record.js +180 -0
- package/dist/records/select-record.js.map +1 -0
- package/dist/records/serialize-record.d.ts +20 -0
- package/dist/records/serialize-record.d.ts.map +1 -0
- package/dist/records/serialize-record.js +100 -0
- package/dist/records/serialize-record.js.map +1 -0
- package/dist/records/source-fields.d.ts +21 -0
- package/dist/records/source-fields.d.ts.map +1 -0
- package/dist/records/source-fields.js +28 -0
- package/dist/records/source-fields.js.map +1 -0
- package/dist/records/to-record-source.d.ts +23 -0
- package/dist/records/to-record-source.d.ts.map +1 -0
- package/dist/records/to-record-source.js +39 -0
- package/dist/records/to-record-source.js.map +1 -0
- package/dist/records/user-home.d.ts +16 -0
- package/dist/records/user-home.d.ts.map +1 -0
- package/dist/records/user-home.js +84 -0
- package/dist/records/user-home.js.map +1 -0
- package/dist/records/writer-group.d.ts +7 -0
- package/dist/records/writer-group.d.ts.map +1 -0
- package/dist/records/writer-group.js +31 -0
- package/dist/records/writer-group.js.map +1 -0
- package/dist/registry/activate-registry-profile.d.ts.map +1 -1
- package/dist/registry/activate-registry-profile.js +4 -1
- package/dist/registry/activate-registry-profile.js.map +1 -1
- package/dist/registry/batch-install-profile.d.ts +76 -0
- package/dist/registry/batch-install-profile.d.ts.map +1 -0
- package/dist/registry/batch-install-profile.js +67 -0
- package/dist/registry/batch-install-profile.js.map +1 -0
- package/dist/registry/create-source-adapter.d.ts +16 -1
- package/dist/registry/create-source-adapter.d.ts.map +1 -1
- package/dist/registry/create-source-adapter.js +76 -3
- package/dist/registry/create-source-adapter.js.map +1 -1
- package/dist/registry/hub-manager.d.ts +41 -0
- package/dist/registry/hub-manager.d.ts.map +1 -1
- package/dist/registry/hub-manager.js +82 -4
- package/dist/registry/hub-manager.js.map +1 -1
- package/dist/registry/index.d.ts +1 -0
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -0
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/install-registry-bundle.js +4 -3
- package/dist/registry/install-registry-bundle.js.map +1 -1
- package/dist/registry/list-installed-bundles.d.ts +2 -3
- package/dist/registry/list-installed-bundles.d.ts.map +1 -1
- package/dist/registry/list-installed-bundles.js.map +1 -1
- package/dist/registry/load-hub-sources.d.ts +8 -0
- package/dist/registry/load-hub-sources.d.ts.map +1 -1
- package/dist/registry/load-hub-sources.js +70 -3
- package/dist/registry/load-hub-sources.js.map +1 -1
- package/dist/registry/profile-lifecycle.d.ts +7 -2
- package/dist/registry/profile-lifecycle.d.ts.map +1 -1
- package/dist/registry/profile-lifecycle.js +82 -11
- package/dist/registry/profile-lifecycle.js.map +1 -1
- package/dist/registry/uninstall-installed-bundle.d.ts +2 -3
- package/dist/registry/uninstall-installed-bundle.d.ts.map +1 -1
- package/dist/registry/uninstall-installed-bundle.js.map +1 -1
- package/dist/registry/update-registry-bundle.d.ts +2 -2
- package/dist/registry/update-registry-bundle.js +2 -2
- package/dist/registry/update-registry-bundle.js.map +1 -1
- package/dist/registry/validate-hub-config-file.d.ts +14 -1
- package/dist/registry/validate-hub-config-file.d.ts.map +1 -1
- package/dist/registry/validate-hub-config-file.js +81 -44
- package/dist/registry/validate-hub-config-file.js.map +1 -1
- package/dist/release/plan-bundle-release.d.ts +6 -12
- package/dist/release/plan-bundle-release.d.ts.map +1 -1
- package/dist/release/plan-bundle-release.js +178 -7
- package/dist/release/plan-bundle-release.js.map +1 -1
- package/dist/replicate/replicate.d.ts +5 -2
- package/dist/replicate/replicate.d.ts.map +1 -1
- package/dist/replicate/replicate.js +121 -17
- package/dist/replicate/replicate.js.map +1 -1
- package/dist/security/index.d.ts +4 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +22 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/rating/bundle-discovery.d.ts +19 -0
- package/dist/security/rating/bundle-discovery.d.ts.map +1 -0
- package/dist/security/rating/bundle-discovery.js +244 -0
- package/dist/security/rating/bundle-discovery.js.map +1 -0
- package/dist/security/rating/index.d.ts +5 -0
- package/dist/security/rating/index.d.ts.map +1 -0
- package/dist/security/rating/index.js +21 -0
- package/dist/security/rating/index.js.map +1 -0
- package/dist/security/rating/security-rating-markdown.d.ts +17 -0
- package/dist/security/rating/security-rating-markdown.d.ts.map +1 -0
- package/dist/security/rating/security-rating-markdown.js +131 -0
- package/dist/security/rating/security-rating-markdown.js.map +1 -0
- package/dist/security/rating/security-rating-scan.d.ts +23 -0
- package/dist/security/rating/security-rating-scan.d.ts.map +1 -0
- package/dist/security/rating/security-rating-scan.js +40 -0
- package/dist/security/rating/security-rating-scan.js.map +1 -0
- package/dist/security/rating/security-rating-templates.d.ts +40 -0
- package/dist/security/rating/security-rating-templates.d.ts.map +1 -0
- package/dist/security/rating/security-rating-templates.js +83 -0
- package/dist/security/rating/security-rating-templates.js.map +1 -0
- package/dist/security/rating/security-rating.d.ts +32 -0
- package/dist/security/rating/security-rating.d.ts.map +1 -0
- package/dist/security/rating/security-rating.js +94 -0
- package/dist/security/rating/security-rating.js.map +1 -0
- package/dist/security/security-scan-use-case.d.ts +101 -0
- package/dist/security/security-scan-use-case.d.ts.map +1 -0
- package/dist/security/security-scan-use-case.js +185 -0
- package/dist/security/security-scan-use-case.js.map +1 -0
- package/dist/stores/json-lockfile-store.d.ts.map +1 -1
- package/dist/stores/json-lockfile-store.js +6 -32
- package/dist/stores/json-lockfile-store.js.map +1 -1
- package/dist/transform/transformer-registry.d.ts.map +1 -1
- package/dist/transform/transformer-registry.js +3 -0
- package/dist/transform/transformer-registry.js.map +1 -1
- package/dist/transform/transformers/windsurf-transformer.d.ts +5 -0
- package/dist/transform/transformers/windsurf-transformer.d.ts.map +1 -1
- package/dist/transform/transformers/windsurf-transformer.js.map +1 -1
- package/dist/writers/file-tree-writer.d.ts +14 -1
- package/dist/writers/file-tree-writer.d.ts.map +1 -1
- package/dist/writers/file-tree-writer.js +23 -71
- package/dist/writers/file-tree-writer.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitize-source.js","sourceRoot":"","sources":["../../src/records/sanitize-source.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,kDAGiC;AACjC,mDAGyB;AAEzB,yDAAyD;AACzD,MAAM,mBAAmB,GAAG,+EAA+E,CAAC;AAE5G,2GAA2G;AAC3G,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAE7C,+DAA+D;AAC/D,MAAM,2BAA2B,GAAG,2BAA2B,CAAC;AAEhE,+DAA+D;AAC/D,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAErD,gEAAgE;AAChE,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,MAAM,mBAAmB,GAAG,CAAC,GAAW,EAAsB,EAAE;IAC9D,IAAI,MAAW,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,MAAM,CAAC,QAAQ,KAAK,EAAE,IAAI,MAAM,CAAC,QAAQ,KAAK,EAAE,EAAE,CAAC;QACrD,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;QACrB,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;QACrB,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QACvD,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACjC,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC;IACD,gEAAgE;IAChE,OAAO,OAAO,CAAC,CA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AG,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;QACjC,OAAO,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;IAC5D,CAAC;IACD,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC,CAAC;AAdW,QAAA,iBAAiB,qBAc5B;AAEF;;;;GAIG;AACI,MAAM,cAAc,GAAG,CAAC,MAAyC,EAAgB,EAAE;IACxF,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC7B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,EAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;QACrF,MAAM,IAAA,kBAAW,EAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,iCAAiC,EAAE,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,IAAA,gCAAgB,EAAC,MAAM,EAAE,IAAI,EAAE,IAAA,yBAAiB,EAAC,GAAG,CAAC,EAAE,6BAAa,CAAC,CAAC;AAC/E,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type InstallationScope, type RecordFs, type RecordLevel, type RecordLocation } from '@ai-primitives-hub/core';
|
|
2
|
+
import type { RecordStore } from './record-store';
|
|
3
|
+
/** Why a {@link RecordSelection} picked its level. */
|
|
4
|
+
export type RecordSelectionReason = 'lockfile-flag' | 'explicit-scope' | 'target-scope' | 'repository-record-found' | 'user-fallback';
|
|
5
|
+
/** The record file(s) a command acts on. Never stored. */
|
|
6
|
+
export interface RecordSelection {
|
|
7
|
+
level: RecordLevel;
|
|
8
|
+
/** The git root or `--lockfile` folder, the home folder, or the user lockfile's folder. */
|
|
9
|
+
root: string;
|
|
10
|
+
/** Loaded record files, committed first; empty at user level and for an old `--lockfile`. */
|
|
11
|
+
locations: RecordLocation[];
|
|
12
|
+
/** Old-format lockfile for the same level, read with the old code. */
|
|
13
|
+
oldLockfile?: string;
|
|
14
|
+
/** `true` when no level was given and it was inferred. */
|
|
15
|
+
inferred: boolean;
|
|
16
|
+
reason: RecordSelectionReason;
|
|
17
|
+
}
|
|
18
|
+
/** Inputs of {@link selectRecord}. */
|
|
19
|
+
export interface SelectRecordOptions {
|
|
20
|
+
store: RecordStore;
|
|
21
|
+
fs: RecordFs;
|
|
22
|
+
/** Current folder; where the walk starts when no target root is given. */
|
|
23
|
+
cwd: string;
|
|
24
|
+
/** What the command was given; nothing for `status` and a bare `install`. */
|
|
25
|
+
given?: {
|
|
26
|
+
/** `--lockfile <path>`, absolute or relative to `cwd`. */
|
|
27
|
+
lockfile?: string;
|
|
28
|
+
scope?: InstallationScope;
|
|
29
|
+
target?: {
|
|
30
|
+
scope: InstallationScope;
|
|
31
|
+
rootPath?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** Upward walk for an old `prompt-registry.*` file; a result equal to the user lockfile is ignored. */
|
|
35
|
+
findOldLockfile: (start: string) => Promise<string | null>;
|
|
36
|
+
/** Absolute path of the user lockfile. */
|
|
37
|
+
userLockfile: string;
|
|
38
|
+
/** The shared user record; with {@link home}, the user level selects it. */
|
|
39
|
+
userRecord?: string;
|
|
40
|
+
/** Home folder, the user level's root. */
|
|
41
|
+
home?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Record level for an install scope; user and workspace scopes are both `user`.
|
|
45
|
+
* @param scope - Install scope.
|
|
46
|
+
*/
|
|
47
|
+
export declare const recordLevelForScope: (scope: InstallationScope) => RecordLevel;
|
|
48
|
+
/**
|
|
49
|
+
* Choose the record file(s) a command acts on.
|
|
50
|
+
* @param options - Selection inputs.
|
|
51
|
+
* @throws {RegistryError} Any `RECORD.*` error from loading a selected file.
|
|
52
|
+
*/
|
|
53
|
+
export declare const selectRecord: (options: SelectRecordOptions) => Promise<RecordSelection>;
|
|
54
|
+
//# sourceMappingURL=select-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-record.d.ts","sourceRoot":"","sources":["../../src/records/select-record.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB,sDAAsD;AACtD,MAAM,MAAM,qBAAqB,GAC7B,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,yBAAyB,GACzB,eAAe,CAAC;AAEpB,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,WAAW,CAAC;IACnB,2FAA2F;IAC3F,IAAI,EAAE,MAAM,CAAC;IACb,6FAA6F;IAC7F,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAED,sCAAsC;AACtC,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,WAAW,CAAC;IACnB,EAAE,EAAE,QAAQ,CAAC;IACb,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAC;IACZ,6EAA6E;IAC7E,KAAK,CAAC,EAAE;QACN,0DAA0D;QAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,iBAAiB,CAAC;QAC1B,MAAM,CAAC,EAAE;YAAE,KAAK,EAAE,iBAAiB,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC1D,CAAC;IACF,uGAAuG;IACvG,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3D,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,iBAAiB,KAAG,WACf,CAAC;AAgHjD;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAU,SAAS,mBAAmB,KAAG,OAAO,CAAC,eAAe,CAuBxF,CAAC"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.selectRecord = exports.recordLevelForScope = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* Record selection: which install record file(s) a command acts on. The level
|
|
39
|
+
* comes from `--lockfile`, `--scope` or the target; without one, a record or old
|
|
40
|
+
* lockfile at the git root picks the repository level. Selected files are
|
|
41
|
+
* loaded, so a bad record stops the command before anything is written. At user
|
|
42
|
+
* level, the shared user record (rooted at home) is used when it is passed in,
|
|
43
|
+
* with the old user lockfile as its old store until it is imported.
|
|
44
|
+
* @module records/select-record
|
|
45
|
+
*/
|
|
46
|
+
const path = __importStar(require("node:path"));
|
|
47
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
48
|
+
const git_root_1 = require("./git-root");
|
|
49
|
+
/**
|
|
50
|
+
* Record level for an install scope; user and workspace scopes are both `user`.
|
|
51
|
+
* @param scope - Install scope.
|
|
52
|
+
*/
|
|
53
|
+
const recordLevelForScope = (scope) => scope === 'repository' ? 'repository' : 'user';
|
|
54
|
+
exports.recordLevelForScope = recordLevelForScope;
|
|
55
|
+
const userSelection = (userLockfile, reason, inferred) => ({
|
|
56
|
+
level: 'user',
|
|
57
|
+
root: path.dirname(userLockfile),
|
|
58
|
+
locations: [],
|
|
59
|
+
oldLockfile: userLockfile,
|
|
60
|
+
inferred,
|
|
61
|
+
reason
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* User selection on the shared user record, with the old user lockfile as old
|
|
65
|
+
* store. Without the user record and home, or at workspace scope, only the old lockfile.
|
|
66
|
+
* @param options - Selection inputs.
|
|
67
|
+
* @param reason - Why the user level was picked.
|
|
68
|
+
* @param inferred - Whether the level was inferred.
|
|
69
|
+
* @param scope - The given or target scope, when there is one.
|
|
70
|
+
*/
|
|
71
|
+
const sharedUserSelection = async (options, reason, inferred, scope) => {
|
|
72
|
+
if (options.userRecord === undefined || options.home === undefined || scope === 'workspace') {
|
|
73
|
+
return userSelection(options.userLockfile, reason, inferred);
|
|
74
|
+
}
|
|
75
|
+
const location = options.store.resolveUser({ home: options.home, path: options.userRecord });
|
|
76
|
+
const { record } = await options.store.load(location);
|
|
77
|
+
// Once the old user lockfile was imported, the user level no longer reads it.
|
|
78
|
+
const oldExists = record[core_1.IMPORTED_USER_LOCKFILE_FIELD] === undefined && await options.fs.exists(options.userLockfile);
|
|
79
|
+
return {
|
|
80
|
+
level: 'user',
|
|
81
|
+
root: location.root,
|
|
82
|
+
locations: [location],
|
|
83
|
+
...(oldExists ? { oldLockfile: options.userLockfile } : {}),
|
|
84
|
+
inferred,
|
|
85
|
+
reason
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* The old repository file found from `start`, accepted only at its git root;
|
|
90
|
+
* the user lockfile the walk may fall back to is ignored.
|
|
91
|
+
* @param options - Selection inputs.
|
|
92
|
+
* @param start - Walk start.
|
|
93
|
+
*/
|
|
94
|
+
const findOldRepositoryFile = async (options, start) => {
|
|
95
|
+
const found = await options.findOldLockfile(start);
|
|
96
|
+
if (found === null || path.resolve(found) === path.resolve(options.userLockfile)) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
const root = await (0, git_root_1.resolveRepositoryRoot)(options.fs, start);
|
|
100
|
+
return path.dirname(path.resolve(found)) === root ? found : undefined;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Repository selection at the git root of `start`, with both record files loaded.
|
|
104
|
+
* @param options - Selection inputs.
|
|
105
|
+
* @param start - Target root or current folder.
|
|
106
|
+
* @param reason - Why the repository level was picked.
|
|
107
|
+
* @param oldLockfile - Old file already found, if any.
|
|
108
|
+
*/
|
|
109
|
+
const repositorySelection = async (options, start, reason, oldLockfile) => {
|
|
110
|
+
const locations = await options.store.resolveRepository({ start });
|
|
111
|
+
for (const location of locations) {
|
|
112
|
+
await options.store.load(location);
|
|
113
|
+
}
|
|
114
|
+
const old = oldLockfile ?? await findOldRepositoryFile(options, start);
|
|
115
|
+
return {
|
|
116
|
+
level: 'repository',
|
|
117
|
+
root: locations[0].root,
|
|
118
|
+
locations,
|
|
119
|
+
...(old === undefined ? {} : { oldLockfile: old }),
|
|
120
|
+
inferred: reason === 'repository-record-found',
|
|
121
|
+
reason
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Selection for `--lockfile <path>`; the file decides the level and format.
|
|
126
|
+
* @param options - Selection inputs.
|
|
127
|
+
* @param lockfile - The flag's value.
|
|
128
|
+
*/
|
|
129
|
+
const lockfileSelection = async (options, lockfile) => {
|
|
130
|
+
const absolute = path.resolve(options.cwd, lockfile);
|
|
131
|
+
if (absolute === path.resolve(options.userLockfile)) {
|
|
132
|
+
return userSelection(options.userLockfile, 'lockfile-flag', false);
|
|
133
|
+
}
|
|
134
|
+
if (options.userRecord !== undefined && absolute === path.resolve(options.userRecord)) {
|
|
135
|
+
return sharedUserSelection(options, 'lockfile-flag', false);
|
|
136
|
+
}
|
|
137
|
+
const root = path.dirname(absolute);
|
|
138
|
+
const name = path.basename(absolute);
|
|
139
|
+
// The record file name gives the commit mode.
|
|
140
|
+
const location = (0, core_1.repositoryLocations)(root).find((candidate) => path.basename(candidate.path) === name);
|
|
141
|
+
if (location === undefined) {
|
|
142
|
+
return { level: 'repository', root, locations: [], oldLockfile: absolute, inferred: false, reason: 'lockfile-flag' };
|
|
143
|
+
}
|
|
144
|
+
// Both files are checked, as an install of the selected file also loads its counterpart.
|
|
145
|
+
for (const candidate of (0, core_1.repositoryLocations)(root)) {
|
|
146
|
+
await options.store.load(candidate);
|
|
147
|
+
}
|
|
148
|
+
return { level: 'repository', root, locations: [location], inferred: false, reason: 'lockfile-flag' };
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Choose the record file(s) a command acts on.
|
|
152
|
+
* @param options - Selection inputs.
|
|
153
|
+
* @throws {RegistryError} Any `RECORD.*` error from loading a selected file.
|
|
154
|
+
*/
|
|
155
|
+
const selectRecord = async (options) => {
|
|
156
|
+
const { given, cwd } = options;
|
|
157
|
+
if (given?.lockfile !== undefined && given.lockfile !== '') {
|
|
158
|
+
return lockfileSelection(options, given.lockfile);
|
|
159
|
+
}
|
|
160
|
+
const start = path.resolve(cwd, given?.target?.rootPath ?? cwd);
|
|
161
|
+
if (given?.scope !== undefined) {
|
|
162
|
+
return (0, exports.recordLevelForScope)(given.scope) === 'repository'
|
|
163
|
+
? repositorySelection(options, start, 'explicit-scope')
|
|
164
|
+
: sharedUserSelection(options, 'explicit-scope', false, given.scope);
|
|
165
|
+
}
|
|
166
|
+
if (given?.target !== undefined) {
|
|
167
|
+
return (0, exports.recordLevelForScope)(given.target.scope) === 'repository'
|
|
168
|
+
? repositorySelection(options, start, 'target-scope')
|
|
169
|
+
: sharedUserSelection(options, 'target-scope', false, given.target.scope);
|
|
170
|
+
}
|
|
171
|
+
const [committed, localOnly] = await options.store.resolveRepository({ start: path.resolve(cwd) });
|
|
172
|
+
const hasNewRecord = (await options.fs.exists(committed.path)) || (await options.fs.exists(localOnly.path));
|
|
173
|
+
const old = hasNewRecord ? undefined : await findOldRepositoryFile(options, path.resolve(cwd));
|
|
174
|
+
if (hasNewRecord || old !== undefined) {
|
|
175
|
+
return repositorySelection(options, path.resolve(cwd), 'repository-record-found', old);
|
|
176
|
+
}
|
|
177
|
+
return sharedUserSelection(options, 'user-fallback', true);
|
|
178
|
+
};
|
|
179
|
+
exports.selectRecord = selectRecord;
|
|
180
|
+
//# sourceMappingURL=select-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-record.js","sourceRoot":"","sources":["../../src/records/select-record.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;GAQG;AACH,gDAAkC;AAClC,kDAOiC;AACjC,yCAEoB;AAkDpB;;;GAGG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAAwB,EAAe,EAAE,CAC3E,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;AADpC,QAAA,mBAAmB,uBACiB;AAEjD,MAAM,aAAa,GAAG,CAAC,YAAoB,EAAE,MAA6B,EAAE,QAAiB,EAAmB,EAAE,CAAC,CAAC;IAClH,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;IAChC,SAAS,EAAE,EAAE;IACb,WAAW,EAAE,YAAY;IACzB,QAAQ;IACR,MAAM;CACP,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,mBAAmB,GAAG,KAAK,EAC/B,OAA4B,EAC5B,MAA6B,EAC7B,QAAiB,EACjB,KAAyB,EACC,EAAE;IAC5B,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;QAC5F,OAAO,aAAa,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAC7F,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,IA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GAAG,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC,CAAC;AAvBW,QAAA,YAAY,gBAuBvB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical serialization of install records, shared by the CLI and the
|
|
3
|
+
* extension so the same content always gives the same bytes.
|
|
4
|
+
* @module records/serialize-record
|
|
5
|
+
*/
|
|
6
|
+
import { type InstallRecord } from '@ai-primitives-hub/core';
|
|
7
|
+
/**
|
|
8
|
+
* Deep, prototype-free copy with sorted keys and files and the canonical `$schema`.
|
|
9
|
+
* @param record - Record to copy; left unchanged.
|
|
10
|
+
* @throws {RegistryError} `RECORD.MALFORMED` when a forbidden key appears at any depth.
|
|
11
|
+
*/
|
|
12
|
+
export declare const canonicalizeRecord: (record: InstallRecord) => InstallRecord;
|
|
13
|
+
/**
|
|
14
|
+
* Serialize a record canonically: the record's main fields first in a fixed
|
|
15
|
+
* order, the others sorted, two-space indentation, trailing newline.
|
|
16
|
+
* @param record - Record to write.
|
|
17
|
+
* @throws {RegistryError} `RECORD.MALFORMED` when a forbidden key appears at any depth.
|
|
18
|
+
*/
|
|
19
|
+
export declare const serializeRecord: (record: InstallRecord) => string;
|
|
20
|
+
//# sourceMappingURL=serialize-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-record.d.ts","sourceRoot":"","sources":["../../src/records/serialize-record.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAGL,KAAK,aAAa,EAInB,MAAM,yBAAyB,CAAC;AA4EjC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,aAAa,KAAG,aAU1D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,aAAa,KAAG,MACqB,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeRecord = exports.canonicalizeRecord = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Canonical serialization of install records, shared by the CLI and the
|
|
6
|
+
* extension so the same content always gives the same bytes.
|
|
7
|
+
* @module records/serialize-record
|
|
8
|
+
*/
|
|
9
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
10
|
+
const canonicalize = (value) => {
|
|
11
|
+
if (Array.isArray(value)) {
|
|
12
|
+
return value.map((item) => canonicalize(item));
|
|
13
|
+
}
|
|
14
|
+
if (!(0, core_1.isJsonObject)(value)) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
const copy = Object.create(null);
|
|
18
|
+
for (const key of Object.keys(value).toSorted(core_1.compareCodeUnits)) {
|
|
19
|
+
if (core_1.FORBIDDEN_KEYS.has(key)) {
|
|
20
|
+
throw (0, core_1.recordError)('RECORD.MALFORMED', { detail: `forbidden key ${key}` });
|
|
21
|
+
}
|
|
22
|
+
copy[key] = canonicalize(value[key]);
|
|
23
|
+
}
|
|
24
|
+
return copy;
|
|
25
|
+
};
|
|
26
|
+
const filePathOf = (file) => (0, core_1.isJsonObject)(file) && typeof file.path === 'string' ? file.path : '';
|
|
27
|
+
/** Keys written first, in this order, at each level of the record; the rest follow sorted. */
|
|
28
|
+
const KEY_ORDER = {
|
|
29
|
+
top: ['$schema', 'version', 'level', 'generatedAt', 'generatedBy', 'hubs', 'sources', 'bundles'],
|
|
30
|
+
bundle: ['name', 'tools'],
|
|
31
|
+
entry: ['version', 'bundleId', 'sourceId', 'sourceType', 'installedAt', 'integrity', 'root', 'needsReinstall', 'files', 'plugins', 'mcpServers'],
|
|
32
|
+
file: ['path', 'checksum', 'sourcePath', 'mode']
|
|
33
|
+
};
|
|
34
|
+
// Copy with the given keys first, in that order, then the others in sorted order.
|
|
35
|
+
const ordered = (value, first) => {
|
|
36
|
+
if (!(0, core_1.isJsonObject)(value)) {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
const copy = Object.create(null);
|
|
40
|
+
for (const key of [...first.filter((name) => Object.hasOwn(value, name)), ...Object.keys(value).filter((other) => !first.includes(other))]) {
|
|
41
|
+
copy[key] = value[key];
|
|
42
|
+
}
|
|
43
|
+
return copy;
|
|
44
|
+
};
|
|
45
|
+
const orderRecordKeys = (record) => {
|
|
46
|
+
const top = ordered(record, KEY_ORDER.top);
|
|
47
|
+
if ((0, core_1.isJsonObject)(top.bundles)) {
|
|
48
|
+
for (const [key, bundle] of Object.entries(top.bundles)) {
|
|
49
|
+
const bundleCopy = ordered(bundle, KEY_ORDER.bundle);
|
|
50
|
+
if ((0, core_1.isJsonObject)(bundleCopy.tools)) {
|
|
51
|
+
for (const [tool, entry] of Object.entries(bundleCopy.tools)) {
|
|
52
|
+
const entryCopy = ordered(entry, KEY_ORDER.entry);
|
|
53
|
+
if (Array.isArray(entryCopy.files)) {
|
|
54
|
+
entryCopy.files = entryCopy.files.map((file) => ordered(file, KEY_ORDER.file));
|
|
55
|
+
}
|
|
56
|
+
bundleCopy.tools[tool] = entryCopy;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
top.bundles[key] = bundleCopy;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return top;
|
|
63
|
+
};
|
|
64
|
+
const sortEntryFiles = (record) => {
|
|
65
|
+
const bundles = (0, core_1.isJsonObject)(record.bundles) ? record.bundles : undefined;
|
|
66
|
+
for (const bundle of Object.values(bundles ?? {})) {
|
|
67
|
+
const tools = (0, core_1.isJsonObject)(bundle) && (0, core_1.isJsonObject)(bundle.tools) ? bundle.tools : undefined;
|
|
68
|
+
for (const entry of Object.values(tools ?? {})) {
|
|
69
|
+
if ((0, core_1.isJsonObject)(entry) && Array.isArray(entry.files)) {
|
|
70
|
+
entry.files = entry.files.toSorted((left, right) => (0, core_1.compareCodeUnits)(filePathOf(left), filePathOf(right)));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Deep, prototype-free copy with sorted keys and files and the canonical `$schema`.
|
|
77
|
+
* @param record - Record to copy; left unchanged.
|
|
78
|
+
* @throws {RegistryError} `RECORD.MALFORMED` when a forbidden key appears at any depth.
|
|
79
|
+
*/
|
|
80
|
+
const canonicalizeRecord = (record) => {
|
|
81
|
+
const copy = canonicalize(record);
|
|
82
|
+
sortEntryFiles(copy);
|
|
83
|
+
copy.$schema = core_1.RECORD_SCHEMA_URL;
|
|
84
|
+
// Rebuild so `$schema` sits in sorted position even when the input had none.
|
|
85
|
+
const result = Object.create(null);
|
|
86
|
+
for (const key of Object.keys(copy).toSorted(core_1.compareCodeUnits)) {
|
|
87
|
+
result[key] = copy[key];
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
};
|
|
91
|
+
exports.canonicalizeRecord = canonicalizeRecord;
|
|
92
|
+
/**
|
|
93
|
+
* Serialize a record canonically: the record's main fields first in a fixed
|
|
94
|
+
* order, the others sorted, two-space indentation, trailing newline.
|
|
95
|
+
* @param record - Record to write.
|
|
96
|
+
* @throws {RegistryError} `RECORD.MALFORMED` when a forbidden key appears at any depth.
|
|
97
|
+
*/
|
|
98
|
+
const serializeRecord = (record) => `${JSON.stringify(orderRecordKeys((0, exports.canonicalizeRecord)(record)), null, 2)}\n`;
|
|
99
|
+
exports.serializeRecord = serializeRecord;
|
|
100
|
+
//# sourceMappingURL=serialize-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-record.js","sourceRoot":"","sources":["../../src/records/serialize-record.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,kDAOiC;AAIjC,MAAM,YAAY,GAAG,CAAC,KAAc,EAAW,EAAE;IAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,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KAAK,CAAC,EAAE,CAAC;gBACtD,KAAK,CAAC,KAAK,GAAI,KAAK,CAAC,KAAmB,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAA,uBAAgB,EAAC,UAAU,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5H,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CAAC,MAAqB,EAAiB,EAAE;IACzE,MAAM,IAAI,GAAG,YAAY,CAAC,MAAM,CAAe,CAAC;IAChD,cAAc,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,CAAC,OAAO,GAAG,wBAAiB,CAAC;IACjC,6EAA6E;IAC7E,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAe,CAAC;IACjD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,uBAAgB,CAAC,EAAE,CAAC;QAC/D,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,MAAuB,CAAC;AACjC,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B;AAEF;;;;;GAKG;AACI,MAAM,eAAe,GAAG,CAAC,MAAqB,EAAU,EAAE,CAC/D,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAA,0BAAkB,EAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;AADjE,QAAA,eAAe,mBACkD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The optional fields of a recorded source and the copy every record source
|
|
3
|
+
* builder uses. Internal to `records`.
|
|
4
|
+
* @module records/source-fields
|
|
5
|
+
*/
|
|
6
|
+
import type { SourceRecord } from '@ai-primitives-hub/core';
|
|
7
|
+
/** Optional string fields of a recorded source, in addition to `type` and `url`. */
|
|
8
|
+
export declare const SOURCE_FIELDS: readonly ["branch", "collectionsPath", "indexFile", "authMode", "credentialRef", "hubId"];
|
|
9
|
+
/** The optional fields kept from a record's own copy of a source: never `authMode` or `credentialRef`. */
|
|
10
|
+
export declare const SOURCE_FIELDS_WITHOUT_CREDENTIALS: readonly ["branch", "collectionsPath", "indexFile", "hubId"];
|
|
11
|
+
/** One optional source field name. */
|
|
12
|
+
export type SourceField = typeof SOURCE_FIELDS[number];
|
|
13
|
+
/**
|
|
14
|
+
* A prototype-free `SourceRecord` with `type`, `url` and each listed string field of `from`.
|
|
15
|
+
* @param from - Object to copy the optional fields from.
|
|
16
|
+
* @param type - Source type.
|
|
17
|
+
* @param url - Source URL.
|
|
18
|
+
* @param fields - Optional fields to copy.
|
|
19
|
+
*/
|
|
20
|
+
export declare const copySourceFields: (from: Readonly<Record<string, unknown>> | undefined, type: string, url: string, fields: readonly SourceField[]) => SourceRecord;
|
|
21
|
+
//# sourceMappingURL=source-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-fields.d.ts","sourceRoot":"","sources":["../../src/records/source-fields.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,oFAAoF;AACpF,eAAO,MAAM,aAAa,2FAA4F,CAAC;AAEvH,0GAA0G;AAC1G,eAAO,MAAM,iCAAiC,8DAA+D,CAAC;AAE9G,sCAAsC;AACtC,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,MAAM,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,EACnD,MAAM,MAAM,EACZ,KAAK,MAAM,EACX,QAAQ,SAAS,WAAW,EAAE,KAC7B,YAWF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.copySourceFields = exports.SOURCE_FIELDS_WITHOUT_CREDENTIALS = exports.SOURCE_FIELDS = void 0;
|
|
4
|
+
/** Optional string fields of a recorded source, in addition to `type` and `url`. */
|
|
5
|
+
exports.SOURCE_FIELDS = ['branch', 'collectionsPath', 'indexFile', 'authMode', 'credentialRef', 'hubId'];
|
|
6
|
+
/** The optional fields kept from a record's own copy of a source: never `authMode` or `credentialRef`. */
|
|
7
|
+
exports.SOURCE_FIELDS_WITHOUT_CREDENTIALS = ['branch', 'collectionsPath', 'indexFile', 'hubId'];
|
|
8
|
+
/**
|
|
9
|
+
* A prototype-free `SourceRecord` with `type`, `url` and each listed string field of `from`.
|
|
10
|
+
* @param from - Object to copy the optional fields from.
|
|
11
|
+
* @param type - Source type.
|
|
12
|
+
* @param url - Source URL.
|
|
13
|
+
* @param fields - Optional fields to copy.
|
|
14
|
+
*/
|
|
15
|
+
const copySourceFields = (from, type, url, fields) => {
|
|
16
|
+
const source = Object.create(null);
|
|
17
|
+
source.type = type;
|
|
18
|
+
source.url = url;
|
|
19
|
+
for (const field of fields) {
|
|
20
|
+
const value = from?.[field];
|
|
21
|
+
if (typeof value === 'string') {
|
|
22
|
+
source[field] = value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return source;
|
|
26
|
+
};
|
|
27
|
+
exports.copySourceFields = copySourceFields;
|
|
28
|
+
//# sourceMappingURL=source-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-fields.js","sourceRoot":"","sources":["../../src/records/source-fields.ts"],"names":[],"mappings":";;;AASA,oFAAoF;AACvE,QAAA,aAAa,GAAG,CAAC,QAAQ,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,CAAU,CAAC;AAEvH,0GAA0G;AAC7F,QAAA,iCAAiC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,CAAU,CAAC;AAK9G;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAC9B,IAAmD,EACnD,IAAY,EACZ,GAAW,EACX,MAA8B,EAChB,EAAE;IAChB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAiB,CAAC;IACnD,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAhBW,QAAA,gBAAgB,oBAgB3B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configured source to recorded source: one normalisation for every writer of
|
|
3
|
+
* a record source. Only the fields that apply to the source type are kept, and
|
|
4
|
+
* tokens never reach the result.
|
|
5
|
+
* @module records/to-record-source
|
|
6
|
+
*/
|
|
7
|
+
import { type RegistrySource, type SourceRecord } from '@ai-primitives-hub/core';
|
|
8
|
+
import { type RecordHubInput } from './record-hub';
|
|
9
|
+
/**
|
|
10
|
+
* The record-shaped, prototype-free copy of a configured source.
|
|
11
|
+
* @param configured - Configured source.
|
|
12
|
+
*/
|
|
13
|
+
export declare function toRecordSource(configured: RegistrySource): SourceRecord;
|
|
14
|
+
/**
|
|
15
|
+
* The record-shaped copy of a configured source, with its record id.
|
|
16
|
+
* @param configured - Configured source.
|
|
17
|
+
* @param sourceId - Record key of the source.
|
|
18
|
+
* @param hub - The source's hub when it is shareable; its id is then recorded as `hubId`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function toRecordSource(configured: RegistrySource, sourceId: string, hub?: RecordHubInput): SourceRecord & {
|
|
21
|
+
sourceId: string;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=to-record-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-record-source.d.ts","sourceRoot":"","sources":["../../src/records/to-record-source.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAKtB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,cAAc,GAAG,YAAY,CAAC;AACzE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toRecordSource = toRecordSource;
|
|
4
|
+
/**
|
|
5
|
+
* Configured source to recorded source: one normalisation for every writer of
|
|
6
|
+
* a record source. Only the fields that apply to the source type are kept, and
|
|
7
|
+
* tokens never reach the result.
|
|
8
|
+
* @module records/to-record-source
|
|
9
|
+
*/
|
|
10
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
11
|
+
const record_hub_1 = require("./record-hub");
|
|
12
|
+
const source_fields_1 = require("./source-fields");
|
|
13
|
+
/**
|
|
14
|
+
* Implementation of both overloads.
|
|
15
|
+
* @param configured - Configured source.
|
|
16
|
+
* @param sourceId - Record key of the source.
|
|
17
|
+
* @param hub - The source's shareable hub.
|
|
18
|
+
*/
|
|
19
|
+
function toRecordSource(configured, sourceId, hub) {
|
|
20
|
+
const config = configured.config;
|
|
21
|
+
const isArtifactory = configured.type === 'artifactory';
|
|
22
|
+
const source = (0, source_fields_1.copySourceFields)(config, configured.type, configured.url, isArtifactory ? ['indexFile', 'credentialRef'] : ['branch']);
|
|
23
|
+
if (typeof config?.collectionsPath === 'string' && config.collectionsPath !== '') {
|
|
24
|
+
source.collectionsPath = config.collectionsPath;
|
|
25
|
+
}
|
|
26
|
+
if (isArtifactory) {
|
|
27
|
+
// `anonymous` is the Artifactory adapter's default when `authMode` is absent.
|
|
28
|
+
source.authMode = config?.authMode === 'bearer' ? 'bearer' : 'anonymous';
|
|
29
|
+
}
|
|
30
|
+
// Never the built-in local hub or a local-path hub.
|
|
31
|
+
if (hub !== undefined && configured.hubId === hub.id && hub.id !== core_1.DEFAULT_LOCAL_HUB_ID && (0, record_hub_1.toRecordHub)(hub.id, hub.name, hub) !== undefined) {
|
|
32
|
+
source.hubId = hub.id;
|
|
33
|
+
}
|
|
34
|
+
if (sourceId !== undefined) {
|
|
35
|
+
source.sourceId = sourceId;
|
|
36
|
+
}
|
|
37
|
+
return source;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=to-record-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-record-source.js","sourceRoot":"","sources":["../../src/records/to-record-source.ts"],"names":[],"mappings":";;AAqCA,wCAqBC;AA1DD;;;;;GAKG;AACH,kDAIiC;AACjC,6CAGsB;AACtB,mDAEyB;AAczB;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,UAA0B,EAAE,QAAiB,EAAE,GAAoB;IAChG,MAAM,MAAM,GAAkD,UAAU,CAAC,MAAM,CAAC;IAChF,MAAM,aAAa,GAAG,UAAU,CAAC,IAAI,KAAK,aAAa,CAAC;IACxD,MAAM,MAAM,GAAyC,IAAA,gCAAgB,EACnE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CACrG,CAAC;IACF,IAAI,OAAO,MAAM,EAAE,eAAe,KAAK,QAAQ,IAAI,MAAM,CAAC,eAAe,KAAK,EAAE,EAAE,CAAC;QACjF,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;IAClD,CAAC;IACD,IAAI,aAAa,EAAE,CAAC;QAClB,8EAA8E;QAC9E,MAAM,CAAC,QAAQ,GAAG,MAAM,EAAE,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC;IAC3E,CAAC;IACD,oDAAoD;IACpD,IAAI,GAAG,KAAK,SAAS,IAAI,UAAU,CAAC,KAAK,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,2BAAoB,IAAI,IAAA,wBAAW,EAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;QAC5I,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC;IACxB,CAAC;IACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RecordFs } from '@ai-primitives-hub/core';
|
|
2
|
+
/**
|
|
3
|
+
* The user level's home folder: `HOME`, else `USERPROFILE`, else `os.homedir()`.
|
|
4
|
+
* Unlike infra's `homeDir`, `HOME` wins on Windows too, because the writers expand `~` against it.
|
|
5
|
+
* @param env - Environment variables.
|
|
6
|
+
*/
|
|
7
|
+
export declare const resolveUserHome: (env: Record<string, string | undefined>) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Refuse a user target folder whose real path is outside home; it need not exist yet.
|
|
10
|
+
* @param fs - Filesystem port.
|
|
11
|
+
* @param home - Home folder.
|
|
12
|
+
* @param folder - Absolute folder the writer will write into.
|
|
13
|
+
* @throws {RegistryError} `RECORD.PATH_OUTSIDE_ROOT`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const assertUserFolderInsideHome: (fs: RecordFs, home: string, folder: string) => Promise<void>;
|
|
16
|
+
//# sourceMappingURL=user-home.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-home.d.ts","sourceRoot":"","sources":["../../src/records/user-home.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,QAAQ,EAEd,MAAM,yBAAyB,CAAC;AAQjC;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,KAAG,MACK,CAAC;AAKhF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAU,IAAI,QAAQ,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,IAAI,CAmBzG,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.assertUserFolderInsideHome = exports.resolveUserHome = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* The user level's home folder, shared by the CLI, the extension and doctor,
|
|
39
|
+
* and the pre-write check that a user target folder sits inside it.
|
|
40
|
+
* @module records/user-home
|
|
41
|
+
*/
|
|
42
|
+
const os = __importStar(require("node:os"));
|
|
43
|
+
const path = __importStar(require("node:path"));
|
|
44
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
45
|
+
const confine_path_1 = require("./confine-path");
|
|
46
|
+
const nonEmpty = (value) => value === undefined || value === '' ? undefined : value;
|
|
47
|
+
/**
|
|
48
|
+
* The user level's home folder: `HOME`, else `USERPROFILE`, else `os.homedir()`.
|
|
49
|
+
* Unlike infra's `homeDir`, `HOME` wins on Windows too, because the writers expand `~` against it.
|
|
50
|
+
* @param env - Environment variables.
|
|
51
|
+
*/
|
|
52
|
+
const resolveUserHome = (env) => path.resolve(nonEmpty(env.HOME) ?? nonEmpty(env.USERPROFILE) ?? os.homedir());
|
|
53
|
+
exports.resolveUserHome = resolveUserHome;
|
|
54
|
+
const outsideHomeHint = (home) => `Use a target under ${home} or a repository target.`;
|
|
55
|
+
/**
|
|
56
|
+
* Refuse a user target folder whose real path is outside home; it need not exist yet.
|
|
57
|
+
* @param fs - Filesystem port.
|
|
58
|
+
* @param home - Home folder.
|
|
59
|
+
* @param folder - Absolute folder the writer will write into.
|
|
60
|
+
* @throws {RegistryError} `RECORD.PATH_OUTSIDE_ROOT`.
|
|
61
|
+
*/
|
|
62
|
+
const assertUserFolderInsideHome = async (fs, home, folder) => {
|
|
63
|
+
// Home itself is not a target folder: it counts as outside.
|
|
64
|
+
const relative = (0, core_1.relativeInside)(path.resolve(home), path.resolve(folder));
|
|
65
|
+
const refuse = (cause) => (0, core_1.recordError)('RECORD.PATH_OUTSIDE_ROOT', {
|
|
66
|
+
message: 'The user target folder is outside the home folder; nothing was written.',
|
|
67
|
+
detail: `the user target folder ${folder} is outside the home folder ${home}`,
|
|
68
|
+
hint: outsideHomeHint(home),
|
|
69
|
+
context: { folder, home },
|
|
70
|
+
...(cause === undefined ? {} : { cause })
|
|
71
|
+
});
|
|
72
|
+
if (relative === undefined) {
|
|
73
|
+
throw refuse();
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
// Check a probe leaf, so the target folder itself is realpath'd too.
|
|
77
|
+
await (0, confine_path_1.confinePath)(fs, home, `${relative}/.ai-primitives-hub-probe`);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw refuse(error);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.assertUserFolderInsideHome = assertUserFolderInsideHome;
|
|
84
|
+
//# sourceMappingURL=user-home.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-home.js","sourceRoot":"","sources":["../../src/records/user-home.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAI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