@ai-primitives-hub/app 0.2.1 → 0.2.2-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/collection/affected-collections.d.ts +11 -0
- package/dist/collection/affected-collections.d.ts.map +1 -0
- package/dist/collection/affected-collections.js +90 -0
- package/dist/collection/affected-collections.js.map +1 -0
- package/dist/collection/create-plugin.d.ts +35 -0
- package/dist/collection/create-plugin.d.ts.map +1 -0
- package/dist/collection/create-plugin.js +118 -0
- package/dist/collection/create-plugin.js.map +1 -0
- package/dist/collection/index.d.ts +4 -2
- package/dist/collection/index.d.ts.map +1 -1
- package/dist/collection/index.js +8 -4
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/kind-route-warning.d.ts +13 -0
- package/dist/collection/kind-route-warning.d.ts.map +1 -0
- package/dist/collection/kind-route-warning.js +40 -0
- package/dist/collection/kind-route-warning.js.map +1 -0
- package/dist/collection/plugin-item-issues.d.ts +36 -0
- package/dist/collection/plugin-item-issues.d.ts.map +1 -0
- package/dist/collection/plugin-item-issues.js +31 -0
- package/dist/collection/plugin-item-issues.js.map +1 -0
- package/dist/collection/read-collection.d.ts +1 -1
- package/dist/collection/read-collection.d.ts.map +1 -1
- package/dist/collection/read-collection.js +14 -15
- package/dist/collection/read-collection.js.map +1 -1
- package/dist/collection-editor/collection-contribution-workflow.d.ts +96 -0
- package/dist/collection-editor/collection-contribution-workflow.d.ts.map +1 -0
- package/dist/collection-editor/collection-contribution-workflow.js +479 -0
- package/dist/collection-editor/collection-contribution-workflow.js.map +1 -0
- package/dist/collection-editor/collection-editor-service.d.ts +232 -0
- package/dist/collection-editor/collection-editor-service.d.ts.map +1 -0
- package/dist/collection-editor/collection-editor-service.js +868 -0
- package/dist/collection-editor/collection-editor-service.js.map +1 -0
- package/dist/collection-editor/index.d.ts +7 -0
- package/dist/collection-editor/index.d.ts.map +1 -0
- package/dist/collection-editor/index.js +12 -0
- package/dist/collection-editor/index.js.map +1 -0
- package/dist/diagnostics/find-ancestor-file.d.ts +13 -0
- package/dist/diagnostics/find-ancestor-file.d.ts.map +1 -0
- package/dist/diagnostics/find-ancestor-file.js +85 -0
- package/dist/diagnostics/find-ancestor-file.js.map +1 -0
- package/dist/diagnostics/index.d.ts +10 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +26 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/diagnostics/run-primitive-diagnostics.d.ts +43 -0
- package/dist/diagnostics/run-primitive-diagnostics.d.ts.map +1 -0
- package/dist/diagnostics/run-primitive-diagnostics.js +413 -0
- package/dist/diagnostics/run-primitive-diagnostics.js.map +1 -0
- package/dist/diagnostics/sandbox-snapshot.d.ts +20 -0
- package/dist/diagnostics/sandbox-snapshot.d.ts.map +1 -0
- package/dist/diagnostics/sandbox-snapshot.js +117 -0
- package/dist/diagnostics/sandbox-snapshot.js.map +1 -0
- package/dist/governance/generate-catalogue.d.ts +16 -0
- package/dist/governance/generate-catalogue.d.ts.map +1 -0
- package/dist/governance/generate-catalogue.js +67 -0
- package/dist/governance/generate-catalogue.js.map +1 -0
- package/dist/governance/hub-scoped-governance.d.ts +37 -0
- package/dist/governance/hub-scoped-governance.d.ts.map +1 -0
- package/dist/governance/hub-scoped-governance.js +110 -0
- package/dist/governance/hub-scoped-governance.js.map +1 -0
- package/dist/governance/index.d.ts +10 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +26 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/load-config.d.ts +45 -0
- package/dist/governance/load-config.d.ts.map +1 -0
- package/dist/governance/load-config.js +137 -0
- package/dist/governance/load-config.js.map +1 -0
- package/dist/governance/pr-scope.d.ts +23 -0
- package/dist/governance/pr-scope.d.ts.map +1 -0
- package/dist/governance/pr-scope.js +22 -0
- package/dist/governance/pr-scope.js.map +1 -0
- package/dist/governance/report.d.ts +23 -0
- package/dist/governance/report.d.ts.map +1 -0
- package/dist/governance/report.js +177 -0
- package/dist/governance/report.js.map +1 -0
- package/dist/governance/run-governance.d.ts +22 -0
- package/dist/governance/run-governance.d.ts.map +1 -0
- package/dist/governance/run-governance.js +78 -0
- package/dist/governance/run-governance.js.map +1 -0
- package/dist/governance/source-checks.d.ts +29 -0
- package/dist/governance/source-checks.d.ts.map +1 -0
- package/dist/governance/source-checks.js +80 -0
- package/dist/governance/source-checks.js.map +1 -0
- package/dist/governance/validate-collection-governance.d.ts +46 -0
- package/dist/governance/validate-collection-governance.d.ts.map +1 -0
- package/dist/governance/validate-collection-governance.js +291 -0
- package/dist/governance/validate-collection-governance.js.map +1 -0
- package/dist/hub-editor/hub-config-editor-service.d.ts +94 -0
- package/dist/hub-editor/hub-config-editor-service.d.ts.map +1 -0
- package/dist/hub-editor/hub-config-editor-service.js +289 -0
- package/dist/hub-editor/hub-config-editor-service.js.map +1 -0
- package/dist/hub-editor/hub-contribution-workflow.d.ts +99 -0
- package/dist/hub-editor/hub-contribution-workflow.d.ts.map +1 -0
- package/dist/hub-editor/hub-contribution-workflow.js +385 -0
- package/dist/hub-editor/hub-contribution-workflow.js.map +1 -0
- package/dist/hub-editor/index.d.ts +7 -0
- package/dist/hub-editor/index.d.ts.map +1 -0
- package/dist/hub-editor/index.js +23 -0
- package/dist/hub-editor/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/install/index.d.ts +2 -0
- package/dist/install/index.d.ts.map +1 -1
- package/dist/install/index.js +3 -1
- package/dist/install/index.js.map +1 -1
- package/dist/install/partial-target-write.d.ts +63 -0
- package/dist/install/partial-target-write.d.ts.map +1 -0
- package/dist/install/partial-target-write.js +128 -0
- package/dist/install/partial-target-write.js.map +1 -0
- package/dist/install/pipeline.d.ts +2 -1
- package/dist/install/pipeline.d.ts.map +1 -1
- package/dist/install/pipeline.js +4 -3
- package/dist/install/pipeline.js.map +1 -1
- package/dist/install/target-write.d.ts +10 -0
- package/dist/install/target-write.d.ts.map +1 -1
- package/dist/install/target-write.js +3 -2
- package/dist/install/target-write.js.map +1 -1
- package/dist/install/uninstall-pipeline.d.ts +11 -10
- package/dist/install/uninstall-pipeline.d.ts.map +1 -1
- package/dist/install/uninstall-pipeline.js +10 -11
- package/dist/install/uninstall-pipeline.js.map +1 -1
- package/dist/records/atomic-write.d.ts +11 -0
- package/dist/records/atomic-write.d.ts.map +1 -0
- package/dist/records/atomic-write.js +66 -0
- package/dist/records/atomic-write.js.map +1 -0
- package/dist/records/confine-path.d.ts +35 -0
- package/dist/records/confine-path.d.ts.map +1 -0
- package/dist/records/confine-path.js +140 -0
- package/dist/records/confine-path.js.map +1 -0
- package/dist/records/git-root.d.ts +66 -0
- package/dist/records/git-root.d.ts.map +1 -0
- package/dist/records/git-root.js +208 -0
- package/dist/records/git-root.js.map +1 -0
- package/dist/records/index.d.ts +30 -0
- package/dist/records/index.d.ts.map +1 -0
- package/dist/records/index.js +46 -0
- package/dist/records/index.js.map +1 -0
- package/dist/records/install-record-service.d.ts +496 -0
- package/dist/records/install-record-service.d.ts.map +1 -0
- package/dist/records/install-record-service.js +1365 -0
- package/dist/records/install-record-service.js.map +1 -0
- package/dist/records/install-record-services.d.ts +29 -0
- package/dist/records/install-record-services.d.ts.map +1 -0
- package/dist/records/install-record-services.js +17 -0
- package/dist/records/install-record-services.js.map +1 -0
- package/dist/records/legacy-shapes.d.ts +18 -0
- package/dist/records/legacy-shapes.d.ts.map +1 -0
- package/dist/records/legacy-shapes.js +30 -0
- package/dist/records/legacy-shapes.js.map +1 -0
- package/dist/records/map-tool-to-target.d.ts +33 -0
- package/dist/records/map-tool-to-target.d.ts.map +1 -0
- package/dist/records/map-tool-to-target.js +98 -0
- package/dist/records/map-tool-to-target.js.map +1 -0
- package/dist/records/mcp-servers.d.ts +116 -0
- package/dist/records/mcp-servers.d.ts.map +1 -0
- package/dist/records/mcp-servers.js +268 -0
- package/dist/records/mcp-servers.js.map +1 -0
- package/dist/records/modified-files.d.ts +32 -0
- package/dist/records/modified-files.d.ts.map +1 -0
- package/dist/records/modified-files.js +146 -0
- package/dist/records/modified-files.js.map +1 -0
- package/dist/records/plan-record-entries.d.ts +76 -0
- package/dist/records/plan-record-entries.d.ts.map +1 -0
- package/dist/records/plan-record-entries.js +84 -0
- package/dist/records/plan-record-entries.js.map +1 -0
- package/dist/records/read-record-text.d.ts +15 -0
- package/dist/records/read-record-text.d.ts.map +1 -0
- package/dist/records/read-record-text.js +36 -0
- package/dist/records/read-record-text.js.map +1 -0
- package/dist/records/record-entry.d.ts +31 -0
- package/dist/records/record-entry.d.ts.map +1 -0
- package/dist/records/record-entry.js +81 -0
- package/dist/records/record-entry.js.map +1 -0
- package/dist/records/record-file-shape.d.ts +90 -0
- package/dist/records/record-file-shape.d.ts.map +1 -0
- package/dist/records/record-file-shape.js +288 -0
- package/dist/records/record-file-shape.js.map +1 -0
- package/dist/records/record-hub.d.ts +42 -0
- package/dist/records/record-hub.d.ts.map +1 -0
- package/dist/records/record-hub.js +85 -0
- package/dist/records/record-hub.js.map +1 -0
- package/dist/records/record-identity.d.ts +14 -0
- package/dist/records/record-identity.d.ts.map +1 -0
- package/dist/records/record-identity.js +41 -0
- package/dist/records/record-identity.js.map +1 -0
- package/dist/records/record-migration.d.ts +118 -0
- package/dist/records/record-migration.d.ts.map +1 -0
- package/dist/records/record-migration.js +454 -0
- package/dist/records/record-migration.js.map +1 -0
- package/dist/records/record-store.d.ts +123 -0
- package/dist/records/record-store.d.ts.map +1 -0
- package/dist/records/record-store.js +291 -0
- package/dist/records/record-store.js.map +1 -0
- package/dist/records/resolve-record-source.d.ts +64 -0
- package/dist/records/resolve-record-source.d.ts.map +1 -0
- package/dist/records/resolve-record-source.js +160 -0
- package/dist/records/resolve-record-source.js.map +1 -0
- package/dist/records/sanitize-source.d.ts +18 -0
- package/dist/records/sanitize-source.d.ts.map +1 -0
- package/dist/records/sanitize-source.js +90 -0
- package/dist/records/sanitize-source.js.map +1 -0
- package/dist/records/select-record.d.ts +54 -0
- package/dist/records/select-record.d.ts.map +1 -0
- package/dist/records/select-record.js +180 -0
- package/dist/records/select-record.js.map +1 -0
- package/dist/records/serialize-record.d.ts +20 -0
- package/dist/records/serialize-record.d.ts.map +1 -0
- package/dist/records/serialize-record.js +100 -0
- package/dist/records/serialize-record.js.map +1 -0
- package/dist/records/source-fields.d.ts +21 -0
- package/dist/records/source-fields.d.ts.map +1 -0
- package/dist/records/source-fields.js +28 -0
- package/dist/records/source-fields.js.map +1 -0
- package/dist/records/to-record-source.d.ts +23 -0
- package/dist/records/to-record-source.d.ts.map +1 -0
- package/dist/records/to-record-source.js +39 -0
- package/dist/records/to-record-source.js.map +1 -0
- package/dist/records/user-home.d.ts +16 -0
- package/dist/records/user-home.d.ts.map +1 -0
- package/dist/records/user-home.js +84 -0
- package/dist/records/user-home.js.map +1 -0
- package/dist/records/writer-group.d.ts +7 -0
- package/dist/records/writer-group.d.ts.map +1 -0
- package/dist/records/writer-group.js +31 -0
- package/dist/records/writer-group.js.map +1 -0
- package/dist/registry/activate-registry-profile.d.ts.map +1 -1
- package/dist/registry/activate-registry-profile.js +4 -1
- package/dist/registry/activate-registry-profile.js.map +1 -1
- package/dist/registry/batch-install-profile.d.ts +76 -0
- package/dist/registry/batch-install-profile.d.ts.map +1 -0
- package/dist/registry/batch-install-profile.js +67 -0
- package/dist/registry/batch-install-profile.js.map +1 -0
- package/dist/registry/create-source-adapter.d.ts +16 -1
- package/dist/registry/create-source-adapter.d.ts.map +1 -1
- package/dist/registry/create-source-adapter.js +76 -3
- package/dist/registry/create-source-adapter.js.map +1 -1
- package/dist/registry/hub-manager.d.ts +41 -0
- package/dist/registry/hub-manager.d.ts.map +1 -1
- package/dist/registry/hub-manager.js +82 -4
- package/dist/registry/hub-manager.js.map +1 -1
- package/dist/registry/index.d.ts +1 -0
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -0
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/install-registry-bundle.js +4 -3
- package/dist/registry/install-registry-bundle.js.map +1 -1
- package/dist/registry/list-installed-bundles.d.ts +2 -3
- package/dist/registry/list-installed-bundles.d.ts.map +1 -1
- package/dist/registry/list-installed-bundles.js.map +1 -1
- package/dist/registry/load-hub-sources.d.ts +8 -0
- package/dist/registry/load-hub-sources.d.ts.map +1 -1
- package/dist/registry/load-hub-sources.js +70 -3
- package/dist/registry/load-hub-sources.js.map +1 -1
- package/dist/registry/profile-lifecycle.d.ts +7 -2
- package/dist/registry/profile-lifecycle.d.ts.map +1 -1
- package/dist/registry/profile-lifecycle.js +82 -11
- package/dist/registry/profile-lifecycle.js.map +1 -1
- package/dist/registry/uninstall-installed-bundle.d.ts +2 -3
- package/dist/registry/uninstall-installed-bundle.d.ts.map +1 -1
- package/dist/registry/uninstall-installed-bundle.js.map +1 -1
- package/dist/registry/update-registry-bundle.d.ts +2 -2
- package/dist/registry/update-registry-bundle.js +2 -2
- package/dist/registry/update-registry-bundle.js.map +1 -1
- package/dist/registry/validate-hub-config-file.d.ts +14 -1
- package/dist/registry/validate-hub-config-file.d.ts.map +1 -1
- package/dist/registry/validate-hub-config-file.js +81 -44
- package/dist/registry/validate-hub-config-file.js.map +1 -1
- package/dist/release/plan-bundle-release.d.ts +6 -12
- package/dist/release/plan-bundle-release.d.ts.map +1 -1
- package/dist/release/plan-bundle-release.js +178 -7
- package/dist/release/plan-bundle-release.js.map +1 -1
- package/dist/replicate/replicate.d.ts +5 -2
- package/dist/replicate/replicate.d.ts.map +1 -1
- package/dist/replicate/replicate.js +121 -17
- package/dist/replicate/replicate.js.map +1 -1
- package/dist/security/index.d.ts +4 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +22 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/rating/bundle-discovery.d.ts +19 -0
- package/dist/security/rating/bundle-discovery.d.ts.map +1 -0
- package/dist/security/rating/bundle-discovery.js +244 -0
- package/dist/security/rating/bundle-discovery.js.map +1 -0
- package/dist/security/rating/index.d.ts +5 -0
- package/dist/security/rating/index.d.ts.map +1 -0
- package/dist/security/rating/index.js +21 -0
- package/dist/security/rating/index.js.map +1 -0
- package/dist/security/rating/security-rating-markdown.d.ts +17 -0
- package/dist/security/rating/security-rating-markdown.d.ts.map +1 -0
- package/dist/security/rating/security-rating-markdown.js +131 -0
- package/dist/security/rating/security-rating-markdown.js.map +1 -0
- package/dist/security/rating/security-rating-scan.d.ts +23 -0
- package/dist/security/rating/security-rating-scan.d.ts.map +1 -0
- package/dist/security/rating/security-rating-scan.js +40 -0
- package/dist/security/rating/security-rating-scan.js.map +1 -0
- package/dist/security/rating/security-rating-templates.d.ts +40 -0
- package/dist/security/rating/security-rating-templates.d.ts.map +1 -0
- package/dist/security/rating/security-rating-templates.js +83 -0
- package/dist/security/rating/security-rating-templates.js.map +1 -0
- package/dist/security/rating/security-rating.d.ts +32 -0
- package/dist/security/rating/security-rating.d.ts.map +1 -0
- package/dist/security/rating/security-rating.js +94 -0
- package/dist/security/rating/security-rating.js.map +1 -0
- package/dist/security/security-scan-use-case.d.ts +101 -0
- package/dist/security/security-scan-use-case.d.ts.map +1 -0
- package/dist/security/security-scan-use-case.js +185 -0
- package/dist/security/security-scan-use-case.js.map +1 -0
- package/dist/stores/json-lockfile-store.d.ts.map +1 -1
- package/dist/stores/json-lockfile-store.js +6 -32
- package/dist/stores/json-lockfile-store.js.map +1 -1
- package/dist/transform/transformer-registry.d.ts.map +1 -1
- package/dist/transform/transformer-registry.js +3 -0
- package/dist/transform/transformer-registry.js.map +1 -1
- package/dist/transform/transformers/windsurf-transformer.d.ts +5 -0
- package/dist/transform/transformers/windsurf-transformer.d.ts.map +1 -1
- package/dist/transform/transformers/windsurf-transformer.js.map +1 -1
- package/dist/writers/file-tree-writer.d.ts +14 -1
- package/dist/writers/file-tree-writer.d.ts.map +1 -1
- package/dist/writers/file-tree-writer.js +23 -71
- package/dist/writers/file-tree-writer.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
import { type InstallRecord, type RecordChange, type RecordedMcpServer, type RecordFs, type RecordLevel, type RecordLocation, type SourceType, type ToolEntry } from '@ai-primitives-hub/core';
|
|
2
|
+
import { type McpConfigFile, type McpServerToWrite } from './mcp-servers';
|
|
3
|
+
import { type RecordHubInput } from './record-hub';
|
|
4
|
+
import type { RecordStore } from './record-store';
|
|
5
|
+
/** Every `SourceType` value, the only `sourceType` a new entry may carry. */
|
|
6
|
+
export declare const RECORD_SOURCE_TYPES: readonly SourceType[];
|
|
7
|
+
/** Source details passed to `recordInstall`, with the key they are recorded under. */
|
|
8
|
+
export interface RecordSourceInput {
|
|
9
|
+
sourceId: string;
|
|
10
|
+
/** Must equal `RecordInstallInput.sourceType`. */
|
|
11
|
+
type: string;
|
|
12
|
+
/** Credentials are removed before it is recorded. */
|
|
13
|
+
url: string;
|
|
14
|
+
branch?: string;
|
|
15
|
+
collectionsPath?: string;
|
|
16
|
+
indexFile?: string;
|
|
17
|
+
authMode?: string;
|
|
18
|
+
credentialRef?: string;
|
|
19
|
+
/** Any other field is dropped, never recorded. */
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
/** Input of {@link InstallRecordService.recordInstall}. */
|
|
23
|
+
export interface RecordInstallInput {
|
|
24
|
+
/** File the entry is recorded in. */
|
|
25
|
+
location: RecordLocation;
|
|
26
|
+
bundleId: string;
|
|
27
|
+
version: string;
|
|
28
|
+
/** The target's type, never the user's target name. */
|
|
29
|
+
tool: string;
|
|
30
|
+
source: RecordSourceInput;
|
|
31
|
+
/** The hub named by `source.hubId`, recorded under `hubs`; a hub that is not shareable is ignored. */
|
|
32
|
+
hub?: RecordHubInput;
|
|
33
|
+
/** A `SourceType` value equal to `source.type`. */
|
|
34
|
+
sourceType: string;
|
|
35
|
+
/** The writer's `written` list, as absolute paths. */
|
|
36
|
+
writtenPaths: readonly string[];
|
|
37
|
+
/** Workspace root the writer installed into, where merged MCP configs sit; defaults to the record's root. */
|
|
38
|
+
workspaceRoot?: string;
|
|
39
|
+
/** Collection, manifest or index id of the bundle, recorded as the bundle `name` without its version. */
|
|
40
|
+
name?: string;
|
|
41
|
+
/** The downloaded bundle's files by bundle path: give the entry its `integrity` and each file its `sourcePath`. */
|
|
42
|
+
bundleFiles?: ReadonlyMap<string, Uint8Array>;
|
|
43
|
+
/**
|
|
44
|
+
* MCP servers the install wrote, `config` relative to the record's root. A
|
|
45
|
+
* server the replaced entry had and this list lacks is removed after the save;
|
|
46
|
+
* absent keeps the replaced entry's servers.
|
|
47
|
+
*/
|
|
48
|
+
mcpServers?: readonly RecordedMcpServer[];
|
|
49
|
+
/**
|
|
50
|
+
* Which sibling tools that share this tool's files to bring to the same version:
|
|
51
|
+
* all (default), the accepted ones, or none. Pass `false` when re-recording a sibling, so the sync never loops.
|
|
52
|
+
*/
|
|
53
|
+
syncSiblings?: boolean | ((tool: string) => boolean);
|
|
54
|
+
}
|
|
55
|
+
/** One sibling entry found by the shared-folder sync. */
|
|
56
|
+
export interface SiblingSync {
|
|
57
|
+
tool: string;
|
|
58
|
+
/** Its version now: the new one when synced, the old one otherwise. */
|
|
59
|
+
version: string;
|
|
60
|
+
/** The file that holds the sibling. */
|
|
61
|
+
location: RecordLocation;
|
|
62
|
+
/** `false` when `syncSiblings` did not accept the tool, so the entry is out of date. */
|
|
63
|
+
synced: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** Outcome of {@link InstallRecordService.recordInstall}. */
|
|
66
|
+
export interface RecordInstallResult extends RecordChange {
|
|
67
|
+
/** Non-fatal problems from the saves, for the caller to log. */
|
|
68
|
+
warnings: string[];
|
|
69
|
+
/** Sibling entries found by the shared-folder sync, sorted by tool; empty for an uninstall. */
|
|
70
|
+
siblings: SiblingSync[];
|
|
71
|
+
}
|
|
72
|
+
/** One `status` row: one (bundle, tool) entry of a record file. */
|
|
73
|
+
export interface StatusRow {
|
|
74
|
+
bundleId: string;
|
|
75
|
+
tool: string;
|
|
76
|
+
level: RecordLevel;
|
|
77
|
+
version: string;
|
|
78
|
+
/** Absolute path of the record file the entry is in. */
|
|
79
|
+
record: string;
|
|
80
|
+
/** `true` for an entry under the `unknown` tool that must be reinstalled. */
|
|
81
|
+
needsReinstall: boolean;
|
|
82
|
+
/** The shared hub the entry's source came from, when recorded. */
|
|
83
|
+
hubId?: string;
|
|
84
|
+
}
|
|
85
|
+
/** One tool entry of a bundle, with the record file holding it. */
|
|
86
|
+
export interface LocatedToolEntry {
|
|
87
|
+
location: RecordLocation;
|
|
88
|
+
bundleId: string;
|
|
89
|
+
tool: string;
|
|
90
|
+
entry: ToolEntry;
|
|
91
|
+
}
|
|
92
|
+
/** Input of {@link InstallRecordService.uninstallEntry}. */
|
|
93
|
+
export interface UninstallEntryInput {
|
|
94
|
+
/** A record file holding the entry; for a repository file both files at its root are read. */
|
|
95
|
+
location: RecordLocation;
|
|
96
|
+
bundleId: string;
|
|
97
|
+
tool: string;
|
|
98
|
+
/** More root-relative paths to keep. */
|
|
99
|
+
keep?: ReadonlySet<string>;
|
|
100
|
+
}
|
|
101
|
+
/** Outcome of {@link InstallRecordService.uninstallEntry}. */
|
|
102
|
+
export interface UninstallEntryResult {
|
|
103
|
+
change: RecordInstallResult;
|
|
104
|
+
/** Root-relative files removed. */
|
|
105
|
+
deleted: string[];
|
|
106
|
+
/** Root-relative files kept: listed by another entry, modified, missing or in `keep`. */
|
|
107
|
+
kept: string[];
|
|
108
|
+
/** Kept files still on disk whose content changed since the install, sorted. */
|
|
109
|
+
modified: string[];
|
|
110
|
+
/** MCP servers removed from their files. */
|
|
111
|
+
mcpServersRemoved: RecordedMcpServer[];
|
|
112
|
+
/** MCP servers kept because their definition changed since the install. */
|
|
113
|
+
mcpServersModified: RecordedMcpServer[];
|
|
114
|
+
warnings: string[];
|
|
115
|
+
}
|
|
116
|
+
/** Outcome of {@link InstallRecordService.deleteSuperseded}. */
|
|
117
|
+
export interface DeleteSupersededResult {
|
|
118
|
+
/** Root-relative paths that were removed. */
|
|
119
|
+
deleted: string[];
|
|
120
|
+
/** MCP servers removed from their files. */
|
|
121
|
+
mcpServersRemoved: RecordedMcpServer[];
|
|
122
|
+
/** MCP servers kept because their definition changed since the install. */
|
|
123
|
+
mcpServersModified: RecordedMcpServer[];
|
|
124
|
+
/** One message per path or server that was skipped or could not be removed. */
|
|
125
|
+
warnings: string[];
|
|
126
|
+
}
|
|
127
|
+
/** Input of {@link InstallRecordService.moveEntry}. */
|
|
128
|
+
export interface MoveEntryInput {
|
|
129
|
+
/** The repository file holding the entry now. */
|
|
130
|
+
location: RecordLocation;
|
|
131
|
+
bundleId: string;
|
|
132
|
+
tool: string;
|
|
133
|
+
}
|
|
134
|
+
/** Outcome of {@link InstallRecordService.moveEntry}. */
|
|
135
|
+
export interface MoveEntryResult {
|
|
136
|
+
from: RecordLocation;
|
|
137
|
+
to: RecordLocation;
|
|
138
|
+
/** Root-relative files only the replaced entries listed, for `deleteSuperseded` at `to`; sorted. */
|
|
139
|
+
deletedFiles: string[];
|
|
140
|
+
/** Root-relative files of the replaced entries another entry still lists; sorted. */
|
|
141
|
+
keptSharedFiles: string[];
|
|
142
|
+
warnings: string[];
|
|
143
|
+
}
|
|
144
|
+
/** The configured source a remapped id points to: `RecordSourceInput` without the key. */
|
|
145
|
+
export interface RecordSourceDescriptor {
|
|
146
|
+
/** A `SourceType` value. */
|
|
147
|
+
type: string;
|
|
148
|
+
/** Source URL; credentials are removed before it is recorded. */
|
|
149
|
+
url: string;
|
|
150
|
+
branch?: string;
|
|
151
|
+
collectionsPath?: string;
|
|
152
|
+
indexFile?: string;
|
|
153
|
+
authMode?: string;
|
|
154
|
+
credentialRef?: string;
|
|
155
|
+
/** Any other field is dropped, never recorded. */
|
|
156
|
+
[key: string]: unknown;
|
|
157
|
+
}
|
|
158
|
+
/** Input of {@link InstallRecordService.remapSource}. */
|
|
159
|
+
export interface RemapSourceInput {
|
|
160
|
+
/** Repository root whose two record files are rewritten. */
|
|
161
|
+
root: string;
|
|
162
|
+
from: string;
|
|
163
|
+
to: string;
|
|
164
|
+
/** Fields recorded under `sources.<to>`; a missing `hubId` keeps the one recorded for `from`. */
|
|
165
|
+
descriptor: RecordSourceDescriptor;
|
|
166
|
+
/** Fields of the retired source, for records that name it by its readable id. */
|
|
167
|
+
fromDescriptor?: RecordSourceDescriptor;
|
|
168
|
+
/** The hub named by the source's `hubId`, recorded under `hubs`. */
|
|
169
|
+
hub?: RecordHubInput;
|
|
170
|
+
}
|
|
171
|
+
/** Outcome of {@link InstallRecordService.remapSource}. */
|
|
172
|
+
export interface RemapSourceResult {
|
|
173
|
+
/** Record files that changed and were saved, committed first. */
|
|
174
|
+
changed: RecordLocation[];
|
|
175
|
+
warnings: string[];
|
|
176
|
+
}
|
|
177
|
+
/** Dependencies of an {@link InstallRecordService}. */
|
|
178
|
+
export interface InstallRecordServiceOptions {
|
|
179
|
+
/** Record store; loads and saves both repository files. */
|
|
180
|
+
store: RecordStore;
|
|
181
|
+
/** Filesystem port used for confinement, checksums and deletions. */
|
|
182
|
+
fs: RecordFs;
|
|
183
|
+
/** Clock for `installedAt`; defaults to the current time. */
|
|
184
|
+
now?: () => Date;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Whether a git-root-relative path is exactly a merged MCP config file of the
|
|
188
|
+
* install's workspace; a same-named bundle file elsewhere is still recorded.
|
|
189
|
+
* @param relative - Path relative to the git root.
|
|
190
|
+
* @param workspacePrefix - Workspace root relative to the git root; `''` when they are the same.
|
|
191
|
+
*/
|
|
192
|
+
export declare const isMergedMcpConfigPath: (relative: string, workspacePrefix?: string) => boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Whether a bundle's only entry at a level is `unknown`: migrated, and not reinstalled by any tool.
|
|
195
|
+
* @param tools - Tool keys of the bundle's entries at the level.
|
|
196
|
+
*/
|
|
197
|
+
export declare const isLoneUnknown: (tools: Iterable<string>) => boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Every installed path listed by any entry of the given records.
|
|
200
|
+
* @param records - Records to scan.
|
|
201
|
+
*/
|
|
202
|
+
export declare const listedPaths: (records: readonly InstallRecord[]) => Set<string>;
|
|
203
|
+
/**
|
|
204
|
+
* Every MCP server any entry of the records lists, as {@link mcpServerKeyOf} keys.
|
|
205
|
+
* @param records - Records of one level.
|
|
206
|
+
*/
|
|
207
|
+
export declare const listedMcpServers: (records: readonly InstallRecord[]) => Set<string>;
|
|
208
|
+
/** Records installs and uninstalls in the shared install record. */
|
|
209
|
+
export declare class InstallRecordService {
|
|
210
|
+
private readonly store;
|
|
211
|
+
private readonly fs;
|
|
212
|
+
private readonly now;
|
|
213
|
+
constructor(options: InstallRecordServiceOptions);
|
|
214
|
+
/**
|
|
215
|
+
* The paths to delete that another entry lists through an aliased parent
|
|
216
|
+
* folder: both name the same file, so it is still owned. Parent folders are
|
|
217
|
+
* resolved and the leaf name kept; an unresolvable parent compares as written.
|
|
218
|
+
* @param root - Level root.
|
|
219
|
+
* @param deleted - Paths to delete.
|
|
220
|
+
* @param listed - Paths the level's entries still list.
|
|
221
|
+
*/
|
|
222
|
+
private aliasedListedPaths;
|
|
223
|
+
private validateInput;
|
|
224
|
+
/**
|
|
225
|
+
* A written path relative to the root; falls back to real paths when the root is behind a symlink.
|
|
226
|
+
* @param root - Level root.
|
|
227
|
+
* @param written - Absolute path from the writer.
|
|
228
|
+
*/
|
|
229
|
+
private toRelative;
|
|
230
|
+
/**
|
|
231
|
+
* The workspace root relative to the record root; `''` when the same or not below it.
|
|
232
|
+
* @param root - Level root.
|
|
233
|
+
* @param workspaceRoot - Workspace root the writer installed into.
|
|
234
|
+
*/
|
|
235
|
+
private workspacePrefix;
|
|
236
|
+
/**
|
|
237
|
+
* Recorded files for the writer's `written` list: confined, checksummed, merged MCP configs left out.
|
|
238
|
+
* @param root - Level root.
|
|
239
|
+
* @param writtenPaths - Absolute paths from the writer.
|
|
240
|
+
* @param workspaceRoot - Workspace root the writer installed into.
|
|
241
|
+
* @param bundleIndex - The downloaded bundle's files, to give each file its `sourcePath`.
|
|
242
|
+
*/
|
|
243
|
+
private toRecordedFiles;
|
|
244
|
+
private removeEntry;
|
|
245
|
+
/**
|
|
246
|
+
* Remove the tool's entries keyed by the bundle id or by another id with the same identity.
|
|
247
|
+
* @param record - Record file to change.
|
|
248
|
+
* @param bundleId - Key of the new entry.
|
|
249
|
+
* @param identity - Identity of the new entry.
|
|
250
|
+
* @param tool - The target's type.
|
|
251
|
+
*/
|
|
252
|
+
private removeSameIdentity;
|
|
253
|
+
private dropUnusedSource;
|
|
254
|
+
private clearUnknown;
|
|
255
|
+
/**
|
|
256
|
+
* Save a record file, without the `hubs` entries no source names.
|
|
257
|
+
* @param location - Record file.
|
|
258
|
+
* @param record - Its content.
|
|
259
|
+
*/
|
|
260
|
+
private save;
|
|
261
|
+
/**
|
|
262
|
+
* Save a changed record file, or remove a repository file with no bundles left.
|
|
263
|
+
* An empty user record is kept so its import marker survives.
|
|
264
|
+
* @param other - The loaded, changed file.
|
|
265
|
+
*/
|
|
266
|
+
private saveOther;
|
|
267
|
+
/**
|
|
268
|
+
* Bring sibling entries that share the installed tool's files to its version, in memory.
|
|
269
|
+
* A sibling held under another key of the same identity moves to the installed key.
|
|
270
|
+
* @param loaded - The target file, then the other repository file.
|
|
271
|
+
* @param change - What the installed tool wrote.
|
|
272
|
+
* @param change.bundleId - Bundle id.
|
|
273
|
+
* @param change.identity - Its bundle identity.
|
|
274
|
+
* @param change.tool - The installed tool.
|
|
275
|
+
* @param change.sourceId - Readable id of its source; another source's entry is not a sibling.
|
|
276
|
+
* @param change.version - Its new version.
|
|
277
|
+
* @param change.integrity - The new version's bundle integrity, when known.
|
|
278
|
+
* @param change.files - Its new recorded files.
|
|
279
|
+
* @param change.previousPaths - Paths its previous entry listed.
|
|
280
|
+
* @param change.accepts - Which sibling tools to sync.
|
|
281
|
+
* @returns The siblings found, sorted by tool, and the files changed.
|
|
282
|
+
*/
|
|
283
|
+
private syncSiblingEntries;
|
|
284
|
+
/**
|
|
285
|
+
* Tool entries of the given record files, one per level, root, bundle and
|
|
286
|
+
* tool; an entry in both repository files at one root comes from the committed file.
|
|
287
|
+
* @param locations - Record files to read.
|
|
288
|
+
* @param bundleId - Only this bundle's entries, when given.
|
|
289
|
+
* @param tool - Only this tool's entries, when given.
|
|
290
|
+
*/
|
|
291
|
+
private locateEntries;
|
|
292
|
+
/**
|
|
293
|
+
* Record that a tool installed a bundle, moving the entry out of the other
|
|
294
|
+
* repository file, syncing siblings and clearing the bundle's `unknown` entry.
|
|
295
|
+
* The tool's entries with the same bundle identity in either file are
|
|
296
|
+
* replaced. Saves the target file first; deletes nothing.
|
|
297
|
+
* @param input - Install to record.
|
|
298
|
+
* @returns The change, with the superseded files to delete after the save and the siblings found.
|
|
299
|
+
* @throws {RegistryError} A `RECORD.*` error; the record is unchanged when the target save fails.
|
|
300
|
+
*/
|
|
301
|
+
recordInstall(input: RecordInstallInput): Promise<RecordInstallResult>;
|
|
302
|
+
/**
|
|
303
|
+
* Refuse, before any file is written, an install of a source the record holds from another hub.
|
|
304
|
+
* @param location - Record file the install will change.
|
|
305
|
+
* @param source - Source to record.
|
|
306
|
+
* @param hub - The hub named by `source.hubId`.
|
|
307
|
+
* @throws {RegistryError} `RECORD.HUB_CONFLICT`, or any `RECORD.*` load error.
|
|
308
|
+
*/
|
|
309
|
+
checkSourceHub(location: RecordLocation, source: RecordSourceInput, hub?: RecordHubInput): Promise<void>;
|
|
310
|
+
private applyInstall;
|
|
311
|
+
/**
|
|
312
|
+
* Record that a tool's install of a bundle was removed, from whichever
|
|
313
|
+
* repository file holds it. Paths another entry still lists go to
|
|
314
|
+
* `keptSharedFiles`. Deletes no installed file.
|
|
315
|
+
* @param input - Location, bundle id and tool.
|
|
316
|
+
* @param input.location - Either repository record location; both files at its root are read.
|
|
317
|
+
* @param input.bundleId - Bundle id.
|
|
318
|
+
* @param input.tool - The target's type.
|
|
319
|
+
* @throws {RegistryError} `RECORD.ENTRY_NOT_FOUND` when neither file has the entry.
|
|
320
|
+
*/
|
|
321
|
+
recordUninstall(input: {
|
|
322
|
+
location: RecordLocation;
|
|
323
|
+
bundleId: string;
|
|
324
|
+
tool: string;
|
|
325
|
+
}): Promise<RecordInstallResult>;
|
|
326
|
+
private applyUninstall;
|
|
327
|
+
/**
|
|
328
|
+
* Uninstall one tool's entry and delete its files, keeping files another
|
|
329
|
+
* entry lists, files changed or missing since the install, and `keep`.
|
|
330
|
+
* @param input - The file holding the entry, the bundle id, the tool and extra paths to keep.
|
|
331
|
+
* @throws {RegistryError} `RECORD.ENTRY_NOT_FOUND`, or any `RECORD.*` load or save error.
|
|
332
|
+
*/
|
|
333
|
+
uninstallEntry(input: UninstallEntryInput): Promise<UninstallEntryResult>;
|
|
334
|
+
/**
|
|
335
|
+
* Bundles whose only entries across the given record files, under any key
|
|
336
|
+
* of the same identity, are `unknown`, each with its entry.
|
|
337
|
+
* @param locations - Record files of one level, committed first.
|
|
338
|
+
* @throws {RegistryError} Any `RECORD.*` error from loading a file.
|
|
339
|
+
*/
|
|
340
|
+
findLoneUnknown(locations: readonly RecordLocation[]): Promise<Map<string, LocatedToolEntry>>;
|
|
341
|
+
/**
|
|
342
|
+
* Remove a bundle's `unknown` entry, and those of the same identity under
|
|
343
|
+
* other keys, keeping every file they list, since no tool is known to own them.
|
|
344
|
+
* @param location - A record file of the level.
|
|
345
|
+
* @param bundleId - Bundle id.
|
|
346
|
+
* @throws {RegistryError} `RECORD.ENTRY_NOT_FOUND` when no file has the entry, or another `RECORD.*` error.
|
|
347
|
+
*/
|
|
348
|
+
removeUnknownEntry(location: RecordLocation, bundleId: string): Promise<UninstallEntryResult>;
|
|
349
|
+
/**
|
|
350
|
+
* Move one tool's entry, unchanged, between the committed and the local-only
|
|
351
|
+
* repository file. The tool's entries with the same bundle identity in the
|
|
352
|
+
* target are replaced, so its copy from an interrupted move is too. The
|
|
353
|
+
* target is saved first; deletes nothing.
|
|
354
|
+
* @param input - The file holding the entry, the bundle id and the tool.
|
|
355
|
+
* @returns Both files, with the replaced entries' files to delete after the save.
|
|
356
|
+
* @throws {RegistryError} `RECORD.ENTRY_NOT_FOUND` or `RECORD.MALFORMED`, or any `RECORD.*` load or save error.
|
|
357
|
+
*/
|
|
358
|
+
moveEntry(input: MoveEntryInput): Promise<MoveEntryResult>;
|
|
359
|
+
private applyMove;
|
|
360
|
+
/**
|
|
361
|
+
* Rewrite a source id, and the matching entries' `sourceType`, in both
|
|
362
|
+
* repository files at a root. Both files load before anything is saved, and
|
|
363
|
+
* running it again is a no-op.
|
|
364
|
+
* @param input - Root, the two ids and the source fields for `to`.
|
|
365
|
+
* @throws {RegistryError} `RECORD.MALFORMED` for a bad id or source, or any `RECORD.*` load or save error.
|
|
366
|
+
*/
|
|
367
|
+
remapSource(input: RemapSourceInput): Promise<RemapSourceResult>;
|
|
368
|
+
/**
|
|
369
|
+
* One status row per (bundle, tool) entry of the given record files, sorted.
|
|
370
|
+
* An entry in both repository files at one root is listed once.
|
|
371
|
+
* @param locations - Record files to list.
|
|
372
|
+
* @throws {RegistryError} Any `RECORD.*` error from loading a file.
|
|
373
|
+
*/
|
|
374
|
+
listEntries(locations: readonly RecordLocation[]): Promise<StatusRow[]>;
|
|
375
|
+
/**
|
|
376
|
+
* A bundle's tool entries in the given record files, in file order.
|
|
377
|
+
* @param locations - Record files to search, committed first.
|
|
378
|
+
* @param bundleId - Bundle id.
|
|
379
|
+
* @param tool - Only this tool's entry, when given.
|
|
380
|
+
* @throws {RegistryError} Any `RECORD.*` error from loading a file.
|
|
381
|
+
*/
|
|
382
|
+
findEntries(locations: readonly RecordLocation[], bundleId: string, tool?: string): Promise<LocatedToolEntry[]>;
|
|
383
|
+
/**
|
|
384
|
+
* Every tool entry of every bundle in the given record files, in file order.
|
|
385
|
+
* @param locations - Record files to list.
|
|
386
|
+
* @throws {RegistryError} Any `RECORD.*` error from loading a file.
|
|
387
|
+
*/
|
|
388
|
+
listToolEntries(locations: readonly RecordLocation[]): Promise<LocatedToolEntry[]>;
|
|
389
|
+
/**
|
|
390
|
+
* The record file that holds the entry, so a re-record keeps its commit mode.
|
|
391
|
+
* @param locations - Record files to search, committed first.
|
|
392
|
+
* @param bundleId - Bundle id.
|
|
393
|
+
* @param tool - Tool key.
|
|
394
|
+
* @returns The file holding the entry, the committed one when both do.
|
|
395
|
+
* @throws {RegistryError} Any `RECORD.*` error from loading a file.
|
|
396
|
+
*/
|
|
397
|
+
holdingLocation(locations: readonly RecordLocation[], bundleId: string, tool: string): Promise<RecordLocation | undefined>;
|
|
398
|
+
/**
|
|
399
|
+
* Recorded paths by bundle id for every bundle with an entry for `tool`, merged across the files.
|
|
400
|
+
* @param locations - Record files to read.
|
|
401
|
+
* @param tool - Tool key.
|
|
402
|
+
* @throws {RegistryError} Any `RECORD.*` error from loading a file.
|
|
403
|
+
*/
|
|
404
|
+
entriesForTool(locations: readonly RecordLocation[], tool: string): Promise<Map<string, string[]>>;
|
|
405
|
+
/**
|
|
406
|
+
* Delete the files of a saved change. Only regular files and symlinks are
|
|
407
|
+
* removed; anything refused or failing becomes a warning.
|
|
408
|
+
* @param change - The saved change.
|
|
409
|
+
*/
|
|
410
|
+
deleteSuperseded(change: Pick<RecordChange, 'deletedFiles' | 'location' | 'removedMcpServers'>): Promise<DeleteSupersededResult>;
|
|
411
|
+
/**
|
|
412
|
+
* Write a bundle's MCP servers into a tool's MCP file under the level root. A
|
|
413
|
+
* name the file has is replaced only when an entry of the level records it.
|
|
414
|
+
* @param input - The level's record file, the MCP file and the servers.
|
|
415
|
+
* @param input.location - Record file the install is recorded in.
|
|
416
|
+
* @param input.file - The tool's MCP file; it must be inside the level root.
|
|
417
|
+
* @param input.servers - Servers to write.
|
|
418
|
+
* @returns The servers as recorded, `config` relative to the level root.
|
|
419
|
+
* @throws {RegistryError} `RECORD.PATH_OUTSIDE_ROOT`, `RECORD.MCP_CONFLICT` or `RECORD.MCP_CONFIG_UNREADABLE`; the file is then unchanged.
|
|
420
|
+
*/
|
|
421
|
+
writeMcpServers(input: {
|
|
422
|
+
location: RecordLocation;
|
|
423
|
+
file: McpConfigFile;
|
|
424
|
+
servers: readonly McpServerToWrite[];
|
|
425
|
+
}): Promise<RecordedMcpServer[]>;
|
|
426
|
+
/**
|
|
427
|
+
* Check that servers can be written into a tool's MCP file, writing nothing, so
|
|
428
|
+
* an install can refuse before it writes its other files.
|
|
429
|
+
* @param input - The level's record file, the MCP file and the servers.
|
|
430
|
+
* @param input.location - Record file the install is recorded in.
|
|
431
|
+
* @param input.file - The tool's MCP file; it must be inside the level root.
|
|
432
|
+
* @param input.servers - Servers to write.
|
|
433
|
+
* @throws {RegistryError} `RECORD.PATH_OUTSIDE_ROOT`, `RECORD.MCP_CONFLICT` or `RECORD.MCP_CONFIG_UNREADABLE`.
|
|
434
|
+
*/
|
|
435
|
+
checkMcpServers(input: {
|
|
436
|
+
location: RecordLocation;
|
|
437
|
+
file: McpConfigFile;
|
|
438
|
+
servers: readonly McpServerToWrite[];
|
|
439
|
+
}): Promise<void>;
|
|
440
|
+
/**
|
|
441
|
+
* Add MCP servers to an entry that already exists, as a migration from another
|
|
442
|
+
* store of them does. Servers the entry lists are left as they are.
|
|
443
|
+
* @param input - Record file, bundle id, tool and servers.
|
|
444
|
+
* @param input.location - Either record file of the level; both repository files are searched.
|
|
445
|
+
* @param input.bundleId - Bundle id.
|
|
446
|
+
* @param input.tool - Tool key.
|
|
447
|
+
* @param input.servers - Servers to add, `config` relative to the level root.
|
|
448
|
+
* @returns `true` when an entry took the servers.
|
|
449
|
+
* @throws {RegistryError} Any `RECORD.*` load or save error.
|
|
450
|
+
*/
|
|
451
|
+
addMcpServers(input: {
|
|
452
|
+
location: RecordLocation;
|
|
453
|
+
bundleId: string;
|
|
454
|
+
tool: string;
|
|
455
|
+
servers: readonly RecordedMcpServer[];
|
|
456
|
+
}): Promise<boolean>;
|
|
457
|
+
/**
|
|
458
|
+
* Every MCP server the entries of a level list for one MCP file, by name, with
|
|
459
|
+
* the bundle id of an entry listing it.
|
|
460
|
+
* @param location - Either record file of the level.
|
|
461
|
+
* @param file - The tool's MCP file; a file outside the level root has none.
|
|
462
|
+
* @throws {RegistryError} Any `RECORD.*` load error.
|
|
463
|
+
*/
|
|
464
|
+
recordedMcpServersIn(location: RecordLocation, file: string): Promise<Map<string, string>>;
|
|
465
|
+
/**
|
|
466
|
+
* Describe servers another writer put in a tool's MCP file, as an entry records them.
|
|
467
|
+
* Names the file does not have are left out.
|
|
468
|
+
* @param root - Level root.
|
|
469
|
+
* @param file - The tool's MCP file; it must be inside the level root.
|
|
470
|
+
* @param servers - Server names with the bundle item each came from.
|
|
471
|
+
* @throws {RegistryError} `RECORD.PATH_OUTSIDE_ROOT` or `RECORD.MCP_CONFIG_UNREADABLE`.
|
|
472
|
+
*/
|
|
473
|
+
describeMcpServers(root: string, file: McpConfigFile, servers: readonly {
|
|
474
|
+
name: string;
|
|
475
|
+
item?: string;
|
|
476
|
+
}[]): Promise<RecordedMcpServer[]>;
|
|
477
|
+
/**
|
|
478
|
+
* Remove recorded MCP servers from their files under a level root, keeping
|
|
479
|
+
* those whose definition changed; a file outside the root is never touched.
|
|
480
|
+
* @param root - Level root the `config` paths are relative to.
|
|
481
|
+
* @param servers - Servers to remove.
|
|
482
|
+
*/
|
|
483
|
+
removeRecordedMcpServers(root: string, servers: readonly RecordedMcpServer[]): Promise<{
|
|
484
|
+
removed: RecordedMcpServer[];
|
|
485
|
+
modified: RecordedMcpServer[];
|
|
486
|
+
warnings: string[];
|
|
487
|
+
}>;
|
|
488
|
+
/**
|
|
489
|
+
* Delete the superseded files of several changes saved in one run, keeping
|
|
490
|
+
* any path a later change listed again.
|
|
491
|
+
* @param changes - The saved changes, in order.
|
|
492
|
+
* @throws {RegistryError} Any `RECORD.*` error from loading a file.
|
|
493
|
+
*/
|
|
494
|
+
deleteSupersededAfterAll(changes: readonly Pick<RecordChange, 'deletedFiles' | 'location' | 'removedMcpServers'>[]): Promise<DeleteSupersededResult>;
|
|
495
|
+
}
|
|
496
|
+
//# sourceMappingURL=install-record-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-record-service.d.ts","sourceRoot":"","sources":["../../src/records/install-record-service.ts"],"names":[],"mappings":"AAYA,OAAO,EAGL,KAAK,aAAa,EAGlB,KAAK,YAAY,EAEjB,KAAK,iBAAiB,EAEtB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EAInB,KAAK,UAAU,EAEf,KAAK,SAAS,EAGf,MAAM,yBAAyB,CAAC;AAcjC,OAAO,EAEL,KAAK,aAAa,EAGlB,KAAK,gBAAgB,EAItB,MAAM,eAAe,CAAC;AAkBvB,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAEV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAmBxB,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,EAAE,SAAS,UAAU,EAAkD,CAAC;AAExG,sFAAsF;AACtF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,2DAA2D;AAC3D,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,i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