@agentshouse/kit 0.1.0-alpha.41 → 0.1.0-alpha.42

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/README.md CHANGED
@@ -13,13 +13,13 @@ The Skill set Kit installs is Matt Pocock's
13
13
  Linux (`amd64`, `arm64`) or macOS (Apple silicon, Intel):
14
14
 
15
15
  ```sh
16
- bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.41/connect-linux.sh)
16
+ bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.42/connect-linux.sh)
17
17
  ```
18
18
 
19
19
  Windows 11 (`amd64`), in PowerShell:
20
20
 
21
21
  ```powershell
22
- & ([scriptblock]::Create((irm https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.41/connect-windows.ps1)))
22
+ & ([scriptblock]::Create((irm https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.42/connect-windows.ps1)))
23
23
  ```
24
24
 
25
25
  The command sets up Docker if it is missing, creates `~/.house-kit` (Kit home;
package/bootstrap.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "0.1.0-alpha.41",
3
+ "version": "0.1.0-alpha.42",
4
4
  "hosts": {
5
5
  "linux": {
6
- "command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.41/connect-linux.sh)",
6
+ "command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.42/connect-linux.sh)",
7
7
  "asset": {
8
8
  "name": "connect-linux.sh",
9
- "url": "https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.41/connect-linux.sh"
9
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.42/connect-linux.sh"
10
10
  },
11
11
  "workspace": {
12
12
  "argument": "--workspace",
@@ -14,10 +14,10 @@
14
14
  }
15
15
  },
16
16
  "windows": {
17
- "command": "& ([scriptblock]::Create((irm https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.41/connect-windows.ps1)))",
17
+ "command": "& ([scriptblock]::Create((irm https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.42/connect-windows.ps1)))",
18
18
  "asset": {
19
19
  "name": "connect-windows.ps1",
20
- "url": "https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.41/connect-windows.ps1"
20
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.42/connect-windows.ps1"
21
21
  },
22
22
  "workspace": {
23
23
  "argument": "--workspace",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/kit",
3
- "version": "0.1.0-alpha.41",
3
+ "version": "0.1.0-alpha.42",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
package/src/workspace.js CHANGED
@@ -401,7 +401,7 @@ async function placeReplacement(host, settings, identity, held, running) {
401
401
  }
402
402
 
403
403
  async function rollBack(host, identity, running, cause) {
404
- const unrestored = await restorePrevious(host, identity);
404
+ const unrestored = await restorePrevious(host, identity, true);
405
405
  if (unrestored !== null) return `${cause}, and ${unrestored}`;
406
406
  if (!running) return cause;
407
407
  const restarted = await docker(host, ["start", identity]);
@@ -409,10 +409,16 @@ async function rollBack(host, identity, running, cause) {
409
409
  return `${cause}, and the workspace did not start again: ${restarted.stderr.trim()}`;
410
410
  }
411
411
 
412
- async function restorePrevious(host, identity) {
412
+ async function restorePrevious(host, identity, rollingBack = false) {
413
413
  const previous = previousName(identity);
414
414
  if ((await workspacePresent(host, previous)) === null) return null;
415
- if ((await workspacePresent(host, identity)) !== null) {
415
+ const current = await workspacePresent(host, identity);
416
+ if (current === "running" && !rollingBack) {
417
+ const removed = await docker(host, ["rm", "--force", previous]);
418
+ if (removed.status !== 0) return `the previous workspace was not removed: ${removed.stderr.trim()}`;
419
+ return null;
420
+ }
421
+ if (current !== null) {
416
422
  const discarded = await docker(host, ["rm", "--force", identity]);
417
423
  if (discarded.status !== 0) {
418
424
  return `the replacement was not removed: ${discarded.stderr.trim()}`;