@agentshouse/kit 0.1.0-alpha.7 → 0.1.0-alpha.8

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
@@ -10,7 +10,7 @@ On Linux `amd64` or `arm64` with a working Docker Engine, run the published,
10
10
  versioned bootstrap once:
11
11
 
12
12
  ```sh
13
- bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.7/connect-linux.sh)
13
+ bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.8/connect-linux.sh)
14
14
  ```
15
15
 
16
16
  The release asset pins one immutable multi-architecture image digest. It creates
@@ -23,6 +23,43 @@ another House and is retained in Kit home. A repeated invocation reuses the
23
23
  same container, credential and Environment; a different installed image is
24
24
  left for the explicit update journey.
25
25
 
26
+ The versioned `bootstrap.json` is the machine-readable command source for this
27
+ release. It is exported from the npm package as `@agentshouse/kit/bootstrap`
28
+ (JSON import) and published byte-for-byte beside `connect-linux.sh` in the
29
+ GitHub release. Its schema version is `1`, its `version` is the Kit package
30
+ version, and `hosts` contains only bootstrap scripts published in that release.
31
+ The package exports only the `./bootstrap` subpath; `./package.json` and source
32
+ subpaths are not exported. For this release, only `hosts.linux` exists. In this
33
+ schema example, `<version>` stands for the package's version:
34
+
35
+ ```json
36
+ {
37
+ "schemaVersion": 1,
38
+ "version": "<version>",
39
+ "hosts": {
40
+ "linux": {
41
+ "command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v<version>/connect-linux.sh)",
42
+ "asset": {
43
+ "name": "connect-linux.sh",
44
+ "url": "https://github.com/agentshouse/kit/releases/download/v<version>/connect-linux.sh"
45
+ },
46
+ "workspace": { "argument": "--workspace", "quoting": "posix" }
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ `command` is complete for the default workspace. To show a selected absolute
53
+ workspace, append the declared `workspace.argument` and the path as one POSIX
54
+ shell-quoted argument. For example, `/home/user/My Agents' House` becomes
55
+ `--workspace '/home/user/My Agents'\'' House'`. Quote the entire path before
56
+ adding it to a copyable shell command; never interpolate it as shell syntax.
57
+ The bootstrap validates an absolute workspace root and encodes it as one Docker
58
+ `--mount` CSV source field, including commas and double quotes in the name.
59
+ The package manifest contains no image digest: the release workflow
60
+ fills the immutable image digest into the published script after the package
61
+ has been built.
62
+
26
63
  The bootstrap does not install native Kit on an ordinary computer. The native
27
64
  package remains for managed Nodes and an explicitly selected eligible Kit host.
28
65
 
@@ -14,6 +14,11 @@ refuse() {
14
14
  exit 1
15
15
  }
16
16
 
17
+ bind_mount() {
18
+ local source=${1//\"/\"\"}
19
+ printf 'type=bind,"src=%s",dst=%s' "$source" "$2"
20
+ }
21
+
17
22
  while (($#)); do
18
23
  case "$1" in
19
24
  --workspace|--house)
@@ -65,6 +70,8 @@ for path in "$KIT_HOME" "$WORKSPACE"; do
65
70
  done
66
71
  KIT_HOME=$(cd "$KIT_HOME" && pwd -P)
67
72
  WORKSPACE=$(cd "$WORKSPACE" && pwd -P)
73
+ KIT_HOME_MOUNT=$(bind_mount "$KIT_HOME" /kit-home)
74
+ WORKSPACE_MOUNT=$(bind_mount "$WORKSPACE" /agents/house)
68
75
  if [[ -f "$KIT_HOME/credential" || -f "$KIT_HOME/environment" ]] && [[ ! -f "$KIT_HOME/house" ]]; then
69
76
  refuse 'stored House origin is missing for an enrolled Environment'
70
77
  fi
@@ -76,7 +83,7 @@ if [[ -f "$KIT_HOME/house" ]]; then
76
83
  HOUSE="$BOUND_HOUSE"
77
84
  fi
78
85
  [[ "$HOUSE" == https://* || "$HOUSE" == http://127.0.0.1:* || "$HOUSE" == http://localhost:* ]] || refuse 'House origin must use HTTPS or local loopback HTTP'
79
- DOCKER_RUN=(docker run --rm --network host --user "$(id -u):$(id -g)" --mount "type=bind,src=$KIT_HOME,dst=/kit-home" --mount "type=bind,src=$WORKSPACE,dst=/agents/house" --env HOME=/kit-home --env HOUSE_KIT_HOME=/kit-home --env HOUSE_KIT_CONTAINER=1 --env "HOUSE_KIT_HOSTNAME=$(hostname)" "$IMAGE")
86
+ DOCKER_RUN=(docker run --rm --network host --user "$(id -u):$(id -g)" --mount "$KIT_HOME_MOUNT" --mount "$WORKSPACE_MOUNT" --env HOME=/kit-home --env HOUSE_KIT_HOME=/kit-home --env HOUSE_KIT_CONTAINER=1 --env "HOUSE_KIT_HOSTNAME=$(hostname)" "$IMAGE")
80
87
 
81
88
  if docker container inspect "$NAME" >/dev/null 2>&1; then
82
89
  [[ "$(docker inspect --format '{{.Config.Image}}' "$NAME")" == "$IMAGE" ]] || refuse 'an installed Kit uses a different image; update it explicitly'
@@ -123,5 +130,5 @@ else
123
130
  fi
124
131
 
125
132
  "${DOCKER_RUN[@]}" apply --house "$HOUSE"
126
- docker run -d --name "$NAME" --restart unless-stopped --user "$(id -u):$(id -g)" --mount "type=bind,src=$KIT_HOME,dst=/kit-home" --mount "type=bind,src=$WORKSPACE,dst=/agents/house" --label "agentshouse.house=$HOUSE" --env HOME=/kit-home --env HOUSE_KIT_HOME=/kit-home --env HOUSE_KIT_CONTAINER=1 "$IMAGE" resident --house "$HOUSE" >/dev/null
133
+ docker run -d --name "$NAME" --restart unless-stopped --user "$(id -u):$(id -g)" --mount "$KIT_HOME_MOUNT" --mount "$WORKSPACE_MOUNT" --label "agentshouse.house=$HOUSE" --env HOME=/kit-home --env HOUSE_KIT_HOME=/kit-home --env HOUSE_KIT_CONTAINER=1 "$IMAGE" resident --house "$HOUSE" >/dev/null
127
134
  printf 'House Kit connected for Environment %s.\n' "$(cat "$KIT_HOME/environment")"
package/bootstrap.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "version": "0.1.0-alpha.8",
4
+ "hosts": {
5
+ "linux": {
6
+ "command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.8/connect-linux.sh)",
7
+ "asset": {
8
+ "name": "connect-linux.sh",
9
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.8/connect-linux.sh"
10
+ },
11
+ "workspace": {
12
+ "argument": "--workspace",
13
+ "quoting": "posix"
14
+ }
15
+ }
16
+ }
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/kit",
3
- "version": "0.1.0-alpha.7",
3
+ "version": "0.1.0-alpha.8",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,6 +11,9 @@
11
11
  "bin": {
12
12
  "kit": "bin/kit.js"
13
13
  },
14
+ "exports": {
15
+ "./bootstrap": "./bootstrap.json"
16
+ },
14
17
  "dependencies": {
15
18
  "@agentclientprotocol/sdk": "1.5.0",
16
19
  "@agentshouse/mdmodel": "0.1.0-alpha.13",