@agentxm/workspace-lint 0.28.7 → 0.28.9

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.
@@ -45,7 +45,7 @@ import { PackManifestSchema } from "@agentxm/extension-model/unstable/packs/mani
45
45
  import { MANIFEST_FILENAME as SKILL_MANIFEST_FILENAME } from "@agentxm/extension-model/unstable/skills/manifest-schema";
46
46
  import { MANIFEST_FILENAME as SUBAGENT_MANIFEST_FILENAME } from "@agentxm/extension-model/unstable/subagents/manifest-schema";
47
47
  import { readManifestJson } from "./manifest-json.js";
48
- import { toExtensionTypePlural } from "@agentxm/extension-model/unstable/extensions/common";
48
+ import { CommonManifestBaseFields, ExtensionNameSchema, ExtensionTypeSchema, toExtensionTypePlural, } from "@agentxm/extension-model/unstable/extensions/common";
49
49
  /**
50
50
  * Build the per-rule `WorkspaceRuleContext` and the flat `LintWorkspaceView`
51
51
  * via a single {@link makeWorkspaceReadModel} invocation.
@@ -131,7 +131,7 @@ const makeInstructionAccessor = (args) => Effect.gen(function* () {
131
131
  });
132
132
  const joinManifestPath = (root, filename) => root === "" || root === "." ? filename : `${root}/${filename}`;
133
133
  const buildLintWorkspaceView = (args) => Effect.gen(function* () {
134
- const [skills, packs, subagents, mcpServers, hooks, rules, knowledge] = yield* Effect.all([
134
+ const [skills, packs, subagents, mcpServers, hooks, rules, knowledge, workspaceOwner] = yield* Effect.all([
135
135
  args.readModel.skills.installed,
136
136
  args.readModel.packs.installed,
137
137
  args.readModel.subagents.installed,
@@ -139,6 +139,7 @@ const buildLintWorkspaceView = (args) => Effect.gen(function* () {
139
139
  args.readModel.hooks.installed,
140
140
  args.readModel.rules.installed,
141
141
  args.readModel.knowledge.installed,
142
+ args.readModel.owner,
142
143
  ], { concurrency: "unbounded" });
143
144
  const namedSkills = skills.flatMap((skill) => {
144
145
  const built = installedSkillToInfo(args, skill);
@@ -195,6 +196,23 @@ const buildLintWorkspaceView = (args) => Effect.gen(function* () {
195
196
  populateRuleManifestJson(namedRules),
196
197
  populateKnowledgeManifestJson(namedKnowledge, args.inspectKnowledge),
197
198
  ], { concurrency: "unbounded" });
199
+ const installedManifests = [
200
+ ...skillsWithJson.map((entry) => ({
201
+ extensionType: "skill",
202
+ name: entry.name,
203
+ manifestPath: entry.manifestPath,
204
+ manifestJson: entry.info.skillJson,
205
+ })),
206
+ ...toManifests("subagent", subagentsWithJson, (c) => c.subject.subagentJson),
207
+ ...toManifests("mcp-server", mcpServersWithJson, (c) => c.subject.mcpServerJson),
208
+ ...toManifests("hook", hooksWithJson, (c) => c.subject.hookJson),
209
+ ...toManifests("rule", rulesWithJson, (c) => c.subject.ruleJson),
210
+ ...toManifests("knowledge", knowledgeWithJson, (c) => c.subject.knowledgeJson),
211
+ ];
212
+ const manifestByMember = new Map(installedManifests.map((entry) => [
213
+ `${entry.extensionType}\u0000${entry.name}`,
214
+ entry.manifestJson,
215
+ ]));
198
216
  return {
199
217
  view: {
200
218
  installedSkills: skillsWithJson.map((entry) => entry.info),
@@ -205,42 +223,51 @@ const buildLintWorkspaceView = (args) => Effect.gen(function* () {
205
223
  ruleContexts: rulesWithJson.map((entry) => entry.context),
206
224
  knowledgeContexts: knowledgeWithJson.map((entry) => entry.context),
207
225
  },
208
- installedManifests: [
209
- ...skillsWithJson.map((entry) => ({
210
- extensionType: "skill",
211
- name: entry.name,
212
- manifestPath: entry.manifestPath,
213
- manifestJson: entry.info.skillJson,
214
- })),
215
- ...toManifests("subagent", subagentsWithJson, (c) => c.subject.subagentJson),
216
- ...toManifests("mcp-server", mcpServersWithJson, (c) => c.subject.mcpServerJson),
217
- ...toManifests("hook", hooksWithJson, (c) => c.subject.hookJson),
218
- ...toManifests("rule", rulesWithJson, (c) => c.subject.ruleJson),
219
- ...toManifests("knowledge", knowledgeWithJson, (c) => c.subject.knowledgeJson),
220
- ],
226
+ installedManifests,
221
227
  packDependencyReachability: buildPackDependencyReachability({
222
228
  packs: installedPacksWithJson.flatMap(toPackDependencyDeclaration),
223
- members: [
224
- ...skills.flatMap((entry) => memberObservation("skill", entry.resolved)),
225
- ...subagents.flatMap((entry) => memberObservation("subagent", entry.resolved)),
226
- ...mcpServers.flatMap((entry) => memberObservation("mcp-server", entry.resolved)),
227
- ...hooks.flatMap((entry) => memberObservation("hook", entry.resolved)),
228
- ...rules.flatMap((entry) => memberObservation("rule", entry.resolved)),
229
- ...knowledge.flatMap((entry) => memberObservation("knowledge", entry.resolved)),
230
- ],
229
+ members: [...skills, ...subagents, ...mcpServers, ...hooks, ...rules, ...knowledge].flatMap((entry) => memberObservation(entry, manifestByMember.get(`${entry.key.type}\u0000${entry.key.name}`), workspaceOwner)),
231
230
  }),
232
231
  };
233
232
  });
234
233
  const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
235
- const memberObservation = (extensionType, resolved) => {
234
+ const MemberIdentitySchema = Schema.Struct({
235
+ owner: CommonManifestBaseFields.owner,
236
+ version: CommonManifestBaseFields.version,
237
+ name: ExtensionNameSchema,
238
+ type: ExtensionTypeSchema,
239
+ });
240
+ const memberObservation = (installed, manifestJson, workspaceOwner) => {
241
+ const extensionType = installed.key.type;
242
+ if (installed.installationOrigin._tag === "direct" &&
243
+ installed.installationOrigin.declared.entry.source === "workspace") {
244
+ // Workspace authorship has no accepted external lock row. Its declared
245
+ // package supplies the current version; agent copies and unrelated files
246
+ // cannot become a second resolution authority.
247
+ const decoded = Schema.decodeUnknownResult(MemberIdentitySchema)(manifestJson);
248
+ if (Result.isFailure(decoded) ||
249
+ Option.isNone(workspaceOwner) ||
250
+ decoded.success.owner !== workspaceOwner.value ||
251
+ decoded.success.type !== extensionType ||
252
+ decoded.success.name !== installed.key.name)
253
+ return [];
254
+ return [
255
+ {
256
+ fqn: `${decoded.success.owner}/${toExtensionTypePlural(extensionType)}/${decoded.success.name}`,
257
+ version: decoded.success.version,
258
+ authority: "workspace",
259
+ },
260
+ ];
261
+ }
262
+ const resolved = installed.resolved;
236
263
  if (Option.isNone(resolved) || !isRecord(resolved.value.lockEntry))
237
264
  return [];
238
265
  const entry = resolved.value.lockEntry;
239
266
  const authority = entry["type"];
240
267
  const owner = entry["owner"];
241
268
  const name = entry["name"];
242
- const version = authority === "workspace" ? entry["version"] : entry["resolvedVersion"];
243
- if ((authority !== "workspace" && authority !== "registry") ||
269
+ const version = entry["resolvedVersion"];
270
+ if (authority !== "registry" ||
244
271
  typeof owner !== "string" ||
245
272
  typeof name !== "string" ||
246
273
  typeof version !== "string") {
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
1
  {
2
- "name": "@agentxm/workspace-lint",
3
- "version": "0.28.7",
4
- "description": "AXM workspace-lint feature: workspace facts, lint rules, findings, normalization, and bounded fix planning for the axm CLI. Unstable and unsupported — use the axm.sh CLI.",
5
- "type": "module",
6
- "license": "FSL-1.1-MIT",
7
- "homepage": "https://axm.sh",
2
+ "author": "AgentXM <hello@agentxm.ai> (https://agentxm.ai)",
8
3
  "bugs": {
9
4
  "url": "https://github.com/agentxm/axm/issues"
10
5
  },
11
- "author": "AgentXM <hello@agentxm.ai> (https://agentxm.ai)",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/agentxm/axm.git",
15
- "directory": "packages/workspace-lint"
6
+ "dependencies": {
7
+ "@agentxm/extension-model": "^0.28.9",
8
+ "@agentxm/extension-sources": "^0.28.9",
9
+ "@agentxm/extension-workspace": "^0.28.9",
10
+ "@agentxm/registry-protocol": "^0.28.9",
11
+ "@agentxm/workspace-operations": "^0.28.9",
12
+ "@agentxm/workspace-state": "^0.28.9",
13
+ "effect": "4.0.0-rc.112"
14
+ },
15
+ "description": "AXM workspace-lint feature: workspace facts, lint rules, findings, normalization, and bounded fix planning for the axm CLI. Unstable and unsupported — use the axm.sh CLI.",
16
+ "devDependencies": {
17
+ "@agentxm/agent-integration": "^0.28.9",
18
+ "@effect/platform-node": "4.0.0-rc.112",
19
+ "@effect/vitest": "4.0.0-rc.112",
20
+ "@types/bun": "^1.3.14",
21
+ "@typescript/native": "npm:typescript@^7.0.2",
22
+ "typescript": "npm:@typescript/typescript6@^6.0.2",
23
+ "vitest": "^4.1.10"
24
+ },
25
+ "engines": {
26
+ "node": ">=22.19.0"
16
27
  },
17
- "sideEffects": false,
18
28
  "exports": {
19
29
  ".": {
20
- "types": "./dist/src/index.d.ts",
21
30
  "axm-source": "./src/index.ts",
22
- "default": "./dist/src/index.js"
31
+ "default": "./dist/src/index.js",
32
+ "types": "./dist/src/index.d.ts"
23
33
  }
24
34
  },
25
35
  "files": [
26
36
  "dist/src/",
27
37
  "!**/*.map"
