@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,101 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Option from "effect/Option";
3
+ import * as Schema from "effect/Schema";
4
+ import { installRefused } from "../install/vocabulary.js";
5
+ import { installableExtensionTypePluralSegments, isInstallableExtensionTypePlural, toInstallableExtensionType, } from "@agentxm/extension-model/unstable/extensions/installable-types";
6
+ import { RegistrySourceRefSchema } from "@agentxm/extension-model/unstable/extensions";
7
+ import { parseInputPattern } from "@agentxm/extension-model/unstable/sources/parser";
8
+ const decodeRegistrySourceRef = Schema.decodeUnknownEffect(RegistrySourceRefSchema);
9
+ export const rootUninstallableTypeSegments = installableExtensionTypePluralSegments;
10
+ const rootUninstallFqnGrammar = "@<handle>/<plural-type>/<name>[@<version>]";
11
+ const supportedRootUninstallTypes = rootUninstallableTypeSegments.join(", ");
12
+ const genericPerTypeUninstallGuidance = "Use the matching per-type uninstall command instead: `axm skills uninstall <name>`, `axm subagents uninstall <name>`, `axm packs uninstall <name>`, or `axm mcps uninstall <name>`.";
13
+ const rootUninstallRegistryOnlyHowToFix = (source) => {
14
+ const parsed = parseInputPattern(source);
15
+ if (Option.isNone(parsed)) {
16
+ return `Use \`axm uninstall ${rootUninstallFqnGrammar}\`. ${genericPerTypeUninstallGuidance}`;
17
+ }
18
+ switch (parsed.value.pattern.pattern) {
19
+ case "name-input":
20
+ case "glob-input":
21
+ return `Root uninstall only accepts registry FQNs. Use the matching per-type command instead: \`axm skills uninstall ${source}\`, \`axm subagents uninstall ${source}\`, \`axm packs uninstall ${source}\`, or \`axm mcps uninstall ${source}\`.`;
22
+ case "file-path-pattern":
23
+ case "url-input":
24
+ case "git-scp-address":
25
+ case "shorthand-input":
26
+ case "slash-pattern":
27
+ case "registry-pattern-input":
28
+ return `Use \`axm uninstall ${rootUninstallFqnGrammar}\`. ${genericPerTypeUninstallGuidance}`;
29
+ case "workspace-pattern-input":
30
+ return "Use the matching per-type uninstall command for a workspace-authored extension.";
31
+ }
32
+ };
33
+ /**
34
+ * Root uninstall accepts only a registry FQN: it is the one form that names
35
+ * the extension type without guessing, and every other spelling has a
36
+ * per-type command that already knows the type.
37
+ */
38
+ export const resolveRootUninstallIntent = Effect.fn("UninstallExtensions.resolveRootIntent")(function* (input) {
39
+ const source = input.trim();
40
+ const segments = source.split("/");
41
+ const pluralType = segments.length === 3 ? segments[1] : undefined;
42
+ if (!source.startsWith("@")) {
43
+ return yield* installRefused({
44
+ category: "usage",
45
+ detail: "Root uninstall only accepts registry FQNs",
46
+ suggestions: [{ description: rootUninstallRegistryOnlyHowToFix(source) }],
47
+ });
48
+ }
49
+ if (pluralType === "libraries") {
50
+ return yield* installRefused({
51
+ category: "usage",
52
+ detail: "Libraries are curated registry collections and cannot be uninstalled",
53
+ suggestions: [
54
+ {
55
+ description: "Uninstall individual extensions by FQN; Libraries do not create workspace state.",
56
+ },
57
+ ],
58
+ });
59
+ }
60
+ const parsed = yield* decodeRegistrySourceRef(source).pipe(Effect.mapError((error) => {
61
+ if (pluralType !== undefined && !isInstallableExtensionTypePlural(pluralType)) {
62
+ return installRefused({
63
+ category: "not_found",
64
+ detail: "Uninstall source uses an unsupported plural type",
65
+ suggestions: [
66
+ {
67
+ description: `Use ${rootUninstallFqnGrammar}. Supported plural types: ${supportedRootUninstallTypes}.`,
68
+ },
69
+ ],
70
+ cause: error,
71
+ });
72
+ }
73
+ return installRefused({
74
+ category: "validation",
75
+ detail: "Uninstall source must be a registry FQN",
76
+ suggestions: [
77
+ {
78
+ description: `Use ${rootUninstallFqnGrammar} with one of: ${supportedRootUninstallTypes}.`,
79
+ },
80
+ ],
81
+ cause: error,
82
+ });
83
+ }));
84
+ if (!isInstallableExtensionTypePlural(parsed.type)) {
85
+ return yield* installRefused({
86
+ category: "usage",
87
+ detail: "Root uninstall does not support that extension type",
88
+ suggestions: [
89
+ {
90
+ description: `Use ${rootUninstallFqnGrammar}. Supported plural types: ${supportedRootUninstallTypes}.`,
91
+ },
92
+ ],
93
+ });
94
+ }
95
+ return {
96
+ source,
97
+ type: toInstallableExtensionType(parsed.type),
98
+ name: parsed.name,
99
+ };
100
+ });
101
+ //# sourceMappingURL=root-intent.js.map
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Uninstalling extensions.
3
+ *
4
+ * One use case behind eight command spellings. `axm uninstall @owner/type/name`
5
+ * reads the type from the FQN; `axm <type> uninstall <selector>` already knows
6
+ * it. From there the decision is the same: which installed extensions the
7
+ * selector names, whether each still has anything to withdraw, and what a
8
+ * removal is allowed to delete.
9
+ *
10
+ * @experimental This API is unstable and may change without notice.
11
+ */
12
+ import * as Effect from "effect/Effect";
13
+ import * as Option from "effect/Option";
14
+ import type { InstallableExtensionType } from "@agentxm/extension-model/unstable/extensions/installable-types";
15
+ import { type ExecutionCandidate, type OperationResolution, type PlanExecution } from "@agentxm/workspace-operations";
16
+ import type { ExtensionLifecycleFailed } from "../errors.js";
17
+ import { type PackUninstallRequirements } from "../packs/uninstall/plan.js";
18
+ import type { InstallExecutionFailure, PrepareInstallRequirements } from "../install/vocabulary.js";
19
+ /** One uninstall request, whatever command spelling produced it. */
20
+ export interface UninstallExtensionsRequest {
21
+ /**
22
+ * The type the command fixed. `none` is the root form, which accepts only a
23
+ * registry FQN because that is the one spelling that names its own type.
24
+ */
25
+ readonly type: Option.Option<InstallableExtensionType>;
26
+ /** A name, a glob, or a registry FQN, as the person typed it. */
27
+ readonly selector: string;
28
+ }
29
+ /**
30
+ * A settled removal: every target is resolved and nothing is written. `type`
31
+ * is the type the removal settled on, which the root form derived from the
32
+ * FQN; `names` are the extensions it will withdraw.
33
+ */
34
+ export interface UninstallExtensionsCandidate {
35
+ readonly type: InstallableExtensionType;
36
+ /**
37
+ * The selector scoped to the settled type: what a typed route was given,
38
+ * and the extension name the root form read out of the registry FQN. What
39
+ * a report names the subject with, whether or not anything matched.
40
+ */
41
+ readonly selector: string;
42
+ readonly names: ReadonlyArray<string>;
43
+ /** The selector matched nothing installed; the application renders a no-op. */
44
+ readonly empty: boolean;
45
+ readonly planName: string;
46
+ readonly execution: ExecutionCandidate<PackUninstallRequirements>;
47
+ }
48
+ /** Every failure settling a removal can surface before anything is written. */
49
+ export type UninstallExtensionsFailure = ExtensionLifecycleFailed | InstallExecutionFailure;
50
+ /** Everything settling a removal reads before it freezes a candidate. */
51
+ export type PrepareUninstallRequirements = PrepareInstallRequirements | PackUninstallRequirements;
52
+ /** Settle a removal without writing anything. */
53
+ export declare const prepareUninstallExtensions: (request: UninstallExtensionsRequest) => Effect.Effect<UninstallExtensionsCandidate, UninstallExtensionsFailure, PrepareUninstallRequirements>;
54
+ /** Preview or apply a settled removal, resolving to one operation outcome. */
55
+ export declare const previewOrApplyUninstallExtensions: (candidate: UninstallExtensionsCandidate, execution: PlanExecution) => Effect.Effect<OperationResolution, UninstallExtensionsFailure, PrepareUninstallRequirements>;
56
+ /** The removal use case: settle a request, then preview or apply it. */
57
+ export declare const UninstallExtensions: {
58
+ readonly prepare: (request: UninstallExtensionsRequest) => Effect.Effect<UninstallExtensionsCandidate, UninstallExtensionsFailure, PrepareUninstallRequirements>;
59
+ readonly previewOrApply: (candidate: UninstallExtensionsCandidate, execution: PlanExecution) => Effect.Effect<OperationResolution, UninstallExtensionsFailure, PrepareUninstallRequirements>;
60
+ };
61
+ //# sourceMappingURL=uninstall-extensions.d.ts.map
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Uninstalling extensions.
3
+ *
4
+ * One use case behind eight command spellings. `axm uninstall @owner/type/name`
5
+ * reads the type from the FQN; `axm <type> uninstall <selector>` already knows
6
+ * it. From there the decision is the same: which installed extensions the
7
+ * selector names, whether each still has anything to withdraw, and what a
8
+ * removal is allowed to delete.
9
+ *
10
+ * @experimental This API is unstable and may change without notice.
11
+ */
12
+ import * as Effect from "effect/Effect";
13
+ import * as Option from "effect/Option";
14
+ import { operationPresentation, prepareExecutionCandidate, resolveExecutionCandidate, } from "@agentxm/workspace-operations";
15
+ import { parseHookUninstallRequest, planHookUninstall } from "../hooks/uninstall/plan.js";
16
+ import { parseKnowledgeUninstallRequest, planKnowledgeUninstall, } from "../knowledge/uninstall/plan.js";
17
+ import { parseMcpServerUninstallRequest, planMcpServerUninstall } from "../mcps/uninstall/plan.js";
18
+ import { finalizePackUninstallIntent, parsePackUninstallSelectors, planPackUninstall, } from "../packs/uninstall/plan.js";
19
+ import { parseRuleUninstallRequest, planRuleUninstall } from "../rules/uninstall/plan.js";
20
+ import { parseSkillUninstallRequest, planSkillUninstall } from "../skills/uninstall/plan.js";
21
+ import { parseSubagentUninstallRequest, planSubagentUninstall, } from "../subagents/uninstall/plan.js";
22
+ import { resolveRootUninstallIntent } from "./root-intent.js";
23
+ const planForType = (type, selector) => {
24
+ switch (type) {
25
+ case "skill":
26
+ return Effect.gen(function* () {
27
+ const intent = yield* parseSkillUninstallRequest(selector);
28
+ return {
29
+ names: intent.targets.map((target) => target.name),
30
+ plan: yield* planSkillUninstall(intent),
31
+ };
32
+ });
33
+ case "subagent":
34
+ return Effect.gen(function* () {
35
+ const intent = yield* parseSubagentUninstallRequest(selector);
36
+ return {
37
+ names: intent.targets.map((target) => target.name),
38
+ plan: yield* planSubagentUninstall(intent),
39
+ };
40
+ });
41
+ case "mcp-server":
42
+ return Effect.gen(function* () {
43
+ const intent = parseMcpServerUninstallRequest(selector);
44
+ return {
45
+ names: intent.targets.map((target) => target.name),
46
+ plan: yield* planMcpServerUninstall(intent),
47
+ };
48
+ });
49
+ case "rule":
50
+ return Effect.gen(function* () {
51
+ const intent = yield* parseRuleUninstallRequest(selector);
52
+ return {
53
+ names: intent.targets.map((target) => target.name),
54
+ plan: yield* planRuleUninstall(intent),
55
+ };
56
+ });
57
+ case "hook":
58
+ return Effect.gen(function* () {
59
+ const intent = yield* parseHookUninstallRequest(selector);
60
+ return {
61
+ names: intent.targets.map((target) => target.name),
62
+ plan: yield* planHookUninstall(intent),
63
+ };
64
+ });
65
+ case "knowledge":
66
+ return Effect.gen(function* () {
67
+ const intent = yield* parseKnowledgeUninstallRequest(selector);
68
+ return {
69
+ names: intent.targets.map((target) => target.name),
70
+ plan: yield* planKnowledgeUninstall(intent),
71
+ };
72
+ });
73
+ case "pack":
74
+ return Effect.gen(function* () {
75
+ const selectors = yield* parsePackUninstallSelectors(selector);
76
+ const intent = yield* finalizePackUninstallIntent(selectors);
77
+ return {
78
+ names: intent.packsToUninstall.map((pack) => pack.name),
79
+ plan: yield* planPackUninstall(intent),
80
+ };
81
+ });
82
+ }
83
+ };
84
+ // -----------------------------------------------------------------------------
85
+ // prepare
86
+ // -----------------------------------------------------------------------------
87
+ /** Settle a removal without writing anything. */
88
+ export const prepareUninstallExtensions = Effect.fn("UninstallExtensions.prepare")(function* (request) {
89
+ const resolved = yield* Option.match(request.type, {
90
+ onSome: (type) => Effect.succeed({ type, selector: request.selector }),
91
+ onNone: () => resolveRootUninstallIntent(request.selector).pipe(Effect.map((intent) => ({ type: intent.type, selector: intent.name }))),
92
+ });
93
+ const planned = yield* planForType(resolved.type, resolved.selector);
94
+ // The plan's own name stands whichever spelling produced it: the removal a
95
+ // person asked for is type-specific, and the plan name is what they read.
96
+ // Only the presented subject varies — the root form routes across every
97
+ // type, so it presents the default subject rather than the one this
98
+ // request happened to settle on.
99
+ const plan = {
100
+ ...planned.plan,
101
+ presentation: operationPresentation({ imperative: "uninstall", past: "Uninstalled", gerund: "Uninstalling" }, Option.getOrUndefined(request.type)),
102
+ };
103
+ // Every removal withdraws the extension's per-agent projection, so the
104
+ // candidate carries the configured-agent operation the resolution projects
105
+ // before the removal and verifies after it.
106
+ const configuredAgentOperations = planned.names.map((name) => ({ extensionType: resolved.type, name, plannedState: "absent" }));
107
+ const execution = yield* prepareExecutionCandidate(plan, { configuredAgentOperations });
108
+ return {
109
+ type: resolved.type,
110
+ selector: resolved.selector,
111
+ names: planned.names,
112
+ empty: planned.names.length === 0,
113
+ planName: plan.name,
114
+ execution,
115
+ };
116
+ });
117
+ // -----------------------------------------------------------------------------
118
+ // previewOrApply
119
+ // -----------------------------------------------------------------------------
120
+ /** Preview or apply a settled removal, resolving to one operation outcome. */
121
+ export const previewOrApplyUninstallExtensions = (candidate, execution) => resolveExecutionCandidate(candidate.execution, execution);
122
+ /** The removal use case: settle a request, then preview or apply it. */
123
+ export const UninstallExtensions = {
124
+ prepare: prepareUninstallExtensions,
125
+ previewOrApply: previewOrApplyUninstallExtensions,
126
+ };
127
+ //# sourceMappingURL=uninstall-extensions.js.map
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The vocabulary every uninstall route shares.
3
+ *
4
+ * Root uninstall and the seven per-type uninstalls are one use case with the
5
+ * type either fixed by the command or read from the registry FQN, so they
6
+ * share one settled target list and one disposition vocabulary. What a
7
+ * removal actually did — removed the package, retained it for a pack, left
8
+ * unowned content in place, or found nothing at all — is reported as a typed
9
+ * settlement rather than inferred from a sentence.
10
+ *
11
+ * @experimental This API is unstable and may change without notice.
12
+ */
13
+ import type { HookExtensionTarget, KnowledgeExtensionTarget, McpServerExtensionTarget, PackExtensionTarget, RuleExtensionTarget, SkillExtensionTarget, SubagentExtensionTarget } from "@agentxm/workspace-state";
14
+ /** One skill removal. */
15
+ export interface SkillUninstallIntent {
16
+ readonly targets: ReadonlyArray<SkillExtensionTarget>;
17
+ }
18
+ /** One subagent removal. */
19
+ export interface SubagentUninstallIntent {
20
+ readonly targets: ReadonlyArray<SubagentExtensionTarget>;
21
+ }
22
+ /** One MCP connection removal. */
23
+ export interface McpServerUninstallIntent {
24
+ readonly targets: ReadonlyArray<McpServerExtensionTarget>;
25
+ }
26
+ /** One rule removal. */
27
+ export interface RuleUninstallIntent {
28
+ readonly targets: ReadonlyArray<RuleExtensionTarget>;
29
+ }
30
+ /** One hooks-package removal. */
31
+ export interface HookUninstallIntent {
32
+ readonly targets: ReadonlyArray<HookExtensionTarget>;
33
+ }
34
+ /** One knowledge-bundle removal. */
35
+ export interface KnowledgeUninstallIntent {
36
+ readonly targets: ReadonlyArray<KnowledgeExtensionTarget>;
37
+ }
38
+ /** One pack removal, with the owner and authority its desired identity named. */
39
+ export type PackUninstallTarget = PackExtensionTarget;
40
+ //# sourceMappingURL=vocabulary.d.ts.map
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The vocabulary every uninstall route shares.
3
+ *
4
+ * Root uninstall and the seven per-type uninstalls are one use case with the
5
+ * type either fixed by the command or read from the registry FQN, so they
6
+ * share one settled target list and one disposition vocabulary. What a
7
+ * removal actually did — removed the package, retained it for a pack, left
8
+ * unowned content in place, or found nothing at all — is reported as a typed
9
+ * settlement rather than inferred from a sentence.
10
+ *
11
+ * @experimental This API is unstable and may change without notice.
12
+ */
13
+ export {};
14
+ //# sourceMappingURL=vocabulary.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The atomicity a workspace-wide update declares, and why.
3
+ *
4
+ * A targeted update is one closure and keeps the ordinary closure-atomic
5
+ * promise. A workspace-wide sweep is not: it advances every configured entry
6
+ * that can advance, each as its own closure, and deliberately leaves the ones
7
+ * that already advanced committed when a later entry fails. There is no
8
+ * cross-closure undo, so the operation reports itself `non-rollbackable`
9
+ * rather than claiming a rollback it will not perform.
10
+ *
11
+ * The declaration lives with the update use case so the atomicity a person
12
+ * reads in the result document is the one its owner decided, not one a
13
+ * transport adapter chose while assembling a plan literal.
14
+ *
15
+ * @experimental This API is unstable and may change without notice.
16
+ */
17
+ import type { AtomicityClass, PlanExecutionCapabilities } from "@agentxm/workspace-operations";
18
+ /** A workspace-wide update settles each entry independently and undoes none. */
19
+ export declare const WORKSPACE_UPDATE_ATOMICITY: AtomicityClass;
20
+ /** The execution capabilities a workspace-wide update plan declares. */
21
+ export declare const WORKSPACE_UPDATE_EXECUTION_CAPABILITIES: PlanExecutionCapabilities;
22
+ //# sourceMappingURL=atomicity.d.ts.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The atomicity a workspace-wide update declares, and why.
3
+ *
4
+ * A targeted update is one closure and keeps the ordinary closure-atomic
5
+ * promise. A workspace-wide sweep is not: it advances every configured entry
6
+ * that can advance, each as its own closure, and deliberately leaves the ones
7
+ * that already advanced committed when a later entry fails. There is no
8
+ * cross-closure undo, so the operation reports itself `non-rollbackable`
9
+ * rather than claiming a rollback it will not perform.
10
+ *
11
+ * The declaration lives with the update use case so the atomicity a person
12
+ * reads in the result document is the one its owner decided, not one a
13
+ * transport adapter chose while assembling a plan literal.
14
+ *
15
+ * @experimental This API is unstable and may change without notice.
16
+ */
17
+ /** A workspace-wide update settles each entry independently and undoes none. */
18
+ export const WORKSPACE_UPDATE_ATOMICITY = "non-rollbackable";
19
+ /** The execution capabilities a workspace-wide update plan declares. */
20
+ export const WORKSPACE_UPDATE_EXECUTION_CAPABILITIES = {
21
+ rollback: WORKSPACE_UPDATE_ATOMICITY,
22
+ };
23
+ //# sourceMappingURL=atomicity.js.map
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Why a targeted update may not proceed, said once.
3
+ *
4
+ * Every reason a named update is refused is a fact about the workspace, not
5
+ * about the command that asked: the extension is not desired, the entry is
6
+ * turned off, a Pack owns the constraint the request would fork, the Pack
7
+ * graph cannot prove ownership, the declared constraints do not intersect,
8
+ * the source is the copy embedded in this executable, the source is
9
+ * workspace-authored, or the ownership context went stale under the
10
+ * transition. The sentence and the blocking class belong here so preview,
11
+ * apply, and machine output all report the same refusal.
12
+ *
13
+ * What a person should type next is the application's to render: the blocker
14
+ * travels as `blocking.reference`, and the adapter maps it to the command it
15
+ * knows how to spell.
16
+ *
17
+ * @experimental This API is unstable and may change without notice.
18
+ */
19
+ import type { TargetedUpdateBlocker, TargetedUpdatePublicContext } from "@agentxm/extension-resolution";
20
+ import type { BlockingClass } from "@agentxm/workspace-operations";
21
+ /** The refusal sentence for one classified blocker. */
22
+ export declare const blockerDetail: (context: TargetedUpdatePublicContext) => string;
23
+ /**
24
+ * Which kind of blocking a refusal is: a policy the workspace chose to
25
+ * enforce, a precondition the workspace does not meet, or an answer that went
26
+ * out of date.
27
+ */
28
+ export declare const blockerClass: (blocker: TargetedUpdateBlocker | undefined) => BlockingClass;
29
+ /** The ownership context a stale outcome reports: nothing moved. */
30
+ export declare const staleOutputContext: (context: TargetedUpdatePublicContext) => TargetedUpdatePublicContext;
31
+ //# sourceMappingURL=blockers.d.ts.map
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Why a targeted update may not proceed, said once.
3
+ *
4
+ * Every reason a named update is refused is a fact about the workspace, not
5
+ * about the command that asked: the extension is not desired, the entry is
6
+ * turned off, a Pack owns the constraint the request would fork, the Pack
7
+ * graph cannot prove ownership, the declared constraints do not intersect,
8
+ * the source is the copy embedded in this executable, the source is
9
+ * workspace-authored, or the ownership context went stale under the
10
+ * transition. The sentence and the blocking class belong here so preview,
11
+ * apply, and machine output all report the same refusal.
12
+ *
13
+ * What a person should type next is the application's to render: the blocker
14
+ * travels as `blocking.reference`, and the adapter maps it to the command it
15
+ * knows how to spell.
16
+ *
17
+ * @experimental This API is unstable and may change without notice.
18
+ */
19
+ import { TARGETED_UPDATE_STALE_DETAIL } from "./targeted-plan.js";
20
+ /** The refusal sentence for one classified blocker. */
21
+ export const blockerDetail = (context) => {
22
+ const withRelevantProblems = (detail) => context.relevantProblems.length === 0
23
+ ? detail
24
+ : `${detail}. ${context.relevantProblems.join("; ")}`;
25
+ if (context.blocker === undefined) {
26
+ return `Update ${context.target.fqn} is blocked`;
27
+ }
28
+ switch (context.blocker) {
29
+ case "not-desired":
30
+ return `${context.target.fqn} is not desired by this workspace`;
31
+ case "disabled":
32
+ return `${context.target.fqn} is effectively disabled`;
33
+ case "pack-owned-constraint":
34
+ return `${context.target.fqn} is pack-owned; a targeted version range would create direct intent`;
35
+ case "incomplete-graph":
36
+ return withRelevantProblems(`Pack membership is incomplete, so ownership of ${context.target.fqn} cannot be proven`);
37
+ case "constraint-conflict":
38
+ return withRelevantProblems(`The desired constraints for ${context.target.fqn} have no compatible intersection`);
39
+ case "bundled-source":
40
+ return `${context.target.fqn} uses the skill embedded in this AXM executable and cannot be advanced from the Registry`;
41
+ case "source-authority":
42
+ return `${context.target.fqn} is workspace-authored and cannot be replaced from the Registry`;
43
+ case "stale-plan":
44
+ return TARGETED_UPDATE_STALE_DETAIL;
45
+ }
46
+ };
47
+ /**
48
+ * Which kind of blocking a refusal is: a policy the workspace chose to
49
+ * enforce, a precondition the workspace does not meet, or an answer that went
50
+ * out of date.
51
+ */
52
+ export const blockerClass = (blocker) => {
53
+ switch (blocker) {
54
+ case "pack-owned-constraint":
55
+ case "bundled-source":
56
+ case "source-authority":
57
+ return "policy-excluded";
58
+ case "stale-plan":
59
+ return "stale-candidate";
60
+ default:
61
+ return "precondition-unmet";
62
+ }
63
+ };
64
+ /** The ownership context a stale outcome reports: nothing moved. */
65
+ export const staleOutputContext = (context) => ({
66
+ ...context,
67
+ authority: "blocked",
68
+ blocker: "stale-plan",
69
+ effects: {
70
+ settings: "unchanged",
71
+ acceptedResolution: "unchanged",
72
+ canonical: "unchanged",
73
+ projection: "unchanged",
74
+ packRoot: "unchanged",
75
+ packManifest: "unchanged",
76
+ },
77
+ });
78
+ //# sourceMappingURL=blockers.js.map
@@ -0,0 +1,78 @@
1
+ /**
2
+ * The configured-entry sweep an update performs.
3
+ *
4
+ * A workspace-wide update — and every `<type> update` that narrows it — asks
5
+ * one question of each configured, enabled entry: given the source the
6
+ * workspace declared and the constraint it recorded, which visible version
7
+ * does that source resolve to now, and does it differ from the one already
8
+ * accepted? A workspace-authored entry is locally authoritative and is
9
+ * reported unchanged rather than re-resolved; an inline MCP connection has no
10
+ * source to advance; an entry whose source cannot be resolved is reported as
11
+ * a blocked unit rather than failing the sweep, so one unreachable Registry
12
+ * does not stop every other advance.
13
+ *
14
+ * Each entry is planned through the same per-type install planner the install
15
+ * routes use, because advancing an accepted resolution is installing the
16
+ * version the source now offers. Where a direct declaration and a Pack-owned
17
+ * dependency both plan the same target, the direct one wins: the workspace's
18
+ * own declaration outranks a dependency the closure derived.
19
+ *
20
+ * @experimental This API is unstable and may change without notice.
21
+ */
22
+ import * as Effect from "effect/Effect";
23
+ import * as Option from "effect/Option";
24
+ import type * as FileSystem from "effect/FileSystem";
25
+ import type * as Path from "effect/Path";
26
+ import type * as Scope from "effect/Scope";
27
+ import type * as HttpClient from "effect/unstable/http/HttpClient";
28
+ import { ReleaseAgePosture, resolveConfiguredSkill } from "@agentxm/extension-resolution";
29
+ import { type Plan, type PlannedJobStep } from "@agentxm/workspace-operations";
30
+ import { WorkspaceMutations, type WorkspaceSettingsReadFailure, type WorkspaceStateReadFailure } from "@agentxm/workspace-state";
31
+ import { type InstallableExtensionType } from "@agentxm/extension-model/unstable/extensions/installable-types";
32
+ import { HookManager, KnowledgeManager, McpServerManager, PackManager, RuleManager, SkillManager, SubagentManager } from "@agentxm/extension-materialization";
33
+ import { SourceHostProviders, WorkspaceCatalog } from "@agentxm/extension-sources";
34
+ import { ExtensionLifecycleFailed } from "../errors.js";
35
+ import { StepFailureConversion } from "../step-failure-conversion.js";
36
+ import type { InstallStepRequirements } from "../install/vocabulary.js";
37
+ import { type PackInstallRequirements } from "../packs/install/plan.js";
38
+ export type WorkspaceUpdatableType = InstallableExtensionType;
39
+ /**
40
+ * Everything sweeping the configured entries can fail with before a plan
41
+ * exists: the feature's own refusals, whatever resolving one entry against
42
+ * its source surfaced, and the workspace reads the sweep performs.
43
+ */
44
+ export type ConfiguredUpdateFailure = ExtensionLifecycleFailed | Effect.Error<ReturnType<typeof resolveConfiguredSkill>> | WorkspaceStateReadFailure | WorkspaceSettingsReadFailure;
45
+ type WorkspaceUpdateCollectorContext = InstallStepRequirements | PackInstallRequirements | StepFailureConversion | Scope.Scope | HttpClient.HttpClient | FileSystem.FileSystem | Path.Path | WorkspaceMutations | WorkspaceCatalog | SourceHostProviders | HookManager | KnowledgeManager | McpServerManager | PackManager | RuleManager | SkillManager | SubagentManager;
46
+ /**
47
+ * Name selector shared by every collector. `undefined` means "no selector was
48
+ * given" and is distinct from an empty set, which selects nothing.
49
+ */
50
+ export interface WorkspaceUpdateNameSelection {
51
+ readonly names: ReadonlySet<string> | undefined;
52
+ }
53
+ export type WorkspaceUpdatePlanResult = {
54
+ readonly _tag: "NoConfiguredExtensions";
55
+ readonly message: string;
56
+ } | {
57
+ readonly _tag: "WorkspaceUpdatePlan";
58
+ readonly plan: Plan<InstallStepRequirements>;
59
+ };
60
+ export declare const makeWorkspaceUpdatePlan: (name: string, description: Option.Option<string>, steps: ReadonlyArray<PlannedJobStep<InstallStepRequirements>>, type: Option.Option<WorkspaceUpdatableType>, releaseAge: Plan<InstallStepRequirements>["releaseAge"]) => Plan<InstallStepRequirements>;
61
+ /** What a configured sweep asks for: a type filter and an optional selection. */
62
+ export interface WorkspaceUpdatePlanRequest {
63
+ readonly type: Option.Option<WorkspaceUpdatableType>;
64
+ readonly planName: string;
65
+ readonly planDescription: Option.Option<string>;
66
+ /** Installed names the caller's selector resolved to; omit to update all. */
67
+ readonly names?: ReadonlyArray<string>;
68
+ /** Whether the invoking surface can prompt while the planned advance runs. */
69
+ readonly nonInteractive: boolean;
70
+ }
71
+ /**
72
+ * Sweep every selected configured entry and fold the surviving steps into one
73
+ * best-effort plan, or report that the selection had nothing configured to
74
+ * advance.
75
+ */
76
+ export declare const buildWorkspaceUpdatePlan: (request: WorkspaceUpdatePlanRequest) => Effect.Effect<WorkspaceUpdatePlanResult, ConfiguredUpdateFailure, WorkspaceUpdateCollectorContext | ReleaseAgePosture>;
77
+ export {};
78
+ //# sourceMappingURL=configured.d.ts.map