@agentxm/extension-lifecycle 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.
Files changed (55) hide show
  1. package/dist/src/activation/set-activation.d.ts +22 -40
  2. package/dist/src/activation/set-activation.js +199 -331
  3. package/dist/src/demote/demote-to-external-source.d.ts +1 -1
  4. package/dist/src/demote/demote-to-external-source.js +53 -24
  5. package/dist/src/hooks/configured-agent-outcomes-provider.d.ts +4 -4
  6. package/dist/src/hooks/configured-agent-outcomes-provider.js +23 -17
  7. package/dist/src/hooks/install/plan.js +6 -3
  8. package/dist/src/hooks/uninstall/plan.js +4 -3
  9. package/dist/src/index.d.ts +1 -2
  10. package/dist/src/index.js +1 -2
  11. package/dist/src/install/root-intent.d.ts +2 -2
  12. package/dist/src/install/vocabulary.d.ts +5 -4
  13. package/dist/src/knowledge/install/plan.js +2 -1
  14. package/dist/src/knowledge/uninstall/plan.js +4 -3
  15. package/dist/src/live.d.ts +1 -1
  16. package/dist/src/live.js +1 -1
  17. package/dist/src/mcps/install/plan.js +2 -3
  18. package/dist/src/mcps/operations/disable.js +1 -1
  19. package/dist/src/mcps/operations/enable.js +20 -35
  20. package/dist/src/mcps/operations/uninstall.js +2 -1
  21. package/dist/src/mcps/uninstall/plan.js +13 -4
  22. package/dist/src/packs/graph-transition.d.ts +0 -25
  23. package/dist/src/packs/graph-transition.js +0 -101
  24. package/dist/src/packs/install/plan.d.ts +0 -13
  25. package/dist/src/packs/install/plan.js +12 -9
  26. package/dist/src/packs/member-install-step.js +8 -21
  27. package/dist/src/packs/promote-authored-pack.js +6 -3
  28. package/dist/src/packs/uninstall/plan.js +52 -20
  29. package/dist/src/rules/install/plan.js +6 -3
  30. package/dist/src/rules/uninstall/plan.js +4 -3
  31. package/dist/src/skills/install/bundled.js +4 -4
  32. package/dist/src/skills/install/plan.js +3 -2
  33. package/dist/src/skills/operations/install.d.ts +0 -1
  34. package/dist/src/skills/operations/install.js +9 -18
  35. package/dist/src/skills/uninstall/plan.js +4 -3
  36. package/dist/src/subagents/install/plan.js +3 -2
  37. package/dist/src/subagents/operations/enable.js +1 -3
  38. package/dist/src/subagents/uninstall/plan.js +4 -3
  39. package/dist/src/testing.d.ts +1 -1
  40. package/dist/src/testing.js +2 -1
  41. package/dist/src/uninstall/root-intent.d.ts +1 -1
  42. package/dist/src/uninstall/uninstall-extensions.d.ts +1 -1
  43. package/dist/src/uninstall/uninstall-extensions.js +77 -1
  44. package/dist/src/update/root-request.d.ts +2 -2
  45. package/dist/src/update/selective/skills.d.ts +1 -1
  46. package/dist/src/update/selective/skills.js +0 -1
  47. package/dist/src/update/selective/subagents.d.ts +1 -1
  48. package/dist/src/update/selective/subagents.js +3 -2
  49. package/dist/src/update/selective/use-case.d.ts +2 -2
  50. package/dist/src/update/targeted-plan.js +4 -2
  51. package/dist/src/workspace-paths.d.ts +0 -6
  52. package/dist/src/workspace-paths.js +0 -10
  53. package/package.json +22 -24
  54. package/dist/src/uninstall/retention-policy.d.ts +0 -21
  55. package/dist/src/uninstall/retention-policy.js +0 -28
@@ -64,9 +64,7 @@ export const enableSubagent = (op) => Effect.gen(function* () {
64
64
  });
65
65
  }
66
66
  const baseDir = ws.baseDir;
67
- const subagentSrcPath = canonical.value.ref.refType === "registry" || canonical.value.ref.refType === "workspace"
68
- ? path.join(canonical.value.observation.path, "src")
69
- : canonical.value.observation.path;
67
+ const subagentSrcPath = path.join(canonical.value.observation.path, "src");
70
68
  // Read and parse the subagent content file
71
69
  const expectedFilename = subagentContentFilename(op.args.subagentName);
72
70
  const contentPath = subagentContentPath(path.join, subagentSrcPath, op.args.subagentName);
@@ -9,13 +9,14 @@
9
9
  */
10
10
  import * as Effect from "effect/Effect";
11
11
  import * as Option from "effect/Option";
12
- import { NO_MATERIALIZATION_OBSERVATION, SubagentManager, buildUninstallOperation, } from "@agentxm/extension-materialization";
12
+ import { NO_MATERIALIZATION_OBSERVATION, SubagentManager, } from "@agentxm/extension-materialization";
13
+ import { buildUninstallOperation } from "@agentxm/workspace-reconciliation";
13
14
  import { parseExtensionFqnParts } from "@agentxm/extension-model/unstable/extensions";
14
15
  import { WorkspaceMutations, acquiredExtensionDisplayPathFromLockEntry, } from "@agentxm/workspace-state";
15
16
  import { expandGlob } from "../../glob.js";
16
17
  import { lifecycleStepFailure } from "../../step-failure.js";
17
18
  import { installRefused } from "../../install/vocabulary.js";
18
- import { makeWorkspaceRetentionPolicy } from "../../uninstall/retention-policy.js";
19
+ import { makeWorkspaceRetentionPolicy } from "@agentxm/workspace-reconciliation";
19
20
  import { workspaceCanonicalPath, workspaceCanonicalRoot, workspaceLockfilePath, workspaceSettingsPath, } from "../../workspace-paths.js";
20
21
  const resolvedVersion = (entry) => entry !== undefined && entry.type === "registry" ? entry.resolvedVersion : undefined;
21
22
  const subagentSourceTarget = (args) => args.lockEntry === undefined
