@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,140 @@
|
|
|
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.resolveDeleteTarget = exports.confinePath = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* Filesystem confinement for recorded paths: symlinked parent folders must not
|
|
39
|
+
* leave the root or enter `.git`. The leaf is never followed, since the record
|
|
40
|
+
* owns a link, not its target.
|
|
41
|
+
* @module records/confine-path
|
|
42
|
+
*/
|
|
43
|
+
const path = __importStar(require("node:path"));
|
|
44
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
45
|
+
const realRootOf = async (fs, root, file) => {
|
|
46
|
+
try {
|
|
47
|
+
return await fs.realpath(root);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw (0, core_1.recordError)('RECORD.PATH_OUTSIDE_ROOT', { file, detail: 'the root folder does not resolve', cause: error });
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const resolveNearestAncestor = async (fs, root, segments) => {
|
|
54
|
+
let count = segments.length;
|
|
55
|
+
while (count > 0 && (await fs.lstat(path.join(root, ...segments.slice(0, count)))) === undefined) {
|
|
56
|
+
count -= 1;
|
|
57
|
+
}
|
|
58
|
+
return { realAncestor: await fs.realpath(path.join(root, ...segments.slice(0, count))), rest: segments.slice(count) };
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Check a recorded path's text, then its resolved folders against the disk.
|
|
62
|
+
* @param fs - Filesystem port.
|
|
63
|
+
* @param root - Absolute level root.
|
|
64
|
+
* @param recordedPath - Path as recorded.
|
|
65
|
+
* @param file - Record file to name in the error.
|
|
66
|
+
* @returns The path with forward slashes, relative to the root.
|
|
67
|
+
* @throws {RegistryError} `RECORD.PATH_OUTSIDE_ROOT` when the path is refused.
|
|
68
|
+
*/
|
|
69
|
+
const confinePath = async (fs, root, recordedPath, file) => {
|
|
70
|
+
const relative = (0, core_1.checkRecordedPath)(recordedPath, file);
|
|
71
|
+
const realRoot = await realRootOf(fs, root, file);
|
|
72
|
+
const segments = relative.split('/');
|
|
73
|
+
const leaf = segments.pop();
|
|
74
|
+
let resolved;
|
|
75
|
+
try {
|
|
76
|
+
resolved = await resolveNearestAncestor(fs, root, segments);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
throw (0, core_1.recordError)('RECORD.PATH_OUTSIDE_ROOT', {
|
|
80
|
+
file,
|
|
81
|
+
detail: `a folder of ${JSON.stringify(relative)} does not resolve`,
|
|
82
|
+
cause: error
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const candidate = path.join(resolved.realAncestor, ...resolved.rest, leaf);
|
|
86
|
+
const inside = (0, core_1.relativeInside)(realRoot, candidate);
|
|
87
|
+
const problem = inside === undefined ? 'resolves outside the root' : (0, core_1.findRecordedPathProblem)(inside);
|
|
88
|
+
if (problem !== undefined) {
|
|
89
|
+
throw (0, core_1.recordError)('RECORD.PATH_OUTSIDE_ROOT', {
|
|
90
|
+
file,
|
|
91
|
+
detail: `${JSON.stringify(relative)} ${inside === undefined ? problem : `resolves to a path with a ${problem}`}`
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return relative;
|
|
95
|
+
};
|
|
96
|
+
exports.confinePath = confinePath;
|
|
97
|
+
/**
|
|
98
|
+
* Check a recorded path just before deleting it; never throws for a refused path.
|
|
99
|
+
* @param fs - Filesystem port.
|
|
100
|
+
* @param root - Absolute level root.
|
|
101
|
+
* @param recordedPath - Path as recorded.
|
|
102
|
+
*/
|
|
103
|
+
const resolveDeleteTarget = async (fs, root, recordedPath) => {
|
|
104
|
+
const textProblem = (0, core_1.findRecordedPathProblem)(recordedPath);
|
|
105
|
+
if (textProblem !== undefined) {
|
|
106
|
+
return { status: 'skip', reason: textProblem };
|
|
107
|
+
}
|
|
108
|
+
const segments = recordedPath.split(/[/\\]/);
|
|
109
|
+
const leaf = segments.pop();
|
|
110
|
+
let realRoot;
|
|
111
|
+
let realParent;
|
|
112
|
+
try {
|
|
113
|
+
realRoot = await fs.realpath(root);
|
|
114
|
+
realParent = await fs.realpath(path.join(root, ...segments));
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return (await fs.lstat(path.join(root, ...segments))) === undefined
|
|
118
|
+
? { status: 'missing' }
|
|
119
|
+
: { status: 'skip', reason: 'its folder does not resolve' };
|
|
120
|
+
}
|
|
121
|
+
const absolute = path.join(realParent, leaf);
|
|
122
|
+
const inside = (0, core_1.relativeInside)(realRoot, absolute);
|
|
123
|
+
if (inside === undefined) {
|
|
124
|
+
return { status: 'skip', reason: 'its folder resolves outside the root' };
|
|
125
|
+
}
|
|
126
|
+
const resolvedProblem = (0, core_1.findRecordedPathProblem)(inside);
|
|
127
|
+
if (resolvedProblem !== undefined) {
|
|
128
|
+
return { status: 'skip', reason: `its folder resolves to a path with a ${resolvedProblem}` };
|
|
129
|
+
}
|
|
130
|
+
const stat = await fs.lstat(absolute);
|
|
131
|
+
if (stat === undefined) {
|
|
132
|
+
return { status: 'missing' };
|
|
133
|
+
}
|
|
134
|
+
if (stat.kind !== 'file' && stat.kind !== 'symlink') {
|
|
135
|
+
return { status: 'skip', reason: stat.kind === 'directory' ? 'it is a folder' : 'it is not a regular file' };
|
|
136
|
+
}
|
|
137
|
+
return { status: 'delete', absolute };
|
|
138
|
+
};
|
|
139
|
+
exports.resolveDeleteTarget = resolveDeleteTarget;
|
|
140
|
+
//# sourceMappingURL=confine-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confine-path.js","sourceRoot":"","sources":["../../src/records/confine-path.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,gDAAkC;AAClC,kDAMiC;AAWjC,MAAM,UAAU,GAAG,KAAK,EAAE,EAAY,EAAE,IAAY,EAAE,IAAwB,EAAmB,EAAE;IACjG,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAA,kBAAW,EAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,kCAAkC,EAA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EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAC/B,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,0BAA0B,EAAE,CAAC;IAC/G,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACxC,CAAC,CAAC;AAlCW,QAAA,mBAAmB,uBAkC9B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type RecordFs } from '@ai-primitives-hub/core';
|
|
2
|
+
/** Outcome of {@link ensureExcluded}. */
|
|
3
|
+
export interface ExcludeResult {
|
|
4
|
+
/** `added` wrote the entry, `present` found it already there, `skipped` wrote nothing. */
|
|
5
|
+
status: 'added' | 'present' | 'skipped';
|
|
6
|
+
/** `info/exclude` path used, when a git directory was found. */
|
|
7
|
+
excludePath?: string;
|
|
8
|
+
/** Why nothing was written, for the caller to log (status `skipped` only). */
|
|
9
|
+
warning?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Nearest folder from `start` upward that holds `.git`, or `undefined`.
|
|
13
|
+
* @param fs - Filesystem port.
|
|
14
|
+
* @param start - Folder to start from.
|
|
15
|
+
*/
|
|
16
|
+
export declare const findGitRoot: (fs: RecordFs, start: string) => Promise<string | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* Repository root for a start folder: the git root, or the start folder itself when there is none.
|
|
19
|
+
* @param fs - Filesystem port.
|
|
20
|
+
* @param start - Folder to start from.
|
|
21
|
+
*/
|
|
22
|
+
export declare const resolveRepositoryRoot: (fs: RecordFs, start: string) => Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Common git directory for a repository root, or a warning when none can be trusted.
|
|
25
|
+
* @param fs - Filesystem port.
|
|
26
|
+
* @param root - Repository root.
|
|
27
|
+
*/
|
|
28
|
+
export declare const resolveExcludeDir: (fs: RecordFs, root: string) => Promise<{
|
|
29
|
+
dir: string;
|
|
30
|
+
} | {
|
|
31
|
+
warning: string;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* The `info/exclude` file for a repository root, in the common git directory, or a warning.
|
|
35
|
+
* @param fs - Filesystem port.
|
|
36
|
+
* @param root - Repository root.
|
|
37
|
+
*/
|
|
38
|
+
export declare const resolveExcludeFile: (fs: RecordFs, root: string) => Promise<{
|
|
39
|
+
file: string;
|
|
40
|
+
} | {
|
|
41
|
+
warning: string;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Add `name` to the hub's section of `info/exclude`. Never throws; failures come back as a warning.
|
|
45
|
+
* @param fs - Filesystem port.
|
|
46
|
+
* @param root - Repository root.
|
|
47
|
+
* @param name - Root-relative file name.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ensureExcluded: (fs: RecordFs, root: string, name: string) => Promise<ExcludeResult>;
|
|
50
|
+
/** Outcome of {@link removeExcluded}. */
|
|
51
|
+
export interface RemoveExcludedResult {
|
|
52
|
+
/** `removed` took the entry out, `absent` found nothing to remove, `skipped` changed nothing because of a problem. */
|
|
53
|
+
status: 'removed' | 'absent' | 'skipped';
|
|
54
|
+
/** `info/exclude` path used, when a git directory was found. */
|
|
55
|
+
excludePath?: string;
|
|
56
|
+
/** Why nothing was changed, for the caller to log (status `skipped` only). */
|
|
57
|
+
warning?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Remove `name` from the hub's section of `info/exclude`. Never throws; failures come back as a warning.
|
|
61
|
+
* @param fs - Filesystem port.
|
|
62
|
+
* @param root - Repository root.
|
|
63
|
+
* @param name - Root-relative file name.
|
|
64
|
+
*/
|
|
65
|
+
export declare const removeExcluded: (fs: RecordFs, root: string, name: string) => Promise<RemoveExcludedResult>;
|
|
66
|
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E,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzC,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAU,IAAI,QAAQ,EAAE,MAAM,MAAM,EAAE,MAAM,MAAM,KAAG,OAAO,CAAC,oBAAoB,CA4B3G,CAAC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
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.removeExcluded = exports.ensureExcluded = exports.resolveExcludeFile = exports.resolveExcludeDir = exports.resolveRepositoryRoot = exports.findGitRoot = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* Repository root detection and the local-only `info/exclude` entry, through
|
|
39
|
+
* `RecordFs` only (no `git` process). A `gitdir:` target is trusted only when
|
|
40
|
+
* it holds `HEAD` or `commondir`, so a crafted `.git` file cannot redirect writes.
|
|
41
|
+
* @module records/git-root
|
|
42
|
+
*/
|
|
43
|
+
const path = __importStar(require("node:path"));
|
|
44
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
45
|
+
const find_ancestor_file_1 = require("../diagnostics/find-ancestor-file");
|
|
46
|
+
const atomic_write_1 = require("./atomic-write");
|
|
47
|
+
/** Largest `.git` file, `commondir` file or `info/exclude` file read, in bytes. */
|
|
48
|
+
const SMALL_FILE_MAX_BYTES = 1024 * 1024;
|
|
49
|
+
/**
|
|
50
|
+
* Nearest folder from `start` upward that holds `.git`, or `undefined`.
|
|
51
|
+
* @param fs - Filesystem port.
|
|
52
|
+
* @param start - Folder to start from.
|
|
53
|
+
*/
|
|
54
|
+
const findGitRoot = async (fs, start) => {
|
|
55
|
+
const dotGit = await (0, find_ancestor_file_1.findAncestorFile)(fs, path.resolve(start), ['.git']);
|
|
56
|
+
return dotGit === undefined ? undefined : path.dirname(dotGit);
|
|
57
|
+
};
|
|
58
|
+
exports.findGitRoot = findGitRoot;
|
|
59
|
+
/**
|
|
60
|
+
* Repository root for a start folder: the git root, or the start folder itself when there is none.
|
|
61
|
+
* @param fs - Filesystem port.
|
|
62
|
+
* @param start - Folder to start from.
|
|
63
|
+
*/
|
|
64
|
+
const resolveRepositoryRoot = async (fs, start) => (await (0, exports.findGitRoot)(fs, start)) ?? path.resolve(start);
|
|
65
|
+
exports.resolveRepositoryRoot = resolveRepositoryRoot;
|
|
66
|
+
const readSmallText = async (fs, file) => {
|
|
67
|
+
const bytes = await fs.readCapped(file, SMALL_FILE_MAX_BYTES + 1);
|
|
68
|
+
if (bytes.byteLength > SMALL_FILE_MAX_BYTES) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
return new TextDecoder('utf-8').decode(bytes);
|
|
72
|
+
};
|
|
73
|
+
const followedKind = async (fs, file) => {
|
|
74
|
+
const stat = await fs.lstat(file);
|
|
75
|
+
if (stat?.kind !== 'symlink') {
|
|
76
|
+
return stat?.kind;
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
return (await fs.lstat(await fs.realpath(file)))?.kind;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const gitDirFromFile = async (fs, dotGit) => {
|
|
86
|
+
const text = await readSmallText(fs, dotGit);
|
|
87
|
+
const match = text === undefined ? null : /^gitdir:[ \t]*(.+?)[ \t]*$/m.exec(text);
|
|
88
|
+
return match === null ? undefined : path.resolve(path.dirname(dotGit), match[1]);
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Common git directory for a repository root, or a warning when none can be trusted.
|
|
92
|
+
* @param fs - Filesystem port.
|
|
93
|
+
* @param root - Repository root.
|
|
94
|
+
*/
|
|
95
|
+
const resolveExcludeDir = async (fs, root) => {
|
|
96
|
+
const dotGit = path.join(root, '.git');
|
|
97
|
+
const kind = await followedKind(fs, dotGit);
|
|
98
|
+
let gitDir;
|
|
99
|
+
if (kind === 'directory') {
|
|
100
|
+
gitDir = dotGit;
|
|
101
|
+
}
|
|
102
|
+
else if (kind === 'file') {
|
|
103
|
+
gitDir = await gitDirFromFile(fs, dotGit);
|
|
104
|
+
if (gitDir === undefined) {
|
|
105
|
+
return { warning: `${dotGit} has no "gitdir:" line` };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
return { warning: `no git directory at ${dotGit}` };
|
|
110
|
+
}
|
|
111
|
+
const commondirFile = path.join(gitDir, 'commondir');
|
|
112
|
+
const hasCommondir = (await followedKind(fs, commondirFile)) === 'file';
|
|
113
|
+
if (!hasCommondir && !(await fs.exists(path.join(gitDir, 'HEAD')))) {
|
|
114
|
+
return { warning: `${gitDir} does not look like a git directory (no HEAD or commondir)` };
|
|
115
|
+
}
|
|
116
|
+
if (!hasCommondir) {
|
|
117
|
+
return { dir: gitDir };
|
|
118
|
+
}
|
|
119
|
+
const commondir = (await readSmallText(fs, commondirFile))?.trim();
|
|
120
|
+
if (!commondir) {
|
|
121
|
+
return { warning: `${commondirFile} is empty or too large` };
|
|
122
|
+
}
|
|
123
|
+
return { dir: path.resolve(gitDir, commondir) };
|
|
124
|
+
};
|
|
125
|
+
exports.resolveExcludeDir = resolveExcludeDir;
|
|
126
|
+
/**
|
|
127
|
+
* The `info/exclude` file for a repository root, in the common git directory, or a warning.
|
|
128
|
+
* @param fs - Filesystem port.
|
|
129
|
+
* @param root - Repository root.
|
|
130
|
+
*/
|
|
131
|
+
const resolveExcludeFile = async (fs, root) => {
|
|
132
|
+
const resolved = await (0, exports.resolveExcludeDir)(fs, root);
|
|
133
|
+
return 'warning' in resolved ? resolved : { file: path.join(resolved.dir, 'info', 'exclude') };
|
|
134
|
+
};
|
|
135
|
+
exports.resolveExcludeFile = resolveExcludeFile;
|
|
136
|
+
/**
|
|
137
|
+
* Add `name` to the hub's section of `info/exclude`. Never throws; failures come back as a warning.
|
|
138
|
+
* @param fs - Filesystem port.
|
|
139
|
+
* @param root - Repository root.
|
|
140
|
+
* @param name - Root-relative file name.
|
|
141
|
+
*/
|
|
142
|
+
const ensureExcluded = async (fs, root, name) => {
|
|
143
|
+
let excludePath;
|
|
144
|
+
try {
|
|
145
|
+
const resolved = await (0, exports.resolveExcludeFile)(fs, root);
|
|
146
|
+
if ('warning' in resolved) {
|
|
147
|
+
return { status: 'skipped', warning: `${name} was not added to info/exclude: ${resolved.warning}` };
|
|
148
|
+
}
|
|
149
|
+
excludePath = resolved.file;
|
|
150
|
+
const existing = (await fs.exists(excludePath)) ? await readSmallText(fs, excludePath) : '';
|
|
151
|
+
if (existing === undefined) {
|
|
152
|
+
return { status: 'skipped', excludePath, warning: `${name} was not added to ${excludePath}: the file is too large` };
|
|
153
|
+
}
|
|
154
|
+
const updated = (0, core_1.addExcludeEntries)(existing, [name]);
|
|
155
|
+
if (updated === undefined) {
|
|
156
|
+
return { status: 'present', excludePath };
|
|
157
|
+
}
|
|
158
|
+
await fs.mkdir(path.dirname(excludePath), { recursive: true });
|
|
159
|
+
await (0, atomic_write_1.writeFileAtomically)(fs, excludePath, updated);
|
|
160
|
+
return { status: 'added', excludePath };
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
return {
|
|
164
|
+
status: 'skipped',
|
|
165
|
+
excludePath,
|
|
166
|
+
warning: `${name} was not added to info/exclude: ${error instanceof Error ? error.message : String(error)}`
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
exports.ensureExcluded = ensureExcluded;
|
|
171
|
+
/**
|
|
172
|
+
* Remove `name` from the hub's section of `info/exclude`. Never throws; failures come back as a warning.
|
|
173
|
+
* @param fs - Filesystem port.
|
|
174
|
+
* @param root - Repository root.
|
|
175
|
+
* @param name - Root-relative file name.
|
|
176
|
+
*/
|
|
177
|
+
const removeExcluded = async (fs, root, name) => {
|
|
178
|
+
let excludePath;
|
|
179
|
+
try {
|
|
180
|
+
const resolved = await (0, exports.resolveExcludeFile)(fs, root);
|
|
181
|
+
if ('warning' in resolved) {
|
|
182
|
+
return { status: 'skipped', warning: `${name} was not removed from info/exclude: ${resolved.warning}` };
|
|
183
|
+
}
|
|
184
|
+
excludePath = resolved.file;
|
|
185
|
+
if (!(await fs.exists(excludePath))) {
|
|
186
|
+
return { status: 'absent', excludePath };
|
|
187
|
+
}
|
|
188
|
+
const existing = await readSmallText(fs, excludePath);
|
|
189
|
+
if (existing === undefined) {
|
|
190
|
+
return { status: 'skipped', excludePath, warning: `${name} was not removed from ${excludePath}: the file is too large` };
|
|
191
|
+
}
|
|
192
|
+
const updated = (0, core_1.removeExcludeEntries)(existing, [name]);
|
|
193
|
+
if (updated === undefined) {
|
|
194
|
+
return { status: 'absent', excludePath };
|
|
195
|
+
}
|
|
196
|
+
await (0, atomic_write_1.writeFileAtomically)(fs, excludePath, updated);
|
|
197
|
+
return { status: 'removed', excludePath };
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
return {
|
|
201
|
+
status: 'skipped',
|
|
202
|
+
excludePath,
|
|
203
|
+
warning: `${name} was not removed from info/exclude: ${error instanceof Error ? error.message : String(error)}`
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
exports.removeExcluded = removeExcluded;
|
|
208
|
+
//# sourceMappingURL=git-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-root.js","sourceRoot":"","sources":["../../src/records/git-root.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,gDAAkC;AAClC,kDAIiC;AACjC,0EAE2C;AAC3C,iDAEwB;AAExB,mFAAmF;AACnF,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAAC;AAYzC;;;;GAIG;AACI,MAAM,WAAW,GAAG,KAAK,EAAE,EAAY,EAAE,KAAa,EAA+B,EAAE;IAC5F,MAAM,MAAM,GAAG,MAAM,IAAA,qCAAgB,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACzE,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,C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AAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,WAAW;YACX,OAAO,EAAE,GAAG,IAAI,uCAAuC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;SAChH,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AA5BW,QAAA,cAAc,kBA4BzB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install-record barrel export: path confinement, git root and `info/exclude`,
|
|
3
|
+
* canonical serialization, the record store and service, record selection,
|
|
4
|
+
* migration, tool-to-target mapping, the source trust gate, the legacy lockfile shapes,
|
|
5
|
+
* locally modified files and the writer group for the shared-folder sync.
|
|
6
|
+
* @module records
|
|
7
|
+
*/
|
|
8
|
+
export * from './atomic-write';
|
|
9
|
+
export * from './confine-path';
|
|
10
|
+
export * from './git-root';
|
|
11
|
+
export * from './install-record-service';
|
|
12
|
+
export * from './install-record-services';
|
|
13
|
+
export * from './legacy-shapes';
|
|
14
|
+
export * from './map-tool-to-target';
|
|
15
|
+
export * from './mcp-servers';
|
|
16
|
+
export * from './modified-files';
|
|
17
|
+
export * from './plan-record-entries';
|
|
18
|
+
export * from './record-file-shape';
|
|
19
|
+
export * from './record-hub';
|
|
20
|
+
export * from './record-identity';
|
|
21
|
+
export * from './record-migration';
|
|
22
|
+
export * from './record-store';
|
|
23
|
+
export * from './resolve-record-source';
|
|
24
|
+
export * from './sanitize-source';
|
|
25
|
+
export * from './select-record';
|
|
26
|
+
export * from './serialize-record';
|
|
27
|
+
export * from './to-record-source';
|
|
28
|
+
export * from './user-home';
|
|
29
|
+
export * from './writer-group';
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/records/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Install-record barrel export: path confinement, git root and `info/exclude`,
|
|
19
|
+
* canonical serialization, the record store and service, record selection,
|
|
20
|
+
* migration, tool-to-target mapping, the source trust gate, the legacy lockfile shapes,
|
|
21
|
+
* locally modified files and the writer group for the shared-folder sync.
|
|
22
|
+
* @module records
|
|
23
|
+
*/
|
|
24
|
+
__exportStar(require("./atomic-write"), exports);
|
|
25
|
+
__exportStar(require("./confine-path"), exports);
|
|
26
|
+
__exportStar(require("./git-root"), exports);
|
|
27
|
+
__exportStar(require("./install-record-service"), exports);
|
|
28
|
+
__exportStar(require("./install-record-services"), exports);
|
|
29
|
+
__exportStar(require("./legacy-shapes"), exports);
|
|
30
|
+
__exportStar(require("./map-tool-to-target"), exports);
|
|
31
|
+
__exportStar(require("./mcp-servers"), exports);
|
|
32
|
+
__exportStar(require("./modified-files"), exports);
|
|
33
|
+
__exportStar(require("./plan-record-entries"), exports);
|
|
34
|
+
__exportStar(require("./record-file-shape"), exports);
|
|
35
|
+
__exportStar(require("./record-hub"), exports);
|
|
36
|
+
__exportStar(require("./record-identity"), exports);
|
|
37
|
+
__exportStar(require("./record-migration"), exports);
|
|
38
|
+
__exportStar(require("./record-store"), exports);
|
|
39
|
+
__exportStar(require("./resolve-record-source"), exports);
|
|
40
|
+
__exportStar(require("./sanitize-source"), exports);
|
|
41
|
+
__exportStar(require("./select-record"), exports);
|
|
42
|
+
__exportStar(require("./serialize-record"), exports);
|
|
43
|
+
__exportStar(require("./to-record-source"), exports);
|
|
44
|
+
__exportStar(require("./user-home"), exports);
|
|
45
|
+
__exportStar(require("./writer-group"), exports);
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/records/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,iDAA+B;AAC/B,iDAA+B;AAC/B,6CAA2B;AAC3B,2DAAyC;AACzC,4DAA0C;AAC1C,kDAAgC;AAChC,uDAAqC;AACrC,gDAA8B;AAC9B,mDAAiC;AACjC,wDAAsC;AACtC,sDAAoC;AACpC,+CAA6B;AAC7B,oDAAkC;AAClC,qDAAmC;AACnC,iDAA+B;AAC/B,0DAAwC;AACxC,oDAAkC;AAClC,kDAAgC;AAChC,qDAAmC;AACnC,qDAAmC;AACnC,8CAA4B;AAC5B,iDAA+B"}
|