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.
Files changed (54) hide show
  1. package/README.md +47 -0
  2. package/dist/src/cli/serve.d.ts +6 -0
  3. package/dist/src/cli/serve.d.ts.map +1 -0
  4. package/dist/src/cli/serve.js +9 -0
  5. package/dist/src/cli/serve.js.map +1 -0
  6. package/dist/src/cli/setup.d.ts +5 -0
  7. package/dist/src/cli/setup.d.ts.map +1 -0
  8. package/dist/src/cli/setup.js +215 -0
  9. package/dist/src/cli/setup.js.map +1 -0
  10. package/dist/src/cli/status.d.ts +5 -0
  11. package/dist/src/cli/status.d.ts.map +1 -0
  12. package/dist/src/cli/status.js +73 -0
  13. package/dist/src/cli/status.js.map +1 -0
  14. package/dist/src/cli/unpair.d.ts +5 -0
  15. package/dist/src/cli/unpair.d.ts.map +1 -0
  16. package/dist/src/cli/unpair.js +65 -0
  17. package/dist/src/cli/unpair.js.map +1 -0
  18. package/dist/src/cloud/client.d.ts +58 -0
  19. package/dist/src/cloud/client.d.ts.map +1 -0
  20. package/dist/src/cloud/client.js +166 -0
  21. package/dist/src/cloud/client.js.map +1 -0
  22. package/dist/src/cloud/pairing.d.ts +51 -0
  23. package/dist/src/cloud/pairing.d.ts.map +1 -0
  24. package/dist/src/cloud/pairing.js +131 -0
  25. package/dist/src/cloud/pairing.js.map +1 -0
  26. package/dist/src/config/mcp-config.d.ts +26 -0
  27. package/dist/src/config/mcp-config.d.ts.map +1 -0
  28. package/dist/src/config/mcp-config.js +76 -0
  29. package/dist/src/config/mcp-config.js.map +1 -0
  30. package/dist/src/config/pairing-store.d.ts +38 -0
  31. package/dist/src/config/pairing-store.d.ts.map +1 -0
  32. package/dist/src/config/pairing-store.js +91 -0
  33. package/dist/src/config/pairing-store.js.map +1 -0
  34. package/dist/src/index.d.ts +8 -0
  35. package/dist/src/index.d.ts.map +1 -0
  36. package/dist/src/index.js +68 -0
  37. package/dist/src/index.js.map +1 -0
  38. package/dist/src/server/index.d.ts +12 -0
  39. package/dist/src/server/index.d.ts.map +1 -0
  40. package/dist/src/server/index.js +74 -0
  41. package/dist/src/server/index.js.map +1 -0
  42. package/dist/src/server/state.d.ts +64 -0
  43. package/dist/src/server/state.d.ts.map +1 -0
  44. package/dist/src/server/state.js +194 -0
  45. package/dist/src/server/state.js.map +1 -0
  46. package/dist/src/server/tools.d.ts +258 -0
  47. package/dist/src/server/tools.d.ts.map +1 -0
  48. package/dist/src/server/tools.js +177 -0
  49. package/dist/src/server/tools.js.map +1 -0
  50. package/dist/src/types/index.d.ts +212 -0
  51. package/dist/src/types/index.d.ts.map +1 -0
  52. package/dist/src/types/index.js +90 -0
  53. package/dist/src/types/index.js.map +1 -0
  54. package/package.json +52 -0
