Lines 1-24javascript
2import * as fs from 'node:fs/promises';
3import * as path from 'node:path';
4import * as os from 'node:os';
5import * as child_process from 'node:child_process';
6import * as fsSync from 'node:fs';
7import * as readline from 'node:readline';
8import { startCwc, describeIdleStop, probePortState, portInUse, serverResponding, waitForServer, resolveOccupant, } from '../src/server/launcher.js';
9import { fileURLToPath } from 'node:url';
10import open from 'open';
11import { SERVICE_LABEL, buildServerPlist } from '../src/server/service-plist.js';
12import { runDoctor } from '../src/detection/doctor.js';
14const CWC_DIR = path.join(os.homedir(), '.cwc');
15const PID_FILE = path.join(CWC_DIR, 'server.pid');
16const SKILL_VERSION_FILE = path.join(CWC_DIR, '.skill-version');
17const SKILL_DECLINED_FILE = path.join(CWC_DIR, '.skill-declined');
18const CLAUDE_SKILLS_DIR = path.join(os.homedir(), '.claude', 'skills');
19const SKILL_DEST = path.join(CLAUDE_SKILLS_DIR, 'cwc-generate-workflow', 'SKILL.md');
20const LAUNCH_AGENTS_DIR = path.join(os.homedir(), 'Library', 'LaunchAgents');
21const PLIST_PATH = path.join(LAUNCH_AGENTS_DIR, `${SERVICE_LABEL}.plist`);
22const SERVICE_LOG_DIR = path.join(CWC_DIR, 'logs');
23const SERVICE_STDOUT = path.join(SERVICE_LOG_DIR, 'server.out.log');
24const SERVICE_STDERR = path.join(SERVICE_LOG_DIR, 'server.err.log');
MediumInstall Persistence
Source writes installer persistence such as shell profile or service configuration.
dist/bin/cwc.jsView on unpkg · L4