@ai-primitives-hub/app 0.2.0 → 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,291 @@
|
|
|
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.changedGitHubSources = changedGitHubSources;
|
|
37
|
+
exports.validateCollectionGovernance = validateCollectionGovernance;
|
|
38
|
+
/**
|
|
39
|
+
* Collection governance: the established file validator plus the shared policy engine.
|
|
40
|
+
* With `--base-ref`/`--head-ref`, only collections the PR touched are reported. When the PR changes
|
|
41
|
+
* the hub config, every added or modified enabled github source is downloaded and its collections validated.
|
|
42
|
+
* @module app/governance/validate-collection-governance
|
|
43
|
+
*/
|
|
44
|
+
const path = __importStar(require("node:path"));
|
|
45
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
46
|
+
const infra_1 = require("@ai-primitives-hub/infra");
|
|
47
|
+
const governance_1 = require("@ai-primitives-hub/infra/governance");
|
|
48
|
+
const affected_collections_1 = require("../collection/affected-collections");
|
|
49
|
+
const read_collection_1 = require("../collection/read-collection");
|
|
50
|
+
const load_config_1 = require("./load-config");
|
|
51
|
+
const pr_scope_1 = require("./pr-scope");
|
|
52
|
+
/**
|
|
53
|
+
* A finding belongs to a collection when it names the file in its `file` field or message prefix.
|
|
54
|
+
* A duplicate (COL001) is reported on the later file, so it also belongs to the earlier one it names.
|
|
55
|
+
* @param finding
|
|
56
|
+
* @param files
|
|
57
|
+
*/
|
|
58
|
+
const concerns = (finding, files) => (finding.file !== undefined && files.has(finding.file))
|
|
59
|
+
|| [...files].some((file) => finding.message.startsWith(`${file}:`)
|
|
60
|
+
|| (finding.ruleId === 'COL001' && finding.message.replaceAll('\\', '/').endsWith(`(also in ${file})`)));
|
|
61
|
+
/**
|
|
62
|
+
* Validate the collections of one repository on disk, and their releases when requested.
|
|
63
|
+
* @param fs
|
|
64
|
+
* @param repoRoot
|
|
65
|
+
* @param options
|
|
66
|
+
*/
|
|
67
|
+
async function repositoryFindings(fs, repoRoot, options) {
|
|
68
|
+
// A repository without a collections/ directory has no collections, not a read error.
|
|
69
|
+
// Uniqueness (COL001) needs every collection, so the whole set is validated and then narrowed.
|
|
70
|
+
const files = options.collectionFiles?.length
|
|
71
|
+
? options.collectionFiles
|
|
72
|
+
: (await fs.exists(path.join(repoRoot, 'collections')) ? (0, read_collection_1.listCollectionFiles)(repoRoot) : []);
|
|
73
|
+
const result = files.length === 0 ? undefined : (0, read_collection_1.validateAllCollections)(repoRoot, files);
|
|
74
|
+
if (result === undefined) {
|
|
75
|
+
return options.affected === undefined
|
|
76
|
+
? [{ ruleId: 'COL005', severity: 'error', message: 'No collection files found. Supply --collection-file or a non-empty collections/ directory.' }]
|
|
77
|
+
: [];
|
|
78
|
+
}
|
|
79
|
+
const affected = options.affected === undefined ? undefined : new Set([...options.affected].map((file) => file.replaceAll('\\', '/')));
|
|
80
|
+
const all = (0, load_config_1.withDisplayPaths)((0, core_1.collectionGovernanceFindings)(result), repoRoot);
|
|
81
|
+
const findings = affected === undefined
|
|
82
|
+
? all
|
|
83
|
+
: all.filter((finding) => concerns(finding, affected));
|
|
84
|
+
if (options.checkReleases || options.candidates) {
|
|
85
|
+
for (const file of result.fileResults) {
|
|
86
|
+
const collectionFile = file.file.replaceAll('\\', '/');
|
|
87
|
+
if (!file.ok || !file.collection || (affected !== undefined && !affected.has(collectionFile))) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const collection = { id: file.collection.id, name: file.collection.name, sourceId: options.sourceId, repository: options.repository, file: collectionFile };
|
|
91
|
+
options.candidates?.push(collection);
|
|
92
|
+
if (!options.checkReleases) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
let evidence;
|
|
96
|
+
try {
|
|
97
|
+
evidence = options.releaseLookup === undefined
|
|
98
|
+
? { status: 'unverified', message: 'Supply --repository <owner/repo> and a release lookup for publication checks.' }
|
|
99
|
+
: await options.releaseLookup.lookup(collection);
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
evidence = { status: 'unverified' };
|
|
103
|
+
}
|
|
104
|
+
findings.push(...(0, core_1.releaseFindings)(collection, evidence));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return findings;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Changed sources and canonical profile references, with full reference coverage for index edits.
|
|
111
|
+
* @param request
|
|
112
|
+
* @param changes
|
|
113
|
+
*/
|
|
114
|
+
async function changedHubCollections(request, changes) {
|
|
115
|
+
const configPath = path.resolve(request.repoRoot, request.config ?? 'hub-config.yml');
|
|
116
|
+
const relative = path.relative(request.repoRoot, configPath);
|
|
117
|
+
// External trusted configs are not part of this repository's PR history.
|
|
118
|
+
if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
119
|
+
return { sources: [], references: [] };
|
|
120
|
+
}
|
|
121
|
+
const config = relative.replaceAll('\\', '/');
|
|
122
|
+
const indexChanged = request.checkSources === true && changes.files.includes(path.posix.join(path.posix.dirname(config), '.config', 'sources', 'collection-index.yml'));
|
|
123
|
+
if ((!changes.files.includes(config) && !indexChanged) || request.processRunner === undefined) {
|
|
124
|
+
return { sources: [], references: [] };
|
|
125
|
+
}
|
|
126
|
+
const snapshot = await (0, governance_1.readGitHubScope)(request.processRunner, request.repoRoot, config, changes.baseRef, changes.headRef);
|
|
127
|
+
const scope = (0, core_1.computeHubScope)(snapshot.base, snapshot.head);
|
|
128
|
+
const ids = new Set([...scope.sources.added, ...scope.sources.modified]);
|
|
129
|
+
const references = indexChanged
|
|
130
|
+
? (0, core_1.computeHubScope)(snapshot.head, snapshot.head, { sourceIds: [], profileIds: snapshot.head.profiles.map((profile) => profile.id) }).references
|
|
131
|
+
: scope.references;
|
|
132
|
+
return {
|
|
133
|
+
sources: snapshot.head.sources.filter((source) => ids.has(source.id) && source.enabled === true && source.type === 'github'),
|
|
134
|
+
references: (0, core_1.hubCollectionReferences)(snapshot.head, references).map((collection) => ({ ...collection, file: config }))
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Enabled GitHub sources the PR added or modified; retained for SDK consumers.
|
|
139
|
+
* @param request
|
|
140
|
+
* @param changes
|
|
141
|
+
*/
|
|
142
|
+
async function changedGitHubSources(request, changes) {
|
|
143
|
+
return (await changedHubCollections(request, changes)).sources;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Download one hub source and validate its collections. Paths are reported as `<source id>/<file>`.
|
|
147
|
+
* @param fs
|
|
148
|
+
* @param source
|
|
149
|
+
* @param request
|
|
150
|
+
* @param candidates
|
|
151
|
+
*/
|
|
152
|
+
async function sourceCollectionFindings(fs, source, request, candidates) {
|
|
153
|
+
const unreadable = (failure) => [{
|
|
154
|
+
ruleId: 'COL005', severity: 'error', verified: false, file: source.id, subject: { kind: 'source', id: source.id }, problem: failure.reason,
|
|
155
|
+
message: `Could not download source '${source.id}' to validate its collections. Why: ${failure.reason}`, hint: failure.hint
|
|
156
|
+
}];
|
|
157
|
+
if (request.hubSources === undefined) {
|
|
158
|
+
return unreadable({ reason: 'Source download is not configured', hint: 'Run through the CLI, which supplies source access.' });
|
|
159
|
+
}
|
|
160
|
+
let checkout;
|
|
161
|
+
try {
|
|
162
|
+
checkout = await request.hubSources.checkout(source);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
return unreadable((0, governance_1.describeFailure)(error));
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
const selected = [];
|
|
169
|
+
const findings = await repositoryFindings(fs, checkout.dir, {
|
|
170
|
+
checkReleases: request.checkReleases, repository: checkout.repository, sourceId: source.id, releaseLookup: checkout.releaseLookup, candidates: selected
|
|
171
|
+
});
|
|
172
|
+
candidates.push(...selected.map((collection) => ({ ...collection, file: `${source.id}/${collection.file}` })));
|
|
173
|
+
return (0, load_config_1.withDisplayPaths)(findings, checkout.dir).map((finding) => ({ ...finding, file: finding.file === undefined ? source.id : `${source.id}/${finding.file}` }));
|
|
174
|
+
}
|
|
175
|
+
finally {
|
|
176
|
+
await checkout.dispose();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Resolve only unambiguous enabled repository ownership; never guess from a collection ID.
|
|
181
|
+
* @param repository
|
|
182
|
+
* @param inventory
|
|
183
|
+
*/
|
|
184
|
+
function repositorySourceId(repository, inventory) {
|
|
185
|
+
if (!repository || !inventory?.registry) {
|
|
186
|
+
return inventory?.registry ? '' : 'repository';
|
|
187
|
+
}
|
|
188
|
+
const identity = (url) => {
|
|
189
|
+
const target = (0, infra_1.parseGitHubRepositoryTarget)(url);
|
|
190
|
+
return `${target.host}/${target.owner}/${target.repository}`.toLowerCase();
|
|
191
|
+
};
|
|
192
|
+
try {
|
|
193
|
+
const expected = identity(repository);
|
|
194
|
+
const matches = [...inventory.registry.sources].filter(([, url]) => {
|
|
195
|
+
try {
|
|
196
|
+
return identity(url) === expected;
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
return matches.length === 1 ? matches[0][0] : '';
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
return '';
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Run collection checks and apply policy without loading source adapters.
|
|
210
|
+
* @param fs Filesystem port.
|
|
211
|
+
* @param request Root, collection files, PR refs and options.
|
|
212
|
+
*/
|
|
213
|
+
async function validateCollectionGovernance(fs, request) {
|
|
214
|
+
let mode = request.checkReleases || request.checkSources ? 'sources' : 'offline';
|
|
215
|
+
let config = { policy: {}, findings: [] };
|
|
216
|
+
let findings;
|
|
217
|
+
let prScope;
|
|
218
|
+
try {
|
|
219
|
+
const changes = await (0, pr_scope_1.readPrChanges)(request, request.repoRoot);
|
|
220
|
+
config = await (0, load_config_1.loadScopedGovernanceConfig)(fs, request, changes?.mergeBase);
|
|
221
|
+
if (config.findings.length > 0) {
|
|
222
|
+
return (0, core_1.evaluateGovernance)('collection', config.findings, {}, { mode, configFile: config.file });
|
|
223
|
+
}
|
|
224
|
+
if (changes && request.collectionFiles?.length) {
|
|
225
|
+
throw new Error('--collection-file cannot be combined with --base-ref/--head-ref.');
|
|
226
|
+
}
|
|
227
|
+
let inventory;
|
|
228
|
+
let legacyInventory = false;
|
|
229
|
+
if (request.checkSources) {
|
|
230
|
+
try {
|
|
231
|
+
const configPath = path.resolve(request.repoRoot, request.config ?? 'hub-config.yml');
|
|
232
|
+
const relative = path.relative(request.repoRoot, configPath);
|
|
233
|
+
const inRepository = relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);
|
|
234
|
+
const index = request.collectionIndex ?? new governance_1.FileCollectionIndex(fs, configPath, changes && inRepository && request.processRunner
|
|
235
|
+
? { repoRoot: request.repoRoot, commit: changes.headRef, runner: request.processRunner }
|
|
236
|
+
: undefined);
|
|
237
|
+
inventory = await index.read();
|
|
238
|
+
legacyInventory = request.collectionIndex !== undefined && inventory.registry === undefined;
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
inventory = { collections: [], unverifiedSources: [{ sourceId: 'collection-index.yml',
|
|
242
|
+
message: error instanceof Error ? error.message : 'Central collection index is unavailable.',
|
|
243
|
+
hint: 'Provide a valid .config/sources/collection-index.yml relative to the trusted hub config directory. No remote inventory fallback is performed.' }] };
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
const candidates = [];
|
|
247
|
+
const hasCollectionsDir = await fs.exists(path.join(request.repoRoot, 'collections'));
|
|
248
|
+
const affected = changes ? new Set(hasCollectionsDir ? (0, affected_collections_1.affectedCollections)(request.repoRoot, changes.files).map((c) => c.file.replaceAll('\\', '/')) : []) : undefined;
|
|
249
|
+
const changed = changes ? await changedHubCollections(request, changes) : { sources: [], references: [] };
|
|
250
|
+
const sources = changed.sources;
|
|
251
|
+
candidates.push(...changed.references);
|
|
252
|
+
if (changes) {
|
|
253
|
+
prScope = { baseRef: changes.baseRef, headRef: changes.headRef, mergeBase: changes.mergeBase, changedFiles: changes.files,
|
|
254
|
+
validated: [...affected ?? []].toSorted(), ...(sources.length > 0 ? { sources: sources.map((source) => source.id).toSorted() } : {}) };
|
|
255
|
+
}
|
|
256
|
+
findings = (0, load_config_1.withDisplayPaths)(await repositoryFindings(fs, request.repoRoot, {
|
|
257
|
+
collectionFiles: request.collectionFiles, affected, checkReleases: request.checkReleases,
|
|
258
|
+
repository: request.repository, releaseLookup: request.releaseLookup, sourceId: repositorySourceId(request.repository, inventory), candidates
|
|
259
|
+
}), request.repoRoot);
|
|
260
|
+
for (const source of sources) {
|
|
261
|
+
mode = 'sources';
|
|
262
|
+
findings.push(...await sourceCollectionFindings(fs, source, request, candidates));
|
|
263
|
+
}
|
|
264
|
+
if (inventory) {
|
|
265
|
+
// Only a successfully supplied legacy inventory can be scoped. Index failures must
|
|
266
|
+
// remain errors even when the PR has no candidates or profile references.
|
|
267
|
+
if (legacyInventory && changes && request.processRunner) {
|
|
268
|
+
const snapshot = await (0, governance_1.readGitHubScope)(request.processRunner, request.repoRoot, request.config ?? 'hub-config.yml', changes.baseRef, changes.headRef);
|
|
269
|
+
inventory = (0, core_1.scopedHubInventory)(snapshot.head, (0, core_1.computeHubScope)(snapshot.base, snapshot.head), inventory);
|
|
270
|
+
}
|
|
271
|
+
findings.push(...(0, core_1.hubCollectionFindings)(inventory, candidates));
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
findings = [{ ruleId: 'COL005', severity: 'error',
|
|
276
|
+
message: `Validation could not complete: ${error instanceof Error ? error.message : String(error)}` }];
|
|
277
|
+
}
|
|
278
|
+
const report = (0, core_1.evaluateGovernance)('collection', findings, config.policy, { mode, configFile: config.file });
|
|
279
|
+
if (mode === 'sources') {
|
|
280
|
+
for (const [ruleId, enabled, option] of [
|
|
281
|
+
['COL002', request.checkReleases, '--check-releases'],
|
|
282
|
+
['COL004', request.checkSources, '--check-sources']
|
|
283
|
+
]) {
|
|
284
|
+
if (!enabled && !report.suppressions.some((entry) => entry.ruleId === ruleId && entry.action === 'disabled')) {
|
|
285
|
+
report.notChecked.push({ ruleId, reason: `Not requested; use ${option}.` });
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return prScope ? { ...report, prScope } : report;
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=validate-collection-governance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-collection-governance.js","sourceRoot":"","sources":["../../src/governance/validate-collection-governance.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6LA,oDAEC;AAoED,oEA6EC;AAhVD;;;;;GAKG;AACH,gDAAkC;AAClC,kDAgBiC;AACjC,oDAEkC;AAClC,oEAM6C;AAC7C,6EAE4C;AAC5C,mEAGuC;AACvC,+CAIuB;AACvB,yCAIoB;AA8CpB;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,CAAC,OAA0B,EAAE,KAA0B,EAAW,EAAE,CACnF,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;OACpD,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC;WAC9D,CAAC,OAAO,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,YAAY,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AAE7G;;;;;GAKG;AACH,KAAK,UAAU,kBAAkB,CAAC,EAAc,EAAE,QAAgB,EAAE,OAA0B;IAC5F,sFAAsF;IACtF,+FAA+F;IAC/F,MAAM,KAAK,GAAG,OAAO,CAAC,eAAe,EAAE,MAAM;QAC3C,CAAC,CAAC,OAAO,CAAC,eAAe;QACzB,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,qCAAmB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hub-config.yml`
|
|
3
|
+
* documents across the Visual Hub Configuration Editor, Hub Config Tree View,
|
|
4
|
+
* and YAML Text Editor Intelligence.
|
|
5
|
+
* @module hub-editor/hub-config-editor-service
|
|
6
|
+
*/
|
|
7
|
+
import type { FileSystem, HubChangeSummary, HubConfig, HubCursorNodeContext, HubInlineDecoration, HubProfile, HubSourceCatalogEntry, HubValidationDiagnostic, RegistrySource, SourceRange } from '@ai-primitives-hub/core';
|
|
8
|
+
import { type HubYamlMutation } from '@ai-primitives-hub/infra';
|
|
9
|
+
import { type SourceAdapterFactoryDeps } from '../registry/create-source-adapter';
|
|
10
|
+
import { type HubValidationProgress } from '../registry/validate-hub-config-file';
|
|
11
|
+
export { consolidateSourceCatalog, type HubSourceCatalogEntry, } from '@ai-primitives-hub/core';
|
|
12
|
+
export interface HubProfileCategoryGroup {
|
|
13
|
+
category: string;
|
|
14
|
+
profiles: {
|
|
15
|
+
index: number;
|
|
16
|
+
profile: HubProfile;
|
|
17
|
+
}[];
|
|
18
|
+
}
|
|
19
|
+
export interface HubConfigDocumentInspection {
|
|
20
|
+
valid: boolean;
|
|
21
|
+
config?: HubConfig;
|
|
22
|
+
errors: string[];
|
|
23
|
+
warnings: string[];
|
|
24
|
+
diagnostics: HubValidationDiagnostic[];
|
|
25
|
+
inlineDecorations: HubInlineDecoration[];
|
|
26
|
+
nodeRanges: Map<string, SourceRange>;
|
|
27
|
+
catalogsBySourceId: Record<string, HubSourceCatalogEntry[]>;
|
|
28
|
+
profileCategories: HubProfileCategoryGroup[];
|
|
29
|
+
}
|
|
30
|
+
export declare class HubConfigEditorService {
|
|
31
|
+
private readonly catalogsBySourceId;
|
|
32
|
+
private lastDeepDiagnostics;
|
|
33
|
+
private lastDeepDecorations;
|
|
34
|
+
private recordDeepValidationResults;
|
|
35
|
+
private remapDeepDiagnostics;
|
|
36
|
+
private mergeDecorations;
|
|
37
|
+
private groupProfilesByCategory;
|
|
38
|
+
/**
|
|
39
|
+
* Inspect a `hub-config.yml` string offline (syntax, schema, policies, ranges,
|
|
40
|
+
* categories, and any cached deep catalogs/diagnostics).
|
|
41
|
+
* @param content Raw YAML document string.
|
|
42
|
+
* @returns Complete document inspection payload.
|
|
43
|
+
*/
|
|
44
|
+
inspectDocument(content: string): HubConfigDocumentInspection;
|
|
45
|
+
/**
|
|
46
|
+
* Apply a comment-preserving CRUD or quick-fix mutation to `hub-config.yml`
|
|
47
|
+
* and return the updated content along with its fresh inspection.
|
|
48
|
+
* @param content Current YAML content.
|
|
49
|
+
* @param mutation Mutation to apply.
|
|
50
|
+
*/
|
|
51
|
+
applyMutation(content: string, mutation: HubYamlMutation): {
|
|
52
|
+
updatedContent: string;
|
|
53
|
+
inspection: HubConfigDocumentInspection;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Locate the semantic node enclosing a 0-based line number in `hub-config.yml`.
|
|
57
|
+
* @param content Raw YAML content.
|
|
58
|
+
* @param line 0-based line number.
|
|
59
|
+
*/
|
|
60
|
+
locateCursor(content: string, line: number): HubCursorNodeContext;
|
|
61
|
+
/**
|
|
62
|
+
* Summarize structural changes between a base `hub-config.yml` and an edited
|
|
63
|
+
* `hub-config.yml` for commit messages and PR descriptions.
|
|
64
|
+
* @param baseContent Base YAML content.
|
|
65
|
+
* @param currentContent Edited YAML content.
|
|
66
|
+
*/
|
|
67
|
+
summarizeChanges(baseContent: string, currentContent: string): HubChangeSummary;
|
|
68
|
+
/**
|
|
69
|
+
* Validate a single source and discover its bundle catalog for the Bundle Picker.
|
|
70
|
+
* @param source Source definition to probe.
|
|
71
|
+
* @param sourceAdapterDeps Dependencies for creating the source adapter.
|
|
72
|
+
*/
|
|
73
|
+
discoverSourceBundles(source: RegistrySource, sourceAdapterDeps: SourceAdapterFactoryDeps): Promise<{
|
|
74
|
+
valid: boolean;
|
|
75
|
+
errors: string[];
|
|
76
|
+
bundles: HubSourceCatalogEntry[];
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Run deep hub configuration validation (source reachability, catalog
|
|
80
|
+
* discovery, and profile bundle/version resolution) and map results onto
|
|
81
|
+
* YAML line ranges and inline decorations.
|
|
82
|
+
* @param _fs Filesystem port (retained for signature compatibility).
|
|
83
|
+
* @param filePath Path to `hub-config.yml`.
|
|
84
|
+
* @param content Current YAML content.
|
|
85
|
+
* @param options Deep validation options.
|
|
86
|
+
* @param options.sourceAdapterDeps
|
|
87
|
+
* @param options.onProgress
|
|
88
|
+
*/
|
|
89
|
+
validateDeep(_fs: FileSystem, filePath: string, content: string, options: {
|
|
90
|
+
sourceAdapterDeps: SourceAdapterFactoryDeps;
|
|
91
|
+
onProgress?: (event: HubValidationProgress) => void;
|
|
92
|
+
}): Promise<HubConfigDocumentInspection>;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=hub-config-editor-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hub-config-editor-service.d.ts","sourceRoot":"","sources":["../../src/hub-editor/hub-config-editor-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAEL,KAAK,eAAe,EAIrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,wBAAwB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,UAAU,CAAC;KACrB,EAAE,C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