@mclawnet/agent 0.5.8 → 0.6.1
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/cli.js +168 -61
- package/dist/__tests__/cli.test.d.ts +2 -0
- package/dist/__tests__/cli.test.d.ts.map +1 -0
- package/dist/__tests__/service-config.test.d.ts +2 -0
- package/dist/__tests__/service-config.test.d.ts.map +1 -0
- package/dist/__tests__/service-linux.test.d.ts +2 -0
- package/dist/__tests__/service-linux.test.d.ts.map +1 -0
- package/dist/__tests__/service-macos.test.d.ts +2 -0
- package/dist/__tests__/service-macos.test.d.ts.map +1 -0
- package/dist/__tests__/service-windows.test.d.ts +2 -0
- package/dist/__tests__/service-windows.test.d.ts.map +1 -0
- package/dist/backend-adapter.d.ts +2 -0
- package/dist/backend-adapter.d.ts.map +1 -1
- package/dist/{chunk-KHPEQTWF.js → chunk-KITKMSBE.js} +166 -90
- package/dist/chunk-KITKMSBE.js.map +1 -0
- package/dist/chunk-W3LSW4XY.js +95 -0
- package/dist/chunk-W3LSW4XY.js.map +1 -0
- package/dist/hub-connection.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/linux-5KQ4SCAA.js +175 -0
- package/dist/linux-5KQ4SCAA.js.map +1 -0
- package/dist/macos-FGY546NC.js +173 -0
- package/dist/macos-FGY546NC.js.map +1 -0
- package/dist/service/config.d.ts +19 -0
- package/dist/service/config.d.ts.map +1 -0
- package/dist/service/index.d.ts +6 -0
- package/dist/service/index.d.ts.map +1 -0
- package/dist/service/index.js +46 -0
- package/dist/service/index.js.map +1 -0
- package/dist/service/linux.d.ts +18 -0
- package/dist/service/linux.d.ts.map +1 -0
- package/dist/service/macos.d.ts +18 -0
- package/dist/service/macos.d.ts.map +1 -0
- package/dist/service/types.d.ts +19 -0
- package/dist/service/types.d.ts.map +1 -0
- package/dist/service/windows.d.ts +18 -0
- package/dist/service/windows.d.ts.map +1 -0
- package/dist/session-manager.d.ts +4 -7
- package/dist/session-manager.d.ts.map +1 -1
- package/dist/skill-loader.d.ts +8 -0
- package/dist/skill-loader.d.ts.map +1 -0
- package/dist/start.d.ts.map +1 -1
- package/dist/start.js +1 -1
- package/dist/windows-PIJ4CMWX.js +164 -0
- package/dist/windows-PIJ4CMWX.js.map +1 -0
- package/package.json +18 -16
- package/skills/academic-search/SKILL.md +147 -0
- package/skills/architecture/SKILL.md +294 -0
- package/skills/changelog-generator/SKILL.md +112 -0
- package/skills/chart-visualization/SKILL.md +183 -0
- package/skills/code-review/SKILL.md +304 -0
- package/skills/codebase-health/SKILL.md +281 -0
- package/skills/consulting-analysis/SKILL.md +584 -0
- package/skills/content-research-writer/SKILL.md +546 -0
- package/skills/data-analysis/SKILL.md +194 -0
- package/skills/deep-research/SKILL.md +198 -0
- package/skills/docx/SKILL.md +211 -0
- package/skills/github-deep-research/SKILL.md +207 -0
- package/skills/image-generation/SKILL.md +209 -0
- package/skills/lead-research-assistant/SKILL.md +207 -0
- package/skills/mcp-builder/SKILL.md +304 -0
- package/skills/meeting-insights-analyzer/SKILL.md +335 -0
- package/skills/pair-programming/SKILL.md +196 -0
- package/skills/pdf/SKILL.md +309 -0
- package/skills/performance-analysis/SKILL.md +261 -0
- package/skills/podcast-generation/SKILL.md +224 -0
- package/skills/pptx/SKILL.md +497 -0
- package/skills/project-learnings/SKILL.md +280 -0
- package/skills/security-audit/SKILL.md +211 -0
- package/skills/skill-creator/SKILL.md +200 -0
- package/skills/technical-writing/SKILL.md +286 -0
- package/skills/testing/SKILL.md +363 -0
- package/skills/video-generation/SKILL.md +247 -0
- package/skills/web-design-guidelines/SKILL.md +203 -0
- package/skills/webapp-testing/SKILL.md +162 -0
- package/skills/workflow-automation/SKILL.md +299 -0
- package/skills/xlsx/SKILL.md +305 -0
- package/dist/chunk-KHPEQTWF.js.map +0 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SERVICE_LABEL,
|
|
3
|
+
getCliPath,
|
|
4
|
+
getLogDir,
|
|
5
|
+
getNodePath,
|
|
6
|
+
loadServiceConfig
|
|
7
|
+
} from "./chunk-W3LSW4XY.js";
|
|
8
|
+
|
|
9
|
+
// src/service/macos.ts
|
|
10
|
+
import { execSync, spawn } from "child_process";
|
|
11
|
+
import { existsSync, writeFileSync, unlinkSync, mkdirSync, chmodSync } from "fs";
|
|
12
|
+
import { join } from "path";
|
|
13
|
+
import { homedir } from "os";
|
|
14
|
+
function getPlistPath() {
|
|
15
|
+
return join(homedir(), "Library", "LaunchAgents", `${SERVICE_LABEL}.plist`);
|
|
16
|
+
}
|
|
17
|
+
function escapeXml(str) {
|
|
18
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
19
|
+
}
|
|
20
|
+
function generatePlist(config) {
|
|
21
|
+
const nodePath = getNodePath();
|
|
22
|
+
const cliPath = getCliPath();
|
|
23
|
+
const logDir = getLogDir();
|
|
24
|
+
const envEntries = [];
|
|
25
|
+
if (config.hubUrl) {
|
|
26
|
+
envEntries.push(` <key>CLAWNET_HUB_URL</key>
|
|
27
|
+
<string>${escapeXml(config.hubUrl)}</string>`);
|
|
28
|
+
}
|
|
29
|
+
if (config.token) {
|
|
30
|
+
envEntries.push(` <key>CLAWNET_TOKEN</key>
|
|
31
|
+
<string>${escapeXml(config.token)}</string>`);
|
|
32
|
+
}
|
|
33
|
+
if (config.name) {
|
|
34
|
+
envEntries.push(` <key>CLAWNET_NAME</key>
|
|
35
|
+
<string>${escapeXml(config.name)}</string>`);
|
|
36
|
+
}
|
|
37
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
38
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
39
|
+
<plist version="1.0">
|
|
40
|
+
<dict>
|
|
41
|
+
<key>Label</key>
|
|
42
|
+
<string>${SERVICE_LABEL}</string>
|
|
43
|
+
<key>ProgramArguments</key>
|
|
44
|
+
<array>
|
|
45
|
+
<string>${nodePath}</string>
|
|
46
|
+
<string>${cliPath}</string>
|
|
47
|
+
<string>start</string>
|
|
48
|
+
<string>-f</string>
|
|
49
|
+
</array>
|
|
50
|
+
<key>WorkingDirectory</key>
|
|
51
|
+
<string>${homedir()}</string>
|
|
52
|
+
<key>EnvironmentVariables</key>
|
|
53
|
+
<dict>
|
|
54
|
+
${envEntries.join("\n")}
|
|
55
|
+
</dict>
|
|
56
|
+
<key>RunAtLoad</key>
|
|
57
|
+
<true/>
|
|
58
|
+
<key>KeepAlive</key>
|
|
59
|
+
<dict>
|
|
60
|
+
<key>SuccessfulExit</key>
|
|
61
|
+
<false/>
|
|
62
|
+
</dict>
|
|
63
|
+
<key>ThrottleInterval</key>
|
|
64
|
+
<integer>10</integer>
|
|
65
|
+
<key>StandardOutPath</key>
|
|
66
|
+
<string>${logDir}/out.log</string>
|
|
67
|
+
<key>StandardErrorPath</key>
|
|
68
|
+
<string>${logDir}/error.log</string>
|
|
69
|
+
</dict>
|
|
70
|
+
</plist>`;
|
|
71
|
+
}
|
|
72
|
+
var MacOSServiceManager = class {
|
|
73
|
+
async install() {
|
|
74
|
+
const config = loadServiceConfig();
|
|
75
|
+
const plistPath = getPlistPath();
|
|
76
|
+
const logDir = getLogDir();
|
|
77
|
+
const launchAgentsDir = join(homedir(), "Library", "LaunchAgents");
|
|
78
|
+
if (existsSync(plistPath)) {
|
|
79
|
+
try {
|
|
80
|
+
execSync(`launchctl unload "${plistPath}"`, { stdio: "ignore" });
|
|
81
|
+
} catch {
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!existsSync(launchAgentsDir)) mkdirSync(launchAgentsDir, { recursive: true });
|
|
85
|
+
if (!existsSync(logDir)) mkdirSync(logDir, { recursive: true });
|
|
86
|
+
writeFileSync(plistPath, generatePlist(config), "utf-8");
|
|
87
|
+
chmodSync(plistPath, 384);
|
|
88
|
+
console.log(`\u2713 Service registered: ${plistPath}`);
|
|
89
|
+
}
|
|
90
|
+
async uninstall() {
|
|
91
|
+
const plistPath = getPlistPath();
|
|
92
|
+
if (!existsSync(plistPath)) {
|
|
93
|
+
console.log("Service not registered");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
execSync(`launchctl unload "${plistPath}"`, { stdio: "ignore" });
|
|
98
|
+
} catch {
|
|
99
|
+
}
|
|
100
|
+
unlinkSync(plistPath);
|
|
101
|
+
console.log("\u2713 Service removed");
|
|
102
|
+
}
|
|
103
|
+
async start() {
|
|
104
|
+
const plistPath = getPlistPath();
|
|
105
|
+
if (!existsSync(plistPath)) {
|
|
106
|
+
throw new Error("Service not registered. Run clawnet-agent enable first.");
|
|
107
|
+
}
|
|
108
|
+
execSync(`launchctl load "${plistPath}"`, { stdio: "inherit" });
|
|
109
|
+
console.log("\u2713 Service started");
|
|
110
|
+
}
|
|
111
|
+
async stop() {
|
|
112
|
+
const plistPath = getPlistPath();
|
|
113
|
+
if (!existsSync(plistPath)) {
|
|
114
|
+
console.log("Service not registered");
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
execSync(`launchctl unload "${plistPath}"`, { stdio: "inherit" });
|
|
119
|
+
console.log("\u2713 Service stopped");
|
|
120
|
+
} catch {
|
|
121
|
+
console.log("Service not running");
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async restart() {
|
|
125
|
+
await this.stop();
|
|
126
|
+
await this.start();
|
|
127
|
+
}
|
|
128
|
+
async status() {
|
|
129
|
+
try {
|
|
130
|
+
const output = execSync(
|
|
131
|
+
`launchctl list | grep ${SERVICE_LABEL}`,
|
|
132
|
+
{ encoding: "utf-8" }
|
|
133
|
+
).trim();
|
|
134
|
+
if (!output) return { running: false };
|
|
135
|
+
const [pidStr, exitCodeStr] = output.split(/\s+/);
|
|
136
|
+
const pid = pidStr === "-" ? void 0 : parseInt(pidStr, 10);
|
|
137
|
+
const exitCode = parseInt(exitCodeStr, 10);
|
|
138
|
+
return { running: pid !== void 0, pid, exitCode };
|
|
139
|
+
} catch {
|
|
140
|
+
return { running: false };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async printStatus() {
|
|
144
|
+
const s = await this.status();
|
|
145
|
+
console.log("ClawNet Agent");
|
|
146
|
+
console.log(` Status: ${s.running ? "Running \u2713" : "Stopped \u2717"}`);
|
|
147
|
+
if (s.pid) console.log(` PID: ${s.pid}`);
|
|
148
|
+
if (s.exitCode !== void 0 && !s.running) console.log(` Exit code: ${s.exitCode}`);
|
|
149
|
+
console.log(" Platform: macOS (launchd)");
|
|
150
|
+
}
|
|
151
|
+
async logs(options = {}) {
|
|
152
|
+
const logDir = getLogDir();
|
|
153
|
+
const outLog = join(logDir, "out.log");
|
|
154
|
+
const errLog = join(logDir, "error.log");
|
|
155
|
+
const files = [];
|
|
156
|
+
if (existsSync(outLog)) files.push(outLog);
|
|
157
|
+
if (existsSync(errLog)) files.push(errLog);
|
|
158
|
+
if (files.length === 0) {
|
|
159
|
+
console.log("No logs yet");
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const lines = options.lines || 100;
|
|
163
|
+
const args = options.follow ? ["-f", "-n", String(lines), ...files] : ["-n", String(lines), ...files];
|
|
164
|
+
const child = spawn("tail", args, { stdio: "inherit" });
|
|
165
|
+
await new Promise((resolve) => child.on("close", resolve));
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
export {
|
|
169
|
+
MacOSServiceManager,
|
|
170
|
+
generatePlist,
|
|
171
|
+
getPlistPath
|
|
172
|
+
};
|
|
173
|
+
//# sourceMappingURL=macos-FGY546NC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/service/macos.ts"],"sourcesContent":["import { execSync, spawn } from \"child_process\";\nimport { existsSync, writeFileSync, unlinkSync, mkdirSync, chmodSync } from \"fs\";\nimport { join } from \"path\";\nimport { homedir } from \"os\";\nimport type { ServiceManager, ServiceStatus } from \"./types.js\";\nimport {\n SERVICE_LABEL,\n getLogDir,\n getNodePath,\n getCliPath,\n loadServiceConfig,\n type ServiceConfig,\n} from \"./config.js\";\n\nexport function getPlistPath(): string {\n return join(homedir(), \"Library\", \"LaunchAgents\", `${SERVICE_LABEL}.plist`);\n}\n\nfunction escapeXml(str: string): string {\n return str\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n}\n\nexport function generatePlist(config: ServiceConfig): string {\n const nodePath = getNodePath();\n const cliPath = getCliPath();\n const logDir = getLogDir();\n\n const envEntries: string[] = [];\n if (config.hubUrl) {\n envEntries.push(` <key>CLAWNET_HUB_URL</key>\\n <string>${escapeXml(config.hubUrl)}</string>`);\n }\n if (config.token) {\n envEntries.push(` <key>CLAWNET_TOKEN</key>\\n <string>${escapeXml(config.token)}</string>`);\n }\n if (config.name) {\n envEntries.push(` <key>CLAWNET_NAME</key>\\n <string>${escapeXml(config.name)}</string>`);\n }\n\n return `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n <key>Label</key>\n <string>${SERVICE_LABEL}</string>\n <key>ProgramArguments</key>\n <array>\n <string>${nodePath}</string>\n <string>${cliPath}</string>\n <string>start</string>\n <string>-f</string>\n </array>\n <key>WorkingDirectory</key>\n <string>${homedir()}</string>\n <key>EnvironmentVariables</key>\n <dict>\n${envEntries.join(\"\\n\")}\n </dict>\n <key>RunAtLoad</key>\n <true/>\n <key>KeepAlive</key>\n <dict>\n <key>SuccessfulExit</key>\n <false/>\n </dict>\n <key>ThrottleInterval</key>\n <integer>10</integer>\n <key>StandardOutPath</key>\n <string>${logDir}/out.log</string>\n <key>StandardErrorPath</key>\n <string>${logDir}/error.log</string>\n</dict>\n</plist>`;\n}\n\nexport class MacOSServiceManager implements ServiceManager {\n async install(): Promise<void> {\n const config = loadServiceConfig();\n const plistPath = getPlistPath();\n const logDir = getLogDir();\n const launchAgentsDir = join(homedir(), \"Library\", \"LaunchAgents\");\n\n if (existsSync(plistPath)) {\n try {\n execSync(`launchctl unload \"${plistPath}\"`, { stdio: \"ignore\" });\n } catch { /* ignore */ }\n }\n\n if (!existsSync(launchAgentsDir)) mkdirSync(launchAgentsDir, { recursive: true });\n if (!existsSync(logDir)) mkdirSync(logDir, { recursive: true });\n\n writeFileSync(plistPath, generatePlist(config), \"utf-8\");\n chmodSync(plistPath, 0o600);\n console.log(`✓ Service registered: ${plistPath}`);\n }\n\n async uninstall(): Promise<void> {\n const plistPath = getPlistPath();\n if (!existsSync(plistPath)) {\n console.log(\"Service not registered\");\n return;\n }\n try {\n execSync(`launchctl unload \"${plistPath}\"`, { stdio: \"ignore\" });\n } catch { /* ignore */ }\n unlinkSync(plistPath);\n console.log(\"✓ Service removed\");\n }\n\n async start(): Promise<void> {\n const plistPath = getPlistPath();\n if (!existsSync(plistPath)) {\n throw new Error(\"Service not registered. Run clawnet-agent enable first.\");\n }\n execSync(`launchctl load \"${plistPath}\"`, { stdio: \"inherit\" });\n console.log(\"✓ Service started\");\n }\n\n async stop(): Promise<void> {\n const plistPath = getPlistPath();\n if (!existsSync(plistPath)) {\n console.log(\"Service not registered\");\n return;\n }\n try {\n execSync(`launchctl unload \"${plistPath}\"`, { stdio: \"inherit\" });\n console.log(\"✓ Service stopped\");\n } catch {\n console.log(\"Service not running\");\n }\n }\n\n async restart(): Promise<void> {\n await this.stop();\n await this.start();\n }\n\n async status(): Promise<ServiceStatus> {\n try {\n const output = execSync(\n `launchctl list | grep ${SERVICE_LABEL}`,\n { encoding: \"utf-8\" }\n ).trim();\n if (!output) return { running: false };\n const [pidStr, exitCodeStr] = output.split(/\\s+/);\n const pid = pidStr === \"-\" ? undefined : parseInt(pidStr, 10);\n const exitCode = parseInt(exitCodeStr, 10);\n return { running: pid !== undefined, pid, exitCode };\n } catch {\n return { running: false };\n }\n }\n\n async printStatus(): Promise<void> {\n const s = await this.status();\n console.log(\"ClawNet Agent\");\n console.log(` Status: ${s.running ? \"Running ✓\" : \"Stopped ✗\"}`);\n if (s.pid) console.log(` PID: ${s.pid}`);\n if (s.exitCode !== undefined && !s.running) console.log(` Exit code: ${s.exitCode}`);\n console.log(\" Platform: macOS (launchd)\");\n }\n\n async logs(options: { follow?: boolean; lines?: number } = {}): Promise<void> {\n const logDir = getLogDir();\n const outLog = join(logDir, \"out.log\");\n const errLog = join(logDir, \"error.log\");\n\n const files: string[] = [];\n if (existsSync(outLog)) files.push(outLog);\n if (existsSync(errLog)) files.push(errLog);\n\n if (files.length === 0) {\n console.log(\"No logs yet\");\n return;\n }\n\n const lines = options.lines || 100;\n const args = options.follow\n ? [\"-f\", \"-n\", String(lines), ...files]\n : [\"-n\", String(lines), ...files];\n\n const child = spawn(\"tail\", args, { stdio: \"inherit\" });\n await new Promise<void>((resolve) => child.on(\"close\", resolve));\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,UAAU,aAAa;AAChC,SAAS,YAAY,eAAe,YAAY,WAAW,iBAAiB;AAC5E,SAAS,YAAY;AACrB,SAAS,eAAe;AAWjB,SAAS,eAAuB;AACrC,SAAO,KAAK,QAAQ,GAAG,WAAW,gBAAgB,GAAG,aAAa,QAAQ;AAC5E;AAEA,SAAS,UAAU,KAAqB;AACtC,SAAO,IACJ,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,QAAQ;AAC3B;AAEO,SAAS,cAAc,QAA+B;AAC3D,QAAM,WAAW,YAAY;AAC7B,QAAM,UAAU,WAAW;AAC3B,QAAM,SAAS,UAAU;AAEzB,QAAM,aAAuB,CAAC;AAC9B,MAAI,OAAO,QAAQ;AACjB,eAAW,KAAK;AAAA,gBAAmD,UAAU,OAA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AAE,SAAS,MAAM;AAAA,IAC1B;AAAA,EACF;AAAA,EAEA,MAAM,cAA6B;AACjC,UAAM,IAAI,MAAM,KAAK,OAAO;AAC5B,YAAQ,IAAI,eAAe;AAC3B,YAAQ,IAAI,aAAa,EAAE,UAAU,mBAAc,gBAAW,EAAE;AAChE,QAAI,EAAE,IAAK,SAAQ,IAAI,UAAU,EAAE,GAAG,EAAE;AACxC,QAAI,EAAE,aAAa,UAAa,CAAC,EAAE,QAAS,SAAQ,IAAI,gBAAgB,EAAE,QAAQ,EAAE;AACpF,YAAQ,IAAI,6BAA6B;AAAA,EAC3C;AAAA,EAEA,MAAM,KAAK,UAAgD,CAAC,GAAkB;AAC5E,UAAM,SAAS,UAAU;AACzB,UAAM,SAAS,KAAK,QAAQ,SAAS;AACrC,UAAM,SAAS,KAAK,QAAQ,WAAW;AAEvC,UAAM,QAAkB,CAAC;AACzB,QAAI,WAAW,MAAM,EAAG,OAAM,KAAK,MAAM;AACzC,QAAI,WAAW,MAAM,EAAG,OAAM,KAAK,MAAM;AAEzC,QAAI,MAAM,WAAW,GAAG;AACtB,cAAQ,IAAI,aAAa;AACzB;AAAA,IACF;AAEA,UAAM,QAAQ,QAAQ,SAAS;AAC/B,UAAM,OAAO,QAAQ,SACjB,CAAC,MAAM,MAAM,OAAO,KAAK,GAAG,GAAG,KAAK,IACpC,CAAC,MAAM,OAAO,KAAK,GAAG,GAAG,KAAK;AAElC,UAAM,QAAQ,MAAM,QAAQ,MAAM,EAAE,OAAO,UAAU,CAAC;AACtD,UAAM,IAAI,QAAc,CAAC,YAAY,MAAM,GAAG,SAAS,OAAO,CAAC;AAAA,EACjE;AACF;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const SERVICE_NAME = "clawnet-agent";
|
|
2
|
+
export declare const SERVICE_LABEL = "com.clawnet.agent";
|
|
3
|
+
export interface ServiceConfig {
|
|
4
|
+
hubUrl?: string;
|
|
5
|
+
token?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
workDir?: string;
|
|
8
|
+
[key: string]: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function getConfigDir(): string;
|
|
11
|
+
export declare function getLogDir(): string;
|
|
12
|
+
export declare function getServiceConfigPath(): string;
|
|
13
|
+
export declare function getNodePath(): string;
|
|
14
|
+
export declare function getCliPath(): string;
|
|
15
|
+
export declare function loadServiceConfig(): ServiceConfig;
|
|
16
|
+
export declare function saveServiceConfig(config: ServiceConfig): void;
|
|
17
|
+
export declare function validateServiceConfig(config: ServiceConfig): void;
|
|
18
|
+
export declare function mergeServiceConfig(cliOpts?: ServiceConfig): ServiceConfig;
|
|
19
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/service/config.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,aAAa,sBAAsB,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAQrC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,wBAAgB,UAAU,IAAI,MAAM,CAiBnC;AAED,wBAAgB,iBAAiB,IAAI,aAAa,CAQjD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAU7D;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAWjE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,aAAkB,GAAG,aAAa,CAO7E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ServiceManager } from "./types.js";
|
|
2
|
+
export type { ServiceManager, ServiceStatus } from "./types.js";
|
|
3
|
+
export { SERVICE_NAME, SERVICE_LABEL, getConfigDir, getLogDir, getNodePath, getCliPath, loadServiceConfig, saveServiceConfig, validateServiceConfig, mergeServiceConfig, } from "./config.js";
|
|
4
|
+
export type { ServiceConfig } from "./config.js";
|
|
5
|
+
export declare function getServiceManager(): Promise<ServiceManager>;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,SAAS,EACT,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC,CAiBjE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SERVICE_LABEL,
|
|
3
|
+
SERVICE_NAME,
|
|
4
|
+
getCliPath,
|
|
5
|
+
getConfigDir,
|
|
6
|
+
getLogDir,
|
|
7
|
+
getNodePath,
|
|
8
|
+
loadServiceConfig,
|
|
9
|
+
mergeServiceConfig,
|
|
10
|
+
saveServiceConfig,
|
|
11
|
+
validateServiceConfig
|
|
12
|
+
} from "../chunk-W3LSW4XY.js";
|
|
13
|
+
|
|
14
|
+
// src/service/index.ts
|
|
15
|
+
async function getServiceManager() {
|
|
16
|
+
switch (process.platform) {
|
|
17
|
+
case "darwin": {
|
|
18
|
+
const { MacOSServiceManager } = await import("../macos-FGY546NC.js");
|
|
19
|
+
return new MacOSServiceManager();
|
|
20
|
+
}
|
|
21
|
+
case "linux": {
|
|
22
|
+
const { LinuxServiceManager } = await import("../linux-5KQ4SCAA.js");
|
|
23
|
+
return new LinuxServiceManager();
|
|
24
|
+
}
|
|
25
|
+
case "win32": {
|
|
26
|
+
const { WindowsServiceManager } = await import("../windows-PIJ4CMWX.js");
|
|
27
|
+
return new WindowsServiceManager();
|
|
28
|
+
}
|
|
29
|
+
default:
|
|
30
|
+
throw new Error(`Unsupported platform: ${process.platform}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
SERVICE_LABEL,
|
|
35
|
+
SERVICE_NAME,
|
|
36
|
+
getCliPath,
|
|
37
|
+
getConfigDir,
|
|
38
|
+
getLogDir,
|
|
39
|
+
getNodePath,
|
|
40
|
+
getServiceManager,
|
|
41
|
+
loadServiceConfig,
|
|
42
|
+
mergeServiceConfig,
|
|
43
|
+
saveServiceConfig,
|
|
44
|
+
validateServiceConfig
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/service/index.ts"],"sourcesContent":["import type { ServiceManager } from \"./types.js\";\n\nexport type { ServiceManager, ServiceStatus } from \"./types.js\";\nexport {\n SERVICE_NAME,\n SERVICE_LABEL,\n getConfigDir,\n getLogDir,\n getNodePath,\n getCliPath,\n loadServiceConfig,\n saveServiceConfig,\n validateServiceConfig,\n mergeServiceConfig,\n} from \"./config.js\";\nexport type { ServiceConfig } from \"./config.js\";\n\nexport async function getServiceManager(): Promise<ServiceManager> {\n switch (process.platform) {\n case \"darwin\": {\n const { MacOSServiceManager } = await import(\"./macos.js\");\n return new MacOSServiceManager();\n }\n case \"linux\": {\n const { LinuxServiceManager } = await import(\"./linux.js\");\n return new LinuxServiceManager();\n }\n case \"win32\": {\n const { WindowsServiceManager } = await import(\"./windows.js\");\n return new WindowsServiceManager();\n }\n default:\n throw new Error(`Unsupported platform: ${process.platform}`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,eAAsB,oBAA6C;AACjE,UAAQ,QAAQ,UAAU;AAAA,IACxB,KAAK,UAAU;AACb,YAAM,EAAE,oBAAoB,IAAI,MAAM,OAAO,sBAAY;AACzD,aAAO,IAAI,oBAAoB;AAAA,IACjC;AAAA,IACA,KAAK,SAAS;AACZ,YAAM,EAAE,oBAAoB,IAAI,MAAM,OAAO,sBAAY;AACzD,aAAO,IAAI,oBAAoB;AAAA,IACjC;AAAA,IACA,KAAK,SAAS;AACZ,YAAM,EAAE,sBAAsB,IAAI,MAAM,OAAO,wBAAc;AAC7D,aAAO,IAAI,sBAAsB;AAAA,IACnC;AAAA,IACA;AACE,YAAM,IAAI,MAAM,yBAAyB,QAAQ,QAAQ,EAAE;AAAA,EAC/D;AACF;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ServiceManager, ServiceStatus } from "./types.js";
|
|
2
|
+
import { type ServiceConfig } from "./config.js";
|
|
3
|
+
export declare function getUnitPath(): string;
|
|
4
|
+
export declare function generateUnit(config: ServiceConfig): string;
|
|
5
|
+
export declare class LinuxServiceManager implements ServiceManager {
|
|
6
|
+
install(): Promise<void>;
|
|
7
|
+
uninstall(): Promise<void>;
|
|
8
|
+
start(): Promise<void>;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
restart(): Promise<void>;
|
|
11
|
+
status(): Promise<ServiceStatus>;
|
|
12
|
+
printStatus(): Promise<void>;
|
|
13
|
+
logs(options?: {
|
|
14
|
+
follow?: boolean;
|
|
15
|
+
lines?: number;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=linux.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linux.d.ts","sourceRoot":"","sources":["../../src/service/linux.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAErB,wBAAgB,WAAW,IAAI,MAAM,CAQpC;AAMD,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAoC1D;AAED,qBAAa,mBAAoB,YAAW,cAAc;IAClD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBxB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAmB1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAWtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IASrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IASxB,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC;IAmBhC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5B,IAAI,CACR,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GACjD,OAAO,CAAC,IAAI,CAAC;CA4BjB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ServiceManager, ServiceStatus } from "./types.js";
|
|
2
|
+
import { type ServiceConfig } from "./config.js";
|
|
3
|
+
export declare function getPlistPath(): string;
|
|
4
|
+
export declare function generatePlist(config: ServiceConfig): string;
|
|
5
|
+
export declare class MacOSServiceManager implements ServiceManager {
|
|
6
|
+
install(): Promise<void>;
|
|
7
|
+
uninstall(): Promise<void>;
|
|
8
|
+
start(): Promise<void>;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
restart(): Promise<void>;
|
|
11
|
+
status(): Promise<ServiceStatus>;
|
|
12
|
+
printStatus(): Promise<void>;
|
|
13
|
+
logs(options?: {
|
|
14
|
+
follow?: boolean;
|
|
15
|
+
lines?: number;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=macos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"macos.d.ts","sourceRoot":"","sources":["../../src/service/macos.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAErB,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAWD,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAkD3D;AAED,qBAAa,mBAAoB,YAAW,cAAc;IAClD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBxB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAa1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAcrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC;IAgBhC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAS5B,IAAI,CAAC,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAsB9E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ServiceStatus {
|
|
2
|
+
running: boolean;
|
|
3
|
+
pid?: number;
|
|
4
|
+
exitCode?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ServiceManager {
|
|
7
|
+
install(): Promise<void>;
|
|
8
|
+
uninstall(): Promise<void>;
|
|
9
|
+
start(): Promise<void>;
|
|
10
|
+
stop(): Promise<void>;
|
|
11
|
+
restart(): Promise<void>;
|
|
12
|
+
status(): Promise<ServiceStatus>;
|
|
13
|
+
printStatus(): Promise<void>;
|
|
14
|
+
logs(options?: {
|
|
15
|
+
follow?: boolean;
|
|
16
|
+
lines?: number;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/service/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IACjC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ServiceManager, ServiceStatus } from "./types.js";
|
|
2
|
+
import { type ServiceConfig } from "./config.js";
|
|
3
|
+
export declare function getEcosystemPath(): string;
|
|
4
|
+
export declare function generateEcosystem(config: ServiceConfig): string;
|
|
5
|
+
export declare class WindowsServiceManager implements ServiceManager {
|
|
6
|
+
install(): Promise<void>;
|
|
7
|
+
uninstall(): Promise<void>;
|
|
8
|
+
start(): Promise<void>;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
restart(): Promise<void>;
|
|
11
|
+
status(): Promise<ServiceStatus>;
|
|
12
|
+
printStatus(): Promise<void>;
|
|
13
|
+
logs(options?: {
|
|
14
|
+
follow?: boolean;
|
|
15
|
+
lines?: number;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=windows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows.d.ts","sourceRoot":"","sources":["../../src/service/windows.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAErB,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAkBD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CA4B/D;AAWD,qBAAa,qBAAsB,YAAW,cAAc;IACpD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBxB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAc1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IASrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IASxB,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC;IAehC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5B,IAAI,CACR,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GACjD,OAAO,CAAC,IAAI,CAAC;CASjB"}
|
|
@@ -3,13 +3,14 @@ import type { BackendAdapter, SpawnOptions } from "./backend-adapter.js";
|
|
|
3
3
|
* Manages active sessions, mapping ClawNet session IDs to BackendProcess instances.
|
|
4
4
|
*
|
|
5
5
|
* When `options.roleId` is set, the manager automatically injects:
|
|
6
|
-
* - Pipeline A: memory prompt via `--append-system-prompt`
|
|
7
|
-
*
|
|
6
|
+
* - Pipeline A: memory prompt + roleId hint via `--append-system-prompt`
|
|
7
|
+
*
|
|
8
|
+
* Note: MCP config is now handled globally via ~/.clawnet/mcp.json
|
|
9
|
+
* (mounted by ClaudeCodeAdapter), no longer generated per-session.
|
|
8
10
|
*/
|
|
9
11
|
export declare class SessionManager {
|
|
10
12
|
private sessions;
|
|
11
13
|
private conversationBuffer;
|
|
12
|
-
private mcpConfigPaths;
|
|
13
14
|
private adapter;
|
|
14
15
|
private onOutput;
|
|
15
16
|
private onTurnComplete;
|
|
@@ -40,9 +41,5 @@ export declare class SessionManager {
|
|
|
40
41
|
closeAll(): Promise<void>;
|
|
41
42
|
hasSession(sessionId: string): boolean;
|
|
42
43
|
get activeSessionCount(): number;
|
|
43
|
-
/** Generate a temporary MCP config file for the memory server. */
|
|
44
|
-
private createMemoryMcpConfig;
|
|
45
|
-
/** Remove temporary MCP config file for a session. */
|
|
46
|
-
private cleanupMcpConfig;
|
|
47
44
|
}
|
|
48
45
|
//# sourceMappingURL=session-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../src/session-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../src/session-manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAkB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOzF;;;;;;;;GAQG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,kBAAkB,CAA+D;IACzF,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,QAAQ,CAA6C;IAC7D,OAAO,CAAC,cAAc,CAQZ;IACV,OAAO,CAAC,cAAc,CAA6C;IACnE,OAAO,CAAC,aAAa,CAAC,CAA2F;gBAErG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2. Copy built-in skills (don't overwrite existing)
|
|
5
|
+
* 3. Ensure MCP config exists
|
|
6
|
+
*/
|
|
7
|
+
export declare function initSkills(): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=skill-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-loader.d.ts","sourceRoot":"","sources":["../src/skill-loader.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAIhD"}
|
package/dist/start.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAa,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAa,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC;IAC/D,GAAG,EAAE,aAAa,CAAC;IACnB,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC,CAgGD"}
|
package/dist/start.js
CHANGED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SERVICE_NAME,
|
|
3
|
+
getCliPath,
|
|
4
|
+
getConfigDir,
|
|
5
|
+
getLogDir,
|
|
6
|
+
getNodePath,
|
|
7
|
+
loadServiceConfig
|
|
8
|
+
} from "./chunk-W3LSW4XY.js";
|
|
9
|
+
|
|
10
|
+
// src/service/windows.ts
|
|
11
|
+
import { execSync, spawn } from "child_process";
|
|
12
|
+
import { existsSync, writeFileSync, unlinkSync, mkdirSync } from "fs";
|
|
13
|
+
import { join, dirname } from "path";
|
|
14
|
+
import { homedir } from "os";
|
|
15
|
+
function getEcosystemPath() {
|
|
16
|
+
return join(getConfigDir(), "ecosystem.config.cjs");
|
|
17
|
+
}
|
|
18
|
+
function getStartupBatPath() {
|
|
19
|
+
return join(
|
|
20
|
+
process.env.APPDATA || join(homedir(), "AppData", "Roaming"),
|
|
21
|
+
"Microsoft",
|
|
22
|
+
"Windows",
|
|
23
|
+
"Start Menu",
|
|
24
|
+
"Programs",
|
|
25
|
+
"Startup",
|
|
26
|
+
`${SERVICE_NAME}.bat`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function escapePath(p) {
|
|
30
|
+
return p.replace(/\\/g, "\\\\");
|
|
31
|
+
}
|
|
32
|
+
function generateEcosystem(config) {
|
|
33
|
+
const nodePath = escapePath(getNodePath());
|
|
34
|
+
const cliPath = escapePath(getCliPath());
|
|
35
|
+
const logDir = escapePath(getLogDir());
|
|
36
|
+
const env = {};
|
|
37
|
+
if (config.hubUrl) env.CLAWNET_HUB_URL = config.hubUrl;
|
|
38
|
+
if (config.token) env.CLAWNET_TOKEN = config.token;
|
|
39
|
+
if (config.name) env.CLAWNET_NAME = config.name;
|
|
40
|
+
return `module.exports = {
|
|
41
|
+
apps: [{
|
|
42
|
+
name: '${SERVICE_NAME}',
|
|
43
|
+
script: '${cliPath}',
|
|
44
|
+
args: 'start -f',
|
|
45
|
+
interpreter: '${nodePath}',
|
|
46
|
+
env: ${JSON.stringify(env, null, 6)},
|
|
47
|
+
autorestart: true,
|
|
48
|
+
watch: false,
|
|
49
|
+
max_restarts: 10,
|
|
50
|
+
restart_delay: 5000,
|
|
51
|
+
log_date_format: 'YYYY-MM-DD HH:mm:ss',
|
|
52
|
+
error_file: '${logDir}/error.log',
|
|
53
|
+
out_file: '${logDir}/out.log',
|
|
54
|
+
merge_logs: true,
|
|
55
|
+
max_memory_restart: '500M',
|
|
56
|
+
}]
|
|
57
|
+
};`;
|
|
58
|
+
}
|
|
59
|
+
function ensurePm2() {
|
|
60
|
+
try {
|
|
61
|
+
execSync("pm2 --version", { stdio: "ignore" });
|
|
62
|
+
} catch {
|
|
63
|
+
console.log("Installing PM2...");
|
|
64
|
+
execSync("npm install -g pm2", { stdio: "inherit" });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
var WindowsServiceManager = class {
|
|
68
|
+
async install() {
|
|
69
|
+
ensurePm2();
|
|
70
|
+
const config = loadServiceConfig();
|
|
71
|
+
const ecoPath = getEcosystemPath();
|
|
72
|
+
const logDir = getLogDir();
|
|
73
|
+
const configDir = getConfigDir();
|
|
74
|
+
if (!existsSync(configDir)) mkdirSync(configDir, { recursive: true });
|
|
75
|
+
if (!existsSync(logDir)) mkdirSync(logDir, { recursive: true });
|
|
76
|
+
writeFileSync(ecoPath, generateEcosystem(config), "utf-8");
|
|
77
|
+
const batPath = getStartupBatPath();
|
|
78
|
+
const batDir = dirname(batPath);
|
|
79
|
+
if (!existsSync(batDir)) mkdirSync(batDir, { recursive: true });
|
|
80
|
+
writeFileSync(batPath, `@echo off
|
|
81
|
+
pm2 resurrect
|
|
82
|
+
`, "utf-8");
|
|
83
|
+
console.log(`\u2713 Service registered: ${ecoPath}`);
|
|
84
|
+
}
|
|
85
|
+
async uninstall() {
|
|
86
|
+
try {
|
|
87
|
+
execSync(`pm2 delete ${SERVICE_NAME}`, { stdio: "ignore" });
|
|
88
|
+
execSync("pm2 save", { stdio: "ignore" });
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
91
|
+
const ecoPath = getEcosystemPath();
|
|
92
|
+
if (existsSync(ecoPath)) unlinkSync(ecoPath);
|
|
93
|
+
const batPath = getStartupBatPath();
|
|
94
|
+
if (existsSync(batPath)) unlinkSync(batPath);
|
|
95
|
+
console.log("\u2713 Service removed");
|
|
96
|
+
}
|
|
97
|
+
async start() {
|
|
98
|
+
ensurePm2();
|
|
99
|
+
const ecoPath = getEcosystemPath();
|
|
100
|
+
if (!existsSync(ecoPath)) {
|
|
101
|
+
throw new Error(
|
|
102
|
+
"Service not registered. Run clawnet-agent enable first."
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
execSync(`pm2 start ${SERVICE_NAME}`, { stdio: "ignore" });
|
|
107
|
+
} catch {
|
|
108
|
+
execSync(`pm2 start "${ecoPath}"`, { stdio: "inherit" });
|
|
109
|
+
}
|
|
110
|
+
execSync("pm2 save", { stdio: "ignore" });
|
|
111
|
+
console.log("\u2713 Service started");
|
|
112
|
+
}
|
|
113
|
+
async stop() {
|
|
114
|
+
try {
|
|
115
|
+
execSync(`pm2 stop ${SERVICE_NAME}`, { stdio: "inherit" });
|
|
116
|
+
console.log("\u2713 Service stopped");
|
|
117
|
+
} catch {
|
|
118
|
+
console.log("Service not running");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async restart() {
|
|
122
|
+
const ecoPath = getEcosystemPath();
|
|
123
|
+
if (!existsSync(ecoPath)) {
|
|
124
|
+
throw new Error("Service not registered. Run clawnet-agent enable first.");
|
|
125
|
+
}
|
|
126
|
+
execSync(`pm2 restart ${SERVICE_NAME}`, { stdio: "inherit" });
|
|
127
|
+
console.log("\u2713 Service restarted");
|
|
128
|
+
}
|
|
129
|
+
async status() {
|
|
130
|
+
try {
|
|
131
|
+
const output = execSync("pm2 jlist", { encoding: "utf-8" });
|
|
132
|
+
const apps = JSON.parse(output);
|
|
133
|
+
const app = apps.find((a) => a.name === SERVICE_NAME);
|
|
134
|
+
if (!app) return { running: false };
|
|
135
|
+
return {
|
|
136
|
+
running: app.pm2_env?.status === "online",
|
|
137
|
+
pid: app.pid
|
|
138
|
+
};
|
|
139
|
+
} catch {
|
|
140
|
+
return { running: false };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async printStatus() {
|
|
144
|
+
const s = await this.status();
|
|
145
|
+
console.log("ClawNet Agent");
|
|
146
|
+
console.log(` Status: ${s.running ? "Running \u2713" : "Stopped \u2717"}`);
|
|
147
|
+
if (s.pid) console.log(` PID: ${s.pid}`);
|
|
148
|
+
console.log(" Platform: Windows (PM2)");
|
|
149
|
+
}
|
|
150
|
+
async logs(options = {}) {
|
|
151
|
+
ensurePm2();
|
|
152
|
+
const lines = options.lines || 100;
|
|
153
|
+
const args = ["logs", SERVICE_NAME, "--lines", String(lines)];
|
|
154
|
+
if (!options.follow) args.push("--nostream");
|
|
155
|
+
const child = spawn("pm2", args, { stdio: "inherit", shell: true });
|
|
156
|
+
await new Promise((resolve) => child.on("close", resolve));
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
WindowsServiceManager,
|
|
161
|
+
generateEcosystem,
|
|
162
|
+
getEcosystemPath
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=windows-PIJ4CMWX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/service/windows.ts"],"sourcesContent":["import { execSync, spawn } from \"child_process\";\nimport { existsSync, writeFileSync, unlinkSync, mkdirSync } from \"fs\";\nimport { join, dirname } from \"path\";\nimport { homedir } from \"os\";\nimport type { ServiceManager, ServiceStatus } from \"./types.js\";\nimport {\n SERVICE_NAME,\n getConfigDir,\n getLogDir,\n getNodePath,\n getCliPath,\n loadServiceConfig,\n type ServiceConfig,\n} from \"./config.js\";\n\nexport function getEcosystemPath(): string {\n return join(getConfigDir(), \"ecosystem.config.cjs\");\n}\n\nfunction getStartupBatPath(): string {\n return join(\n process.env.APPDATA || join(homedir(), \"AppData\", \"Roaming\"),\n \"Microsoft\",\n \"Windows\",\n \"Start Menu\",\n \"Programs\",\n \"Startup\",\n `${SERVICE_NAME}.bat`,\n );\n}\n\nfunction escapePath(p: string): string {\n return p.replace(/\\\\/g, \"\\\\\\\\\");\n}\n\nexport function generateEcosystem(config: ServiceConfig): string {\n const nodePath = escapePath(getNodePath());\n const cliPath = escapePath(getCliPath());\n const logDir = escapePath(getLogDir());\n\n const env: Record<string, string> = {};\n if (config.hubUrl) env.CLAWNET_HUB_URL = config.hubUrl;\n if (config.token) env.CLAWNET_TOKEN = config.token;\n if (config.name) env.CLAWNET_NAME = config.name;\n\n return `module.exports = {\n apps: [{\n name: '${SERVICE_NAME}',\n script: '${cliPath}',\n args: 'start -f',\n interpreter: '${nodePath}',\n env: ${JSON.stringify(env, null, 6)},\n autorestart: true,\n watch: false,\n max_restarts: 10,\n restart_delay: 5000,\n log_date_format: 'YYYY-MM-DD HH:mm:ss',\n error_file: '${logDir}/error.log',\n out_file: '${logDir}/out.log',\n merge_logs: true,\n max_memory_restart: '500M',\n }]\n};`;\n}\n\nfunction ensurePm2(): void {\n try {\n execSync(\"pm2 --version\", { stdio: \"ignore\" });\n } catch {\n console.log(\"Installing PM2...\");\n execSync(\"npm install -g pm2\", { stdio: \"inherit\" });\n }\n}\n\nexport class WindowsServiceManager implements ServiceManager {\n async install(): Promise<void> {\n ensurePm2();\n const config = loadServiceConfig();\n const ecoPath = getEcosystemPath();\n const logDir = getLogDir();\n const configDir = getConfigDir();\n\n if (!existsSync(configDir)) mkdirSync(configDir, { recursive: true });\n if (!existsSync(logDir)) mkdirSync(logDir, { recursive: true });\n\n writeFileSync(ecoPath, generateEcosystem(config), \"utf-8\");\n\n const batPath = getStartupBatPath();\n const batDir = dirname(batPath);\n if (!existsSync(batDir)) mkdirSync(batDir, { recursive: true });\n writeFileSync(batPath, `@echo off\\npm2 resurrect\\n`, \"utf-8\");\n\n console.log(`\\u2713 Service registered: ${ecoPath}`);\n }\n\n async uninstall(): Promise<void> {\n try {\n execSync(`pm2 delete ${SERVICE_NAME}`, { stdio: \"ignore\" });\n execSync(\"pm2 save\", { stdio: \"ignore\" });\n } catch {\n /* ignore */\n }\n const ecoPath = getEcosystemPath();\n if (existsSync(ecoPath)) unlinkSync(ecoPath);\n const batPath = getStartupBatPath();\n if (existsSync(batPath)) unlinkSync(batPath);\n console.log(\"\\u2713 Service removed\");\n }\n\n async start(): Promise<void> {\n ensurePm2();\n const ecoPath = getEcosystemPath();\n if (!existsSync(ecoPath)) {\n throw new Error(\n \"Service not registered. Run clawnet-agent enable first.\",\n );\n }\n try {\n execSync(`pm2 start ${SERVICE_NAME}`, { stdio: \"ignore\" });\n } catch {\n execSync(`pm2 start \"${ecoPath}\"`, { stdio: \"inherit\" });\n }\n execSync(\"pm2 save\", { stdio: \"ignore\" });\n console.log(\"\\u2713 Service started\");\n }\n\n async stop(): Promise<void> {\n try {\n execSync(`pm2 stop ${SERVICE_NAME}`, { stdio: \"inherit\" });\n console.log(\"\\u2713 Service stopped\");\n } catch {\n console.log(\"Service not running\");\n }\n }\n\n async restart(): Promise<void> {\n const ecoPath = getEcosystemPath();\n if (!existsSync(ecoPath)) {\n throw new Error(\"Service not registered. Run clawnet-agent enable first.\");\n }\n execSync(`pm2 restart ${SERVICE_NAME}`, { stdio: \"inherit\" });\n console.log(\"\\u2713 Service restarted\");\n }\n\n async status(): Promise<ServiceStatus> {\n try {\n const output = execSync(\"pm2 jlist\", { encoding: \"utf-8\" });\n const apps = JSON.parse(output);\n const app = apps.find((a: any) => a.name === SERVICE_NAME);\n if (!app) return { running: false };\n return {\n running: app.pm2_env?.status === \"online\",\n pid: app.pid,\n };\n } catch {\n return { running: false };\n }\n }\n\n async printStatus(): Promise<void> {\n const s = await this.status();\n console.log(\"ClawNet Agent\");\n console.log(` Status: ${s.running ? \"Running \\u2713\" : \"Stopped \\u2717\"}`);\n if (s.pid) console.log(` PID: ${s.pid}`);\n console.log(\" Platform: Windows (PM2)\");\n }\n\n async logs(\n options: { follow?: boolean; lines?: number } = {},\n ): Promise<void> {\n ensurePm2();\n const lines = options.lines || 100;\n const args = [\"logs\", SERVICE_NAME, \"--lines\", String(lines)];\n if (!options.follow) args.push(\"--nostream\");\n\n const child = spawn(\"pm2\", args, { stdio: \"inherit\", shell: true });\n await new Promise<void>((resolve) => child.on(\"close\", resolve));\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,UAAU,aAAa;AAChC,SAAS,YAAY,eAAe,YAAY,iBAAiB;AACjE,SAAS,MAAM,eAAe;AAC9B,SAAS,eAAe;AAYjB,SAAS,mBAA2B;AACzC,SAAO,KAAK,aAAa,GAAG,sBAAsB;AACpD;AAEA,SAAS,oBAA4B;AACnC,SAAO;AAAA,IACL,QAAQ,IAAI,WAAW,KAAK,QAAQ,GAAG,WAAW,SAAS;AAAA,IAC3D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,YAAY;AAAA,EACjB;AACF;AAEA,SAAS,WAAW,GAAmB;AACrC,SAAO,EAAE,QAAQ,OAAO,MAAM;AAChC;AAEO,SAAS,kBAAkB,QAA+B;AAC/D,QAAM,WAAW,WAAW,YAAY,CAAC;AACzC,QAAM,UAAU,WAAW,WAAW,CAAC;AACvC,QAAM,SAAS,WAAW,UAAU,CAAC;AAErC,QAAM,MAA8B,CAAC;AACrC,MAAI,OAAO,OAAQ,KAAI,kBAAkB,OAAO;AAChD,MAAI,OAAO,MAAO,KAAI,gBAAgB,OAAO;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