@agentxm/workspace-operations 0.28.8 → 0.28.10
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.
|
@@ -144,9 +144,6 @@ export const acquireWorkspaceTransitionLock = (args) => Effect.gen(function* ()
|
|
|
144
144
|
const workspaceExisted = yield* fs
|
|
145
145
|
.exists(workspaceDir)
|
|
146
146
|
.pipe(Effect.mapError((cause) => new WorkspaceDirectoryError({ path: workspaceDir, step: "inspect", cause })));
|
|
147
|
-
yield* fs
|
|
148
|
-
.makeDirectory(scratchDir, { recursive: true })
|
|
149
|
-
.pipe(Effect.mapError((cause) => new TransitionLockError({ path: scratchDir, step: "create-scratch", cause })));
|
|
150
147
|
const removeEmptyScratch = fs.readDirectory(scratchDir).pipe(Effect.flatMap((entries) => entries.length === 0
|
|
151
148
|
? fs.remove(scratchDir, { recursive: true, force: false })
|
|
152
149
|
: Effect.void), Effect.ignore);
|
|
@@ -159,6 +156,12 @@ export const acquireWorkspaceTransitionLock = (args) => Effect.gen(function* ()
|
|
|
159
156
|
let waitedMillis = 0;
|
|
160
157
|
let reportedWaiting = false;
|
|
161
158
|
while (true) {
|
|
159
|
+
// The previous holder removes an empty scratch directory when it
|
|
160
|
+
// releases. Recreate it before every attempt so that a waiter can
|
|
161
|
+
// acquire after that cleanup instead of mistaking ENOENT for a hold.
|
|
162
|
+
yield* fs
|
|
163
|
+
.makeDirectory(scratchDir, { recursive: true })
|
|
164
|
+
.pipe(Effect.mapError((cause) => new TransitionLockError({ path: scratchDir, step: "create-scratch", cause })));
|
|
162
165
|
// One attempt is atomic with respect to interruption: from the library
|
|
163
166
|
// granting the hold through finalizer registration there is no
|
|
164
167
|
// interruptible gap, so an interrupt requested mid-acquisition defers
|
package/package.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"url": "https://github.com/agentxm/axm/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@agentxm/extension-model": "^0.28.
|
|
8
|
-
"@agentxm/registry-protocol": "^0.28.
|
|
9
|
-
"@agentxm/workspace-state": "^0.28.
|
|
7
|
+
"@agentxm/extension-model": "^0.28.10",
|
|
8
|
+
"@agentxm/registry-protocol": "^0.28.10",
|
|
9
|
+
"@agentxm/workspace-state": "^0.28.10",
|
|
10
10
|
"effect": "4.0.0-rc.112",
|
|
11
11
|
"proper-lockfile": "^4.1.2"
|
|
12
12
|
},
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
62
|
"type": "module",
|
|
63
|
-
"version": "0.28.
|
|
63
|
+
"version": "0.28.10"
|
|
64
64
|
}
|