@agentxm/extension-lifecycle 0.28.12 → 0.28.13

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 (207) hide show
  1. package/dist/src/activation/display-paths.d.ts +25 -0
  2. package/dist/src/activation/display-paths.js +25 -0
  3. package/dist/src/activation/errors.d.ts +16 -0
  4. package/dist/src/activation/errors.js +7 -0
  5. package/dist/src/activation/set-activation.d.ts +134 -0
  6. package/dist/src/activation/set-activation.js +772 -0
  7. package/dist/src/demote/demote-to-external-source.d.ts +82 -0
  8. package/dist/src/demote/demote-to-external-source.js +233 -0
  9. package/dist/src/errors.d.ts +0 -8
  10. package/dist/src/errors.js +0 -8
  11. package/dist/src/glob.d.ts +35 -0
  12. package/dist/src/glob.js +75 -0
  13. package/dist/src/hooks/configured-agent-outcomes-provider.d.ts +7 -3
  14. package/dist/src/hooks/configured-agent-outcomes-provider.js +11 -4
  15. package/dist/src/hooks/install/plan.d.ts +45 -0
  16. package/dist/src/hooks/install/plan.js +224 -0
  17. package/dist/src/hooks/uninstall/plan.d.ts +20 -0
  18. package/dist/src/hooks/uninstall/plan.js +77 -0
  19. package/dist/src/index.d.ts +48 -16
  20. package/dist/src/index.js +60 -17
  21. package/dist/src/install/aggregate-projection-step.d.ts +16 -0
  22. package/dist/src/install/aggregate-projection-step.js +49 -0
  23. package/dist/src/install/configured.d.ts +65 -0
  24. package/dist/src/install/configured.js +406 -0
  25. package/dist/src/install/inline-mcp-operation.d.ts +4 -0
  26. package/dist/src/install/inline-mcp-operation.js +25 -0
  27. package/dist/src/install/install-extensions.d.ts +110 -0
  28. package/dist/src/install/install-extensions.js +282 -0
  29. package/dist/src/install/per-type-install.d.ts +12 -0
  30. package/dist/src/install/per-type-install.js +12 -0
  31. package/dist/src/install/registry-install-target.d.ts +35 -0
  32. package/dist/src/install/registry-install-target.js +66 -0
  33. package/dist/src/install/registry-login-suggestion.d.ts +21 -0
  34. package/dist/src/install/registry-login-suggestion.js +34 -0
  35. package/dist/src/install/registry-source-resolution.d.ts +54 -0
  36. package/dist/src/install/registry-source-resolution.js +216 -0
  37. package/dist/src/install/root-intent.d.ts +19 -0
  38. package/dist/src/install/root-intent.js +122 -0
  39. package/dist/src/install/selection-interaction.d.ts +46 -0
  40. package/dist/src/install/selection-interaction.js +22 -0
  41. package/dist/src/install/vocabulary.d.ts +143 -0
  42. package/dist/src/install/vocabulary.js +29 -0
  43. package/dist/src/knowledge/install/plan.d.ts +35 -0
  44. package/dist/src/knowledge/install/plan.js +128 -0
  45. package/dist/src/knowledge/uninstall/plan.d.ts +23 -0
  46. package/dist/src/knowledge/uninstall/plan.js +140 -0
  47. package/dist/src/live.d.ts +4 -11
  48. package/dist/src/live.js +4 -11
  49. package/dist/src/mcps/install/plan.d.ts +65 -0
  50. package/dist/src/mcps/install/plan.js +301 -0
  51. package/dist/src/mcps/operations/disable.d.ts +5 -3
  52. package/dist/src/mcps/operations/disable.js +6 -4
  53. package/dist/src/mcps/operations/enable.d.ts +5 -3
  54. package/dist/src/mcps/operations/enable.js +8 -6
  55. package/dist/src/mcps/operations/sync-outcome.d.ts +1 -1
  56. package/dist/src/mcps/operations/uninstall.d.ts +5 -3
  57. package/dist/src/mcps/operations/uninstall.js +4 -4
  58. package/dist/src/mcps/uninstall/plan.d.ts +24 -0
  59. package/dist/src/mcps/uninstall/plan.js +109 -0
  60. package/dist/src/packs/artifact.d.ts +21 -0
  61. package/dist/src/packs/artifact.js +32 -0
  62. package/dist/src/packs/constraint-gate.d.ts +30 -0
  63. package/dist/src/packs/constraint-gate.js +76 -0
  64. package/dist/src/packs/expansion.d.ts +13 -14
  65. package/dist/src/packs/expansion.js +1 -2
  66. package/dist/src/packs/graph-transition.d.ts +64 -0
  67. package/dist/src/packs/graph-transition.js +219 -0
  68. package/dist/src/packs/install/plan.d.ts +95 -0
  69. package/dist/src/packs/install/plan.js +845 -0
  70. package/dist/src/packs/member-install-step.d.ts +29 -0
  71. package/dist/src/packs/member-install-step.js +156 -0
  72. package/dist/src/packs/operations/install.d.ts +3 -3
  73. package/dist/src/packs/operations/install.js +5 -5
  74. package/dist/src/packs/promote-authored-pack.d.ts +86 -0
  75. package/dist/src/packs/promote-authored-pack.js +239 -0
  76. package/dist/src/packs/resolved-dependency.d.ts +9 -26
  77. package/dist/src/packs/resolved-dependency.js +8 -20
  78. package/dist/src/packs/uninstall/plan.d.ts +66 -0
  79. package/dist/src/packs/uninstall/plan.js +344 -0
  80. package/dist/src/packs/uninstall/readiness.d.ts +50 -0
  81. package/dist/src/packs/uninstall/readiness.js +130 -0
  82. package/dist/src/publisher-binding.d.ts +8 -40
  83. package/dist/src/publisher-binding.js +8 -46
  84. package/dist/src/rules/install/plan.d.ts +35 -0
  85. package/dist/src/rules/install/plan.js +133 -0
  86. package/dist/src/rules/uninstall/plan.d.ts +19 -0
  87. package/dist/src/rules/uninstall/plan.js +54 -0
  88. package/dist/src/skills/install/bundled.d.ts +73 -0
  89. package/dist/src/skills/install/bundled.js +244 -0
  90. package/dist/src/skills/install/plan.d.ts +72 -0
  91. package/dist/src/skills/install/plan.js +429 -0
  92. package/dist/src/skills/install/selection.d.ts +26 -0
  93. package/dist/src/skills/install/selection.js +41 -0
  94. package/dist/src/skills/install/source.d.ts +21 -0
  95. package/dist/src/skills/install/source.js +76 -0
  96. package/dist/src/skills/operations/disable.d.ts +3 -2
  97. package/dist/src/skills/operations/disable.js +7 -11
  98. package/dist/src/skills/operations/enable.d.ts +3 -2
  99. package/dist/src/skills/operations/enable.js +6 -8
  100. package/dist/src/skills/operations/install.d.ts +4 -4
  101. package/dist/src/skills/operations/install.js +13 -12
  102. package/dist/src/skills/uninstall/plan.d.ts +23 -0
  103. package/dist/src/skills/uninstall/plan.js +165 -0
  104. package/dist/src/skills/utils.js +1 -1
  105. package/dist/src/step-failure-conversion.d.ts +44 -0
  106. package/dist/src/step-failure-conversion.js +26 -0
  107. package/dist/src/step-failure.d.ts +29 -0
  108. package/dist/src/step-failure.js +130 -0
  109. package/dist/src/subagents/install/plan.d.ts +49 -0
  110. package/dist/src/subagents/install/plan.js +270 -0
  111. package/dist/src/subagents/install/selection.d.ts +26 -0
  112. package/dist/src/subagents/install/selection.js +37 -0
  113. package/dist/src/subagents/install/source.d.ts +18 -0
  114. package/dist/src/subagents/install/source.js +72 -0
  115. package/dist/src/subagents/operations/disable.d.ts +5 -3
  116. package/dist/src/subagents/operations/disable.js +5 -3
  117. package/dist/src/subagents/operations/enable.d.ts +5 -3
  118. package/dist/src/subagents/operations/enable.js +17 -12
  119. package/dist/src/subagents/uninstall/plan.d.ts +20 -0
  120. package/dist/src/subagents/uninstall/plan.js +142 -0
  121. package/dist/src/test-packages.d.ts +34 -0
  122. package/dist/src/test-packages.js +111 -0
  123. package/dist/src/test-registry.d.ts +78 -0
  124. package/dist/src/test-registry.js +223 -0
  125. package/dist/src/testing.d.ts +108 -0
  126. package/dist/src/testing.js +241 -0
  127. package/dist/src/uninstall/retention-policy.d.ts +21 -0
  128. package/dist/src/uninstall/retention-policy.js +28 -0
  129. package/dist/src/uninstall/root-intent.d.ts +17 -0
  130. package/dist/src/uninstall/root-intent.js +101 -0
  131. package/dist/src/uninstall/uninstall-extensions.d.ts +61 -0
  132. package/dist/src/uninstall/uninstall-extensions.js +127 -0
  133. package/dist/src/uninstall/vocabulary.d.ts +40 -0
  134. package/dist/src/uninstall/vocabulary.js +14 -0
  135. package/dist/src/update/atomicity.d.ts +22 -0
  136. package/dist/src/update/atomicity.js +23 -0
  137. package/dist/src/update/blockers.d.ts +31 -0
  138. package/dist/src/update/blockers.js +78 -0
  139. package/dist/src/update/configured.d.ts +78 -0
  140. package/dist/src/update/configured.js +546 -0
  141. package/dist/src/update/root-request.d.ts +39 -0
  142. package/dist/src/update/root-request.js +117 -0
  143. package/dist/src/update/selective/plan.d.ts +45 -0
  144. package/dist/src/update/selective/plan.js +61 -0
  145. package/dist/src/update/selective/requirements.d.ts +17 -0
  146. package/dist/src/update/selective/requirements.js +14 -0
  147. package/dist/src/update/selective/selection.d.ts +63 -0
  148. package/dist/src/update/selective/selection.js +85 -0
  149. package/dist/src/update/selective/skills.d.ts +55 -0
  150. package/dist/src/update/selective/skills.js +596 -0
  151. package/dist/src/update/selective/subagents.d.ts +52 -0
  152. package/dist/src/update/selective/subagents.js +331 -0
  153. package/dist/src/update/selective/use-case.d.ts +121 -0
  154. package/dist/src/update/selective/use-case.js +28 -0
  155. package/dist/src/update/selective/vocabulary.d.ts +43 -0
  156. package/dist/src/update/selective/vocabulary.js +28 -0
  157. package/dist/src/update/selector.d.ts +72 -0
  158. package/dist/src/update/selector.js +120 -0
  159. package/dist/src/update/targeted-plan.d.ts +30 -0
  160. package/dist/src/update/targeted-plan.js +113 -0
  161. package/dist/src/update/update-extensions.d.ts +164 -0
  162. package/dist/src/update/update-extensions.js +579 -0
  163. package/dist/src/workspace-paths.d.ts +31 -0
  164. package/dist/src/workspace-paths.js +46 -0
  165. package/package.json +22 -12
  166. package/dist/src/configured-entry-resolution.d.ts +0 -111
  167. package/dist/src/configured-entry-resolution.js +0 -731
  168. package/dist/src/failure-adapter.d.ts +0 -35
  169. package/dist/src/failure-adapter.js +0 -23
  170. package/dist/src/hooks/manager.d.ts +0 -15
  171. package/dist/src/hooks/manager.js +0 -769
  172. package/dist/src/internal/fs-helpers.d.ts +0 -12
  173. package/dist/src/internal/fs-helpers.js +0 -13
  174. package/dist/src/internal/integrity.d.ts +0 -13
  175. package/dist/src/internal/integrity.js +0 -17
  176. package/dist/src/knowledge/manager.d.ts +0 -11
  177. package/dist/src/knowledge/manager.js +0 -711
  178. package/dist/src/mcps/manager.d.ts +0 -16
  179. package/dist/src/mcps/manager.js +0 -247
  180. package/dist/src/mcps/operations/artifact.d.ts +0 -24
  181. package/dist/src/mcps/operations/artifact.js +0 -74
  182. package/dist/src/mcps/operations/install.d.ts +0 -78
  183. package/dist/src/mcps/operations/install.js +0 -596
  184. package/dist/src/packs/dependency-resolution.d.ts +0 -65
  185. package/dist/src/packs/dependency-resolution.js +0 -414
  186. package/dist/src/packs/manager.d.ts +0 -16
  187. package/dist/src/packs/manager.js +0 -181
  188. package/dist/src/registry-materialization.d.ts +0 -52
  189. package/dist/src/registry-materialization.js +0 -72
  190. package/dist/src/release-age-posture.d.ts +0 -23
  191. package/dist/src/release-age-posture.js +0 -15
  192. package/dist/src/resolution-timeout.d.ts +0 -5
  193. package/dist/src/resolution-timeout.js +0 -11
  194. package/dist/src/rules/manager.d.ts +0 -20
  195. package/dist/src/rules/manager.js +0 -480
  196. package/dist/src/skills/manager.d.ts +0 -18
  197. package/dist/src/skills/manager.js +0 -346
  198. package/dist/src/skills/materialization.d.ts +0 -54
  199. package/dist/src/skills/materialization.js +0 -158
  200. package/dist/src/skills/operations/source-hash.d.ts +0 -2
  201. package/dist/src/skills/operations/source-hash.js +0 -6
  202. package/dist/src/subagents/manager.d.ts +0 -18
  203. package/dist/src/subagents/manager.js +0 -722
  204. package/dist/src/workflows/install-command/workflow.d.ts +0 -56
  205. package/dist/src/workflows/install-command/workflow.js +0 -46
  206. package/dist/src/workflows/uninstall-command/workflow.d.ts +0 -42
  207. package/dist/src/workflows/uninstall-command/workflow.js +0 -29
