@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
@@ -8,10 +8,11 @@
8
8
  */
9
9
  import * as FileSystem from "effect/FileSystem";
10
10
  import * as Path from "effect/Path";
11
- import { LifecycleFailureAdapter } from "../../failure-adapter.js";
11
+ import { StepFailureConversion } from "../../step-failure-conversion.js";
12
12
  import type { OperationHandler } from "@agentxm/workspace-operations";
13
13
  import type { Operation } from "@agentxm/workspace-operations";
14
14
  import { WorkspaceMutations } from "@agentxm/workspace-state";
15
+ import { WorkspaceTransactionScope } from "@agentxm/workspace-transactions";
15
16
  /**
16
17
  * Disable a skill (remove files but keep settings/lockfile entry).
17
18
  *
@@ -27,5 +28,5 @@ export type DisableSkillOperation = Operation<"disable-skill", {
27
28
  * materialized targets, and promotes implicit pack members to a direct disabled
28
29
  * preference. Canonical files are preserved for later re-enablement.
29
30
  */
30
- export declare const disableSkill: OperationHandler<DisableSkillOperation, FileSystem.FileSystem | Path.Path | WorkspaceMutations | LifecycleFailureAdapter>;
31
+ export declare const disableSkill: OperationHandler<DisableSkillOperation, FileSystem.FileSystem | Path.Path | WorkspaceMutations | WorkspaceTransactionScope | StepFailureConversion>;
31
32
  //# sourceMappingURL=disable.d.ts.map
@@ -12,14 +12,15 @@ import * as Array from "effect/Array";
12
12
  import * as Effect from "effect/Effect";
13
13
  import * as Option from "effect/Option";
14
14
  import * as Layer from "effect/Layer";
15
- import { DefaultCodingAgentRepository } from "@agentxm/extension-workspace";
15
+ import { DefaultCodingAgentRepository } from "@agentxm/workspace-projection";
16
16
  import { ExtensionLifecycleFailed } from "../../errors.js";
17
- import { LifecycleFailureAdapter, withAdaptedStepFailures } from "../../failure-adapter.js";
17
+ import { StepFailureConversion, withAdaptedStepFailures } from "../../step-failure-conversion.js";
18
18
  import { WorkspaceMutations } from "@agentxm/workspace-state";
19
+ import { WorkspaceTransactionScope, runWorkspaceTransaction, } from "@agentxm/workspace-transactions";
19
20
  import { sanitizeName } from "@agentxm/workspace-state";
20
- import { skillArtifactFromTargets, } from "@agentxm/extension-workspace";
21
+ import { skillArtifactFromTargets, } from "@agentxm/extension-materialization";
21
22
  import { installedRowsByName } from "@agentxm/workspace-state";
22
- import { removeSkillAgentArtifact } from "../materialization.js";
23
+ import { removeSkillAgentArtifact } from "@agentxm/extension-materialization";
23
24
  // -----------------------------------------------------------------------------
24
25
  // Public API
25
26
  // -----------------------------------------------------------------------------
