tabclaw 0.1.2 → 0.1.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/README.md +5 -3
- package/dist/cli/index.js +23 -19
- package/dist/cli/index.js.map +1 -1
- package/dist/daemon/process.js +2 -2
- package/dist/daemon/process.js.map +1 -1
- package/package.json +1 -4
package/README.md
CHANGED
|
@@ -20,9 +20,11 @@ The core workflow bridges Claude Code with Telegram:
|
|
|
20
20
|
3. **Real-time Decisions** — Click the button in Telegram to grant or deny the tool execution
|
|
21
21
|
4. **Task Completion** — Receive final notifications when tasks complete, including execution duration, token usage, and results
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
<p align="center">
|
|
24
|
+
<img src="assets/image_01.jpg" width="45%" alt="Claude + Telegram workflow" />
|
|
25
|
+
|
|
26
|
+
<img src="assets/image_02.jpg" width="45%" alt="Permission request and task completion on Telegram" />
|
|
27
|
+
</p>
|
|
26
28
|
|
|
27
29
|
## Installation
|
|
28
30
|
|
package/dist/cli/index.js
CHANGED
|
@@ -49,8 +49,8 @@ function mergeHooks(existing, newHooks) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// src/shared/credentials.ts
|
|
52
|
-
import { readFileSync, writeFileSync, existsSync } from "fs";
|
|
53
|
-
import { join } from "path";
|
|
52
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
53
|
+
import { join, dirname } from "path";
|
|
54
54
|
import { homedir } from "os";
|
|
55
55
|
import { randomBytes } from "crypto";
|
|
56
56
|
var CREDENTIALS_VERSION = "1";
|
|
@@ -76,6 +76,10 @@ function loadCredentials() {
|
|
|
76
76
|
}
|
|
77
77
|
function saveCredentials(credentials) {
|
|
78
78
|
const path = getCredentialsPath();
|
|
79
|
+
const dir = dirname(path);
|
|
80
|
+
if (!existsSync(dir)) {
|
|
81
|
+
mkdirSync(dir, { recursive: true });
|
|
82
|
+
}
|
|
79
83
|
writeFileSync(path, JSON.stringify(credentials, null, 2), { mode: 384 });
|
|
80
84
|
}
|
|
81
85
|
function getOrCreateHookToken() {
|
|
@@ -107,9 +111,9 @@ function resetCredentials() {
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
// src/cli/attach.ts
|
|
110
|
-
import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync } from "fs";
|
|
114
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
111
115
|
import { homedir as homedir3 } from "os";
|
|
112
|
-
import { join as join3, dirname } from "path";
|
|
116
|
+
import { join as join3, dirname as dirname2 } from "path";
|
|
113
117
|
|
|
114
118
|
// src/config.ts
|
|
115
119
|
import { readFileSync as readFileSync2, existsSync as existsSync2 } from "fs";
|
|
@@ -467,7 +471,7 @@ function backupSettings(settingsPath) {
|
|
|
467
471
|
}
|
|
468
472
|
}
|
|
469
473
|
function writeSettings(settingsPath, settings) {
|
|
470
|
-
|
|
474
|
+
mkdirSync2(dirname2(settingsPath), { recursive: true });
|
|
471
475
|
writeFileSync2(settingsPath, JSON.stringify(settings, null, 2));
|
|
472
476
|
}
|
|
473
477
|
function getGatewayBaseUrl(port) {
|
|
@@ -565,7 +569,7 @@ function createInitialState(hasExistingConfig) {
|
|
|
565
569
|
}
|
|
566
570
|
|
|
567
571
|
// src/cli/wizard/applicator.ts
|
|
568
|
-
import { writeFileSync as writeFileSync3, mkdirSync as
|
|
572
|
+
import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "fs";
|
|
569
573
|
import { join as join4 } from "path";
|
|
570
574
|
import { homedir as homedir4 } from "os";
|
|
571
575
|
import TOML2 from "@iarna/toml";
|
|
@@ -585,7 +589,7 @@ var ConfigApplicator = class {
|
|
|
585
589
|
}
|
|
586
590
|
};
|
|
587
591
|
const configDir = join4(homedir4(), ".tabclaw");
|
|
588
|
-
|
|
592
|
+
mkdirSync3(configDir, { recursive: true });
|
|
589
593
|
const configPath = join4(configDir, "config.toml");
|
|
590
594
|
const content = TOML2.stringify(merged);
|
|
591
595
|
writeFileSync3(configPath, content);
|
|
@@ -763,8 +767,8 @@ var prompts = {
|
|
|
763
767
|
};
|
|
764
768
|
|
|
765
769
|
// src/cli/wizard/steps/cli.ts
|
|
766
|
-
import { writeFileSync as writeFileSync4, existsSync as existsSync5, readFileSync as readFileSync5, mkdirSync as
|
|
767
|
-
import { dirname as
|
|
770
|
+
import { writeFileSync as writeFileSync4, existsSync as existsSync5, readFileSync as readFileSync5, mkdirSync as mkdirSync4 } from "fs";
|
|
771
|
+
import { dirname as dirname3 } from "path";
|
|
768
772
|
import pc from "picocolors";
|
|
769
773
|
import ora from "ora";
|
|
770
774
|
async function stepCli(state) {
|
|
@@ -836,7 +840,7 @@ function injectClaudeHooks(settingsPath, events) {
|
|
|
836
840
|
currentSettings,
|
|
837
841
|
hooksConfig
|
|
838
842
|
);
|
|
839
|
-
|
|
843
|
+
mkdirSync4(dirname3(settingsPath), { recursive: true });
|
|
840
844
|
writeFileSync4(settingsPath, JSON.stringify(mergedSettings, null, 2));
|
|
841
845
|
}
|
|
842
846
|
function generateHooksConfig2(baseUrl, events) {
|
|
@@ -1050,9 +1054,9 @@ ${t("wizard.notify.title", { channel: channelName })}
|
|
|
1050
1054
|
// src/cli/daemon.ts
|
|
1051
1055
|
import { spawn } from "child_process";
|
|
1052
1056
|
import { exec } from "child_process";
|
|
1053
|
-
import { join as join6, dirname as
|
|
1057
|
+
import { join as join6, dirname as dirname4 } from "path";
|
|
1054
1058
|
import { fileURLToPath } from "url";
|
|
1055
|
-
import { mkdirSync as
|
|
1059
|
+
import { mkdirSync as mkdirSync5, existsSync as existsSync7 } from "fs";
|
|
1056
1060
|
|
|
1057
1061
|
// src/shared/pidfile.ts
|
|
1058
1062
|
import { writeFileSync as writeFileSync5, readFileSync as readFileSync6, existsSync as existsSync6, unlinkSync } from "fs";
|
|
@@ -1131,9 +1135,9 @@ var DaemonManager = class {
|
|
|
1131
1135
|
try {
|
|
1132
1136
|
const homedir14 = process.env.HOME || process.env.USERPROFILE || "";
|
|
1133
1137
|
const logDir = join6(homedir14, ".tabclaw", "logs");
|
|
1134
|
-
|
|
1138
|
+
mkdirSync5(logDir, { recursive: true });
|
|
1135
1139
|
removePidFile(this.pidFilePath);
|
|
1136
|
-
const __dirname3 =
|
|
1140
|
+
const __dirname3 = dirname4(fileURLToPath(import.meta.url));
|
|
1137
1141
|
let daemonScript = join6(__dirname3, "..", "daemon", "process.js");
|
|
1138
1142
|
if (!existsSync7(daemonScript)) {
|
|
1139
1143
|
daemonScript = join6(__dirname3, "..", "..", "src", "daemon", "process.ts");
|
|
@@ -1767,9 +1771,9 @@ var gatewayCommand = new Command6("gateway").description("Manage tabclaw Gateway
|
|
|
1767
1771
|
import { Command as Command7 } from "commander";
|
|
1768
1772
|
import { spawn as spawn2 } from "child_process";
|
|
1769
1773
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1770
|
-
import { dirname as
|
|
1774
|
+
import { dirname as dirname5, join as join14 } from "path";
|
|
1771
1775
|
var __filename2 = fileURLToPath2(import.meta.url);
|
|
1772
|
-
var __dirname2 =
|
|
1776
|
+
var __dirname2 = dirname5(__filename2);
|
|
1773
1777
|
var debugCommand = new Command7("debug").description("Debug tools for TabClaw").addCommand(
|
|
1774
1778
|
new Command7("hooks").description("Capture and log raw hook payloads for debugging").option("-p, --port <port>", "Port to listen on", "16792").action(async (options) => {
|
|
1775
1779
|
const port = parseInt(options.port, 10);
|
|
@@ -1794,8 +1798,8 @@ var debugCommand = new Command7("debug").description("Debug tools for TabClaw").
|
|
|
1794
1798
|
// src/cli/agent/claude.ts
|
|
1795
1799
|
import { spawn as spawn3 } from "child_process";
|
|
1796
1800
|
import { homedir as homedir13 } from "os";
|
|
1797
|
-
import { join as join15, dirname as
|
|
1798
|
-
import { readFileSync as readFileSync7, existsSync as existsSync12, writeFileSync as writeFileSync6, mkdirSync as
|
|
1801
|
+
import { join as join15, dirname as dirname6 } from "path";
|
|
1802
|
+
import { readFileSync as readFileSync7, existsSync as existsSync12, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6 } from "fs";
|
|
1799
1803
|
function getSettingsPath3() {
|
|
1800
1804
|
return join15(homedir13(), ".claude", "settings.json");
|
|
1801
1805
|
}
|
|
@@ -1806,7 +1810,7 @@ function backupSettings2(settingsPath) {
|
|
|
1806
1810
|
}
|
|
1807
1811
|
}
|
|
1808
1812
|
function writeSettings2(settingsPath, settings) {
|
|
1809
|
-
|
|
1813
|
+
mkdirSync6(dirname6(settingsPath), { recursive: true });
|
|
1810
1814
|
writeFileSync6(settingsPath, JSON.stringify(settings, null, 2));
|
|
1811
1815
|
}
|
|
1812
1816
|
function generateHooksConfig3(port, token) {
|