@@ -0,0 +1,224 @@
1
+ /**
2
+ * Installing hooks packages.
3
+ *
4
+ * A hook becomes observable through each agent's own hook configuration, so
5
+ * its planned artifact is the set of configured-agent outcomes, and an agent
6
+ * that cannot accept the hook blocks the closure rather than failing mid-way.
7
+ *
8
+ * @experimental This API is unstable and may change without notice.
9
+ */
10
+ import * as Effect from "effect/Effect";
11
+ import * as Option from "effect/Option";
12
+ import { HookManager, buildInstallOperation } from "@agentxm/extension-materialization";
13
+ import { parseSourceQualifiedRegistrySourcePatternParts, } from "@agentxm/extension-model/unstable/extensions";
14
+ import { HOOK_EXTENSION_DIR } from "@agentxm/extension-model/unstable/hooks/manifest-schema";
15
+ import { SourceHostProviders, resolveSource } from "@agentxm/extension-sources";
16
+ import { operationPresentation, } from "@agentxm/workspace-operations";
17
+ import { applyPlannedProjections } from "@agentxm/workspace-projection";
18
+ import { ACQUIRED_EXTENSIONS_DIR, WorkspaceMutations, acquiredExtensionDisplayPath, acquiredExtensionDisplayPathFromLockEntry, } from "@agentxm/workspace-state";
19
+ import { lifecycleStepFailure } from "../../step-failure.js";
20
+ import { registryLoginSuggestions } from "../../install/registry-login-suggestion.js";
21
+ import { installRefused, } from "../../install/vocabulary.js";
22
+ const hookLockEntryVersion = (entry) => entry.type === "registry" ? entry.resolvedVersion : undefined;
23
+ const acquiredRoot = (scope) => scope === "project" ? ACQUIRED_EXTENSIONS_DIR : ".axm/workspace/agent_extensions";
24
+ const hookRefArtifactPath = (ref, scope) => ref.refType === "workspace"
25
+ ? ref.location
26
+ : acquiredExtensionDisplayPath(acquiredRoot(scope), ref, HOOK_EXTENSION_DIR, ref.name);
27
+ const hookInstallArtifactPath = (entry, scope) => acquiredExtensionDisplayPathFromLockEntry(acquiredRoot(scope), entry, HOOK_EXTENSION_DIR, entry.workspaceName);
28
+ /** The artifact an applied hook install reports, from its accepted lock entry. */
29
+ export const hookInstallArtifact = (args) => {
30
+ const version = hookLockEntryVersion(args.lockEntry);
31
+ return {
32
+ path: hookInstallArtifactPath(args.lockEntry, args.scope),
33
+ scope: args.scope,
34
+ agents: args.agents,
35
+ ...(version === undefined ? {} : { version }),
36
+ change: args.installedBefore ? "updated" : "created",
37
+ ...(args.agentOutcomes === undefined ? {} : { agentOutcomes: args.agentOutcomes }),
38
+ ...(args.targets.length === 0 ? {} : { fileCount: args.targets.length, targets: args.targets }),
39
+ };
40
+ };
41
+ /** Read the hooks source grammar: which owner, which names, which range. */
42
+ export const parseHookInstallRequest = Effect.fn("InstallExtensions.parseHookRequest")(function* (source) {
43
+ const input = source.trim();
44
+ const parsed = parseSourceQualifiedRegistrySourcePatternParts(input);
45
+ const resolved = yield* resolveSource(input).pipe(Effect.mapError((error) => installRefused({
46
+ category: "validation",
47
+ detail: `Invalid hooks source: ${error.message}`,
48
+ cause: error,
49
+ })));
50
+ return {
51
+ source: resolved,
52
+ names: parsed?.type === "hooks" && parsed.name !== undefined ? [parsed.name] : [],
53
+ owner: parsed?.type === "hooks"
54
+ ? Option.some(parsed.owner)
55
+ : resolved.type === "registry"
56
+ ? resolved.owner
57
+ : Option.none(),
58
+ versionRange: resolved.type === "registry" && parsed?.type === "hooks"
59
+ ? Option.fromUndefinedOr(parsed.versionRange)
60
+ : Option.none(),
61
+ };
62
+ });
63
+ /** Discover the hooks packages the parsed source offers. */
64
+ export const discoverHookRefs = Effect.fn("InstallExtensions.discoverHooks")(function* (request) {
65
+ const sources = yield* SourceHostProviders;
66
+ return yield* sources
67
+ .find(request.source, {
68
+ names: request.names,
69
+ type: "hook",
70
+ owner: request.owner,
71
+ versionRange: request.versionRange,
72
+ })
73
+ .pipe(Effect.mapError((cause) => installRefused({
74
+ category: "network",
75
+ detail: "Hooks packages could not be discovered from the source",
76
+ cause,
77
+ })), Effect.map((refs) => refs.filter((ref) => ref.type === "hook")));
78
+ });
79
+ /** Settle which hooks packages this request installs, or refuse when none matched. */
80
+ export const finalizeHookInstallIntent = Effect.fn("InstallExtensions.finalizeHookIntent")(function* (request, refs) {
81
+ if (refs.length === 0) {
82
+ const suggestions = request.source.type === "registry"
83
+ ? yield* registryLoginSuggestions([request.source.location.href])
84
+ : [];
85
+ return yield* installRefused({
86
+ category: "not_found",
87
+ detail: "No hooks packages found in source",
88
+ suggestions,
89
+ });
90
+ }
91
+ return {
92
+ refs: refs.map((ref) => ({
93
+ ref,
94
+ versionRange: ref.refType === "registry" ? request.versionRange : Option.none(),
95
+ })),
96
+ };
97
+ });
98
+ /** The closures a settled hook intent becomes. */
99
+ export const planHookInstall = Effect.fn("InstallExtensions.planHooks")(function* (intent) {
100
+ const ws = yield* WorkspaceMutations;
101
+ const hookManager = yield* HookManager;
102
+ const deferProjections = intent.deferProjections === true || intent.refs.length > 1;
103
+ const memberSteps = yield* Effect.forEach(intent.refs, ({ ref, versionRange }) => Effect.gen(function* () {
104
+ const installedBefore = yield* hookManager.isInstalled({
105
+ target: { type: "hook", name: ref.hook.name },
106
+ });
107
+ const agentOutcomes = hookManager.configuredAgentOutcomesForRef === undefined
108
+ ? []
109
+ : yield* hookManager.configuredAgentOutcomesForRef(ref, "projected");
110
+ const previewPath = hookRefArtifactPath(ref, ws.scope);
111
+ const previewArtifact = {
112
+ path: previewPath,
113
+ scope: ws.scope,
114
+ agents: agentOutcomes
115
+ .filter(({ outcome }) => outcome !== "blocked")
116
+ .map(({ agentId }) => agentId),
117
+ ...(ref.refType === "registry" || ref.refType === "workspace"
118
+ ? { version: ref.version }
119
+ : {}),
120
+ change: installedBefore ? "updated" : "created",
121
+ agentOutcomes,
122
+ targets: Array.from(new Map(agentOutcomes.flatMap((outcome) => outcome.path === undefined
123
+ ? []
124
+ : [
125
+ [
126
+ outcome.path,
127
+ {
128
+ path: outcome.path,
129
+ change: installedBefore ? "updated" : "created",
130
+ agentIds: agentOutcomes
131
+ .filter(({ path }) => path === outcome.path)
132
+ .map(({ agentId }) => agentId),
133
+ },
134
+ ],
135
+ ])).values()),
136
+ };
137
+ const operation = buildInstallOperation(hookManager, {
138
+ toStepFailure: lifecycleStepFailure,
139
+ ref,
140
+ versionRange,
141
+ skipProjections: deferProjections,
142
+ installedBefore: Effect.succeed(installedBefore),
143
+ message: `Installed ${ref.hook.name}`,
144
+ buildArtifact: ({ installedBefore }) => Effect.gen(function* () {
145
+ const materialization = yield* hookManager.aggregateProjectionObservation;
146
+ const appliedOutcomes = hookManager.configuredAgentOutcomesForRef === undefined
147
+ ? []
148
+ : yield* hookManager.configuredAgentOutcomesForRef(ref, "current");
149
+ const currentLockEntry = yield* ws
150
+ .getLockedHookEntry(ref.hook.name)
151
+ .pipe(Effect.catch(() => Effect.succeed(Option.none())));
152
+ if (Option.isNone(currentLockEntry)) {
153
+ const path = hookRefArtifactPath(ref, ws.scope);
154
+ const change = installedBefore ? "updated" : "created";
155
+ return {
156
+ path,
157
+ scope: ws.scope,
158
+ ...(ref.refType === "registry" || ref.refType === "workspace"
159
+ ? { version: ref.version }
160
+ : {}),
161
+ agents: materialization.agents,
162
+ change,
163
+ agentOutcomes: appliedOutcomes,
164
+ targets: materialization.targets.length === 0
165
+ ? [{ path, change }]
166
+ : materialization.targets.map((target) => ({ ...target, change })),
167
+ };
168
+ }
169
+ return hookInstallArtifact({
170
+ lockEntry: currentLockEntry.value,
171
+ installedBefore,
172
+ scope: ws.scope,
173
+ agents: materialization.agents,
174
+ agentOutcomes: appliedOutcomes,
175
+ targets: materialization.targets.map((target) => ({
176
+ ...target,
177
+ change: installedBefore ? "updated" : "created",
178
+ })),
179
+ });
180
+ }),
181
+ });
182
+ // An agent that cannot accept this hook is a projection fact, so the
183
+ // closure is refused before it writes rather than failing part-way.
184
+ const blocked = agentOutcomes.filter(({ outcome }) => outcome === "blocked");
185
+ if (blocked.length > 0) {
186
+ return {
187
+ ...(operation.key === undefined ? {} : { key: operation.key }),
188
+ label: operation.label,
189
+ readiness: "error",
190
+ errorMessage: blocked.map(({ agentId, reason }) => `${agentId}: ${reason}`).join("; "),
191
+ artifact: previewArtifact,
192
+ };
193
+ }
194
+ return {
195
+ ...operation,
196
+ artifact: previewArtifact,
197
+ };
198
+ }).pipe(Effect.mapError((cause) => installRefused({
199
+ category: "internal",
200
+ detail: `Hook install planning failed for ${ref.hook.name}`,
201
+ cause,
202
+ }))), { concurrency: 1 });
203
+ const projectionSteps = deferProjections && intent.deferProjections !== true
204
+ ? [
205
+ {
206
+ key: "projection:hook:units",
207
+ label: "hook projections",
208
+ readiness: "ready",
209
+ run: applyPlannedProjections(hookManager).pipe(Effect.mapError(lifecycleStepFailure), Effect.as({
210
+ result: "success",
211
+ message: "Rendered installed Hooks from the complete contributor set",
212
+ })),
213
+ },
214
+ ]
215
+ : [];
216
+ return {
217
+ _tag: "Plan",
218
+ name: "Install hooks",
219
+ description: Option.some("Install hooks package"),
220
+ presentation: operationPresentation({ imperative: "install", past: "Installed", gerund: "Installing" }, "hook"),
221
+ jobs: [{ concurrency: 1, steps: [...memberSteps, ...projectionSteps] }],
222
+ };
223
+ });
224
+ //# sourceMappingURL=plan.js.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Uninstalling a hooks package.
3
+ *
4
+ * A hooks package whose canonical content is kept on disk is reported as
5
+ * retained, from the settlement the removal returns rather than from the
6
+ * sentence it printed.
7
+ *
8
+ * @experimental This API is unstable and may change without notice.
9
+ */
10
+ import * as Effect from "effect/Effect";
11
+ import { HookManager } from "@agentxm/extension-materialization";
12
+ import type { Plan } from "@agentxm/workspace-operations";
13
+ import type { ExtensionLifecycleFailed } from "../../errors.js";
14
+ import { type InstallStepRequirements } from "../../install/vocabulary.js";
15
+ import type { HookUninstallIntent } from "../../uninstall/vocabulary.js";
16
+ /** Settle whether this hooks package has anything to remove. */
17
+ export declare const parseHookUninstallRequest: (selector: string) => Effect.Effect<HookUninstallIntent, ExtensionLifecycleFailed, InstallStepRequirements | HookManager>;
18
+ /** The closures a settled hooks-package removal becomes. */
19
+ export declare const planHookUninstall: (intent: HookUninstallIntent) => Effect.Effect<Plan<InstallStepRequirements>, ExtensionLifecycleFailed, InstallStepRequirements | HookManager>;
20
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Uninstalling a hooks package.
3
+ *
4
+ * A hooks package whose canonical content is kept on disk is reported as
5
+ * retained, from the settlement the removal returns rather than from the
6
+ * sentence it printed.
7
+ *
8
+ * @experimental This API is unstable and may change without notice.
9
+ */
10
+ import * as Effect from "effect/Effect";
11
+ import * as Option from "effect/Option";
12
+ import { HookManager, buildUninstallOperation } from "@agentxm/extension-materialization";
13
+ import { WorkspaceMutations, acquiredExtensionDisplayPathFromLockEntry, } from "@agentxm/workspace-state";
14
+ import { lifecycleStepFailure } from "../../step-failure.js";
15
+ import { installRefused } from "../../install/vocabulary.js";
16
+ import { makeWorkspaceRetentionPolicy } from "../../uninstall/retention-policy.js";
17
+ import { workspaceCanonicalRoot, workspaceLockfilePath, workspaceSettingsPath, } from "../../workspace-paths.js";
18
+ const hookUninstallArtifactTargets = (entry, retained, targetName, scope) => {
19
+ if (Option.isNone(entry))
20
+ return [];
21
+ const sourcePath = acquiredExtensionDisplayPathFromLockEntry(workspaceCanonicalRoot(scope), entry.value, "hooks", targetName);
22
+ return [
23
+ { path: workspaceLockfilePath(scope), change: "updated" },
24
+ { path: workspaceSettingsPath(scope), change: "updated" },
25
+ { path: sourcePath, change: retained ? "unchanged" : "removed" },
26
+ ];
27
+ };
28
+ /** Settle whether this hooks package has anything to remove. */
29
+ export const parseHookUninstallRequest = Effect.fn("UninstallExtensions.parseHookRequest")(function* (selector) {
30
+ const hookManager = yield* HookManager;
31
+ const target = { type: "hook", name: selector.trim() };
32
+ return yield* Effect.gen(function* () {
33
+ const configured = hookManager.getConfiguredSource === undefined
34
+ ? Option.none()
35
+ : yield* hookManager.getConfiguredSource({ target });
36
+ const installed = yield* hookManager.isInstalled({ target });
37
+ return Option.isNone(configured) && !installed
38
+ ? { targets: [] }
39
+ : { targets: [target] };
40
+ }).pipe(Effect.mapError((cause) => installRefused({
41
+ category: "internal",
42
+ detail: `Hooks package "${target.name}" declaration could not be read`,
43
+ cause,
44
+ })));
45
+ });
46
+ /** The closures a settled hooks-package removal becomes. */
47
+ export const planHookUninstall = Effect.fn("UninstallExtensions.planHooks")(function* (intent) {
48
+ const ws = yield* WorkspaceMutations;
49
+ const hookManager = yield* HookManager;
50
+ const retentionPolicy = makeWorkspaceRetentionPolicy(ws);
51
+ const steps = yield* Effect.forEach(intent.targets, (target) => Effect.gen(function* () {
52
+ const lockEntry = yield* ws
53
+ .getLockedHookEntry(target.name)
54
+ .pipe(Effect.catch(() => Effect.succeed(Option.none())));
55
+ return buildUninstallOperation(hookManager, retentionPolicy, {
56
+ target,
57
+ toStepFailure: lifecycleStepFailure,
58
+ buildArtifact: ({ settlement }) => {
59
+ const retained = settlement.canonical !== "removed";
60
+ const targets = hookUninstallArtifactTargets(lockEntry, retained, target.name, ws.scope);
61
+ return Effect.succeed({
62
+ path: retained ? workspaceSettingsPath(ws.scope) : workspaceLockfilePath(ws.scope),
63
+ scope: ws.scope,
64
+ change: retained ? "updated" : "removed",
65
+ ...(targets.length === 0 ? {} : { fileCount: targets.length, targets }),
66
+ });
67
+ },
68
+ });
69
+ }));
70
+ return {
71
+ _tag: "Plan",
72
+ name: "Uninstall hooks",
73
+ description: Option.some("Uninstall hooks package"),
74
+ jobs: [{ concurrency: 1, steps }],
75
+ };
76
+ });
77
+ //# sourceMappingURL=plan.js.map
@@ -1,38 +1,70 @@
1
1
  /**
2
2
  * Extension-lifecycle feature: install, update, uninstall, enable, and
3
3
  * disable policy across root and type-specific command forms — configured
4
- * entry resolution, the shared install/uninstall command workflows, and the
5
- * per-type lifecycle operations. The environment-backed per-type manager
4
+ * entry resolution, the install and uninstall use cases every command
5
+ * spelling routes through, and the per-type lifecycle operations. The environment-backed per-type manager
6
6
  * layers live behind `./live`.
7
7
  *
8
8
  * @experimental All exports from this module are unstable and may change without notice.
9
9
  * @packageDocumentation
10
10
  */
