@fro.bot/space-bus 0.10.0 → 0.11.0

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/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";
@@ -154,10 +154,12 @@ import {
154
154
  import { homedir } from "node:os";
155
155
  import { join } from "node:path";
156
156
  import { z as z2 } from "zod";
157
+ function rosterKey(rosterPath) {
158
+ return createHash("sha256").update(rosterPath).digest("hex").slice(0, 16);
159
+ }
157
160
  function stateDirFor(rosterPath) {
158
161
  const base = process.env["XDG_STATE_HOME"] ?? join(homedir(), ".local", "state");
159
- const hash = createHash("sha256").update(rosterPath).digest("hex").slice(0, 16);
160
- return join(base, "space-bus", hash);
162
+ return join(base, "space-bus", rosterKey(rosterPath));
161
163
  }
162
164
  function discoveryFilePath(rosterPath) {
163
165
  return join(stateDirFor(rosterPath), "discovery.json");
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(),
@@ -1,6 +1,13 @@
1
1
  import { z } from "zod";
2
2
  import { discoveryFileSchema, loopbackOk, managedSpawnConfigSchema } from "./contract";
3
3
  export { discoveryFileSchema, managedSpawnConfigSchema };
4
+ /**
5
+ * First 16 hex chars of sha256(roster path) — the shared per-roster
6
+ * identity key used by both `stateDirFor` (filesystem layout) and
7
+ * `launchd.ts`'s `serviceLabel` (launchd label/plist filename), so the two
8
+ * stay in lockstep without duplicating the hash derivation.
9
+ */
10
+ export declare function rosterKey(rosterPath: string): string;
4
11
  /**
5
12
  * Per-roster state directory: `$XDG_STATE_HOME|~/.local/state`/
6
13
  * `space-bus/<first 16 hex of sha256(absolute roster path)>/`. Keying by a
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) => {