setup-cc-room 0.2.1 → 0.2.3
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/chunk-3AMPTQ5K.js +20 -0
- package/dist/chunk-DXODI3WA.js +151 -0
- package/dist/chunk-EF2H256X.js +131 -0
- package/dist/chunk-KEFBOTQD.js +22 -0
- package/dist/chunk-MSQUTURC.js +119 -0
- package/dist/chunk-MVD6RIS2.js +120 -0
- package/dist/chunk-OYW7MM4W.js +278 -0
- package/dist/chunk-RYVZHEHF.js +169 -0
- package/dist/chunk-SMSDMP5O.js +125 -0
- package/dist/chunk-URM67EVS.js +123 -0
- package/dist/chunk-Z3DH4ZOT.js +125 -0
- package/dist/chunk-ZDOKJ4KX.js +132 -0
- package/dist/daemon-resolver.d.ts +1 -2
- package/dist/daemon-resolver.js +1 -3
- package/dist/i18n.d.ts +7 -0
- package/dist/i18n.js +12 -0
- package/dist/index.js +43 -54
- package/dist/installer.d.ts +5 -2
- package/dist/installer.js +9 -6
- package/dist/register-service.d.ts +3 -1
- package/dist/register-service.js +5 -1
- package/dist/settings-merger.d.ts +31 -1
- package/dist/settings-merger.js +9 -1
- package/dist/uninstaller.js +3 -2
- package/dist/validators.js +2 -1
- package/package.json +2 -2
- package/vendor/commands/room/en/private.md +75 -0
- package/vendor/commands/room/en/room.md +475 -0
- package/vendor/commands/room/en/show.md +149 -0
- package/vendor/daemon/dist/index.js +20 -0
- /package/vendor/commands/room/{private.md → ja/private.md} +0 -0
- /package/vendor/commands/room/{room.md → ja/room.md} +0 -0
- /package/vendor/commands/room/{show.md → ja/show.md} +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {
|
|
2
|
+
unmergeSettings
|
|
3
|
+
} from "./chunk-DXODI3WA.js";
|
|
4
|
+
import {
|
|
5
|
+
t
|
|
6
|
+
} from "./chunk-OYW7MM4W.js";
|
|
7
|
+
import {
|
|
8
|
+
resolveCcRoomDir
|
|
9
|
+
} from "./chunk-WCEABGOA.js";
|
|
10
|
+
|
|
11
|
+
// src/uninstaller.ts
|
|
12
|
+
import {
|
|
13
|
+
existsSync,
|
|
14
|
+
mkdirSync,
|
|
15
|
+
rmSync,
|
|
16
|
+
unlinkSync
|
|
17
|
+
} from "fs";
|
|
18
|
+
import { join } from "path";
|
|
19
|
+
import { homedir, platform } from "os";
|
|
20
|
+
import { execFileSync, spawnSync } from "child_process";
|
|
21
|
+
var COMMAND_FILES = ["room.md", "private.md", "show.md"];
|
|
22
|
+
function getLaunchdPlistPath(home = homedir()) {
|
|
23
|
+
return join(home, "Library", "LaunchAgents", "dev.ccroom.daemon.plist");
|
|
24
|
+
}
|
|
25
|
+
function getSystemdUnitPath(home = homedir()) {
|
|
26
|
+
return join(home, ".config", "systemd", "user", "cc-room-daemon.service");
|
|
27
|
+
}
|
|
28
|
+
function stopLaunchd(plistPath) {
|
|
29
|
+
if (!existsSync(plistPath)) {
|
|
30
|
+
console.log(t("un.launchd_none"));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
execFileSync("launchctl", ["unload", plistPath], { stdio: "pipe" });
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
unlinkSync(plistPath);
|
|
39
|
+
console.log(t("un.launchd_ok", { path: plistPath }));
|
|
40
|
+
} catch (err) {
|
|
41
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
42
|
+
console.log(t("un.plist_fail", { msg }));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function stopSystemd(unitPath) {
|
|
46
|
+
try {
|
|
47
|
+
execFileSync("systemctl", ["--user", "disable", "--now", "cc-room-daemon"], { stdio: "pipe" });
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
50
|
+
if (existsSync(unitPath)) {
|
|
51
|
+
try {
|
|
52
|
+
unlinkSync(unitPath);
|
|
53
|
+
console.log(t("un.systemd_ok", { path: unitPath }));
|
|
54
|
+
} catch (err) {
|
|
55
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
56
|
+
console.log(t("un.unit_fail", { msg }));
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
console.log(t("un.systemd_none"));
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
execFileSync("systemctl", ["--user", "daemon-reload"], { stdio: "pipe" });
|
|
63
|
+
} catch {
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function removeCommandFiles(commandsDir) {
|
|
67
|
+
mkdirSync(commandsDir, { recursive: true });
|
|
68
|
+
let removed = 0;
|
|
69
|
+
for (const name of COMMAND_FILES) {
|
|
70
|
+
const path = join(commandsDir, name);
|
|
71
|
+
if (existsSync(path)) {
|
|
72
|
+
unlinkSync(path);
|
|
73
|
+
removed++;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
console.log(t("un.commands_ok", { count: removed, dir: commandsDir }));
|
|
77
|
+
}
|
|
78
|
+
function removeCcRoomData(ccRoomDir) {
|
|
79
|
+
if (!existsSync(ccRoomDir)) {
|
|
80
|
+
console.log(t("un.data_skip", { dir: ccRoomDir }));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
rmSync(ccRoomDir, { recursive: true, force: true });
|
|
84
|
+
console.log(t("un.data_ok", { dir: ccRoomDir }));
|
|
85
|
+
}
|
|
86
|
+
function stopOrphanDaemon() {
|
|
87
|
+
if (platform() === "win32") {
|
|
88
|
+
spawnSync("taskkill", ["/F", "/IM", "cc-room-daemon.exe"], { stdio: "pipe" });
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
spawnSync("pkill", ["-f", "cc-room-daemon"], { stdio: "pipe" });
|
|
92
|
+
}
|
|
93
|
+
async function uninstall() {
|
|
94
|
+
const ccRoomDir = resolveCcRoomDir();
|
|
95
|
+
const commandsDir = join(homedir(), ".claude", "commands");
|
|
96
|
+
const os = platform();
|
|
97
|
+
console.log(t("un.step1"));
|
|
98
|
+
if (os === "darwin") {
|
|
99
|
+
stopLaunchd(getLaunchdPlistPath());
|
|
100
|
+
} else if (os === "linux") {
|
|
101
|
+
stopSystemd(getSystemdUnitPath());
|
|
102
|
+
} else {
|
|
103
|
+
console.log(t("un.os_manual", { os }));
|
|
104
|
+
}
|
|
105
|
+
stopOrphanDaemon();
|
|
106
|
+
console.log(t("un.step2"));
|
|
107
|
+
removeCommandFiles(commandsDir);
|
|
108
|
+
console.log(t("un.step3"));
|
|
109
|
+
unmergeSettings();
|
|
110
|
+
console.log(t("un.step4"));
|
|
111
|
+
removeCcRoomData(ccRoomDir);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export {
|
|
115
|
+
getLaunchdPlistPath,
|
|
116
|
+
getSystemdUnitPath,
|
|
117
|
+
stopLaunchd,
|
|
118
|
+
stopSystemd,
|
|
119
|
+
removeCommandFiles,
|
|
120
|
+
removeCcRoomData,
|
|
121
|
+
stopOrphanDaemon,
|
|
122
|
+
uninstall
|
|
123
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveDaemonSource
|
|
3
|
+
} from "./chunk-3AMPTQ5K.js";
|
|
4
|
+
import {
|
|
5
|
+
registerService
|
|
6
|
+
} from "./chunk-EF2H256X.js";
|
|
7
|
+
import {
|
|
8
|
+
mergeSettings
|
|
9
|
+
} from "./chunk-DXODI3WA.js";
|
|
10
|
+
import {
|
|
11
|
+
t
|
|
12
|
+
} from "./chunk-OYW7MM4W.js";
|
|
13
|
+
import {
|
|
14
|
+
resolveCcRoomDir
|
|
15
|
+
} from "./chunk-WCEABGOA.js";
|
|
16
|
+
|
|
17
|
+
// src/installer.ts
|
|
18
|
+
import {
|
|
19
|
+
mkdirSync,
|
|
20
|
+
writeFileSync,
|
|
21
|
+
existsSync,
|
|
22
|
+
copyFileSync,
|
|
23
|
+
chmodSync,
|
|
24
|
+
unlinkSync
|
|
25
|
+
} from "fs";
|
|
26
|
+
import { join, dirname } from "path";
|
|
27
|
+
import { homedir } from "os";
|
|
28
|
+
import { execFileSync, spawnSync } from "child_process";
|
|
29
|
+
import { fileURLToPath } from "url";
|
|
30
|
+
import { stringify } from "yaml";
|
|
31
|
+
var CC_ROOM_DIR = resolveCcRoomDir();
|
|
32
|
+
var BIN_DIR = join(CC_ROOM_DIR, "bin");
|
|
33
|
+
var CONFIG_PATH = join(CC_ROOM_DIR, "config.yaml");
|
|
34
|
+
var COMMANDS_DIR = join(homedir(), ".claude", "commands");
|
|
35
|
+
var THIS_DIR = dirname(fileURLToPath(import.meta.url));
|
|
36
|
+
var SETUP_PACKAGE_ROOT = join(THIS_DIR, "..");
|
|
37
|
+
function getGitUserName() {
|
|
38
|
+
try {
|
|
39
|
+
return execFileSync("git", ["config", "user.name"], { encoding: "utf-8", stdio: "pipe" }).trim();
|
|
40
|
+
} catch {
|
|
41
|
+
return "unknown";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function resolveCommandSources(setupPackageRoot, locale) {
|
|
45
|
+
const candidates = [
|
|
46
|
+
join(setupPackageRoot, "vendor", "commands", "room", locale),
|
|
47
|
+
join(setupPackageRoot, "..", "commands", "room", locale),
|
|
48
|
+
// legacy flat layout (pre-i18n)
|
|
49
|
+
join(setupPackageRoot, "vendor", "commands", "room"),
|
|
50
|
+
join(setupPackageRoot, "..", "commands", "room")
|
|
51
|
+
];
|
|
52
|
+
for (const dir of candidates) {
|
|
53
|
+
if (existsSync(join(dir, "room.md"))) return dir;
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
async function install(locale = "en") {
|
|
58
|
+
console.log(t("install.step1", { dir: CC_ROOM_DIR }));
|
|
59
|
+
mkdirSync(BIN_DIR, { recursive: true });
|
|
60
|
+
const daemonSrc = resolveDaemonSource(SETUP_PACKAGE_ROOT);
|
|
61
|
+
const daemonDest = join(BIN_DIR, "cc-room-daemon");
|
|
62
|
+
if (daemonSrc) {
|
|
63
|
+
copyFileSync(daemonSrc, daemonDest);
|
|
64
|
+
chmodSync(daemonDest, 493);
|
|
65
|
+
console.log(t("install.copied", { path: daemonDest }));
|
|
66
|
+
} else {
|
|
67
|
+
const globalBin = spawnSync("which", ["cc-room-daemon"], { encoding: "utf-8" });
|
|
68
|
+
if (globalBin.status === 0) {
|
|
69
|
+
console.log(t("install.global_ok", { path: globalBin.stdout.trim() }));
|
|
70
|
+
} else {
|
|
71
|
+
console.log(` \x1B[33m\u26A0 ${t("daemon.missing")}\x1B[0m`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
console.log(t("install.step2", { path: CONFIG_PATH }));
|
|
75
|
+
if (!existsSync(CONFIG_PATH)) {
|
|
76
|
+
const identity = getGitUserName();
|
|
77
|
+
const config = {
|
|
78
|
+
identity: { name: identity },
|
|
79
|
+
ui: { locale },
|
|
80
|
+
network: { port: 7331, http_port: 7332 },
|
|
81
|
+
trust: [],
|
|
82
|
+
sessions: { default_mode: "approve", share_files: true, share_context: true },
|
|
83
|
+
privacy: {
|
|
84
|
+
public_tools: ["room_context", "room_messages", "room_files", "room_status", "room_invite", "room_share"],
|
|
85
|
+
private_patterns: [],
|
|
86
|
+
redact_after_private_tool: true
|
|
87
|
+
},
|
|
88
|
+
summarizer: { model: "claude-haiku-4-5-20251001", interval_turns: 5, interval_seconds: 30 },
|
|
89
|
+
storage: { max_bytes: 524288e3, artifact_ttl_days: 30, context_ttl_days: 7, message_ttl_days: 14 }
|
|
90
|
+
};
|
|
91
|
+
writeFileSync(CONFIG_PATH, stringify(config), { mode: 384 });
|
|
92
|
+
console.log(t("install.config_created", { path: CONFIG_PATH, identity }));
|
|
93
|
+
} else {
|
|
94
|
+
console.log(t("install.config_skip", { path: CONFIG_PATH }));
|
|
95
|
+
}
|
|
96
|
+
console.log(t("install.step3", { locale }));
|
|
97
|
+
mkdirSync(COMMANDS_DIR, { recursive: true });
|
|
98
|
+
const commandFiles = ["room.md", "private.md", "show.md"];
|
|
99
|
+
const legacyFiles = ["invite.md", "join.md", "leave.md", "files.md", "remember.md", "share.md"];
|
|
100
|
+
const commandsSrcDir = resolveCommandSources(SETUP_PACKAGE_ROOT, locale);
|
|
101
|
+
if (!commandsSrcDir) {
|
|
102
|
+
throw new Error(`Command source directory not found for locale=${locale}`);
|
|
103
|
+
}
|
|
104
|
+
for (const cmd of commandFiles) {
|
|
105
|
+
const src = join(commandsSrcDir, cmd);
|
|
106
|
+
if (!existsSync(src)) throw new Error(`Command source file not found: ${src}`);
|
|
107
|
+
copyFileSync(src, join(COMMANDS_DIR, cmd));
|
|
108
|
+
}
|
|
109
|
+
for (const legacy of legacyFiles) {
|
|
110
|
+
const dest = join(COMMANDS_DIR, legacy);
|
|
111
|
+
if (existsSync(dest)) {
|
|
112
|
+
unlinkSync(dest);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
console.log(t("install.commands_ok", { count: commandFiles.length, dir: COMMANDS_DIR }));
|
|
116
|
+
console.log(t("install.step4"));
|
|
117
|
+
mergeSettings();
|
|
118
|
+
console.log(t("install.step5"));
|
|
119
|
+
await registerService();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export {
|
|
123
|
+
resolveCommandSources,
|
|
124
|
+
install
|
|
125
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveCcRoomDir
|
|
3
|
+
} from "./chunk-WCEABGOA.js";
|
|
4
|
+
import {
|
|
5
|
+
t
|
|
6
|
+
} from "./chunk-OYW7MM4W.js";
|
|
7
|
+
|
|
8
|
+
// src/register-service.ts
|
|
9
|
+
import { writeFileSync, mkdirSync, existsSync } from "fs";
|
|
10
|
+
import { join } from "path";
|
|
11
|
+
import { homedir, platform } from "os";
|
|
12
|
+
import { execFileSync } from "child_process";
|
|
13
|
+
var CC_ROOM_DIR = resolveCcRoomDir();
|
|
14
|
+
function getDaemonBinPath() {
|
|
15
|
+
try {
|
|
16
|
+
const which = execFileSync("which", ["cc-room-daemon"], { encoding: "utf-8", stdio: "pipe" }).trim();
|
|
17
|
+
if (which) return which;
|
|
18
|
+
} catch {
|
|
19
|
+
}
|
|
20
|
+
return join(CC_ROOM_DIR, "bin", "cc-room-daemon");
|
|
21
|
+
}
|
|
22
|
+
function ccRoomHomeEnvXml() {
|
|
23
|
+
if (!process.env.CC_ROOM_HOME) return "";
|
|
24
|
+
return `
|
|
25
|
+
<key>CC_ROOM_HOME</key>
|
|
26
|
+
<string>${process.env.CC_ROOM_HOME}</string>`;
|
|
27
|
+
}
|
|
28
|
+
function registerLaunchd() {
|
|
29
|
+
const plistDir = join(homedir(), "Library", "LaunchAgents");
|
|
30
|
+
const plistPath = join(plistDir, "dev.ccroom.daemon.plist");
|
|
31
|
+
const daemonBin = getDaemonBinPath();
|
|
32
|
+
const logPath = join(CC_ROOM_DIR, "logs", "daemon.log");
|
|
33
|
+
mkdirSync(join(CC_ROOM_DIR, "logs"), { recursive: true });
|
|
34
|
+
mkdirSync(plistDir, { recursive: true });
|
|
35
|
+
const plist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
36
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
37
|
+
<plist version="1.0">
|
|
38
|
+
<dict>
|
|
39
|
+
<key>Label</key>
|
|
40
|
+
<string>dev.ccroom.daemon</string>
|
|
41
|
+
<key>ProgramArguments</key>
|
|
42
|
+
<array>
|
|
43
|
+
<string>${daemonBin}</string>
|
|
44
|
+
</array>
|
|
45
|
+
<key>KeepAlive</key>
|
|
46
|
+
<true/>
|
|
47
|
+
<key>RunAtLoad</key>
|
|
48
|
+
<true/>
|
|
49
|
+
<key>StandardOutPath</key>
|
|
50
|
+
<string>${logPath}</string>
|
|
51
|
+
<key>StandardErrorPath</key>
|
|
52
|
+
<string>${logPath}</string>
|
|
53
|
+
<key>EnvironmentVariables</key>
|
|
54
|
+
<dict>
|
|
55
|
+
<key>PATH</key>
|
|
56
|
+
<string>/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin</string>${ccRoomHomeEnvXml()}
|
|
57
|
+
</dict>
|
|
58
|
+
</dict>
|
|
59
|
+
</plist>
|
|
60
|
+
`;
|
|
61
|
+
writeFileSync(plistPath, plist, { mode: 420 });
|
|
62
|
+
try {
|
|
63
|
+
execFileSync("launchctl", ["unload", plistPath], { stdio: "pipe" });
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
execFileSync("launchctl", ["load", plistPath], { stdio: "pipe" });
|
|
68
|
+
console.log(t("svc.launchd_ok", { path: plistPath }));
|
|
69
|
+
} catch (err) {
|
|
70
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
71
|
+
console.log(t("svc.launchd_fail", { msg }));
|
|
72
|
+
console.log(t("svc.launchd_manual", { path: plistPath }));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function registerSystemd() {
|
|
76
|
+
const serviceDir = join(homedir(), ".config", "systemd", "user");
|
|
77
|
+
const servicePath = join(serviceDir, "cc-room-daemon.service");
|
|
78
|
+
const daemonBin = getDaemonBinPath();
|
|
79
|
+
const logPath = join(CC_ROOM_DIR, "logs", "daemon.log");
|
|
80
|
+
mkdirSync(join(CC_ROOM_DIR, "logs"), { recursive: true });
|
|
81
|
+
mkdirSync(serviceDir, { recursive: true });
|
|
82
|
+
const envLine = process.env.CC_ROOM_HOME ? `Environment=CC_ROOM_HOME=${process.env.CC_ROOM_HOME}
|
|
83
|
+
` : "";
|
|
84
|
+
const unit = `[Unit]
|
|
85
|
+
Description=cc-room daemon
|
|
86
|
+
After=network.target
|
|
87
|
+
|
|
88
|
+
[Service]
|
|
89
|
+
ExecStart=${daemonBin}
|
|
90
|
+
Restart=on-failure
|
|
91
|
+
RestartSec=5
|
|
92
|
+
${envLine}StandardOutput=append:${logPath}
|
|
93
|
+
StandardError=append:${logPath}
|
|
94
|
+
|
|
95
|
+
[Install]
|
|
96
|
+
WantedBy=default.target
|
|
97
|
+
`;
|
|
98
|
+
writeFileSync(servicePath, unit, { mode: 420 });
|
|
99
|
+
try {
|
|
100
|
+
execFileSync("systemctl", ["--user", "daemon-reload"], { stdio: "pipe" });
|
|
101
|
+
execFileSync("systemctl", ["--user", "enable", "--now", "cc-room-daemon"], { stdio: "pipe" });
|
|
102
|
+
console.log(t("svc.systemd_ok", { path: servicePath }));
|
|
103
|
+
} catch (err) {
|
|
104
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
105
|
+
console.log(t("svc.systemd_fail", { msg }));
|
|
106
|
+
console.log(t("svc.systemd_manual"));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async function registerService() {
|
|
110
|
+
const os = platform();
|
|
111
|
+
if (os === "darwin") {
|
|
112
|
+
registerLaunchd();
|
|
113
|
+
} else if (os === "linux") {
|
|
114
|
+
registerSystemd();
|
|
115
|
+
} else {
|
|
116
|
+
console.log(t("svc.unsupported", { os }));
|
|
117
|
+
}
|
|
118
|
+
const pidPath = join(CC_ROOM_DIR, "daemon.pid");
|
|
119
|
+
if (!existsSync(pidPath)) {
|
|
120
|
+
console.log(t("svc.waiting"));
|
|
121
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
122
|
+
}
|
|
123
|
+
if (existsSync(pidPath)) {
|
|
124
|
+
console.log(t("svc.started"));
|
|
125
|
+
} else {
|
|
126
|
+
console.log(t("svc.start_unconfirmed"));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
registerService
|
|
132
|
+
};
|
|
@@ -3,6 +3,5 @@
|
|
|
3
3
|
* 優先: vendor 同梱(npm / pack:vendor)→ ローカル dist-bundle
|
|
4
4
|
*/
|
|
5
5
|
declare function resolveDaemonSource(setupPackageRoot: string): string | null;
|
|
6
|
-
declare const DAEMON_MISSING_HINT = "cc-room-daemon \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u30EA\u30DD\u30B8\u30C8\u30EA\u3067\u306F `pnpm --filter setup-cc-room run pack:vendor` \u3092\u5B9F\u884C\u3059\u308B\u304B\u3001npm \u306E setup-cc-room \u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002";
|
|
7
6
|
|
|
8
|
-
export {
|
|
7
|
+
export { resolveDaemonSource };
|
package/dist/daemon-resolver.js
CHANGED
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type Locale = "en" | "ja";
|
|
2
|
+
declare function resolveLocale(argv?: string[], env?: NodeJS.ProcessEnv): Locale;
|
|
3
|
+
declare function setLocale(locale: Locale): void;
|
|
4
|
+
declare function getLocale(): Locale;
|
|
5
|
+
declare function t(key: string, vars?: Record<string, string | number>): string;
|
|
6
|
+
|
|
7
|
+
export { type Locale, getLocale, resolveLocale, setLocale, t };
|
package/dist/i18n.js
ADDED
package/dist/index.js
CHANGED
|
@@ -1,72 +1,59 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
printResults,
|
|
4
|
+
validateAll
|
|
5
|
+
} from "./chunk-RYVZHEHF.js";
|
|
2
6
|
import {
|
|
3
7
|
install
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-Z3DH4ZOT.js";
|
|
9
|
+
import "./chunk-3AMPTQ5K.js";
|
|
10
|
+
import "./chunk-EF2H256X.js";
|
|
7
11
|
import {
|
|
8
12
|
uninstall
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-ETJNYBPF.js";
|
|
13
|
+
} from "./chunk-URM67EVS.js";
|
|
14
|
+
import "./chunk-DXODI3WA.js";
|
|
12
15
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
getLocale,
|
|
17
|
+
resolveLocale,
|
|
18
|
+
setLocale,
|
|
19
|
+
t
|
|
20
|
+
} from "./chunk-OYW7MM4W.js";
|
|
21
|
+
import "./chunk-WCEABGOA.js";
|
|
16
22
|
|
|
17
23
|
// src/index.ts
|
|
18
|
-
var VERSION = "0.2.
|
|
24
|
+
var VERSION = "0.2.3";
|
|
25
|
+
function stripLangArgs(argv) {
|
|
26
|
+
const out = [];
|
|
27
|
+
for (let i = 0; i < argv.length; i++) {
|
|
28
|
+
const a = argv[i];
|
|
29
|
+
if (a === "--lang" || a === "--locale") {
|
|
30
|
+
i++;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (a.startsWith("--lang=") || a.startsWith("--locale=")) continue;
|
|
34
|
+
out.push(a);
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
19
38
|
function printHelp() {
|
|
20
|
-
console.log(
|
|
21
|
-
\u{1F3E0} setup-cc-room v${VERSION}
|
|
22
|
-
|
|
23
|
-
Usage:
|
|
24
|
-
npx setup-cc-room Install cc-room
|
|
25
|
-
npx setup-cc-room uninstall Remove cc-room (daemon, hooks, data)
|
|
26
|
-
npx setup-cc-room --help Show this help
|
|
27
|
-
`);
|
|
39
|
+
console.log(t("cli.help", { version: VERSION }));
|
|
28
40
|
}
|
|
29
41
|
async function runInstall() {
|
|
30
42
|
console.log(`
|
|
31
43
|
\u{1F3E0} setup-cc-room v${VERSION}
|
|
32
44
|
`);
|
|
33
|
-
console.log("
|
|
45
|
+
console.log(t("cli.running_preflight"));
|
|
34
46
|
const { passed, results } = validateAll();
|
|
35
47
|
printResults(results);
|
|
36
48
|
if (!passed) {
|
|
37
|
-
console.log("
|
|
49
|
+
console.log(t("cli.preflight_failed"));
|
|
38
50
|
process.exit(1);
|
|
39
51
|
}
|
|
40
|
-
console.log("
|
|
41
|
-
await install();
|
|
52
|
+
console.log(t("cli.preflight_ok"));
|
|
53
|
+
await install(getLocale());
|
|
42
54
|
console.log(`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
cc-room \u306E\u4F7F\u3044\u65B9:
|
|
46
|
-
|
|
47
|
-
\u3010\u4F1A\u8B70\u5BA4\u3092\u958B\u304F\u5834\u5408\u3011
|
|
48
|
-
1. Claude Code \u3092\u518D\u8D77\u52D5\uFF08MCP \u3068 Hooks \u3092\u6709\u52B9\u5316\uFF09
|
|
49
|
-
2. /room open <name> \u2190 \u4F1A\u8B70\u5BA4\u3092\u958B\u304F\uFF08PIN \u767A\u884C\uFF09
|
|
50
|
-
3. \u8868\u793A\u3055\u308C\u308B\u90E8\u5C4B\u540D\u3068 PIN \u3092\u76F8\u624B\u306B\u53E3\u982D\u3084 DM \u3067\u4F1D\u3048\u308B
|
|
51
|
-
4. \u76F8\u624B\u304C /room join <name> <PIN> \u3092\u5B9F\u884C\u3059\u308C\u3070\u53C2\u52A0\u5B8C\u4E86
|
|
52
|
-
|
|
53
|
-
\u3010\u62DB\u5F85\u3055\u308C\u305F\u5834\u5408\u3011
|
|
54
|
-
1. Claude Code \u3092\u518D\u8D77\u52D5
|
|
55
|
-
2. /room join <name> <PIN> \u2190 \u76F8\u624B\u304B\u3089\u53D7\u3051\u53D6\u3063\u305F\u5024\u3092\u5165\u529B
|
|
56
|
-
|
|
57
|
-
\u3010\u65E5\u5E38\u64CD\u4F5C\u3011
|
|
58
|
-
/room \u2026 \u30DB\u30EF\u30A4\u30C8\u30DC\u30FC\u30C9\u3092\u898B\u308B
|
|
59
|
-
/private \u2026 \u72B6\u614B\u8868\u793A\u3001\u624B\u5143/\u516C\u958B\u306E\u5207\u66FF\uFF08on|off|share|drop\uFF09
|
|
60
|
-
|
|
61
|
-
\u26A0\uFE0F cc-room \u306F\u81EA\u52D5\u3067\u76F8\u624B\u306B\u901A\u77E5\u3057\u307E\u305B\u3093\u3002
|
|
62
|
-
\u90E8\u5C4B\u540D\u3068 PIN \u306F\u81EA\u5206\u3067\u76F8\u624B\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002
|
|
63
|
-
|
|
64
|
-
\u63A5\u7D9A\u5F8C\u306F\u540C\u3058 WiFi\uFF08LAN\uFF09\u5185\u306B\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
|
65
|
-
\uFF08VPN \u3067\u540C\u4E00 LAN \u76F8\u5F53\u306B\u306A\u308C\u3070\u30EA\u30E2\u30FC\u30C8\u3067\u3082\u4F7F\u3048\u307E\u3059\uFF09
|
|
66
|
-
|
|
67
|
-
\u30A2\u30F3\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB: npx setup-cc-room uninstall
|
|
68
|
-
|
|
69
|
-
\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8: https://github.com/takanorisuzuki/cc-room
|
|
55
|
+
${t("cli.install_done")}
|
|
56
|
+
${t("cli.install_guide")}
|
|
70
57
|
`);
|
|
71
58
|
}
|
|
72
59
|
async function runUninstall() {
|
|
@@ -75,13 +62,15 @@ async function runUninstall() {
|
|
|
75
62
|
`);
|
|
76
63
|
await uninstall();
|
|
77
64
|
console.log(`
|
|
78
|
-
|
|
65
|
+
${t("cli.uninstall_done")}
|
|
79
66
|
|
|
80
|
-
|
|
67
|
+
${t("cli.restart_claude")}
|
|
81
68
|
`);
|
|
82
69
|
}
|
|
83
70
|
async function main() {
|
|
84
|
-
|
|
71
|
+
setLocale(resolveLocale(process.argv, process.env));
|
|
72
|
+
const args = stripLangArgs(process.argv.slice(2));
|
|
73
|
+
const arg = args[0];
|
|
85
74
|
if (arg === "--help" || arg === "-h" || arg === "help") {
|
|
86
75
|
printHelp();
|
|
87
76
|
return;
|
|
@@ -91,13 +80,13 @@ async function main() {
|
|
|
91
80
|
return;
|
|
92
81
|
}
|
|
93
82
|
if (arg && arg !== "install") {
|
|
94
|
-
console.error(
|
|
83
|
+
console.error(t("cli.unknown_arg", { arg }));
|
|
95
84
|
printHelp();
|
|
96
85
|
process.exit(1);
|
|
97
86
|
}
|
|
98
87
|
await runInstall();
|
|
99
88
|
}
|
|
100
89
|
main().catch((err) => {
|
|
101
|
-
console.error("
|
|
90
|
+
console.error(t("cli.error"), err instanceof Error ? err.message : err);
|
|
102
91
|
process.exit(1);
|
|
103
92
|
});
|
package/dist/installer.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Locale } from './i18n.js';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
declare function resolveCommandSources(setupPackageRoot: string, locale: Locale): string | null;
|
|
4
|
+
declare function install(locale?: Locale): Promise<void>;
|
|
5
|
+
|
|
6
|
+
export { install, resolveCommandSources };
|
package/dist/installer.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
install
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "./chunk-
|
|
2
|
+
install,
|
|
3
|
+
resolveCommandSources
|
|
4
|
+
} from "./chunk-Z3DH4ZOT.js";
|
|
5
|
+
import "./chunk-3AMPTQ5K.js";
|
|
6
|
+
import "./chunk-EF2H256X.js";
|
|
7
|
+
import "./chunk-DXODI3WA.js";
|
|
8
|
+
import "./chunk-OYW7MM4W.js";
|
|
6
9
|
import "./chunk-WCEABGOA.js";
|
|
7
|
-
import "./chunk-ETJNYBPF.js";
|
|
8
10
|
export {
|
|
9
|
-
install
|
|
11
|
+
install,
|
|
12
|
+
resolveCommandSources
|
|
10
13
|
};
|
package/dist/register-service.js
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
|
+
/** Claude Code hooks / MCP から呼ぶ daemon の絶対パスを解決する */
|
|
2
|
+
declare function resolveDaemonCommand(env?: NodeJS.ProcessEnv): string;
|
|
3
|
+
declare function buildCcRoomHooks(daemonBin: string): {
|
|
4
|
+
UserPromptSubmit: {
|
|
5
|
+
hooks: {
|
|
6
|
+
type: string;
|
|
7
|
+
command: string;
|
|
8
|
+
}[];
|
|
9
|
+
}[];
|
|
10
|
+
PostToolUse: {
|
|
11
|
+
matcher: string;
|
|
12
|
+
hooks: {
|
|
13
|
+
type: string;
|
|
14
|
+
command: string;
|
|
15
|
+
}[];
|
|
16
|
+
}[];
|
|
17
|
+
Stop: {
|
|
18
|
+
hooks: {
|
|
19
|
+
type: string;
|
|
20
|
+
command: string;
|
|
21
|
+
}[];
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
declare function buildCcRoomMcp(daemonBin: string): {
|
|
25
|
+
"cc-room": {
|
|
26
|
+
type: string;
|
|
27
|
+
command: string;
|
|
28
|
+
args: string[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
1
31
|
declare function mergeSettings(): void;
|
|
2
32
|
/** settings.json から cc-room の hooks / mcpServers を除去(他設定は保持) */
|
|
3
33
|
declare function stripCcRoomFromSettings(settings: Record<string, unknown>): Record<string, unknown>;
|
|
4
34
|
declare function unmergeSettings(): void;
|
|
5
35
|
|
|
6
|
-
export { mergeSettings, stripCcRoomFromSettings, unmergeSettings };
|
|
36
|
+
export { buildCcRoomHooks, buildCcRoomMcp, mergeSettings, resolveDaemonCommand, stripCcRoomFromSettings, unmergeSettings };
|
package/dist/settings-merger.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildCcRoomHooks,
|
|
3
|
+
buildCcRoomMcp,
|
|
2
4
|
mergeSettings,
|
|
5
|
+
resolveDaemonCommand,
|
|
3
6
|
stripCcRoomFromSettings,
|
|
4
7
|
unmergeSettings
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DXODI3WA.js";
|
|
9
|
+
import "./chunk-OYW7MM4W.js";
|
|
10
|
+
import "./chunk-WCEABGOA.js";
|
|
6
11
|
export {
|
|
12
|
+
buildCcRoomHooks,
|
|
13
|
+
buildCcRoomMcp,
|
|
7
14
|
mergeSettings,
|
|
15
|
+
resolveDaemonCommand,
|
|
8
16
|
stripCcRoomFromSettings,
|
|
9
17
|
unmergeSettings
|
|
10
18
|
};
|