@agentxm/workspace-state 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.
|
@@ -8,7 +8,7 @@ import { ACQUIRED_EXTENSIONS_DIR, AXM_DIR_NAME, LOCK_FILENAME, USER_WORKSPACE_DI
|
|
|
8
8
|
import { makeAbsolutePath } from "@agentxm/extension-model/unstable/path-types";
|
|
9
9
|
import { SETTINGS_FILENAME } from "@agentxm/extension-model/unstable/workspace-files";
|
|
10
10
|
export { AXM_DIR_NAME, USER_WORKSPACE_DIRECTORY } from "./constants.js";
|
|
11
|
-
const axmUserHomeConfig = Config.option(Config.
|
|
11
|
+
const axmUserHomeConfig = Config.option(Config.String("AXM_USER_HOME"));
|
|
12
12
|
export const resolveUserHomePure = (configuredHome) => configuredHome ?? os.homedir();
|
|
13
13
|
export const resolveUserAxmHomePure = (pathJoin, homeDir) => pathJoin(homeDir, AXM_DIR_NAME);
|
|
14
14
|
export const resolveUserWorkspaceRootPure = (pathJoin, homeDir) => pathJoin(resolveUserAxmHomePure(pathJoin, homeDir), USER_WORKSPACE_DIRECTORY);
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
* composes the builder output with the real (Phase 9) Live layer; in
|
|
28
28
|
* Phase 5 it falls back to a `Layer.fail` placeholder.
|
|
29
29
|
*/
|
|
30
|
+
import * as ByteSize from "effect/ByteSize";
|
|
30
31
|
import * as Data from "effect/Data";
|
|
31
32
|
import * as Effect from "effect/Effect";
|
|
32
33
|
import * as FileSystem from "effect/FileSystem";
|
|
@@ -207,7 +208,7 @@ const makeInMemoryFs = (files) => {
|
|
|
207
208
|
uid: Option.none(),
|
|
208
209
|
gid: Option.none(),
|
|
209
210
|
rdev: Option.none(),
|
|
210
|
-
size:
|
|
211
|
+
size: ByteSize.bytes(0),
|
|
211
212
|
blksize: Option.none(),
|
|
212
213
|
blocks: Option.none(),
|
|
213
214
|
});
|
|
@@ -225,7 +226,7 @@ const makeInMemoryFs = (files) => {
|
|
|
225
226
|
uid: Option.none(),
|
|
226
227
|
gid: Option.none(),
|
|
227
228
|
rdev: Option.none(),
|
|
228
|
-
size:
|
|
229
|
+
size: ByteSize.bytes(0),
|
|
229
230
|
blksize: Option.none(),
|
|
230
231
|
blocks: Option.none(),
|
|
231
232
|
});
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
import * as Effect from "effect/Effect";
|
|
25
25
|
import * as Option from "effect/Option";
|
|
26
26
|
import * as Schema from "effect/Schema";
|
|
27
|
-
import { parse } from "jsonc-parser";
|
|
27
|
+
import { parse as parseJson } from "jsonc-parser";
|
|
28
|
+
import { parse as parseToml } from "smol-toml";
|
|
29
|
+
import { parse as parseYaml } from "yaml";
|
|
28
30
|
import { getHome } from "../../../utils/environment.js";
|
|
29
31
|
import { AGENTS } from "@agentxm/extension-model/unstable/agents/registry";
|
|
30
32
|
import { CONFIGURABLE_AGENTS_BY_ID, } from "@agentxm/extension-model/unstable/agent-capabilities";
|
|
@@ -61,7 +63,18 @@ const extractServers = (decoded, serversKey) => !isRecord(decoded[serversKey])
|
|
|
61
63
|
const decodedName = decodeExtensionNameOption(name);
|
|
62
64
|
return Option.isNone(decodedName) ? [] : [{ name: decodedName.value, config }];
|
|
63
65
|
});
|
|
64
|
-
const
|
|
66
|
+
const parseMcpConfig = (raw, format) => {
|
|
67
|
+
if (format === "toml")
|
|
68
|
+
return parseToml(raw);
|
|
69
|
+
if (format === "yaml")
|
|
70
|
+
return parseYaml(raw);
|
|
71
|
+
const errors = [];
|
|
72
|
+
const value = parseJson(raw, errors, { allowTrailingComma: true });
|
|
73
|
+
if (errors.length > 0)
|
|
74
|
+
throw errors;
|
|
75
|
+
return value;
|
|
76
|
+
};
|
|
77
|
+
const readMcpConfig = (fs, diagnostics, filePath, format) => Effect.gen(function* () {
|
|
65
78
|
const exists = yield* Effect.result(fs.exists(filePath));
|
|
66
79
|
if (exists._tag === "Failure") {
|
|
67
80
|
yield* diagnostics.append({
|
|
@@ -85,19 +98,13 @@ const readMcpConfig = (fs, diagnostics, filePath) => Effect.gen(function* () {
|
|
|
85
98
|
return Option.none();
|
|
86
99
|
}
|
|
87
100
|
const parsed = yield* Effect.result(Effect.try({
|
|
88
|
-
try: () =>
|
|
89
|
-
const errors = [];
|
|
90
|
-
const value = parse(read.success, errors, { allowTrailingComma: true });
|
|
91
|
-
if (errors.length > 0)
|
|
92
|
-
throw errors;
|
|
93
|
-
return value;
|
|
94
|
-
},
|
|
101
|
+
try: () => parseMcpConfig(read.success, format),
|
|
95
102
|
catch: (cause) => ({ cause }),
|
|
96
103
|
}));
|
|
97
104
|
if (parsed._tag === "Failure") {
|
|
98
105
|
yield* diagnostics.append({
|
|
99
106
|
source: "scanner",
|
|
100
|
-
message: `${SCANNER_NAME}: cannot parse
|
|
107
|
+
message: `${SCANNER_NAME}: cannot parse ${format.toUpperCase()} at ${filePath}`,
|
|
101
108
|
path: filePath,
|
|
102
109
|
code: "scanner-parse",
|
|
103
110
|
});
|
|
@@ -115,11 +122,11 @@ const readMcpConfig = (fs, diagnostics, filePath) => Effect.gen(function* () {
|
|
|
115
122
|
}
|
|
116
123
|
return Option.some(decoded.success);
|
|
117
124
|
});
|
|
118
|
-
const readMcpConfigCached = (cache, fs, diagnostics, filePath) => {
|
|
125
|
+
const readMcpConfigCached = (cache, fs, diagnostics, filePath, format) => {
|
|
119
126
|
const existing = cache.get(filePath);
|
|
120
127
|
if (existing !== undefined)
|
|
121
128
|
return Effect.succeed(existing);
|
|
122
|
-
return readMcpConfig(fs, diagnostics, filePath).pipe(Effect.tap((decoded) => Effect.sync(() => {
|
|
129
|
+
return readMcpConfig(fs, diagnostics, filePath, format).pipe(Effect.tap((decoded) => Effect.sync(() => {
|
|
123
130
|
cache.set(filePath, decoded);
|
|
124
131
|
})));
|
|
125
132
|
};
|
|
@@ -183,7 +190,7 @@ const scanMcpSurface = (deps, plan, cache) => Effect.gen(function* () {
|
|
|
183
190
|
const filePathOpt = yield* resolveMcpConfigTargetPath(deps, plan.target);
|
|
184
191
|
if (Option.isNone(filePathOpt))
|
|
185
192
|
return [];
|
|
186
|
-
const decoded = yield* readMcpConfigCached(cache, fs, diagnostics, filePathOpt.value);
|
|
193
|
+
const decoded = yield* readMcpConfigCached(cache, fs, diagnostics, filePathOpt.value, plan.target.format);
|
|
187
194
|
if (Option.isNone(decoded))
|
|
188
195
|
return [];
|
|
189
196
|
const servers = extractServers(decoded.value, plan.serversKey);
|
|
@@ -79,7 +79,11 @@ export const makeReadModelRecordReaders = (args) => {
|
|
|
79
79
|
lifecycle: row.installationOrigin._tag === "direct" ? "configured" : "implicit",
|
|
80
80
|
enabled: row.activation === "enabled",
|
|
81
81
|
installed: row.actual.length > 0,
|
|
82
|
-
agents:
|
|
82
|
+
agents: row.key.type === "mcp-server"
|
|
83
|
+
? defaultAgents
|
|
84
|
+
: observedAgents.length === 0
|
|
85
|
+
? defaultAgents
|
|
86
|
+
: observedAgents,
|
|
83
87
|
origins: observations.origins,
|
|
84
88
|
paths: observations.paths,
|
|
85
89
|
};
|
package/package.json
CHANGED
|
@@ -4,25 +4,27 @@
|
|
|
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-model": "^0.29.
|
|
10
|
-
"@agentxm/registry-protocol": "^0.29.
|
|
11
|
-
"@agentxm/workspace-transactions": "^0.29.
|
|
12
|
-
"effect": "4.0.0-rc.
|
|
7
|
+
"@agentxm/agent-integration": "^0.29.4",
|
|
8
|
+
"@agentxm/extension-content": "^0.29.4",
|
|
9
|
+
"@agentxm/extension-model": "^0.29.4",
|
|
10
|
+
"@agentxm/registry-protocol": "^0.29.4",
|
|
11
|
+
"@agentxm/workspace-transactions": "^0.29.4",
|
|
12
|
+
"effect": "4.0.0-rc.115",
|
|
13
13
|
"jsonc-parser": "^3.3.1",
|
|
14
14
|
"semver": "^7.8.5",
|
|
15
|
+
"smol-toml": "1.6.1",
|
|
15
16
|
"yaml": "^2.9.0"
|
|
16
17
|
},
|
|
17
18
|
"description": "AXM workspace state kernel: settings, lockfile, read model, and desired-state vocabulary for the axm CLI. Unstable and unsupported — use the axm.sh CLI.",
|
|
18
19
|
"devDependencies": {
|
|
19
|
-
"@agentxm/specification-metadata": "^0.29.
|
|
20
|
-
"@effect/platform-node": "4.0.0-rc.
|
|
21
|
-
"@effect/vitest": "4.0.0-rc.
|
|
20
|
+
"@agentxm/specification-metadata": "^0.29.4",
|
|
21
|
+
"@effect/platform-node": "4.0.0-rc.115",
|
|
22
|
+
"@effect/vitest": "4.0.0-rc.115",
|
|
23
|
+
"@fast-check/vitest": "^0.5.0",
|
|
22
24
|
"@types/semver": "^7.7.1",
|
|
23
25
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
24
26
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
25
|
-
"vitest": "^
|
|
27
|
+
"vitest": "^5.0.0"
|
|
26
28
|
},
|
|
27
29
|
"engines": {
|
|
28
30
|
"node": ">=22.19.0"
|
|
@@ -64,5 +66,5 @@
|
|
|
64
66
|
},
|
|
65
67
|
"sideEffects": false,
|
|
66
68
|
"type": "module",
|
|
67
|
-
"version": "0.29.
|
|
69
|
+
"version": "0.29.4"
|
|
68
70
|
}
|