@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
@@ -1,16 +0,0 @@
1
- /**
2
- * MCP server extension manager service.
3
- *
4
- * Implements ExtensionManager<McpServerExtensionRef>. Delegates to existing
5
- * MCP server materialization functions and workspace service methods.
6
- *
7
- * @experimental This API is unstable and may change without notice.
8
- */
9
- import * as FileSystem from "effect/FileSystem";
10
- import * as HttpClient from "effect/unstable/http/HttpClient";
11
- import * as Path from "effect/Path";
12
- import * as Layer from "effect/Layer";
13
- import { McpServerManager } from "@agentxm/extension-workspace";
14
- import { WorkspaceMutations } from "@agentxm/workspace-state";
15
- export declare const McpServerManagerLive: Layer.Layer<McpServerManager, never, WorkspaceMutations | FileSystem.FileSystem | HttpClient.HttpClient | Path.Path>;
16
- //# sourceMappingURL=manager.d.ts.map
@@ -1,247 +0,0 @@
1
- /**
2
- * MCP server extension manager service.
3
- *
4
- * Implements ExtensionManager<McpServerExtensionRef>. Delegates to existing
5
- * MCP server materialization functions and workspace service methods.
6
- *
7
- * @experimental This API is unstable and may change without notice.
8
- */
9
- import * as FileSystem from "effect/FileSystem";
10
- import * as HttpClient from "effect/unstable/http/HttpClient";
11
- import * as Path from "effect/Path";
12
- import * as Effect from "effect/Effect";
13
- import * as Layer from "effect/Layer";
14
- import * as Option from "effect/Option";
15
- import { McpConfigIoFailed, McpInstallStateMissing, McpRegistryOnlyInstall, removeMcpServerFromManifest, applyProjectionPlans, planSingletonProjection, } from "@agentxm/extension-workspace";
16
- import { McpServerManager } from "@agentxm/extension-workspace";
17
- import { configuredMcpServersToDiskRefs } from "@agentxm/extension-workspace";
18
- import { mcpRegistryResolutionKey, WorkspaceMutations } from "@agentxm/workspace-state";
19
- import { canReuseInstalledPackage } from "@agentxm/extension-workspace";
20
- import { materializeRegistryPackageWithTreeIntegrity } from "../registry-materialization.js";
21
- import { computeExtensionPathsForLayout } from "@agentxm/workspace-state";
22
- import { acceptedRegistryVersionForRef, validateExactResolvedVersion, } from "@agentxm/workspace-state";
23
- import { decodeVersionSync } from "@agentxm/extension-model/unstable/version-constraints";
24
- import { configuredRowsByName } from "@agentxm/workspace-state";
25
- import { isObservedInstalled } from "@agentxm/workspace-state";
26
- import { acceptedCanonicalObservation, prepareAcceptedCanonicalTransition, removableAcceptedCanonicalPath, } from "@agentxm/workspace-state";
27
- import { protectWorkspacePath } from "@agentxm/workspace-state";
28
- import { computeMaterializedTreeIntegrity } from "@agentxm/workspace-state";
29
- // Build lock entry from registry ref
30
- const buildMcpServerLockEntry = (ref, treeIntegrity) => ({
31
- type: "registry",
32
- sourceType: "registry",
33
- packageFormat: "agentxm",
34
- endpoint: ref.source.location,
35
- extensionType: "mcp-server",
36
- workspaceName: ref.server.name,
37
- owner: ref.owner,
38
- name: ref.name,
39
- resolvedVersion: decodeVersionSync(ref.version),
40
- integrity: Option.getOrElse(ref.integrity, () => ""),
41
- sourceName: ref.source.name,
42
- publisherBindingId: ref.publisherBindingId,
43
- treeIntegrity,
44
- });
45
- // -----------------------------------------------------------------------------
46
- // Live Layer
47
- // -----------------------------------------------------------------------------
48
- export const McpServerManagerLive = Layer.effect(McpServerManager, Effect.gen(function* () {
49
- const ws = yield* WorkspaceMutations;
50
- const fs = yield* FileSystem.FileSystem;
51
- const httpClient = yield* HttpClient.HttpClient;
52
- const path = yield* Path.Path;
53
- const baseDir = ws.baseDir;
54
- // Build a layer to provide FileSystem + Path to inner effects
55
- const fsPathLayer = Layer.mergeAll(Layer.succeed(FileSystem.FileSystem, fs), Layer.succeed(Path.Path, path), Layer.succeed(HttpClient.HttpClient, httpClient));
56
- const provide = (effect) => Effect.provide(effect, fsPathLayer);
57
- const lastTreeIntegrities = new Map();
58
- const pendingRemoval = new Map();
59
- const materializeInstall = Effect.fn("McpServerManager.materializeInstall")(function* ({ ref, force }) {
60
- if (ref.refType !== "registry") {
61
- return yield* new McpRegistryOnlyInstall({
62
- serverName: ref.server.name,
63
- refType: ref.refType,
64
- });
65
- }
66
- const registryRef = ref;
67
- const canonicalPath = computeExtensionPathsForLayout(path.join, ws.layout, registryRef, "mcps", registryRef.name).canonicalPath;
68
- const lockedEntry = yield* ws.getLockedMcpServer(mcpRegistryResolutionKey({
69
- authority: registryRef.source.location,
70
- owner: registryRef.owner,
71
- name: registryRef.server.name,
72
- }));
73
- const lockedVersion = acceptedRegistryVersionForRef(lockedEntry, registryRef);
74
- const useExisting = yield* provide(canReuseInstalledPackage({
75
- installedPath: canonicalPath,
76
- force: force === true,
77
- refVersion: registryRef.version,
78
- hasIntegrity: Option.isSome(registryRef.integrity),
79
- ...(lockedVersion === undefined ? {} : { lockedVersion }),
80
- existsFailureDetail: (target) => `Failed to check if canonical path exists: ${target}`,
81
- }));
82
- if (useExisting && Option.isSome(lockedEntry)) {
83
- const observedTree = yield* provide(computeMaterializedTreeIntegrity(canonicalPath));
84
- if (observedTree === lockedEntry.value.treeIntegrity) {
85
- lastTreeIntegrities.set(registryRef.server.name, lockedEntry.value.treeIntegrity);
86
- return;
87
- }
88
- }
89
- const materialized = yield* provide(materializeRegistryPackageWithTreeIntegrity({
90
- baseDir,
91
- destinationPath: canonicalPath,
92
- sourceLocation: registryRef.source.location,
93
- owner: registryRef.owner,
94
- type: "mcp-server",
95
- name: registryRef.name,
96
- version: registryRef.version,
97
- integrity: registryRef.integrity,
98
- messages: {
99
- integrityMismatchDetail: `Integrity mismatch for ${registryRef.name}@${registryRef.version}`,
100
- },
101
- }));
102
- lastTreeIntegrities.set(registryRef.server.name, materialized.treeIntegrity);
103
- }, Effect.asVoid);
104
- const makeMaterializeRemoval = (retainCanonical) => Effect.fn("McpServerManager.materializeRemoval")(function* ({ target }) {
105
- const graph = yield* ws.getDesiredStateGraph();
106
- const desiredNode = graph.nodes.find((node) => node.type === "mcp-server" && node.name === target.name);
107
- const closure = desiredNode === undefined || desiredNode.authority === "inline"
108
- ? undefined
109
- : graph.mcpSourceClosures.find((candidate) => candidate.identity === desiredNode.identity);
110
- const retainShared = closure !== undefined && closure.localNames.some((name) => name !== target.name);
111
- pendingRemoval.set(target.name, {
112
- ...(desiredNode === undefined || desiredNode.authority === "inline"
113
- ? {}
114
- : { resolutionKey: desiredNode.identity }),
115
- retainShared,
116
- });
117
- const configuredAgents = yield* ws.getConfiguredAgents();
118
- yield* applyProjectionPlans(configuredAgents.map((agentId) => planSingletonProjection({
119
- unitId: "mcp-server:native-config-entry",
120
- // Multiple configured agents may share one native config file.
121
- targetFile: `mcp:${target.name}:configured-agents`,
122
- contributor: target,
123
- adapter: {
124
- observe: () => Effect.succeed({
125
- unitId: "mcp-server:native-config-entry",
126
- path: `${agentId}:${target.name}`,
127
- present: true,
128
- current: false,
129
- expectedContributors: [],
130
- observedContributors: [target.name],
131
- }),
132
- apply: () => provide(removeMcpServerFromManifest(agentId, {
133
- workspaceRoot: baseDir,
134
- scope: ws.scope,
135
- serverName: target.name,
136
- })).pipe(Effect.asVoid),
137
- },
138
- })));
139
- if (retainCanonical || retainShared)
140
- return;
141
- const canonical = yield* provide(acceptedCanonicalObservation({
142
- workspace: ws,
143
- type: "mcp-server",
144
- name: target.name,
145
- }));
146
- const serverPath = removableAcceptedCanonicalPath(canonical);
147
- if (Option.isSome(serverPath)) {
148
- yield* protectWorkspacePath(serverPath.value);
149
- yield* fs.remove(serverPath.value, { recursive: true, force: true }).pipe(Effect.mapError((cause) => new McpConfigIoFailed({
150
- detail: `Failed to remove MCP server package: ${serverPath.value}`,
151
- cause,
152
- })));
153
- }
154
- }, Effect.asVoid);
155
- const materializeUninstall = makeMaterializeRemoval(false);
156
- const materializeDeactivate = makeMaterializeRemoval(true);
157
- return {
158
- type: "mcp-server",
159
- runTransaction: ws.runTransaction,
160
- isInstalled: Effect.fn("McpServerManager.isInstalled")(function* ({ target, }) {
161
- return yield* isObservedInstalled(ws, "mcp-server", target.name);
162
- }),
163
- materializeInstall,
164
- prepareSourceTransition: ({ ref }) => provide(prepareAcceptedCanonicalTransition({
165
- workspace: ws,
166
- type: "mcp-server",
167
- name: ref.server.name,
168
- ref,
169
- })),
170
- getConfiguredSource: Effect.fn("McpServerManager.getConfiguredSource")(function* ({ target, }) {
171
- const configured = yield* ws.getConfiguredMcpServerEntries();
172
- return Option.fromUndefinedOr(configured[target.name]?.source);
173
- }),
174
- isConfigured: Effect.fn("McpServerManager.isConfigured")(function* ({ target }) {
175
- const configured = yield* ws.getConfiguredMcpServerEntries();
176
- return configured[target.name] !== undefined;
177
- }),
178
- listMaterializable: Effect.fn("McpServerManager.listMaterializable")(function* () {
179
- const configured = yield* ws.records
180
- .rows("mcp-server")
181
- .pipe(Effect.map(configuredRowsByName));
182
- return yield* configuredMcpServersToDiskRefs({ fs, path, baseDir, scope: ws.scope, layout: ws.layout }, configured);
183
- }),
184
- materializeUninstall,
185
- materializeDeactivate,
186
- upsertSettingsEntry: ({ ref, versionRange, }) => {
187
- if (ref.refType !== "registry")
188
- return Effect.void.pipe(Effect.withSpan("McpServerManager.upsertSettingsEntry"));
189
- const registryRef = ref;
190
- return validateExactResolvedVersion(`mcpServers.${ref.server.name}.resolvedVersion`, registryRef.version).pipe(Effect.flatMap(() => {
191
- const treeIntegrity = lastTreeIntegrities.get(registryRef.server.name);
192
- if (treeIntegrity === undefined) {
193
- return Effect.fail(new McpInstallStateMissing({ name: registryRef.server.name }));
194
- }
195
- const lockEntry = buildMcpServerLockEntry(registryRef, treeIntegrity);
196
- return ws.setMcpServer({
197
- name: ref.server.name,
198
- resolutionKey: mcpRegistryResolutionKey({
199
- authority: registryRef.source.location,
200
- owner: registryRef.owner,
201
- name: registryRef.server.name,
202
- }),
203
- lockEntry,
204
- versionRange,
205
- });
206
- }), Effect.withSpan("McpServerManager.upsertSettingsEntry"));
207
- },
208
- removeSettingsEntry: ({ target }) => ws
209
- .removeMcpServerSettings(target.name)
210
- .pipe(Effect.withSpan("McpServerManager.removeSettingsEntry")),
211
- upsertLockfileEntry: ({ ref }) => {
212
- if (ref.refType !== "registry")
213
- return ws
214
- .removeMcpServerLock(ref.server.name)
215
- .pipe(Effect.withSpan("McpServerManager.upsertLockfileEntry"));
216
- const registryRef = ref;
217
- return validateExactResolvedVersion(`mcpServers.${ref.server.name}.resolvedVersion`, registryRef.version).pipe(Effect.flatMap(() => {
218
- const treeIntegrity = lastTreeIntegrities.get(registryRef.server.name);
219
- if (treeIntegrity === undefined) {
220
- return Effect.fail(new McpInstallStateMissing({ name: registryRef.server.name }));
221
- }
222
- const lockEntry = buildMcpServerLockEntry(registryRef, treeIntegrity);
223
- return ws.setMcpServerLock({
224
- name: ref.server.name,
225
- resolutionKey: mcpRegistryResolutionKey({
226
- authority: registryRef.source.location,
227
- owner: registryRef.owner,
228
- name: registryRef.server.name,
229
- }),
230
- lockEntry,
231
- versionRange: Option.none(),
232
- });
233
- }), Effect.withSpan("McpServerManager.upsertLockfileEntry"));
234
- },
235
- removeLockfileEntry: ({ target }) => {
236
- const removal = pendingRemoval.get(target.name);
237
- pendingRemoval.delete(target.name);
238
- if (removal?.retainShared === true || removal?.resolutionKey === undefined) {
239
- return Effect.void.pipe(Effect.withSpan("McpServerManager.removeLockfileEntry"));
240
- }
241
- return ws
242
- .removeMcpServerLock(removal.resolutionKey)
243
- .pipe(Effect.withSpan("McpServerManager.removeLockfileEntry"));
244
- },
245
- };
246
- }));
247
- //# sourceMappingURL=manager.js.map
@@ -1,24 +0,0 @@
1
- import type { AgentId } from "@agentxm/extension-model/unstable/agents/types";
2
- import type { McpServerLockEntry } from "@agentxm/workspace-state";
3
- import type { JobStepArtifact, JobStepArtifactTarget } from "@agentxm/workspace-operations";
4
- import type { WorkspaceScope } from "@agentxm/extension-model/unstable/workspace-scope";
5
- export declare const mcpConfigSurface: (scope: WorkspaceScope) => string;
6
- export declare const MCP_AGENT_CONFIG_SURFACE = ".mcp.json";
7
- export declare const mcpServerVersion: (entry: McpServerLockEntry) => string | undefined;
8
- export declare const mcpServerSourcePath: (scope: WorkspaceScope, entry: McpServerLockEntry) => string;
9
- export declare const agentConfigTarget: (change: JobStepArtifactTarget["change"], agentIds: ReadonlyArray<AgentId>) => JobStepArtifactTarget | undefined;
10
- export interface AgentMcpConfigOutcome {
11
- readonly agentId: string;
12
- readonly targets?: ReadonlyArray<JobStepArtifactTarget>;
13
- }
14
- export declare const agentConfigTargets: (outcomes: ReadonlyArray<AgentMcpConfigOutcome>) => ReadonlyArray<JobStepArtifactTarget>;
15
- export declare const mcpSettingsTarget: (scope: WorkspaceScope, change: JobStepArtifactTarget["change"]) => JobStepArtifactTarget;
16
- export declare const mcpSourceTarget: (scope: WorkspaceScope, entry: McpServerLockEntry, change: JobStepArtifactTarget["change"]) => JobStepArtifactTarget;
17
- export declare const mcpServerArtifact: (args: {
18
- readonly lockEntry: McpServerLockEntry | undefined;
19
- readonly scope: JobStepArtifact["scope"];
20
- readonly change: JobStepArtifact["change"];
21
- readonly targets: ReadonlyArray<JobStepArtifactTarget>;
22
- readonly agents?: ReadonlyArray<string>;
23
- }) => JobStepArtifact;
24
- //# sourceMappingURL=artifact.d.ts.map
@@ -1,74 +0,0 @@
1
- import { ACQUIRED_EXTENSIONS_DIR } from "@agentxm/workspace-state";
2
- import { acquiredExtensionDisplayPathFromLockEntry } from "@agentxm/workspace-state";
3
- export const mcpConfigSurface = (scope) => scope === "project"
4
- ? "axm.json / axm-lock.yaml"
5
- : ".axm/workspace/axm.json / .axm/workspace/axm-lock.yaml";
6
- export const MCP_AGENT_CONFIG_SURFACE = ".mcp.json";
7
- export const mcpServerVersion = (entry) => entry.type === "registry" ? entry.resolvedVersion : undefined;
8
- export const mcpServerSourcePath = (scope, entry) => acquiredExtensionDisplayPathFromLockEntry(scope === "project" ? ACQUIRED_EXTENSIONS_DIR : ".axm/workspace/agent_extensions", entry, "mcps", entry.workspaceName);
9
- export const agentConfigTarget = (change, agentIds) => agentIds.length === 0
10
- ? undefined
11
- : {
12
- path: MCP_AGENT_CONFIG_SURFACE,
13
- change,
14
- agentIds,
15
- };
16
- const mergeTargetChange = (current, next) => {
17
- if (current === "created" || next === "created")
18
- return "created";
19
- if (current === "updated" || next === "updated")
20
- return "updated";
21
- if (current === "removed" || next === "removed")
22
- return "removed";
23
- return "unchanged";
24
- };
25
- export const agentConfigTargets = (outcomes) => {
26
- const grouped = new Map();
27
- for (const outcome of outcomes) {
28
- for (const target of outcome.targets ?? []) {
29
- const existing = grouped.get(target.path);
30
- if (existing === undefined) {
31
- grouped.set(target.path, {
32
- path: target.path,
33
- change: target.change,
34
- agentIds: [outcome.agentId],
35
- });
36
- continue;
37
- }
38
- existing.change = mergeTargetChange(existing.change, target.change);
39
- existing.agentIds.push(outcome.agentId);
40
- }
41
- }
42
- return Array.from(grouped.values()).map((target) => ({
43
- path: target.path,
44
- change: target.change,
45
- agentIds: target.agentIds,
46
- }));
47
- };
48
- export const mcpSettingsTarget = (scope, change) => ({
49
- path: scope === "project" ? "axm.json" : ".axm/workspace/axm.json",
50
- change,
51
- });
52
- export const mcpSourceTarget = (scope, entry, change) => ({
53
- path: mcpServerSourcePath(scope, entry),
54
- change,
55
- });
56
- export const mcpServerArtifact = (args) => {
57
- const version = args.lockEntry === undefined ? undefined : mcpServerVersion(args.lockEntry);
58
- return {
59
- path: args.lockEntry === undefined
60
- ? mcpConfigSurface(args.scope)
61
- : mcpServerSourcePath(args.scope, args.lockEntry),
62
- scope: args.scope,
63
- change: args.change,
64
- ...(args.agents === undefined ? {} : { agents: args.agents }),
65
- ...(version === undefined ? {} : { version }),
66
- ...(args.targets.length === 0
67
- ? {}
68
- : {
69
- fileCount: args.targets.length,
70
- targets: args.targets,
71
- }),
72
- };
73
- };
74
- //# sourceMappingURL=artifact.js.map
@@ -1,78 +0,0 @@
1
- /**
2
- * Install MCP server executor — orchestrates the per-server installation pipeline.
3
- *
4
- * Registry-only install: fetch archive, extract to canonical path, update lockfile/settings.
5
- * Simpler than skills — no agent symlinks.
6
- *
7
- * @experimental This API is unstable and may change without notice.
8
- */
9
- import * as FileSystem from "effect/FileSystem";
10
- import type * as HttpClient from "effect/unstable/http/HttpClient";
11
- import * as Path from "effect/Path";
12
- import * as Effect from "effect/Effect";
13
- import * as Option from "effect/Option";
14
- import { CodingAgentRepository } from "@agentxm/extension-workspace";
15
- import type { StepFailure } from "@agentxm/workspace-operations";
16
- import type { JobStepResult, Operation } from "@agentxm/workspace-operations";
17
- import { WorkspaceMutations } from "@agentxm/workspace-state";
18
- import type { McpServerExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/mcp-server";
19
- import { type McpServerManifest } from "@agentxm/extension-model/unstable/mcps/manifest-schema";
20
- import { LifecycleFailureAdapter } from "../../failure-adapter.js";
21
- /**
22
- * Args for the install-mcp-server operation.
23
- */
24
- export type InstallMcpServerOperationArgs = {
25
- readonly ref: McpServerExtensionRef;
26
- /** Local connection identity and exact agent-native MCP key. */
27
- readonly localName?: string;
28
- readonly force: boolean;
29
- /** Explicitly permit a workspace-authored relocation during reconciliation. */
30
- readonly allowWorkspaceSourceTransition?: boolean;
31
- readonly versionRange: Option.Option<string>;
32
- /** When true, write to lockfile only (skip settings). Used for pack dependencies. */
33
- readonly skipSettings: Option.Option<boolean>;
34
- /** Materialize only; the enclosing authored-package transaction owns state writes. */
35
- readonly skipStateWrites?: boolean;
36
- /** When true, enforce strict policy for MCP sync outcomes. */
37
- readonly strictAgentSync?: Option.Option<boolean>;
38
- /** Resolved MCP input values from `--env KEY=VALUE` flags. */
39
- readonly env?: Option.Option<Readonly<Record<string, string>>>;
40
- /**
41
- * Whether the invoking surface can prompt for missing required inputs.
42
- * The transport boundary resolves flag, CI, and TTY state.
43
- */
44
- readonly nonInteractive: boolean;
45
- };
46
- /**
47
- * Add an MCP server to the workspace.
48
- *
49
- * @experimental This API is unstable and may change without notice.
50
- */
51
- export type InstallMcpServerOperation = Operation<"install-mcp-server", InstallMcpServerOperationArgs>;
52
- export declare const mcpSecretAccount: (args: {
53
- readonly scopeRoot: string;
54
- readonly localName: string;
55
- readonly sourceIdentity: string;
56
- readonly inputName: string;
57
- }) => string;
58
- export type McpSecretDeletionOutcome = {
59
- readonly _tag: "deleted";
60
- readonly inputName: string;
61
- } | {
62
- readonly _tag: "absent";
63
- readonly inputName: string;
64
- } | {
65
- readonly _tag: "failed";
66
- readonly inputName: string;
67
- };
68
- export declare const collectSecretInputNames: (manifest: McpServerManifest) => ReadonlySet<string>;
69
- export declare const readMcpServerManifest: (canonicalPath: string) => Effect.Effect<Option.Option<McpServerManifest>, never, FileSystem.FileSystem | Path.Path>;
70
- export declare const deleteMcpSecrets: (identity: Omit<Parameters<typeof mcpSecretAccount>[0], "inputName">, secretNames: ReadonlySet<string>) => Effect.Effect<ReadonlyArray<McpSecretDeletionOutcome>>;
71
- /**
72
- * Install-mcp-server operation handler.
73
- *
74
- * Registry-only: fetch archive, validate integrity, extract to canonical path,
75
- * then update lockfile/settings.
76
- */
77
- export declare const installMcpServer: (op: InstallMcpServerOperation) => Effect.Effect<JobStepResult, StepFailure, FileSystem.FileSystem | HttpClient.HttpClient | Path.Path | WorkspaceMutations | CodingAgentRepository | LifecycleFailureAdapter>;
78
- //# sourceMappingURL=install.d.ts.map