@hasna/machines 0.0.6 → 0.0.7

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/cli/index.js CHANGED
@@ -18219,15 +18219,32 @@ function hasDisplayServer() {
18219
18219
  const wayland = process.env["WAYLAND_DISPLAY"] || "";
18220
18220
  if (display || wayland)
18221
18221
  return true;
18222
- try {
18223
- const result = Bun.spawnSync(["wl-paste", "--no-newline"], { stdout: "pipe", stderr: "pipe", env: process.env, timeout: 2000 });
18224
- if (result.exitCode === 0) {
18225
- const output = result.stdout.toString("utf8");
18226
- if (/\x1b\]52;/.test(output))
18227
- return false;
18228
- return output.length > 0;
18229
- }
18230
- } catch {}
18222
+ if (process.platform === "darwin")
18223
+ return true;
18224
+ if (process.platform === "linux") {
18225
+ try {
18226
+ const result = Bun.spawnSync(["loginctl", "list-sessions", "--no-legend"], { stdout: "pipe", stderr: "pipe", env: process.env, timeout: 2000 });
18227
+ if (result.exitCode === 0) {
18228
+ const sessions = result.stdout.toString("utf8").trim();
18229
+ if (sessions) {
18230
+ for (const line of sessions.split(`
18231
+ `)) {
18232
+ const sessionId = line.trim().split(/\s+/)[0];
18233
+ if (sessionId) {
18234
+ const typeResult = Bun.spawnSync(["loginctl", "show-session", sessionId, "-p", "Type", "--value"], { stdout: "pipe", stderr: "pipe", env: process.env, timeout: 2000 });
18235
+ if (typeResult.exitCode === 0) {
18236
+ const sessionType = typeResult.stdout.toString("utf8").trim();
18237
+ if (sessionType === "wayland" || sessionType === "x11") {
18238
+ return true;
18239
+ }
18240
+ }
18241
+ }
18242
+ }
18243
+ }
18244
+ }
18245
+ } catch {}
18246
+ return false;
18247
+ }
18231
18248
  return false;
18232
18249
  }
18233
18250
  function computeHash2(content) {
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard-daemon.d.ts","sourceRoot":"","sources":["../../src/commands/clipboard-daemon.ts"],"names":[],"mappings":"AA4GA,wBAAgB,mBAAmB,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAO9E;AAED,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CA6DxD"}
1
+ {"version":3,"file":"clipboard-daemon.d.ts","sourceRoot":"","sources":["../../src/commands/clipboard-daemon.ts"],"names":[],"mappings":"AA2HA,wBAAgB,mBAAmB,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAO9E;AAED,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CA6DxD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/machines",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Machine fleet management CLI + MCP for developers",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",