@@ -0,0 +1,258 @@
1
+ /**
2
+ * MCP Tool definitions for Claude Watch
3
+ */
4
+ export declare const tools: {
5
+ watch_notify: {
6
+ name: string;
7
+ description: string;
8
+ inputSchema: {
9
+ type: "object";
10
+ properties: {
11
+ title: {
12
+ type: string;
13
+ description: string;
14
+ };
15
+ message: {
16
+ type: string;
17
+ description: string;
18
+ };
19
+ };
20
+ required: string[];
21
+ };
22
+ handler: (args: {
23
+ title: string;
24
+ message: string;
25
+ }) => Promise<{
26
+ success: boolean;
27
+ }>;
28
+ };
29
+ watch_request_approval: {
30
+ name: string;
31
+ description: string;
32
+ inputSchema: {
33
+ type: "object";
34
+ properties: {
35
+ action_type: {
36
+ type: string;
37
+ enum: string[];
38
+ description: string;
39
+ };
40
+ title: {
41
+ type: string;
42
+ description: string;
43
+ };
44
+ description: {
45
+ type: string;
46
+ description: string;
47
+ };
48
+ file_path: {
49
+ type: string;
50
+ description: string;
51
+ };
52
+ command: {
53
+ type: string;
54
+ description: string;
55
+ };
56
+ };
57
+ required: string[];
58
+ };
59
+ handler: (args: {
60
+ action_type: string;
61
+ title: string;
62
+ description: string;
63
+ file_path?: string;
64
+ command?: string;
65
+ }) => Promise<{
66
+ approved: boolean;
67
+ status: import("../types/index.js").ActionStatus;
68
+ }>;
69
+ };
70
+ watch_update_progress: {
71
+ name: string;
72
+ description: string;
73
+ inputSchema: {
74
+ type: "object";
75
+ properties: {
76
+ progress: {
77
+ type: string;
78
+ minimum: number;
79
+ maximum: number;
80
+ description: string;
81
+ };
82
+ task_name: {
83
+ type: string;
84
+ description: string;
85
+ };
86
+ };
87
+ required: string[];
88
+ };
89
+ handler: (args: {
90
+ progress: number;
91
+ task_name?: string;
92
+ }) => Promise<{
93
+ success: boolean;
94
+ }>;
95
+ };
96
+ watch_set_task: {
97
+ name: string;
98
+ description: string;
99
+ inputSchema: {
100
+ type: "object";
101
+ properties: {
102
+ name: {
103
+ type: string;
104
+ description: string;
105
+ };
106
+ description: {
107
+ type: string;
108
+ description: string;
109
+ };
110
+ };
111
+ required: string[];
112
+ };
113
+ handler: (args: {
114
+ name: string;
115
+ description?: string;
116
+ }) => Promise<{
117
+ success: boolean;
118
+ }>;
119
+ };
120
+ watch_complete_task: {
121
+ name: string;
122
+ description: string;
123
+ inputSchema: {
124
+ type: "object";
125
+ properties: {
126
+ success: {
127
+ type: string;
128
+ default: boolean;
129
+ description: string;
130
+ };
131
+ };
132
+ };
133
+ handler: (args: {
134
+ success?: boolean;
135
+ }) => Promise<{
136
+ success: boolean;
137
+ }>;
138
+ };
139
+ watch_get_state: {
140
+ name: string;
141
+ description: string;
142
+ inputSchema: {
143
+ type: "object";
144
+ properties: {};
145
+ };
146
+ handler: () => Promise<{
147
+ status: "idle" | "running" | "waiting" | "completed" | "failed";
148
+ task_name: string;
149
+ task_description: string;
150
+ progress: number;
151
+ pending_actions: {
152
+ id: string;
153
+ type: "file_edit" | "file_create" | "file_delete" | "bash" | "tool_use" | "approval";
154
+ status: "pending" | "approved" | "rejected" | "timeout";
155
+ title: string;
156
+ description: string;
157
+ timestamp: string;
158
+ file_path?: string | null | undefined;
159
+ command?: string | null | undefined;
160
+ }[];
161
+ model: string;
162
+ yolo_mode: boolean;
163
+ started_at: string | null;
164
+ }>;
165
+ };
166
+ };
167
+ /**
168
+ * Get all tools as an array for MCP tools/list
169
+ */
170
+ export declare function getToolsList(): {
171
+ name: string;
172
+ description: string;
173
+ inputSchema: {
174
+ type: "object";
175
+ properties: {
176
+ title: {
177
+ type: string;
178
+ description: string;
179
+ };
180
+ message: {
181
+ type: string;
182
+ description: string;
183
+ };
184
+ };
185
+ required: string[];
186
+ } | {
187
+ type: "object";
188
+ properties: {
189
+ action_type: {
190
+ type: string;
191
+ enum: string[];
192
+ description: string;
193
+ };
194
+ title: {
195
+ type: string;
196
+ description: string;
197
+ };
198
+ description: {
199
+ type: string;
200
+ description: string;
201
+ };
202
+ file_path: {
203
+ type: string;
204
+ description: string;
205
+ };
206
+ command: {
207
+ type: string;
208
+ description: string;
209
+ };
210
+ };
211
+ required: string[];
212
+ } | {
213
+ type: "object";
214
+ properties: {
215
+ progress: {
216
+ type: string;
217
+ minimum: number;
218
+ maximum: number;
219
+ description: string;
220
+ };
221
+ task_name: {
222
+ type: string;
223
+ description: string;
224
+ };
225
+ };
226
+ required: string[];
227
+ } | {
228
+ type: "object";
229
+ properties: {
230
+ name: {
231
+ type: string;
232
+ description: string;
233
+ };
234
+ description: {
235
+ type: string;
236
+ description: string;
237
+ };
238
+ };
239
+ required: string[];
240
+ } | {
241
+ type: "object";
242
+ properties: {
243
+ success: {
244
+ type: string;
245
+ default: boolean;
246
+ description: string;
247
+ };
248
+ };
249
+ } | {
250
+ type: "object";
251
+ properties: {};
252
+ };
253
+ }[];
254
+ /**
255
+ * Call a tool by name
256
+ */
257
+ export declare function callTool(name: string, args: Record<string, unknown>): Promise<unknown>;
258
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;wBAkBQ;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4ClC;YACpB,WAAW,EAAE,MAAM,CAAC;YACpB,KAAK,EAAE,MAAM,CAAC;YACd,WAAW,EAAE,MAAM,CAAC;YACpB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB;;;;;;;;;;;;;;;;;;;;;;;;wBAgCqB;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;wBAwBxC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;wBAoBtC;YAAE,OAAO,CAAC,EAAE,OAAO,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB9C,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAM3B;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CAMlB"}
@@ -0,0 +1,177 @@
1
+ import { getStateManager } from "./state.js";
2
+ /**
3
+ * MCP Tool definitions for Claude Watch
4
+ */
5
+ export const tools = {
6
+ watch_notify: {
7
+ name: "watch_notify",
8
+ description: "Send a notification to the connected Apple Watch",
9
+ inputSchema: {
10
+ type: "object",
11
+ properties: {
12
+ title: {
13
+ type: "string",
14
+ description: "Notification title",
15
+ },
16
+ message: {
17
+ type: "string",
18
+ description: "Notification message",
19
+ },
20
+ },
21
+ required: ["title", "message"],
22
+ },
23
+ handler: async (args) => {
24
+ const manager = getStateManager();
25
+ const success = await manager.notify(args.title, args.message);
26
+ return { success };
27
+ },
28
+ },
29
+ watch_request_approval: {
30
+ name: "watch_request_approval",
31
+ description: "Request approval from watch for an action. Blocks until approved/rejected.",
32
+ inputSchema: {
33
+ type: "object",
34
+ properties: {
35
+ action_type: {
36
+ type: "string",
37
+ enum: [
38
+ "file_edit",
39
+ "file_create",
40
+ "file_delete",
41
+ "bash",
42
+ "tool_use",
43
+ ],
44
+ description: "Type of action requiring approval",
45
+ },
46
+ title: {
47
+ type: "string",
48
+ description: "Short title for the action",
49
+ },
50
+ description: {
51
+ type: "string",
52
+ description: "Detailed description",
53
+ },
54
+ file_path: {
55
+ type: "string",
56
+ description: "File path if applicable",
57
+ },
58
+ command: {
59
+ type: "string",
60
+ description: "Command if bash action",
61
+ },
62
+ },
63
+ required: ["action_type", "title", "description"],
64
+ },
65
+ handler: async (args) => {
66
+ const manager = getStateManager();
67
+ const result = await manager.requestApproval({
68
+ type: args.action_type,
69
+ title: args.title,
70
+ description: args.description,
71
+ file_path: args.file_path,
72
+ command: args.command,
73
+ });
74
+ return result;
75
+ },
76
+ },
77
+ watch_update_progress: {
78
+ name: "watch_update_progress",
79
+ description: "Update task progress shown on watch",
80
+ inputSchema: {
81
+ type: "object",
82
+ properties: {
83
+ progress: {
84
+ type: "number",
85
+ minimum: 0,
86
+ maximum: 1,
87
+ description: "Progress value between 0 and 1",
88
+ },
89
+ task_name: {
90
+ type: "string",
91
+ description: "Optional task name to update",
92
+ },
93
+ },
94
+ required: ["progress"],
95
+ },
96
+ handler: async (args) => {
97
+ const manager = getStateManager();
98
+ const success = await manager.updateProgress(args.progress, args.task_name);
99
+ return { success };
100
+ },
101
+ },
102
+ watch_set_task: {
103
+ name: "watch_set_task",
104
+ description: "Set the current task being worked on",
105
+ inputSchema: {
106
+ type: "object",
107
+ properties: {
108
+ name: {
109
+ type: "string",
110
+ description: "Task name",
111
+ },
112
+ description: {
113
+ type: "string",
114
+ description: "Task description",
115
+ },
116
+ },
117
+ required: ["name"],
118
+ },
119
+ handler: async (args) => {
120
+ const manager = getStateManager();
121
+ const success = await manager.setTask(args.name, args.description || "");
122
+ return { success };
123
+ },
124
+ },
125
+ watch_complete_task: {
126
+ name: "watch_complete_task",
127
+ description: "Mark current task as complete",
128
+ inputSchema: {
129
+ type: "object",
130
+ properties: {
131
+ success: {
132
+ type: "boolean",
133
+ default: true,
134
+ description: "Whether the task completed successfully",
135
+ },
136
+ },
137
+ },
138
+ handler: async (args) => {
139
+ const manager = getStateManager();
140
+ const result = await manager.completeTask(args.success ?? true);
141
+ return { success: result };
142
+ },
143
+ },
144
+ watch_get_state: {
145
+ name: "watch_get_state",
146
+ description: "Get current watch/session state",
147
+ inputSchema: {
148
+ type: "object",
149
+ properties: {},
150
+ },
151
+ handler: async () => {
152
+ const manager = getStateManager();
153
+ return manager.getState();
154
+ },
155
+ },
156
+ };
157
+ /**
158
+ * Get all tools as an array for MCP tools/list
159
+ */
160
+ export function getToolsList() {
161
+ return Object.values(tools).map((tool) => ({
162
+ name: tool.name,
163
+ description: tool.description,
164
+ inputSchema: tool.inputSchema,
165
+ }));
166
+ }
167
+ /**
168
+ * Call a tool by name
169
+ */
170
+ export async function callTool(name, args) {
171
+ const tool = tools[name];
172
+ if (!tool) {
173
+ throw new Error(`Unknown tool: ${name}`);
174
+ }
175
+ return tool.handler(args);
176
+ }
177
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/server/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,YAAY,EAAE;QACZ,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,kDAAkD;QAC/D,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,Q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f,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;KAC9B,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAY,EACZ,IAA6B;IAE7B,MAAM,IAAI,GAAG,KAAK,CAAC,IAA0B,CAAC,CAAC;IAC/C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAa,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,212 @@
1
+ import { z } from "zod";
2
+ export declare const ActionType: {
3
+ readonly FILE_EDIT: "file_edit";
4
+ readonly FILE_CREATE: "file_create";
5
+ readonly FILE_DELETE: "file_delete";
6
+ readonly BASH: "bash";
7
+ readonly TOOL_USE: "tool_use";
8
+ readonly APPROVAL: "approval";
9
+ };
10
+ export type ActionType = (typeof ActionType)[keyof typeof ActionType];
11
+ export declare const ActionStatus: {
12
+ readonly PENDING: "pending";
13
+ readonly APPROVED: "approved";
14
+ readonly REJECTED: "rejected";
15
+ readonly TIMEOUT: "timeout";
16
+ };
17
+ export type ActionStatus = (typeof ActionStatus)[keyof typeof ActionStatus];
18
+ export declare const SessionStatus: {
19
+ readonly IDLE: "idle";
20
+ readonly RUNNING: "running";
21
+ readonly WAITING: "waiting";
22
+ readonly COMPLETED: "completed";
23
+ readonly FAILED: "failed";
24
+ };
25
+ export type SessionStatus = (typeof SessionStatus)[keyof typeof SessionStatus];
26
+ export declare const PendingActionSchema: z.ZodObject<{
27
+ id: z.ZodString;
28
+ type: z.ZodEnum<["file_edit", "file_create", "file_delete", "bash", "tool_use", "approval"]>;
29
+ title: z.ZodString;
30
+ description: z.ZodString;
31
+ file_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
32
+ command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
+ timestamp: z.ZodString;
34
+ status: z.ZodEnum<["pending", "approved", "rejected", "timeout"]>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ id: string;
37
+ type: "file_edit" | "file_create" | "file_delete" | "bash" | "tool_use" | "approval";
38
+ status: "pending" | "approved" | "rejected" | "timeout";
39
+ title: string;
40
+ description: string;
41
+ timestamp: string;
42
+ file_path?: string | null | undefined;
43
+ command?: string | null | undefined;
44
+ }, {
45
+ id: string;
46
+ type: "file_edit" | "file_create" | "file_delete" | "bash" | "tool_use" | "approval";
47
+ status: "pending" | "approved" | "rejected" | "timeout";
48
+ title: string;
49
+ description: string;
50
+ timestamp: string;
51
+ file_path?: string | null | undefined;
52
+ command?: string | null | undefined;
53
+ }>;
54
+ export declare const SessionStateSchema: z.ZodObject<{
55
+ task_name: z.ZodString;
56
+ task_description: z.ZodString;
57
+ progress: z.ZodNumber;
58
+ status: z.ZodEnum<["idle", "running", "waiting", "completed", "failed"]>;
59
+ pending_actions: z.ZodArray<z.ZodObject<{
60
+ id: z.ZodString;
61
+ type: z.ZodEnum<["file_edit", "file_create", "file_delete", "bash", "tool_use", "approval"]>;
62
+ title: z.ZodString;
63
+ description: z.ZodString;
64
+ file_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
+ command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
+ timestamp: z.ZodString;
67
+ status: z.ZodEnum<["pending", "approved", "rejected", "timeout"]>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ id: string;
70
+ type: "file_edit" | "file_create" | "file_delete" | "bash" | "tool_use" | "approval";
71
+ status: "pending" | "approved" | "rejected" | "timeout";
72
+ title: string;
73
+ description: string;
74
+ timestamp: string;
75
+ file_path?: string | null | undefined;
76
+ command?: string | null | undefined;
77
+ }, {
78
+ id: string;
79
+ type: "file_edit" | "file_create" | "file_delete" | "bash" | "tool_use" | "approval";
80
+ status: "pending" | "approved" | "rejected" | "timeout";
81
+ title: string;
82
+ description: string;
83
+ timestamp: string;
84
+ file_path?: string | null | undefined;
85
+ command?: string | null | undefined;
86
+ }>, "many">;
87
+ model: z.ZodString;
88
+ yolo_mode: z.ZodBoolean;
89
+ started_at: z.ZodNullable<z.ZodString>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ status: "idle" | "running" | "waiting" | "completed" | "failed";
92
+ task_name: string;
93
+ task_description: string;
94
+ progress: number;
95
+ pending_actions: {
96
+ id: string;
97
+ type: "file_edit" | "file_create" | "file_delete" | "bash" | "tool_use" | "approval";
98
+ status: "pending" | "approved" | "rejected" | "timeout";
99
+ title: string;
100
+ description: string;
101
+ timestamp: string;
102
+ file_path?: string | null | undefined;
103
+ command?: string | null | undefined;
104
+ }[];
105
+ model: string;
106
+ yolo_mode: boolean;
107
+ started_at: string | null;
108
+ }, {
109
+ status: "idle" | "running" | "waiting" | "completed" | "failed";
110
+ task_name: string;
111
+ task_description: string;
112
+ progress: number;
113
+ pending_actions: {
114
+ id: string;
115
+ type: "file_edit" | "file_create" | "file_delete" | "bash" | "tool_use" | "approval";
116
+ status: "pending" | "approved" | "rejected" | "timeout";
117
+ title: string;
118
+ description: string;
119
+ timestamp: string;
120
+ file_path?: string | null | undefined;
121
+ command?: string | null | undefined;
122
+ }[];
123
+ model: string;
124
+ yolo_mode: boolean;
125
+ started_at: string | null;
126
+ }>;
127
+ export type PendingAction = z.infer<typeof PendingActionSchema>;
128
+ export type SessionState = z.infer<typeof SessionStateSchema>;
129
+ export interface PairingConfig {
130
+ pairingId: string;
131
+ cloudUrl: string;
132
+ createdAt: string;
133
+ watchId?: string;
134
+ }
135
+ export interface MCPServerConfig {
136
+ command: string;
137
+ args?: string[];
138
+ env?: Record<string, string>;
139
+ }
140
+ export interface MCPConfig {
141
+ mcpServers: Record<string, MCPServerConfig>;
142
+ }
143
+ export interface CloudMessage {
144
+ type: string;
145
+ pairingId: string;
146
+ payload: unknown;
147
+ timestamp: string;
148
+ }
149
+ export interface PairingRequest {
150
+ pairingCode: string;
151
+ deviceInfo?: {
152
+ model?: string;
153
+ os?: string;
154
+ };
155
+ }
156
+ export interface PairingResponse {
157
+ success: boolean;
158
+ pairingId?: string;
159
+ error?: string;
160
+ }
161
+ export type WatchMessage = {
162
+ type: "state_sync";
163
+ state: SessionState;
164
+ } | {
165
+ type: "action_requested";
166
+ action: PendingAction;
167
+ } | {
168
+ type: "progress_update";
169
+ progress: number;
170
+ task_name: string;
171
+ } | {
172
+ type: "task_started";
173
+ task_name: string;
174
+ task_description: string;
175
+ } | {
176
+ type: "task_completed";
177
+ success: boolean;
178
+ task_name: string;
179
+ } | {
180
+ type: "notification";
181
+ title: string;
182
+ message: string;
183
+ } | {
184
+ type: "yolo_changed";
185
+ enabled: boolean;
186
+ } | {
187
+ type: "prompt_received";
188
+ text: string;
189
+ } | {
190
+ type: "pong";
191
+ };
192
+ export type WatchRequest = {
193
+ type: "action_response";
194
+ action_id: string;
195
+ approved: boolean;
196
+ } | {
197
+ type: "prompt";
198
+ text: string;
199
+ } | {
200
+ type: "toggle_yolo";
201
+ enabled: boolean;
202
+ } | {
203
+ type: "approve_all";
204
+ } | {
205
+ type: "register_push_token";
206
+ token: string;
207
+ } | {
208
+ type: "ping";
209
+ };
210
+ export declare function createDefaultSessionState(): SessionState;
211
+ export declare function createPendingAction(params: Omit<PendingAction, "id" | "timestamp" | "status">): PendingAction;
212
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,UAAU;;;;;;;CAOb,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEtE,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MA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