11
11
  export { ExtensionLifecycleFailed } from "./errors.js";
12
- export { ReleaseAgePosture, type ReleaseAgePostureValue } from "./release-age-posture.js";
13
- export { LifecycleFailureAdapter, withAdaptedStepFailures, type LifecycleFailureAdapterService, } from "./failure-adapter.js";
14
- export { makeConfiguredReleaseAgeEvaluation, resolveConfiguredHook, resolveConfiguredKnowledge, resolveConfiguredMcpServer, resolveConfiguredPack, resolveConfiguredRegistryEntry, resolveConfiguredRule, resolveConfiguredSkill, resolveConfiguredSubagent, } from "./configured-entry-resolution.js";
15
- export { CONFIGURED_ENTRY_RESOLUTION_TIMEOUT, withConfiguredEntryResolutionTimeout, } from "./resolution-timeout.js";
16
- export { PUBLISHER_CHANGE_CONDITION_ID, classifyPublisherBindingTransition, publisherChangeRiskCondition, publisherTransitionWarning, registryBindingProposal, withPublisherTrust, withPublisherTrustConditions, type PublisherBindingTransition, } from "./publisher-binding.js";
17
- export { buildInstallCommandPlan, runInstallCommandWorkflow, type InstallExtensionCommandWorkflowActions, } from "./workflows/install-command/workflow.js";
18
- export { runUninstallCommandWorkflow, type UninstallExtensionCommandWorkflowActions, type UninstallWorkflowFlags, } from "./workflows/uninstall-command/workflow.js";
19
- export { materializeRegistryPackage, materializeRegistryPackageWithTreeIntegrity, type MaterializeRegistryPackageArgs, type RegistryPackageMaterializationMessages, } from "./registry-materialization.js";
20
- export { ensureSkillAgentArtifact, removeSkillAgentArtifact } from "./skills/materialization.js";
12
+ export { StepFailureConversion, withAdaptedStepFailures, type LifecycleFailure, type StepFailureConversionService, } from "./step-failure-conversion.js";
13
+ export { prepareSetActivation, previewOrApplySetActivation, SetActivation, type ActivationTransition, type ActivationUnchanged, type SetActivationCandidate, type SetActivationFailure, type SetActivationRequest, type SetActivationRequirements, } from "./activation/set-activation.js";
14
+ export type { SetActivationExecutionFailure } from "./activation/errors.js";
15
+ export { PUBLISHER_CHANGE_CONDITION_ID, publisherChangeRiskCondition, withPublisherTrust, withPublisherTrustConditions, } from "./publisher-binding.js";
16
+ export { InstallExtensions, prepareInstallExtensions, previewOrApplyInstallExtensions, type InstallDiagnostics, type InstallExtensionsCandidate, type InstallExtensionsFailure, type InstallExtensionsRequest, type InstallSubject, } from "./install/install-extensions.js";
17
+ export { installRefused, type HookInstallIntent, type InstallStepRequirements, type KnowledgeInstallIntent, type McpServerInstallIntent, type PackInstallIntent, type PackRecoveryDependencyResolver, type PrepareInstallRequirements, type ResolveInstallRequirements, type RuleInstallIntent, type SkillInstallIntent, type SubagentInstallIntent, } from "./install/vocabulary.js";
18
+ export { ExtensionSelectionCancelled, ExtensionSelectionInteraction, type ExtensionSelectionFailure, type ExtensionSelectionInteractionService, } from "./install/selection-interaction.js";
19
+ export { resolveRootInstallIntent, rootInstallableTypeSegments, RootInstallableTypeSegmentSchema, type RootInstallIntent, type RootInstallableType, type RootInstallableTypeSegment, } from "./install/root-intent.js";
20
+ export { installCommandFor, perTypeInstallPluralSegments } from "./install/per-type-install.js";
21
+ export { buildConfiguredInstallPlan, buildConfiguredPackInstallPlan, type ConfiguredInstallPlanResult, type ConfiguredInstallRequirements, type ConfiguredInstallableType, } from "./install/configured.js";
22
+ export { buildAggregateProjectionStep } from "./install/aggregate-projection-step.js";
23
+ export { inlineMcpNotApplicablePlan } from "./install/inline-mcp-operation.js";
24
+ export { formatRegistryProbe, type RegistryLookupProbe, } from "./install/registry-source-resolution.js";
25
+ export { planHookInstall } from "./hooks/install/plan.js";
26
+ export { planKnowledgeInstall } from "./knowledge/install/plan.js";
27
+ export { parseMcpEnvInputs, planMcpServerInstall } from "./mcps/install/plan.js";
28
+ export { planPackInstall, type PackInstallRequirements } from "./packs/install/plan.js";
29
+ export { planRuleInstall } from "./rules/install/plan.js";
30
+ export { planSkillInstall } from "./skills/install/plan.js";
31
+ export { planSubagentInstall } from "./subagents/install/plan.js";
32
+ export { BUNDLED_AXM_SKILL_AUTHORED_BLOCKER, BundledAxmSkillAsset, bundledAxmSkillCanonicalPath, inspectBundledAxmSkillReadiness, installBundledAxmSkill, type BundledAxmSkillAssetService, type BundledAxmSkillReadiness, type BundledAxmSkillSourceFile, } from "./skills/install/bundled.js";
33
+ export { buildAtomicPackGraphStep, validatePackGraphPostcondition, type AtomicPackGraphChild, } from "./packs/graph-transition.js";
34
+ export { buildPackMemberInstallStep, type PackMemberRef } from "./packs/member-install-step.js";
35
+ export { configuredPackConstraintBlockPlan, prospectivePackConstraintProblems, relevantPackConstraintProblems, } from "./packs/constraint-gate.js";
36
+ export { UninstallExtensions, prepareUninstallExtensions, previewOrApplyUninstallExtensions, type PrepareUninstallRequirements, type UninstallExtensionsCandidate, type UninstallExtensionsFailure, type UninstallExtensionsRequest, } from "./uninstall/uninstall-extensions.js";
37
+ export { resolveRootUninstallIntent, rootUninstallableTypeSegments, type RootUninstallIntent, type RootUninstallableType, } from "./uninstall/root-intent.js";
38
+ export { exclusiveMemberRetentionPolicy, makeWorkspaceRetentionPolicy, } from "./uninstall/retention-policy.js";
39
+ export { PACK_UNINSTALL_GRAPH_BLOCKER_ID, packUninstallRecoveryIdentifiers, planPackUninstallGraphReadiness, type PackRetirement, type PackUninstallGraphReadiness, } from "./packs/uninstall/readiness.js";
40
+ export { type PackUninstallIntent, type PackUninstallRequirements, type ResolvedPackUninstallTarget, } from "./packs/uninstall/plan.js";
21
41
  export { getSkillDisplayName } from "./skills/utils.js";
