@clawos-dev/clawd 0.2.225 → 0.2.226
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.cjs +23 -14
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -41919,7 +41919,7 @@ var CONTACT_SSH_SYSTEM_PROMPT_HINT = `## \u8DE8\u8BBE\u5907\u6587\u4EF6\u8BBF\u9
|
|
|
41919
41919
|
|
|
41920
41920
|
**\u6CE8\u610F**\uFF1A
|
|
41921
41921
|
- \u6388\u6743\u76EE\u5F55\u6570\u636E\u6E90\u5B9E\u65F6\uFF08jail \u6BCF\u6B21\u8BFB A \u4FA7\u6700\u65B0\u914D\u7F6E\uFF09\uFF0CA \u6539\u4E86\u6388\u6743\u540E\u4F60\u4E0B\u4E00\u6B21\u62E8\u53F7\u7ACB\u5373\u611F\u77E5
|
|
41922
|
-
- \u6392\u969C\uFF1A\u672C\u673A debug \u65E5\u5FD7\u5728 \`~/.clawd/contact-ssh.log\`\uFF08\u7528\u6237\u53EF \`tail -f\` \u770B\u6BCF\u4E00\u6B65\uFF09\uFF0C\u4F60\u51FA\u9519\u65F6\u544A\u8BC9\u7528\u6237\u67E5\u8FD9\u4E2A\u6587\u4EF6
|
|
41922
|
+
- \u6392\u969C\uFF1A\u672C\u673A debug \u65E5\u5FD7\u5728 \`~/.clawd/log/contact-ssh.log\`\uFF08\u7528\u6237\u53EF \`tail -f\` \u770B\u6BCF\u4E00\u6B65\uFF09\uFF0C\u4F60\u51FA\u9519\u65F6\u544A\u8BC9\u7528\u6237\u67E5\u8FD9\u4E2A\u6587\u4EF6
|
|
41923
41923
|
- \u5982\u679C \`ls ~/.clawd/contact-ssh-keys/\` \u4E3A\u7A7A\uFF0C\u8BF4\u660E\u8FD8\u6CA1\u6709\u5BF9\u7AEF\u6388\u6743\u4F60\u6216 key \u8FD8\u6CA1\u62C9\u5230\uFF08B \u4FA7 daemon \u6BCF 60s \u4E00\u6B21\u81EA\u52A8\u62C9\uFF09\uFF0C\u5982\u5B9E\u544A\u8BC9\u7528\u6237
|
|
41924
41924
|
`;
|
|
41925
41925
|
|
|
@@ -53190,7 +53190,9 @@ var TunnelManager = class {
|
|
|
53190
53190
|
const proc = (this.deps.spawnImpl ?? import_node_child_process9.spawn)(frpcBin, ["-c", tomlPath], {
|
|
53191
53191
|
stdio: ["ignore", "pipe", "pipe"]
|
|
53192
53192
|
});
|
|
53193
|
-
const
|
|
53193
|
+
const logDir = import_node_path35.default.join(this.deps.dataDir, "log");
|
|
53194
|
+
import_node_fs34.default.mkdirSync(logDir, { recursive: true });
|
|
53195
|
+
const logFilePath = import_node_path35.default.join(logDir, "frpc.log");
|
|
53194
53196
|
const logStream = import_node_fs34.default.createWriteStream(logFilePath, { flags: "a", mode: 384 });
|
|
53195
53197
|
logStream.on("error", () => {
|
|
53196
53198
|
});
|
|
@@ -53431,8 +53433,11 @@ var CLAWD_SSH_JAIL_SCRIPT = String.raw`#!/usr/bin/env bash
|
|
|
53431
53433
|
|
|
53432
53434
|
set -euo pipefail
|
|
53433
53435
|
|
|
53434
|
-
# 用户可读审计日志:追加到 ~/.clawd/contact-ssh.log(跟 daemon TS 侧 contact-ssh-log.ts 共写)
|
|
53435
|
-
|
|
53436
|
+
# 用户可读审计日志:追加到 ~/.clawd/log/contact-ssh.log(跟 daemon TS 侧 contact-ssh-log.ts 共写)
|
|
53437
|
+
# bash 侧写死 ~/.clawd/log/,因为 jail 脚本在 authorized_keys command= 里被 sshd 起,
|
|
53438
|
+
# 拿不到 daemon --data-dir 覆盖。dev daemon 用 --data-dir=/tmp/x 时 jail 仍写 ~/.clawd/log/,
|
|
53439
|
+
# 跟改动前 (~/.clawd/contact-ssh.log) 一样的分歧行为,不做统一。
|
|
53440
|
+
CONTACT_SSH_LOG="${"${HOME}"}/.clawd/log/contact-ssh.log"
|
|
53436
53441
|
log_line() {
|
|
53437
53442
|
# 参数: level tag msg
|
|
53438
53443
|
local ts
|
|
@@ -53629,7 +53634,9 @@ var SshdManager = class {
|
|
|
53629
53634
|
const proc = (this.deps.spawnImpl ?? import_node_child_process11.spawn)(sshdBin, ["-D", "-e", "-f", configPath], {
|
|
53630
53635
|
stdio: ["ignore", "pipe", "pipe"]
|
|
53631
53636
|
});
|
|
53632
|
-
const
|
|
53637
|
+
const sshdLogDir = import_node_path39.default.join(this.deps.dataDir, "log");
|
|
53638
|
+
import_node_fs38.default.mkdirSync(sshdLogDir, { recursive: true });
|
|
53639
|
+
const logStream = import_node_fs38.default.createWriteStream(import_node_path39.default.join(sshdLogDir, "sshd.log"), {
|
|
53633
53640
|
flags: "a",
|
|
53634
53641
|
mode: 384
|
|
53635
53642
|
});
|
|
@@ -53810,7 +53817,7 @@ var import_node_path42 = __toESM(require("path"), 1);
|
|
|
53810
53817
|
var import_node_fs40 = __toESM(require("fs"), 1);
|
|
53811
53818
|
var import_node_path41 = __toESM(require("path"), 1);
|
|
53812
53819
|
function createContactSshLog(dataDir) {
|
|
53813
|
-
const file = import_node_path41.default.join(dataDir, "contact-ssh.log");
|
|
53820
|
+
const file = import_node_path41.default.join(dataDir, "log", "contact-ssh.log");
|
|
53814
53821
|
function append(level, tag, message, meta) {
|
|
53815
53822
|
const time = (/* @__PURE__ */ new Date()).toISOString();
|
|
53816
53823
|
let line = `[${time}] [${level}] [${tag}] ${message}`;
|
|
@@ -59421,18 +59428,20 @@ async function startDaemon(config) {
|
|
|
59421
59428
|
sampling: logShippingCfg.sampling,
|
|
59422
59429
|
homeDir: import_node_os21.default.homedir()
|
|
59423
59430
|
});
|
|
59431
|
+
const logDir = import_node_path64.default.join(config.dataDir, "log");
|
|
59432
|
+
import_node_fs51.default.mkdirSync(logDir, { recursive: true });
|
|
59424
59433
|
const logger = createLogger({
|
|
59425
59434
|
level: config.logLevel,
|
|
59426
|
-
file: import_node_path64.default.join(
|
|
59435
|
+
file: import_node_path64.default.join(logDir, "clawd.log"),
|
|
59427
59436
|
logClient
|
|
59428
59437
|
});
|
|
59429
59438
|
logger.info("starting clawd", { version, config: { port: config.port, host: config.host, dataDir: config.dataDir } });
|
|
59430
59439
|
const screenIdleProbeLogger = createFileOnlyLogger({
|
|
59431
|
-
file: import_node_path64.default.join(
|
|
59440
|
+
file: import_node_path64.default.join(logDir, "screen-idle-probe.log"),
|
|
59432
59441
|
level: "debug"
|
|
59433
59442
|
});
|
|
59434
59443
|
logger.info("screen-idle probe logger enabled", {
|
|
59435
|
-
file: import_node_path64.default.join(
|
|
59444
|
+
file: import_node_path64.default.join(logDir, "screen-idle-probe.log")
|
|
59436
59445
|
});
|
|
59437
59446
|
const stateMgr = new StateFileManager({ dataDir: config.dataDir });
|
|
59438
59447
|
const pre = stateMgr.preflight();
|
|
@@ -59603,7 +59612,7 @@ async function startDaemon(config) {
|
|
|
59603
59612
|
const dispatchServerScriptPath = dispatchServerCandidates.find((p2) => import_node_fs51.default.existsSync(p2));
|
|
59604
59613
|
let dispatchMcpConfigPath2;
|
|
59605
59614
|
if (dispatchServerScriptPath) {
|
|
59606
|
-
const dispatchLogPath = import_node_path64.default.join(
|
|
59615
|
+
const dispatchLogPath = import_node_path64.default.join(logDir, "dispatch-mcp-server.log");
|
|
59607
59616
|
dispatchMcpConfigPath2 = writeDispatchMcpConfig({
|
|
59608
59617
|
dataDir: config.dataDir,
|
|
59609
59618
|
serverScriptPath: dispatchServerScriptPath,
|
|
@@ -59626,7 +59635,7 @@ async function startDaemon(config) {
|
|
|
59626
59635
|
const ticketServerScriptPath = ticketServerCandidates.find((p2) => import_node_fs51.default.existsSync(p2));
|
|
59627
59636
|
let ticketMcpConfigPath2;
|
|
59628
59637
|
if (ticketServerScriptPath) {
|
|
59629
|
-
const ticketLogPath = import_node_path64.default.join(
|
|
59638
|
+
const ticketLogPath = import_node_path64.default.join(logDir, "ticket-mcp-server.log");
|
|
59630
59639
|
ticketMcpConfigPath2 = writeTicketMcpConfig({
|
|
59631
59640
|
dataDir: config.dataDir,
|
|
59632
59641
|
serverScriptPath: ticketServerScriptPath,
|
|
@@ -59651,7 +59660,7 @@ async function startDaemon(config) {
|
|
|
59651
59660
|
const shiftServerScriptPath = shiftServerCandidates.find((p2) => import_node_fs51.default.existsSync(p2));
|
|
59652
59661
|
let shiftMcpConfigPath2;
|
|
59653
59662
|
if (shiftServerScriptPath) {
|
|
59654
|
-
const shiftLogPath = import_node_path64.default.join(
|
|
59663
|
+
const shiftLogPath = import_node_path64.default.join(logDir, "shift-mcp-server.log");
|
|
59655
59664
|
shiftMcpConfigPath2 = await writeShiftMcpConfig({
|
|
59656
59665
|
dataDir: config.dataDir,
|
|
59657
59666
|
serverScriptPath: shiftServerScriptPath,
|
|
@@ -59675,7 +59684,7 @@ async function startDaemon(config) {
|
|
|
59675
59684
|
const inboxServerScriptPath = inboxServerCandidates.find((p2) => import_node_fs51.default.existsSync(p2));
|
|
59676
59685
|
let inboxMcpConfigPath2;
|
|
59677
59686
|
if (inboxServerScriptPath) {
|
|
59678
|
-
const inboxLogPath = import_node_path64.default.join(
|
|
59687
|
+
const inboxLogPath = import_node_path64.default.join(logDir, "inbox-mcp-server.log");
|
|
59679
59688
|
inboxMcpConfigPath2 = await writeInboxMcpConfig({
|
|
59680
59689
|
dataDir: config.dataDir,
|
|
59681
59690
|
serverScriptPath: inboxServerScriptPath,
|
|
@@ -60487,7 +60496,7 @@ async function startDaemon(config) {
|
|
|
60487
60496
|
`Tunnel: ${r.url}`,
|
|
60488
60497
|
...resolvedAuthToken ? [`Connect: ${connectUrl}`] : [],
|
|
60489
60498
|
`Frpc config: ${import_node_path64.default.join(config.dataDir, "frpc.toml")}`,
|
|
60490
|
-
`Frpc log: ${import_node_path64.default.join(
|
|
60499
|
+
`Frpc log: ${import_node_path64.default.join(logDir, "frpc.log")}`
|
|
60491
60500
|
];
|
|
60492
60501
|
const width = Math.max(...lines.map((l) => l.length));
|
|
60493
60502
|
const bar = "\u2550".repeat(width + 4);
|