@@ -50,7 +51,7 @@ export const disableSkill = (op) => Effect.gen(function* () {
50
51
  const desiredBeforeDisable = graph.nodes.find((node) => node.type === "skill" && node.name === op.args.skillName);
51
52
  const sanitizedName = sanitizeName(op.args.skillName);
52
53
  const materializationAgents = yield* DefaultCodingAgentRepository.getMaterializationAgents().pipe(Effect.provideService(WorkspaceMutations, ws));
53
- const installableTargetOptions = yield* ws.runTransaction({
54
+ const installableTargetOptions = yield* runWorkspaceTransaction({
54
55
  transition: Effect.gen(function* () {
55
56
  if (isImplicit) {
56
57
  const source = desiredBeforeDisable?.source ?? Option.getOrElse(installed.source, () => undefined);
@@ -72,12 +73,7 @@ export const disableSkill = (op) => Effect.gen(function* () {
72
73
  return yield* Effect.forEach(materializationAgents, (agent) => agent.resolveEffectiveSkillsDir({ workspaceRoot: base }).pipe(Effect.provide(fsPathLayer), Effect.flatMap((outcome) => outcome._tag === "supported"
73
74
  ? Effect.gen(function* () {
74
75
  const targetDir = path.normalize(outcome.dir);
75
- yield* removeSkillAgentArtifact({
76
- fs,
77
- pathService: path,
78
- targetDir,
79
- sanitizedName,
80
- });
76
+ yield* removeSkillAgentArtifact({ targetDir, sanitizedName });
81
77
  return Option.some({
82
78
  agentId: agent.id,
83
79
  targetDir,
@@ -8,10 +8,11 @@
8
8
  */
9
9
  import * as FileSystem from "effect/FileSystem";
10
10
  import * as Path from "effect/Path";
11
- import { LifecycleFailureAdapter } from "../../failure-adapter.js";
11
+ import { StepFailureConversion } from "../../step-failure-conversion.js";
12
12
  import type { OperationHandler } from "@agentxm/workspace-operations";
13
13
  import type { Operation } from "@agentxm/workspace-operations";
14
14
  import { WorkspaceMutations } from "@agentxm/workspace-state";
15
+ import { WorkspaceTransactionScope } from "@agentxm/workspace-transactions";
15
16
  /**
16
17
  * Enable a previously disabled skill (re-install files and update state).
17
18
  *
@@ -27,5 +28,5 @@ export type EnableSkillOperation = Operation<"enable-skill", {
27
28
  * 2. Create agent artifacts.
28
29
  * 3. Update settings to set enabled: true.
29
30
  */
30
- export declare const enableSkill: OperationHandler<EnableSkillOperation, FileSystem.FileSystem | Path.Path | WorkspaceMutations | LifecycleFailureAdapter>;
31
+ export declare const enableSkill: OperationHandler<EnableSkillOperation, FileSystem.FileSystem | Path.Path | WorkspaceMutations | WorkspaceTransactionScope | StepFailureConversion>;
31
32
  //# sourceMappingURL=enable.d.ts.map
@@ -11,13 +11,14 @@ import * as Path from "effect/Path";
11
11
  import * as Effect from "effect/Effect";
12
12
  import * as Option from "effect/Option";
13
13
  import * as Layer from "effect/Layer";
14
- import { DefaultCodingAgentRepository } from "@agentxm/extension-workspace";
14
+ import { DefaultCodingAgentRepository } from "@agentxm/workspace-projection";
15
15
  import { ExtensionLifecycleFailed } from "../../errors.js";
16
- import { LifecycleFailureAdapter, withAdaptedStepFailures } from "../../failure-adapter.js";
16
+ import { StepFailureConversion, withAdaptedStepFailures } from "../../step-failure-conversion.js";
17
17
  import { WorkspaceMutations } from "@agentxm/workspace-state";
18
+ import { WorkspaceTransactionScope, runWorkspaceTransaction, } from "@agentxm/workspace-transactions";
18
19
  import { sanitizeName } from "@agentxm/workspace-state";
19
- import { ensureSkillAgentArtifact } from "../materialization.js";
20
- import { skillArtifactFromTargets, } from "@agentxm/extension-workspace";
20
+ import { ensureSkillAgentArtifact } from "@agentxm/extension-materialization";
21
+ import { skillArtifactFromTargets, } from "@agentxm/extension-materialization";
21
22
  import { usableAcceptedCanonicalObservation } from "@agentxm/workspace-state";
22
23
  // -----------------------------------------------------------------------------
23
24
  // Public API
@@ -35,7 +36,6 @@ export const enableSkill = (op) => Effect.gen(function* () {
35
36
  const ws = yield* WorkspaceMutations;
36
37
  const base = ws.baseDir;
37
38
  const fsPathLayer = Layer.mergeAll(Layer.succeed(FileSystem.FileSystem, fs), Layer.succeed(Path.Path, path));
38
- const provide = (effect) => Effect.provide(effect, fsPathLayer);
39
39
  const canonical = yield* usableAcceptedCanonicalObservation({
40
40
  workspace: ws,
41
41
  type: "skill",
@@ -62,7 +62,7 @@ export const enableSkill = (op) => Effect.gen(function* () {
62
62
  const skillSrcPath = portable
63
63
  ? canonical.value.observation.path
64
64
  : path.join(canonical.value.observation.path, "src");
65
- const installableTargets = yield* ws.runTransaction({
65
+ const installableTargets = yield* runWorkspaceTransaction({
66
66
  transition: Effect.gen(function* () {
67
67
  const resolvedTargets = yield* Effect.forEach(materializationAgents, (agent) => agent.resolveEffectiveSkillsDir({ workspaceRoot: base }).pipe(Effect.provide(fsPathLayer), Effect.map((outcome) => ({ agent, outcome }))), { concurrency: "unbounded" });
68
68
  const targets = resolvedTargets.flatMap(({ agent, outcome }) => outcome._tag === "supported"
@@ -85,9 +85,7 @@ export const enableSkill = (op) => Effect.gen(function* () {
85
85
  canonicalSkillSrcPath: skillSrcPath,
86
86
  targetDir: location.targetDir,
87
87
  sanitizedName,
88
- pathService: path,
89
88
  baseDir: base,
90
- provide,
91
89
  }), { concurrency: "unbounded" });
92
90
  yield* ws.updateSkillEntry(op.args.skillName, (entry) => ({
93
91
  ...entry,
@@ -14,8 +14,8 @@ import type { AgentId } from "@agentxm/extension-model/unstable/agents/types";
14
14
  import { type RenderedFilesMap } from "@agentxm/workspace-state";
15
15
  import type { SkillExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/skill";
16
16
  import { SourceHostProviders } from "@agentxm/extension-sources";
17
- import { CodingAgentRepository } from "@agentxm/extension-workspace";
18
- import { LifecycleFailureAdapter } from "../../failure-adapter.js";
17
+ import { CodingAgentRepository } from "@agentxm/workspace-projection";
18
+ import { StepFailureConversion } from "../../step-failure-conversion.js";
19
19
  import type { OperationHandler } from "@agentxm/workspace-operations";
20
20
  import type { Operation } from "@agentxm/workspace-operations";
21
21
  import type { JobStepArtifactSource } from "@agentxm/workspace-operations";
@@ -43,7 +43,7 @@ export type InstallSkillOperationArgs = {
43
43
  */
44
44
  export type InstallSkillOperation = Operation<"install-skill", InstallSkillOperationArgs>;
45
45
  export declare const gitHostedSkillArtifactSource: (ref: SkillExtensionRef) => JobStepArtifactSource | undefined;
46
- export { computeSkillSourceHash } from "./source-hash.js";
46
+ export { computeSkillSourceHash } from "@agentxm/extension-materialization";
47
47
  /**
48
48
  * Build a RenderedFilesMap from per-agent copy-mode install results.
49
49
  * Only includes agents where mode === "copy" and success === true.
@@ -63,5 +63,5 @@ export declare const buildRenderedFilesFromResults: (installableTargets: Readonl
63
63
  * 2. Update lockfile/settings entry (failures logged as warnings)
64
64
  * 3. Compute and return overall result
65
65
  */
66
- export declare const installSkill: OperationHandler<InstallSkillOperation, FileSystem.FileSystem | HttpClient.HttpClient | Path.Path | WorkspaceMutations | SourceHostProviders | CodingAgentRepository | LifecycleFailureAdapter>;
66
+ export declare const installSkill: OperationHandler<InstallSkillOperation, FileSystem.FileSystem | HttpClient.HttpClient | Path.Path | WorkspaceMutations | SourceHostProviders | CodingAgentRepository | StepFailureConversion>;
67
67
  //# sourceMappingURL=install.d.ts.map
@@ -7,6 +7,7 @@
7
7
  * @experimental This API is unstable and may change without notice.
8
8
  */
9
9
  import * as FileSystem from "effect/FileSystem";
10
+ import { stripFileProtocol } from "@agentxm/registry-client";
10
11
  import * as Path from "effect/Path";
11
12
  import * as Array from "effect/Array";
12
13
  import * as Effect from "effect/Effect";
@@ -14,29 +15,29 @@ import * as Option from "effect/Option";
14
15
  import { printSourceParams } from "@agentxm/extension-model/unstable/sources/printer";
15
16
  import { printSkillLockSourceLocator } from "@agentxm/workspace-state";
16
17
  import { sourceToLockEntry } from "@agentxm/workspace-state";
17
- import { canReuseInstalledPackage, materializeExternalPackage } from "@agentxm/extension-workspace";
18
- import { materializeRegistryPackage } from "../../registry-materialization.js";
18
+ import { canReuseInstalledPackage, materializeExternalPackage, } from "@agentxm/extension-materialization";
19
+ import { materializeRegistryPackage } from "@agentxm/extension-materialization";
19
20
  import { computePackageContentHash } from "@agentxm/workspace-state";
20
21
  import { RenderedFilePathSchema, } from "@agentxm/workspace-state";
21
22
  import { computeMaterializedTreeIntegrity } from "@agentxm/workspace-state";
22
23
  import * as Schema from "effect/Schema";
23
24
  import { SourceHostProviders } from "@agentxm/extension-sources";
24
- import { CodingAgentRepository, validateAxmSkillCandidate } from "@agentxm/extension-workspace";
25
- import { stripFileProtocol } from "../../internal/fs-helpers.js";
26
- import { isPathSafe } from "@agentxm/workspace-state";
25
+ import { CodingAgentRepository } from "@agentxm/workspace-projection";
26
+ import { isPathSafe } from "@agentxm/extension-model/unstable/path-types";
27
27
  import { makeWorkspaceRelativeSourcePath } from "@agentxm/extension-model/unstable/path-types";
28
28
  import { createSymlink } from "@agentxm/workspace-state";
29
29
  import { validatePathSafety } from "@agentxm/workspace-state";
30
30
  import { StepFailure } from "@agentxm/workspace-operations";
31
31
  import { acceptedRegistryVersionForRef, validateExactResolvedVersion, } from "@agentxm/workspace-state";
32
32
  import { ExtensionLifecycleFailed } from "../../errors.js";
33
- import { LifecycleFailureAdapter, withAdaptedStepFailures } from "../../failure-adapter.js";
33
+ import { StepFailureConversion, withAdaptedStepFailures } from "../../step-failure-conversion.js";
34
34
  import { appendWarningsToMessage } from "@agentxm/workspace-operations";
35
35
  import { WorkspaceMutations } from "@agentxm/workspace-state";
36
- import { copyExtensionDirectory, formatCopyExtensionDirectoryFailure, } from "@agentxm/extension-workspace";
37
- import { artifactAgentIdsFromTargets, artifactTargetAgentIds, groupInstallTargetsByDirectory, } from "@agentxm/extension-workspace";
36
+ import { copyExtensionDirectory, formatCopyExtensionDirectoryFailure, } from "@agentxm/extension-materialization";
37
+ import { artifactAgentIdsFromTargets, artifactTargetAgentIds, groupInstallTargetsByDirectory, } from "@agentxm/extension-materialization";
38
38
  import { sanitizeName } from "@agentxm/workspace-state";
39
- import { computeSkillSourceHash } from "./source-hash.js";
39
+ import { computeSkillSourceHash } from "@agentxm/extension-materialization";
40
+ import { validateAxmSkillCandidate } from "@agentxm/extension-resolution";
40
41
  const countFiles = (dir) => Effect.gen(function* () {
41
42
  const fs = yield* FileSystem.FileSystem;
42
43
  const path = yield* Path.Path;
@@ -134,7 +135,7 @@ export const gitHostedSkillArtifactSource = (ref) => {
134
135
  // Shared helpers
135
136
  // -----------------------------------------------------------------------------
136
137
  const preCleanAndCopy = (sanitizedName, sourcePath, copyTarget) => Effect.gen(function* () {
137
- const adapter = yield* LifecycleFailureAdapter;
138
+ const adapter = yield* StepFailureConversion;
138
139
  const fs = yield* FileSystem.FileSystem;
139
140
  const ws = yield* WorkspaceMutations;
140
141
  const sourceExists = yield* fs
@@ -171,7 +172,7 @@ const preCleanAndCopy = (sanitizedName, sourcePath, copyTarget) => Effect.gen(fu
171
172
  })));
172
173
  });
173
174
  const decodeRenderedFilePath = Schema.decodeUnknownSync(RenderedFilePathSchema);
174
- export { computeSkillSourceHash } from "./source-hash.js";
175
+ export { computeSkillSourceHash } from "@agentxm/extension-materialization";
175
176
  /**
176
177
  * Build a RenderedFilesMap from per-agent copy-mode install results.
177
178
  * Only includes agents where mode === "copy" and success === true.
@@ -371,7 +372,7 @@ const materializeSkill = (ref, sanitizedName, versionRange, reuse) => {
371
372
  * 3. Compute and return overall result
372
373
  */
373
374
  export const installSkill = (op) => Effect.gen(function* () {
374
- const adapter = yield* LifecycleFailureAdapter;
375
+ const adapter = yield* StepFailureConversion;
375
376
  const ws = yield* WorkspaceMutations;
376
377
  const path = yield* Path.Path;
377
378
  const agentRepo = yield* CodingAgentRepository;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Uninstalling skills.
3
+ *
4
+ * A skill's removal withdraws its projection from every configured agent's
5
+ * skills directory as well as its canonical package, so the artifact names
6
+ * both. What the removal actually settled — package removed, retained for a
7
+ * pack, or already absent — comes from the settlement, not from its sentence.
8
+ *
9
+ * @experimental This API is unstable and may change without notice.
10
+ */
11
+ import * as Effect from "effect/Effect";
12
+ import * as FileSystem from "effect/FileSystem";
13
+ import * as Path from "effect/Path";
14
+ import { SkillManager } from "@agentxm/extension-materialization";
15
+ import type { Plan } from "@agentxm/workspace-operations";
16
+ import type { ExtensionLifecycleFailed } from "../../errors.js";
17
+ import { type InstallStepRequirements, type ResolveInstallRequirements } from "../../install/vocabulary.js";
18
+ import type { SkillUninstallIntent } from "../../uninstall/vocabulary.js";
19
+ /** Expand the selector against installed skills; a glob may match nothing. */
20
+ export declare const parseSkillUninstallRequest: (selector: string) => Effect.Effect<SkillUninstallIntent, ExtensionLifecycleFailed, InstallStepRequirements | ResolveInstallRequirements>;
21
+ /** The closures a settled skill removal becomes. */
22
+ export declare const planSkillUninstall: (intent: SkillUninstallIntent) => Effect.Effect<Plan<InstallStepRequirements>, ExtensionLifecycleFailed, InstallStepRequirements | SkillManager | FileSystem.FileSystem | Path.Path>;
23
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Uninstalling skills.
3
+ *
4
+ * A skill's removal withdraws its projection from every configured agent's
5
+ * skills directory as well as its canonical package, so the artifact names
6
+ * both. What the removal actually settled — package removed, retained for a
7
+ * pack, or already absent — comes from the settlement, not from its sentence.
8
+ *
9
+ * @experimental This API is unstable and may change without notice.
10
+ */
11
+ import * as Effect from "effect/Effect";
12
+ import * as FileSystem from "effect/FileSystem";
13
+ import * as Option from "effect/Option";
14
+ import * as Path from "effect/Path";
15
+ import { SkillManager, buildUninstallOperation, skillArtifactFromTargets, } from "@agentxm/extension-materialization";
16
+ import { resolveInstalledIdentifierNameOrInput } from "@agentxm/extension-sources";
17
+ import { CodingAgentRepository } from "@agentxm/workspace-projection";
18
+ import { WorkspaceMutations, acquiredExtensionDisplayPathFromLockEntry, installedRowsByName, sanitizeName, } from "@agentxm/workspace-state";
19
+ import { expandGlob } from "../../glob.js";
20
+ import { lifecycleStepFailure } from "../../step-failure.js";
21
+ import { installRefused, } from "../../install/vocabulary.js";
22
+ import { makeWorkspaceRetentionPolicy } from "../../uninstall/retention-policy.js";
23
+ import { workspaceAuthoredPath, workspaceCanonicalPath, workspaceCanonicalRoot, workspaceLockfilePath, workspaceSettingsPath, } from "../../workspace-paths.js";
24
+ const skillSourceTarget = (ws, path, configuredSource, lockEntry, sanitizedName) => {
25
+ if (Option.isSome(configuredSource) && configuredSource.value === "workspace") {
26
+ return { path: workspaceAuthoredPath(path, ws, "skill", sanitizedName), change: "unchanged" };
27
+ }
28
+ if (Option.isSome(lockEntry)) {
29
+ const entry = lockEntry.value;
30
+ return {
31
+ path: acquiredExtensionDisplayPathFromLockEntry(workspaceCanonicalRoot(ws.scope), entry, "skills", entry.workspaceName),
32
+ change: "removed",
33
+ };
34
+ }
35
+ return { path: workspaceCanonicalPath(ws.scope, sanitizedName), change: "removed" };
36
+ };
37
+ /** Expand the selector against installed skills; a glob may match nothing. */
38
+ export const parseSkillUninstallRequest = Effect.fn("UninstallExtensions.parseSkillRequest")(function* (selector) {
39
+ const ws = yield* WorkspaceMutations;
40
+ const installedSkills = yield* ws.records.rows("skill").pipe(Effect.mapError((cause) => installRefused({
41
+ category: "internal",
42
+ detail: "Installed skills could not be read",
43
+ cause,
44
+ })), Effect.map(installedRowsByName));
45
+ const installedNames = Object.keys(installedSkills);
46
+ const matched = expandGlob(selector, installedNames);
47
+ if (selector.includes("*") && matched.length === 0) {
48
+ return { targets: [] };
49
+ }
50
+ const names = matched.length > 0
51
+ ? matched
52
+ : [
53
+ yield* resolveInstalledIdentifierNameOrInput({
54
+ input: selector,
55
+ resourceType: "skill",
56
+ }).pipe(Effect.mapError((cause) => installRefused({
57
+ category: "not_found",
58
+ detail: `Skill "${selector}" could not be resolved`,
59
+ cause,
60
+ }))),
61
+ ];
62
+ return {
63
+ targets: names.map((name) => ({ type: "skill", name })),
64
+ };
65
+ });
66
+ /** The closures a settled skill removal becomes. */
67
+ export const planSkillUninstall = Effect.fn("UninstallExtensions.planSkills")(function* (intent) {
68
+ const ws = yield* WorkspaceMutations;
69
+ const skillManager = yield* SkillManager;
70
+ const agentRepo = yield* CodingAgentRepository;
71
+ const path = yield* Path.Path;
72
+ const retentionPolicy = makeWorkspaceRetentionPolicy(ws);
73
+ const configuredAgents = yield* agentRepo.getMaterializationAgents().pipe(Effect.mapError((cause) => installRefused({
74
+ category: "internal",
75
+ detail: "Configured agents could not be read",
76
+ cause,
77
+ })));
78
+ const resolvedAgents = yield* Effect.forEach(configuredAgents, (agent) => agent
79
+ .resolveEffectiveSkillsDir({ workspaceRoot: ws.baseDir })
80
+ .pipe(Effect.map((outcome) => ({ agentId: agent.id, outcome }))), { concurrency: "unbounded" }).pipe(Effect.mapError((cause) => installRefused({
81
+ category: "internal",
82
+ detail: "Configured skill placement could not be resolved",
83
+ cause,
84
+ })));
85
+ const installableTargets = [];
86
+ for (const { agentId, outcome } of resolvedAgents) {
87
+ if (outcome._tag === "supported") {
88
+ installableTargets.push({ agentId, targetDir: path.normalize(outcome.dir) });
89
+ }
90
+ }
91
+ const steps = yield* Effect.forEach(intent.targets, (target) => Effect.gen(function* () {
92
+ const sanitizedName = sanitizeName(target.name);
93
+ const configuredSource = skillManager.getConfiguredSource === undefined
94
+ ? Option.none()
95
+ : yield* skillManager.getConfiguredSource({ target });
96
+ const lockEntry = yield* ws
97
+ .getLockedSkill(target.name)
98
+ .pipe(Effect.catch(() => Effect.succeed(Option.none())));
99
+ const sourceTarget = skillSourceTarget(ws, path, configuredSource, lockEntry, sanitizedName);
100
+ const removedArtifact = yield* skillArtifactFromTargets({
101
+ targets: installableTargets,
102
+ workspaceRoot: ws.baseDir,
103
+ sanitizedName,
104
+ scope: ws.scope,
105
+ change: "removed",
106
+ workspaceTargets: [
107
+ { path: workspaceLockfilePath(ws.scope), change: "updated" },
108
+ { path: workspaceSettingsPath(ws.scope), change: "updated" },
109
+ sourceTarget,
110
+ ],
111
+ });
112
+ // A skill another desired route still reaches keeps its resolution,
113
+ // its package, and its projections: only the direct declaration goes.
114
+ const retainedArtifact = yield* skillArtifactFromTargets({
115
+ targets: installableTargets,
116
+ workspaceRoot: ws.baseDir,
117
+ sanitizedName,
118
+ scope: ws.scope,
119
+ change: "unchanged",
120
+ workspaceTargets: [
121
+ { path: workspaceLockfilePath(ws.scope), change: "unchanged" },
122
+ { path: workspaceSettingsPath(ws.scope), change: "updated" },
123
+ { path: sourceTarget.path, change: "unchanged" },
124
+ ],
125
+ });
126
+ const step = buildUninstallOperation(skillManager, retentionPolicy, {
127
+ target,
128
+ toStepFailure: lifecycleStepFailure,
129
+ // The settlement says what the removal withdrew, so a package
130
+ // retained for a pack — or one that was never there — is reported
131
+ // from the settlement rather than read out of a sentence.
132
+ buildArtifact: ({ settlement }) => {
133
+ if (settlement.declaration === "absent") {
134
+ return Effect.succeed({ ...removedArtifact, change: "unchanged" });
135
+ }
136
+ if (settlement.canonical === "retained-by-pack" ||
137
+ settlement.canonical === "preserved-unreadable") {
138
+ // The declaration was withdrawn, so this changed the workspace
139
+ // even though nothing on disk was deleted.
140
+ return Effect.succeed({ ...retainedArtifact, change: "updated" });
141
+ }
142
+ return Effect.succeed(removedArtifact);
143
+ },
144
+ });
145
+ return {
146
+ ...step,
147
+ artifact: removedArtifact,
148
+ };
149
+ }).pipe(Effect.mapError((cause) => installRefused({
150
+ category: "internal",
151
+ detail: `Skill uninstall planning failed for ${target.name}`,
152
+ cause,
153
+ }))), { concurrency: "unbounded" });
154
+ return {
155
+ _tag: "Plan",
156
+ name: intent.targets.length === 0
157
+ ? "Uninstall skills"
158
+ : intent.targets.length === 1
159
+ ? "Uninstall skill"
160
+ : `Uninstall ${intent.targets.length} skills`,
161
+ description: Option.none(),
162
+ jobs: [{ concurrency: 1, steps }],
163
+ };
164
+ });
165
+ //# sourceMappingURL=plan.js.map
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @experimental This API is unstable and may change without notice.
8
8
  */
9
- import { stripFileProtocol } from "../internal/fs-helpers.js";
9
+ import { stripFileProtocol } from "@agentxm/registry-client";
10
10
  // -----------------------------------------------------------------------------
11
11
  // Display Name
12
12
  // -----------------------------------------------------------------------------
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The application-supplied conversion from a lifecycle operation's typed
3
+ * failure union into the plan-step vocabulary and into display text.
4
+ *
5
+ * Error rendering is application-owned: the CLI implements this with the same
6
+ * dispatcher it uses at its output boundary, so step categories and details
7
+ * inside lifecycle plans stay byte-identical with rendered errors. Nothing in
8
+ * the channel is `unknown` — the port names the exact union a lifecycle
9
+ * operation can surface, so a new failure family is a compile error here
10
+ * rather than a silently mis-rendered step.
11
+ *
12
+ * @experimental This API is unstable and may change without notice.
13
+ */
14
+ import * as ServiceMap from "effect/Context";
15
+ import * as Effect from "effect/Effect";
16
+ import type { StepFailure } from "@agentxm/workspace-operations";
17
+ import type { ExtensionManagerFailure } from "@agentxm/extension-materialization";
18
+ import type { ExtensionResolutionFailed } from "@agentxm/extension-resolution";
19
+ import type { ExtensionLifecycleFailed } from "./errors.js";
20
+ /**
21
+ * Every failure a lifecycle operation can surface: the materialization
22
+ * families and the integration families they carry, the resolution refusal a
23
+ * configured entry's source can produce before any plan exists, plus the
24
+ * feature's own typed failure.
25
+ */
26
+ export type LifecycleFailure = ExtensionManagerFailure | ExtensionResolutionFailed | ExtensionLifecycleFailed | StepFailure;
27
+ export interface StepFailureConversionService {
28
+ /** Serialize one lifecycle failure into the plan-step vocabulary. */
29
+ readonly toStepFailure: (failure: LifecycleFailure) => StepFailure;
30
+ /** Render one failure as the detail sentence the boundary would print. */
31
+ readonly describeFailure: (failure: LifecycleFailure) => string;
32
+ /** Render one failure as the boundary envelope's `message` property. */
33
+ readonly describeFailureMessage: (failure: LifecycleFailure) => string;
34
+ }
35
+ declare const StepFailureConversion_base: ServiceMap.ServiceClass<StepFailureConversion, "@agentxm/extension-lifecycle/step-failure-conversion/StepFailureConversion", StepFailureConversionService>;
36
+ export declare class StepFailureConversion extends StepFailureConversion_base {
37
+ }
38
+ /**
39
+ * Serialize every failure of one lifecycle operation into the plan-step
40
+ * vocabulary through the application-supplied conversion.
41
+ */
42
+ export declare const withAdaptedStepFailures: <A, E extends LifecycleFailure, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, StepFailure, R | StepFailureConversion>;
43
+ export {};
44
+ //# sourceMappingURL=step-failure-conversion.d.ts.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The application-supplied conversion from a lifecycle operation's typed
3
+ * failure union into the plan-step vocabulary and into display text.
4
+ *
5
+ * Error rendering is application-owned: the CLI implements this with the same
6
+ * dispatcher it uses at its output boundary, so step categories and details
7
+ * inside lifecycle plans stay byte-identical with rendered errors. Nothing in
8
+ * the channel is `unknown` — the port names the exact union a lifecycle
9
+ * operation can surface, so a new failure family is a compile error here
10
+ * rather than a silently mis-rendered step.
11
+ *
12
+ * @experimental This API is unstable and may change without notice.
13
+ */
14
+ import * as ServiceMap from "effect/Context";
15
+ import * as Effect from "effect/Effect";
16
+ export class StepFailureConversion extends ServiceMap.Service()("@agentxm/extension-lifecycle/step-failure-conversion/StepFailureConversion") {
17
+ }
18
+ /**
19
+ * Serialize every failure of one lifecycle operation into the plan-step
20
+ * vocabulary through the application-supplied conversion.
21
+ */
22
+ export const withAdaptedStepFailures = (effect) => Effect.gen(function* () {
23
+ const conversion = yield* StepFailureConversion;
24
+ return yield* effect.pipe(Effect.mapError((failure) => conversion.toStepFailure(failure)));
25
+ });
26
+ //# sourceMappingURL=step-failure-conversion.js.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * How a lifecycle closure serializes a failure into the plan-step vocabulary.
3
+ *
4
+ * The feature owns this: a lifecycle step that failed must report the same
5
+ * category, sentence, and recovery whether the failure came from lifecycle
6
+ * policy, from the materialization machinery underneath it, from workspace
7
+ * state, or from the transaction around it. Nothing is supplied by the
8
+ * application, so a lifecycle use case carries no failure adapter in its
9
+ * requirements.
10
+ *
11
+ * Categories and detail sentences are the serialized contract of machine
12
+ * output; families that already carry their own category and fact sentence
13
+ * keep both rather than being replaced with a generic sentence.
14
+ *
15
+ * @experimental This API is unstable and may change without notice.
16
+ */
17
+ import { StepFailure } from "@agentxm/workspace-operations";
18
+ import type { LifecycleFailure } from "./step-failure-conversion.js";
19
+ /** Every failure a lifecycle closure can settle a plan step with. */
20
+ export type LifecycleStepFailure = LifecycleFailure;
21
+ /**
22
+ * Serialize one lifecycle-closure failure into the plan-step vocabulary.
23
+ *
24
+ * Families this feature or the machinery beneath it constructs are rendered
25
+ * exactly; families the kernel already serializes are delegated to it; and
26
+ * anything else carries its producer's own category and sentence through.
27
+ */
28
+ export declare const lifecycleStepFailure: (failure: LifecycleStepFailure) => StepFailure;
29
+ //# sourceMappingURL=step-failure.d.ts.map