@agentxm/extension-lifecycle 0.29.1 → 0.29.4
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.
- package/dist/src/activation/set-activation.js +17 -4
- package/dist/src/hooks/configured-agent-outcomes-provider.d.ts +4 -4
- package/dist/src/hooks/configured-agent-outcomes-provider.js +23 -17
- package/dist/src/live.d.ts +1 -1
- package/dist/src/live.js +1 -1
- package/dist/src/mcps/operations/disable.js +1 -1
- package/dist/src/mcps/operations/enable.js +20 -35
- package/package.json +19 -18
|
@@ -188,9 +188,17 @@ export const prepareSetActivation = (request) => Effect.gen(function* () {
|
|
|
188
188
|
if (entry === undefined) {
|
|
189
189
|
return unchanged(request, request.name, `MCP server "${request.name}" is not configured`);
|
|
190
190
|
}
|
|
191
|
-
if (entry.enabled === request.enabled) {
|
|
191
|
+
if (!request.enabled && entry.enabled === request.enabled) {
|
|
192
192
|
return unchanged(request, request.name, `MCP server "${request.name}" is already ${verb}`);
|
|
193
193
|
}
|
|
194
|
+
const managers = yield* ExtensionManagers;
|
|
195
|
+
const agentOutcomes = request.enabled
|
|
196
|
+
? yield* managers["mcp-server"].configuredAgentOutcomesForEntry({
|
|
197
|
+
name: request.name,
|
|
198
|
+
entry,
|
|
199
|
+
state: "projected",
|
|
200
|
+
})
|
|
201
|
+
: [];
|
|
194
202
|
return {
|
|
195
203
|
_tag: "SetActivation",
|
|
196
204
|
type: "mcp-server",
|
|
@@ -202,7 +210,7 @@ export const prepareSetActivation = (request) => Effect.gen(function* () {
|
|
|
202
210
|
instructions: Option.none(),
|
|
203
211
|
blocked: Option.none(),
|
|
204
212
|
warning: Option.none(),
|
|
205
|
-
agentOutcomes
|
|
213
|
+
agentOutcomes,
|
|
206
214
|
};
|
|
207
215
|
}
|
|
208
216
|
case "rule": {
|
|
@@ -424,7 +432,7 @@ const dematerializeMember = (node) => Effect.gen(function* () {
|
|
|
424
432
|
workspaceRoot: ws.baseDir,
|
|
425
433
|
scope: ws.scope,
|
|
426
434
|
serverName: node.name,
|
|
427
|
-
disableOnly:
|
|
435
|
+
disableOnly: false,
|
|
428
436
|
})
|
|
429
437
|
.pipe(Effect.flatMap((outcome) => outcome._tag === "disabled" ||
|
|
430
438
|
outcome._tag === "nothing-runnable" ||
|
|
@@ -617,7 +625,12 @@ const executorStep = (candidate, kind) => {
|
|
|
617
625
|
: candidate.enabled
|
|
618
626
|
? enableMcpServer({ name: "enable-mcp-server", args: { serverName: candidate.name } })
|
|
619
627
|
: disableMcpServer({ name: "disable-mcp-server", args: { serverName: candidate.name } });
|
|
620
|
-
return {
|
|
628
|
+
return {
|
|
629
|
+
label: candidate.name,
|
|
630
|
+
readiness: "ready",
|
|
631
|
+
...(candidate.agentOutcomes.length === 0 ? {} : { agentOutcomes: candidate.agentOutcomes }),
|
|
632
|
+
run,
|
|
633
|
+
};
|
|
621
634
|
};
|
|
622
635
|
/**
|
|
623
636
|
* The step for a type whose transition this use case composes itself: the
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Extension-manager-backed implementation of the workspace-state
|
|
3
3
|
* `ConfiguredAgentOutcomesProvider` port.
|
|
4
4
|
*
|
|
5
|
-
* The plan pipeline consumes the port;
|
|
5
|
+
* The plan pipeline consumes the port; extension managers own the effective
|
|
6
6
|
* per-agent outcome facts. Only the composition root sees both, so the
|
|
7
7
|
* application wires this layer over the manager, supplying its own failure
|
|
8
8
|
* serialization so plan resolutions embed byte-identical step failures on
|
|
@@ -17,6 +17,6 @@ import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
|
17
17
|
import { NativeWriteAuthority } from "@agentxm/agent-integration";
|
|
18
18
|
import { ConfiguredAgentOutcomesProvider } from "@agentxm/workspace-state";
|
|
19
19
|
import { StepFailureConversion } from "../step-failure-conversion.js";
|
|
20
|
-
import { HookManager } from "@agentxm/extension-materialization";
|
|
21
|
-
export declare const
|
|
20
|
+
import { HookManager, McpServerManager } from "@agentxm/extension-materialization";
|
|
21
|
+
export declare const ConfiguredAgentOutcomesProviderLive: Layer.Layer<ConfiguredAgentOutcomesProvider, never, StepFailureConversion | FileSystem.FileSystem | Path.Path | NativeWriteAuthority | HttpClient.HttpClient | HookManager | McpServerManager>;
|
|
22
22
|
//# sourceMappingURL=configured-agent-outcomes-provider.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Extension-manager-backed implementation of the workspace-state
|
|
3
3
|
* `ConfiguredAgentOutcomesProvider` port.
|
|
4
4
|
*
|
|
5
|
-
* The plan pipeline consumes the port;
|
|
5
|
+
* The plan pipeline consumes the port; extension managers own the effective
|
|
6
6
|
* per-agent outcome facts. Only the composition root sees both, so the
|
|
7
7
|
* application wires this layer over the manager, supplying its own failure
|
|
8
8
|
* serialization so plan resolutions embed byte-identical step failures on
|
|
@@ -18,28 +18,34 @@ import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
|
18
18
|
import { NativeWriteAuthority } from "@agentxm/agent-integration";
|
|
19
19
|
import { ConfiguredAgentOutcomesProvider, ConfiguredAgentOutcomesUnavailable, } from "@agentxm/workspace-state";
|
|
20
20
|
import { StepFailureConversion } from "../step-failure-conversion.js";
|
|
21
|
-
import { HookManager } from "@agentxm/extension-materialization";
|
|
22
|
-
export const
|
|
21
|
+
import { HookManager, McpServerManager } from "@agentxm/extension-materialization";
|
|
22
|
+
export const ConfiguredAgentOutcomesProviderLive = Layer.effect(ConfiguredAgentOutcomesProvider, Effect.gen(function* () {
|
|
23
23
|
const adapter = yield* StepFailureConversion;
|
|
24
24
|
const hookManager = yield* HookManager;
|
|
25
|
+
const mcpServerManager = yield* McpServerManager;
|
|
25
26
|
// The provider's members answer with no requirements of their own, so this
|
|
26
27
|
// layer is the boundary that composes what the manager needs.
|
|
27
28
|
const managerLayer = Layer.mergeAll(Layer.succeed(FileSystem.FileSystem, yield* FileSystem.FileSystem), Layer.succeed(Path.Path, yield* Path.Path), Layer.succeed(HttpClient.HttpClient, yield* HttpClient.HttpClient), Layer.succeed(NativeWriteAuthority, yield* NativeWriteAuthority));
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
return
|
|
31
|
-
|
|
29
|
+
const mapFailure = (failure) => {
|
|
30
|
+
const step = adapter.toStepFailure(failure);
|
|
31
|
+
return new ConfiguredAgentOutcomesUnavailable({
|
|
32
|
+
category: step.category,
|
|
33
|
+
detail: step.detail,
|
|
34
|
+
...(step.suggestions === undefined ? {} : { suggestions: step.suggestions }),
|
|
35
|
+
...(step.cause === undefined ? {} : { cause: step.cause }),
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const configuredHookOutcomes = hookManager.configuredAgentOutcomes;
|
|
32
39
|
return {
|
|
33
40
|
byExtensionType: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})),
|
|
41
|
+
...(configuredHookOutcomes === undefined
|
|
42
|
+
? {}
|
|
43
|
+
: {
|
|
44
|
+
hook: (state) => configuredHookOutcomes(state).pipe(Effect.provide(managerLayer), Effect.mapError(mapFailure)),
|
|
45
|
+
}),
|
|
46
|
+
"mcp-server": (state) => mcpServerManager
|
|
47
|
+
.configuredAgentOutcomes(state)
|
|
48
|
+
.pipe(Effect.provide(managerLayer), Effect.mapError(mapFailure)),
|
|
43
49
|
},
|
|
44
50
|
};
|
|
45
51
|
}));
|
package/dist/src/live.d.ts
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* @experimental All exports from this module are unstable and may change without notice.
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
export {
|
|
10
|
+
export { ConfiguredAgentOutcomesProviderLive } from "./hooks/configured-agent-outcomes-provider.js";
|
|
11
11
|
//# sourceMappingURL=live.d.ts.map
|
package/dist/src/live.js
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* @experimental All exports from this module are unstable and may change without notice.
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
export {
|
|
10
|
+
export { ConfiguredAgentOutcomesProviderLive } from "./hooks/configured-agent-outcomes-provider.js";
|
|
11
11
|
//# sourceMappingURL=live.js.map
|
|
@@ -35,7 +35,7 @@ export const disableMcpServer = (op) => Effect.gen(function* () {
|
|
|
35
35
|
workspaceRoot: ws.baseDir,
|
|
36
36
|
scope: ws.scope,
|
|
37
37
|
serverName: op.args.serverName,
|
|
38
|
-
disableOnly:
|
|
38
|
+
disableOnly: false,
|
|
39
39
|
}), { concurrency: "unbounded" });
|
|
40
40
|
yield* requireSuccessfulMcpSync(op.args.serverName, agents.map((agent, index) => ({
|
|
41
41
|
agentId: agent.id,
|
|
@@ -7,8 +7,8 @@ import * as FileSystem from "effect/FileSystem";
|
|
|
7
7
|
import * as Path from "effect/Path";
|
|
8
8
|
import * as Effect from "effect/Effect";
|
|
9
9
|
import * as Option from "effect/Option";
|
|
10
|
-
import { CodingAgentRepository
|
|
11
|
-
import { NativeWriteAuthority, syncInlineMcpServerToAgents } from "@agentxm/agent-integration";
|
|
10
|
+
import { CodingAgentRepository } from "@agentxm/workspace-projection";
|
|
11
|
+
import { NativeWriteAuthority, syncInlineMcpServerToAgents, syncManifestMcpServerToAgents, } from "@agentxm/agent-integration";
|
|
12
12
|
import { normalizeHandle, parseExtensionFqnParts, } from "@agentxm/extension-model/unstable/extensions";
|
|
13
13
|
import { appendWarningsToMessage } from "@agentxm/workspace-operations";
|
|
14
14
|
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
@@ -117,37 +117,22 @@ export const enableMcpServer = (op) => Effect.gen(function* () {
|
|
|
117
117
|
const owner = trustedIdentity?.type === "mcp-server" ? trustedIdentity.owner : normalizeHandle("@local");
|
|
118
118
|
const resolvedVersion = accepted?.type === "registry" ? accepted.resolvedVersion : "0.0.0";
|
|
119
119
|
const agents = yield* agentRepo.getConfiguredAgents();
|
|
120
|
+
const agentIds = agents.map(({ id }) => id);
|
|
120
121
|
const outcomes = yield* runWorkspaceTransaction({
|
|
121
122
|
transition: Effect.gen(function* () {
|
|
122
|
-
const synced = yield*
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
apply: () => Effect.gen(function* () {
|
|
136
|
-
return yield* agent.addMcpServer({
|
|
137
|
-
workspaceRoot: ws.baseDir,
|
|
138
|
-
scope: ws.scope,
|
|
139
|
-
serverName: op.args.serverName,
|
|
140
|
-
canonicalPath,
|
|
141
|
-
owner,
|
|
142
|
-
resolvedVersion,
|
|
143
|
-
enabled: true,
|
|
144
|
-
configValues: entry.env,
|
|
145
|
-
});
|
|
146
|
-
}),
|
|
147
|
-
},
|
|
148
|
-
})));
|
|
149
|
-
yield* requireSuccessfulMcpSync(op.args.serverName, agents.map((agent, index) => ({
|
|
150
|
-
agentId: agent.id,
|
|
123
|
+
const synced = yield* syncManifestMcpServerToAgents({
|
|
124
|
+
agentIds,
|
|
125
|
+
workspaceRoot: ws.baseDir,
|
|
126
|
+
scope: ws.scope,
|
|
127
|
+
serverName: op.args.serverName,
|
|
128
|
+
canonicalPath,
|
|
129
|
+
owner,
|
|
130
|
+
resolvedVersion,
|
|
131
|
+
enabled: true,
|
|
132
|
+
configValues: entry.env,
|
|
133
|
+
});
|
|
134
|
+
yield* requireSuccessfulMcpSync(op.args.serverName, agentIds.map((agentId, index) => ({
|
|
135
|
+
agentId,
|
|
151
136
|
outcome: synced[index] ?? {
|
|
152
137
|
_tag: "failed",
|
|
153
138
|
reason: "Agent sync returned no outcome",
|
|
@@ -161,17 +146,17 @@ export const enableMcpServer = (op) => Effect.gen(function* () {
|
|
|
161
146
|
}).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path)),
|
|
162
147
|
validate: () => Effect.void,
|
|
163
148
|
});
|
|
164
|
-
const warnings = mcpSyncWarnings(op.args.serverName,
|
|
165
|
-
agentId
|
|
149
|
+
const warnings = mcpSyncWarnings(op.args.serverName, agentIds.map((agentId, index) => ({
|
|
150
|
+
agentId,
|
|
166
151
|
outcome: outcomes[index] ?? {
|
|
167
152
|
_tag: "failed",
|
|
168
153
|
reason: "Agent sync returned no outcome",
|
|
169
154
|
},
|
|
170
155
|
})));
|
|
171
|
-
const agentOutcomes =
|
|
156
|
+
const agentOutcomes = agentIds.flatMap((agentId, index) => {
|
|
172
157
|
const outcome = outcomes[index];
|
|
173
158
|
return outcome !== undefined && "targets" in outcome
|
|
174
|
-
? [{ agentId
|
|
159
|
+
? [{ agentId, targets: outcome.targets }]
|
|
175
160
|
: [];
|
|
176
161
|
});
|
|
177
162
|
return {
|
package/package.json
CHANGED
|
@@ -4,31 +4,32 @@
|
|
|
4
4
|
"url": "https://github.com/agentxm/axm/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@agentxm/agent-integration": "^0.29.
|
|
8
|
-
"@agentxm/extension-content": "^0.29.
|
|
9
|
-
"@agentxm/extension-materialization": "^0.29.
|
|
10
|
-
"@agentxm/extension-model": "^0.29.
|
|
11
|
-
"@agentxm/extension-resolution": "^0.29.
|
|
12
|
-
"@agentxm/extension-sources": "^0.29.
|
|
13
|
-
"@agentxm/registry-auth": "^0.29.
|
|
14
|
-
"@agentxm/registry-client": "^0.29.
|
|
15
|
-
"@agentxm/registry-protocol": "^0.29.
|
|
16
|
-
"@agentxm/workspace-operations": "^0.29.
|
|
17
|
-
"@agentxm/workspace-projection": "^0.29.
|
|
18
|
-
"@agentxm/workspace-state": "^0.29.
|
|
19
|
-
"@agentxm/workspace-transactions": "^0.29.
|
|
7
|
+
"@agentxm/agent-integration": "^0.29.4",
|
|
8
|
+
"@agentxm/extension-content": "^0.29.4",
|
|
9
|
+
"@agentxm/extension-materialization": "^0.29.4",
|
|
10
|
+
"@agentxm/extension-model": "^0.29.4",
|
|
11
|
+
"@agentxm/extension-resolution": "^0.29.4",
|
|
12
|
+
"@agentxm/extension-sources": "^0.29.4",
|
|
13
|
+
"@agentxm/registry-auth": "^0.29.4",
|
|
14
|
+
"@agentxm/registry-client": "^0.29.4",
|
|
15
|
+
"@agentxm/registry-protocol": "^0.29.4",
|
|
16
|
+
"@agentxm/workspace-operations": "^0.29.4",
|
|
17
|
+
"@agentxm/workspace-projection": "^0.29.4",
|
|
18
|
+
"@agentxm/workspace-state": "^0.29.4",
|
|
19
|
+
"@agentxm/workspace-transactions": "^0.29.4",
|
|
20
20
|
"@napi-rs/keyring": "^1.3.0",
|
|
21
|
-
"effect": "4.0.0-rc.
|
|
21
|
+
"effect": "4.0.0-rc.115",
|
|
22
22
|
"fflate": "^0.8.3"
|
|
23
23
|
},
|
|
24
24
|
"description": "AXM extension-lifecycle feature: install, update, uninstall, enable, and disable policy across root and type-specific command forms for the axm CLI. Unstable and unsupported — use the axm.sh CLI.",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@effect/platform-node": "4.0.0-rc.
|
|
27
|
-
"@effect/vitest": "4.0.0-rc.
|
|
26
|
+
"@effect/platform-node": "4.0.0-rc.115",
|
|
27
|
+
"@effect/vitest": "4.0.0-rc.115",
|
|
28
|
+
"@fast-check/vitest": "^0.5.0",
|
|
28
29
|
"@types/bun": "^1.3.14",
|
|
29
30
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
30
31
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
31
|
-
"vitest": "^
|
|
32
|
+
"vitest": "^5.0.0",
|
|
32
33
|
"yaml": "^2.9.0"
|
|
33
34
|
},
|
|
34
35
|
"engines": {
|
|
@@ -71,5 +72,5 @@
|
|
|
71
72
|
},
|
|
72
73
|
"sideEffects": false,
|
|
73
74
|
"type": "module",
|
|
74
|
-
"version": "0.29.
|
|
75
|
+
"version": "0.29.4"
|
|
75
76
|
}
|