zenflo 0.11.7 → 0.11.9
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/{index-yJG0qz0r.mjs → index-CE4K-X3c.mjs} +532 -67
- package/dist/{index-HBSmEvnF.cjs → index-GoBFTs9u.cjs} +530 -64
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/dist/lib.cjs +1 -1
- package/dist/lib.mjs +1 -1
- package/dist/runCCR-C4iiYV_d.mjs +101 -0
- package/dist/runCCR-CbB0wPJ6.cjs +103 -0
- package/dist/{runCodex-cXLrsovg.cjs → runCodex-DaGqRdiG.cjs} +2 -2
- package/dist/{runCodex-Bl0T0A2Z.mjs → runCodex-DqKH9UFw.mjs} +2 -2
- package/dist/status-BB4epZ_d.cjs +101 -0
- package/dist/status-BmogoZjk.mjs +104 -0
- package/dist/status-CXjOWgh0.cjs +94 -0
- package/dist/status-Crjj5AbA.mjs +92 -0
- package/dist/status-DVIDR-sx.mjs +99 -0
- package/dist/status-QtPjWqoQ.cjs +106 -0
- package/dist/{types-Dvhor4zW.cjs → types-BNjAQcO4.cjs} +2 -2
- package/dist/{types-DJhJK2jD.mjs → types-CTT5Uja5.mjs} +2 -2
- package/package.json +1 -1
- package/scripts/ccr_launcher.cjs +309 -0
- package/scripts/unpack-tools.cjs +4 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import os$1, { homedir } from 'node:os';
|
|
3
3
|
import { randomUUID, randomBytes } from 'node:crypto';
|
|
4
|
-
import { l as logger, p as projectPath,
|
|
4
|
+
import { l as logger, p as projectPath, e as backoff, f as delay, R as RawJSONLinesSchema, g as AsyncLock, c as configuration, r as readDaemonState, h as clearDaemonState, d as packageJson, b as readSettings, i as readCredentials, j as encodeBase64, u as updateSettings, k as encodeBase64Url, m as decodeBase64, w as writeCredentialsLegacy, n as writeCredentialsDataKey, o as acquireDaemonLock, q as writeDaemonState, A as ApiClient, s as releaseDaemonLock, t as clearCredentials, v as clearMachineId, x as getLatestDaemonLog } from './types-CTT5Uja5.mjs';
|
|
5
5
|
import { spawn, execSync, execFileSync } from 'node:child_process';
|
|
6
6
|
import { resolve, join } from 'node:path';
|
|
7
7
|
import { createInterface } from 'node:readline';
|
|
@@ -18,8 +18,8 @@ import tweetnacl from 'tweetnacl';
|
|
|
18
18
|
import 'expo-server-sdk';
|
|
19
19
|
import { createHash, randomBytes as randomBytes$1 } from 'crypto';
|
|
20
20
|
import { spawn as spawn$1, execSync as execSync$1, exec } from 'child_process';
|
|
21
|
-
import { readFileSync as readFileSync$1, existsSync as existsSync$1,
|
|
22
|
-
import { join as join$1 } from 'path';
|
|
21
|
+
import { readFileSync as readFileSync$1, existsSync as existsSync$1, mkdirSync as mkdirSync$1, copyFileSync, writeFileSync, unlinkSync } from 'fs';
|
|
22
|
+
import path, { join as join$1 } from 'path';
|
|
23
23
|
import psList from 'ps-list';
|
|
24
24
|
import spawn$2 from 'cross-spawn';
|
|
25
25
|
import os from 'os';
|
|
@@ -32,6 +32,7 @@ import { validatorCompiler, serializerCompiler } from 'fastify-type-provider-zod
|
|
|
32
32
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
33
33
|
import { createServer } from 'node:http';
|
|
34
34
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
35
|
+
import { fileURLToPath as fileURLToPath$1 } from 'url';
|
|
35
36
|
import { createServer as createServer$1 } from 'http';
|
|
36
37
|
import { promisify } from 'util';
|
|
37
38
|
|
|
@@ -998,10 +999,10 @@ class AbortError extends Error {
|
|
|
998
999
|
}
|
|
999
1000
|
}
|
|
1000
1001
|
|
|
1001
|
-
const __filename$
|
|
1002
|
-
const __dirname$
|
|
1002
|
+
const __filename$2 = fileURLToPath(import.meta.url);
|
|
1003
|
+
const __dirname$2 = join(__filename$2, "..");
|
|
1003
1004
|
function getDefaultClaudeCodePath() {
|
|
1004
|
-
return join(__dirname$
|
|
1005
|
+
return join(__dirname$2, "..", "..", "..", "node_modules", "@anthropic-ai", "claude-code", "cli.js");
|
|
1005
1006
|
}
|
|
1006
1007
|
function logDebug(message) {
|
|
1007
1008
|
if (process.env.DEBUG) {
|
|
@@ -3880,8 +3881,8 @@ function selectAuthenticationMethod() {
|
|
|
3880
3881
|
async function doMobileAuth(keypair) {
|
|
3881
3882
|
console.clear();
|
|
3882
3883
|
console.log("\nMobile Authentication\n");
|
|
3883
|
-
console.log("Scan this QR code with your
|
|
3884
|
-
const authUrl = "
|
|
3884
|
+
console.log("Scan this QR code with your ZenFlo mobile app:\n");
|
|
3885
|
+
const authUrl = "zenflo://terminal?" + encodeBase64Url(keypair.publicKey);
|
|
3885
3886
|
displayQRCode(authUrl);
|
|
3886
3887
|
console.log("\nOr manually enter this URL:");
|
|
3887
3888
|
console.log(authUrl);
|
|
@@ -4780,7 +4781,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
4780
4781
|
// Initialize lifecycle state
|
|
4781
4782
|
lifecycleState: "running",
|
|
4782
4783
|
lifecycleStateSince: Date.now(),
|
|
4783
|
-
flavor: "claude"
|
|
4784
|
+
flavor: options.flavor || "claude"
|
|
4784
4785
|
};
|
|
4785
4786
|
const response = await api.getOrCreateSession({ tag: sessionTag, metadata, state });
|
|
4786
4787
|
logger.debug(`Session created: ${response.id}`);
|
|
@@ -5017,16 +5018,120 @@ async function runClaude(credentials, options = {}) {
|
|
|
5017
5018
|
process.exit(0);
|
|
5018
5019
|
}
|
|
5019
5020
|
|
|
5020
|
-
const
|
|
5021
|
-
const
|
|
5022
|
-
|
|
5021
|
+
const __filename$1 = fileURLToPath$1(import.meta.url);
|
|
5022
|
+
const __dirname$1 = path.dirname(__filename$1);
|
|
5023
|
+
const PLIST_LABEL$1 = "com.zenflo.daemon";
|
|
5024
|
+
const LAUNCH_AGENTS_DIR$1 = path.join(os.homedir(), "Library", "LaunchAgents");
|
|
5025
|
+
const PLIST_FILE$1 = path.join(LAUNCH_AGENTS_DIR$1, `${PLIST_LABEL$1}.plist`);
|
|
5026
|
+
const APP_BUNDLE_DIR = path.join(os.homedir(), "Library", "Application Support", "ZenFlo");
|
|
5027
|
+
const APP_BUNDLE_PATH = path.join(APP_BUNDLE_DIR, "ZenFlo Daemon.app");
|
|
5028
|
+
async function install$3() {
|
|
5023
5029
|
try {
|
|
5030
|
+
console.log(chalk.cyan("\u{1F4E6} Installing ZenFlo daemon as LaunchAgent...\n"));
|
|
5024
5031
|
if (existsSync$1(PLIST_FILE$1)) {
|
|
5025
|
-
|
|
5026
|
-
|
|
5032
|
+
console.log(chalk.yellow("\u26A0\uFE0F LaunchAgent already installed. Uninstalling first...\n"));
|
|
5033
|
+
try {
|
|
5034
|
+
execSync$1(`launchctl unload "${PLIST_FILE$1}"`, { stdio: "pipe" });
|
|
5035
|
+
} catch (error) {
|
|
5036
|
+
}
|
|
5037
|
+
}
|
|
5038
|
+
if (!existsSync$1(LAUNCH_AGENTS_DIR$1)) {
|
|
5039
|
+
mkdirSync$1(LAUNCH_AGENTS_DIR$1, { recursive: true });
|
|
5040
|
+
}
|
|
5041
|
+
let zenfloBinaryPath;
|
|
5042
|
+
try {
|
|
5043
|
+
zenfloBinaryPath = execSync$1("which zenflo", { encoding: "utf-8" }).trim();
|
|
5044
|
+
} catch (error) {
|
|
5045
|
+
throw new Error("Could not find zenflo binary in PATH. Is ZenFlo installed?");
|
|
5046
|
+
}
|
|
5047
|
+
console.log(chalk.cyan("Creating app bundle with ZenFlo icon..."));
|
|
5048
|
+
const contentsDir = path.join(APP_BUNDLE_PATH, "Contents");
|
|
5049
|
+
const macosDir = path.join(contentsDir, "MacOS");
|
|
5050
|
+
const resourcesDir = path.join(contentsDir, "Resources");
|
|
5051
|
+
mkdirSync$1(macosDir, { recursive: true });
|
|
5052
|
+
mkdirSync$1(resourcesDir, { recursive: true });
|
|
5053
|
+
const possibleIconPaths = [
|
|
5054
|
+
// PRIMARY: Icon Exports directory (user's actual branding)
|
|
5055
|
+
"/Users/quinnmay/developer/zenflo/Icon Exports/ZenFlo.icns",
|
|
5056
|
+
path.join(process.cwd(), "Icon Exports", "ZenFlo.icns"),
|
|
5057
|
+
path.join(__dirname$1, "..", "..", "..", "Icon Exports", "ZenFlo.icns"),
|
|
5058
|
+
// Fallback: Tauri icons (old location)
|
|
5059
|
+
"/Users/quinnmay/developer/zenflo/mobile/src-tauri/icons/icon.icns",
|
|
5060
|
+
"/Users/quinnmay/developer/zenflo/webapp/src-tauri/icons/icon.icns",
|
|
5061
|
+
path.join(process.cwd(), "mobile", "src-tauri", "icons", "icon.icns"),
|
|
5062
|
+
path.join(process.cwd(), "webapp", "src-tauri", "icons", "icon.icns"),
|
|
5063
|
+
path.join(__dirname$1, "..", "..", "..", "mobile", "src-tauri", "icons", "icon.icns"),
|
|
5064
|
+
path.join(__dirname$1, "..", "..", "..", "webapp", "src-tauri", "icons", "icon.icns")
|
|
5065
|
+
];
|
|
5066
|
+
let iconCopied = false;
|
|
5067
|
+
for (const iconPath of possibleIconPaths) {
|
|
5068
|
+
if (existsSync$1(iconPath)) {
|
|
5069
|
+
copyFileSync(iconPath, path.join(resourcesDir, "AppIcon.icns"));
|
|
5070
|
+
console.log(chalk.green("\u2705 Copied ZenFlo icon"));
|
|
5071
|
+
console.log(chalk.dim(` Source: ${iconPath}`));
|
|
5072
|
+
iconCopied = true;
|
|
5073
|
+
break;
|
|
5074
|
+
}
|
|
5075
|
+
}
|
|
5076
|
+
if (!iconCopied) {
|
|
5077
|
+
console.log(chalk.yellow("\u26A0\uFE0F Could not find icon.icns (will use default icon)"));
|
|
5027
5078
|
}
|
|
5028
|
-
|
|
5029
|
-
|
|
5079
|
+
try {
|
|
5080
|
+
execSync$1(`touch "${APP_BUNDLE_PATH}"`);
|
|
5081
|
+
execSync$1("killall Dock 2>/dev/null || true", { stdio: "pipe" });
|
|
5082
|
+
execSync$1("killall Finder 2>/dev/null || true", { stdio: "pipe" });
|
|
5083
|
+
console.log(chalk.green("\u2705 Refreshed icon cache\n"));
|
|
5084
|
+
} catch (error) {
|
|
5085
|
+
console.log(chalk.dim(" (Icon cache refresh skipped)\n"));
|
|
5086
|
+
}
|
|
5087
|
+
const infoPlistContent = trimIdent(`
|
|
5088
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
5089
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
5090
|
+
<plist version="1.0">
|
|
5091
|
+
<dict>
|
|
5092
|
+
<key>CFBundleExecutable</key>
|
|
5093
|
+
<string>zenflo-daemon</string>
|
|
5094
|
+
<key>CFBundleIconFile</key>
|
|
5095
|
+
<string>AppIcon.icns</string>
|
|
5096
|
+
<key>CFBundleIdentifier</key>
|
|
5097
|
+
<string>com.zenflo.daemon</string>
|
|
5098
|
+
<key>CFBundleName</key>
|
|
5099
|
+
<string>ZenFlo Daemon</string>
|
|
5100
|
+
<key>CFBundlePackageType</key>
|
|
5101
|
+
<string>APPL</string>
|
|
5102
|
+
<key>CFBundleShortVersionString</key>
|
|
5103
|
+
<string>1.0.0</string>
|
|
5104
|
+
<key>LSBackgroundOnly</key>
|
|
5105
|
+
<true/>
|
|
5106
|
+
<key>LSUIElement</key>
|
|
5107
|
+
<true/>
|
|
5108
|
+
</dict>
|
|
5109
|
+
</plist>
|
|
5110
|
+
`);
|
|
5111
|
+
writeFileSync(path.join(contentsDir, "Info.plist"), infoPlistContent);
|
|
5112
|
+
console.log(chalk.green("\u2705 Created app bundle Info.plist"));
|
|
5113
|
+
let nodePath;
|
|
5114
|
+
let zenfloScriptPath;
|
|
5115
|
+
try {
|
|
5116
|
+
nodePath = execSync$1("which node", { encoding: "utf-8" }).trim();
|
|
5117
|
+
} catch (error) {
|
|
5118
|
+
throw new Error("Could not find node binary in PATH. Is Node.js installed?");
|
|
5119
|
+
}
|
|
5120
|
+
try {
|
|
5121
|
+
const symlinkTarget = execSync$1(`readlink "${zenfloBinaryPath}"`, { encoding: "utf-8" }).trim();
|
|
5122
|
+
const symlinkDir = path.dirname(zenfloBinaryPath);
|
|
5123
|
+
zenfloScriptPath = path.resolve(symlinkDir, symlinkTarget);
|
|
5124
|
+
} catch (error) {
|
|
5125
|
+
zenfloScriptPath = zenfloBinaryPath;
|
|
5126
|
+
}
|
|
5127
|
+
const wrapperScript = trimIdent(`
|
|
5128
|
+
#!/bin/bash
|
|
5129
|
+
# Use absolute paths to avoid issues when launched from / by LaunchAgent
|
|
5130
|
+
exec "${nodePath}" "${zenfloScriptPath}" daemon start-sync
|
|
5131
|
+
`);
|
|
5132
|
+
const wrapperPath = path.join(macosDir, "zenflo-daemon");
|
|
5133
|
+
writeFileSync(wrapperPath, wrapperScript, { mode: 493 });
|
|
5134
|
+
console.log(chalk.green("\u2705 Created launcher script\n"));
|
|
5030
5135
|
const plistContent = trimIdent(`
|
|
5031
5136
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
5032
5137
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
@@ -5034,92 +5139,411 @@ async function install$1() {
|
|
|
5034
5139
|
<dict>
|
|
5035
5140
|
<key>Label</key>
|
|
5036
5141
|
<string>${PLIST_LABEL$1}</string>
|
|
5037
|
-
|
|
5142
|
+
|
|
5038
5143
|
<key>ProgramArguments</key>
|
|
5039
5144
|
<array>
|
|
5040
|
-
<string
|
|
5041
|
-
<string
|
|
5042
|
-
<string
|
|
5145
|
+
<string>/usr/bin/open</string>
|
|
5146
|
+
<string>-a</string>
|
|
5147
|
+
<string>${APP_BUNDLE_PATH}</string>
|
|
5148
|
+
<string>--background</string>
|
|
5043
5149
|
</array>
|
|
5044
|
-
|
|
5045
|
-
<key>EnvironmentVariables</key>
|
|
5046
|
-
<dict>
|
|
5047
|
-
<key>ZENFLO_DAEMON_MODE</key>
|
|
5048
|
-
<string>true</string>
|
|
5049
|
-
</dict>
|
|
5050
|
-
|
|
5150
|
+
|
|
5051
5151
|
<key>RunAtLoad</key>
|
|
5052
5152
|
<true/>
|
|
5053
|
-
|
|
5153
|
+
|
|
5054
5154
|
<key>KeepAlive</key>
|
|
5055
|
-
<
|
|
5056
|
-
|
|
5155
|
+
<dict>
|
|
5156
|
+
<key>SuccessfulExit</key>
|
|
5157
|
+
<false/>
|
|
5158
|
+
</dict>
|
|
5159
|
+
|
|
5057
5160
|
<key>StandardErrorPath</key>
|
|
5058
|
-
<string>${
|
|
5059
|
-
|
|
5161
|
+
<string>${configuration.zenfloHomeDir}/daemon.err</string>
|
|
5162
|
+
|
|
5060
5163
|
<key>StandardOutPath</key>
|
|
5061
|
-
<string>${
|
|
5062
|
-
|
|
5164
|
+
<string>${configuration.zenfloHomeDir}/daemon.log</string>
|
|
5165
|
+
|
|
5063
5166
|
<key>WorkingDirectory</key>
|
|
5064
|
-
<string
|
|
5167
|
+
<string>${os.homedir()}</string>
|
|
5168
|
+
|
|
5169
|
+
<key>ProcessType</key>
|
|
5170
|
+
<string>Background</string>
|
|
5171
|
+
|
|
5172
|
+
<key>ThrottleInterval</key>
|
|
5173
|
+
<integer>10</integer>
|
|
5065
5174
|
</dict>
|
|
5066
5175
|
</plist>
|
|
5067
5176
|
`);
|
|
5068
|
-
writeFileSync(PLIST_FILE$1, plistContent);
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5177
|
+
writeFileSync(PLIST_FILE$1, plistContent, { mode: 420 });
|
|
5178
|
+
console.log(chalk.green("\u2705 Created LaunchAgent plist"));
|
|
5179
|
+
console.log(chalk.dim(` ${PLIST_FILE$1}
|
|
5180
|
+
`));
|
|
5181
|
+
try {
|
|
5182
|
+
execSync$1(`launchctl load "${PLIST_FILE$1}"`, { stdio: "pipe" });
|
|
5183
|
+
console.log(chalk.green("\u2705 LaunchAgent loaded successfully\n"));
|
|
5184
|
+
} catch (error) {
|
|
5185
|
+
throw new Error(`Failed to load LaunchAgent: ${error instanceof Error ? error.message : error}`);
|
|
5186
|
+
}
|
|
5187
|
+
console.log(chalk.green.bold("\u{1F389} Installation complete!\n"));
|
|
5188
|
+
console.log(chalk.cyan("The daemon will now:"));
|
|
5189
|
+
console.log(chalk.dim(" \u2022 Start automatically when you log in"));
|
|
5190
|
+
console.log(chalk.dim(" \u2022 Run in the background 24/7"));
|
|
5191
|
+
console.log(chalk.dim(" \u2022 Restart automatically if it crashes"));
|
|
5192
|
+
console.log(chalk.dim(" \u2022 Display with ZenFlo branding in Activity Monitor\n"));
|
|
5193
|
+
console.log(chalk.cyan("Next steps:"));
|
|
5194
|
+
console.log(chalk.dim(" \u2022 Check status: ") + chalk.white("zenflo daemon status"));
|
|
5195
|
+
console.log(chalk.dim(" \u2022 View logs: ") + chalk.white(`tail -f ${configuration.zenfloHomeDir}/daemon.log`));
|
|
5196
|
+
console.log(chalk.dim(" \u2022 Uninstall: ") + chalk.white("zenflo daemon uninstall\n"));
|
|
5197
|
+
console.log(chalk.yellow("\u{1F4A1} Tip: To grant Full Disk Access:"));
|
|
5198
|
+
console.log(chalk.dim(" 1. Open System Settings \u2192 Privacy & Security \u2192 Full Disk Access"));
|
|
5199
|
+
console.log(chalk.dim(" 2. Click the + button"));
|
|
5200
|
+
console.log(chalk.dim(" 3. Navigate to: ") + chalk.white(zenfloBinaryPath));
|
|
5201
|
+
console.log(chalk.dim(" 4. Enable the toggle\n"));
|
|
5074
5202
|
} catch (error) {
|
|
5203
|
+
console.error(chalk.red("\u274C Installation failed:"), error instanceof Error ? error.message : error);
|
|
5075
5204
|
logger.debug("Failed to install daemon:", error);
|
|
5076
5205
|
throw error;
|
|
5077
5206
|
}
|
|
5078
5207
|
}
|
|
5079
5208
|
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5209
|
+
const TASK_NAME$1 = "ZenFlo Daemon";
|
|
5210
|
+
async function install$2() {
|
|
5211
|
+
try {
|
|
5212
|
+
console.log(chalk.cyan("\u{1F4E6} Installing ZenFlo daemon as Windows Task Scheduler task...\n"));
|
|
5213
|
+
try {
|
|
5214
|
+
execSync$1(`schtasks /Query /TN "${TASK_NAME$1}"`, { stdio: "pipe" });
|
|
5215
|
+
console.log(chalk.yellow("\u26A0\uFE0F Task already installed. Uninstalling first...\n"));
|
|
5216
|
+
try {
|
|
5217
|
+
execSync$1(`schtasks /Delete /TN "${TASK_NAME$1}" /F`, { stdio: "pipe" });
|
|
5218
|
+
} catch (error) {
|
|
5219
|
+
}
|
|
5220
|
+
} catch (error) {
|
|
5221
|
+
}
|
|
5222
|
+
let zenfloBinaryPath;
|
|
5223
|
+
try {
|
|
5224
|
+
zenfloBinaryPath = execSync$1("where zenflo", { encoding: "utf-8" }).trim().split("\n")[0];
|
|
5225
|
+
} catch (error) {
|
|
5226
|
+
throw new Error("Could not find zenflo binary in PATH. Is ZenFlo installed?");
|
|
5227
|
+
}
|
|
5228
|
+
let nodePath;
|
|
5229
|
+
try {
|
|
5230
|
+
nodePath = execSync$1("where node", { encoding: "utf-8" }).trim().split("\n")[0];
|
|
5231
|
+
} catch (error) {
|
|
5232
|
+
throw new Error("Could not find node.exe in PATH. Is Node.js installed?");
|
|
5233
|
+
}
|
|
5234
|
+
const xmlPath = path.join(configuration.zenfloHomeDir, "daemon-task.xml");
|
|
5235
|
+
const xmlContent = trimIdent(`
|
|
5236
|
+
<?xml version="1.0" encoding="UTF-16"?>
|
|
5237
|
+
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
|
5238
|
+
<RegistrationInfo>
|
|
5239
|
+
<Date>2025-01-01T00:00:00</Date>
|
|
5240
|
+
<Author>${os.userInfo().username}</Author>
|
|
5241
|
+
<Description>ZenFlo AI coding assistant daemon service</Description>
|
|
5242
|
+
</RegistrationInfo>
|
|
5243
|
+
<Triggers>
|
|
5244
|
+
<LogonTrigger>
|
|
5245
|
+
<Enabled>true</Enabled>
|
|
5246
|
+
<UserId>${os.userInfo().username}</UserId>
|
|
5247
|
+
</LogonTrigger>
|
|
5248
|
+
</Triggers>
|
|
5249
|
+
<Principals>
|
|
5250
|
+
<Principal id="Author">
|
|
5251
|
+
<UserId>${os.userInfo().username}</UserId>
|
|
5252
|
+
<LogonType>InteractiveToken</LogonType>
|
|
5253
|
+
<RunLevel>LeastPrivilege</RunLevel>
|
|
5254
|
+
</Principal>
|
|
5255
|
+
</Principals>
|
|
5256
|
+
<Settings>
|
|
5257
|
+
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
|
|
5258
|
+
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
|
|
5259
|
+
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
|
|
5260
|
+
<AllowHardTerminate>true</AllowHardTerminate>
|
|
5261
|
+
<StartWhenAvailable>true</StartWhenAvailable>
|
|
5262
|
+
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
|
|
5263
|
+
<IdleSettings>
|
|
5264
|
+
<StopOnIdleEnd>false</StopOnIdleEnd>
|
|
5265
|
+
<RestartOnIdle>false</RestartOnIdle>
|
|
5266
|
+
</IdleSettings>
|
|
5267
|
+
<AllowStartOnDemand>true</AllowStartOnDemand>
|
|
5268
|
+
<Enabled>true</Enabled>
|
|
5269
|
+
<Hidden>false</Hidden>
|
|
5270
|
+
<RunOnlyIfIdle>false</RunOnlyIfIdle>
|
|
5271
|
+
<WakeToRun>false</WakeToRun>
|
|
5272
|
+
<ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
|
|
5273
|
+
<Priority>7</Priority>
|
|
5274
|
+
<RestartOnFailure>
|
|
5275
|
+
<Interval>PT1M</Interval>
|
|
5276
|
+
<Count>3</Count>
|
|
5277
|
+
</RestartOnFailure>
|
|
5278
|
+
</Settings>
|
|
5279
|
+
<Actions Context="Author">
|
|
5280
|
+
<Exec>
|
|
5281
|
+
<Command>"${nodePath}"</Command>
|
|
5282
|
+
<Arguments>"${zenfloBinaryPath}" daemon start-sync</Arguments>
|
|
5283
|
+
<WorkingDirectory>${os.homedir()}</WorkingDirectory>
|
|
5284
|
+
</Exec>
|
|
5285
|
+
</Actions>
|
|
5286
|
+
</Task>
|
|
5287
|
+
`);
|
|
5288
|
+
writeFileSync(xmlPath, xmlContent, { encoding: "utf-16le" });
|
|
5289
|
+
console.log(chalk.green("\u2705 Created task definition XML"));
|
|
5290
|
+
console.log(chalk.dim(` ${xmlPath}
|
|
5291
|
+
`));
|
|
5292
|
+
try {
|
|
5293
|
+
execSync$1(`schtasks /Create /XML "${xmlPath}" /TN "${TASK_NAME$1}"`, { stdio: "pipe" });
|
|
5294
|
+
console.log(chalk.green("\u2705 Task created successfully\n"));
|
|
5295
|
+
} catch (error) {
|
|
5296
|
+
throw new Error(`Failed to create scheduled task: ${error instanceof Error ? error.message : error}`);
|
|
5297
|
+
}
|
|
5298
|
+
try {
|
|
5299
|
+
execSync$1(`schtasks /Run /TN "${TASK_NAME$1}"`, { stdio: "pipe" });
|
|
5300
|
+
console.log(chalk.green("\u2705 Task started successfully\n"));
|
|
5301
|
+
} catch (error) {
|
|
5302
|
+
console.log(chalk.yellow("\u26A0\uFE0F Could not start task immediately (will start at next login)\n"));
|
|
5303
|
+
}
|
|
5304
|
+
console.log(chalk.green.bold("\u{1F389} Installation complete!\n"));
|
|
5305
|
+
console.log(chalk.cyan("The daemon will now:"));
|
|
5306
|
+
console.log(chalk.dim(" \u2022 Start automatically when you log in"));
|
|
5307
|
+
console.log(chalk.dim(" \u2022 Run in the background 24/7"));
|
|
5308
|
+
console.log(chalk.dim(" \u2022 Restart automatically if it crashes (up to 3 times)\n"));
|
|
5309
|
+
console.log(chalk.cyan("Next steps:"));
|
|
5310
|
+
console.log(chalk.dim(" \u2022 Check status: ") + chalk.white("zenflo daemon status"));
|
|
5311
|
+
console.log(chalk.dim(" \u2022 View logs: ") + chalk.white(`type ${configuration.zenfloHomeDir}\\daemon.log`));
|
|
5312
|
+
console.log(chalk.dim(" \u2022 Uninstall: ") + chalk.white("zenflo daemon uninstall\n"));
|
|
5313
|
+
console.log(chalk.yellow("\u{1F4A1} Tip: View task in Task Scheduler:"));
|
|
5314
|
+
console.log(chalk.dim(" 1. Press Win+R and type: taskschd.msc"));
|
|
5315
|
+
console.log(chalk.dim(' 2. Find "ZenFlo Daemon" in Task Scheduler Library'));
|
|
5316
|
+
console.log(chalk.dim(" 3. View history, logs, and configuration\n"));
|
|
5317
|
+
} catch (error) {
|
|
5318
|
+
console.error(chalk.red("\u274C Installation failed:"), error instanceof Error ? error.message : error);
|
|
5319
|
+
logger.debug("Failed to install daemon:", error);
|
|
5320
|
+
throw error;
|
|
5321
|
+
}
|
|
5322
|
+
}
|
|
5323
|
+
|
|
5324
|
+
const SERVICE_NAME$1 = "zenflo-daemon";
|
|
5325
|
+
const SYSTEMD_USER_DIR$1 = path.join(os.homedir(), ".config", "systemd", "user");
|
|
5326
|
+
const SERVICE_FILE$1 = path.join(SYSTEMD_USER_DIR$1, `${SERVICE_NAME$1}.service`);
|
|
5327
|
+
async function install$1() {
|
|
5328
|
+
try {
|
|
5329
|
+
console.log(chalk.cyan("\u{1F4E6} Installing ZenFlo daemon as systemd user service...\n"));
|
|
5330
|
+
if (existsSync$1(SERVICE_FILE$1)) {
|
|
5331
|
+
console.log(chalk.yellow("\u26A0\uFE0F Service already installed. Uninstalling first...\n"));
|
|
5332
|
+
try {
|
|
5333
|
+
execSync$1(`systemctl --user stop ${SERVICE_NAME$1}`, { stdio: "pipe" });
|
|
5334
|
+
execSync$1(`systemctl --user disable ${SERVICE_NAME$1}`, { stdio: "pipe" });
|
|
5335
|
+
} catch (error) {
|
|
5336
|
+
}
|
|
5337
|
+
}
|
|
5338
|
+
if (!existsSync$1(SYSTEMD_USER_DIR$1)) {
|
|
5339
|
+
mkdirSync$1(SYSTEMD_USER_DIR$1, { recursive: true });
|
|
5340
|
+
}
|
|
5341
|
+
let zenfloBinaryPath;
|
|
5342
|
+
try {
|
|
5343
|
+
zenfloBinaryPath = execSync$1("which zenflo", { encoding: "utf-8" }).trim();
|
|
5344
|
+
} catch (error) {
|
|
5345
|
+
throw new Error("Could not find zenflo binary in PATH. Is ZenFlo installed?");
|
|
5346
|
+
}
|
|
5347
|
+
const serviceContent = trimIdent(`
|
|
5348
|
+
[Unit]
|
|
5349
|
+
Description=ZenFlo AI Coding Assistant Daemon
|
|
5350
|
+
After=network.target
|
|
5351
|
+
|
|
5352
|
+
[Service]
|
|
5353
|
+
Type=simple
|
|
5354
|
+
ExecStart=${zenfloBinaryPath} daemon start-sync
|
|
5355
|
+
Restart=on-failure
|
|
5356
|
+
RestartSec=10
|
|
5357
|
+
StandardOutput=append:${configuration.zenfloHomeDir}/daemon.log
|
|
5358
|
+
StandardError=append:${configuration.zenfloHomeDir}/daemon.err
|
|
5359
|
+
WorkingDirectory=${os.homedir()}
|
|
5360
|
+
|
|
5361
|
+
[Install]
|
|
5362
|
+
WantedBy=default.target
|
|
5363
|
+
`);
|
|
5364
|
+
writeFileSync(SERVICE_FILE$1, serviceContent, { mode: 420 });
|
|
5365
|
+
console.log(chalk.green("\u2705 Created systemd service file"));
|
|
5366
|
+
console.log(chalk.dim(` ${SERVICE_FILE$1}
|
|
5367
|
+
`));
|
|
5368
|
+
try {
|
|
5369
|
+
execSync$1("systemctl --user daemon-reload", { stdio: "pipe" });
|
|
5370
|
+
console.log(chalk.green("\u2705 Reloaded systemd configuration"));
|
|
5371
|
+
} catch (error) {
|
|
5372
|
+
throw new Error(`Failed to reload systemd: ${error instanceof Error ? error.message : error}`);
|
|
5373
|
+
}
|
|
5374
|
+
try {
|
|
5375
|
+
execSync$1(`systemctl --user enable ${SERVICE_NAME$1}`, { stdio: "pipe" });
|
|
5376
|
+
console.log(chalk.green("\u2705 Service enabled (auto-start at login)"));
|
|
5377
|
+
} catch (error) {
|
|
5378
|
+
throw new Error(`Failed to enable service: ${error instanceof Error ? error.message : error}`);
|
|
5379
|
+
}
|
|
5380
|
+
try {
|
|
5381
|
+
execSync$1(`systemctl --user start ${SERVICE_NAME$1}`, { stdio: "pipe" });
|
|
5382
|
+
console.log(chalk.green("\u2705 Service started successfully\n"));
|
|
5383
|
+
} catch (error) {
|
|
5384
|
+
throw new Error(`Failed to start service: ${error instanceof Error ? error.message : error}`);
|
|
5385
|
+
}
|
|
5386
|
+
console.log(chalk.green.bold("\u{1F389} Installation complete!\n"));
|
|
5387
|
+
console.log(chalk.cyan("The daemon will now:"));
|
|
5388
|
+
console.log(chalk.dim(" \u2022 Start automatically when you log in"));
|
|
5389
|
+
console.log(chalk.dim(" \u2022 Run in the background 24/7"));
|
|
5390
|
+
console.log(chalk.dim(" \u2022 Restart automatically if it crashes\n"));
|
|
5391
|
+
console.log(chalk.cyan("Next steps:"));
|
|
5392
|
+
console.log(chalk.dim(" \u2022 Check status: ") + chalk.white("zenflo daemon status"));
|
|
5393
|
+
console.log(chalk.dim(" \u2022 View logs: ") + chalk.white(`tail -f ${configuration.zenfloHomeDir}/daemon.log`));
|
|
5394
|
+
console.log(chalk.dim(" \u2022 Uninstall: ") + chalk.white("zenflo daemon uninstall\n"));
|
|
5395
|
+
console.log(chalk.yellow("\u{1F4A1} Tip: systemd commands:"));
|
|
5396
|
+
console.log(chalk.dim(" \u2022 Check status: ") + chalk.white(`systemctl --user status ${SERVICE_NAME$1}`));
|
|
5397
|
+
console.log(chalk.dim(" \u2022 View logs: ") + chalk.white(`journalctl --user -u ${SERVICE_NAME$1} -f`));
|
|
5398
|
+
console.log(chalk.dim(" \u2022 Restart: ") + chalk.white(`systemctl --user restart ${SERVICE_NAME$1}
|
|
5399
|
+
`));
|
|
5400
|
+
} catch (error) {
|
|
5401
|
+
console.error(chalk.red("\u274C Installation failed:"), error instanceof Error ? error.message : error);
|
|
5402
|
+
logger.debug("Failed to install daemon:", error);
|
|
5403
|
+
throw error;
|
|
5083
5404
|
}
|
|
5084
|
-
|
|
5085
|
-
|
|
5405
|
+
}
|
|
5406
|
+
|
|
5407
|
+
async function install() {
|
|
5408
|
+
switch (process.platform) {
|
|
5409
|
+
case "darwin":
|
|
5410
|
+
await install$3();
|
|
5411
|
+
break;
|
|
5412
|
+
case "win32":
|
|
5413
|
+
await install$2();
|
|
5414
|
+
break;
|
|
5415
|
+
case "linux":
|
|
5416
|
+
await install$1();
|
|
5417
|
+
break;
|
|
5418
|
+
default:
|
|
5419
|
+
throw new Error(`Daemon installation is not supported on platform: ${process.platform}`);
|
|
5086
5420
|
}
|
|
5087
|
-
logger.info("Installing ZenFlo CLI daemon for macOS...");
|
|
5088
|
-
await install$1();
|
|
5089
5421
|
}
|
|
5090
5422
|
|
|
5091
|
-
const PLIST_LABEL = "com.
|
|
5092
|
-
const
|
|
5093
|
-
|
|
5423
|
+
const PLIST_LABEL = "com.zenflo.daemon";
|
|
5424
|
+
const LAUNCH_AGENTS_DIR = path.join(os.homedir(), "Library", "LaunchAgents");
|
|
5425
|
+
const PLIST_FILE = path.join(LAUNCH_AGENTS_DIR, `${PLIST_LABEL}.plist`);
|
|
5426
|
+
async function uninstall$3() {
|
|
5094
5427
|
try {
|
|
5428
|
+
console.log(chalk.cyan("\u{1F5D1}\uFE0F Uninstalling ZenFlo daemon LaunchAgent...\n"));
|
|
5095
5429
|
if (!existsSync$1(PLIST_FILE)) {
|
|
5096
|
-
|
|
5430
|
+
console.log(chalk.yellow("\u26A0\uFE0F LaunchAgent not found. Nothing to uninstall."));
|
|
5431
|
+
console.log(chalk.dim(` Expected location: ${PLIST_FILE}
|
|
5432
|
+
`));
|
|
5097
5433
|
return;
|
|
5098
5434
|
}
|
|
5099
5435
|
try {
|
|
5100
|
-
execSync$1(`launchctl unload ${PLIST_FILE}`, { stdio: "
|
|
5101
|
-
|
|
5436
|
+
execSync$1(`launchctl unload "${PLIST_FILE}"`, { stdio: "pipe" });
|
|
5437
|
+
console.log(chalk.green("\u2705 LaunchAgent unloaded"));
|
|
5102
5438
|
} catch (error) {
|
|
5103
|
-
|
|
5439
|
+
console.log(chalk.dim(" (LaunchAgent was not loaded)\n"));
|
|
5104
5440
|
}
|
|
5105
5441
|
unlinkSync(PLIST_FILE);
|
|
5106
|
-
|
|
5107
|
-
|
|
5442
|
+
console.log(chalk.green("\u2705 Removed LaunchAgent plist\n"));
|
|
5443
|
+
console.log(chalk.green.bold("\u{1F389} Uninstallation complete!\n"));
|
|
5444
|
+
console.log(chalk.cyan("The daemon will no longer:"));
|
|
5445
|
+
console.log(chalk.dim(" \u2022 Start automatically at login"));
|
|
5446
|
+
console.log(chalk.dim(" \u2022 Run in the background\n"));
|
|
5447
|
+
console.log(chalk.cyan("Note: ") + chalk.dim("Auto-start will still work when you run ") + chalk.white("zenflo\n"));
|
|
5108
5448
|
} catch (error) {
|
|
5449
|
+
console.error(chalk.red("\u274C Uninstallation failed:"), error instanceof Error ? error.message : error);
|
|
5109
5450
|
logger.debug("Failed to uninstall daemon:", error);
|
|
5110
5451
|
throw error;
|
|
5111
5452
|
}
|
|
5112
5453
|
}
|
|
5113
5454
|
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5455
|
+
const TASK_NAME = "ZenFlo Daemon";
|
|
5456
|
+
async function uninstall$2() {
|
|
5457
|
+
try {
|
|
5458
|
+
console.log(chalk.cyan("\u{1F5D1}\uFE0F Uninstalling ZenFlo daemon scheduled task...\n"));
|
|
5459
|
+
try {
|
|
5460
|
+
execSync$1(`schtasks /Query /TN "${TASK_NAME}"`, { stdio: "pipe" });
|
|
5461
|
+
} catch (error) {
|
|
5462
|
+
console.log(chalk.yellow("\u26A0\uFE0F Scheduled task not found. Nothing to uninstall.\n"));
|
|
5463
|
+
return;
|
|
5464
|
+
}
|
|
5465
|
+
try {
|
|
5466
|
+
execSync$1(`schtasks /End /TN "${TASK_NAME}"`, { stdio: "pipe" });
|
|
5467
|
+
console.log(chalk.green("\u2705 Task stopped"));
|
|
5468
|
+
} catch (error) {
|
|
5469
|
+
console.log(chalk.dim(" (Task was not running)\n"));
|
|
5470
|
+
}
|
|
5471
|
+
try {
|
|
5472
|
+
execSync$1(`schtasks /Delete /TN "${TASK_NAME}" /F`, { stdio: "pipe" });
|
|
5473
|
+
console.log(chalk.green("\u2705 Scheduled task removed\n"));
|
|
5474
|
+
} catch (error) {
|
|
5475
|
+
throw new Error(`Failed to delete scheduled task: ${error instanceof Error ? error.message : error}`);
|
|
5476
|
+
}
|
|
5477
|
+
console.log(chalk.green.bold("\u{1F389} Uninstallation complete!\n"));
|
|
5478
|
+
console.log(chalk.cyan("The daemon will no longer:"));
|
|
5479
|
+
console.log(chalk.dim(" \u2022 Start automatically at login"));
|
|
5480
|
+
console.log(chalk.dim(" \u2022 Run in the background\n"));
|
|
5481
|
+
console.log(chalk.cyan("Note: ") + chalk.dim("Auto-start will still work when you run ") + chalk.white("zenflo\n"));
|
|
5482
|
+
} catch (error) {
|
|
5483
|
+
console.error(chalk.red("\u274C Uninstallation failed:"), error instanceof Error ? error.message : error);
|
|
5484
|
+
logger.debug("Failed to uninstall daemon:", error);
|
|
5485
|
+
throw error;
|
|
5117
5486
|
}
|
|
5118
|
-
|
|
5119
|
-
|
|
5487
|
+
}
|
|
5488
|
+
|
|
5489
|
+
const SERVICE_NAME = "zenflo-daemon";
|
|
5490
|
+
const SYSTEMD_USER_DIR = path.join(os.homedir(), ".config", "systemd", "user");
|
|
5491
|
+
const SERVICE_FILE = path.join(SYSTEMD_USER_DIR, `${SERVICE_NAME}.service`);
|
|
5492
|
+
async function uninstall$1() {
|
|
5493
|
+
try {
|
|
5494
|
+
console.log(chalk.cyan("\u{1F5D1}\uFE0F Uninstalling ZenFlo daemon systemd service...\n"));
|
|
5495
|
+
if (!existsSync$1(SERVICE_FILE)) {
|
|
5496
|
+
console.log(chalk.yellow("\u26A0\uFE0F Service not found. Nothing to uninstall."));
|
|
5497
|
+
console.log(chalk.dim(` Expected location: ${SERVICE_FILE}
|
|
5498
|
+
`));
|
|
5499
|
+
return;
|
|
5500
|
+
}
|
|
5501
|
+
try {
|
|
5502
|
+
execSync$1(`systemctl --user stop ${SERVICE_NAME}`, { stdio: "pipe" });
|
|
5503
|
+
console.log(chalk.green("\u2705 Service stopped"));
|
|
5504
|
+
} catch (error) {
|
|
5505
|
+
console.log(chalk.dim(" (Service was not running)"));
|
|
5506
|
+
}
|
|
5507
|
+
try {
|
|
5508
|
+
execSync$1(`systemctl --user disable ${SERVICE_NAME}`, { stdio: "pipe" });
|
|
5509
|
+
console.log(chalk.green("\u2705 Service disabled"));
|
|
5510
|
+
} catch (error) {
|
|
5511
|
+
console.log(chalk.dim(" (Service was not enabled)"));
|
|
5512
|
+
}
|
|
5513
|
+
unlinkSync(SERVICE_FILE);
|
|
5514
|
+
console.log(chalk.green("\u2705 Removed service file\n"));
|
|
5515
|
+
try {
|
|
5516
|
+
execSync$1("systemctl --user daemon-reload", { stdio: "pipe" });
|
|
5517
|
+
console.log(chalk.green("\u2705 Reloaded systemd configuration\n"));
|
|
5518
|
+
} catch (error) {
|
|
5519
|
+
console.log(chalk.dim(" (Could not reload systemd)\n"));
|
|
5520
|
+
}
|
|
5521
|
+
console.log(chalk.green.bold("\u{1F389} Uninstallation complete!\n"));
|
|
5522
|
+
console.log(chalk.cyan("The daemon will no longer:"));
|
|
5523
|
+
console.log(chalk.dim(" \u2022 Start automatically at login"));
|
|
5524
|
+
console.log(chalk.dim(" \u2022 Run in the background\n"));
|
|
5525
|
+
console.log(chalk.cyan("Note: ") + chalk.dim("Auto-start will still work when you run ") + chalk.white("zenflo\n"));
|
|
5526
|
+
} catch (error) {
|
|
5527
|
+
console.error(chalk.red("\u274C Uninstallation failed:"), error instanceof Error ? error.message : error);
|
|
5528
|
+
logger.debug("Failed to uninstall daemon:", error);
|
|
5529
|
+
throw error;
|
|
5530
|
+
}
|
|
5531
|
+
}
|
|
5532
|
+
|
|
5533
|
+
async function uninstall() {
|
|
5534
|
+
switch (process.platform) {
|
|
5535
|
+
case "darwin":
|
|
5536
|
+
await uninstall$3();
|
|
5537
|
+
break;
|
|
5538
|
+
case "win32":
|
|
5539
|
+
await uninstall$2();
|
|
5540
|
+
break;
|
|
5541
|
+
case "linux":
|
|
5542
|
+
await uninstall$1();
|
|
5543
|
+
break;
|
|
5544
|
+
default:
|
|
5545
|
+
throw new Error(`Daemon uninstallation is not supported on platform: ${process.platform}`);
|
|
5120
5546
|
}
|
|
5121
|
-
logger.info("Uninstalling ZenFlo CLI daemon for macOS...");
|
|
5122
|
-
await uninstall$1();
|
|
5123
5547
|
}
|
|
5124
5548
|
|
|
5125
5549
|
async function handleAuthCommand(args) {
|
|
@@ -5875,7 +6299,7 @@ async function handleConnectVendor(vendor, displayName) {
|
|
|
5875
6299
|
return;
|
|
5876
6300
|
} else if (subcommand === "codex") {
|
|
5877
6301
|
try {
|
|
5878
|
-
const { runCodex } = await import('./runCodex-
|
|
6302
|
+
const { runCodex } = await import('./runCodex-DqKH9UFw.mjs');
|
|
5879
6303
|
let startedBy = void 0;
|
|
5880
6304
|
for (let i = 1; i < args.length; i++) {
|
|
5881
6305
|
if (args[i] === "--started-by") {
|
|
@@ -5894,6 +6318,27 @@ async function handleConnectVendor(vendor, displayName) {
|
|
|
5894
6318
|
process.exit(1);
|
|
5895
6319
|
}
|
|
5896
6320
|
return;
|
|
6321
|
+
} else if (subcommand === "ccr" || subcommand === "glm") {
|
|
6322
|
+
try {
|
|
6323
|
+
const { runCCR } = await import('./runCCR-C4iiYV_d.mjs');
|
|
6324
|
+
let startedBy = void 0;
|
|
6325
|
+
for (let i = 1; i < args.length; i++) {
|
|
6326
|
+
if (args[i] === "--started-by") {
|
|
6327
|
+
startedBy = args[++i];
|
|
6328
|
+
}
|
|
6329
|
+
}
|
|
6330
|
+
const {
|
|
6331
|
+
credentials
|
|
6332
|
+
} = await authAndSetupMachineIfNeeded();
|
|
6333
|
+
await runCCR({ credentials, startedBy });
|
|
6334
|
+
} catch (error) {
|
|
6335
|
+
console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
|
|
6336
|
+
if (process.env.DEBUG) {
|
|
6337
|
+
console.error(error);
|
|
6338
|
+
}
|
|
6339
|
+
process.exit(1);
|
|
6340
|
+
}
|
|
6341
|
+
return;
|
|
5897
6342
|
} else if (subcommand === "logout") {
|
|
5898
6343
|
console.log(chalk.yellow('Note: "happy logout" is deprecated. Use "happy auth logout" instead.\n'));
|
|
5899
6344
|
try {
|
|
@@ -5974,7 +6419,27 @@ async function handleConnectVendor(vendor, displayName) {
|
|
|
5974
6419
|
await stopDaemon();
|
|
5975
6420
|
process.exit(0);
|
|
5976
6421
|
} else if (daemonSubcommand === "status") {
|
|
5977
|
-
|
|
6422
|
+
try {
|
|
6423
|
+
let statusModule;
|
|
6424
|
+
switch (process.platform) {
|
|
6425
|
+
case "darwin":
|
|
6426
|
+
statusModule = await import('./status-BmogoZjk.mjs');
|
|
6427
|
+
break;
|
|
6428
|
+
case "win32":
|
|
6429
|
+
statusModule = await import('./status-Crjj5AbA.mjs');
|
|
6430
|
+
break;
|
|
6431
|
+
case "linux":
|
|
6432
|
+
statusModule = await import('./status-DVIDR-sx.mjs');
|
|
6433
|
+
break;
|
|
6434
|
+
default:
|
|
6435
|
+
console.error(chalk.red(`Status command not supported on platform: ${process.platform}`));
|
|
6436
|
+
process.exit(1);
|
|
6437
|
+
}
|
|
6438
|
+
await statusModule.status();
|
|
6439
|
+
} catch (error) {
|
|
6440
|
+
console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
|
|
6441
|
+
process.exit(1);
|
|
6442
|
+
}
|
|
5978
6443
|
process.exit(0);
|
|
5979
6444
|
} else if (daemonSubcommand === "logs") {
|
|
5980
6445
|
const latest = await getLatestDaemonLog();
|
|
@@ -6183,4 +6648,4 @@ ${chalk.bold("Examples:")}
|
|
|
6183
6648
|
}
|
|
6184
6649
|
}
|
|
6185
6650
|
|
|
6186
|
-
export { MessageQueue2 as M,
|
|
6651
|
+
export { MessageQueue2 as M, registerKillSessionHandler as a, MessageBuffer as b, stopCaffeinate as c, hashObject as h, initialMachineMetadata as i, notifyDaemonSessionStarted as n, runClaude as r, startZenfloServer as s, trimIdent as t };
|