@agentxm/workspace-operations 0.28.4-bootstrap.0 → 0.28.5

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.
@@ -22,8 +22,8 @@ export declare const makeWorkspaceTransactionCapabilities: MakeWorkspaceTransact
22
22
  *
23
23
  * Loads an existing workspace from disk.
24
24
  *
25
- * The workspace must already be initialized. Missing or invalid settings fail
26
- * fast with an `AppError`.
25
+ * The workspace must already be initialized. Missing or invalid settings and
26
+ * invalid or unsupported lockfiles fail fast with a typed workspace error.
27
27
  *
28
28
  * @param options - WorkspaceMutations layer options
29
29
  * @returns Effect yielding WorkspaceMutationsService
@@ -56,8 +56,8 @@ export const makeWorkspaceTransactionCapabilities = ({ workspaceDir, settingsPat
56
56
  *
57
57
  * Loads an existing workspace from disk.
58
58
  *
59
- * The workspace must already be initialized. Missing or invalid settings fail
60
- * fast with an `AppError`.
59
+ * The workspace must already be initialized. Missing or invalid settings and
60
+ * invalid or unsupported lockfiles fail fast with a typed workspace error.
61
61
  *
62
62
  * @param options - WorkspaceMutations layer options
63
63
  * @returns Effect yielding WorkspaceMutationsService
@@ -41,13 +41,60 @@ export const workspaceStateReadFailureToStepFailure = (error) => {
41
41
  cause: error,
42
42
  });
43
43
  case "LockfileIoError":
44
+ return new StepFailure({
45
+ category: "validation",
46
+ detail: `Workspace lockfile at ${error.path} could not be read`,
47
+ suggestions: [
48
+ {
49
+ description: "Repair the lockfile permissions or restore a known-good copy, then re-run.",
50
+ },
51
+ ],
52
+ cause: error,
53
+ });
44
54
  case "LockfileParseError":
55
+ return new StepFailure({
56
+ category: "validation",
57
+ detail: `Workspace lockfile at ${error.path} is not valid YAML`,
58
+ suggestions: [
59
+ {
60
+ description: "Fix the YAML syntax or restore a known-good lockfile, then re-run.",
61
+ },
62
+ ],
63
+ cause: error,
64
+ });
45
65
  case "LockfileDecodeError":
46
66
  return new StepFailure({
47
67
  category: "validation",
48
- detail: `Failed to read the workspace lockfile. Fix the file's permissions or restore it from version control, then rerun.`,
68
+ detail: `Invalid workspace lockfile at ${error.path}: ${error.issues.join("; ")}`,
69
+ suggestions: [
70
+ {
71
+ description: "Correct the invalid values or restore a lockfile written in the supported format, then re-run.",
72
+ },
73
+ ],
74
+ cause: error,
75
+ });
76
+ case "LockfileVersionUnsupported": {
77
+ const older = error.observedVersion < error.supportedVersion;
78
+ return new StepFailure({
79
+ category: "validation",
80
+ detail: older
81
+ ? `Workspace lockfile at ${error.path} declares version ${error.observedVersion}, but this AXM supports version ${error.supportedVersion}. Re-accept the workspace intent into the current format before continuing.`
82
+ : `Workspace lockfile at ${error.path} declares version ${error.observedVersion}, but this AXM supports version ${error.supportedVersion}. This workspace requires a newer AXM.`,
83
+ suggestions: older
84
+ ? [
85
+ {
86
+ description: "Preserve the incompatible lockfile outside its authoritative path, review the desired workspace intent, then remove the incompatible file.",
87
+ },
88
+ {
89
+ description: "Preview fresh resolution in the supported lockfile format.",
90
+ cmd: "axm sync --preview",
91
+ },
92
+ { description: "Apply the reviewed resolution.", cmd: "axm sync" },
93
+ ]
94
+ : [{ description: "Upgrade AXM before accessing this workspace." }],
49
95
  cause: error,
50
96
  });
97
+ }
51
98
  case "WorkspaceRootEscape":
52
99
  return new StepFailure({
53
100
  category: "internal",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentxm/workspace-operations",
3
- "version": "0.28.4-bootstrap.0",
3
+ "version": "0.28.5",
4
4
  "description": "AXM workspace operations kernel: plans, execution candidates, operation resolutions, and workspace transactions for the axm CLI. Unstable and unsupported — use the axm.sh CLI.",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-MIT",
@@ -18,14 +18,17 @@
18
18
  "exports": {
19
19
  ".": {
20
20
  "types": "./dist/src/index.d.ts",
21
+ "axm-source": "./src/index.ts",
21
22
  "default": "./dist/src/index.js"
22
23
  },
23
24
  "./live": {
24
25
  "types": "./dist/src/live.d.ts",
26
+ "axm-source": "./src/live.ts",
25
27
  "default": "./dist/src/live.js"
26
28
  },
27
29
  "./testing": {
28
30
  "types": "./dist/src/testing.d.ts",
31
+ "axm-source": "./src/testing.ts",
29
32
  "default": "./dist/src/testing.js"
30
33
  }
31
34
  },
@@ -45,9 +48,9 @@
45
48
  "dependencies": {
46
49
  "effect": "4.0.0-rc.112",
47
50
  "proper-lockfile": "^4.1.2",
48
- "@agentxm/workspace-state": "^0.28.4-bootstrap.0",
49
- "@agentxm/registry-protocol": "^0.28.4-bootstrap.0",
50
- "@agentxm/extension-model": "^0.28.4-bootstrap.0"
51
+ "@agentxm/extension-model": "^0.28.5",
52
+ "@agentxm/registry-protocol": "^0.28.5",
53
+ "@agentxm/workspace-state": "^0.28.5"
51
54
  },
52
55
  "devDependencies": {
53
56
  "@effect/platform-node": "4.0.0-rc.112",