22
- export { computeSkillSourceHash, gitHostedSkillArtifactSource, installSkill, type InstallSkillOperation, type InstallSkillOperationArgs, } from "./skills/operations/install.js";
42
+ export { gitHostedSkillArtifactSource, installSkill, type InstallSkillOperation, type InstallSkillOperationArgs, } from "./skills/operations/install.js";
23
43
  export type { InstallResult } from "./skills/operations/install-result.js";
24
44
  export { enableSkill, type EnableSkillOperation } from "./skills/operations/enable.js";
25
45
  export { disableSkill, type DisableSkillOperation } from "./skills/operations/disable.js";
26
- export { collectSecretInputNames, deleteMcpSecrets, installMcpServer, mcpSecretAccount, readMcpServerManifest, type InstallMcpServerOperation, type InstallMcpServerOperationArgs, } from "./mcps/operations/install.js";
27
46
  export { uninstallMcpServer, type UninstallMcpServerOperation, type UninstallMcpServerOperationArgs, } from "./mcps/operations/uninstall.js";
28
47
  export { enableMcpServer, type EnableMcpServerOperation } from "./mcps/operations/enable.js";
29
48
  export { disableMcpServer, type DisableMcpServerOperation } from "./mcps/operations/disable.js";
30
- export { mcpServerArtifact, mcpSettingsTarget, mcpSourceTarget, } from "./mcps/operations/artifact.js";
31
49
  export { SUBAGENT_CONFIG_SURFACE, renderedSubagentTargets, subagentConfigTarget, subagentLifecycleArtifact, } from "./subagents/operations/artifact.js";
