@agentxm/extension-materialization 0.29.2 → 0.30.1
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/src/hooks/manager.d.ts +0 -5
- package/dist/src/hooks/manager.js +73 -36
- package/dist/src/index.d.ts +1 -6
- package/dist/src/index.js +0 -9
- package/dist/src/knowledge/manager.d.ts +0 -1
- package/dist/src/knowledge/manager.js +36 -29
- package/dist/src/manager-contract.d.ts +16 -18
- package/dist/src/manager-registry.d.ts +2 -3
- package/dist/src/managers.d.ts +22 -3
- package/dist/src/managers.js +0 -13
- package/dist/src/mcps/manager.js +84 -44
- package/dist/src/packs/manager.js +21 -18
- package/dist/src/rules/manager.d.ts +0 -5
- package/dist/src/rules/manager.js +22 -32
- package/dist/src/skills/errors.d.ts +2 -1
- package/dist/src/skills/manager.js +45 -53
- package/dist/src/skills/materialization.d.ts +2 -2
- package/dist/src/skills/skill-artifact.d.ts +5 -1
- package/dist/src/subagents/manager.js +31 -52
- package/dist/src/testing.d.ts +0 -66
- package/dist/src/testing.js +1 -89
- package/package.json +19 -22
- package/dist/src/desired-state/errors.d.ts +0 -22
- package/dist/src/desired-state/errors.js +0 -22
- package/dist/src/desired-state/retained-materialization.d.ts +0 -58
- package/dist/src/desired-state/retained-materialization.js +0 -119
- package/dist/src/extensions/operations.d.ts +0 -252
- package/dist/src/extensions/operations.js +0 -631
- package/dist/src/mcps/authored-materialization.d.ts +0 -28
- package/dist/src/mcps/authored-materialization.js +0 -34
- package/dist/src/mcps/install-operation.d.ts +0 -92
- package/dist/src/mcps/install-operation.js +0 -557
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared extension closure recipes — install, materialize, uninstall, and the
|
|
3
|
-
* authored-package transition.
|
|
4
|
-
*
|
|
5
|
-
* A recipe composes one manager's contract into one plan step. Requirements
|
|
6
|
-
* stay explicit: the step declares the manager's `R` plus the transaction
|
|
7
|
-
* scope its closure runs in, and the command boundary composes them once. The
|
|
8
|
-
* facts a materialization observed travel from `materializeInstall` to the
|
|
9
|
-
* settings and lockfile writes and to the step's artifact as values.
|
|
10
|
-
*
|
|
11
|
-
* @experimental This API is unstable and may change without notice.
|
|
12
|
-
* @packageDocumentation
|
|
13
|
-
*/
|
|
14
|
-
import * as Effect from "effect/Effect";
|
|
15
|
-
import * as Option from "effect/Option";
|
|
16
|
-
import type * as FileSystem from "effect/FileSystem";
|
|
17
|
-
import type * as Path from "effect/Path";
|
|
18
|
-
import type { ExtensionManager, MaterializationFacts } from "../manager-contract.js";
|
|
19
|
-
import type { ExtensionManagerFailure } from "../errors.js";
|
|
20
|
-
import type { StepFailure } from "@agentxm/workspace-operations";
|
|
21
|
-
import type { JobStepArtifact, PlannedJobStep } from "@agentxm/workspace-operations";
|
|
22
|
-
import type { ExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/extension-ref";
|
|
23
|
-
import type { PackageUrlParts } from "@agentxm/extension-model/unstable/packaging/package-url";
|
|
24
|
-
import type { ExtensionTarget, ExtensionTargetFor } from "@agentxm/workspace-state";
|
|
25
|
-
import type { WorkspaceTransactionScope } from "@agentxm/workspace-transactions";
|
|
26
|
-
/**
|
|
27
|
-
* Derive an ExtensionTarget from an ExtensionRef.
|
|
28
|
-
*
|
|
29
|
-
* Pack targets include owner; leaf-extension targets are name-only.
|
|
30
|
-
*/
|
|
31
|
-
export declare const targetFromRef: (ref: ExtensionRef) => ExtensionTarget;
|
|
32
|
-
export declare const extensionRefLifecycleWarnings: (ref: ExtensionRef) => ReadonlyArray<string>;
|
|
33
|
-
export declare const extensionRefRegistryLifecycle: (ref: ExtensionRef) => {
|
|
34
|
-
deprecation: {
|
|
35
|
-
readonly message: string;
|
|
36
|
-
readonly deprecatedAt: import("effect/DateTime").Utc;
|
|
37
|
-
readonly replacement?: {
|
|
38
|
-
readonly status: "available";
|
|
39
|
-
readonly fqn: string;
|
|
40
|
-
} | {
|
|
41
|
-
readonly status: "unavailable";
|
|
42
|
-
readonly fqn?: string | undefined;
|
|
43
|
-
} | undefined;
|
|
44
|
-
} | {
|
|
45
|
-
readonly deprecatedAt: import("effect/DateTime").Utc;
|
|
46
|
-
readonly replacement: {
|
|
47
|
-
readonly status: "available";
|
|
48
|
-
readonly fqn: string;
|
|
49
|
-
} | {
|
|
50
|
-
readonly status: "unavailable";
|
|
51
|
-
readonly fqn?: string | undefined;
|
|
52
|
-
};
|
|
53
|
-
readonly message?: string | undefined;
|
|
54
|
-
};
|
|
55
|
-
} | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* Produce a display label from an ExtensionTarget.
|
|
58
|
-
*
|
|
59
|
-
* Pack targets render as `owner/name`; others render as `name`.
|
|
60
|
-
*/
|
|
61
|
-
export declare const toLabel: (target: ExtensionTarget) => string;
|
|
62
|
-
/**
|
|
63
|
-
* Produce a stable step identity key from an ExtensionTarget.
|
|
64
|
-
*
|
|
65
|
-
* This is internal plan identity, not display text.
|
|
66
|
-
*/
|
|
67
|
-
export declare const toStepKey: (target: ExtensionTarget) => string;
|
|
68
|
-
/**
|
|
69
|
-
* Format a single PackageUrlParts as a compact display string.
|
|
70
|
-
*
|
|
71
|
-
* Examples: `pkg:npm/react`, `pkg:npm/@angular/core@18.0.0`
|
|
72
|
-
*/
|
|
73
|
-
export declare const formatPackageUrlParts: (parts: PackageUrlParts) => string;
|
|
74
|
-
/**
|
|
75
|
-
* Build a display label with optional packages suffix.
|
|
76
|
-
*
|
|
77
|
-
* When packages is non-empty, appends them parenthesized:
|
|
78
|
-
* `code-review (pkg:npm/react, pkg:npm/typescript)`
|
|
79
|
-
*/
|
|
80
|
-
export declare const toLabelWithCompanions: (target: ExtensionTarget, packages: ReadonlyArray<PackageUrlParts>) => string;
|
|
81
|
-
/**
|
|
82
|
-
* Cross-cutting uninstall dependency-retention policy: whether an installed
|
|
83
|
-
* Pack still requires the target's package.
|
|
84
|
-
*/
|
|
85
|
-
export interface UninstallRetentionPolicy<F = never, R = never> {
|
|
86
|
-
readonly isRequiredByInstalledPack: (args: {
|
|
87
|
-
readonly target: ExtensionTarget;
|
|
88
|
-
}) => Effect.Effect<boolean, CallerStepFailure<F>, R>;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Failure channel for a recipe's typed inputs: the manager failures the recipe
|
|
92
|
-
* itself can surface plus whatever failure family the calling feature supplies
|
|
93
|
-
* through `F`. Nothing in this channel is `unknown`.
|
|
94
|
-
*/
|
|
95
|
-
export type CallerStepFailure<F = never> = ExtensionManagerFailure | F;
|
|
96
|
-
/**
|
|
97
|
-
* The one conversion from a recipe's typed failure union into the serialized
|
|
98
|
-
* plan-step vocabulary. Categories and wording are the boundary's, so machine
|
|
99
|
-
* output does not depend on which side of the seam rendered the failure; the
|
|
100
|
-
* recipe applies it once, at the edge of the step.
|
|
101
|
-
*/
|
|
102
|
-
export interface StepFailureAdapter<F = never> {
|
|
103
|
-
readonly toStepFailure: (failure: CallerStepFailure<F>) => StepFailure;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* What every recipe adds on top of its manager's own requirements: the
|
|
107
|
-
* transaction scope its closure opens, and the platform that scope reads and
|
|
108
|
-
* writes through.
|
|
109
|
-
*/
|
|
110
|
-
export type RecipeRequirements = WorkspaceTransactionScope | FileSystem.FileSystem | Path.Path;
|
|
111
|
-
export interface InstallOperationArgs<TRef extends ExtensionRef, TMaterialization extends MaterializationFacts, F = never, R = never> extends StepFailureAdapter<F> {
|
|
112
|
-
readonly ref: TRef;
|
|
113
|
-
readonly versionRange: Option.Option<string>;
|
|
114
|
-
/** When true, re-materialize unconditionally (repair path for forced reinstalls). */
|
|
115
|
-
readonly force?: boolean;
|
|
116
|
-
/** When true, skip writing to settings (e.g. pack dependency installs). */
|
|
117
|
-
readonly skipSettings?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* When true, skip the trailing shared-projection reconcile (e.g. pack
|
|
120
|
-
* dependency steps, whose closure runs one projection write at the end).
|
|
121
|
-
*/
|
|
122
|
-
readonly skipProjections?: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Defer the manager-wide observable check to an enclosing semantic closure.
|
|
125
|
-
* Pack member transitions use this while other configured Packs are still
|
|
126
|
-
* incomplete; the enclosing Pack graph validates every accepted canonical
|
|
127
|
-
* package and its scoped desired-state postcondition before committing.
|
|
128
|
-
*/
|
|
129
|
-
readonly deferObservableValidation?: boolean;
|
|
130
|
-
/** Optional pre-install state probe for artifact change labels. */
|
|
131
|
-
readonly installedBefore?: Effect.Effect<boolean, CallerStepFailure<F>, R>;
|
|
132
|
-
/** Optional presenter metadata computed after materialization/settings writes. */
|
|
133
|
-
readonly buildArtifact?: (args: {
|
|
134
|
-
readonly installedBefore: boolean;
|
|
135
|
-
readonly materialization: Option.Option<TMaterialization>;
|
|
136
|
-
}) => Effect.Effect<JobStepArtifact, CallerStepFailure<F>, R>;
|
|
137
|
-
/** Optional outcome message for type-specific install presenters. */
|
|
138
|
-
readonly message?: string;
|
|
139
|
-
/** Explicit destructive source-authority transition used only by demotion. */
|
|
140
|
-
readonly allowWorkspaceReplacement?: boolean;
|
|
141
|
-
}
|
|
142
|
-
export interface NewExtensionOperationArgs<TRef extends ExtensionRef, TMaterialization extends MaterializationFacts, F = never, R = never> extends Omit<InstallOperationArgs<TRef, TMaterialization, F, R>, "force" | "allowWorkspaceReplacement"> {
|
|
143
|
-
readonly target: ExtensionTargetFor<TRef>;
|
|
144
|
-
/** Read-only artifact forecast rendered by preview before any mutation occurs. */
|
|
145
|
-
readonly plannedArtifact?: JobStepArtifact;
|
|
146
|
-
/** Collision checks repeated under the workspace transaction lock before the first write. */
|
|
147
|
-
readonly preflight?: Effect.Effect<void, CallerStepFailure<F>, R>;
|
|
148
|
-
readonly scaffold: Effect.Effect<unknown, CallerStepFailure<F>, R>;
|
|
149
|
-
readonly markAuthored: Effect.Effect<void, CallerStepFailure<F>, R>;
|
|
150
|
-
readonly message: string;
|
|
151
|
-
readonly label?: string;
|
|
152
|
-
}
|
|
153
|
-
export interface AuthoredExtensionOperationArgs<TRef extends ExtensionRef, TMaterialization extends MaterializationFacts, F = never, R = never> extends Omit<NewExtensionOperationArgs<TRef, TMaterialization, F, R>, "ref"> {
|
|
154
|
-
/** Canonical workspace package path protected by the transaction snapshot. */
|
|
155
|
-
readonly location: string;
|
|
156
|
-
/** Additional files that the authored transition may update transactionally. */
|
|
157
|
-
readonly transactionTargets?: ReadonlyArray<string>;
|
|
158
|
-
/** Whether the new authored extension should remain materialized after creation. */
|
|
159
|
-
readonly enabled?: boolean;
|
|
160
|
-
/** Commit the caller's final desired-state shape after canonical resolution. */
|
|
161
|
-
readonly finalizeAuthored?: Effect.Effect<void, CallerStepFailure<F>, R>;
|
|
162
|
-
/** Type-specific projection path for authored packages with specialized installers. */
|
|
163
|
-
readonly materializeInstall?: (ref: TRef) => Effect.Effect<Option.Option<TMaterialization>, CallerStepFailure<F>, R>;
|
|
164
|
-
/**
|
|
165
|
-
* Project and then deactivate a disabled target when adopting a native
|
|
166
|
-
* configuration requires the projection writer to perform the transition.
|
|
167
|
-
*/
|
|
168
|
-
readonly materializeWhenDisabled?: boolean;
|
|
169
|
-
/**
|
|
170
|
-
* Skip the global materializability preflight when replacing an explicitly
|
|
171
|
-
* selected native/configured source with a new workspace-authored package.
|
|
172
|
-
*/
|
|
173
|
-
readonly allowConfiguredSourceTransition?: boolean;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Build a PlannedJobStep for an install operation.
|
|
177
|
-
*
|
|
178
|
-
* The step keeps the manager's requirements and the transaction scope in its
|
|
179
|
-
* `run` effect; the command boundary composes them once.
|
|
180
|
-
*/
|
|
181
|
-
export declare const buildInstallOperation: <TRef extends ExtensionRef, TMaterialization extends MaterializationFacts, F = never, R = never>(manager: ExtensionManager<TRef, TMaterialization, R>, args: InstallOperationArgs<TRef, TMaterialization, F, R>) => PlannedJobStep<R | RecipeRequirements>;
|
|
182
|
-
/**
|
|
183
|
-
* Build a PlannedJobStep for `new` commands.
|
|
184
|
-
*
|
|
185
|
-
* A read-only preflight runs first. The transaction then snapshots the source
|
|
186
|
-
* path, scaffolds it, seeds desired state, resolves the canonical package, and
|
|
187
|
-
* materializes projections before validating the authored postcondition.
|
|
188
|
-
*/
|
|
189
|
-
export declare const buildAuthoredExtensionStep: <TRef extends ExtensionRef, TMaterialization extends MaterializationFacts, F = never, R = never>(manager: ExtensionManager<TRef, TMaterialization, R>, args: AuthoredExtensionOperationArgs<TRef, TMaterialization, F, R>) => PlannedJobStep<R | RecipeRequirements>;
|
|
190
|
-
/**
|
|
191
|
-
* Build a PlannedJobStep for existing `new` commands.
|
|
192
|
-
*
|
|
193
|
-
* New commands remain enabled by default while sharing the authored-package
|
|
194
|
-
* transaction used by fork and native import.
|
|
195
|
-
*/
|
|
196
|
-
export declare const buildNewExtensionStep: <TRef extends ExtensionRef, TMaterialization extends MaterializationFacts, F = never, R = never>(manager: ExtensionManager<TRef, TMaterialization, R>, args: NewExtensionOperationArgs<TRef, TMaterialization, F, R>) => PlannedJobStep<R | RecipeRequirements>;
|
|
197
|
-
export interface MaterializeOperationArgs<TRef extends ExtensionRef, TMaterialization extends MaterializationFacts, F = never, R = never> extends StepFailureAdapter<F> {
|
|
198
|
-
readonly ref: TRef;
|
|
199
|
-
/** Optional transition-rich label used by reconciliation previews. */
|
|
200
|
-
readonly label?: string;
|
|
201
|
-
/** Explicitly permit a workspace-authored relocation during reconciliation. */
|
|
202
|
-
readonly allowWorkspaceSourceTransition?: boolean;
|
|
203
|
-
/** Reacquire canonical content before projecting it. */
|
|
204
|
-
readonly force?: boolean;
|
|
205
|
-
/** Verify realized content inside the transaction before recording its resolution. */
|
|
206
|
-
readonly validateMaterialized?: (args: {
|
|
207
|
-
readonly materialization: TMaterialization;
|
|
208
|
-
}) => Effect.Effect<void, CallerStepFailure<F>, R>;
|
|
209
|
-
readonly buildArtifact?: (args: {
|
|
210
|
-
readonly materialization: TMaterialization;
|
|
211
|
-
}) => Effect.Effect<JobStepArtifact, CallerStepFailure<F>, R>;
|
|
212
|
-
readonly message?: string;
|
|
213
|
-
}
|
|
214
|
-
export declare const buildMaterializeOperation: <TRef extends ExtensionRef, TMaterialization extends MaterializationFacts, F = never, R = never>(manager: ExtensionManager<TRef, TMaterialization, R>, args: MaterializeOperationArgs<TRef, TMaterialization, F, R>) => PlannedJobStep<R | RecipeRequirements>;
|
|
215
|
-
export interface UninstallOperationArgs<TRef extends ExtensionRef, TMaterialization extends MaterializationFacts, F = never, R = never> extends StepFailureAdapter<F> {
|
|
216
|
-
readonly target: ExtensionTargetFor<TRef>;
|
|
217
|
-
/**
|
|
218
|
-
* When true, skip the trailing shared-projection reconcile (e.g. pack
|
|
219
|
-
* dependency steps, whose closure runs one projection write at the end).
|
|
220
|
-
*/
|
|
221
|
-
readonly skipProjections?: boolean;
|
|
222
|
-
/**
|
|
223
|
-
* Declares that the target's canonical package could not be read. Uninstall
|
|
224
|
-
* then removes the target's configuration and accepted resolution only, and
|
|
225
|
-
* preserves canonical content it cannot verify.
|
|
226
|
-
*/
|
|
227
|
-
readonly retirement?: UnreadablePackageRetirement;
|
|
228
|
-
/** Presenter metadata computed from what the removal settled and withdrew. */
|
|
229
|
-
readonly buildArtifact?: (args: {
|
|
230
|
-
readonly settlement: UninstallSettlement;
|
|
231
|
-
readonly unmaterialization: Option.Option<TMaterialization>;
|
|
232
|
-
}) => Effect.Effect<JobStepArtifact, CallerStepFailure<F>, R>;
|
|
233
|
-
}
|
|
234
|
-
/** Why an uninstall target's canonical package could not be read. */
|
|
235
|
-
export interface UnreadablePackageRetirement {
|
|
236
|
-
/** Workspace path where the unreadable manifest was looked for. */
|
|
237
|
-
readonly manifestPath: string;
|
|
238
|
-
readonly reason: "missing" | "invalid";
|
|
239
|
-
}
|
|
240
|
-
/** What an uninstall settled: the declaration, and the canonical content. */
|
|
241
|
-
export interface UninstallSettlement {
|
|
242
|
-
readonly declaration: "removed" | "absent";
|
|
243
|
-
readonly canonical: "removed" | "absent" | "retained-by-pack" | "preserved-authored" | "preserved-unowned" | "preserved-unreadable";
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Build a PlannedJobStep for an uninstall operation.
|
|
247
|
-
*
|
|
248
|
-
* The step keeps the manager's requirements and the transaction scope in its
|
|
249
|
-
* `run` effect; the command boundary composes them once.
|
|
250
|
-
*/
|
|
251
|
-
export declare const buildUninstallOperation: <TRef extends ExtensionRef, TMaterialization extends MaterializationFacts, F = never, R = never>(manager: ExtensionManager<TRef, TMaterialization, R>, retentionPolicy: UninstallRetentionPolicy<F, R>, args: UninstallOperationArgs<TRef, TMaterialization, F, R>) => PlannedJobStep<R | RecipeRequirements>;
|
|
252
|
-
//# sourceMappingURL=operations.d.ts.map
|