handsoff 0.1.2 → 0.1.5
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 +13 -13
- package/dist/cli/index.js.map +1 -1
- package/dist/gateway/process.js +203 -40
- package/dist/gateway/process.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -122,12 +122,12 @@ function resetCredentials() {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
// src/cli/attach.ts
|
|
125
|
-
import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync as
|
|
125
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSync as mkdirSync2 } from "fs";
|
|
126
126
|
import { homedir as homedir3 } from "os";
|
|
127
127
|
import { join as join3, dirname as dirname2 } from "path";
|
|
128
128
|
|
|
129
129
|
// src/config.ts
|
|
130
|
-
import { readFileSync as readFileSync2, existsSync as existsSync2 } from "fs";
|
|
130
|
+
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2 } from "fs";
|
|
131
131
|
import { join as join2 } from "path";
|
|
132
132
|
import { homedir as homedir2 } from "os";
|
|
133
133
|
import TOML from "@iarna/toml";
|
|
@@ -559,12 +559,12 @@ function getSettingsPath() {
|
|
|
559
559
|
function backupSettings(settingsPath) {
|
|
560
560
|
const backupPath = settingsPath + ".handsoff-backup";
|
|
561
561
|
if (existsSync3(settingsPath)) {
|
|
562
|
-
|
|
562
|
+
writeFileSync3(backupPath, readFileSync3(settingsPath, "utf-8"));
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
function writeSettings(settingsPath, settings) {
|
|
566
566
|
mkdirSync2(dirname2(settingsPath), { recursive: true });
|
|
567
|
-
|
|
567
|
+
writeFileSync3(settingsPath, JSON.stringify(settings, null, 2));
|
|
568
568
|
}
|
|
569
569
|
function getGatewayBaseUrl(port) {
|
|
570
570
|
return `http://localhost:${port}`;
|
|
@@ -662,7 +662,7 @@ function createInitialState(hasExistingConfig) {
|
|
|
662
662
|
}
|
|
663
663
|
|
|
664
664
|
// src/cli/wizard/applicator.ts
|
|
665
|
-
import { writeFileSync as
|
|
665
|
+
import { writeFileSync as writeFileSync4, mkdirSync as mkdirSync3 } from "fs";
|
|
666
666
|
import { join as join4 } from "path";
|
|
667
667
|
import { homedir as homedir4 } from "os";
|
|
668
668
|
import TOML2 from "@iarna/toml";
|
|
@@ -709,7 +709,7 @@ var ConfigApplicator = class {
|
|
|
709
709
|
mkdirSync3(configDir, { recursive: true });
|
|
710
710
|
const configPath = join4(configDir, "config.toml");
|
|
711
711
|
const content = TOML2.stringify(finalConfig);
|
|
712
|
-
|
|
712
|
+
writeFileSync4(configPath, content);
|
|
713
713
|
}
|
|
714
714
|
};
|
|
715
715
|
|
|
@@ -992,7 +992,7 @@ var prompts = {
|
|
|
992
992
|
};
|
|
993
993
|
|
|
994
994
|
// src/cli/wizard/steps/cli.ts
|
|
995
|
-
import { writeFileSync as
|
|
995
|
+
import { writeFileSync as writeFileSync5, existsSync as existsSync5, readFileSync as readFileSync5, mkdirSync as mkdirSync4 } from "fs";
|
|
996
996
|
import { dirname as dirname3 } from "path";
|
|
997
997
|
import pc from "picocolors";
|
|
998
998
|
import ora from "ora";
|
|
@@ -1154,7 +1154,7 @@ function injectClaudeHooks(settingsPath, events) {
|
|
|
1154
1154
|
hooksConfig
|
|
1155
1155
|
);
|
|
1156
1156
|
mkdirSync4(dirname3(settingsPath), { recursive: true });
|
|
1157
|
-
|
|
1157
|
+
writeFileSync5(settingsPath, JSON.stringify(mergedSettings, null, 2));
|
|
1158
1158
|
}
|
|
1159
1159
|
var COMMAND_ONLY_HOOKS = ["SessionStart", "Setup"];
|
|
1160
1160
|
function generateHooksConfig2(port, token, events) {
|
|
@@ -1188,7 +1188,7 @@ function cleanupClaudeHooks(settingsPath) {
|
|
|
1188
1188
|
delete cleanedSettings.hooks;
|
|
1189
1189
|
}
|
|
1190
1190
|
mkdirSync4(dirname3(settingsPath), { recursive: true });
|
|
1191
|
-
|
|
1191
|
+
writeFileSync5(settingsPath, JSON.stringify(cleanedSettings, null, 2));
|
|
1192
1192
|
}
|
|
1193
1193
|
|
|
1194
1194
|
// src/cli/wizard/detectors/channel.ts
|
|
@@ -1557,7 +1557,7 @@ import { fileURLToPath } from "url";
|
|
|
1557
1557
|
import { mkdirSync as mkdirSync5, existsSync as existsSync7 } from "fs";
|
|
1558
1558
|
|
|
1559
1559
|
// src/shared/pidfile.ts
|
|
1560
|
-
import { writeFileSync as
|
|
1560
|
+
import { writeFileSync as writeFileSync6, readFileSync as readFileSync6, existsSync as existsSync6, unlinkSync } from "fs";
|
|
1561
1561
|
function readPidFile(pidFilePath) {
|
|
1562
1562
|
if (!existsSync6(pidFilePath)) {
|
|
1563
1563
|
return null;
|
|
@@ -2344,19 +2344,19 @@ var debugCommand = new Command7("debug").description("Debug tools for Handsoff")
|
|
|
2344
2344
|
import { spawn as spawn3 } from "child_process";
|
|
2345
2345
|
import { homedir as homedir13 } from "os";
|
|
2346
2346
|
import { join as join15, dirname as dirname6 } from "path";
|
|
2347
|
-
import { readFileSync as readFileSync7, existsSync as existsSync12, writeFileSync as
|
|
2347
|
+
import { readFileSync as readFileSync7, existsSync as existsSync12, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6 } from "fs";
|
|
2348
2348
|
function getSettingsPath3() {
|
|
2349
2349
|
return join15(homedir13(), ".claude", "settings.json");
|
|
2350
2350
|
}
|
|
2351
2351
|
function backupSettings2(settingsPath) {
|
|
2352
2352
|
const backupPath = settingsPath + ".handsoff-backup";
|
|
2353
2353
|
if (existsSync12(settingsPath)) {
|
|
2354
|
-
|
|
2354
|
+
writeFileSync7(backupPath, readFileSync7(settingsPath, "utf-8"));
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
2357
2357
|
function writeSettings2(settingsPath, settings) {
|
|
2358
2358
|
mkdirSync6(dirname6(settingsPath), { recursive: true });
|
|
2359
|
-
|
|
2359
|
+
writeFileSync7(settingsPath, JSON.stringify(settings, null, 2));
|
|
2360
2360
|
}
|
|
2361
2361
|
function generateHooksConfig3(port, token) {
|
|
2362
2362
|
const unifiedUrl = `http://localhost:${port}/hook/${token}/event`;
|