@@ -77,7 +78,7 @@ export const parseSubagentUninstallRequest = Effect.fn("UninstallExtensions.pars
77
78
  export const planSubagentUninstall = Effect.fn("UninstallExtensions.planSubagents")(function* (intent) {
78
79
  const ws = yield* WorkspaceMutations;
79
80
  const subagentManager = yield* SubagentManager;
80
- const retentionPolicy = makeWorkspaceRetentionPolicy(ws);
81
+ const retentionPolicy = makeWorkspaceRetentionPolicy(ws, lifecycleStepFailure);
81
82
  // The accepted resolution names the package the removal retires, and the
82
83
  // removal deletes it, so it is read before the step runs.
83
84
  const steps = yield* Effect.forEach(intent.targets, (target) => Effect.gen(function* () {
@@ -99,7 +99,7 @@ export declare const makeLifecycleFixture: (options?: LifecycleFixtureOptions) =
99
99
  readonly type: "skill" | "subagent";
100
100
  readonly offered: ReadonlyArray<string>;
101
101
  }>;
102
- provide: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | import("@agentxm/workspace-state").WorkspaceMutationsError, import("effect/FileSystem").FileSystem | import("effect/Path").Path | Exclude<R, StepFailureConversion | import("@agentxm/workspace-state").WorkspaceMutations | import("@agentxm/workspace-transactions").WorkspaceTransactionScope | import("@agentxm/workspace-projection").CodingAgentRepository | import("@agentxm/agent-integration").NativeWriteAuthority | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("@agentxm/extension-materialization").ExtensionManagers | import("@agentxm/workspace-transactions").FootprintRecorder | HttpClient.HttpClient | import("@agentxm/workspace-operations").OperationJournal | import("@agentxm/extension-materialization").McpSecretStore | ReleaseAgePosture | import("@agentxm/workspace-operations").ResolvePlanInteraction | SourceHostProviders | import("@agentxm/extension-materialization").SubagentManager | import("@agentxm/extension-sources").WorkspaceCatalog | import("@agentxm/extension-materialization").HookManager | import("@agentxm/extension-materialization").KnowledgeManager | import("@agentxm/extension-materialization").RuleManager | import("@agentxm/extension-materialization").SkillManager | import("@agentxm/extension-materialization").McpServerManager | import("@agentxm/extension-materialization").PackManager | ExtensionSelectionInteraction | BundledAxmSkillAsset | AgentExecutableResolver | import("@agentxm/workspace-state/live").WorkspaceStateServices | import("@agentxm/workspace-projection").ProjectionParticipants | import("@agentxm/workspace-projection").WorkspaceInvariantFacts>>;
102
+ provide: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | import("@agentxm/workspace-state").WorkspaceMutationsError, import("effect/FileSystem").FileSystem | import("effect/Path").Path | Exclude<R, StepFailureConversion | import("@agentxm/workspace-state").WorkspaceMutations | import("@agentxm/workspace-transactions").WorkspaceTransactionScope | import("@agentxm/workspace-projection").CodingAgentRepository | import("@agentxm/agent-integration").NativeWriteAuthority | HttpClient.HttpClient | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("@agentxm/extension-materialization").ExtensionManagers | import("@agentxm/extension-materialization").HookManager | import("@agentxm/extension-materialization").SkillManager | import("@agentxm/extension-materialization").RuleManager | import("@agentxm/extension-materialization").KnowledgeManager | import("@agentxm/extension-materialization").PackManager | import("@agentxm/extension-materialization").McpServerManager | import("@agentxm/workspace-transactions").FootprintRecorder | import("@agentxm/workspace-operations").OperationJournal | import("@agentxm/extension-materialization").McpSecretStore | ReleaseAgePosture | import("@agentxm/workspace-operations").ResolvePlanInteraction | SourceHostProviders | import("@agentxm/extension-materialization").SubagentManager | import("@agentxm/extension-sources").WorkspaceCatalog | import("@agentxm/workspace-projection").WorkspaceInvariantFacts | ExtensionSelectionInteraction | BundledAxmSkillAsset | AgentExecutableResolver | import("@agentxm/workspace-state/live").WorkspaceStateServices | import("@agentxm/workspace-projection").ProjectionParticipants>>;
103
103
  cleanup: () => void;
104
104
  };
105
105
  export type LifecycleFixture = ReturnType<typeof makeLifecycleFixture>;
@@ -21,7 +21,8 @@ import * as HttpClient from "effect/unstable/http/HttpClient";
21
21
  import { AgentExecutableResolver } from "@agentxm/agent-integration";
22
22
  import { decodeAbsolutePathSync } from "@agentxm/extension-model/unstable/path-types";
23
23
  import { ExtensionManagersLive, HookManagerLive, KnowledgeManagerLive, McpSecretStoreLive, McpServerManagerLive, PackManagerLive, ProjectionParticipantsLive, RuleManagerLive, SkillManagerLive, SubagentManagerLive, } from "@agentxm/extension-materialization/live";
24
- import { ReleaseAgePosture, decideNamedRegistryVersion, makeAxmSkillCompatibilityPolicyLayer, namedRegistryCandidates, resolveVersionEntryWithReleaseAge, } from "@agentxm/extension-resolution";
24
+ import { ReleaseAgePosture, decideNamedRegistryVersion, namedRegistryCandidates, resolveVersionEntryWithReleaseAge, } from "@agentxm/extension-resolution";
25
+ import { makeAxmSkillCompatibilityPolicyLayer } from "@agentxm/cli-maintenance/official-skill/composition";
25
26
  import { AxmSkillCandidateGateLive } from "@agentxm/extension-resolution/live";
26
27
  import { RegistryResolutionPolicy, SourceHostProviders } from "@agentxm/extension-sources";
27
28
  import { SourceHostProvidersLive } from "@agentxm/extension-sources/live";
@@ -1,7 +1,7 @@
1
1
  import * as Effect from "effect/Effect";
2
2
  import type { ExtensionLifecycleFailed } from "../errors.js";
3
3
  import { type InstallableExtensionType } from "@agentxm/extension-model/unstable/extensions/installable-types";
4
- export declare const rootUninstallableTypeSegments: readonly ("knowledge" | "rules" | "hooks" | "mcps" | "skills" | "subagents" | "packs")[];
4
+ export declare const rootUninstallableTypeSegments: readonly ("knowledge" | "rules" | "hooks" | "skills" | "subagents" | "packs" | "mcps")[];
5
5
  export type RootUninstallableType = InstallableExtensionType;
6
6
  export interface RootUninstallIntent {
7
7
  readonly source: string;
@@ -13,7 +13,7 @@ import * as Effect from "effect/Effect";
13
13
  import * as Option from "effect/Option";
14
14
  import type { InstallableExtensionType } from "@agentxm/extension-model/unstable/extensions/installable-types";
15
15
  import { type ExecutionCandidate, type OperationResolution, type PlanExecution } from "@agentxm/workspace-operations";
16
- import type { ExtensionLifecycleFailed } from "../errors.js";
16
+ import { ExtensionLifecycleFailed } from "../errors.js";
17
17
  import { type PackUninstallRequirements } from "../packs/uninstall/plan.js";
18
18
  import type { InstallExecutionFailure, PrepareInstallRequirements } from "../install/vocabulary.js";
19
19
  /** One uninstall request, whatever command spelling produced it. */
@@ -11,7 +11,10 @@
11
11
  */
12
12
  import * as Effect from "effect/Effect";
13
13
  import * as Option from "effect/Option";
14
+ import { proposeDesiredState, prepareUninstallArtifact, collectCleanupStep, buildReconciliationClosure, } from "@agentxm/workspace-reconciliation";
15
+ import { lifecycleStepFailure } from "../step-failure.js";
14
16
  import { operationPresentation, prepareExecutionCandidate, resolveExecutionCandidate, } from "@agentxm/workspace-operations";
17
+ import { ExtensionLifecycleFailed } from "../errors.js";
15
18
  import { parseHookUninstallRequest, planHookUninstall } from "../hooks/uninstall/plan.js";
16
19
  import { parseKnowledgeUninstallRequest, planKnowledgeUninstall, } from "../knowledge/uninstall/plan.js";
17
20
  import { parseMcpServerUninstallRequest, planMcpServerUninstall } from "../mcps/uninstall/plan.js";
@@ -91,19 +94,92 @@ export const prepareUninstallExtensions = Effect.fn("UninstallExtensions.prepare
91
94
  onNone: () => resolveRootUninstallIntent(request.selector).pipe(Effect.map((intent) => ({ type: intent.type, selector: intent.name }))),
92
95
  });
93
96
  const planned = yield* planForType(resolved.type, resolved.selector);
97
+ const proposal = yield* proposeDesiredState(planned.names.map((name) => ({ kind: "remove", type: resolved.type, name }))).pipe(Effect.mapError((cause) => new ExtensionLifecycleFailed({
98
+ category: "conflict",
99
+ detail: "Cannot derive desired state after uninstall",
100
+ cause,
101
+ })));
94
102
  // The plan's own name stands whichever spelling produced it: the removal a
95
103
  // person asked for is type-specific, and the plan name is what they read.
96
104
  // Only the presented subject varies — the root form routes across every
97
105
  // type, so it presents the default subject rather than the one this
98
106
  // request happened to settle on.
107
+ const leafType = resolved.type === "pack" ? undefined : resolved.type;
108
+ const artifacts = leafType === undefined
109
+ ? []
110
+ : yield* Effect.forEach(planned.names, (name) => prepareUninstallArtifact({ type: leafType, name }, proposal)).pipe(Effect.mapError((cause) => new ExtensionLifecycleFailed({
111
+ category: "conflict",
112
+ detail: "Cannot establish uninstall effects",
113
+ cause,
114
+ })));
115
+ const artifactByName = new Map(planned.names.flatMap((name, index) => artifacts[index] === undefined ? [] : [[name, artifacts[index]]]));
116
+ const cleanupAdapter = {
117
+ toStepFailure: (cause) => lifecycleStepFailure(new ExtensionLifecycleFailed({
118
+ category: "conflict",
119
+ detail: "detail" in cause ? cause.detail : cause._tag,
120
+ cause,
121
+ })),
122
+ };
123
+ const activeNames = (type) => new Set(proposal.after.nodes
124
+ .filter((node) => node.type === type && node.enabled)
125
+ .map((node) => node.name));
126
+ const jobs = yield* Effect.forEach(planned.plan.jobs, (job) => Effect.gen(function* () {
127
+ const steps = yield* Effect.forEach(job.steps, (step) => Effect.gen(function* () {
128
+ const artifact = artifactByName.get(step.label ?? "");
129
+ if (artifact === undefined ||
130
+ step.readiness === "error" ||
131
+ leafType === undefined ||
132
+ ((artifact.targets?.length ?? 0) === 0 && (artifact.references?.length ?? 0) === 0))
133
+ return step;
134
+ const cleanup = yield* collectCleanupStep({
135
+ expectedSkillNames: activeNames("skill"),
136
+ expectedSubagentNames: activeNames("subagent"),
137
+ expectedMcpServerNames: activeNames("mcp-server"),
138
+ expectedHookNames: activeNames("hook"),
139
+ subjects: [{ type: leafType, name: step.label }],
140
+ adapter: cleanupAdapter,
141
+ }).pipe(Effect.mapError((cause) => new ExtensionLifecycleFailed({
142
+ category: "conflict",
143
+ detail: "Cannot establish owned uninstall outputs",
144
+ cause,
145
+ })));
146
+ const removal = {
147
+ ...step,
148
+ artifact,
149
+ run: step.run.pipe(Effect.map((result) => result.result === "success" ? { ...result, artifact } : result)),
150
+ };
151
+ if (Option.isNone(cleanup))
152
+ return removal;
153
+ return yield* buildReconciliationClosure({
154
+ label: step.label,
155
+ message: `Uninstalled ${step.label}`,
156
+ artifact,
157
+ children: [
158
+ { step: cleanup.value, coverage: "ineligible" },
159
+ { step: removal, coverage: "eligible" },
160
+ ],
161
+ toStepFailure: (failure) => failure._tag === "StepFailure" ? failure : cleanupAdapter.toStepFailure(failure),
162
+ validate: Effect.void,
163
+ });
164
+ }));
165
+ return { ...job, steps };
166
+ }));
99
167
  const plan = {
100
168
  ...planned.plan,
169
+ jobs,
101
170
  presentation: operationPresentation({ imperative: "uninstall", past: "Uninstalled", gerund: "Uninstalling" }, Option.getOrUndefined(request.type)),
102
171
  };
103
172
  // Every removal withdraws the extension's per-agent projection, so the
104
173
  // candidate carries the configured-agent operation the resolution projects
105
174
  // before the removal and verifies after it.
106
- const configuredAgentOperations = planned.names.map((name) => ({ extensionType: resolved.type, name, plannedState: "absent" }));
175
+ const configuredAgentOperations = planned.names.map((name) => {
176
+ const retained = proposal.after.nodes.find((node) => node.type === resolved.type && node.name === name);
177
+ return {
178
+ extensionType: resolved.type,
179
+ name,
180
+ plannedState: retained === undefined ? "absent" : retained.enabled ? "enabled" : "disabled",
181
+ };
182
+ });
107
183
  const execution = yield* prepareExecutionCandidate(plan, { configuredAgentOperations });
108
184
  return {
109
185
  type: resolved.type,
@@ -18,8 +18,8 @@ import { ExtensionLifecycleFailed } from "../errors.js";
18
18
  import { type InstallableExtensionType } from "@agentxm/extension-model/unstable/extensions/installable-types";
19
19
  import { type ExtensionName, type Handle } from "@agentxm/extension-model/unstable/extensions";
20
20
  import type { VersionRange } from "@agentxm/extension-model/unstable/version-constraints";
21
- export declare const rootUpdatableTypeSegments: readonly ("knowledge" | "rules" | "hooks" | "mcps" | "skills" | "subagents" | "packs")[];
22
- export declare const RootUpdatableTypeSegmentSchema: Schema.Literals<readonly ("knowledge" | "rules" | "hooks" | "mcps" | "skills" | "subagents" | "packs")[]>;
21
+ export declare const rootUpdatableTypeSegments: readonly ("knowledge" | "rules" | "hooks" | "skills" | "subagents" | "packs" | "mcps")[];
22
+ export declare const RootUpdatableTypeSegmentSchema: Schema.Literals<readonly ("knowledge" | "rules" | "hooks" | "skills" | "subagents" | "packs" | "mcps")[]>;
23
23
  export type RootUpdatableTypeSegment = typeof RootUpdatableTypeSegmentSchema.Type;
24
24
  export type RootUpdatableType = InstallableExtensionType;
25
25
  /** One Registry identity a root update names, with the range it requested. */
@@ -51,5 +51,5 @@ export declare const prepareSelectiveSkillUpdate: (request: SelectiveSkillUpdate
51
51
  reason?: never;
52
52
  message?: never;
53
53
  planDescription?: never;
54
- }, ExtensionLifecycleFailed | import("@agentxm/extension-sources").SourceSyntaxInvalid | import("@agentxm/extension-sources").SourceHostNotConfigured | import("@agentxm/extension-sources").SourceNotResolvable | import("@agentxm/extension-sources").SourceNetworkFailure | import("@agentxm/extension-sources").GitOperationFailed | import("@agentxm/extension-sources").WorkspaceCatalogUnavailable | import("@agentxm/extension-sources").AxmSkillGateUnavailable | import("@agentxm/registry-client").RegistryProblem | import("@agentxm/registry-client").RegistryRequestFailed | import("@agentxm/registry-client").RegistryOperationFailed | import("@agentxm/workspace-state").SettingsIoError | import("@agentxm/workspace-state").SettingsParseError | import("@agentxm/workspace-state").SettingsDecodeError | import("@agentxm/workspace-state").LockfileIoError | import("@agentxm/workspace-state").LockfileParseError | import("@agentxm/workspace-state").LockfileDecodeError | import("@agentxm/workspace-state").LockfileVersionUnsupported | import("@agentxm/workspace-state").WorkspaceRootEscape | import("@agentxm/workspace-state").LockfileValidationError | import("@agentxm/extension-resolution").ExtensionResolutionFailed | import("@agentxm/workspace-operations").CandidateFingerprintFailed, import("effect/FileSystem").FileSystem | import("effect/Path").Path | WorkspaceMutations | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("effect/unstable/http/HttpClient").HttpClient | import("@agentxm/extension-resolution").ReleaseAgePosture | import("effect/Scope").Scope | SourceHostProviders | import("@agentxm/extension-sources").WorkspaceCatalog>;
54
+ }, ExtensionLifecycleFailed | import("@agentxm/extension-sources").SourceSyntaxInvalid | import("@agentxm/extension-sources").SourceHostNotConfigured | import("@agentxm/extension-sources").SourceNotResolvable | import("@agentxm/extension-sources").SourceNetworkFailure | import("@agentxm/extension-sources").GitOperationFailed | import("@agentxm/extension-sources").WorkspaceCatalogUnavailable | import("@agentxm/extension-sources").AxmSkillGateUnavailable | import("@agentxm/registry-client").RegistryProblem | import("@agentxm/registry-client").RegistryRequestFailed | import("@agentxm/registry-client").RegistryOperationFailed | import("@agentxm/workspace-state").SettingsIoError | import("@agentxm/workspace-state").SettingsParseError | import("@agentxm/workspace-state").SettingsDecodeError | import("@agentxm/workspace-state").LockfileIoError | import("@agentxm/workspace-state").LockfileParseError | import("@agentxm/workspace-state").LockfileDecodeError | import("@agentxm/workspace-state").LockfileVersionUnsupported | import("@agentxm/workspace-state").WorkspaceRootEscape | import("@agentxm/workspace-state").LockfileValidationError | import("@agentxm/extension-resolution").ExtensionResolutionFailed | import("@agentxm/workspace-operations").CandidateFingerprintFailed, import("effect/FileSystem").FileSystem | import("effect/Path").Path | WorkspaceMutations | import("effect/unstable/http/HttpClient").HttpClient | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("@agentxm/extension-resolution").ReleaseAgePosture | import("effect/Scope").Scope | SourceHostProviders | import("@agentxm/extension-sources").WorkspaceCatalog>;
55
55
  //# sourceMappingURL=skills.d.ts.map
@@ -532,7 +532,6 @@ export const prepareSelectiveSkillUpdate = Effect.fn("SelectiveSkillUpdate.prepa
532
532
  ref: item.ref,
533
533
  force: request.ignoreVersionConstraints || item.ref.refType !== "registry",
534
534
  versionRange: item.versionRange,
535
- skipSettings: Option.none(),
536
535
  strictUnknownAgents: Option.none(),
537
536
  sourceName: Option.none(),
538
537
  },
@@ -48,5 +48,5 @@ export declare const prepareSelectiveSubagentUpdate: (request: SelectiveSubagent
48
48
  reason?: never;
49
49
  message?: never;
50
50
  planDescription?: never;
51
- }, ExtensionLifecycleFailed | import("@agentxm/extension-sources").SourceSyntaxInvalid | import("@agentxm/extension-sources").SourceHostNotConfigured | import("@agentxm/extension-sources").SourceNotResolvable | import("@agentxm/extension-sources").SourceNetworkFailure | import("@agentxm/extension-sources").GitOperationFailed | import("@agentxm/extension-sources").WorkspaceCatalogUnavailable | import("@agentxm/extension-sources").AxmSkillGateUnavailable | import("@agentxm/registry-client").RegistryProblem | import("@agentxm/registry-client").RegistryRequestFailed | import("@agentxm/registry-client").RegistryOperationFailed | import("@agentxm/workspace-state").SettingsIoError | import("@agentxm/workspace-state").SettingsParseError | import("@agentxm/workspace-state").SettingsDecodeError | import("@agentxm/workspace-state").LockfileIoError | import("@agentxm/workspace-state").LockfileParseError | import("@agentxm/workspace-state").LockfileDecodeError | import("@agentxm/workspace-state").LockfileVersionUnsupported | import("@agentxm/workspace-state").WorkspaceRootEscape | import("@agentxm/workspace-state").LockfileValidationError | import("@agentxm/extension-resolution").ExtensionResolutionFailed | import("@agentxm/workspace-operations").CandidateFingerprintFailed, StepFailureConversion | import("effect/FileSystem").FileSystem | import("effect/Path").Path | WorkspaceMutations | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("effect/unstable/http/HttpClient").HttpClient | import("@agentxm/extension-resolution").ReleaseAgePosture | import("effect/Scope").Scope | SourceHostProviders | SubagentManager | import("@agentxm/extension-sources").WorkspaceCatalog>;
51
+ }, ExtensionLifecycleFailed | import("@agentxm/extension-sources").SourceSyntaxInvalid | import("@agentxm/extension-sources").SourceHostNotConfigured | import("@agentxm/extension-sources").SourceNotResolvable | import("@agentxm/extension-sources").SourceNetworkFailure | import("@agentxm/extension-sources").GitOperationFailed | import("@agentxm/extension-sources").WorkspaceCatalogUnavailable | import("@agentxm/extension-sources").AxmSkillGateUnavailable | import("@agentxm/registry-client").RegistryProblem | import("@agentxm/registry-client").RegistryRequestFailed | import("@agentxm/registry-client").RegistryOperationFailed | import("@agentxm/workspace-state").SettingsIoError | import("@agentxm/workspace-state").SettingsParseError | import("@agentxm/workspace-state").SettingsDecodeError | import("@agentxm/workspace-state").LockfileIoError | import("@agentxm/workspace-state").LockfileParseError | import("@agentxm/workspace-state").LockfileDecodeError | import("@agentxm/workspace-state").LockfileVersionUnsupported | import("@agentxm/workspace-state").WorkspaceRootEscape | import("@agentxm/workspace-state").LockfileValidationError | import("@agentxm/extension-resolution").ExtensionResolutionFailed | import("@agentxm/workspace-operations").CandidateFingerprintFailed, StepFailureConversion | import("effect/FileSystem").FileSystem | import("effect/Path").Path | WorkspaceMutations | import("effect/unstable/http/HttpClient").HttpClient | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("@agentxm/extension-resolution").ReleaseAgePosture | import("effect/Scope").Scope | SourceHostProviders | SubagentManager | import("@agentxm/extension-sources").WorkspaceCatalog>;
52
52
  //# sourceMappingURL=subagents.d.ts.map
@@ -15,7 +15,8 @@ import * as Effect from "effect/Effect";
15
15
  import * as Option from "effect/Option";
16
16
  import { decodeExtensionNameSync, parseSourceQualifiedRegistrySourcePatternParts, } from "@agentxm/extension-model/unstable/extensions";
17
17
  import { isWorkspaceSourceLocator } from "@agentxm/extension-model/unstable/sources/workspace";
18
- import { buildInstallOperation, SubagentManager } from "@agentxm/extension-materialization";
18
+ import { SubagentManager } from "@agentxm/extension-materialization";
19
+ import { buildInstallOperation } from "@agentxm/workspace-reconciliation";
19
20
  import { classifyPublisherBindingTransition, makeConfiguredReleaseAgeEvaluation, normalizeReleaseAgeRecords, publisherTransitionWarning, registryBindingProposal, } from "@agentxm/extension-resolution";
20
21
  import { resolveSource, SourceHostProviders } from "@agentxm/extension-sources";
21
22
  import { operationPresentation, prepareExecutionCandidate, StepFailure, } from "@agentxm/workspace-operations";
@@ -271,7 +272,7 @@ export const prepareSelectiveSubagentUpdate = Effect.fn("SelectiveSubagentUpdate
271
272
  const step = buildInstallOperation(subagentManager, {
272
273
  toStepFailure: failureConversion.toStepFailure,
273
274
  ref,
274
- versionRange: Option.none(),
275
+ declaration: { name: ref.subagent.name, versionRange: Option.none() },
275
276
  });
276
277
  if (step.readiness === "error") {
277
278
  return Effect.fail(new StepFailure({ category: "conflict", detail: step.errorMessage }));
@@ -64,7 +64,7 @@ export declare const prepareSelectiveUpdate: (request: SelectiveUpdateRequest) =
64
64
  reason?: never;
65
65
  message?: never;
66
66
  planDescription?: never;
67
- }, import("../../errors.ts").ExtensionLifecycleFailed | import("@agentxm/extension-sources").SourceSyntaxInvalid | import("@agentxm/extension-sources").SourceHostNotConfigured | import("@agentxm/extension-sources").SourceNotResolvable | import("@agentxm/extension-sources").SourceNetworkFailure | import("@agentxm/extension-sources").GitOperationFailed | import("@agentxm/extension-sources").WorkspaceCatalogUnavailable | import("@agentxm/extension-sources").AxmSkillGateUnavailable | import("@agentxm/registry-client").RegistryProblem | import("@agentxm/registry-client").RegistryRequestFailed | import("@agentxm/registry-client").RegistryOperationFailed | import("@agentxm/workspace-state").SettingsIoError | import("@agentxm/workspace-state").SettingsParseError | import("@agentxm/workspace-state").SettingsDecodeError | import("@agentxm/workspace-state").LockfileIoError | import("@agentxm/workspace-state").LockfileParseError | import("@agentxm/workspace-state").LockfileDecodeError | import("@agentxm/workspace-state").LockfileVersionUnsupported | import("@agentxm/workspace-state").WorkspaceRootEscape | import("@agentxm/workspace-state").LockfileValidationError | import("@agentxm/extension-resolution").ExtensionResolutionFailed | import("@agentxm/workspace-operations").CandidateFingerprintFailed, import("../../step-failure-conversion.ts").StepFailureConversion | import("effect/FileSystem").FileSystem | import("effect/Path").Path | import("@agentxm/workspace-state").WorkspaceMutations | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("effect/unstable/http/HttpClient").HttpClient | import("@agentxm/extension-resolution").ReleaseAgePosture | import("effect/Scope").Scope | import("@agentxm/extension-sources").SourceHostProviders | import("@agentxm/extension-materialization").SubagentManager | import("@agentxm/extension-sources").WorkspaceCatalog>;
67
+ }, import("../../errors.ts").ExtensionLifecycleFailed | import("@agentxm/extension-sources").SourceSyntaxInvalid | import("@agentxm/extension-sources").SourceHostNotConfigured | import("@agentxm/extension-sources").SourceNotResolvable | import("@agentxm/extension-sources").SourceNetworkFailure | import("@agentxm/extension-sources").GitOperationFailed | import("@agentxm/extension-sources").WorkspaceCatalogUnavailable | import("@agentxm/extension-sources").AxmSkillGateUnavailable | import("@agentxm/registry-client").RegistryProblem | import("@agentxm/registry-client").RegistryRequestFailed | import("@agentxm/registry-client").RegistryOperationFailed | import("@agentxm/workspace-state").SettingsIoError | import("@agentxm/workspace-state").SettingsParseError | import("@agentxm/workspace-state").SettingsDecodeError | import("@agentxm/workspace-state").LockfileIoError | import("@agentxm/workspace-state").LockfileParseError | import("@agentxm/workspace-state").LockfileDecodeError | import("@agentxm/workspace-state").LockfileVersionUnsupported | import("@agentxm/workspace-state").WorkspaceRootEscape | import("@agentxm/workspace-state").LockfileValidationError | import("@agentxm/extension-resolution").ExtensionResolutionFailed | import("@agentxm/workspace-operations").CandidateFingerprintFailed, import("../../step-failure-conversion.ts").StepFailureConversion | import("effect/FileSystem").FileSystem | import("effect/Path").Path | import("@agentxm/workspace-state").WorkspaceMutations | import("effect/unstable/http/HttpClient").HttpClient | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("@agentxm/extension-resolution").ReleaseAgePosture | import("effect/Scope").Scope | import("@agentxm/extension-sources").SourceHostProviders | import("@agentxm/extension-materialization").SubagentManager | import("@agentxm/extension-sources").WorkspaceCatalog>;
68
68
  /** Settle a selective update, then preview or apply it. */
69
69
  export declare const SelectiveUpdate: {
70
70
  readonly prepare: (request: SelectiveUpdateRequest) => Effect.Effect<{
@@ -115,7 +115,7 @@ export declare const SelectiveUpdate: {
115
115
  reason?: never;
116
116
  message?: never;
117
117
  planDescription?: never;
118
- }, import("../../errors.ts").ExtensionLifecycleFailed | import("@agentxm/extension-sources").SourceSyntaxInvalid | import("@agentxm/extension-sources").SourceHostNotConfigured | import("@agentxm/extension-sources").SourceNotResolvable | import("@agentxm/extension-sources").SourceNetworkFailure | import("@agentxm/extension-sources").GitOperationFailed | import("@agentxm/extension-sources").WorkspaceCatalogUnavailable | import("@agentxm/extension-sources").AxmSkillGateUnavailable | import("@agentxm/registry-client").RegistryProblem | import("@agentxm/registry-client").RegistryRequestFailed | import("@agentxm/registry-client").RegistryOperationFailed | import("@agentxm/workspace-state").SettingsIoError | import("@agentxm/workspace-state").SettingsParseError | import("@agentxm/workspace-state").SettingsDecodeError | import("@agentxm/workspace-state").LockfileIoError | import("@agentxm/workspace-state").LockfileParseError | import("@agentxm/workspace-state").LockfileDecodeError | import("@agentxm/workspace-state").LockfileVersionUnsupported | import("@agentxm/workspace-state").WorkspaceRootEscape | import("@agentxm/workspace-state").LockfileValidationError | import("@agentxm/extension-resolution").ExtensionResolutionFailed | import("@agentxm/workspace-operations").CandidateFingerprintFailed, import("../../step-failure-conversion.ts").StepFailureConversion | import("effect/FileSystem").FileSystem | import("effect/Path").Path | import("@agentxm/workspace-state").WorkspaceMutations | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("effect/unstable/http/HttpClient").HttpClient | import("@agentxm/extension-resolution").ReleaseAgePosture | import("effect/Scope").Scope | import("@agentxm/extension-sources").SourceHostProviders | import("@agentxm/extension-materialization").SubagentManager | import("@agentxm/extension-sources").WorkspaceCatalog>;
118
+ }, import("../../errors.ts").ExtensionLifecycleFailed | import("@agentxm/extension-sources").SourceSyntaxInvalid | import("@agentxm/extension-sources").SourceHostNotConfigured | import("@agentxm/extension-sources").SourceNotResolvable | import("@agentxm/extension-sources").SourceNetworkFailure | import("@agentxm/extension-sources").GitOperationFailed | import("@agentxm/extension-sources").WorkspaceCatalogUnavailable | import("@agentxm/extension-sources").AxmSkillGateUnavailable | import("@agentxm/registry-client").RegistryProblem | import("@agentxm/registry-client").RegistryRequestFailed | import("@agentxm/registry-client").RegistryOperationFailed | import("@agentxm/workspace-state").SettingsIoError | import("@agentxm/workspace-state").SettingsParseError | import("@agentxm/workspace-state").SettingsDecodeError | import("@agentxm/workspace-state").LockfileIoError | import("@agentxm/workspace-state").LockfileParseError | import("@agentxm/workspace-state").LockfileDecodeError | import("@agentxm/workspace-state").LockfileVersionUnsupported | import("@agentxm/workspace-state").WorkspaceRootEscape | import("@agentxm/workspace-state").LockfileValidationError | import("@agentxm/extension-resolution").ExtensionResolutionFailed | import("@agentxm/workspace-operations").CandidateFingerprintFailed, import("../../step-failure-conversion.ts").StepFailureConversion | import("effect/FileSystem").FileSystem | import("effect/Path").Path | import("@agentxm/workspace-state").WorkspaceMutations | import("effect/unstable/http/HttpClient").HttpClient | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("@agentxm/extension-resolution").ReleaseAgePosture | import("effect/Scope").Scope | import("@agentxm/extension-sources").SourceHostProviders | import("@agentxm/extension-materialization").SubagentManager | import("@agentxm/extension-sources").WorkspaceCatalog>;
119
119
  readonly previewOrApply: (candidate: import("./vocabulary.js").PlannedSelectiveUpdateCandidate, execution: import("@agentxm/workspace-operations").PlanExecution) => Effect.Effect<import("@agentxm/workspace-operations").OperationResolution<never>, import("@agentxm/workspace-state").WorkspaceSettingsReadFailure | import("@agentxm/workspace-operations").ApprovalRecoveryMissing | import("@agentxm/workspace-operations").PlanInteractionFailed | import("@agentxm/workspace-transactions").WorkspaceTransitionAcquireFailure, import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("@agentxm/workspace-transactions").FootprintRecorder | import("@agentxm/workspace-operations").OperationJournal | import("@agentxm/workspace-operations").ResolvePlanInteraction | import("./requirements.ts").SelectiveUpdateStepRequirements>;
120
120
  };
121
121
  //# sourceMappingURL=use-case.d.ts.map
@@ -1,3 +1,5 @@
1
+ import { lifecycleStepFailure } from "../step-failure.js";
2
+ import { buildReconciliationClosure, } from "@agentxm/workspace-reconciliation";
1
3
  /**
2
4
  * Wrapping a targeted update in one atomic ownership transition.
3
5
  *
@@ -18,7 +20,6 @@ import { operationPresentation, } from "@agentxm/workspace-operations";
18
20
  import { WorkspaceMutations } from "@agentxm/workspace-state";
19
21
  import { resolveTargetedUpdateContext, } from "@agentxm/extension-resolution";
20
22
  import { ExtensionLifecycleFailed } from "../errors.js";
21
- import { buildAtomicPackGraphStep } from "../packs/graph-transition.js";
22
23
  export const TARGETED_UPDATE_STALE_DETAIL = "The targeted update ownership context became stale before apply.";
23
24
  const same = (left, right) => JSON.stringify(left) === JSON.stringify(right);
24
25
  const validatePostcondition = (args) => {
@@ -63,7 +64,8 @@ export const wrapTargetedUpdatePlan = (args) => Effect.gen(function* () {
63
64
  scope: workspace.scope,
64
65
  change: "updated",
65
66
  };
66
- const builtStep = yield* buildAtomicPackGraphStep({
67
+ const builtStep = yield* buildReconciliationClosure({
68
+ toStepFailure: lifecycleStepFailure,
67
69
  label: args.context.public.target.fqn,
68
70
  message: `Updated ${args.context.public.target.fqn}`,
69
71
  artifact,
@@ -20,12 +20,6 @@ export declare const workspaceLockfilePath: (scope: WorkspaceScope) => string;
20
20
  export declare const workspaceCanonicalRoot: (scope: WorkspaceScope) => string;
21
21
  /** One acquired package's path, relative to the workspace root. */
22
22
  export declare const workspaceCanonicalPath: (scope: WorkspaceScope, relativePath: string) => string;
23
- /** Where one desired-graph node's package sits, authored or acquired. */
24
- export declare const workspaceCanonicalNodePath: (path: Path.Path, ws: WorkspaceMutationsService, node: {
25
- readonly type: ExtensionType;
26
- readonly name: string;
27
- readonly identity: string;
28
- }) => string;
29
23
  /** Where a workspace-authored package of this type and name sits. */
30
24
  export declare const workspaceAuthoredPath: (path: Path.Path, ws: WorkspaceMutationsService, type: ExtensionType, name: string) => string;
31
25
  //# sourceMappingURL=workspace-paths.d.ts.map
@@ -25,16 +25,6 @@ const extensionDirectory = {
25
25
  knowledge: "knowledge",
26
26
  pack: "packs",
27
27
  };
28
- /** Where one desired-graph node's package sits, authored or acquired. */
29
- export const workspaceCanonicalNodePath = (path, ws, node) => {
30
- if (node.identity.startsWith("workspace:") && ws.layout.scope === "project") {
31
- return path.join(path.relative(ws.baseDir, ws.layout.authoredRoot(node.type)), node.name);
32
- }
33
- const identity = node.identity.startsWith("workspace:")
34
- ? node.identity.slice("workspace:".length)
35
- : node.identity;
36
- return workspaceCanonicalPath(ws.scope, identity);
37
- };
38
28
  /** Where a workspace-authored package of this type and name sits. */
39
29
  export const workspaceAuthoredPath = (path, ws, type, name) => {
40
30
  if (ws.layout.scope === "project") {
package/package.json CHANGED
@@ -4,20 +4,21 @@
4
4
  "url": "https://github.com/agentxm/axm/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@agentxm/agent-integration": "^0.29.2",
8
- "@agentxm/extension-content": "^0.29.2",
9
- "@agentxm/extension-materialization": "^0.29.2",
10
- "@agentxm/extension-model": "^0.29.2",
11
- "@agentxm/extension-resolution": "^0.29.2",
12
- "@agentxm/extension-sources": "^0.29.2",
13
- "@agentxm/registry-auth": "^0.29.2",
14
- "@agentxm/registry-client": "^0.29.2",
15
- "@agentxm/registry-protocol": "^0.29.2",
16
- "@agentxm/workspace-operations": "^0.29.2",
17
- "@agentxm/workspace-projection": "^0.29.2",
18
- "@agentxm/workspace-state": "^0.29.2",
19
- "@agentxm/workspace-transactions": "^0.29.2",
20
- "@napi-rs/keyring": "^1.3.0",
7
+ "@agentxm/agent-integration": "^0.30.1",
8
+ "@agentxm/cli-maintenance": "^0.30.1",
9
+ "@agentxm/extension-content": "^0.30.1",
10
+ "@agentxm/extension-materialization": "^0.30.1",
11
+ "@agentxm/extension-model": "^0.30.1",
12
+ "@agentxm/extension-resolution": "^0.30.1",
13
+ "@agentxm/extension-sources": "^0.30.1",
14
+ "@agentxm/registry-auth": "^0.30.1",
15
+ "@agentxm/registry-client": "^0.30.1",
16
+ "@agentxm/registry-protocol": "^0.30.1",
17
+ "@agentxm/workspace-operations": "^0.30.1",
18
+ "@agentxm/workspace-projection": "^0.30.1",
19
+ "@agentxm/workspace-reconciliation": "^0.30.1",
20
+ "@agentxm/workspace-state": "^0.30.1",
21
+ "@agentxm/workspace-transactions": "^0.30.1",
21
22
  "effect": "4.0.0-rc.115",
22
23
  "fflate": "^0.8.3"
23
24
  },
@@ -37,19 +38,16 @@
37
38
  },
38
39
  "exports": {
39
40
  ".": {
40
- "axm-source": "./src/index.ts",
41
- "default": "./dist/src/index.js",
42
- "types": "./dist/src/index.d.ts"
41
+ "types": "./dist/src/index.d.ts",
42
+ "default": "./dist/src/index.js"
43
43
  },
44
44
  "./live": {
45
- "axm-source": "./src/live.ts",
46
- "default": "./dist/src/live.js",
47
- "types": "./dist/src/live.d.ts"
45
+ "types": "./dist/src/live.d.ts",
46
+ "default": "./dist/src/live.js"
48
47
  },
49
48
  "./testing": {
50
- "axm-source": "./src/testing.ts",
51
- "default": "./dist/src/testing.js",
52
- "types": "./dist/src/testing.d.ts"
49
+ "types": "./dist/src/testing.d.ts",
50
+ "default": "./dist/src/testing.js"
53
51
  }
54
52
  },
55
53
  "files": [
@@ -72,5 +70,5 @@
72
70
  },
73
71
  "sideEffects": false,
74
72
  "type": "module",
75
- "version": "0.29.2"
73
+ "version": "0.30.1"
76
74
  }
@@ -1,21 +0,0 @@
1
- /**
2
- * Whether a removal may delete the package it withdraws.
3
- *
4
- * An extension declared directly and also required by an installed pack keeps
5
- * its package when the direct declaration goes: the pack still depends on it.
6
- * The membership fact is workspace state's; deciding that it means "retain"
7
- * is this feature's.
8
- *
9
- * @experimental This API is unstable and may change without notice.
10
- */
11
- import type { UninstallRetentionPolicy } from "@agentxm/extension-materialization";
12
- import type { WorkspaceMutationsService } from "@agentxm/workspace-state";
13
- import type { ExtensionLifecycleFailed } from "../errors.js";
14
- /** Retain a package an installed pack still requires. */
15
- export declare const makeWorkspaceRetentionPolicy: (ws: WorkspaceMutationsService) => UninstallRetentionPolicy<ExtensionLifecycleFailed>;
16
- /**
17
- * A pack's own exclusive members carry no separate retention question: the
18
- * pack that required them is being removed in the same transition.
19
- */
20
- export declare const exclusiveMemberRetentionPolicy: UninstallRetentionPolicy<ExtensionLifecycleFailed>;
21
- //# sourceMappingURL=retention-policy.d.ts.map
@@ -1,28 +0,0 @@
1
- /**
2
- * Whether a removal may delete the package it withdraws.
3
- *
4
- * An extension declared directly and also required by an installed pack keeps
5
- * its package when the direct declaration goes: the pack still depends on it.
6
- * The membership fact is workspace state's; deciding that it means "retain"
7
- * is this feature's.
8
- *
9
- * @experimental This API is unstable and may change without notice.
10
- */
11
- import * as Effect from "effect/Effect";
12
- import { installRefused } from "../install/vocabulary.js";
13
- /** Retain a package an installed pack still requires. */
14
- export const makeWorkspaceRetentionPolicy = (ws) => ({
15
- isRequiredByInstalledPack: (args) => ws.isExtensionRequiredByInstalledPack(args.target).pipe(Effect.mapError((cause) => installRefused({
16
- category: "internal",
17
- detail: `Pack membership for ${args.target.type} "${args.target.name}" could not be read`,
18
- cause,
19
- }))),
20
- });
21
- /**
22
- * A pack's own exclusive members carry no separate retention question: the
23
- * pack that required them is being removed in the same transition.
24
- */
25
- export const exclusiveMemberRetentionPolicy = {
26
- isRequiredByInstalledPack: () => Effect.succeed(false),
27
- };
28
- //# sourceMappingURL=retention-policy.js.map