32
50
  export { enableSubagent, type EnableSubagentOperation } from "./subagents/operations/enable.js";
33
51
  export { disableSubagent, type DisableSubagentOperation } from "./subagents/operations/disable.js";
52
+ export { WORKSPACE_UPDATE_ATOMICITY, WORKSPACE_UPDATE_EXECUTION_CAPABILITIES, } from "./update/atomicity.js";
34
53
  export { expandPackInstallRefs, expandPackInstallRefsWithReleaseAge, type ReleaseAgeAwarePackExpansion, } from "./packs/expansion.js";
35
- export { resolvePackDependenciesWithReleaseAge, type PackDependencyRefResolver, type ReleaseAgeAwarePackDependencyResolution, type WorkspacePackDependencyResolution, type WorkspacePackDependencyResolver, } from "./packs/dependency-resolution.js";
36
- export { ResolvedPackDependencyMapSchema, ResolvedPackDependencySchema, validateExactPackDependencyVersions, type ResolvedPackDependency, type ResolvedPackDependencyMap, } from "./packs/resolved-dependency.js";
54
+ export { validateExactPackDependencyVersions } from "./packs/resolved-dependency.js";
37
55
  export { installPack, type InstallPackOperation, type InstallPackOperationArgs, } from "./packs/operations/install.js";