28
38
  ],
29
- "publishConfig": {
30
- "access": "public"
31
- },
32
- "engines": {
33
- "node": ">=22.19.0"
34
- },
39
+ "homepage": "https://axm.sh",
40
+ "license": "FSL-1.1-MIT",
41
+ "name": "@agentxm/workspace-lint",
35
42
  "nx": {
36
43
  "includedScripts": []
37
44
  },
38
- "dependencies": {
39
- "effect": "4.0.0-rc.112",
40
- "@agentxm/registry-protocol": "^0.28.7",
41
- "@agentxm/extension-model": "^0.28.7",
42
- "@agentxm/extension-workspace": "^0.28.7",
43
- "@agentxm/workspace-state": "^0.28.7",
44
- "@agentxm/extension-sources": "^0.28.7",
45
- "@agentxm/workspace-operations": "^0.28.7"
45
+ "publishConfig": {
46
+ "access": "public"
46
47
  },
47
- "devDependencies": {
48
- "@effect/platform-node": "4.0.0-rc.112",
49
- "@effect/vitest": "4.0.0-rc.112",
50
- "@types/bun": "^1.3.14",
51
- "@typescript/native": "npm:typescript@^7.0.2",
52
- "typescript": "npm:@typescript/typescript6@^6.0.2",
53
- "vitest": "^4.1.10",
54
- "@agentxm/agent-integration": "^0.28.7"
55
- }
56
- }
48
+ "repository": {
49
+ "directory": "packages/workspace-lint",
50
+ "type": "git",
51
+ "url": "https://github.com/agentxm/axm.git"
52
+ },
53
+ "sideEffects": false,
54
+ "type": "module",
55
+ "version": "0.28.9"
56
+ }