@bom0792/herdgate 0.9.13 → 0.9.14

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.
@@ -21,7 +21,7 @@
21
21
 
22
22
  import { View, div } from "gpui-kit";
23
23
  import { v_flex, h_flex, InputState, Input } from "gpui-base";
24
- import { exec, appHome, readTextFile, notify, theme, props } from "herdr";
24
+ import { exec, appHome, readTextFile, notify, theme, props, window } from "herdr";
25
25
 
26
26
  const BASE = `${appHome()}/herdgate`;
27
27
  const SETTINGS = `${BASE}/settings.json`;
@@ -84,6 +84,9 @@ export default class Herdgate extends View {
84
84
  this.busy = { pair: false, publish: false, approve: false, save: false };
85
85
  this.notified = false;
86
86
 
87
+ this.isWindows = false;
88
+ try { this.isWindows = window()?.platform === "windows"; } catch { /* window() unavailable this early */ }
89
+
87
90
  this.cloudInput = InputState.new({ placeholder: "https://herd.example.com" });
88
91
  this.rootInput = InputState.new({ placeholder: "set by `npx @bom0792/herdgate setup-host`" });
89
92
  this.nameInput = InputState.new({ placeholder: "this-machine" });
@@ -270,6 +273,12 @@ export default class Herdgate extends View {
270
273
  }
271
274
 
272
275
  startPublisher(cx) {
276
+ if (this.isWindows) {
277
+ this.phase = "error";
278
+ this.message = "publishing this machine needs Linux/macOS for now (Windows host is coming) — pairing and approving below still work";
279
+ cx.notify();
280
+ return;
281
+ }
273
282
  if (!this.paired) {
274
283
  this.phase = "error";
275
284
  this.message = "pair this machine first";
@@ -314,6 +323,12 @@ export default class Herdgate extends View {
314
323
  }
315
324
 
316
325
  stopPublisher(cx) {
326
+ if (this.isWindows) {
327
+ this.phase = "error";
328
+ this.message = "no publisher can be running here (Windows host is coming)";
329
+ cx.notify();
330
+ return;
331
+ }
317
332
  this.busy.publish = true;
318
333
  cx.spawn(async (cx) => {
319
334
  if (this.publisher.pid) await sh('kill "$1" 2>/dev/null; true', [String(this.publisher.pid)]);
@@ -396,6 +411,7 @@ export default class Herdgate extends View {
396
411
  ),
397
412
  )
398
413
  .child(section("THIS MACHINE"))
414
+ .when(this.isWindows, (el) => el.child(div().text_size(10).text_color(t.dim).child("this machine can pair and approve others; publishing it needs Linux/macOS for now")))
399
415
  .child(this.pairingBlock(t, cx))
400
416
  .child(section("ADD ANOTHER MACHINE"))
401
417
  .child(this.approveBlock(t, cx))
@@ -440,7 +456,7 @@ export default class Herdgate extends View {
440
456
  return v_flex()
441
457
  .id("hg-approve")
442
458
  .gap(5)
443
- .child(div().text_size(10.5).text_color(t.dim).child("on the other machine's herdgate panel, press Pair and type its code here"))
459
+ .child(div().text_size(10.5).text_color(t.dim).child("want another machine in the herd? on IT: npx @bom0792/herdgate setup-host → its herdgate panel → Pair — it shows a code. type that code here:"))
444
460
  .child(
445
461
  h_flex()
446
462
  .gap(6)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bom0792/herdgate",
3
- "version": "0.9.13",
3
+ "version": "0.9.14",
4
4
  "description": "Cloud relay hub for herdr-core: every machine dials out, phones and browsers follow (PWA + SSH leg, E2E payloads).",
5
5
  "type": "module",
6
6
  "engines": {
Binary file