56
+ export { lifecycleStepFailure, type LifecycleStepFailure } from "./step-failure.js";
57
+ export { UpdateExtensions, prepareUpdate, previewOrApplyUpdate, contextForResolution, type BlockedUpdateCandidate, type ConfiguredUpdateRequest, type NothingConfiguredUpdateCandidate, type PlannedUpdateCandidate, type PrepareUpdateRequirements, type PreservedUpdateCandidate, type TargetedUpdateRequest, type UpdateCandidate, type UpdateFailure, type UpdateRequest, type UpdateRequirements, type UpdateSubjectType, } from "./update/update-extensions.js";
58
+ export { UPDATE_NAME_FILTER_FLAG, type ConfiguredUpdateSelection, type ConfiguredUpdateSelector, type ConfiguredUpdateSelectorType, } from "./update/selector.js";
59
+ export { resolveRootUpdateIntent, rootUpdatableTypeSegments, RootUpdatableTypeSegmentSchema, type RootUpdatableType, type RootUpdatableTypeSegment, type RootUpdateIntent, } from "./update/root-request.js";
60
+ export { TARGETED_UPDATE_STALE_DETAIL } from "./update/targeted-plan.js";
61
+ export { SelectiveUpdate, prepareSelectiveUpdate, type SelectiveUpdateRequest, } from "./update/selective/use-case.js";
62
+ export { previewOrApplySelectiveUpdate, selectiveUpdatePlanName, type NothingSelectiveUpdateCandidate, type PlannedSelectiveUpdateCandidate, type SelectiveUpdateCandidate, type SelectiveUpdateSubjectType, } from "./update/selective/vocabulary.js";
63
+ export type { SelectiveUpdateNothingReason } from "./update/selective/selection.js";
64
+ export type { SelectiveSkillUpdateRequest } from "./update/selective/skills.js";
65
+ export type { SelectiveSubagentUpdateRequest } from "./update/selective/subagents.js";
66
+ export type { SelectiveUpdateStepRequirements } from "./update/selective/requirements.js";
67
+ export { makeWorkspaceUpdatePlan, type ConfiguredUpdateFailure, type WorkspaceUpdatableType, type WorkspaceUpdatePlanRequest, type WorkspaceUpdatePlanResult, } from "./update/configured.js";
68
+ export { PromoteAuthoredPack, preparePromoteAuthoredPack, previewOrApplyPromoteAuthoredPack, type PreparePromoteAuthoredPackRequirements, type PromoteAuthoredPackCandidate, type PromoteAuthoredPackFailure, type PromoteAuthoredPackRequest, type PromoteAuthoredPackRequirements, type PromotedPackMember, } from "./packs/promote-authored-pack.js";
69
+ export { DEMOTE_RISK_CONDITION_ID, DemoteToExternalSource, prepareDemote, previewOrApplyDemote, type DemoteCandidate, type DemoteFailure, type DemoteRequest, type DemoteRequirements, type PrepareDemoteRequirements, } from "./demote/demote-to-external-source.js";
38
70
  //# sourceMappingURL=index.d.ts.map
