ztile-cli 0.3.3 → 0.3.4

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.
@@ -1,11 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- __require
4
- } from "./chunk-PDX44BCA.js";
5
2
 
6
3
  // src/lib/credentials.ts
7
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
4
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from "fs";
8
5
  import { join } from "path";
6
+ import { hostname } from "os";
9
7
  function credentialsPath() {
10
8
  const home = process.env["HOME"] ?? process.env["USERPROFILE"] ?? "/tmp";
11
9
  return join(home, ".ztile", "credentials.json");
@@ -44,7 +42,7 @@ function resolveMachineId() {
44
42
  if (envId) return envId;
45
43
  const creds = loadCredentials();
46
44
  if (creds?.machineId) return creds.machineId;
47
- return "";
45
+ return hostname();
48
46
  }
49
47
  function pidFilePath() {
50
48
  const home = process.env["HOME"] ?? process.env["USERPROFILE"] ?? "/tmp";
@@ -67,10 +65,8 @@ function loadPid() {
67
65
  }
68
66
  }
69
67
  function removePid() {
70
- const path = pidFilePath();
71
68
  try {
72
- const { unlinkSync } = __require("fs");
73
- unlinkSync(path);
69
+ unlinkSync(pidFilePath());
74
70
  } catch {
75
71
  }
76
72
  }
package/dist/cli.js CHANGED
@@ -3,16 +3,16 @@
3
3
  // src/cli.ts
4
4
  var args = process.argv.slice(2);
5
5
  if (args[0] === "version" || args[0] === "--version" || args[0] === "-v") {
6
- console.log("0.3.3");
6
+ console.log("0.3.4");
7
7
  process.exit(0);
8
8
  }
9
9
  if (args[0] === "hook") {
10
- const { handleHook } = await import("./hook-5CIEDLN5.js");
10
+ const { handleHook } = await import("./hook-WPPFPN3P.js");
11
11
  await handleHook();
12
12
  process.exit(0);
13
13
  }
14
14
  if (args[0] === "login") {
15
- const { login } = await import("./login-5E7FSVVL.js");
15
+ const { login } = await import("./login-LHLHSMDL.js");
16
16
  await login({
17
17
  apiKey: findArg(args, "--api-key"),
18
18
  serverUrl: findArg(args, "--server-url"),
@@ -21,25 +21,25 @@ if (args[0] === "login") {
21
21
  process.exit(0);
22
22
  }
23
23
  if (args[0] === "install") {
24
- const { resolveApiKey } = await import("./credentials-OO2RZFLG.js");
24
+ const { resolveApiKey } = await import("./credentials-LO2VVMZQ.js");
25
25
  const apiKey = resolveApiKey();
26
26
  if (!apiKey) {
27
27
  console.error("Error: Not logged in.");
28
28
  console.error(" Run `ztile login` first.");
29
29
  process.exit(1);
30
30
  }
31
- const { setupClaudeCode } = await import("./setup-VFHRFRZH.js");
31
+ const { setupClaudeCode } = await import("./setup-BTW4UVF2.js");
32
32
  await setupClaudeCode();
33
33
  process.exit(0);
34
34
  }
35
35
  if (args[0] === "connect") {
36
- const { runConnect } = await import("./connect-CZ727ZOC.js");
36
+ const { runConnect } = await import("./connect-TYJFBFTE.js");
37
37
  const projectDir = findArg(args, "--project") ?? process.env["ZTILE_PROJECT"] ?? process.cwd();
38
38
  const daemon = args.includes("--daemon") || args.includes("-d");
39
39
  await runConnect({ projectDir, daemon });
40
40
  }
41
41
  if (args[0] === "disconnect") {
42
- const { disconnect } = await import("./disconnect-TZ3MQUZS.js");
42
+ const { disconnect } = await import("./disconnect-CQLCAVXH.js");
43
43
  disconnect();
44
44
  process.exit(0);
45
45
  }
@@ -6,8 +6,7 @@ import {
6
6
  resolveApiKey,
7
7
  resolveServerUrl,
8
8
  savePid
9
- } from "./chunk-XSAVKZSF.js";
10
- import "./chunk-PDX44BCA.js";
9
+ } from "./chunk-YAF63OWJ.js";
11
10
 
12
11
  // src/commands/connect.ts
13
12
  import { hostname } from "os";
@@ -9,8 +9,7 @@ import {
9
9
  resolveServerUrl,
10
10
  saveCredentials,
11
11
  savePid
12
- } from "./chunk-XSAVKZSF.js";
13
- import "./chunk-PDX44BCA.js";
12
+ } from "./chunk-YAF63OWJ.js";
14
13
  export {
15
14
  isProcessRunning,
16
15
  loadCredentials,
@@ -3,8 +3,7 @@ import {
3
3
  isProcessRunning,
4
4
  loadPid,
5
5
  removePid
6
- } from "./chunk-XSAVKZSF.js";
7
- import "./chunk-PDX44BCA.js";
6
+ } from "./chunk-YAF63OWJ.js";
8
7
 
9
8
  // src/commands/disconnect.ts
10
9
  function disconnect() {
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveApiKey,
4
+ resolveMachineId,
4
5
  resolveServerUrl
5
- } from "./chunk-XSAVKZSF.js";
6
- import "./chunk-PDX44BCA.js";
6
+ } from "./chunk-YAF63OWJ.js";
7
7
 
8
8
  // src/commands/hook.ts
9
9
  import { readFile as readFile2, stat } from "fs/promises";
@@ -121,7 +121,6 @@ async function sendRawToServer(payload) {
121
121
  // src/commands/hook.ts
122
122
  import { appendFileSync } from "fs";
123
123
  import { join as join2 } from "path";
124
- import { hostname } from "os";
125
124
  var LOG_FILE = join2(process.env["HOME"] ?? "/tmp", ".ztile", "hook-debug.log");
126
125
  function debugLog(msg) {
127
126
  const line = `[${(/* @__PURE__ */ new Date()).toISOString()}] ${msg}
@@ -158,7 +157,7 @@ async function handleHook() {
158
157
  debugLog("[hook] No session_id in payload, skipping");
159
158
  return;
160
159
  }
161
- const machineId = process.env["ZTILE_MACHINE_ID"] ?? hostname();
160
+ const machineId = resolveMachineId();
162
161
  if (hookEvent === "UserPromptSubmit") {
163
162
  const prompt = payload["prompt"];
164
163
  if (prompt) {
@@ -2,8 +2,7 @@
2
2
  import {
3
3
  loadCredentials,
4
4
  saveCredentials
5
- } from "./chunk-XSAVKZSF.js";
6
- import "./chunk-PDX44BCA.js";
5
+ } from "./chunk-YAF63OWJ.js";
7
6
 
8
7
  // src/commands/login.ts
9
8
  import { createInterface } from "readline";
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-PDX44BCA.js";
3
2
 
4
3
  // src/commands/setup.ts
5
4
  import { readFile, writeFile } from "fs/promises";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztile-cli",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Mission control for autonomous coding agents (Claude Code, Codex, Gemini CLI)",
5
5
  "bin": {
6
6
  "ztile": "dist/cli.js"
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
- }) : x)(function(x) {
5
- if (typeof require !== "undefined") return require.apply(this, arguments);
6
- throw Error('Dynamic require of "' + x + '" is not supported');
7
- });
8
-
9
- export {
10
- __require
11
- };