@ai-primitives-hub/core 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/dist/domain/bundle/version.d.ts +13 -0
- package/dist/domain/bundle/version.d.ts.map +1 -1
- package/dist/domain/bundle/version.js +27 -0
- package/dist/domain/bundle/version.js.map +1 -1
- package/dist/domain/collection/apm-release-plan.d.ts +39 -0
- package/dist/domain/collection/apm-release-plan.d.ts.map +1 -0
- package/dist/domain/collection/apm-release-plan.js +185 -0
- package/dist/domain/collection/apm-release-plan.js.map +1 -0
- package/dist/domain/collection/contribution.d.ts +126 -0
- package/dist/domain/collection/contribution.d.ts.map +1 -0
- package/dist/domain/collection/contribution.js +462 -0
- package/dist/domain/collection/contribution.js.map +1 -0
- package/dist/domain/collection/diagnostics.d.ts +166 -0
- package/dist/domain/collection/diagnostics.d.ts.map +1 -0
- package/dist/domain/collection/diagnostics.js +3 -0
- package/dist/domain/collection/diagnostics.js.map +1 -0
- package/dist/domain/collection/manifest-validator.d.ts +3 -2
- package/dist/domain/collection/manifest-validator.d.ts.map +1 -1
- package/dist/domain/collection/manifest-validator.js +99 -17
- package/dist/domain/collection/manifest-validator.js.map +1 -1
- package/dist/domain/collection/release-manifest-plan.d.ts +9 -0
- package/dist/domain/collection/release-manifest-plan.d.ts.map +1 -1
- package/dist/domain/collection/release-manifest-plan.js +45 -14
- package/dist/domain/collection/release-manifest-plan.js.map +1 -1
- package/dist/domain/collection/validate.d.ts +5 -0
- package/dist/domain/collection/validate.d.ts.map +1 -1
- package/dist/domain/collection/validate.js +7 -2
- package/dist/domain/collection/validate.js.map +1 -1
- package/dist/domain/diagnostics/primitives/catalogue.d.ts +40 -0
- package/dist/domain/diagnostics/primitives/catalogue.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/catalogue.js +78 -0
- package/dist/domain/diagnostics/primitives/catalogue.js.map +1 -0
- package/dist/domain/diagnostics/primitives/classifier.d.ts +81 -0
- package/dist/domain/diagnostics/primitives/classifier.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/classifier.js +138 -0
- package/dist/domain/diagnostics/primitives/classifier.js.map +1 -0
- package/dist/domain/diagnostics/primitives/evaluators.d.ts +138 -0
- package/dist/domain/diagnostics/primitives/evaluators.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/evaluators.js +485 -0
- package/dist/domain/diagnostics/primitives/evaluators.js.map +1 -0
- package/dist/domain/diagnostics/primitives/fixture.d.ts +97 -0
- package/dist/domain/diagnostics/primitives/fixture.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/fixture.js +265 -0
- package/dist/domain/diagnostics/primitives/fixture.js.map +1 -0
- package/dist/domain/diagnostics/primitives/index.d.ts +18 -0
- package/dist/domain/diagnostics/primitives/index.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/index.js +34 -0
- package/dist/domain/diagnostics/primitives/index.js.map +1 -0
- package/dist/domain/diagnostics/primitives/known-gaps.d.ts +50 -0
- package/dist/domain/diagnostics/primitives/known-gaps.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/known-gaps.js +148 -0
- package/dist/domain/diagnostics/primitives/known-gaps.js.map +1 -0
- package/dist/domain/diagnostics/primitives/manifest-view.d.ts +28 -0
- package/dist/domain/diagnostics/primitives/manifest-view.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/manifest-view.js +50 -0
- package/dist/domain/diagnostics/primitives/manifest-view.js.map +1 -0
- package/dist/domain/diagnostics/primitives/placements.d.ts +51 -0
- package/dist/domain/diagnostics/primitives/placements.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/placements.js +76 -0
- package/dist/domain/diagnostics/primitives/placements.js.map +1 -0
- package/dist/domain/diagnostics/primitives/planner.d.ts +60 -0
- package/dist/domain/diagnostics/primitives/planner.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/planner.js +60 -0
- package/dist/domain/diagnostics/primitives/planner.js.map +1 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.d.ts +38 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.js +173 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.js.map +1 -0
- package/dist/domain/diagnostics/primitives/report.d.ts +122 -0
- package/dist/domain/diagnostics/primitives/report.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/report.js +85 -0
- package/dist/domain/diagnostics/primitives/report.js.map +1 -0
- package/dist/domain/diagnostics/primitives/sandbox.d.ts +59 -0
- package/dist/domain/diagnostics/primitives/sandbox.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/sandbox.js +193 -0
- package/dist/domain/diagnostics/primitives/sandbox.js.map +1 -0
- package/dist/domain/diagnostics/primitives/support-matrix.d.ts +36 -0
- package/dist/domain/diagnostics/primitives/support-matrix.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/support-matrix.js +69 -0
- package/dist/domain/diagnostics/primitives/support-matrix.js.map +1 -0
- package/dist/domain/diagnostics/primitives/types.d.ts +117 -0
- package/dist/domain/diagnostics/primitives/types.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/types.js +62 -0
- package/dist/domain/diagnostics/primitives/types.js.map +1 -0
- package/dist/domain/governance/catalogue.d.ts +11 -0
- package/dist/domain/governance/catalogue.d.ts.map +1 -0
- package/dist/domain/governance/catalogue.js +45 -0
- package/dist/domain/governance/catalogue.js.map +1 -0
- package/dist/domain/governance/effective-rules.d.ts +19 -0
- package/dist/domain/governance/effective-rules.d.ts.map +1 -0
- package/dist/domain/governance/effective-rules.js +49 -0
- package/dist/domain/governance/effective-rules.js.map +1 -0
- package/dist/domain/governance/evaluate.d.ts +16 -0
- package/dist/domain/governance/evaluate.d.ts.map +1 -0
- package/dist/domain/governance/evaluate.js +34 -0
- package/dist/domain/governance/evaluate.js.map +1 -0
- package/dist/domain/governance/hub-scope.d.ts +74 -0
- package/dist/domain/governance/hub-scope.d.ts.map +1 -0
- package/dist/domain/governance/hub-scope.js +202 -0
- package/dist/domain/governance/hub-scope.js.map +1 -0
- package/dist/domain/governance/hub-scoped-inventory.d.ts +22 -0
- package/dist/domain/governance/hub-scoped-inventory.d.ts.map +1 -0
- package/dist/domain/governance/hub-scoped-inventory.js +59 -0
- package/dist/domain/governance/hub-scoped-inventory.js.map +1 -0
- package/dist/domain/governance/index.d.ts +15 -0
- package/dist/domain/governance/index.d.ts.map +1 -0
- package/dist/domain/governance/index.js +31 -0
- package/dist/domain/governance/index.js.map +1 -0
- package/dist/domain/governance/rule-registry.d.ts +20 -0
- package/dist/domain/governance/rule-registry.d.ts.map +1 -0
- package/dist/domain/governance/rule-registry.js +40 -0
- package/dist/domain/governance/rule-registry.js.map +1 -0
- package/dist/domain/governance/rules/collection.d.ts +32 -0
- package/dist/domain/governance/rules/collection.d.ts.map +1 -0
- package/dist/domain/governance/rules/collection.js +153 -0
- package/dist/domain/governance/rules/collection.js.map +1 -0
- package/dist/domain/governance/rules/config.d.ts +15 -0
- package/dist/domain/governance/rules/config.d.ts.map +1 -0
- package/dist/domain/governance/rules/config.js +38 -0
- package/dist/domain/governance/rules/config.js.map +1 -0
- package/dist/domain/governance/rules/hub.d.ts +7 -0
- package/dist/domain/governance/rules/hub.d.ts.map +1 -0
- package/dist/domain/governance/rules/hub.js +10 -0
- package/dist/domain/governance/rules/hub.js.map +1 -0
- package/dist/domain/governance/types.d.ts +70 -0
- package/dist/domain/governance/types.d.ts.map +1 -0
- package/dist/domain/governance/types.js +7 -0
- package/dist/domain/governance/types.js.map +1 -0
- package/dist/domain/hub/diagnostics.d.ts +92 -0
- package/dist/domain/hub/diagnostics.d.ts.map +1 -0
- package/dist/domain/hub/diagnostics.js +11 -0
- package/dist/domain/hub/diagnostics.js.map +1 -0
- package/dist/domain/hub/profile-requirements.d.ts +16 -0
- package/dist/domain/hub/profile-requirements.d.ts.map +1 -0
- package/dist/domain/hub/profile-requirements.js +16 -0
- package/dist/domain/hub/profile-requirements.js.map +1 -0
- package/dist/domain/hub/replicate.d.ts +23 -0
- package/dist/domain/hub/replicate.d.ts.map +1 -1
- package/dist/domain/hub/replicate.js +13 -0
- package/dist/domain/hub/replicate.js.map +1 -1
- package/dist/domain/hub/types.d.ts +2 -0
- package/dist/domain/hub/types.d.ts.map +1 -1
- package/dist/domain/hub/validate.d.ts +150 -2
- package/dist/domain/hub/validate.d.ts.map +1 -1
- package/dist/domain/hub/validate.js +421 -37
- package/dist/domain/hub/validate.js.map +1 -1
- package/dist/domain/index.d.ts +17 -0
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +17 -0
- package/dist/domain/index.js.map +1 -1
- package/dist/domain/install/category.d.ts +31 -0
- package/dist/domain/install/category.d.ts.map +1 -0
- package/dist/domain/install/category.js +33 -0
- package/dist/domain/install/category.js.map +1 -0
- package/dist/domain/install/file-mode.d.ts +49 -0
- package/dist/domain/install/file-mode.d.ts.map +1 -0
- package/dist/domain/install/file-mode.js +54 -0
- package/dist/domain/install/file-mode.js.map +1 -0
- package/dist/domain/install/git-exclude.d.ts +22 -0
- package/dist/domain/install/git-exclude.d.ts.map +1 -0
- package/dist/domain/install/git-exclude.js +56 -0
- package/dist/domain/install/git-exclude.js.map +1 -0
- package/dist/domain/install/installable.d.ts +2 -0
- package/dist/domain/install/installable.d.ts.map +1 -1
- package/dist/domain/install/kind-route.d.ts +80 -0
- package/dist/domain/install/kind-route.d.ts.map +1 -0
- package/dist/domain/install/kind-route.js +135 -0
- package/dist/domain/install/kind-route.js.map +1 -0
- package/dist/domain/install/record-errors.d.ts +53 -0
- package/dist/domain/install/record-errors.d.ts.map +1 -0
- package/dist/domain/install/record-errors.js +104 -0
- package/dist/domain/install/record-errors.js.map +1 -0
- package/dist/domain/install/record-object.d.ts +21 -0
- package/dist/domain/install/record-object.d.ts.map +1 -0
- package/dist/domain/install/record-object.js +38 -0
- package/dist/domain/install/record-object.js.map +1 -0
- package/dist/domain/install/record-parse.d.ts +23 -0
- package/dist/domain/install/record-parse.d.ts.map +1 -0
- package/dist/domain/install/record-parse.js +73 -0
- package/dist/domain/install/record-parse.js.map +1 -0
- package/dist/domain/install/record-path.d.ts +26 -0
- package/dist/domain/install/record-path.d.ts.map +1 -0
- package/dist/domain/install/record-path.js +130 -0
- package/dist/domain/install/record-path.js.map +1 -0
- package/dist/domain/install/record-types.d.ts +183 -0
- package/dist/domain/install/record-types.d.ts.map +1 -0
- package/dist/domain/install/record-types.js +92 -0
- package/dist/domain/install/record-types.js.map +1 -0
- package/dist/domain/install/types.d.ts +2 -0
- package/dist/domain/install/types.d.ts.map +1 -1
- package/dist/domain/mcp/index.d.ts +1 -0
- package/dist/domain/mcp/index.d.ts.map +1 -1
- package/dist/domain/mcp/index.js +1 -0
- package/dist/domain/mcp/index.js.map +1 -1
- package/dist/domain/mcp/server-key.d.ts +35 -0
- package/dist/domain/mcp/server-key.d.ts.map +1 -0
- package/dist/domain/mcp/server-key.js +44 -0
- package/dist/domain/mcp/server-key.js.map +1 -0
- package/dist/domain/plugin/agent-plugin-spec.d.ts +8 -0
- package/dist/domain/plugin/agent-plugin-spec.d.ts.map +1 -1
- package/dist/domain/plugin/agent-plugin-spec.js +22 -8
- package/dist/domain/plugin/agent-plugin-spec.js.map +1 -1
- package/dist/domain/registry-error.d.ts +1 -1
- package/dist/domain/registry-error.d.ts.map +1 -1
- package/dist/domain/registry-error.js +2 -1
- package/dist/domain/registry-error.js.map +1 -1
- package/dist/domain/security/fingerprint.d.ts +18 -0
- package/dist/domain/security/fingerprint.d.ts.map +1 -0
- package/dist/domain/security/fingerprint.js +34 -0
- package/dist/domain/security/fingerprint.js.map +1 -0
- package/dist/domain/security/high-impact-rules.d.ts +30 -0
- package/dist/domain/security/high-impact-rules.d.ts.map +1 -0
- package/dist/domain/security/high-impact-rules.js +160 -0
- package/dist/domain/security/high-impact-rules.js.map +1 -0
- package/dist/domain/security/index.d.ts +10 -0
- package/dist/domain/security/index.d.ts.map +1 -0
- package/dist/domain/security/index.js +26 -0
- package/dist/domain/security/index.js.map +1 -0
- package/dist/domain/security/markdown-context.d.ts +17 -0
- package/dist/domain/security/markdown-context.d.ts.map +1 -0
- package/dist/domain/security/markdown-context.js +74 -0
- package/dist/domain/security/markdown-context.js.map +1 -0
- package/dist/domain/security/policy.d.ts +17 -0
- package/dist/domain/security/policy.d.ts.map +1 -0
- package/dist/domain/security/policy.js +31 -0
- package/dist/domain/security/policy.js.map +1 -0
- package/dist/domain/security/rating/findings-document.d.ts +22 -0
- package/dist/domain/security/rating/findings-document.d.ts.map +1 -0
- package/dist/domain/security/rating/findings-document.js +57 -0
- package/dist/domain/security/rating/findings-document.js.map +1 -0
- package/dist/domain/security/rating/index.d.ts +5 -0
- package/dist/domain/security/rating/index.d.ts.map +1 -0
- package/dist/domain/security/rating/index.js +21 -0
- package/dist/domain/security/rating/index.js.map +1 -0
- package/dist/domain/security/rating/scoring.d.ts +83 -0
- package/dist/domain/security/rating/scoring.d.ts.map +1 -0
- package/dist/domain/security/rating/scoring.js +115 -0
- package/dist/domain/security/rating/scoring.js.map +1 -0
- package/dist/domain/security/rating/security-rating-report.d.ts +111 -0
- package/dist/domain/security/rating/security-rating-report.d.ts.map +1 -0
- package/dist/domain/security/rating/security-rating-report.js +152 -0
- package/dist/domain/security/rating/security-rating-report.js.map +1 -0
- package/dist/domain/security/rating/types.d.ts +22 -0
- package/dist/domain/security/rating/types.d.ts.map +1 -0
- package/dist/domain/security/rating/types.js +11 -0
- package/dist/domain/security/rating/types.js.map +1 -0
- package/dist/domain/security/remediations.d.ts +17 -0
- package/dist/domain/security/remediations.d.ts.map +1 -0
- package/dist/domain/security/remediations.js +61 -0
- package/dist/domain/security/remediations.js.map +1 -0
- package/dist/domain/security/rule-engine.d.ts +8 -0
- package/dist/domain/security/rule-engine.d.ts.map +1 -0
- package/dist/domain/security/rule-engine.js +875 -0
- package/dist/domain/security/rule-engine.js.map +1 -0
- package/dist/domain/security/suppression.d.ts +19 -0
- package/dist/domain/security/suppression.d.ts.map +1 -0
- package/dist/domain/security/suppression.js +78 -0
- package/dist/domain/security/suppression.js.map +1 -0
- package/dist/domain/security/types.d.ts +91 -0
- package/dist/domain/security/types.d.ts.map +1 -0
- package/dist/domain/security/types.js +10 -0
- package/dist/domain/security/types.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/ports/app-storage.d.ts +11 -15
- package/dist/ports/app-storage.d.ts.map +1 -1
- package/dist/ports/app-storage.js +8 -8
- package/dist/ports/argv-process-runner.d.ts +6 -0
- package/dist/ports/argv-process-runner.d.ts.map +1 -0
- package/dist/ports/argv-process-runner.js +3 -0
- package/dist/ports/argv-process-runner.js.map +1 -0
- package/dist/ports/bundle-extractor.d.ts +16 -3
- package/dist/ports/bundle-extractor.d.ts.map +1 -1
- package/dist/ports/collection-contribution.d.ts +36 -0
- package/dist/ports/collection-contribution.d.ts.map +1 -0
- package/dist/ports/collection-contribution.js +3 -0
- package/dist/ports/collection-contribution.js.map +1 -0
- package/dist/ports/filesystem.d.ts +12 -0
- package/dist/ports/filesystem.d.ts.map +1 -1
- package/dist/ports/hub-collection-index.d.ts +27 -0
- package/dist/ports/hub-collection-index.d.ts.map +1 -0
- package/dist/ports/hub-collection-index.js +3 -0
- package/dist/ports/hub-collection-index.js.map +1 -0
- package/dist/ports/hub-contribution.d.ts +158 -0
- package/dist/ports/hub-contribution.d.ts.map +1 -0
- package/dist/ports/hub-contribution.js +3 -0
- package/dist/ports/hub-contribution.js.map +1 -0
- package/dist/ports/index.d.ts +12 -0
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js +12 -0
- package/dist/ports/index.js.map +1 -1
- package/dist/ports/primitive-diagnostics-driver.d.ts +96 -0
- package/dist/ports/primitive-diagnostics-driver.d.ts.map +1 -0
- package/dist/ports/primitive-diagnostics-driver.js +3 -0
- package/dist/ports/primitive-diagnostics-driver.js.map +1 -0
- package/dist/ports/record-fs.d.ts +46 -0
- package/dist/ports/record-fs.d.ts.map +1 -0
- package/dist/ports/record-fs.js +9 -0
- package/dist/ports/record-fs.js.map +1 -0
- package/dist/ports/registry-operations.d.ts +3 -2
- package/dist/ports/registry-operations.d.ts.map +1 -1
- package/dist/ports/release-lookup.d.ts +24 -0
- package/dist/ports/release-lookup.d.ts.map +1 -0
- package/dist/ports/release-lookup.js +7 -0
- package/dist/ports/release-lookup.js.map +1 -0
- package/dist/ports/release-source.d.ts +17 -3
- package/dist/ports/release-source.d.ts.map +1 -1
- package/dist/ports/repository-exclusion.d.ts +30 -0
- package/dist/ports/repository-exclusion.d.ts.map +1 -0
- package/dist/ports/repository-exclusion.js +3 -0
- package/dist/ports/repository-exclusion.js.map +1 -0
- package/dist/ports/schema-validator.d.ts +25 -0
- package/dist/ports/schema-validator.d.ts.map +1 -0
- package/dist/ports/schema-validator.js +7 -0
- package/dist/ports/schema-validator.js.map +1 -0
- package/dist/ports/security-report-store.d.ts +9 -0
- package/dist/ports/security-report-store.d.ts.map +1 -0
- package/dist/ports/security-report-store.js +4 -0
- package/dist/ports/security-report-store.js.map +1 -0
- package/dist/ports/security-scan-engine.d.ts +32 -0
- package/dist/ports/security-scan-engine.d.ts.map +1 -0
- package/dist/ports/security-scan-engine.js +6 -0
- package/dist/ports/security-scan-engine.js.map +1 -0
- package/dist/ports/security-scan-input.d.ts +63 -0
- package/dist/ports/security-scan-input.d.ts.map +1 -0
- package/dist/ports/security-scan-input.js +3 -0
- package/dist/ports/security-scan-input.js.map +1 -0
- package/dist/ports/source-adapter.d.ts +11 -0
- package/dist/ports/source-adapter.d.ts.map +1 -1
- package/dist/public/schemas/collection.schema.json +0 -1
- package/dist/public/schemas/hub-governance.schema.json +21 -0
- package/dist/public/schemas/install-record.schema.json +343 -0
- package/dist/public/schemas/security-rating-report.schema.json +113 -0
- package/package.json +2 -2
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readManifestView = readManifestView;
|
|
4
|
+
/**
|
|
5
|
+
* Domain layer — tolerant view of `deployment-manifest.yml`.
|
|
6
|
+
*
|
|
7
|
+
* Parsed once by the I0 evaluator and read by I1, I2 and the archived
|
|
8
|
+
* item files. Unlike `validateManifest`, it never throws: malformed fields
|
|
9
|
+
* read as `null` so the evaluators can report what the build produced.
|
|
10
|
+
* @module domain/diagnostics/primitives/manifest-view
|
|
11
|
+
*/
|
|
12
|
+
const js_yaml_1 = require("js-yaml");
|
|
13
|
+
const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
14
|
+
const str = (value) => (typeof value === 'string' ? value : null);
|
|
15
|
+
/**
|
|
16
|
+
* Read a deployment manifest tolerantly.
|
|
17
|
+
* @param bytes - Raw `deployment-manifest.yml` bytes.
|
|
18
|
+
* @returns The view, or undefined unless the YAML is a mapping. Never throws.
|
|
19
|
+
*/
|
|
20
|
+
function readManifestView(bytes) {
|
|
21
|
+
let parsed;
|
|
22
|
+
try {
|
|
23
|
+
parsed = (0, js_yaml_1.load)(new TextDecoder().decode(bytes));
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
if (!isRecord(parsed)) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
const items = Array.isArray(parsed.items)
|
|
32
|
+
? parsed.items.map((entry) => (isRecord(entry)
|
|
33
|
+
? { path: str(entry.path), kind: str(entry.kind), id: str(entry.id) }
|
|
34
|
+
: { path: null, kind: null, id: null }))
|
|
35
|
+
: [];
|
|
36
|
+
const files = new Map();
|
|
37
|
+
if (Array.isArray(parsed.files)) {
|
|
38
|
+
for (const entry of parsed.files) {
|
|
39
|
+
if (isRecord(entry) && typeof entry.path === 'string') {
|
|
40
|
+
files.set(entry.path, {
|
|
41
|
+
role: str(entry.role),
|
|
42
|
+
size: typeof entry.size === 'number' ? entry.size : null,
|
|
43
|
+
sha256: str(entry.sha256)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return { formatVersion: parsed.formatVersion, id: parsed.id, version: parsed.version, items, files };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=manifest-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-view.js","sourceRoot":"","sources":["../../../../src/domain/diagnostics/primitives/manifest-view.ts"],"names":[],"mappings":";;AA8CA,4CA4BC;AA1ED;;;;;;;GAOG;AACH,qCAEiB;AA0BjB,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEvE,MAAM,GAAG,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAE1F;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,KAAiB;IAChD,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAA,cAAS,EAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;QACvC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAc,EAAoB,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;YACvE,CAAC,CAAC,EAAE,IA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HOME/…` at user scope, `<workspace>/…` at repository scope). Declared
|
|
6
|
+
* here from the placements observed after #532, deliberately independent
|
|
7
|
+
* of infra's writer layouts, so a route regression there fails I13.
|
|
8
|
+
*
|
|
9
|
+
* Gapped cells keep their route (hook and plugin on kiro, copilot-cli at
|
|
10
|
+
* repository scope), so a fix PR only deletes the gap entry.
|
|
11
|
+
* @module domain/diagnostics/primitives/placements
|
|
12
|
+
*/
|
|
13
|
+
import type { TargetType } from '../../install/target';
|
|
14
|
+
import type { PrimitiveKind } from '../../primitive/types';
|
|
15
|
+
import type { FixtureItem } from './catalogue';
|
|
16
|
+
import type { DiagnosticScope } from './types';
|
|
17
|
+
/** Placement root label per target and scope. */
|
|
18
|
+
export declare const PLACEMENT_ROOTS: Readonly<Record<TargetType, Readonly<Record<DiagnosticScope, string>>>>;
|
|
19
|
+
type Routes = Readonly<Partial<Record<PrimitiveKind, string>>>;
|
|
20
|
+
/** Destination prefix under the root, per supported cell; the literal 'config' = merged into a config file (MCP). */
|
|
21
|
+
export declare const PLACEMENT_ROUTES: Readonly<Record<TargetType, Routes>>;
|
|
22
|
+
/** A destination outside the target's placement root. */
|
|
23
|
+
interface Placement {
|
|
24
|
+
readonly root: string;
|
|
25
|
+
readonly route: string;
|
|
26
|
+
}
|
|
27
|
+
type Placements = Readonly<Partial<Record<PrimitiveKind, Placement>>>;
|
|
28
|
+
/** Cells whose destination lies outside `PLACEMENT_ROOTS`; they take precedence over `PLACEMENT_ROUTES`. */
|
|
29
|
+
export declare const PLACEMENT_OVERRIDES: Readonly<Partial<Record<TargetType, Partial<Record<DiagnosticScope, Placements>>>>>;
|
|
30
|
+
/** Expected destination of one archived file. */
|
|
31
|
+
export type ExpectedDestination = {
|
|
32
|
+
kind: 'file';
|
|
33
|
+
label: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'config';
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'none';
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Expected destination of an archived item file.
|
|
41
|
+
* @param target - Target type.
|
|
42
|
+
* @param scope - Effective scope of the install.
|
|
43
|
+
* @param item - Collection item the file belongs to.
|
|
44
|
+
* @param archivePath - Archive-relative path of the file (starts with `item.sourcePrefix`).
|
|
45
|
+
* @returns The label `${root}/${route}${archivePath minus sourcePrefix}` (root and route from
|
|
46
|
+
* `PLACEMENT_OVERRIDES` when the cell has one), `config` for merged
|
|
47
|
+
* config items, or `none` for an unsupported cell.
|
|
48
|
+
*/
|
|
49
|
+
export declare function expectedDestination(target: TargetType, scope: DiagnosticScope, item: FixtureItem, archivePath: string): ExpectedDestination;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=placements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placements.d.ts","sourceRoot":"","sources":["../../../../src/domain/diagnostics/primitives/placements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EACV,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,iDAAiD;AACjD,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,CAYnG,CAAC;AAEF,KAAK,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAa/D,qHAAqH;AACrH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAYjE,CAAC;AAEF,yDAAyD;AACzD,UAAU,SAAS;IACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,KAAK,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAStE,4GAA4G;AAC5G,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAGnH,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,mBAAmB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1G;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,WAAW,EACjB,WAAW,EAAE,MAAM,GAClB,mBAAmB,CAWrB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PLACEMENT_OVERRIDES = exports.PLACEMENT_ROUTES = exports.PLACEMENT_ROOTS = void 0;
|
|
4
|
+
exports.expectedDestination = expectedDestination;
|
|
5
|
+
/** Placement root label per target and scope. */
|
|
6
|
+
exports.PLACEMENT_ROOTS = {
|
|
7
|
+
vscode: { user: '$HOME/.copilot', repository: '<workspace>/.github' },
|
|
8
|
+
'vscode-insiders': { user: '$HOME/.copilot', repository: '<workspace>/.github' },
|
|
9
|
+
'copilot-cli': { user: '$HOME/.copilot', repository: '<workspace>/.github' },
|
|
10
|
+
kiro: { user: '$HOME/.kiro', repository: '<workspace>/.kiro' },
|
|
11
|
+
'kiro-cli': { user: '$HOME/.kiro', repository: '<workspace>/.kiro' },
|
|
12
|
+
windsurf: { user: '$HOME/.codeium/windsurf', repository: '<workspace>/.windsurf' },
|
|
13
|
+
'claude-code': { user: '$HOME/.claude', repository: '<workspace>/.claude' },
|
|
14
|
+
cursor: { user: '$HOME/.cursor', repository: '<workspace>/.cursor' },
|
|
15
|
+
opencode: { user: '$HOME/.opencode', repository: '<workspace>/.opencode' },
|
|
16
|
+
devin: { user: '$HOME/.devin', repository: '<workspace>/.devin' },
|
|
17
|
+
'devin-cli': { user: '$HOME/.devin', repository: '<workspace>/.devin' }
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Routes every target has; `config` = merged into a host config file (MCP).
|
|
21
|
+
* A plugin lands as its whole directory under `plugins/`.
|
|
22
|
+
*/
|
|
23
|
+
const COMMON = {
|
|
24
|
+
'chat-mode': 'agents/', agent: 'agents/', skill: 'skills/', plugin: 'plugins/', hook: 'hooks/', 'mcp-server': 'config'
|
|
25
|
+
};
|
|
26
|
+
const COPILOT = { ...COMMON, prompt: 'prompts/', instruction: 'instructions/' };
|
|
27
|
+
const KIRO = { ...COMMON, prompt: 'steering/', instruction: 'steering/', steering: 'steering/', spec: 'specs/', power: 'powers/' };
|
|
28
|
+
const DEVIN = { ...COMMON, prompt: 'rules/', instruction: 'rules/', power: 'powers/', knowledge: 'knowledge/', playbook: 'playbooks/' };
|
|
29
|
+
/** Destination prefix under the root, per supported cell; the literal 'config' = merged into a config file (MCP). */
|
|
30
|
+
exports.PLACEMENT_ROUTES = {
|
|
31
|
+
vscode: COPILOT,
|
|
32
|
+
'vscode-insiders': COPILOT,
|
|
33
|
+
'copilot-cli': COPILOT,
|
|
34
|
+
kiro: KIRO,
|
|
35
|
+
'kiro-cli': KIRO,
|
|
36
|
+
windsurf: { ...COMMON, prompt: 'rules/', instruction: 'rules/' },
|
|
37
|
+
'claude-code': { ...COMMON, prompt: 'commands/', instruction: 'instructions/', command: 'commands/', 'output-style': 'output-styles/' },
|
|
38
|
+
cursor: { ...COMMON, prompt: 'rules/', instruction: 'rules/', rule: 'rules/' },
|
|
39
|
+
opencode: { ...COMMON, prompt: 'commands/', instruction: 'rules/', tool: 'tools/' },
|
|
40
|
+
devin: DEVIN,
|
|
41
|
+
'devin-cli': DEVIN
|
|
42
|
+
};
|
|
43
|
+
/** Devin reads user skills and agents from `~/.config/devin/`, not `~/.devin/`. */
|
|
44
|
+
const DEVIN_USER_CONFIG = {
|
|
45
|
+
'chat-mode': { root: '$HOME/.config/devin', route: 'agents/' },
|
|
46
|
+
agent: { root: '$HOME/.config/devin', route: 'agents/' },
|
|
47
|
+
skill: { root: '$HOME/.config/devin', route: 'skills/' }
|
|
48
|
+
};
|
|
49
|
+
/** Cells whose destination lies outside `PLACEMENT_ROOTS`; they take precedence over `PLACEMENT_ROUTES`. */
|
|
50
|
+
exports.PLACEMENT_OVERRIDES = {
|
|
51
|
+
devin: { user: DEVIN_USER_CONFIG },
|
|
52
|
+
'devin-cli': { user: DEVIN_USER_CONFIG }
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Expected destination of an archived item file.
|
|
56
|
+
* @param target - Target type.
|
|
57
|
+
* @param scope - Effective scope of the install.
|
|
58
|
+
* @param item - Collection item the file belongs to.
|
|
59
|
+
* @param archivePath - Archive-relative path of the file (starts with `item.sourcePrefix`).
|
|
60
|
+
* @returns The label `${root}/${route}${archivePath minus sourcePrefix}` (root and route from
|
|
61
|
+
* `PLACEMENT_OVERRIDES` when the cell has one), `config` for merged
|
|
62
|
+
* config items, or `none` for an unsupported cell.
|
|
63
|
+
*/
|
|
64
|
+
function expectedDestination(target, scope, item, archivePath) {
|
|
65
|
+
const override = exports.PLACEMENT_OVERRIDES[target]?.[scope]?.[item.kind];
|
|
66
|
+
const root = override?.root ?? exports.PLACEMENT_ROOTS[target][scope];
|
|
67
|
+
const route = override?.route ?? exports.PLACEMENT_ROUTES[target][item.kind];
|
|
68
|
+
if (route === undefined) {
|
|
69
|
+
return { kind: 'none' };
|
|
70
|
+
}
|
|
71
|
+
if (route === 'config') {
|
|
72
|
+
return { kind: 'config' };
|
|
73
|
+
}
|
|
74
|
+
return { kind: 'file', label: `${root}/${route}${archivePath.slice(item.sourcePrefix.length)}` };
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=placements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placements.js","sourceRoot":"","sources":["../../../../src/domain/diagnostics/primitives/placements.ts"],"names":[],"mappings":";;;AAsGA,kDAgBC;AA7FD,iDAAiD;AACpC,QAAA,eAAe,GAA4E;IACtG,MAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAE;IACrE,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAE;IAChF,aAAa,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAE;IAC5E,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,mBAAmB,EAAE;IAC9D,UAAU,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,mBAAmB,EAAE;IACpE,QAAQ,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE,UAAU,EAAE,uBAAuB,EAAE;IAClF,aAAa,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,qBAAqB,EAAE;IAC3E,MAAM,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,qBAAqB,EAAE;IACpE,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,UAAU,EAAE,uBAAuB,EAAE;IAC1E,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE;IACjE,WAAW,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE;CACxE,CAAC;AAIF;;;GAGG;AAC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I,IAAI,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;AACnG,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain layer — primitive diagnostics planner.
|
|
3
|
+
*
|
|
4
|
+
* Turns the `--kinds/--targets/--scopes` filters into the bundles to build
|
|
5
|
+
* and the cases to run. Filters select cases only; they never change an
|
|
6
|
+
* expected outcome.
|
|
7
|
+
* @module domain/diagnostics/primitives/planner
|
|
8
|
+
*/
|
|
9
|
+
import { type TargetType } from '../../install/target';
|
|
10
|
+
import { type PrimitiveKind } from '../../primitive/types';
|
|
11
|
+
import { type DiagnosticBundle } from './catalogue';
|
|
12
|
+
import { type ExpectedInstallStatus } from './support-matrix';
|
|
13
|
+
import { type DiagnosticScope } from './types';
|
|
14
|
+
/** Requested filters; an absent filter means all. */
|
|
15
|
+
export interface PrimitiveDiagnosticsFilters {
|
|
16
|
+
kinds?: readonly PrimitiveKind[];
|
|
17
|
+
targets?: readonly TargetType[];
|
|
18
|
+
scopes?: readonly DiagnosticScope[];
|
|
19
|
+
}
|
|
20
|
+
/** One install case: a bundle on a target at a scope. */
|
|
21
|
+
export interface PlannedCase {
|
|
22
|
+
/** `${bundle}__${target}__${scope}`. */
|
|
23
|
+
id: string;
|
|
24
|
+
bundle: string;
|
|
25
|
+
/** Distinct item kinds, in bundle item order. */
|
|
26
|
+
kinds: PrimitiveKind[];
|
|
27
|
+
/** The bundle's items, in bundle order: the subjects of per-item case checks. */
|
|
28
|
+
items: {
|
|
29
|
+
path: string;
|
|
30
|
+
kind: PrimitiveKind;
|
|
31
|
+
}[];
|
|
32
|
+
target: TargetType;
|
|
33
|
+
scope: DiagnosticScope;
|
|
34
|
+
expectedStatus: ExpectedInstallStatus;
|
|
35
|
+
}
|
|
36
|
+
/** What a run executes. */
|
|
37
|
+
export interface PrimitiveDiagnosticsPlan {
|
|
38
|
+
/** Effective filters: de-duplicated, in enum order. */
|
|
39
|
+
filters: {
|
|
40
|
+
kinds: PrimitiveKind[];
|
|
41
|
+
targets: TargetType[];
|
|
42
|
+
scopes: DiagnosticScope[];
|
|
43
|
+
};
|
|
44
|
+
/** Filter kinds no catalogued bundle contains (none with the default catalogue). */
|
|
45
|
+
notCovered: {
|
|
46
|
+
kinds: PrimitiveKind[];
|
|
47
|
+
};
|
|
48
|
+
/** Catalogue order. */
|
|
49
|
+
bundles: DiagnosticBundle[];
|
|
50
|
+
/** Bundle, then TARGET_TYPES, then DIAGNOSTIC_SCOPES order. */
|
|
51
|
+
cases: PlannedCase[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Plan a primitive diagnostics run.
|
|
55
|
+
* @param filters - Requested filters.
|
|
56
|
+
* @param catalogue - Bundles to choose from.
|
|
57
|
+
* @returns The plan; `bundles` is empty when nothing matches.
|
|
58
|
+
*/
|
|
59
|
+
export declare function planPrimitiveDiagnostics(filters: PrimitiveDiagnosticsFilters, catalogue?: readonly DiagnosticBundle[]): PrimitiveDiagnosticsPlan;
|
|
60
|
+
//# sourceMappingURL=planner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../../../src/domain/diagnostics/primitives/planner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,SAAS,CAAC;AAEjB,qDAAqD;AACrD,MAAM,WAAW,2BAA2B;IAC1C,KAAK,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CACrC;AAED,yDAAyD;AACzD,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,iFAAiF;IACjF,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,aAAa,CAAA;KAAE,EAAE,CAAC;IAC/C,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,eAAe,CAAC;IACvB,cAAc,EAAE,qBAAqB,CAAC;CACvC;AAED,2BAA2B;AAC3B,MAAM,WAAW,wBAAwB;IACvC,uDAAuD;IACvD,OAAO,EAAE;QAAE,KAAK,EAAE,aAAa,EAAE,CAAC;QAAC,OAAO,EAAE,UAAU,EAAE,CAAC;QAAC,MAAM,EAAE,eAAe,EAAE,CAAA;KAAE,CAAC;IACtF,oFAAoF;IACpF,UAAU,EAAE;QAAE,KAAK,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;IACvC,uBAAuB;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,+DAA+D;IAC/D,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAaD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,2BAA2B,EACpC,SAAS,GAAE,SAAS,gBAAgB,EAAiC,GACpE,wBAAwB,CA8B1B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.planPrimitiveDiagnostics = planPrimitiveDiagnostics;
|
|
4
|
+
/**
|
|
5
|
+
* Domain layer — primitive diagnostics planner.
|
|
6
|
+
*
|
|
7
|
+
* Turns the `--kinds/--targets/--scopes` filters into the bundles to build
|
|
8
|
+
* and the cases to run. Filters select cases only; they never change an
|
|
9
|
+
* expected outcome.
|
|
10
|
+
* @module domain/diagnostics/primitives/planner
|
|
11
|
+
*/
|
|
12
|
+
const target_1 = require("../../install/target");
|
|
13
|
+
const types_1 = require("../../primitive/types");
|
|
14
|
+
const catalogue_1 = require("./catalogue");
|
|
15
|
+
const support_matrix_1 = require("./support-matrix");
|
|
16
|
+
const types_2 = require("./types");
|
|
17
|
+
/**
|
|
18
|
+
* De-duplicate and re-sort values into enum order.
|
|
19
|
+
* @param order - Enum values in canonical order.
|
|
20
|
+
* @param values - Requested values.
|
|
21
|
+
* @returns The requested values in canonical order.
|
|
22
|
+
*/
|
|
23
|
+
const inEnumOrder = (order, values) => order.filter((value) => values.includes(value));
|
|
24
|
+
const kindsOf = (bundle) => [...new Set(bundle.items.map((item) => item.kind))];
|
|
25
|
+
/**
|
|
26
|
+
* Plan a primitive diagnostics run.
|
|
27
|
+
* @param filters - Requested filters.
|
|
28
|
+
* @param catalogue - Bundles to choose from.
|
|
29
|
+
* @returns The plan; `bundles` is empty when nothing matches.
|
|
30
|
+
*/
|
|
31
|
+
function planPrimitiveDiagnostics(filters, catalogue = catalogue_1.PRIMITIVE_DIAGNOSTIC_BUNDLES) {
|
|
32
|
+
const cataloguedKinds = new Set(catalogue.flatMap((bundle) => kindsOf(bundle)));
|
|
33
|
+
const kinds = inEnumOrder(types_1.PRIMITIVE_KINDS, filters.kinds ?? [...cataloguedKinds]);
|
|
34
|
+
const targets = inEnumOrder(target_1.TARGET_TYPES, filters.targets ?? target_1.TARGET_TYPES);
|
|
35
|
+
const scopes = inEnumOrder(types_2.DIAGNOSTIC_SCOPES, filters.scopes ?? types_2.DIAGNOSTIC_SCOPES);
|
|
36
|
+
const bundles = catalogue.filter((bundle) => kindsOf(bundle).every((kind) => kinds.includes(kind)));
|
|
37
|
+
// An invalid bundle is only validated and built: it has no install cases.
|
|
38
|
+
const cases = bundles.filter((bundle) => bundle.rejection === undefined).flatMap((bundle) => {
|
|
39
|
+
const bundleKinds = kindsOf(bundle);
|
|
40
|
+
return targets.flatMap((target) => {
|
|
41
|
+
const status = (0, support_matrix_1.expectedStatus)(bundleKinds, target);
|
|
42
|
+
return scopes.map((scope) => ({
|
|
43
|
+
id: `${bundle.id}__${target}__${scope}`,
|
|
44
|
+
bundle: bundle.id,
|
|
45
|
+
kinds: [...bundleKinds],
|
|
46
|
+
items: bundle.items.map((item) => ({ path: item.path, kind: item.kind })),
|
|
47
|
+
target,
|
|
48
|
+
scope,
|
|
49
|
+
expectedStatus: status
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
filters: { kinds, targets, scopes },
|
|
55
|
+
notCovered: { kinds: kinds.filter((kind) => !cataloguedKinds.has(kind)) },
|
|
56
|
+
bundles,
|
|
57
|
+
cases
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=planner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner.js","sourceRoot":"","sources":["../../../../src/domain/diagnostics/primitives/planner.ts"],"names":[],"mappings":";;AA+EA,4DAiCC;AAhHD;;;;;;;GAOG;AACH,iDAG8B;AAC9B,iDAG+B;AAC/B,2CAGqB;AACrB,qDAG0B;AAC1B,mCAGiB;AAmCjB;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAmB,KAAmB,EAAE,MAAoB,EAAO,EAAE,CACvF,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAElD,MAAM,OAAO,GAAG,CAAC,MAAwB,EAAmB,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEnH;;;;;G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AM,CAAC,EAAE;gBACjB,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC;gBACvB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;gBACzE,MAAM;gBACN,KAAK;gBACL,cAAc,EAAE,MAAM;aACvB,CAAC,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE;QACnC,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE;QACzE,OAAO;QACP,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { SnapshotRoot } from '../../../ports/primitive-diagnostics-driver';
|
|
2
|
+
import type { TargetType } from '../../install/target';
|
|
3
|
+
import type { FixtureItem } from './catalogue';
|
|
4
|
+
import type { DiagnosticCheck, DiagnosticScope } from './types';
|
|
5
|
+
/** Inputs of the projection checks of one installed case. */
|
|
6
|
+
export interface PluginProjectionInput {
|
|
7
|
+
target: TargetType;
|
|
8
|
+
/** Effective scope of the install. */
|
|
9
|
+
scope: DiagnosticScope;
|
|
10
|
+
/** The bundle's plugin items (`item.plugin` set). */
|
|
11
|
+
items: readonly FixtureItem[];
|
|
12
|
+
/** Archived installable files per item path. */
|
|
13
|
+
archivedItemFiles: ReadonlyMap<string, readonly string[]>;
|
|
14
|
+
/** Non-bookkeeping labels the install added or modified. */
|
|
15
|
+
changed: ReadonlySet<string>;
|
|
16
|
+
/** Text of the changed files, by label; absent entries count as unreadable. */
|
|
17
|
+
installedText: ReadonlyMap<string, string>;
|
|
18
|
+
/** Snapshot roots of the case; needed to resolve the installed plugin root. */
|
|
19
|
+
roots?: readonly SnapshotRoot[];
|
|
20
|
+
}
|
|
21
|
+
/** Projection checks and the labels they account for. */
|
|
22
|
+
export interface PluginProjection {
|
|
23
|
+
/** I11, one per plugin item. */
|
|
24
|
+
skills: DiagnosticCheck[];
|
|
25
|
+
/** I12, one per plugin item. */
|
|
26
|
+
servers: DiagnosticCheck[];
|
|
27
|
+
/** I14, one per plugin item. */
|
|
28
|
+
resolution: DiagnosticCheck[];
|
|
29
|
+
/** Labels I11 expects and config files I12 matched: I13 does not report them as unexpected. */
|
|
30
|
+
projected: ReadonlySet<string>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Evaluate I11, I12 and I14 for the plugin items of an installed case.
|
|
34
|
+
* @param input - What the install placed, per item.
|
|
35
|
+
* @returns One check per plugin item and invariant, and the labels they account for.
|
|
36
|
+
*/
|
|
37
|
+
export declare function evaluatePluginProjection(input: PluginProjectionInput): PluginProjection;
|
|
38
|
+
//# sourceMappingURL=plugin-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-projection.d.ts","sourceRoot":"","sources":["../../../../src/domain/diagnostics/primitives/plugin-projection.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,YAAY,EACb,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EACV,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,aAAa,CAAC;AAarB,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAEhB,MAAM,SAAS,CAAC;AAEjB,6DAA6D;AAC7D,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,UAAU,CAAC;IACnB,sCAAsC;IACtC,KAAK,EAAE,eAAe,CAAC;IACvB,qDAAqD;IACrD,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IAC9B,gDAAgD;IAChD,iBAAiB,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IAC1D,4DAA4D;IAC5D,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,+EAA+E;IAC/E,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,+EAA+E;IAC/E,KAAK,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CACjC;AAED,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,gCAAgC;IAChC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,gCAAgC;IAChC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,+FAA+F;IAC/F,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAChC;AA+DD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,qBAAqB,GAAG,gBAAgB,CA8DvF"}
|
|
@@ -0,0 +1,173 @@
|
|
|
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.evaluatePluginProjection = evaluatePluginProjection;
|
|
37
|
+
/**
|
|
38
|
+
* Domain layer — Agent Plugin projection checks of the primitive diagnostics.
|
|
39
|
+
*
|
|
40
|
+
* What an installed plugin item must provide beyond its copied directory
|
|
41
|
+
* (ADR-0009, #549): each plugin skill projected into the target's skills
|
|
42
|
+
* route (I11), each plugin MCP server projected into a target config file
|
|
43
|
+
* (I12), and `${PLUGIN_ROOT}` in each projected server resolved to the
|
|
44
|
+
* installed plugin root (I14). Only these facts are checked: the config
|
|
45
|
+
* file's path and format, and the projected server's exact name, are left
|
|
46
|
+
* to the target (a server counts as projected under its own name or an
|
|
47
|
+
* owned form ending in `:<name>` or `__<name>`).
|
|
48
|
+
*
|
|
49
|
+
* Observed values are names (never per-target labels), so one known gap
|
|
50
|
+
* covers every target and scope. Pure functions: no I/O.
|
|
51
|
+
* @module domain/diagnostics/primitives/plugin-projection
|
|
52
|
+
*/
|
|
53
|
+
const path = __importStar(require("node:path"));
|
|
54
|
+
const fixture_1 = require("./fixture");
|
|
55
|
+
const placements_1 = require("./placements");
|
|
56
|
+
const sandbox_1 = require("./sandbox");
|
|
57
|
+
const isObject = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
58
|
+
const check = (invariant, item, key, names, reason) => (names.length === 0
|
|
59
|
+
? { invariant, outcome: 'pass', item }
|
|
60
|
+
: { invariant, outcome: 'fail', item, observed: { [key]: [...names].toSorted() }, detail: `${reason}: ${names.join(', ')}` });
|
|
61
|
+
/**
|
|
62
|
+
* Whether a config key names a server: its own name or an owned form.
|
|
63
|
+
* @param key - Property key.
|
|
64
|
+
* @param name - Server name.
|
|
65
|
+
* @returns True for `<name>`, `…:<name>` and `…__<name>`.
|
|
66
|
+
*/
|
|
67
|
+
const namesServer = (key, name) => key === name || key.endsWith(`:${name}`) || key.endsWith(`__${name}`);
|
|
68
|
+
/**
|
|
69
|
+
* Collect every object-valued property, at any depth, whose key names the server.
|
|
70
|
+
* @param value - Parsed JSON.
|
|
71
|
+
* @param name - Server name.
|
|
72
|
+
* @param out - Accumulator.
|
|
73
|
+
*/
|
|
74
|
+
const collectEntries = (value, name, out) => {
|
|
75
|
+
if (Array.isArray(value)) {
|
|
76
|
+
for (const entry of value) {
|
|
77
|
+
collectEntries(entry, name, out);
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (!isObject(value)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
for (const [key, child] of Object.entries(value)) {
|
|
85
|
+
if (isObject(child) && namesServer(key, name)) {
|
|
86
|
+
out.push(child);
|
|
87
|
+
}
|
|
88
|
+
collectEntries(child, name, out);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const parseJson = (text) => {
|
|
92
|
+
try {
|
|
93
|
+
return JSON.parse(text);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Strings a server is launched with: its args, env values and cwd.
|
|
101
|
+
* @param entry - Projected server entry.
|
|
102
|
+
* @returns The strings.
|
|
103
|
+
*/
|
|
104
|
+
const launchStrings = (entry) => [
|
|
105
|
+
...(Array.isArray(entry.args) ? entry.args.filter((arg) => typeof arg === 'string') : []),
|
|
106
|
+
...(isObject(entry.env) ? Object.values(entry.env).filter((value) => typeof value === 'string') : []),
|
|
107
|
+
...(typeof entry.cwd === 'string' ? [entry.cwd] : [])
|
|
108
|
+
];
|
|
109
|
+
/**
|
|
110
|
+
* Evaluate I11, I12 and I14 for the plugin items of an installed case.
|
|
111
|
+
* @param input - What the install placed, per item.
|
|
112
|
+
* @returns One check per plugin item and invariant, and the labels they account for.
|
|
113
|
+
*/
|
|
114
|
+
function evaluatePluginProjection(input) {
|
|
115
|
+
const { target, scope, changed, installedText } = input;
|
|
116
|
+
const projected = new Set();
|
|
117
|
+
const result = { skills: [], servers: [], resolution: [], projected };
|
|
118
|
+
// Plugin skills land where the target's own skill items do (e.g. `$HOME/.config/devin/skills/` for Devin at user scope).
|
|
119
|
+
const skillOverride = placements_1.PLACEMENT_OVERRIDES[target]?.[scope]?.skill;
|
|
120
|
+
const skillRoot = skillOverride?.root ?? placements_1.PLACEMENT_ROOTS[target][scope];
|
|
121
|
+
const skillRoute = skillOverride?.route ?? placements_1.PLACEMENT_ROUTES[target].skill;
|
|
122
|
+
for (const item of input.items) {
|
|
123
|
+
const components = item.plugin;
|
|
124
|
+
const archived = input.archivedItemFiles.get(item.path) ?? [];
|
|
125
|
+
const pluginRoot = `${path.posix.dirname(item.path)}/`;
|
|
126
|
+
const rootDestination = (0, placements_1.expectedDestination)(target, scope, item, pluginRoot);
|
|
127
|
+
const rootLabel = rootDestination.kind === 'file' ? rootDestination.label : undefined;
|
|
128
|
+
// I11 — every file of each plugin skill lands under the target's skills route.
|
|
129
|
+
if (skillRoute === undefined || skillRoute === 'config') {
|
|
130
|
+
result.skills.push({ invariant: 'I11', outcome: 'not-applicable', item: item.path, detail: 'not applicable: the target has no skills route' });
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const unprojectedSkills = components.skills.filter((skill) => {
|
|
134
|
+
const prefix = `${pluginRoot}skills/${skill}/`;
|
|
135
|
+
const labels = archived.filter((file) => file.startsWith(prefix))
|
|
136
|
+
.map((file) => `${skillRoot}/${skillRoute}${skill}/${file.slice(prefix.length)}`);
|
|
137
|
+
for (const label of labels) {
|
|
138
|
+
projected.add(label);
|
|
139
|
+
}
|
|
140
|
+
return labels.length === 0 || labels.some((label) => !changed.has(label));
|
|
141
|
+
});
|
|
142
|
+
result.skills.push(check('I11', item.path, 'unprojected', unprojectedSkills, 'plugin skills not projected into the skills route'));
|
|
143
|
+
}
|
|
144
|
+
// I12 — each plugin MCP server is merged into a config file outside the plugin root.
|
|
145
|
+
const entries = new Map(components.mcpServers.map((name) => [name, []]));
|
|
146
|
+
for (const label of [...changed].toSorted()) {
|
|
147
|
+
const text = installedText.get(label);
|
|
148
|
+
if (!label.endsWith('.json') || (rootLabel !== undefined && label.startsWith(rootLabel)) || text === undefined) {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
const parsed = parseJson(text);
|
|
152
|
+
for (const [name, found] of entries) {
|
|
153
|
+
const before = found.length;
|
|
154
|
+
collectEntries(parsed, name, found);
|
|
155
|
+
if (found.length > before) {
|
|
156
|
+
projected.add(label);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const unprojectedServers = [...entries].filter(([, found]) => found.length === 0).map(([name]) => name);
|
|
161
|
+
result.servers.push(check('I12', item.path, 'unprojected', unprojectedServers, 'plugin MCP servers not projected into a config file'));
|
|
162
|
+
// I14 — a projected server has no ${PLUGIN_ROOT} left and is launched with the installed plugin root.
|
|
163
|
+
const rootPath = rootLabel === undefined || input.roots === undefined
|
|
164
|
+
? undefined
|
|
165
|
+
: (0, sandbox_1.resolveSandboxLabel)(input.roots, rootLabel.replace(/\/$/, ''));
|
|
166
|
+
const unresolved = [...entries].filter(([, found]) => !found.some((entry) => !JSON.stringify(entry).includes(fixture_1.PLUGIN_ROOT_PLACEHOLDER)
|
|
167
|
+
&& rootPath !== undefined
|
|
168
|
+
&& launchStrings(entry).some((value) => value.includes(rootPath)))).map(([name]) => name);
|
|
169
|
+
result.resolution.push(check('I14', item.path, 'unresolved', unresolved, `${fixture_1.PLUGIN_ROOT_PLACEHOLDER} not resolved to the installed plugin root`));
|
|
170
|
+
}
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=plugin-projection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-projection.js","sourceRoot":"","sources":["../../../../src/domain/diagnostics/primitives/plugin-projection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2IA,4DA8DC;AAzMD;;;;;;;;;;;;;;;GAeG;AACH,gDAAkC;AAUlC,uCAEmB;AACnB,6CAKsB;AACtB,uCAEmB;AAsCnB,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAuB,EAAE,CACvD,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEvE,MAAM,KAAK,GAAG,CAAC,SAAsB,EAAE,IAAY,EAAE,GAAW,EAAE,KAAwB,EAAE,MAAc,EAAmB,EAAE,CAC7H,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;IACjB,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;IACtC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC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