package/dist/src/index.js CHANGED
@@ -1,41 +1,84 @@
1
1
  /**
2
2
  * Extension-lifecycle feature: install, update, uninstall, enable, and
3
3
  * disable policy across root and type-specific command forms — configured
4
- * entry resolution, the shared install/uninstall command workflows, and the
5
- * per-type lifecycle operations. The environment-backed per-type manager
4
+ * entry resolution, the install and uninstall use cases every command
5
+ * spelling routes through, and the per-type lifecycle operations. The environment-backed per-type manager
6
6
  * layers live behind `./live`.
7
7
  *
8
8
  * @experimental All exports from this module are unstable and may change without notice.
9
9
  * @packageDocumentation
10
10
  */
11
11
  export { ExtensionLifecycleFailed } from "./errors.js";
12
- export { ReleaseAgePosture } from "./release-age-posture.js";
13
- export { LifecycleFailureAdapter, withAdaptedStepFailures, } from "./failure-adapter.js";
14
- export { makeConfiguredReleaseAgeEvaluation, resolveConfiguredHook, resolveConfiguredKnowledge, resolveConfiguredMcpServer, resolveConfiguredPack, resolveConfiguredRegistryEntry, resolveConfiguredRule, resolveConfiguredSkill, resolveConfiguredSubagent, } from "./configured-entry-resolution.js";
15
- export { CONFIGURED_ENTRY_RESOLUTION_TIMEOUT, withConfiguredEntryResolutionTimeout, } from "./resolution-timeout.js";
16
- export { PUBLISHER_CHANGE_CONDITION_ID, classifyPublisherBindingTransition, publisherChangeRiskCondition, publisherTransitionWarning, registryBindingProposal, withPublisherTrust, withPublisherTrustConditions, } from "./publisher-binding.js";
17
- export { buildInstallCommandPlan, runInstallCommandWorkflow, } from "./workflows/install-command/workflow.js";
18
- export { runUninstallCommandWorkflow, } from "./workflows/uninstall-command/workflow.js";
19
- export { materializeRegistryPackage, materializeRegistryPackageWithTreeIntegrity, } from "./registry-materialization.js";
12
+ export { StepFailureConversion, withAdaptedStepFailures, } from "./step-failure-conversion.js";
13
+ // Activation: enable and disable for every extension type, as one use case.
14
+ export { prepareSetActivation, previewOrApplySetActivation, SetActivation, } from "./activation/set-activation.js";
15
+ export { PUBLISHER_CHANGE_CONDITION_ID, publisherChangeRiskCondition, withPublisherTrust, withPublisherTrustConditions, } from "./publisher-binding.js";
16
+ // Install: acquiring extensions a request names, or the ones the workspace
17
+ // already declares, as one use case behind every command spelling.
18
+ export { InstallExtensions, prepareInstallExtensions, previewOrApplyInstallExtensions, } from "./install/install-extensions.js";
19
+ export { installRefused, } from "./install/vocabulary.js";
20
+ export { ExtensionSelectionCancelled, ExtensionSelectionInteraction, } from "./install/selection-interaction.js";
21
+ export { resolveRootInstallIntent, rootInstallableTypeSegments, RootInstallableTypeSegmentSchema, } from "./install/root-intent.js";
22
+ export { installCommandFor, perTypeInstallPluralSegments } from "./install/per-type-install.js";
23
+ export { buildConfiguredInstallPlan, buildConfiguredPackInstallPlan, } from "./install/configured.js";
24
+ export { buildAggregateProjectionStep } from "./install/aggregate-projection-step.js";
25
+ export { inlineMcpNotApplicablePlan } from "./install/inline-mcp-operation.js";
26
+ export { formatRegistryProbe, } from "./install/registry-source-resolution.js";
27
+ // The per-type install planners every install and update route shares.
28
+ export { planHookInstall } from "./hooks/install/plan.js";
29
+ export { planKnowledgeInstall } from "./knowledge/install/plan.js";
30
+ export { parseMcpEnvInputs, planMcpServerInstall } from "./mcps/install/plan.js";
31
+ export { planPackInstall } from "./packs/install/plan.js";
32
+ export { planRuleInstall } from "./rules/install/plan.js";
33
+ export { planSkillInstall } from "./skills/install/plan.js";
34
+ export { planSubagentInstall } from "./subagents/install/plan.js";
35
+ // The bundled official AXM skill, and the asset port the application fills.
36
+ export { BUNDLED_AXM_SKILL_AUTHORED_BLOCKER, BundledAxmSkillAsset, bundledAxmSkillCanonicalPath, inspectBundledAxmSkillReadiness, installBundledAxmSkill, } from "./skills/install/bundled.js";
37
+ // Pack graph transitions: the atomic step and its desired-state predicate.
38
+ export { buildAtomicPackGraphStep, validatePackGraphPostcondition, } from "./packs/graph-transition.js";
39
+ export { buildPackMemberInstallStep } from "./packs/member-install-step.js";
40
+ export { configuredPackConstraintBlockPlan, prospectivePackConstraintProblems, relevantPackConstraintProblems, } from "./packs/constraint-gate.js";
41
+ // Uninstall: withdrawing extensions, as one use case behind every spelling.
42
+ export { UninstallExtensions, prepareUninstallExtensions, previewOrApplyUninstallExtensions, } from "./uninstall/uninstall-extensions.js";
43
+ export { resolveRootUninstallIntent, rootUninstallableTypeSegments, } from "./uninstall/root-intent.js";
44
+ export { exclusiveMemberRetentionPolicy, makeWorkspaceRetentionPolicy, } from "./uninstall/retention-policy.js";
45
+ export { PACK_UNINSTALL_GRAPH_BLOCKER_ID, packUninstallRecoveryIdentifiers, planPackUninstallGraphReadiness, } from "./packs/uninstall/readiness.js";
46
+ export {} from "./packs/uninstall/plan.js";
20
47
  // Skill lifecycle operations
21
- export { ensureSkillAgentArtifact, removeSkillAgentArtifact } from "./skills/materialization.js";
22
48
  export { getSkillDisplayName } from "./skills/utils.js";
23
- export { computeSkillSourceHash, gitHostedSkillArtifactSource, installSkill, } from "./skills/operations/install.js";
49
+ export { gitHostedSkillArtifactSource, installSkill, } from "./skills/operations/install.js";
24
50
  export { enableSkill } from "./skills/operations/enable.js";
