@fro.bot/space-bus 0.9.0 → 0.10.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/README.md CHANGED
@@ -104,7 +104,7 @@ MCP is attach-only by default — it never spawns. Set `SPACE_BUS_MCP_SPAWN=1` i
104
104
 
105
105
  Security posture: each spawn gets a freshly generated password (never reused, never in argv, never logged); the loopback guard travels with the discovery handshake, so an attached endpoint is re-validated as localhost-only regardless of source. Same-user process compromise is out of scope — anyone who can read your state dir or ptrace the child already has what they need.
106
106
 
107
- Programmatic consumers (e.g. Mothership) that want to drive the lifecycle directly without the CLI can import `@fro.bot/space-bus/server` (Node-only; `ensureServer`/`serverStatus`/`stopServer`).
107
+ Programmatic consumers (e.g. Mothership) that want to drive the lifecycle directly without the CLI can import `@fro.bot/space-bus/managed-server` (Node-only; `ensureServer`/`serverStatus`/`stopServer`).
108
108
 
109
109
  ## Library surface
110
110
 
@@ -114,7 +114,7 @@ Experimental subpath exports expose the bus's internals directly — the functio
114
114
  - `@fro.bot/space-bus/config` — Node-only. `loadContext(directory?)` reads `spacebus.json` (honoring `SPACE_BUS_CONFIG` the same as the plugin) and returns a ready-to-use `BusContext`, with per-project `exists` flags and env-derived credentials attached. Build a fresh context per call; it's per-call/short-lived by contract, not meant to be cached across filesystem changes.
115
115
  - `@fro.bot/space-bus/contract` — the zod schemas (and inferred types) behind the OpenCode API and `BusContext`, for consumers hitting the server directly and wanting the same shapes. Schemas are zod v4.
116
116
  - `@fro.bot/space-bus/format` — the pure formatters the tools use to render output, for tool-identical text.
117
- - `@fro.bot/space-bus/server` — Node-only. The managed-server lifecycle (`ensureServer`/`serverStatus`/`stopServer`) for consumers driving spawn/attach/stop directly — see [Managed server](#managed-server).
117
+ - `@fro.bot/space-bus/managed-server` — Node-only. The managed-server lifecycle (`ensureServer`/`serverStatus`/`stopServer`) for consumers driving spawn/attach/stop directly — see [Managed server](#managed-server).
118
118
  - `@fro.bot/space-bus/attach` — browser-safe. `resolveManagedServer(workspaceDir, seams)` resolves a managed roster's running endpoint by reading the discovery file through injected filesystem/env/crypto seams — re-checking the localhost guard and probing liveness — so an external attacher such as a Tauri webview can attach without any `node:*` imports or reimplementing the discovery contract. Returns `{ baseUrl, credentials, alive }` or an actionable error.
119
119
 
120
120
  Node example (`/config` + `/core`):
package/dist/cli.js CHANGED
@@ -2,6 +2,12 @@
2
2
  import { createRequire } from "node:module";
3
3
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
4
4
 
5
+ // src/config.ts
6
+ import { existsSync, readFileSync as readFileSync2, realpathSync } from "node:fs";
7
+ import { homedir as homedir2 } from "node:os";
8
+ import { join as join2 } from "node:path";
9
+ import { z as z3 } from "zod";
10
+
5
11
  // src/contract.ts
6
12
  import { z } from "zod";
7
13
  var sessionSchema = z.looseObject({
@@ -131,12 +137,6 @@ var discoveryFileSchema = z.object({
131
137
  baseUrl: z.url()
132
138
  });
133
139
 
134
- // src/config.ts
135
- import { existsSync, readFileSync as readFileSync2, realpathSync } from "node:fs";
136
- import { homedir as homedir2 } from "node:os";
137
- import { join as join2 } from "node:path";
138
- import { z as z3 } from "zod";
139
-
140
140
  // src/discovery.ts
141
141
  import { execFileSync } from "node:child_process";
142
142
  import { createHash, randomBytes } from "node:crypto";
package/dist/config.js CHANGED
@@ -1,6 +1,12 @@
1
1
  import { createRequire } from "node:module";
2
2
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
3
 
4
+ // src/config.ts
5
+ import { existsSync, readFileSync as readFileSync2, realpathSync } from "node:fs";
6
+ import { homedir as homedir2 } from "node:os";
7
+ import { join as join2 } from "node:path";
8
+ import { z as z3 } from "zod";
9
+
4
10
  // src/contract.ts
5
11
  import { z } from "zod";
6
12
  var sessionSchema = z.looseObject({
@@ -130,12 +136,6 @@ var discoveryFileSchema = z.object({
130
136
  baseUrl: z.url()
131
137
  });
132
138
 
133
- // src/config.ts
134
- import { existsSync, readFileSync as readFileSync2, realpathSync } from "node:fs";
135
- import { homedir as homedir2 } from "node:os";
136
- import { join as join2 } from "node:path";
137
- import { z as z3 } from "zod";
138
-
139
139
  // src/discovery.ts
140
140
  import { execFileSync } from "node:child_process";
141
141
  import { createHash, randomBytes } from "node:crypto";
package/dist/contract.js CHANGED
@@ -1,6 +1,3 @@
1
- import { createRequire } from "node:module";
2
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
-
4
1
  // src/contract.ts
5
2
  import { z } from "zod";
6
3
  var sessionSchema = z.looseObject({
package/dist/core.js CHANGED
@@ -1,6 +1,3 @@
1
- import { createRequire } from "node:module";
2
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
-
4
1
  // src/contract.ts
5
2
  import { z } from "zod";
6
3
  var sessionSchema = z.looseObject({
@@ -90,13 +87,6 @@ var LOOPBACK_HOSTS = new Set([
90
87
  "[::1]",
91
88
  "localhost"
92
89
  ]);
93
- function loopbackOk(baseUrl) {
94
- try {
95
- return LOOPBACK_HOSTS.has(new URL(baseUrl).hostname);
96
- } catch {
97
- return false;
98
- }
99
- }
100
90
  var projectSchema = z.looseObject({
101
91
  name: z.string(),
102
92
  path: z.string(),
package/dist/format.js CHANGED
@@ -1,6 +1,3 @@
1
- import { createRequire } from "node:module";
2
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
-
4
1
  // src/format.ts
5
2
  function formatRoster(projects) {
6
3
  return projects.map((p) => {