@agentxm/extension-lifecycle 0.28.4-bootstrap.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/LICENSE +110 -0
- package/dist/src/configured-entry-resolution.d.ts +110 -0
- package/dist/src/configured-entry-resolution.js +723 -0
- package/dist/src/errors.d.ts +39 -0
- package/dist/src/errors.js +45 -0
- package/dist/src/failure-adapter.d.ts +35 -0
- package/dist/src/failure-adapter.js +23 -0
- package/dist/src/hooks/configured-agent-outcomes-provider.d.ts +18 -0
- package/dist/src/hooks/configured-agent-outcomes-provider.js +39 -0
- package/dist/src/hooks/manager.d.ts +15 -0
- package/dist/src/hooks/manager.js +751 -0
- package/dist/src/index.d.ts +38 -0
- package/dist/src/index.js +41 -0
- package/dist/src/internal/fs-helpers.d.ts +12 -0
- package/dist/src/internal/fs-helpers.js +13 -0
- package/dist/src/internal/integrity.d.ts +13 -0
- package/dist/src/internal/integrity.js +17 -0
- package/dist/src/knowledge/manager.d.ts +11 -0
- package/dist/src/knowledge/manager.js +655 -0
- package/dist/src/live.d.ts +18 -0
- package/dist/src/live.js +18 -0
- package/dist/src/mcps/manager.d.ts +16 -0
- package/dist/src/mcps/manager.js +213 -0
- package/dist/src/mcps/operations/artifact.d.ts +24 -0
- package/dist/src/mcps/operations/artifact.js +74 -0
- package/dist/src/mcps/operations/disable.d.ts +18 -0
- package/dist/src/mcps/operations/disable.js +113 -0
- package/dist/src/mcps/operations/enable.d.ts +18 -0
- package/dist/src/mcps/operations/enable.js +218 -0
- package/dist/src/mcps/operations/install.d.ts +59 -0
- package/dist/src/mcps/operations/install.js +566 -0
- package/dist/src/mcps/operations/sync-outcome.d.ts +10 -0
- package/dist/src/mcps/operations/sync-outcome.js +27 -0
- package/dist/src/mcps/operations/uninstall.d.ts +41 -0
- package/dist/src/mcps/operations/uninstall.js +189 -0
- package/dist/src/packs/dependency-resolution.d.ts +65 -0
- package/dist/src/packs/dependency-resolution.js +414 -0
- package/dist/src/packs/expansion.d.ts +59 -0
- package/dist/src/packs/expansion.js +44 -0
- package/dist/src/packs/manager.d.ts +16 -0
- package/dist/src/packs/manager.js +181 -0
- package/dist/src/packs/operations/install.d.ts +67 -0
- package/dist/src/packs/operations/install.js +156 -0
- package/dist/src/packs/resolved-dependency.d.ts +29 -0
- package/dist/src/packs/resolved-dependency.js +28 -0
- package/dist/src/registry-materialization.d.ts +52 -0
- package/dist/src/registry-materialization.js +67 -0
- package/dist/src/resolution-progress.d.ts +18 -0
- package/dist/src/resolution-progress.js +11 -0
- package/dist/src/resolution-timeout.d.ts +5 -0
- package/dist/src/resolution-timeout.js +11 -0
- package/dist/src/rules/manager.d.ts +20 -0
- package/dist/src/rules/manager.js +475 -0
- package/dist/src/skills/manager.d.ts +18 -0
- package/dist/src/skills/manager.js +346 -0
- package/dist/src/skills/materialization.d.ts +54 -0
- package/dist/src/skills/materialization.js +158 -0
- package/dist/src/skills/operations/disable.d.ts +31 -0
- package/dist/src/skills/operations/disable.js +110 -0
- package/dist/src/skills/operations/enable.d.ts +31 -0
- package/dist/src/skills/operations/enable.js +113 -0
- package/dist/src/skills/operations/install-result.d.ts +33 -0
- package/dist/src/skills/operations/install-result.js +10 -0
- package/dist/src/skills/operations/install.d.ts +67 -0
- package/dist/src/skills/operations/install.js +590 -0
- package/dist/src/skills/operations/source-hash.d.ts +2 -0
- package/dist/src/skills/operations/source-hash.js +6 -0
- package/dist/src/skills/operations/uninstall.d.ts +40 -0
- package/dist/src/skills/operations/uninstall.js +157 -0
- package/dist/src/skills/utils.d.ts +11 -0
- package/dist/src/skills/utils.js +29 -0
- package/dist/src/subagents/manager.d.ts +18 -0
- package/dist/src/subagents/manager.js +677 -0
- package/dist/src/subagents/operations/artifact.d.ts +18 -0
- package/dist/src/subagents/operations/artifact.js +43 -0
- package/dist/src/subagents/operations/disable.d.ts +32 -0
- package/dist/src/subagents/operations/disable.js +116 -0
- package/dist/src/subagents/operations/enable.d.ts +30 -0
- package/dist/src/subagents/operations/enable.js +160 -0
- package/dist/src/workflows/install-command/workflow.d.ts +57 -0
- package/dist/src/workflows/install-command/workflow.js +41 -0
- package/dist/src/workflows/uninstall-command/workflow.d.ts +42 -0
- package/dist/src/workflows/uninstall-command/workflow.js +29 -0
- package/package.json +62 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pack expansion helpers for cross-type dependency expansion.
|
|
3
|
+
*
|
|
4
|
+
* - expandPackInstallRefs: Expands a pack ref into install refs (pack + dependencies)
|
|
5
|
+
*
|
|
6
|
+
* @experimental This API is unstable and may change without notice.
|
|
7
|
+
*/
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import type * as Option from "effect/Option";
|
|
10
|
+
import type { SourceAuthorityBlocked, PackManagerError } from "@agentxm/extension-workspace";
|
|
11
|
+
/** Failures pack expansion can surface. */
|
|
12
|
+
type PackExpansionError = SourceResolutionFailure | PackManagerError | SourceAuthorityBlocked;
|
|
13
|
+
import { type ExtensionType } from "@agentxm/extension-model/unstable/extensions";
|
|
14
|
+
import type { ExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/extension-ref";
|
|
15
|
+
import type { PackRef } from "@agentxm/extension-model/unstable/extensions/refs/pack";
|
|
16
|
+
import type { SourceHostProvidersService, SourceResolutionFailure } from "@agentxm/extension-sources";
|
|
17
|
+
import type * as Duration from "effect/Duration";
|
|
18
|
+
import { type PackDependencyRefResolver, type ReleaseAgeAwarePackDependencyResolution, type WorkspacePackDependencyResolver } from "./dependency-resolution.js";
|
|
19
|
+
import type { ReleaseAgeEvaluation } from "@agentxm/extension-model/unstable/extensions/release-age";
|
|
20
|
+
/**
|
|
21
|
+
* Expand a pack ref into its cross-type dependency refs.
|
|
22
|
+
*
|
|
23
|
+
* Returns the pack ref first, followed by dependency refs in declaration
|
|
24
|
+
* order. Only dependency types listed in `supportedDependencyTypes` are
|
|
25
|
+
* included.
|
|
26
|
+
*
|
|
27
|
+
* Dependency refs use the pack's registry source and empty integrity
|
|
28
|
+
* (integrity is resolved during materialization, not at expansion time).
|
|
29
|
+
*/
|
|
30
|
+
export declare const expandPackInstallRefs: <E = never>(args: {
|
|
31
|
+
readonly pack: PackRef;
|
|
32
|
+
readonly supportedDependencyTypes: ReadonlyArray<ExtensionType>;
|
|
33
|
+
readonly sources: SourceHostProvidersService;
|
|
34
|
+
readonly minimumReleaseAge?: Option.Option<Duration.Duration>;
|
|
35
|
+
readonly workspaceResolver?: WorkspacePackDependencyResolver<E>;
|
|
36
|
+
readonly dependencyResolver?: PackDependencyRefResolver<E>;
|
|
37
|
+
}) => Effect.Effect<ReadonlyArray<ExtensionRef>, PackExpansionError | E>;
|
|
38
|
+
export type ReleaseAgeAwarePackExpansion = {
|
|
39
|
+
readonly kind: "selected";
|
|
40
|
+
readonly refs: ReadonlyArray<ExtensionRef>;
|
|
41
|
+
readonly holdbacks: Extract<ReleaseAgeAwarePackDependencyResolution, {
|
|
42
|
+
kind: "selected";
|
|
43
|
+
}>["holdbacks"];
|
|
44
|
+
readonly bypasses: Extract<ReleaseAgeAwarePackDependencyResolution, {
|
|
45
|
+
kind: "selected";
|
|
46
|
+
}>["bypasses"];
|
|
47
|
+
} | Extract<ReleaseAgeAwarePackDependencyResolution, {
|
|
48
|
+
kind: "policy_held";
|
|
49
|
+
}>;
|
|
50
|
+
export declare const expandPackInstallRefsWithReleaseAge: <E = never>(args: {
|
|
51
|
+
readonly pack: PackRef;
|
|
52
|
+
readonly supportedDependencyTypes: ReadonlyArray<ExtensionType>;
|
|
53
|
+
readonly sources: SourceHostProvidersService;
|
|
54
|
+
readonly releaseAgeEvaluation: ReleaseAgeEvaluation;
|
|
55
|
+
readonly workspaceResolver?: WorkspacePackDependencyResolver<E>;
|
|
56
|
+
readonly dependencyResolver?: PackDependencyRefResolver<E>;
|
|
57
|
+
}) => Effect.Effect<ReleaseAgeAwarePackExpansion, PackExpansionError | E>;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=expansion.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pack expansion helpers for cross-type dependency expansion.
|
|
3
|
+
*
|
|
4
|
+
* - expandPackInstallRefs: Expands a pack ref into install refs (pack + dependencies)
|
|
5
|
+
*
|
|
6
|
+
* @experimental This API is unstable and may change without notice.
|
|
7
|
+
*/
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import {} from "@agentxm/extension-model/unstable/extensions";
|
|
10
|
+
import { resolvePackDependencies } from "./dependency-resolution.js";
|
|
11
|
+
import { resolvePackDependenciesWithReleaseAge, } from "./dependency-resolution.js";
|
|
12
|
+
// -----------------------------------------------------------------------------
|
|
13
|
+
// expandPackInstallRefs
|
|
14
|
+
// -----------------------------------------------------------------------------
|
|
15
|
+
/**
|
|
16
|
+
* Expand a pack ref into its cross-type dependency refs.
|
|
17
|
+
*
|
|
18
|
+
* Returns the pack ref first, followed by dependency refs in declaration
|
|
19
|
+
* order. Only dependency types listed in `supportedDependencyTypes` are
|
|
20
|
+
* included.
|
|
21
|
+
*
|
|
22
|
+
* Dependency refs use the pack's registry source and empty integrity
|
|
23
|
+
* (integrity is resolved during materialization, not at expansion time).
|
|
24
|
+
*/
|
|
25
|
+
export const expandPackInstallRefs = (args) => Effect.gen(function* () {
|
|
26
|
+
const { pack, supportedDependencyTypes, sources, minimumReleaseAge, workspaceResolver, dependencyResolver, } = args;
|
|
27
|
+
const resolved = yield* resolvePackDependencies(pack, sources, minimumReleaseAge, undefined, workspaceResolver, dependencyResolver);
|
|
28
|
+
const deps = resolved.dependencyRefs.filter((ref) => supportedDependencyTypes.includes(ref.type));
|
|
29
|
+
const packRef = pack;
|
|
30
|
+
return [packRef, ...deps];
|
|
31
|
+
});
|
|
32
|
+
export const expandPackInstallRefsWithReleaseAge = (args) => Effect.gen(function* () {
|
|
33
|
+
const resolved = yield* resolvePackDependenciesWithReleaseAge(args.pack, args.sources, args.releaseAgeEvaluation, undefined, args.workspaceResolver, args.dependencyResolver);
|
|
34
|
+
if (resolved.kind === "policy_held")
|
|
35
|
+
return resolved;
|
|
36
|
+
const dependencies = resolved.dependencies.dependencyRefs.filter((ref) => args.supportedDependencyTypes.includes(ref.type));
|
|
37
|
+
return {
|
|
38
|
+
kind: "selected",
|
|
39
|
+
refs: [args.pack, ...dependencies],
|
|
40
|
+
holdbacks: resolved.holdbacks,
|
|
41
|
+
bypasses: resolved.bypasses,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=expansion.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pack manager service.
|
|
3
|
+
*
|
|
4
|
+
* Implements ExtensionManager<PackRef>. Delegates to existing
|
|
5
|
+
* pack materialization functions and workspace service methods.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
*/
|
|
9
|
+
import * as FileSystem from "effect/FileSystem";
|
|
10
|
+
import * as Path from "effect/Path";
|
|
11
|
+
import * as Layer from "effect/Layer";
|
|
12
|
+
import { SourceHostProviders } from "@agentxm/extension-sources";
|
|
13
|
+
import { PackManager } from "@agentxm/extension-workspace";
|
|
14
|
+
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
15
|
+
export declare const PackManagerLive: Layer.Layer<PackManager, never, SourceHostProviders | WorkspaceMutations | FileSystem.FileSystem | Path.Path>;
|
|
16
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pack manager service.
|
|
3
|
+
*
|
|
4
|
+
* Implements ExtensionManager<PackRef>. Delegates to existing
|
|
5
|
+
* pack materialization functions and workspace service methods.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
*/
|
|
9
|
+
import * as FileSystem from "effect/FileSystem";
|
|
10
|
+
import * as Path from "effect/Path";
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import * as Layer from "effect/Layer";
|
|
13
|
+
import * as Option from "effect/Option";
|
|
14
|
+
import { PackArchiveFetchFailed, PackDefinitionInvalid, PackInstallStateMissing, PackStagingFailed, } from "@agentxm/extension-workspace";
|
|
15
|
+
import { canReuseInstalledPackage, replaceCanonicalDirectoryWithInspection, } from "@agentxm/extension-workspace";
|
|
16
|
+
import { configuredPacksToDiskRefs } from "@agentxm/extension-workspace";
|
|
17
|
+
import { SourceHostProviders } from "@agentxm/extension-sources";
|
|
18
|
+
import { PackManager } from "@agentxm/extension-workspace";
|
|
19
|
+
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
20
|
+
import { copyExtensionDirectory } from "@agentxm/extension-workspace";
|
|
21
|
+
import { computePackPathsForLayout } from "@agentxm/workspace-state";
|
|
22
|
+
import { removeIfExists } from "@agentxm/workspace-state";
|
|
23
|
+
import { acceptedRegistryVersionForRef, validateExactResolvedVersion, } from "@agentxm/workspace-state";
|
|
24
|
+
import { decodeVersionSync } from "@agentxm/extension-model/unstable/version-constraints";
|
|
25
|
+
import { configuredRowsByName } from "@agentxm/workspace-state";
|
|
26
|
+
import { isObservedInstalled } from "@agentxm/workspace-state";
|
|
27
|
+
import { acceptedCanonicalObservation, prepareAcceptedCanonicalTransition, removableAcceptedCanonicalPath, } from "@agentxm/workspace-state";
|
|
28
|
+
import { computePackManifestContentIdentity } from "@agentxm/workspace-state";
|
|
29
|
+
import { computeMaterializedTreeIntegrity, } from "@agentxm/workspace-state";
|
|
30
|
+
// Build pack SetPackArgs from a registry ref
|
|
31
|
+
const buildSetPackArgs = (ref, versionRange, treeIntegrity) => ({
|
|
32
|
+
type: "registry",
|
|
33
|
+
sourceType: "registry",
|
|
34
|
+
packageFormat: "agentxm",
|
|
35
|
+
endpoint: ref.source.location,
|
|
36
|
+
extensionType: "pack",
|
|
37
|
+
workspaceName: ref.pack.name,
|
|
38
|
+
owner: ref.owner,
|
|
39
|
+
name: ref.pack.name,
|
|
40
|
+
resolvedVersion: decodeVersionSync(ref.version),
|
|
41
|
+
integrity: Option.getOrElse(ref.integrity, () => ""),
|
|
42
|
+
sourceName: ref.source.name,
|
|
43
|
+
publisherBindingId: ref.publisherBindingId,
|
|
44
|
+
treeIntegrity,
|
|
45
|
+
manifestContentIdentity: computePackManifestContentIdentity({
|
|
46
|
+
owner: ref.owner,
|
|
47
|
+
type: "pack",
|
|
48
|
+
name: ref.pack.name,
|
|
49
|
+
version: ref.version,
|
|
50
|
+
dependencies: ref.pack.dependencies,
|
|
51
|
+
}),
|
|
52
|
+
versionRange,
|
|
53
|
+
});
|
|
54
|
+
// -----------------------------------------------------------------------------
|
|
55
|
+
// Live Layer
|
|
56
|
+
// -----------------------------------------------------------------------------
|
|
57
|
+
export const PackManagerLive = Layer.effect(PackManager, Effect.gen(function* () {
|
|
58
|
+
const ws = yield* WorkspaceMutations;
|
|
59
|
+
const fs = yield* FileSystem.FileSystem;
|
|
60
|
+
const path = yield* Path.Path;
|
|
61
|
+
const sources = yield* SourceHostProviders;
|
|
62
|
+
const baseDir = ws.baseDir;
|
|
63
|
+
// Build a layer to provide FileSystem + Path to inner effects
|
|
64
|
+
const fsPathLayer = Layer.merge(Layer.succeed(FileSystem.FileSystem, fs), Layer.succeed(Path.Path, path));
|
|
65
|
+
const provide = (effect) => Effect.provide(effect, fsPathLayer);
|
|
66
|
+
const lastTreeIntegrities = new Map();
|
|
67
|
+
const materializeInstall = Effect.fn("PackManager.materializeInstall")(function* ({ ref, force }) {
|
|
68
|
+
if (ref.refType === "registry") {
|
|
69
|
+
yield* validateExactResolvedVersion(`packs.${ref.pack.name}.resolvedVersion`, ref.version);
|
|
70
|
+
}
|
|
71
|
+
const packDir = computePackPathsForLayout(path.join, ws.layout, ref.refType === "workspace" ? "workspace" : ref.source.name, ref.owner, ref.pack.name).canonicalPath;
|
|
72
|
+
const canonicalExists = yield* fs.exists(packDir).pipe(Effect.orElseSucceed(() => false));
|
|
73
|
+
if (ref.refType === "workspace") {
|
|
74
|
+
if (ref.scope !== ws.scope || path.resolve(ref.location) !== path.resolve(packDir)) {
|
|
75
|
+
return yield* new PackDefinitionInvalid({
|
|
76
|
+
detail: `Invalid workspace pack source location: ${ref.location}`,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (!canonicalExists) {
|
|
80
|
+
return yield* new PackDefinitionInvalid({
|
|
81
|
+
detail: `Workspace pack package is missing: ${packDir}`,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const lockedEntry = yield* ws.getLockedPack(ref.pack.name);
|
|
87
|
+
const lockedVersion = acceptedRegistryVersionForRef(lockedEntry, ref);
|
|
88
|
+
if (yield* provide(canReuseInstalledPackage({
|
|
89
|
+
installedPath: packDir,
|
|
90
|
+
force: force === true,
|
|
91
|
+
refVersion: ref.version,
|
|
92
|
+
hasIntegrity: Option.isSome(ref.integrity),
|
|
93
|
+
...(lockedVersion === undefined ? {} : { lockedVersion }),
|
|
94
|
+
existsFailureDetail: (target) => `Failed to check if canonical pack path exists: ${target}`,
|
|
95
|
+
}))) {
|
|
96
|
+
if (Option.isSome(lockedEntry)) {
|
|
97
|
+
const observedTree = yield* provide(computeMaterializedTreeIntegrity(packDir));
|
|
98
|
+
if (observedTree === lockedEntry.value.treeIntegrity) {
|
|
99
|
+
lastTreeIntegrities.set(ref.pack.name, lockedEntry.value.treeIntegrity);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
yield* Effect.scoped(Effect.gen(function* () {
|
|
105
|
+
const fetched = yield* sources
|
|
106
|
+
.fetch(ref)
|
|
107
|
+
.pipe(Effect.mapError((e) => new PackArchiveFetchFailed({ message: e.message, cause: e })));
|
|
108
|
+
const materialized = yield* provide(replaceCanonicalDirectoryWithInspection({
|
|
109
|
+
baseDir,
|
|
110
|
+
canonicalPath: packDir,
|
|
111
|
+
populate: (stagingPath) => copyExtensionDirectory(fetched.directory, stagingPath).pipe(Effect.mapError((cause) => new PackStagingFailed({ packDir, cause }))),
|
|
112
|
+
inspect: computeMaterializedTreeIntegrity,
|
|
113
|
+
}));
|
|
114
|
+
lastTreeIntegrities.set(ref.pack.name, materialized.inspection);
|
|
115
|
+
}));
|
|
116
|
+
});
|
|
117
|
+
const materializeUninstall = Effect.fn("PackManager.materializeUninstall")(function* ({ target }) {
|
|
118
|
+
const canonical = yield* provide(acceptedCanonicalObservation({ workspace: ws, type: "pack", name: target.name }));
|
|
119
|
+
const packDir = removableAcceptedCanonicalPath(canonical);
|
|
120
|
+
if (Option.isSome(packDir))
|
|
121
|
+
yield* removeIfExists(fs, packDir.value);
|
|
122
|
+
});
|
|
123
|
+
const materializeDeactivate = () => Effect.void;
|
|
124
|
+
const buildCurrentPackArgs = (ref, versionRange) => Effect.gen(function* () {
|
|
125
|
+
if (ref.refType !== "registry")
|
|
126
|
+
return Option.none();
|
|
127
|
+
const treeIntegrity = lastTreeIntegrities.get(ref.pack.name);
|
|
128
|
+
if (treeIntegrity === undefined) {
|
|
129
|
+
return yield* new PackInstallStateMissing({ name: ref.pack.name });
|
|
130
|
+
}
|
|
131
|
+
return Option.some(buildSetPackArgs(ref, versionRange, treeIntegrity));
|
|
132
|
+
});
|
|
133
|
+
return {
|
|
134
|
+
type: "pack",
|
|
135
|
+
runTransaction: ws.runTransaction,
|
|
136
|
+
isInstalled: Effect.fn("PackManager.isInstalled")(function* ({ target, }) {
|
|
137
|
+
return yield* isObservedInstalled(ws, "pack", target.name);
|
|
138
|
+
}),
|
|
139
|
+
materializeInstall,
|
|
140
|
+
prepareSourceTransition: ({ ref }) => provide(prepareAcceptedCanonicalTransition({
|
|
141
|
+
workspace: ws,
|
|
142
|
+
type: "pack",
|
|
143
|
+
name: ref.pack.name,
|
|
144
|
+
ref,
|
|
145
|
+
})),
|
|
146
|
+
getConfiguredSource: Effect.fn("PackManager.getConfiguredSource")(function* ({ target }) {
|
|
147
|
+
const configured = yield* ws.getConfiguredPackEntries();
|
|
148
|
+
return Option.fromUndefinedOr(configured[target.name]?.source);
|
|
149
|
+
}),
|
|
150
|
+
listMaterializable: Effect.fn("PackManager.listMaterializable")(function* () {
|
|
151
|
+
const configured = yield* ws.records.rows("pack").pipe(Effect.map(configuredRowsByName));
|
|
152
|
+
return yield* configuredPacksToDiskRefs({ fs, path, baseDir, scope: ws.scope, layout: ws.layout }, configured);
|
|
153
|
+
}),
|
|
154
|
+
materializeUninstall,
|
|
155
|
+
materializeDeactivate,
|
|
156
|
+
upsertSettingsEntry: Effect.fn("PackManager.upsertSettingsEntry")(function* ({ ref, versionRange, }) {
|
|
157
|
+
const args = yield* buildCurrentPackArgs(ref, versionRange);
|
|
158
|
+
if (Option.isSome(args)) {
|
|
159
|
+
yield* ws.setPack(args.value);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
yield* ws.setPackEntry(ref.pack.name, {
|
|
163
|
+
source: "workspace",
|
|
164
|
+
enabled: true,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}),
|
|
168
|
+
removeSettingsEntry: ({ target }) => ws.removePackSettings(target.name).pipe(Effect.withSpan("PackManager.removeSettingsEntry")),
|
|
169
|
+
upsertLockfileEntry: Effect.fn("PackManager.upsertLockfileEntry")(function* ({ ref }) {
|
|
170
|
+
const args = yield* buildCurrentPackArgs(ref, Option.none());
|
|
171
|
+
if (Option.isSome(args)) {
|
|
172
|
+
yield* ws.setPackLock(args.value);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
yield* ws.removePackLock(ref.pack.name);
|
|
176
|
+
}
|
|
177
|
+
}),
|
|
178
|
+
removeLockfileEntry: ({ target }) => ws.removePackLock(target.name).pipe(Effect.withSpan("PackManager.removeLockfileEntry")),
|
|
179
|
+
};
|
|
180
|
+
}));
|
|
181
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install pack operation handler.
|
|
3
|
+
*
|
|
4
|
+
* Fetches the pack archive, extracts to the managed location, and
|
|
5
|
+
* writes pack metadata to settings and lockfile.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
*/
|
|
9
|
+
import * as FileSystem from "effect/FileSystem";
|
|
10
|
+
import * as Path from "effect/Path";
|
|
11
|
+
import type { Option } from "effect/Option";
|
|
12
|
+
import type { Handle } from "@agentxm/extension-model/unstable/extensions/handle";
|
|
13
|
+
import type { Version } from "@agentxm/extension-model/unstable/version-constraints";
|
|
14
|
+
import type { PackRef } from "@agentxm/extension-model/unstable/extensions/refs/pack";
|
|
15
|
+
import { SourceHostProviders } from "@agentxm/extension-sources";
|
|
16
|
+
import { LifecycleFailureAdapter } from "../../failure-adapter.js";
|
|
17
|
+
import type { OperationHandler } from "@agentxm/workspace-operations";
|
|
18
|
+
import type { Operation } from "@agentxm/workspace-operations";
|
|
19
|
+
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
20
|
+
import { type ResolvedPackDependencyMap } from "../resolved-dependency.js";
|
|
21
|
+
/**
|
|
22
|
+
* Args for the install pack operation.
|
|
23
|
+
*/
|
|
24
|
+
export interface InstallPackOperationArgs {
|
|
25
|
+
/** Pack name (e.g., "my-pack") */
|
|
26
|
+
readonly packName: string;
|
|
27
|
+
/** Pack owner (e.g., "@acme") */
|
|
28
|
+
readonly owner: Handle;
|
|
29
|
+
/** Exact resolved version */
|
|
30
|
+
readonly resolvedVersion: Version;
|
|
31
|
+
/** SRI integrity string */
|
|
32
|
+
readonly integrity: string;
|
|
33
|
+
/** Registry source name */
|
|
34
|
+
readonly sourceName: string;
|
|
35
|
+
readonly publisherBindingId: string;
|
|
36
|
+
/** Resolved skill FQNs to exact versions */
|
|
37
|
+
readonly resolvedSkills: ResolvedPackDependencyMap;
|
|
38
|
+
/** Resolved MCP server FQNs to exact versions */
|
|
39
|
+
readonly resolvedMcpServers: ResolvedPackDependencyMap;
|
|
40
|
+
/** Resolved subagent FQNs to exact versions */
|
|
41
|
+
readonly resolvedSubagents: ResolvedPackDependencyMap;
|
|
42
|
+
/** Resolved rule FQNs to exact versions */
|
|
43
|
+
readonly resolvedRules: ResolvedPackDependencyMap;
|
|
44
|
+
/** Resolved hook FQNs to exact versions */
|
|
45
|
+
readonly resolvedHooks: ResolvedPackDependencyMap;
|
|
46
|
+
/** Resolved knowledge FQNs to exact versions */
|
|
47
|
+
readonly resolvedKnowledge: ResolvedPackDependencyMap;
|
|
48
|
+
/** Version constraint from the original source (e.g. "^2.0.0"). Preserved in settings. */
|
|
49
|
+
readonly versionRange: Option<string>;
|
|
50
|
+
/** Pack extension ref for fetching the archive. */
|
|
51
|
+
readonly ref: PackRef;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Add a pack to the workspace.
|
|
55
|
+
*
|
|
56
|
+
* @experimental This API is unstable and may change without notice.
|
|
57
|
+
*/
|
|
58
|
+
export type InstallPackOperation = Operation<"install-pack", InstallPackOperationArgs>;
|
|
59
|
+
/**
|
|
60
|
+
* Install pack operation handler.
|
|
61
|
+
*
|
|
62
|
+
* Fetches the pack archive via sources.fetch(), extracts to the managed
|
|
63
|
+
* source-qualified acquired pack location, then records
|
|
64
|
+
* the pack in settings and lockfile.
|
|
65
|
+
*/
|
|
66
|
+
export declare const installPack: OperationHandler<InstallPackOperation, WorkspaceMutations | SourceHostProviders | FileSystem.FileSystem | Path.Path | LifecycleFailureAdapter>;
|
|
67
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install pack operation handler.
|
|
3
|
+
*
|
|
4
|
+
* Fetches the pack archive, extracts to the managed location, and
|
|
5
|
+
* writes pack metadata to settings and lockfile.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
*/
|
|
9
|
+
import * as FileSystem from "effect/FileSystem";
|
|
10
|
+
import * as Path from "effect/Path";
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import * as Schema from "effect/Schema";
|
|
13
|
+
import { decodeExtensionNameSync } from "@agentxm/extension-model/unstable/extensions";
|
|
14
|
+
import { recoverCanonicalDirectory, replaceCanonicalDirectory } from "@agentxm/extension-workspace";
|
|
15
|
+
import { validateExactResolvedVersion } from "@agentxm/workspace-state";
|
|
16
|
+
import { SourceHostProviders } from "@agentxm/extension-sources";
|
|
17
|
+
import { ExtensionLifecycleFailed } from "../../errors.js";
|
|
18
|
+
import { LifecycleFailureAdapter, } from "../../failure-adapter.js";
|
|
19
|
+
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
20
|
+
import { copyExtensionDirectory } from "@agentxm/extension-workspace";
|
|
21
|
+
import { computePackPathsForLayout } from "@agentxm/workspace-state";
|
|
22
|
+
import { PACK_MANIFEST_FILENAME, PackManifestSchema, } from "@agentxm/extension-model/unstable/packs/manifest-schema";
|
|
23
|
+
import { validateExactPackDependencyVersions, } from "../resolved-dependency.js";
|
|
24
|
+
import { computePackManifestContentIdentity } from "@agentxm/workspace-state";
|
|
25
|
+
import { computeMaterializedTreeIntegrity } from "@agentxm/workspace-state";
|
|
26
|
+
const collectMissingResolvedDependencies = (manifest, op) => {
|
|
27
|
+
const missing = [];
|
|
28
|
+
for (const fqn of Object.keys(manifest.dependencies)) {
|
|
29
|
+
if (!Object.hasOwn(op.args.resolvedSkills, fqn) &&
|
|
30
|
+
!Object.hasOwn(op.args.resolvedMcpServers, fqn) &&
|
|
31
|
+
!Object.hasOwn(op.args.resolvedSubagents, fqn) &&
|
|
32
|
+
!Object.hasOwn(op.args.resolvedRules, fqn) &&
|
|
33
|
+
!Object.hasOwn(op.args.resolvedHooks, fqn) &&
|
|
34
|
+
!Object.hasOwn(op.args.resolvedKnowledge, fqn)) {
|
|
35
|
+
missing.push(fqn);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return missing;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Install pack operation handler.
|
|
42
|
+
*
|
|
43
|
+
* Fetches the pack archive via sources.fetch(), extracts to the managed
|
|
44
|
+
* source-qualified acquired pack location, then records
|
|
45
|
+
* the pack in settings and lockfile.
|
|
46
|
+
*/
|
|
47
|
+
export const installPack = (op) => Effect.gen(function* () {
|
|
48
|
+
const adapter = yield* LifecycleFailureAdapter;
|
|
49
|
+
return yield* runInstallPack(op, adapter);
|
|
50
|
+
});
|
|
51
|
+
const runInstallPack = (op, adapter) => Effect.gen(function* () {
|
|
52
|
+
const ws = yield* WorkspaceMutations;
|
|
53
|
+
const sources = yield* SourceHostProviders;
|
|
54
|
+
const fs = yield* FileSystem.FileSystem;
|
|
55
|
+
const path = yield* Path.Path;
|
|
56
|
+
yield* validateExactResolvedVersion(`packs.${op.args.packName}.resolvedVersion`, op.args.resolvedVersion);
|
|
57
|
+
yield* validateExactPackDependencyVersions(`packs.${op.args.packName}.resolvedSkills`, op.args.resolvedSkills);
|
|
58
|
+
yield* validateExactPackDependencyVersions(`packs.${op.args.packName}.resolvedMcpServers`, op.args.resolvedMcpServers);
|
|
59
|
+
yield* validateExactPackDependencyVersions(`packs.${op.args.packName}.resolvedSubagents`, op.args.resolvedSubagents);
|
|
60
|
+
yield* validateExactPackDependencyVersions(`packs.${op.args.packName}.resolvedRules`, op.args.resolvedRules);
|
|
61
|
+
yield* validateExactPackDependencyVersions(`packs.${op.args.packName}.resolvedHooks`, op.args.resolvedHooks);
|
|
62
|
+
yield* validateExactPackDependencyVersions(`packs.${op.args.packName}.resolvedKnowledge`, op.args.resolvedKnowledge);
|
|
63
|
+
// Extract to managed location
|
|
64
|
+
const packDir = computePackPathsForLayout(path.join, ws.layout, op.args.sourceName, op.args.owner, op.args.packName).canonicalPath;
|
|
65
|
+
yield* recoverCanonicalDirectory({ baseDir: ws.baseDir, canonicalPath: packDir });
|
|
66
|
+
// Keep fetch scope alive through copy; fetched directories are released on scope close.
|
|
67
|
+
const manifestContentIdentity = yield* Effect.scoped(Effect.gen(function* () {
|
|
68
|
+
const fetched = yield* sources.fetch(op.args.ref).pipe(Effect.mapError((error) => new ExtensionLifecycleFailed({
|
|
69
|
+
category: "network",
|
|
70
|
+
detail: `Failed to fetch pack archive: ${error.message}`,
|
|
71
|
+
cause: error,
|
|
72
|
+
})));
|
|
73
|
+
const manifestPath = path.join(fetched.directory, PACK_MANIFEST_FILENAME);
|
|
74
|
+
const manifestContent = yield* fs.readFileString(manifestPath).pipe(Effect.mapError((error) => new ExtensionLifecycleFailed({
|
|
75
|
+
category: "internal",
|
|
76
|
+
detail: `Failed to read fetched pack manifest: ${manifestPath}`,
|
|
77
|
+
cause: error,
|
|
78
|
+
})));
|
|
79
|
+
const manifestJson = yield* Effect.try({
|
|
80
|
+
try: () => {
|
|
81
|
+
const parsed = JSON.parse(manifestContent);
|
|
82
|
+
return parsed;
|
|
83
|
+
},
|
|
84
|
+
catch: (error) => new ExtensionLifecycleFailed({
|
|
85
|
+
category: "validation",
|
|
86
|
+
detail: `Invalid JSON in fetched pack manifest: ${manifestPath}`,
|
|
87
|
+
cause: error,
|
|
88
|
+
}),
|
|
89
|
+
});
|
|
90
|
+
const manifest = yield* Schema.decodeUnknownEffect(PackManifestSchema)(manifestJson).pipe(Effect.mapError((error) => new ExtensionLifecycleFailed({
|
|
91
|
+
category: "validation",
|
|
92
|
+
detail: `Invalid fetched pack manifest: ${manifestPath}`,
|
|
93
|
+
cause: error,
|
|
94
|
+
})));
|
|
95
|
+
const missingDependencies = collectMissingResolvedDependencies(manifest, op);
|
|
96
|
+
if (missingDependencies.length > 0) {
|
|
97
|
+
return yield* new ExtensionLifecycleFailed({
|
|
98
|
+
category: "internal",
|
|
99
|
+
detail: `Pack ${op.args.packName} declares dependencies that were not resolved from registry metadata`,
|
|
100
|
+
suggestions: [
|
|
101
|
+
{
|
|
102
|
+
description: "Republish the pack or repair the registry metadata before installing this pack.",
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
yield* replaceCanonicalDirectory({
|
|
108
|
+
baseDir: ws.baseDir,
|
|
109
|
+
canonicalPath: packDir,
|
|
110
|
+
populate: (stagingPath) => copyExtensionDirectory(fetched.directory, stagingPath).pipe(Effect.mapError((cause) => new ExtensionLifecycleFailed({
|
|
111
|
+
category: "internal",
|
|
112
|
+
detail: `Failed to stage pack at ${packDir}`,
|
|
113
|
+
cause,
|
|
114
|
+
}))),
|
|
115
|
+
});
|
|
116
|
+
return computePackManifestContentIdentity(manifest);
|
|
117
|
+
}));
|
|
118
|
+
const treeIntegrity = yield* computeMaterializedTreeIntegrity(packDir);
|
|
119
|
+
if (op.args.ref.source.type !== "registry") {
|
|
120
|
+
return yield* new ExtensionLifecycleFailed({
|
|
121
|
+
category: "validation",
|
|
122
|
+
detail: `Pack ${op.args.packName} does not resolve to a Registry source`,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
// Write lockfile + settings
|
|
126
|
+
const metadataWarning = yield* ws
|
|
127
|
+
.setPack({
|
|
128
|
+
type: "registry",
|
|
129
|
+
sourceType: "registry",
|
|
130
|
+
packageFormat: "agentxm",
|
|
131
|
+
endpoint: op.args.ref.source.location,
|
|
132
|
+
extensionType: "pack",
|
|
133
|
+
workspaceName: decodeExtensionNameSync(op.args.packName),
|
|
134
|
+
owner: op.args.owner,
|
|
135
|
+
name: decodeExtensionNameSync(op.args.packName),
|
|
136
|
+
resolvedVersion: op.args.resolvedVersion,
|
|
137
|
+
integrity: op.args.integrity,
|
|
138
|
+
sourceName: op.args.sourceName,
|
|
139
|
+
publisherBindingId: op.args.publisherBindingId,
|
|
140
|
+
manifestContentIdentity,
|
|
141
|
+
treeIntegrity,
|
|
142
|
+
versionRange: op.args.versionRange,
|
|
143
|
+
})
|
|
144
|
+
.pipe(Effect.as(undefined), Effect.catch((e) => Effect.succeed(`Pack metadata update failed: ${String(e)}`)));
|
|
145
|
+
return {
|
|
146
|
+
result: "success",
|
|
147
|
+
message: metadataWarning === undefined
|
|
148
|
+
? `Installed pack ${op.args.packName}`
|
|
149
|
+
: `Installed pack ${op.args.packName}; ${metadataWarning}`,
|
|
150
|
+
};
|
|
151
|
+
}).pipe(Effect.catch((error) => Effect.succeed({
|
|
152
|
+
result: "error",
|
|
153
|
+
message: `Failed to install pack: ${adapter.describeFailureMessage(error)}`,
|
|
154
|
+
error: adapter.toStepFailure(error),
|
|
155
|
+
})));
|
|
156
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import { PackDefinitionInvalid } from "@agentxm/extension-workspace";
|
|
4
|
+
export declare const ResolvedPackDependencySchema: Schema.Union<readonly [Schema.Struct<{
|
|
5
|
+
readonly source: Schema.Literal<"registry">;
|
|
6
|
+
readonly version: Schema.brand<Schema.String, "Version">;
|
|
7
|
+
readonly publisherBindingId: Schema.NonEmptyString;
|
|
8
|
+
readonly integrity: Schema.String;
|
|
9
|
+
}>, Schema.Struct<{
|
|
10
|
+
readonly source: Schema.Literal<"workspace">;
|
|
11
|
+
readonly version: Schema.brand<Schema.String, "Version">;
|
|
12
|
+
readonly sourceIdentity: Schema.String;
|
|
13
|
+
readonly contentIdentity: Schema.brand<Schema.String, "SourceHash">;
|
|
14
|
+
}>]>;
|
|
15
|
+
export type ResolvedPackDependency = typeof ResolvedPackDependencySchema.Type;
|
|
16
|
+
export declare const ResolvedPackDependencyMapSchema: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
17
|
+
readonly source: Schema.Literal<"registry">;
|
|
18
|
+
readonly version: Schema.brand<Schema.String, "Version">;
|
|
19
|
+
readonly publisherBindingId: Schema.NonEmptyString;
|
|
20
|
+
readonly integrity: Schema.String;
|
|
21
|
+
}>, Schema.Struct<{
|
|
22
|
+
readonly source: Schema.Literal<"workspace">;
|
|
23
|
+
readonly version: Schema.brand<Schema.String, "Version">;
|
|
24
|
+
readonly sourceIdentity: Schema.String;
|
|
25
|
+
readonly contentIdentity: Schema.brand<Schema.String, "SourceHash">;
|
|
26
|
+
}>]>>;
|
|
27
|
+
export type ResolvedPackDependencyMap = typeof ResolvedPackDependencyMapSchema.Type;
|
|
28
|
+
export declare const validateExactPackDependencyVersions: (field: string, resolved: ResolvedPackDependencyMap) => Effect.Effect<void, PackDefinitionInvalid, never>;
|
|
29
|
+
//# sourceMappingURL=resolved-dependency.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import { PackDefinitionInvalid } from "@agentxm/extension-workspace";
|
|
4
|
+
import { ExtensionFqnSchema } from "@agentxm/extension-model/unstable/extensions";
|
|
5
|
+
import { SourceHashSchema } from "@agentxm/extension-model/unstable/sources/source-hash";
|
|
6
|
+
import { VersionSchema } from "@agentxm/extension-model/unstable/version-constraints";
|
|
7
|
+
const ResolvedRegistryDependencySchema = Schema.Struct({
|
|
8
|
+
source: Schema.Literal("registry"),
|
|
9
|
+
version: VersionSchema,
|
|
10
|
+
publisherBindingId: Schema.NonEmptyString,
|
|
11
|
+
integrity: Schema.String,
|
|
12
|
+
});
|
|
13
|
+
const ResolvedWorkspaceDependencySchema = Schema.Struct({
|
|
14
|
+
source: Schema.Literal("workspace"),
|
|
15
|
+
version: VersionSchema,
|
|
16
|
+
sourceIdentity: Schema.String,
|
|
17
|
+
contentIdentity: SourceHashSchema,
|
|
18
|
+
});
|
|
19
|
+
export const ResolvedPackDependencySchema = Schema.Union([
|
|
20
|
+
ResolvedRegistryDependencySchema,
|
|
21
|
+
ResolvedWorkspaceDependencySchema,
|
|
22
|
+
]);
|
|
23
|
+
export const ResolvedPackDependencyMapSchema = Schema.Record(ExtensionFqnSchema, ResolvedPackDependencySchema);
|
|
24
|
+
export const validateExactPackDependencyVersions = (field, resolved) => Effect.forEach(Object.entries(resolved), ([fqn, value]) => Schema.decodeUnknownEffect(VersionSchema)(value.version).pipe(Effect.mapError((cause) => new PackDefinitionInvalid({
|
|
25
|
+
detail: `Pack dependency ${field}.${fqn}.version must be an exact semver value`,
|
|
26
|
+
cause,
|
|
27
|
+
}))), { concurrency: "unbounded", discard: true });
|
|
28
|
+
//# sourceMappingURL=resolved-dependency.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry-backed canonical package materialization.
|
|
3
|
+
*
|
|
4
|
+
* The canonical-directory staging/swap machinery lives in
|
|
5
|
+
* `@agentxm/extension-workspace`; this module owns only the registry
|
|
6
|
+
* fetch/verify/extract path.
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is unstable and may change without notice.
|
|
9
|
+
*/
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as FileSystem from "effect/FileSystem";
|
|
12
|
+
import * as Option from "effect/Option";
|
|
13
|
+
import * as Path from "effect/Path";
|
|
14
|
+
import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
15
|
+
import type { Version, VersionRange } from "@agentxm/extension-model/unstable/version-constraints";
|
|
16
|
+
import type { ExtensionName, ExtensionType } from "@agentxm/extension-model/unstable/extensions/common";
|
|
17
|
+
import type { Handle } from "@agentxm/extension-model/unstable/extensions/handle";
|
|
18
|
+
import { ArchiveIntegrityMismatch, type CanonicalDirectoryReplacementError, type MaterializedPackage } from "@agentxm/extension-workspace";
|
|
19
|
+
import { CoupledDependencyFailure } from "@agentxm/extension-workspace";
|
|
20
|
+
import { type MaterializedTreeInvalid } from "@agentxm/workspace-state";
|
|
21
|
+
export interface RegistryPackageMaterializationMessages {
|
|
22
|
+
readonly integrityMismatchDetail: string;
|
|
23
|
+
}
|
|
24
|
+
export interface MaterializeRegistryPackageArgs<E = never> {
|
|
25
|
+
readonly baseDir: string;
|
|
26
|
+
/**
|
|
27
|
+
* Canonical installed path for this extension. Bytes always land in a sibling
|
|
28
|
+
* staging directory first and are swapped in after validation.
|
|
29
|
+
*/
|
|
30
|
+
readonly destinationPath: string;
|
|
31
|
+
readonly sourceLocation: URL;
|
|
32
|
+
readonly owner: Handle;
|
|
33
|
+
readonly type: ExtensionType;
|
|
34
|
+
readonly name: ExtensionName;
|
|
35
|
+
readonly version: Version | VersionRange;
|
|
36
|
+
readonly integrity: Option.Option<string>;
|
|
37
|
+
readonly messages: RegistryPackageMaterializationMessages;
|
|
38
|
+
readonly validate?: (stagingPath: string) => Effect.Effect<void, E, FileSystem.FileSystem | Path.Path>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Fetch, verify, and extract a registry package into `destinationPath`.
|
|
42
|
+
*
|
|
43
|
+
* Always writes. Whether new bytes are needed at all is
|
|
44
|
+
* `canReuseInstalledPackage`'s decision, which the caller makes against the
|
|
45
|
+
* canonical installed path before choosing a destination.
|
|
46
|
+
*
|
|
47
|
+
* Registry client and archive-extraction failures travel opaquely as coupled
|
|
48
|
+
* dependency failures; the application boundary restores and converts them.
|
|
49
|
+
*/
|
|
50
|
+
export declare const materializeRegistryPackageWithTreeIntegrity: <E = never>(args: MaterializeRegistryPackageArgs<E>) => Effect.Effect<MaterializedPackage, E | CoupledDependencyFailure | ArchiveIntegrityMismatch | CanonicalDirectoryReplacementError | MaterializedTreeInvalid, FileSystem.FileSystem | HttpClient.HttpClient | Path.Path>;
|
|
51
|
+
export declare const materializeRegistryPackage: <E = never>(args: MaterializeRegistryPackageArgs<E>) => Effect.Effect<string, CoupledDependencyFailure | ArchiveIntegrityMismatch | CanonicalDirectoryReplacementError | MaterializedTreeInvalid | E, FileSystem.FileSystem | HttpClient.HttpClient | Path.Path>;
|
|
52
|
+
//# sourceMappingURL=registry-materialization.d.ts.map
|