@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,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The capped, strict-UTF-8 read shared by the record store and migration.
|
|
3
|
+
* @module records/read-record-text
|
|
4
|
+
*/
|
|
5
|
+
import { type RecordFs } from '@ai-primitives-hub/core';
|
|
6
|
+
/**
|
|
7
|
+
* Read a record file of at most 10 MB as UTF-8 text.
|
|
8
|
+
* @param fs - Filesystem port.
|
|
9
|
+
* @param readPath - Absolute path to read.
|
|
10
|
+
* @param file - File to name in errors.
|
|
11
|
+
* @param hint - Hint for the size error.
|
|
12
|
+
* @throws {RegistryError} `RECORD.MALFORMED` naming `file`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const readRecordText: (fs: RecordFs, readPath: string, file: string, hint?: string) => Promise<string>;
|
|
15
|
+
//# sourceMappingURL=read-record-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-record-text.d.ts","sourceRoot":"","sources":["../../src/records/read-record-text.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAU,IAAI,QAAQ,EAAE,UAAU,MAAM,EAAE,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,MAAM,CAehH,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readRecordText = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The capped, strict-UTF-8 read shared by the record store and migration.
|
|
6
|
+
* @module records/read-record-text
|
|
7
|
+
*/
|
|
8
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
9
|
+
/**
|
|
10
|
+
* Read a record file of at most 10 MB as UTF-8 text.
|
|
11
|
+
* @param fs - Filesystem port.
|
|
12
|
+
* @param readPath - Absolute path to read.
|
|
13
|
+
* @param file - File to name in errors.
|
|
14
|
+
* @param hint - Hint for the size error.
|
|
15
|
+
* @throws {RegistryError} `RECORD.MALFORMED` naming `file`.
|
|
16
|
+
*/
|
|
17
|
+
const readRecordText = async (fs, readPath, file, hint) => {
|
|
18
|
+
let bytes;
|
|
19
|
+
try {
|
|
20
|
+
bytes = await fs.readCapped(readPath, core_1.RECORD_MAX_BYTES + 1);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw (0, core_1.recordError)('RECORD.MALFORMED', { file, detail: 'the file could not be read', cause: error });
|
|
24
|
+
}
|
|
25
|
+
if (bytes.byteLength > core_1.RECORD_MAX_BYTES) {
|
|
26
|
+
throw (0, core_1.recordError)('RECORD.MALFORMED', { file, detail: 'record larger than 10 MB', hint });
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
return new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
throw (0, core_1.recordError)('RECORD.MALFORMED', { file, detail: 'not valid UTF-8', cause: error });
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.readRecordText = readRecordText;
|
|
36
|
+
//# sourceMappingURL=read-record-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-record-text.js","sourceRoot":"","sources":["../../src/records/read-record-text.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,kDAIiC;AAEjC;;;;;;;GAOG;AACI,MAAM,cAAc,GAAG,KAAK,EAAE,EAAY,EAAE,QAAgB,EAAE,IAAY,EAAE,IAAa,EAAmB,EAAE;IACnH,IAAI,KAAiB,CAAC;IACtB,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,uBAAgB,GAAG,CAAC,CAAC,CAAC;IAC9D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAA,kBAAW,EAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,4BAA4B,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACtG,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,GAAG,uBAAgB,EAAE,CAAC;QACxC,MAAM,IAAA,kBAAW,EAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,0BAA0B,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5F,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAA,kBAAW,EAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3F,CAAC;AACH,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type BundleRecord, type InstallRecord, type RecordedFile, type RecordFs, type ToolEntry } from '@ai-primitives-hub/core';
|
|
2
|
+
/** The fields of a tool entry {@link putToolEntry} writes; any other own field is copied as it is. */
|
|
3
|
+
export interface ToolEntryFields {
|
|
4
|
+
version: string;
|
|
5
|
+
sourceId: string;
|
|
6
|
+
sourceType: string;
|
|
7
|
+
installedAt: string;
|
|
8
|
+
/** `sha256:` of the downloaded bundle content. */
|
|
9
|
+
integrity?: string;
|
|
10
|
+
files: readonly RecordedFile[];
|
|
11
|
+
/** Only under the `unknown` tool key. */
|
|
12
|
+
needsReinstall?: true;
|
|
13
|
+
}
|
|
14
|
+
/** An empty, prototype-free bundle record. */
|
|
15
|
+
export declare const createBundle: () => BundleRecord;
|
|
16
|
+
/**
|
|
17
|
+
* The recorded file for a confined path, with the checksum of the bytes on disk.
|
|
18
|
+
* @param fs - Filesystem port.
|
|
19
|
+
* @param root - Level root.
|
|
20
|
+
* @param relative - Path already confined to `root`, forward slashes.
|
|
21
|
+
*/
|
|
22
|
+
export declare const hashRecordedFile: (fs: RecordFs, root: string, relative: string) => Promise<RecordedFile>;
|
|
23
|
+
/**
|
|
24
|
+
* Put a prototype-free tool entry, files sorted, under `bundles.<bundleId>.tools.<tool>`.
|
|
25
|
+
* @param record - Record to change.
|
|
26
|
+
* @param bundleId - Bundle id.
|
|
27
|
+
* @param tool - Tool key.
|
|
28
|
+
* @param fields - The entry's fields; a whole `ToolEntry` to move one unchanged.
|
|
29
|
+
*/
|
|
30
|
+
export declare const putToolEntry: (record: InstallRecord, bundleId: string, tool: string, fields: ToolEntryFields) => ToolEntry;
|
|
31
|
+
//# sourceMappingURL=record-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-entry.d.ts","sourceRoot":"","sources":["../../src/records/record-entry.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAC;AAEjC,sGAAsG;AACtG,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,yCAAyC;IACzC,cAAc,CAAC,EAAE,IAAI,CAAC;CACvB;AAED,8CAA8C;AAC9C,eAAO,MAAM,YAAY,QAAO,YAI/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAU,IAAI,QAAQ,EAAE,MAAM,MAAM,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,YAAY,CAKzG,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,aAAa,EAAE,UAAU,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,eAAe,KAAG,SAQ7G,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
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.putToolEntry = exports.hashRecordedFile = exports.createBundle = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* The 3.0.0 entry builders shared by the record service and migration, so the
|
|
39
|
+
* record bytes do not depend on which writer made the entry.
|
|
40
|
+
* @module records/record-entry
|
|
41
|
+
*/
|
|
42
|
+
const path = __importStar(require("node:path"));
|
|
43
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
44
|
+
/** An empty, prototype-free bundle record. */
|
|
45
|
+
const createBundle = () => {
|
|
46
|
+
const bundle = Object.create(null);
|
|
47
|
+
bundle.tools = Object.create(null);
|
|
48
|
+
return bundle;
|
|
49
|
+
};
|
|
50
|
+
exports.createBundle = createBundle;
|
|
51
|
+
/**
|
|
52
|
+
* The recorded file for a confined path, with the checksum of the bytes on disk.
|
|
53
|
+
* @param fs - Filesystem port.
|
|
54
|
+
* @param root - Level root.
|
|
55
|
+
* @param relative - Path already confined to `root`, forward slashes.
|
|
56
|
+
*/
|
|
57
|
+
const hashRecordedFile = async (fs, root, relative) => {
|
|
58
|
+
const file = Object.create(null);
|
|
59
|
+
file.path = relative;
|
|
60
|
+
file.checksum = await fs.hashFile(path.join(root, ...relative.split('/')));
|
|
61
|
+
return file;
|
|
62
|
+
};
|
|
63
|
+
exports.hashRecordedFile = hashRecordedFile;
|
|
64
|
+
/**
|
|
65
|
+
* Put a prototype-free tool entry, files sorted, under `bundles.<bundleId>.tools.<tool>`.
|
|
66
|
+
* @param record - Record to change.
|
|
67
|
+
* @param bundleId - Bundle id.
|
|
68
|
+
* @param tool - Tool key.
|
|
69
|
+
* @param fields - The entry's fields; a whole `ToolEntry` to move one unchanged.
|
|
70
|
+
*/
|
|
71
|
+
const putToolEntry = (record, bundleId, tool, fields) => {
|
|
72
|
+
const entry = Object.assign(Object.create(null), fields);
|
|
73
|
+
entry.files = [...fields.files].toSorted((left, right) => (0, core_1.compareCodeUnits)(left.path, right.path));
|
|
74
|
+
if (!Object.hasOwn(record.bundles, bundleId)) {
|
|
75
|
+
record.bundles[bundleId] = (0, exports.createBundle)();
|
|
76
|
+
}
|
|
77
|
+
record.bundles[bundleId].tools[tool] = entry;
|
|
78
|
+
return entry;
|
|
79
|
+
};
|
|
80
|
+
exports.putToolEntry = putToolEntry;
|
|
81
|
+
//# sourceMappingURL=record-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-entry.js","sourceRoot":"","sources":["../../src/records/record-entry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,gDAAkC;AAClC,kDAOiC;AAejC,8CAA8C;AACvC,MAAM,YAAY,GAAG,GAAiB,EAAE;IAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAiB,CAAC;IACnD,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAA0B,CAAC;IAC5D,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAJW,QAAA,YAAY,gBAIvB;AAEF;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,KAAK,EAAE,EAAY,EAAE,IAAY,EAAE,QAAgB,EAAyB,EAAE;IAC5G,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAiB,CAAC;IACjD,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;IACrB,IAAI,CAAC,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B;AAEF;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAAC,MAAqB,EAAE,QAAgB,EAAE,IAAY,EAAE,MAAuB,EAAa,EAAE;IACxH,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAc,EAAE,MAAM,CAAC,CAAC;IACtE,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAA,uBAAgB,EAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACnG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAA,oBAAY,GAAE,CAAC;IAC5C,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IAC7C,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AARW,QAAA,YAAY,gBAQvB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The install record as stored on disk, and the record the services work on.
|
|
3
|
+
*
|
|
4
|
+
* On disk (#688): sources and hubs are keyed by a readable id that is the same
|
|
5
|
+
* on every machine, bundles by `<sourceId>/<name>` with no version, and an entry names
|
|
6
|
+
* no source, since its key does. An entry keeps the hub's bundle id as
|
|
7
|
+
* `bundleId` when it differs from the name, so commands can still look the
|
|
8
|
+
* bundle up.
|
|
9
|
+
*
|
|
10
|
+
* In memory: bundles are keyed by the hub's bundle id and every entry has its
|
|
11
|
+
* `sourceId`, so the services and the commands keep one id per bundle. Readable
|
|
12
|
+
* ids of an earlier form are rewritten on read; records keyed by configured ids
|
|
13
|
+
* are read as they are, and the next save rewrites them.
|
|
14
|
+
* @module records/record-file-shape
|
|
15
|
+
*/
|
|
16
|
+
import { type InstallRecord } from '@ai-primitives-hub/core';
|
|
17
|
+
/** Prefix of a readable source id. */
|
|
18
|
+
export declare const RECORD_SOURCE_ID_PREFIX = "src:";
|
|
19
|
+
/** Prefix of a readable hub id. */
|
|
20
|
+
export declare const RECORD_HUB_ID_PREFIX = "hub:";
|
|
21
|
+
/** Hub fields the readable id is made of. */
|
|
22
|
+
export interface RecordHubIdFields {
|
|
23
|
+
type: string;
|
|
24
|
+
location: string;
|
|
25
|
+
ref?: string;
|
|
26
|
+
configFile?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Source fields the readable id is made of. */
|
|
29
|
+
export interface RecordSourceIdFields {
|
|
30
|
+
type: string;
|
|
31
|
+
url: string;
|
|
32
|
+
branch?: string;
|
|
33
|
+
collectionsPath?: string;
|
|
34
|
+
indexFile?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Readable source id `src:<type>:<host/path>[#<branch>][:<path>]`, the same on
|
|
38
|
+
* every machine. `<path>` is the collections folder, or the index file of an
|
|
39
|
+
* Artifactory source; an empty branch or path is left out.
|
|
40
|
+
* @param source - Recorded source fields.
|
|
41
|
+
*/
|
|
42
|
+
export declare const recordSourceIdOf: (source: RecordSourceIdFields) => string;
|
|
43
|
+
/**
|
|
44
|
+
* Whether an id is a readable source id.
|
|
45
|
+
* @param id - Source id.
|
|
46
|
+
*/
|
|
47
|
+
export declare const isRecordSourceId: (id: string) => boolean;
|
|
48
|
+
/**
|
|
49
|
+
* On-disk bundle key: the source id and the bundle name, no version.
|
|
50
|
+
* @param sourceId - Readable source id.
|
|
51
|
+
* @param name - Bundle name.
|
|
52
|
+
*/
|
|
53
|
+
export declare const recordBundleKeyOf: (sourceId: string, name: string) => string;
|
|
54
|
+
/**
|
|
55
|
+
* Bundle name: the collection, manifest or index id without its version.
|
|
56
|
+
* @param bundleId - Hub bundle id or manifest id.
|
|
57
|
+
* @param version - Installed version.
|
|
58
|
+
*/
|
|
59
|
+
export declare const recordBundleNameOf: (bundleId: string, version: string) => string;
|
|
60
|
+
/**
|
|
61
|
+
* Readable hub id `hub:<type>:<host/path>[#<ref>][:<configFile>]`, the same on
|
|
62
|
+
* every machine and in every tool, unlike a configured hub id. A GitHub
|
|
63
|
+
* `owner/repo` location gets its `github.com` host; an empty ref or config
|
|
64
|
+
* file is left out.
|
|
65
|
+
* @param hub - Recorded hub fields.
|
|
66
|
+
*/
|
|
67
|
+
export declare const recordHubIdOf: (hub: RecordHubIdFields) => string;
|
|
68
|
+
/**
|
|
69
|
+
* Whether an id is a readable hub id.
|
|
70
|
+
* @param id - Hub id.
|
|
71
|
+
*/
|
|
72
|
+
export declare const isRecordHubId: (id: string) => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The readable id of a recorded hub, built from its `hubs` entry; a readable
|
|
75
|
+
* key with no such entry is kept, anything else gives `undefined`.
|
|
76
|
+
* @param hubs - The record's `hubs`.
|
|
77
|
+
* @param hubId - A source's `hubId`.
|
|
78
|
+
*/
|
|
79
|
+
export declare const recordHubKeyIn: (hubs: unknown, hubId: string) => string | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* The record as stored on disk: readable source and hub ids, `<sourceId>/<name>` bundle keys.
|
|
82
|
+
* @param record - In-memory record; left unchanged.
|
|
83
|
+
*/
|
|
84
|
+
export declare const toRecordFile: (record: InstallRecord) => InstallRecord;
|
|
85
|
+
/**
|
|
86
|
+
* The record the services work on, from the record as stored on disk.
|
|
87
|
+
* @param file - Record read from disk and checked against the schema; left unchanged.
|
|
88
|
+
*/
|
|
89
|
+
export declare const fromRecordFile: (file: InstallRecord) => InstallRecord;
|
|
90
|
+
//# sourceMappingURL=record-file-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-file-shape.d.ts","sourceRoot":"","sources":["../../src/records/record-file-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAEL,KAAK,aAAa,EAInB,MAAM,yBAAyB,CAAC;AAKjC,sCAAsC;AACtC,e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a,KAAG,aA0EpD,CAAC"}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fromRecordFile = exports.toRecordFile = exports.recordHubKeyIn = exports.isRecordHubId = exports.recordHubIdOf = exports.recordBundleNameOf = exports.recordBundleKeyOf = exports.isRecordSourceId = exports.recordSourceIdOf = exports.RECORD_HUB_ID_PREFIX = exports.RECORD_SOURCE_ID_PREFIX = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The install record as stored on disk, and the record the services work on.
|
|
6
|
+
*
|
|
7
|
+
* On disk (#688): sources and hubs are keyed by a readable id that is the same
|
|
8
|
+
* on every machine, bundles by `<sourceId>/<name>` with no version, and an entry names
|
|
9
|
+
* no source, since its key does. An entry keeps the hub's bundle id as
|
|
10
|
+
* `bundleId` when it differs from the name, so commands can still look the
|
|
11
|
+
* bundle up.
|
|
12
|
+
*
|
|
13
|
+
* In memory: bundles are keyed by the hub's bundle id and every entry has its
|
|
14
|
+
* `sourceId`, so the services and the commands keep one id per bundle. Readable
|
|
15
|
+
* ids of an earlier form are rewritten on read; records keyed by configured ids
|
|
16
|
+
* are read as they are, and the next save rewrites them.
|
|
17
|
+
* @module records/record-file-shape
|
|
18
|
+
*/
|
|
19
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
20
|
+
const record_identity_1 = require("./record-identity");
|
|
21
|
+
/** Prefix of a readable source id. */
|
|
22
|
+
exports.RECORD_SOURCE_ID_PREFIX = 'src:';
|
|
23
|
+
/** Prefix of a readable hub id. */
|
|
24
|
+
exports.RECORD_HUB_ID_PREFIX = 'hub:';
|
|
25
|
+
/** scp-style SSH address: `user@host:path`. */
|
|
26
|
+
const SCP_PATTERN = /^[^\s/:@]+@([^\s/:@]+):(.*)$/;
|
|
27
|
+
const trimSlashes = (value) => value.replaceAll('\\', '/').replace(/^\.?\/+/, '').replace(/\/+$/, '');
|
|
28
|
+
// `host/path` of a URL, without scheme, credentials, query, trailing slash or `.git`; a local path as written.
|
|
29
|
+
const locationOf = (url) => {
|
|
30
|
+
const scp = SCP_PATTERN.exec(url);
|
|
31
|
+
if (scp !== null) {
|
|
32
|
+
return `${scp[1].toLowerCase()}/${trimSlashes(scp[2]).replace(/\.git$/, '')}`;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const parsed = new URL(url);
|
|
36
|
+
if (parsed.host !== '') {
|
|
37
|
+
return `${parsed.host.toLowerCase()}${parsed.pathname.replace(/\/+$/, '').replace(/\.git$/, '')}`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Not a URL: a local folder.
|
|
42
|
+
}
|
|
43
|
+
return url.replaceAll('\\', '/').replace(/\/+$/, '');
|
|
44
|
+
};
|
|
45
|
+
// `#<ref>` and `:<path>`, each left out when empty and nothing follows it.
|
|
46
|
+
const suffixOf = (ref, subPath) => {
|
|
47
|
+
if (subPath !== '') {
|
|
48
|
+
return `#${ref ?? ''}:${subPath}`;
|
|
49
|
+
}
|
|
50
|
+
return ref === undefined || ref === '' ? '' : `#${ref}`;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Readable source id `src:<type>:<host/path>[#<branch>][:<path>]`, the same on
|
|
54
|
+
* every machine. `<path>` is the collections folder, or the index file of an
|
|
55
|
+
* Artifactory source; an empty branch or path is left out.
|
|
56
|
+
* @param source - Recorded source fields.
|
|
57
|
+
*/
|
|
58
|
+
const recordSourceIdOf = (source) => `${exports.RECORD_SOURCE_ID_PREFIX}${source.type}:${locationOf(source.url)}${suffixOf(source.branch, trimSlashes(source.collectionsPath ?? source.indexFile ?? ''))}`;
|
|
59
|
+
exports.recordSourceIdOf = recordSourceIdOf;
|
|
60
|
+
/**
|
|
61
|
+
* Whether an id is a readable source id.
|
|
62
|
+
* @param id - Source id.
|
|
63
|
+
*/
|
|
64
|
+
const isRecordSourceId = (id) => id.startsWith(exports.RECORD_SOURCE_ID_PREFIX);
|
|
65
|
+
exports.isRecordSourceId = isRecordSourceId;
|
|
66
|
+
/**
|
|
67
|
+
* On-disk bundle key: the source id and the bundle name, no version.
|
|
68
|
+
* @param sourceId - Readable source id.
|
|
69
|
+
* @param name - Bundle name.
|
|
70
|
+
*/
|
|
71
|
+
const recordBundleKeyOf = (sourceId, name) => `${sourceId}/${name}`;
|
|
72
|
+
exports.recordBundleKeyOf = recordBundleKeyOf;
|
|
73
|
+
/**
|
|
74
|
+
* Bundle name: the collection, manifest or index id without its version.
|
|
75
|
+
* @param bundleId - Hub bundle id or manifest id.
|
|
76
|
+
* @param version - Installed version.
|
|
77
|
+
*/
|
|
78
|
+
const recordBundleNameOf = (bundleId, version) => (0, record_identity_1.recordIdentityOf)(bundleId, version);
|
|
79
|
+
exports.recordBundleNameOf = recordBundleNameOf;
|
|
80
|
+
/** A GitHub `owner/repo` location, without a host. */
|
|
81
|
+
const GITHUB_SHORTHAND_PATTERN = /^[\w.-]+\/[\w.-]+\/?$/;
|
|
82
|
+
/**
|
|
83
|
+
* Readable hub id `hub:<type>:<host/path>[#<ref>][:<configFile>]`, the same on
|
|
84
|
+
* every machine and in every tool, unlike a configured hub id. A GitHub
|
|
85
|
+
* `owner/repo` location gets its `github.com` host; an empty ref or config
|
|
86
|
+
* file is left out.
|
|
87
|
+
* @param hub - Recorded hub fields.
|
|
88
|
+
*/
|
|
89
|
+
const recordHubIdOf = (hub) => {
|
|
90
|
+
const location = hub.type === 'github' && GITHUB_SHORTHAND_PATTERN.test(hub.location)
|
|
91
|
+
? `github.com/${trimSlashes(hub.location).replace(/\.git$/, '')}`
|
|
92
|
+
: locationOf(hub.location);
|
|
93
|
+
return `${exports.RECORD_HUB_ID_PREFIX}${hub.type}:${location}${suffixOf(hub.ref, trimSlashes(hub.configFile ?? ''))}`;
|
|
94
|
+
};
|
|
95
|
+
exports.recordHubIdOf = recordHubIdOf;
|
|
96
|
+
/**
|
|
97
|
+
* Whether an id is a readable hub id.
|
|
98
|
+
* @param id - Hub id.
|
|
99
|
+
*/
|
|
100
|
+
const isRecordHubId = (id) => id.startsWith(exports.RECORD_HUB_ID_PREFIX);
|
|
101
|
+
exports.isRecordHubId = isRecordHubId;
|
|
102
|
+
/**
|
|
103
|
+
* The readable id of a recorded hub, built from its `hubs` entry; a readable
|
|
104
|
+
* key with no such entry is kept, anything else gives `undefined`.
|
|
105
|
+
* @param hubs - The record's `hubs`.
|
|
106
|
+
* @param hubId - A source's `hubId`.
|
|
107
|
+
*/
|
|
108
|
+
const recordHubKeyIn = (hubs, hubId) => {
|
|
109
|
+
const entry = (0, core_1.isJsonObject)(hubs) && Object.hasOwn(hubs, hubId) ? hubs[hubId] : undefined;
|
|
110
|
+
if ((0, core_1.isJsonObject)(entry) && typeof entry.type === 'string' && typeof entry.location === 'string') {
|
|
111
|
+
return (0, exports.recordHubIdOf)({
|
|
112
|
+
type: entry.type,
|
|
113
|
+
location: entry.location,
|
|
114
|
+
...(typeof entry.ref === 'string' ? { ref: entry.ref } : {}),
|
|
115
|
+
...(typeof entry.configFile === 'string' ? { configFile: entry.configFile } : {})
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return (0, exports.isRecordHubId)(hubId) ? hubId : undefined;
|
|
119
|
+
};
|
|
120
|
+
exports.recordHubKeyIn = recordHubKeyIn;
|
|
121
|
+
// The current readable id for a key of the earlier form, which always had `#<ref>:<path>`
|
|
122
|
+
// and kept a GitHub hub's `owner/repo` without a host; any other key is kept.
|
|
123
|
+
const currentSourceIdOf = (key, source) => {
|
|
124
|
+
if (!(0, core_1.isJsonObject)(source) || typeof source.type !== 'string' || typeof source.url !== 'string') {
|
|
125
|
+
return key;
|
|
126
|
+
}
|
|
127
|
+
const fields = source;
|
|
128
|
+
const earlier = `${exports.RECORD_SOURCE_ID_PREFIX}${fields.type}:${locationOf(fields.url)}#${fields.branch ?? ''}:${trimSlashes(fields.collectionsPath ?? fields.indexFile ?? '')}`;
|
|
129
|
+
return key === earlier ? (0, exports.recordSourceIdOf)(fields) : key;
|
|
130
|
+
};
|
|
131
|
+
const currentHubIdOf = (key, hub) => {
|
|
132
|
+
if (!(0, core_1.isJsonObject)(hub) || typeof hub.type !== 'string' || typeof hub.location !== 'string') {
|
|
133
|
+
return key;
|
|
134
|
+
}
|
|
135
|
+
const ref = typeof hub.ref === 'string' ? hub.ref : '';
|
|
136
|
+
const configFile = typeof hub.configFile === 'string' ? hub.configFile : '';
|
|
137
|
+
const earlier = `${exports.RECORD_HUB_ID_PREFIX}${hub.type}:${locationOf(hub.location)}#${ref}:${trimSlashes(configFile)}`;
|
|
138
|
+
return key === earlier ? (0, exports.recordHubKeyIn)({ [key]: hub }, key) ?? key : key;
|
|
139
|
+
};
|
|
140
|
+
const nullObject = () => Object.create(null);
|
|
141
|
+
// Of two entries for the same key and tool, the later install wins.
|
|
142
|
+
const later = (current, candidate) => current === undefined || Date.parse(candidate.installedAt) >= Date.parse(current.installedAt) ? candidate : current;
|
|
143
|
+
/**
|
|
144
|
+
* The record as stored on disk: readable source and hub ids, `<sourceId>/<name>` bundle keys.
|
|
145
|
+
* @param record - In-memory record; left unchanged.
|
|
146
|
+
*/
|
|
147
|
+
const toRecordFile = (record) => {
|
|
148
|
+
const { bundles, sources, ...rest } = record;
|
|
149
|
+
const file = Object.assign(nullObject(), rest);
|
|
150
|
+
// A hub under its readable id is the current copy; an older id of the same hub only fills a gap.
|
|
151
|
+
const hubIdOf = new Map();
|
|
152
|
+
if ((0, core_1.isJsonObject)(rest.hubs)) {
|
|
153
|
+
const hubs = nullObject();
|
|
154
|
+
const orderedHubs = Object.entries(rest.hubs).toSorted(([left], [right]) => Number((0, exports.isRecordHubId)(right)) - Number((0, exports.isRecordHubId)(left)));
|
|
155
|
+
for (const [key, hub] of orderedHubs) {
|
|
156
|
+
const id = (0, exports.isRecordHubId)(key) ? key : (0, exports.recordHubKeyIn)(rest.hubs, key) ?? key;
|
|
157
|
+
hubIdOf.set(key, id);
|
|
158
|
+
if (!Object.hasOwn(hubs, id)) {
|
|
159
|
+
hubs[id] = (0, core_1.isJsonObject)(hub) ? Object.assign(nullObject(), hub) : hub;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
file.hubs = hubs;
|
|
163
|
+
}
|
|
164
|
+
const idOf = new Map();
|
|
165
|
+
file.sources = nullObject();
|
|
166
|
+
// A source under its readable id is the current copy; an older id of the same source only fills a gap.
|
|
167
|
+
const current = new Set();
|
|
168
|
+
const ordered = Object.entries(sources).toSorted(([left], [right]) => Number((0, exports.isRecordSourceId)(right)) - Number((0, exports.isRecordSourceId)(left)));
|
|
169
|
+
for (const [key, source] of ordered) {
|
|
170
|
+
const id = (0, exports.isRecordSourceId)(key) ? key : (0, exports.recordSourceIdOf)(source);
|
|
171
|
+
idOf.set(key, id);
|
|
172
|
+
const kept = Object.hasOwn(file.sources, id) ? file.sources[id] : undefined;
|
|
173
|
+
// Of two older ids of one source, the copy that names its hub.
|
|
174
|
+
if (kept === undefined || (!current.has(id) && kept.hubId === undefined && source.hubId !== undefined)) {
|
|
175
|
+
const copy = Object.assign(nullObject(), source);
|
|
176
|
+
if (copy.hubId !== undefined && hubIdOf.has(copy.hubId)) {
|
|
177
|
+
copy.hubId = hubIdOf.get(copy.hubId);
|
|
178
|
+
}
|
|
179
|
+
file.sources[id] = copy;
|
|
180
|
+
}
|
|
181
|
+
if ((0, exports.isRecordSourceId)(key)) {
|
|
182
|
+
current.add(id);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
file.bundles = nullObject();
|
|
186
|
+
for (const [bundleId, bundle] of Object.entries(bundles)) {
|
|
187
|
+
const { tools, name: recordedName, ...extra } = bundle;
|
|
188
|
+
for (const [tool, entry] of Object.entries(tools)) {
|
|
189
|
+
const sourceId = idOf.get(entry.sourceId) ?? entry.sourceId;
|
|
190
|
+
const name = typeof recordedName === 'string' && recordedName !== '' ? recordedName : (0, exports.recordBundleNameOf)(bundleId, entry.version);
|
|
191
|
+
const key = (0, exports.recordBundleKeyOf)(sourceId, name);
|
|
192
|
+
if (!Object.hasOwn(file.bundles, key)) {
|
|
193
|
+
file.bundles[key] = Object.assign(nullObject(), extra, { name, tools: nullObject() });
|
|
194
|
+
}
|
|
195
|
+
const { sourceId: _sourceId, ...fields } = entry;
|
|
196
|
+
const stored = Object.assign(nullObject(), fields);
|
|
197
|
+
if (bundleId !== name) {
|
|
198
|
+
stored.bundleId = bundleId;
|
|
199
|
+
}
|
|
200
|
+
const target = file.bundles[key].tools;
|
|
201
|
+
target[tool] = later(Object.hasOwn(target, tool) ? target[tool] : undefined, stored);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return file;
|
|
205
|
+
};
|
|
206
|
+
exports.toRecordFile = toRecordFile;
|
|
207
|
+
/**
|
|
208
|
+
* The record the services work on, from the record as stored on disk.
|
|
209
|
+
* @param file - Record read from disk and checked against the schema; left unchanged.
|
|
210
|
+
*/
|
|
211
|
+
const fromRecordFile = (file) => {
|
|
212
|
+
const { bundles, ...rest } = file;
|
|
213
|
+
const record = Object.assign(nullObject(), rest);
|
|
214
|
+
// Readable hub and source ids of an earlier form are built again from their fields.
|
|
215
|
+
const hubIdOf = new Map();
|
|
216
|
+
if ((0, core_1.isJsonObject)(rest.hubs)) {
|
|
217
|
+
const hubs = nullObject();
|
|
218
|
+
for (const [key, hub] of Object.entries(rest.hubs)) {
|
|
219
|
+
const id = currentHubIdOf(key, hub);
|
|
220
|
+
hubIdOf.set(key, id);
|
|
221
|
+
if (!Object.hasOwn(hubs, id) || id === key) {
|
|
222
|
+
hubs[id] = hub;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
record.hubs = hubs;
|
|
226
|
+
}
|
|
227
|
+
const sourceIdOf = new Map();
|
|
228
|
+
if ((0, core_1.isJsonObject)(rest.sources)) {
|
|
229
|
+
record.sources = nullObject();
|
|
230
|
+
for (const [key, source] of Object.entries(rest.sources)) {
|
|
231
|
+
const id = currentSourceIdOf(key, source);
|
|
232
|
+
sourceIdOf.set(key, id);
|
|
233
|
+
if (!Object.hasOwn(record.sources, id) || id === key) {
|
|
234
|
+
const copy = Object.assign(nullObject(), source);
|
|
235
|
+
if (copy.hubId !== undefined && hubIdOf.has(copy.hubId)) {
|
|
236
|
+
copy.hubId = hubIdOf.get(copy.hubId);
|
|
237
|
+
}
|
|
238
|
+
record.sources[id] = copy;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
record.bundles = nullObject();
|
|
243
|
+
for (const [key, bundle] of Object.entries(bundles)) {
|
|
244
|
+
const slash = key.lastIndexOf('/');
|
|
245
|
+
const keyed = (0, exports.isRecordSourceId)(key) && slash > 0;
|
|
246
|
+
if (!(0, core_1.isJsonObject)(bundle.tools)) {
|
|
247
|
+
// Not a record bundle (another format): kept as it is.
|
|
248
|
+
record.bundles[key] = bundle;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
const { tools, ...extra } = bundle;
|
|
252
|
+
for (const [tool, stored] of Object.entries(tools)) {
|
|
253
|
+
const entry = Object.assign(nullObject(), stored);
|
|
254
|
+
// Written by earlier builds; derived from the key, so it is dropped.
|
|
255
|
+
delete entry.installationId;
|
|
256
|
+
let bundleId = key;
|
|
257
|
+
if (keyed) {
|
|
258
|
+
const recordedId = key.slice(0, slash);
|
|
259
|
+
entry.sourceId = sourceIdOf.get(recordedId) ?? recordedId;
|
|
260
|
+
bundleId = typeof stored.bundleId === 'string' && stored.bundleId !== '' ? stored.bundleId : key.slice(slash + 1);
|
|
261
|
+
delete entry.bundleId;
|
|
262
|
+
}
|
|
263
|
+
else if (typeof entry.sourceId === 'string' && sourceIdOf.has(entry.sourceId)) {
|
|
264
|
+
entry.sourceId = sourceIdOf.get(entry.sourceId);
|
|
265
|
+
}
|
|
266
|
+
if (!Object.hasOwn(record.bundles, bundleId)) {
|
|
267
|
+
record.bundles[bundleId] = Object.assign(nullObject(), extra, { tools: nullObject() });
|
|
268
|
+
}
|
|
269
|
+
const sameKey = record.bundles[bundleId].tools;
|
|
270
|
+
if (keyed && Object.hasOwn(sameKey, tool) && sameKey[tool].sourceId !== entry.sourceId) {
|
|
271
|
+
// Another source's entry of the same bundle and tool, as a merge of two branches leaves it:
|
|
272
|
+
// kept under its own key, so neither entry nor its files are dropped.
|
|
273
|
+
record.bundles[key] ??= Object.assign(nullObject(), extra, { name: key.slice(slash + 1), tools: nullObject() });
|
|
274
|
+
record.bundles[key].tools[tool] = entry;
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
// A name the bundle id gives anyway is not kept, so a save derives it again.
|
|
278
|
+
if (record.bundles[bundleId].name === (0, exports.recordBundleNameOf)(bundleId, entry.version)) {
|
|
279
|
+
delete record.bundles[bundleId].name;
|
|
280
|
+
}
|
|
281
|
+
const target = record.bundles[bundleId].tools;
|
|
282
|
+
target[tool] = later(Object.hasOwn(target, tool) ? target[tool] : undefined, entry);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return record;
|
|
286
|
+
};
|
|
287
|
+
exports.fromRecordFile = fromRecordFile;
|
|
288
|
+
//# sourceMappingURL=record-file-shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-file-shape.js","sourceRoot":"","sources":["../../src/records/record-file-shape.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,kDAMiC;AACjC,uDAE2B;AAE3B,sCAAsC;AACzB,QAAA,uBAAuB,GAAG,MAAM,CAAC;AAE9C,mCAAmC;AACtB,QAAA,oBAAoB,GAAG,MAAM,CAAC;AAmB3C,+CAA+C;AAC/C,MAAM,WAAW,GAAG,8BAA8B,CAAC;AAEnD,MAAM,WAAW,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEtH,+GAA+G;AAC/G,M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+
* Shared hub references for install records. Only a hub another machine can
|
|
3
|
+
* import is recorded: never the built-in local hub or a hub on a local path,
|
|
4
|
+
* and never a credential.
|
|
5
|
+
* @module records/record-hub
|
|
6
|
+
*/
|
|
7
|
+
import { type RecordHub } from '@ai-primitives-hub/core';
|
|
8
|
+
/** A hub to record, with its key in `hubs`. */
|
|
9
|
+
export interface RecordHubInput extends RecordHub {
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
/** The hub reference fields read; credential fields are never copied. */
|
|
13
|
+
export interface HubReferenceFields {
|
|
14
|
+
type: string;
|
|
15
|
+
location: string;
|
|
16
|
+
ref?: string;
|
|
17
|
+
configFile?: string;
|
|
18
|
+
}
|
|
19
|
+
/** A configured hub, as `HubManager.listHubs` lists it. */
|
|
20
|
+
export interface ConfiguredHub {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
reference: HubReferenceFields;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The record entry of a hub, or `undefined` when the hub is not shareable.
|
|
27
|
+
* @param id - Hub id.
|
|
28
|
+
* @param name - Hub display name; the id when empty.
|
|
29
|
+
* @param reference - The hub's import reference.
|
|
30
|
+
*/
|
|
31
|
+
export declare const toRecordHub: (id: string, name: string, reference: HubReferenceFields) => RecordHubInput | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The shareable hubs among the configured ones, by id.
|
|
34
|
+
* @param hubs - Configured hubs.
|
|
35
|
+
*/
|
|
36
|
+
export declare const recordHubsOf: (hubs: readonly ConfiguredHub[]) => Map<string, RecordHubInput>;
|
|
37
|
+
/**
|
|
38
|
+
* The `hubs` entry of a record hub: its fields without the id, prototype-free.
|
|
39
|
+
* @param hub - Hub to record.
|
|
40
|
+
*/
|
|
41
|
+
export declare const hubEntryOf: (hub: RecordHubInput) => RecordHub;
|
|
42
|
+
//# sourceMappingURL=record-hub.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-hub.d.ts","sourceRoot":"","sources":["../../src/records/record-hub.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAC;AAKjC,+CAA+C;AAC/C,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,yEAAyE;AACzE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,kBAAkB,CAAC;CAC/B;AAwBD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,EAAE,MAAM,MAAM,EAAE,WAAW,kBAAkB,KAAG,cAAc,GAAG,SAkBtG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,SAAS,aAAa,EAAE,KAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CASvF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,cAAc,KAAG,SAQhD,CAAC"}
|