claude-code-watchos 0.1.0
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 +47 -0
- package/dist/src/cli/serve.d.ts +6 -0
- package/dist/src/cli/serve.d.ts.map +1 -0
- package/dist/src/cli/serve.js +9 -0
- package/dist/src/cli/serve.js.map +1 -0
- package/dist/src/cli/setup.d.ts +5 -0
- package/dist/src/cli/setup.d.ts.map +1 -0
- package/dist/src/cli/setup.js +215 -0
- package/dist/src/cli/setup.js.map +1 -0
- package/dist/src/cli/status.d.ts +5 -0
- package/dist/src/cli/status.d.ts.map +1 -0
- package/dist/src/cli/status.js +73 -0
- package/dist/src/cli/status.js.map +1 -0
- package/dist/src/cli/unpair.d.ts +5 -0
- package/dist/src/cli/unpair.d.ts.map +1 -0
- package/dist/src/cli/unpair.js +65 -0
- package/dist/src/cli/unpair.js.map +1 -0
- package/dist/src/cloud/client.d.ts +58 -0
- package/dist/src/cloud/client.d.ts.map +1 -0
- package/dist/src/cloud/client.js +166 -0
- package/dist/src/cloud/client.js.map +1 -0
- package/dist/src/cloud/pairing.d.ts +51 -0
- package/dist/src/cloud/pairing.d.ts.map +1 -0
- package/dist/src/cloud/pairing.js +131 -0
- package/dist/src/cloud/pairing.js.map +1 -0
- package/dist/src/config/mcp-config.d.ts +26 -0
- package/dist/src/config/mcp-config.d.ts.map +1 -0
- package/dist/src/config/mcp-config.js +76 -0
- package/dist/src/config/mcp-config.js.map +1 -0
- package/dist/src/config/pairing-store.d.ts +38 -0
- package/dist/src/config/pairing-store.d.ts.map +1 -0
- package/dist/src/config/pairing-store.js +91 -0
- package/dist/src/config/pairing-store.js.map +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +68 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/server/index.d.ts +12 -0
- package/dist/src/server/index.d.ts.map +1 -0
- package/dist/src/server/index.js +74 -0
- package/dist/src/server/index.js.map +1 -0
- package/dist/src/server/state.d.ts +64 -0
- package/dist/src/server/state.d.ts.map +1 -0
- package/dist/src/server/state.js +194 -0
- package/dist/src/server/state.js.map +1 -0
- package/dist/src/server/tools.d.ts +258 -0
- package/dist/src/server/tools.d.ts.map +1 -0
- package/dist/src/server/tools.js +177 -0
- package/dist/src/server/tools.js.map +1 -0
- package/dist/src/types/index.d.ts +212 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +90 -0
- package/dist/src/types/index.js.map +1 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Claude Watch
|
|
2
|
+
|
|
3
|
+
Control Claude Code from your Apple Watch. Approve actions, track progress, and receive notifications.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx claude-code-watchos
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Enter the pairing code shown on your Apple Watch to connect.
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
| Command | Description |
|
|
16
|
+
|---------|-------------|
|
|
17
|
+
| `npx claude-code-watchos` | Interactive setup wizard |
|
|
18
|
+
| `npx claude-code-watchos status` | Check connection status |
|
|
19
|
+
| `npx claude-code-watchos serve` | Start MCP server (called by Claude Code) |
|
|
20
|
+
| `npx claude-code-watchos unpair` | Remove configuration |
|
|
21
|
+
|
|
22
|
+
## How It Works
|
|
23
|
+
|
|
24
|
+
1. **Pair** - Run `npx claude-code-watchos` and enter the code on your watch
|
|
25
|
+
2. **Configure** - Claude Code's MCP config is updated automatically
|
|
26
|
+
3. **Use** - Claude will send approval requests to your watch
|
|
27
|
+
|
|
28
|
+
## MCP Tools
|
|
29
|
+
|
|
30
|
+
When paired, Claude Code gets access to these tools:
|
|
31
|
+
|
|
32
|
+
- `watch_notify` - Send notifications to your watch
|
|
33
|
+
- `watch_request_approval` - Request approval for actions
|
|
34
|
+
- `watch_update_progress` - Update task progress
|
|
35
|
+
- `watch_set_task` - Set current task name
|
|
36
|
+
- `watch_complete_task` - Mark task complete
|
|
37
|
+
- `watch_get_state` - Get session state
|
|
38
|
+
|
|
39
|
+
## Requirements
|
|
40
|
+
|
|
41
|
+
- Node.js 18+
|
|
42
|
+
- Apple Watch with Claude Watch app
|
|
43
|
+
- Claude Code CLI
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/cli/serve.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAE9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/cli/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,MAAM,YAAY,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/cli/setup.ts"],"names":[],"mappings":"AA2MA;;GAEG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAwD9C"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import ora from "ora";
|
|
3
|
+
import prompts from "prompts";
|
|
4
|
+
import { savePairingConfig, isPaired, readPairingConfig, createPairingConfig, } from "../config/pairing-store.js";
|
|
5
|
+
import { addClaudeWatchServer, isClaudeWatchConfigured, getMCPConfigPath, } from "../config/mcp-config.js";
|
|
6
|
+
import { PairingSession, createLocalPairing } from "../cloud/pairing.js";
|
|
7
|
+
import { CloudClient } from "../cloud/client.js";
|
|
8
|
+
/**
|
|
9
|
+
* Display the header
|
|
10
|
+
*/
|
|
11
|
+
function showHeader() {
|
|
12
|
+
console.log();
|
|
13
|
+
console.log(chalk.bold.cyan(" Claude Watch Setup"));
|
|
14
|
+
console.log();
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Check if already configured
|
|
18
|
+
*/
|
|
19
|
+
async function checkExistingConfig() {
|
|
20
|
+
if (isPaired() && isClaudeWatchConfigured()) {
|
|
21
|
+
const config = readPairingConfig();
|
|
22
|
+
console.log(chalk.yellow(" Already configured!"));
|
|
23
|
+
console.log();
|
|
24
|
+
console.log(` Pairing ID: ${chalk.dim(config?.pairingId?.slice(0, 8) + "...")}`);
|
|
25
|
+
console.log(` Cloud URL: ${chalk.dim(config?.cloudUrl)}`);
|
|
26
|
+
console.log();
|
|
27
|
+
const response = await prompts({
|
|
28
|
+
type: "confirm",
|
|
29
|
+
name: "reconfigure",
|
|
30
|
+
message: "Do you want to reconfigure?",
|
|
31
|
+
initial: false,
|
|
32
|
+
});
|
|
33
|
+
if (!response.reconfigure) {
|
|
34
|
+
console.log();
|
|
35
|
+
console.log(chalk.green(" No changes made."));
|
|
36
|
+
console.log();
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Ask for connection mode
|
|
44
|
+
*/
|
|
45
|
+
async function askConnectionMode() {
|
|
46
|
+
const response = await prompts({
|
|
47
|
+
type: "select",
|
|
48
|
+
name: "mode",
|
|
49
|
+
message: "How do you want to connect?",
|
|
50
|
+
choices: [
|
|
51
|
+
{
|
|
52
|
+
title: "Cloud Mode (recommended)",
|
|
53
|
+
description: "Uses cloud relay for easy pairing with your watch",
|
|
54
|
+
value: "cloud",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
title: "Local Mode",
|
|
58
|
+
description: "Direct connection (requires same network)",
|
|
59
|
+
value: "local",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
initial: 0,
|
|
63
|
+
});
|
|
64
|
+
return response.mode;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Run cloud pairing flow
|
|
68
|
+
*/
|
|
69
|
+
async function runCloudPairing() {
|
|
70
|
+
const session = new PairingSession();
|
|
71
|
+
// Register with cloud
|
|
72
|
+
const registerSpinner = ora("Registering pairing code...").start();
|
|
73
|
+
const registered = await session.register();
|
|
74
|
+
if (!registered) {
|
|
75
|
+
registerSpinner.fail("Failed to register pairing code");
|
|
76
|
+
console.log();
|
|
77
|
+
console.log(chalk.yellow(" The cloud relay may be unavailable. Try local mode."));
|
|
78
|
+
console.log();
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
registerSpinner.stop();
|
|
82
|
+
// Show pairing code
|
|
83
|
+
console.log();
|
|
84
|
+
console.log(chalk.dim(" Your pairing code:"));
|
|
85
|
+
console.log();
|
|
86
|
+
console.log(chalk.bold.white(` ${session.getFormattedCode()}`));
|
|
87
|
+
console.log();
|
|
88
|
+
console.log(chalk.dim(" Enter this on your Apple Watch."));
|
|
89
|
+
console.log();
|
|
90
|
+
// Wait for pairing
|
|
91
|
+
const pairingSpinner = ora("Waiting for watch to pair...").start();
|
|
92
|
+
const pairingId = await session.waitForPairing((attempt, max) => {
|
|
93
|
+
const elapsed = Math.floor(attempt);
|
|
94
|
+
const remaining = Math.floor((max - attempt) / 60);
|
|
95
|
+
pairingSpinner.text = `Waiting for watch to pair... (${remaining}m remaining)`;
|
|
96
|
+
});
|
|
97
|
+
if (pairingId) {
|
|
98
|
+
pairingSpinner.succeed("Watch paired!");
|
|
99
|
+
return pairingId;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
pairingSpinner.fail("Pairing timed out");
|
|
103
|
+
await session.cleanup();
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Run local mode setup
|
|
109
|
+
*/
|
|
110
|
+
async function runLocalSetup() {
|
|
111
|
+
console.log();
|
|
112
|
+
console.log(chalk.dim(" Local mode uses a direct connection."));
|
|
113
|
+
console.log(chalk.dim(" Your watch must be on the same network."));
|
|
114
|
+
console.log();
|
|
115
|
+
const pairingId = createLocalPairing();
|
|
116
|
+
console.log(` Generated pairing ID: ${chalk.cyan(pairingId.slice(0, 8) + "...")}`);
|
|
117
|
+
return pairingId;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Configure Claude Code
|
|
121
|
+
*/
|
|
122
|
+
function configureClaude() {
|
|
123
|
+
const spinner = ora("Configuring Claude Code...").start();
|
|
124
|
+
try {
|
|
125
|
+
addClaudeWatchServer();
|
|
126
|
+
spinner.succeed("Claude Code configured");
|
|
127
|
+
console.log();
|
|
128
|
+
console.log(` Config: ${chalk.dim(getMCPConfigPath())}`);
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
spinner.fail("Failed to configure Claude Code");
|
|
132
|
+
console.error(error);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Verify cloud connectivity
|
|
137
|
+
*/
|
|
138
|
+
async function verifyCloud(cloudUrl) {
|
|
139
|
+
const client = new CloudClient(cloudUrl);
|
|
140
|
+
const result = await client.checkConnectivity();
|
|
141
|
+
if (result.connected) {
|
|
142
|
+
console.log(chalk.dim(` Cloud: ${chalk.green("connected")} (${result.latency}ms)`));
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
console.log(chalk.dim(` Cloud: ${chalk.red("not connected")} (${result.error})`));
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Show completion message
|
|
152
|
+
*/
|
|
153
|
+
function showComplete() {
|
|
154
|
+
console.log();
|
|
155
|
+
console.log(chalk.green.bold(" Done!"));
|
|
156
|
+
console.log();
|
|
157
|
+
console.log(chalk.dim(" Your watch will buzz when Claude needs approval."));
|
|
158
|
+
console.log();
|
|
159
|
+
console.log(chalk.dim(" Commands:"));
|
|
160
|
+
console.log(chalk.dim(" npx claude-watch status Check connection"));
|
|
161
|
+
console.log(chalk.dim(" npx claude-watch unpair Remove configuration"));
|
|
162
|
+
console.log();
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Main setup wizard
|
|
166
|
+
*/
|
|
167
|
+
export async function runSetup() {
|
|
168
|
+
showHeader();
|
|
169
|
+
// Check existing config
|
|
170
|
+
const shouldContinue = await checkExistingConfig();
|
|
171
|
+
if (!shouldContinue) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
// Ask for connection mode
|
|
175
|
+
const mode = await askConnectionMode();
|
|
176
|
+
if (!mode) {
|
|
177
|
+
console.log(chalk.yellow(" Setup cancelled."));
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
console.log();
|
|
181
|
+
let pairingId = null;
|
|
182
|
+
let cloudUrl = "https://claude-watch.fly.dev";
|
|
183
|
+
if (mode === "cloud") {
|
|
184
|
+
// Check cloud connectivity first
|
|
185
|
+
const cloudConnected = await verifyCloud(cloudUrl);
|
|
186
|
+
if (!cloudConnected) {
|
|
187
|
+
console.log();
|
|
188
|
+
console.log(chalk.yellow(" Cloud relay unavailable. Falling back to local mode."));
|
|
189
|
+
pairingId = await runLocalSetup();
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
pairingId = await runCloudPairing();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
pairingId = await runLocalSetup();
|
|
197
|
+
cloudUrl = "http://localhost:8787"; // Local server
|
|
198
|
+
}
|
|
199
|
+
if (!pairingId) {
|
|
200
|
+
console.log();
|
|
201
|
+
console.log(chalk.red(" Setup failed. Please try again."));
|
|
202
|
+
console.log();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
// Save config
|
|
206
|
+
const config = createPairingConfig(cloudUrl);
|
|
207
|
+
config.pairingId = pairingId;
|
|
208
|
+
savePairingConfig(config);
|
|
209
|
+
// Configure Claude Code
|
|
210
|
+
console.log();
|
|
211
|
+
configureClaude();
|
|
212
|
+
// Show completion
|
|
213
|
+
showComplete();
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/cli/setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjD;;GAEG;AACH,SAAS,UAAU;IACjB,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,mBAAmB;IAChC,IAAI,QAAQ,EAAE,IAAI,uBAAuB,EAAE,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC;QACnD,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE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C;QACd,OAAO;IACT,CAAC;IAED,cAAc;IACd,MAAM,MAAM,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAE1B,wBAAwB;IACxB,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,eAAe,EAAE,CAAC;IAElB,kBAAkB;IAClB,YAAY,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/status.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAqE/C"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { isPaired, readPairingConfig, getConfigPath, } from "../config/pairing-store.js";
|
|
3
|
+
import { isClaudeWatchConfigured, getMCPConfigPath, } from "../config/mcp-config.js";
|
|
4
|
+
import { CloudClient } from "../cloud/client.js";
|
|
5
|
+
/**
|
|
6
|
+
* Display connection status
|
|
7
|
+
*/
|
|
8
|
+
export async function runStatus() {
|
|
9
|
+
console.log();
|
|
10
|
+
console.log(chalk.bold.cyan(" Claude Watch Status"));
|
|
11
|
+
console.log();
|
|
12
|
+
// Check pairing
|
|
13
|
+
const paired = isPaired();
|
|
14
|
+
const config = readPairingConfig();
|
|
15
|
+
console.log(chalk.dim(" Pairing:"));
|
|
16
|
+
if (paired && config) {
|
|
17
|
+
console.log(` Status: ${chalk.green("configured")}`);
|
|
18
|
+
console.log(` Pairing ID: ${chalk.dim(config.pairingId.slice(0, 8) + "...")}`);
|
|
19
|
+
console.log(` Cloud URL: ${chalk.dim(config.cloudUrl)}`);
|
|
20
|
+
console.log(` Created: ${chalk.dim(config.createdAt)}`);
|
|
21
|
+
if (config.watchId) {
|
|
22
|
+
console.log(` Watch ID: ${chalk.dim(config.watchId)}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
console.log(` Status: ${chalk.yellow("not configured")}`);
|
|
27
|
+
console.log(chalk.dim(` Run ${chalk.white("npx claude-watch")} to set up`));
|
|
28
|
+
}
|
|
29
|
+
console.log();
|
|
30
|
+
// Check Claude Code config
|
|
31
|
+
const claudeConfigured = isClaudeWatchConfigured();
|
|
32
|
+
console.log(chalk.dim(" Claude Code:"));
|
|
33
|
+
if (claudeConfigured) {
|
|
34
|
+
console.log(` MCP Server: ${chalk.green("configured")}`);
|
|
35
|
+
console.log(` Config: ${chalk.dim(getMCPConfigPath())}`);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
console.log(` MCP Server: ${chalk.yellow("not configured")}`);
|
|
39
|
+
console.log(chalk.dim(` Run ${chalk.white("npx claude-watch")} to set up`));
|
|
40
|
+
}
|
|
41
|
+
console.log();
|
|
42
|
+
// Check cloud connectivity (if paired)
|
|
43
|
+
if (paired && config) {
|
|
44
|
+
console.log(chalk.dim(" Cloud Relay:"));
|
|
45
|
+
const client = new CloudClient(config.cloudUrl, config.pairingId);
|
|
46
|
+
const result = await client.checkConnectivity();
|
|
47
|
+
if (result.connected) {
|
|
48
|
+
console.log(` Status: ${chalk.green("connected")}`);
|
|
49
|
+
console.log(` Latency: ${chalk.dim(result.latency + "ms")}`);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
console.log(` Status: ${chalk.red("not connected")}`);
|
|
53
|
+
console.log(` Error: ${chalk.dim(result.error)}`);
|
|
54
|
+
}
|
|
55
|
+
console.log();
|
|
56
|
+
}
|
|
57
|
+
// Show config file locations
|
|
58
|
+
console.log(chalk.dim(" Config Files:"));
|
|
59
|
+
console.log(` Pairing: ${chalk.dim(getConfigPath())}`);
|
|
60
|
+
console.log(` MCP: ${chalk.dim(getMCPConfigPath())}`);
|
|
61
|
+
console.log();
|
|
62
|
+
// Summary
|
|
63
|
+
if (paired && claudeConfigured) {
|
|
64
|
+
console.log(chalk.green(" Ready to use!"));
|
|
65
|
+
console.log(chalk.dim(" Your watch will receive notifications from Claude."));
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
console.log(chalk.yellow(" Setup incomplete."));
|
|
69
|
+
console.log(chalk.dim(` Run ${chalk.white("npx claude-watch")} to complete setup.`));
|
|
70
|
+
}
|
|
71
|
+
console.log();
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/cli/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,EAAE,CAAC;IAEd,gBAAgB;IAChB,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;IAEnC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IACrC,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC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K,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7D,OAAO,CAAC,GAAG,EAAE,CAAC;IAEd,UAAU;IACV,IAAI,MAAM,IAAI,gBAAgB,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAClE,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACxF,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unpair.d.ts","sourceRoot":"","sources":["../../../src/cli/unpair.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAgE/C"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import prompts from "prompts";
|
|
3
|
+
import { deletePairingConfig, isPaired, getConfigPath, } from "../config/pairing-store.js";
|
|
4
|
+
import { removeClaudeWatchServer, isClaudeWatchConfigured, getMCPConfigPath, } from "../config/mcp-config.js";
|
|
5
|
+
/**
|
|
6
|
+
* Remove Claude Watch configuration
|
|
7
|
+
*/
|
|
8
|
+
export async function runUnpair() {
|
|
9
|
+
console.log();
|
|
10
|
+
console.log(chalk.bold.cyan(" Claude Watch Unpair"));
|
|
11
|
+
console.log();
|
|
12
|
+
const paired = isPaired();
|
|
13
|
+
const claudeConfigured = isClaudeWatchConfigured();
|
|
14
|
+
if (!paired && !claudeConfigured) {
|
|
15
|
+
console.log(chalk.dim(" No configuration found."));
|
|
16
|
+
console.log();
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// Show what will be removed
|
|
20
|
+
console.log(chalk.dim(" The following will be removed:"));
|
|
21
|
+
console.log();
|
|
22
|
+
if (paired) {
|
|
23
|
+
console.log(` ${chalk.yellow("•")} Pairing configuration`);
|
|
24
|
+
console.log(` ${chalk.dim(getConfigPath())}`);
|
|
25
|
+
}
|
|
26
|
+
if (claudeConfigured) {
|
|
27
|
+
console.log(` ${chalk.yellow("•")} Claude Code MCP server entry`);
|
|
28
|
+
console.log(` ${chalk.dim(getMCPConfigPath())}`);
|
|
29
|
+
}
|
|
30
|
+
console.log();
|
|
31
|
+
// Confirm
|
|
32
|
+
const response = await prompts({
|
|
33
|
+
type: "confirm",
|
|
34
|
+
name: "confirm",
|
|
35
|
+
message: "Are you sure you want to remove the configuration?",
|
|
36
|
+
initial: false,
|
|
37
|
+
});
|
|
38
|
+
if (!response.confirm) {
|
|
39
|
+
console.log();
|
|
40
|
+
console.log(chalk.dim(" Cancelled. No changes made."));
|
|
41
|
+
console.log();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
// Remove configs
|
|
45
|
+
console.log();
|
|
46
|
+
if (paired) {
|
|
47
|
+
const deleted = deletePairingConfig();
|
|
48
|
+
if (deleted) {
|
|
49
|
+
console.log(chalk.green(" ✓ Pairing configuration removed"));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (claudeConfigured) {
|
|
53
|
+
try {
|
|
54
|
+
removeClaudeWatchServer();
|
|
55
|
+
console.log(chalk.green(" ✓ Claude Code MCP server entry removed"));
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
console.log(chalk.red(" ✗ Failed to remove MCP server entry"));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
console.log();
|
|
62
|
+
console.log(chalk.dim(" Done. Run npx claude-watch to set up again."));
|
|
63
|
+
console.log();
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=unpair.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unpair.js","sourceRoot":"","sources":["../../../src/cli/unpair.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,QAAQ,EACR,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,EAAE,CAAC;IAEd,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,MAAM,gBAAgB,GAAG,uBAAuB,EAAE,CAAC;IAEnD,IAAI,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO;IACT,CAAC;IAED,4BAA4B;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC,CAAC;IAC3D,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,aAAa,EA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AC;QAClE,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { CloudMessage, SessionState, WatchMessage } from "../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Cloud Relay Client
|
|
4
|
+
*
|
|
5
|
+
* Communicates with the cloud relay server to bridge messages
|
|
6
|
+
* between the MCP server and the Apple Watch.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CloudClient {
|
|
9
|
+
private cloudUrl;
|
|
10
|
+
private pairingId;
|
|
11
|
+
private pollInterval;
|
|
12
|
+
private isPolling;
|
|
13
|
+
private messageHandler;
|
|
14
|
+
constructor(cloudUrl?: string, pairingId?: string);
|
|
15
|
+
/**
|
|
16
|
+
* Check if the client is configured
|
|
17
|
+
*/
|
|
18
|
+
isConfigured(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Send a message to the watch via cloud relay
|
|
21
|
+
*/
|
|
22
|
+
sendMessage(message: WatchMessage): Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* Poll for messages from the watch
|
|
25
|
+
*/
|
|
26
|
+
pollMessages(): Promise<CloudMessage[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Broadcast state sync to watch
|
|
29
|
+
*/
|
|
30
|
+
syncState(state: SessionState): Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Start polling for messages
|
|
33
|
+
*/
|
|
34
|
+
startPolling(handler: (message: WatchMessage) => void): void;
|
|
35
|
+
/**
|
|
36
|
+
* Stop polling for messages
|
|
37
|
+
*/
|
|
38
|
+
stopPolling(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Check cloud connectivity
|
|
41
|
+
*/
|
|
42
|
+
checkConnectivity(): Promise<{
|
|
43
|
+
connected: boolean;
|
|
44
|
+
latency?: number;
|
|
45
|
+
error?: string;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Get the cloud URL
|
|
49
|
+
*/
|
|
50
|
+
getCloudUrl(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Get the pairing ID
|
|
53
|
+
*/
|
|
54
|
+
getPairingId(): string | null;
|
|
55
|
+
}
|
|
56
|
+
export declare function getCloudClient(): CloudClient;
|
|
57
|
+
export declare function resetCloudClient(): void;
|
|
58
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/cloud/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGlF;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,cAAc,CAAkD;gBAE5D,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAKjD;;OAEG;IACH,YAAY,IAAI,OAAO;IAIvB;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IA2B1D;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAsB7C;;OAEG;IACG,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAOtD;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI;IAsB5D;;OAEG;IACH,WAAW,IAAI,IAAI;IAKnB;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC;QACjC,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IA2BF;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,YAAY,IAAI,MAAM,GAAG,IAAI;CAG9B;AAOD,wBAAgB,cAAc,IAAI,WAAW,CAK5C;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
|