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.
- package/dist/{chunk-XSAVKZSF.js → chunk-YAF63OWJ.js} +4 -8
- package/dist/cli.js +7 -7
- package/dist/{connect-CZ727ZOC.js → connect-TYJFBFTE.js} +1 -2
- package/dist/{credentials-OO2RZFLG.js → credentials-LO2VVMZQ.js} +1 -2
- package/dist/{disconnect-TZ3MQUZS.js → disconnect-CQLCAVXH.js} +1 -2
- package/dist/{hook-5CIEDLN5.js → hook-WPPFPN3P.js} +3 -4
- package/dist/{login-5E7FSVVL.js → login-LHLHSMDL.js} +1 -2
- package/dist/{setup-VFHRFRZH.js → setup-BTW4UVF2.js} +0 -1
- package/package.json +1 -1
- package/dist/chunk-PDX44BCA.js +0 -11
|
@@ -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
|
-
|
|
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.
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
42
|
+
const { disconnect } = await import("./disconnect-CQLCAVXH.js");
|
|
43
43
|
disconnect();
|
|
44
44
|
process.exit(0);
|
|
45
45
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolveApiKey,
|
|
4
|
+
resolveMachineId,
|
|
4
5
|
resolveServerUrl
|
|
5
|
-
} from "./chunk-
|
|
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 =
|
|
160
|
+
const machineId = resolveMachineId();
|
|
162
161
|
if (hookEvent === "UserPromptSubmit") {
|
|
163
162
|
const prompt = payload["prompt"];
|
|
164
163
|
if (prompt) {
|
package/package.json
CHANGED
package/dist/chunk-PDX44BCA.js
DELETED
|
@@ -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
|
-
};
|