25
51
  export { disableSkill } from "./skills/operations/disable.js";
26
- // MCP server lifecycle operations
27
- export { collectSecretInputNames, deleteMcpSecrets, installMcpServer, mcpSecretAccount, readMcpServerManifest, } from "./mcps/operations/install.js";
52
+ // MCP server lifecycle operations. Installation itself is a materialization
53
+ // capability (`@agentxm/extension-materialization`) because the authoring
54
+ // routes need it too and a feature may not import a peer feature.
28
55
  export { uninstallMcpServer, } from "./mcps/operations/uninstall.js";
29
56
  export { enableMcpServer } from "./mcps/operations/enable.js";
30
57
  export { disableMcpServer } from "./mcps/operations/disable.js";
31
- export { mcpServerArtifact, mcpSettingsTarget, mcpSourceTarget, } from "./mcps/operations/artifact.js";
32
58
  // Subagent lifecycle operations
33
59
  export { SUBAGENT_CONFIG_SURFACE, renderedSubagentTargets, subagentConfigTarget, subagentLifecycleArtifact, } from "./subagents/operations/artifact.js";
34
60
  export { enableSubagent } from "./subagents/operations/enable.js";
35
61
  export { disableSubagent } from "./subagents/operations/disable.js";
62
+ // Update: the atomicity a workspace-wide sweep declares.
63
+ export { WORKSPACE_UPDATE_ATOMICITY, WORKSPACE_UPDATE_EXECUTION_CAPABILITIES, } from "./update/atomicity.js";
36
64
  // Pack lifecycle operations
37
65
  export { expandPackInstallRefs, expandPackInstallRefsWithReleaseAge, } from "./packs/expansion.js";
38
- export { resolvePackDependenciesWithReleaseAge, } from "./packs/dependency-resolution.js";
39
- export { ResolvedPackDependencyMapSchema, ResolvedPackDependencySchema, validateExactPackDependencyVersions, } from "./packs/resolved-dependency.js";
66
+ export { validateExactPackDependencyVersions } from "./packs/resolved-dependency.js";
40
67
  export { installPack, } from "./packs/operations/install.js";
68
+ // How a lifecycle closure serializes its own failures into a plan step.
69
+ export { lifecycleStepFailure } from "./step-failure.js";
70
+ // Update: advancing what the workspace already accepted, for a named
71
+ // extension or for the configured entries as a whole.
72
+ export { UpdateExtensions, prepareUpdate, previewOrApplyUpdate, contextForResolution, } from "./update/update-extensions.js";
73
+ export { UPDATE_NAME_FILTER_FLAG, } from "./update/selector.js";
74
+ export { resolveRootUpdateIntent, rootUpdatableTypeSegments, RootUpdatableTypeSegmentSchema, } from "./update/root-request.js";
75
+ export { TARGETED_UPDATE_STALE_DETAIL } from "./update/targeted-plan.js";
76
+ // Update: advancing the entries a person selected by name or by source.
77
+ export { SelectiveUpdate, prepareSelectiveUpdate, } from "./update/selective/use-case.js";
78
+ export { previewOrApplySelectiveUpdate, selectiveUpdatePlanName, } from "./update/selective/vocabulary.js";
79
+ export { makeWorkspaceUpdatePlan, } from "./update/configured.js";
80
+ // Unpack: promoting a Pack's members to direct declarations.
81
+ export { PromoteAuthoredPack, preparePromoteAuthoredPack, previewOrApplyPromoteAuthoredPack, } from "./packs/promote-authored-pack.js";
82
+ // Demote: returning a workspace-authored package to an external source.
83
+ export { DEMOTE_RISK_CONDITION_ID, DemoteToExternalSource, prepareDemote, previewOrApplyDemote, } from "./demote/demote-to-external-source.js";
41
84
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,16 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Option from "effect/Option";
3
+ import type { ExtensionType } from "@agentxm/extension-model/unstable/extensions";
4
+ import type { PlannedJobStep } from "@agentxm/workspace-operations";
5
+ import { HookManager, KnowledgeManager, RuleManager } from "@agentxm/extension-materialization";
6
+ import type { InstallStepRequirements } from "./vocabulary.js";
7
+ /**
8
+ * One trailing projection write per semantic closure. Member steps commit
9
+ * canonical, settings, and lock state without touching shared aggregate units;
10
+ * this step then renders each affected unit exactly once from the complete
11
+ * desired-state contributor set.
12
+ */
13
+ export declare const buildAggregateProjectionStep: (args: {
14
+ readonly types: ReadonlySet<ExtensionType>;
15
+ }) => Effect.Effect<Option.Option<PlannedJobStep<InstallStepRequirements>>, never, HookManager | KnowledgeManager | RuleManager>;
16
+ //# sourceMappingURL=aggregate-projection-step.d.ts.map
@@ -0,0 +1,49 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Option from "effect/Option";
3
+ import { HookManager, KnowledgeManager, RuleManager, } from "@agentxm/extension-materialization";
4
+ import { applyProjectionPlans, projectionPlanExclusionWarnings, } from "@agentxm/workspace-projection";
5
+ import { lifecycleStepFailure } from "../step-failure.js";
6
+ /**
7
+ * One trailing projection write per semantic closure. Member steps commit
8
+ * canonical, settings, and lock state without touching shared aggregate units;
9
+ * this step then renders each affected unit exactly once from the complete
10
+ * desired-state contributor set.
11
+ */
12
+ export const buildAggregateProjectionStep = (args) => Effect.gen(function* () {
13
+ if (!args.types.has("rule") && !args.types.has("hook") && !args.types.has("knowledge")) {
14
+ return Option.none();
15
+ }
16
+ const ruleManager = args.types.has("rule")
17
+ ? Option.some(yield* RuleManager)
18
+ : Option.none();
19
+ const hookManager = args.types.has("hook")
20
+ ? Option.some(yield* HookManager)
21
+ : Option.none();
22
+ const knowledgeManager = args.types.has("knowledge")
23
+ ? Option.some(yield* KnowledgeManager)
24
+ : Option.none();
25
+ return Option.some({
26
+ key: "projection:aggregate-units",
27
+ label: "instruction files",
28
+ readiness: "ready",
29
+ run: Effect.gen(function* () {
30
+ const plans = [];
31
+ if (Option.isSome(ruleManager)) {
32
+ plans.push(...(yield* ruleManager.value.projectionPlans()));
33
+ }
34
+ if (Option.isSome(hookManager)) {
35
+ plans.push(...(yield* hookManager.value.projectionPlans()));
36
+ }
37
+ if (Option.isSome(knowledgeManager)) {
38
+ plans.push(...(yield* knowledgeManager.value.projectionPlans()));
39
+ }
40
+ yield* applyProjectionPlans(plans);
41
+ return projectionPlanExclusionWarnings(plans);
42
+ }).pipe(Effect.mapError(lifecycleStepFailure), Effect.map((warnings) => ({
43
+ result: "success",
44
+ message: "Rendered shared aggregate units from the complete contributor set",
45
+ ...(warnings.length === 0 ? {} : { warnings }),
46
+ }))),
47
+ });
48
+ });
49
+ //# sourceMappingURL=aggregate-projection-step.js.map