bostrat-node 0.0.1 → 0.2.1

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/fix-pty.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ // bostrat-node postinstall. node-pty@1.1.0's registry tarball ships the darwin
3
+ // prebuilt `spawn-helper` WITHOUT the exec bit and its own post-install never
4
+ // chmods it → every prebuilt-path macOS install dies with "posix_spawnp
5
+ // failed" (found by the first laptop dogfood, 2026-07-21). Best-effort: doctor's
6
+ // node-pty load-and-spawn check is the authority, and it prints the manual
7
+ // chmod when this didn't run (--ignore-scripts).
8
+ import { createRequire } from "node:module";
9
+ import fs from "node:fs";
10
+ import path from "node:path";
11
+
12
+ try {
13
+ // argv[2] (tests): an explicit node-pty root; default: resolve our dependency.
14
+ const root = process.argv[2] || path.dirname(createRequire(import.meta.url).resolve("node-pty/package.json"));
15
+ const prebuilds = path.join(root, "prebuilds");
16
+ for (const dir of fs.readdirSync(prebuilds)) {
17
+ const helper = path.join(prebuilds, dir, "spawn-helper");
18
+ if (fs.existsSync(helper)) fs.chmodSync(helper, 0o755);
19
+ }
20
+ } catch {
21
+ // no prebuilds dir (Linux source build) or node-pty not installed yet — fine
22
+ }
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ # bostrat node boot: first-boot volume layout, then hand off to the CLI.
3
+ # Everything under $HOME sits on the Fly volume (see node.Dockerfile).
4
+ set -e
5
+ mkdir -p "$HOME/repos"
6
+ # Boxes commit as they work; give git an identity on first boot only — the
7
+ # operator can overwrite it (it persists in $HOME/.gitconfig on the volume).
8
+ git config --global user.name >/dev/null 2>&1 || git config --global user.name "bostrat node"
9
+ git config --global user.email >/dev/null 2>&1 || git config --global user.email "node@bostrat.ai"
10
+ # The agent drives boxes on a host tmux server (the Pi's globo-tmux.service
11
+ # equivalent): keep one alive with a detached keeper session.
12
+ SOCKET="${BOSTRAT_TMUX_SOCKET:-/tmp/tmux-0/default}"
13
+ mkdir -p "$(dirname "$SOCKET")"
14
+ tmux -S "$SOCKET" has-session 2>/dev/null || tmux -S "$SOCKET" new-session -d -s keeper "sleep infinity"
15
+ # Global-install layout (the GHCR image / npm -g) has bostrat-node on PATH;
16
+ # staged repo-context builds (`bostrat-node fly` wizard) run the tree copy.
17
+ if command -v bostrat-node >/dev/null 2>&1; then
18
+ exec bostrat-node run
19
+ else
20
+ exec node /app/agent/bin/bostrat-node.js run
21
+ fi
package/package.json CHANGED
@@ -1,8 +1,25 @@
1
1
  {
2
2
  "name": "bostrat-node",
3
- "version": "0.0.1",
4
- "description": "Bostrat node runtime installer placeholder. The published runtime lands with plane P2. https://bostrat.ai",
5
- "bin": { "bostrat-node": "cli.js" },
6
- "license": "SEE LICENSE AT https://bostrat.ai",
7
- "files": ["cli.js"]
3
+ "version": "0.2.1",
4
+ "description": "Bostrat node — the box runtime that dials out to your Bostrat coordination plane. https://bostrat.ai",
5
+ "license": "SEE LICENSE IN LICENSE.md",
6
+ "type": "module",
7
+ "bin": {
8
+ "bostrat-node": "bin/bostrat-node.js"
9
+ },
10
+ "scripts": {
11
+ "postinstall": "node fix-pty.js"
12
+ },
13
+ "dependencies": {
14
+ "express": "4.22.2",
15
+ "node-pty": "1.1.0",
16
+ "playwright-core": "1.61.1",
17
+ "ws": "8.21.0"
18
+ },
19
+ "engines": {
20
+ "node": ">=22.5.0"
21
+ },
22
+ "allowScripts": {
23
+ "node-pty@1.1.0": true
24
+ }
8
25
  }
package/cli.js DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- console.log("bostrat-node: this is a placeholder release reserving the package name.");
3
- console.log("The installable node runtime ships with Bostrat plane P2.");
4
- console.log("Until then, follow the setup steps at https://bostrat.ai");