@jsayubi/ccgram 1.0.0 → 1.0.2
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/package.json +1 -2
- package/dist/src/automation/claude-automation.d.ts +0 -45
- package/dist/src/automation/claude-automation.d.ts.map +0 -1
- package/dist/src/automation/claude-automation.js +0 -367
- package/dist/src/automation/claude-automation.js.map +0 -1
- package/dist/src/automation/simple-automation.d.ts +0 -56
- package/dist/src/automation/simple-automation.d.ts.map +0 -1
- package/dist/src/automation/simple-automation.js +0 -283
- package/dist/src/automation/simple-automation.js.map +0 -1
- package/dist/src/daemon/taskping-daemon.d.ts +0 -38
- package/dist/src/daemon/taskping-daemon.d.ts.map +0 -1
- package/dist/src/daemon/taskping-daemon.js +0 -306
- package/dist/src/daemon/taskping-daemon.js.map +0 -1
- package/dist/src/relay/command-relay.d.ts +0 -94
- package/dist/src/relay/command-relay.d.ts.map +0 -1
- package/dist/src/relay/command-relay.js +0 -463
- package/dist/src/relay/command-relay.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsayubi/ccgram",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Control Claude Code from Telegram",
|
|
5
5
|
"main": "dist/workspace-telegram-bot.js",
|
|
6
6
|
"bin": {
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"optionalDependencies": {
|
|
67
67
|
"express": "^4.18.2",
|
|
68
68
|
"mailparser": "^3.7.4",
|
|
69
|
-
"node-imap": "^0.9.6",
|
|
70
69
|
"node-pty": "^1.0.0",
|
|
71
70
|
"nodemailer": "^7.0.5",
|
|
72
71
|
"pino": "^9.7.0",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Code Dedicated Automation
|
|
3
|
-
* Complete automation solution specifically designed for Claude Code
|
|
4
|
-
*/
|
|
5
|
-
import Logger from '../core/logger';
|
|
6
|
-
interface AutomationStatus {
|
|
7
|
-
platform: NodeJS.Platform;
|
|
8
|
-
supported: boolean;
|
|
9
|
-
name: string;
|
|
10
|
-
}
|
|
11
|
-
declare class ClaudeAutomation {
|
|
12
|
-
logger: Logger;
|
|
13
|
-
constructor();
|
|
14
|
-
/**
|
|
15
|
-
* Fully automated command sending to Claude Code
|
|
16
|
-
*/
|
|
17
|
-
sendCommand(command: string, sessionId?: string): Promise<boolean>;
|
|
18
|
-
/**
|
|
19
|
-
* Copy command to clipboard
|
|
20
|
-
*/
|
|
21
|
-
_copyToClipboard(command: string): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* Full automation solution
|
|
24
|
-
*/
|
|
25
|
-
_fullAutomation(command: string): Promise<boolean>;
|
|
26
|
-
/**
|
|
27
|
-
* Fallback automation solution - more forceful method
|
|
28
|
-
*/
|
|
29
|
-
_fallbackAutomation(command: string): Promise<boolean>;
|
|
30
|
-
/**
|
|
31
|
-
* Specifically activate Claude Code application
|
|
32
|
-
*/
|
|
33
|
-
activateClaudeCode(): Promise<boolean>;
|
|
34
|
-
/**
|
|
35
|
-
* Check system permissions and attempt to request
|
|
36
|
-
*/
|
|
37
|
-
requestPermissions(): Promise<boolean>;
|
|
38
|
-
_runAppleScript(script: string): Promise<string>;
|
|
39
|
-
/**
|
|
40
|
-
* Get status information
|
|
41
|
-
*/
|
|
42
|
-
getStatus(): AutomationStatus;
|
|
43
|
-
}
|
|
44
|
-
export = ClaudeAutomation;
|
|
45
|
-
//# sourceMappingURL=claude-automation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-automation.d.ts","sourceRoot":"","sources":["../../../src/automation/claude-automation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAEpC,UAAU,gBAAgB;IACtB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,cAAM,gBAAgB;IAClB,MAAM,EAAE,MAAM,CAAC;;IAMf;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,MAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAwB5E;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBtD;;OAEG;IACG,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA0IxD;;OAEG;IACG,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAyE5D;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IA4C5C;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IA0BtC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAwBtD;;OAEG;IACH,SAAS,IAAI,gBAAgB;CAOhC;AAED,SAAS,gBAAgB,CAAC"}
|
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Claude Code Dedicated Automation
|
|
4
|
-
* Complete automation solution specifically designed for Claude Code
|
|
5
|
-
*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
const child_process_1 = require("child_process");
|
|
10
|
-
const logger_1 = __importDefault(require("../core/logger"));
|
|
11
|
-
class ClaudeAutomation {
|
|
12
|
-
logger;
|
|
13
|
-
constructor() {
|
|
14
|
-
this.logger = new logger_1.default('ClaudeAutomation');
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Fully automated command sending to Claude Code
|
|
18
|
-
*/
|
|
19
|
-
async sendCommand(command, sessionId = '') {
|
|
20
|
-
try {
|
|
21
|
-
this.logger.info(`Sending command to Claude Code: ${command.substring(0, 50)}...`);
|
|
22
|
-
// First copy command to clipboard
|
|
23
|
-
await this._copyToClipboard(command);
|
|
24
|
-
// Then execute fully automated paste and execution
|
|
25
|
-
const success = await this._fullAutomation(command);
|
|
26
|
-
if (success) {
|
|
27
|
-
this.logger.info('Command sent and executed successfully');
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
// If failed, try fallback option
|
|
32
|
-
return await this._fallbackAutomation(command);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
this.logger.error('Claude automation failed:', error.message);
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Copy command to clipboard
|
|
42
|
-
*/
|
|
43
|
-
async _copyToClipboard(command) {
|
|
44
|
-
return new Promise((resolve, reject) => {
|
|
45
|
-
const pbcopy = (0, child_process_1.spawn)('pbcopy');
|
|
46
|
-
pbcopy.stdin.write(command);
|
|
47
|
-
pbcopy.stdin.end();
|
|
48
|
-
pbcopy.on('close', (code) => {
|
|
49
|
-
if (code === 0) {
|
|
50
|
-
this.logger.debug('Command copied to clipboard');
|
|
51
|
-
resolve();
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
reject(new Error('Failed to copy to clipboard'));
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
pbcopy.on('error', reject);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Full automation solution
|
|
62
|
-
*/
|
|
63
|
-
async _fullAutomation(command) {
|
|
64
|
-
if (process.platform !== 'darwin') {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
return new Promise((resolve) => {
|
|
68
|
-
const script = `
|
|
69
|
-
tell application "System Events"
|
|
70
|
-
-- Define possible Claude Code application names
|
|
71
|
-
set claudeApps to {"Claude", "Claude Code", "Claude Desktop", "Anthropic Claude"}
|
|
72
|
-
set terminalApps to {"Terminal", "iTerm2", "iTerm", "Warp Terminal", "Warp"}
|
|
73
|
-
set codeApps to {"Visual Studio Code", "Code", "Cursor", "Sublime Text", "Atom"}
|
|
74
|
-
|
|
75
|
-
-- First try to find Claude Code
|
|
76
|
-
set targetApp to null
|
|
77
|
-
set appName to ""
|
|
78
|
-
|
|
79
|
-
-- Check Claude applications
|
|
80
|
-
repeat with app in claudeApps
|
|
81
|
-
try
|
|
82
|
-
if application process app exists then
|
|
83
|
-
set targetApp to application process app
|
|
84
|
-
set appName to app
|
|
85
|
-
exit repeat
|
|
86
|
-
end if
|
|
87
|
-
end try
|
|
88
|
-
end repeat
|
|
89
|
-
|
|
90
|
-
-- If Claude not found, check terminal applications
|
|
91
|
-
if targetApp is null then
|
|
92
|
-
repeat with app in terminalApps
|
|
93
|
-
try
|
|
94
|
-
if application process app exists then
|
|
95
|
-
set targetApp to application process app
|
|
96
|
-
set appName to app
|
|
97
|
-
exit repeat
|
|
98
|
-
end if
|
|
99
|
-
end try
|
|
100
|
-
end repeat
|
|
101
|
-
end if
|
|
102
|
-
|
|
103
|
-
-- If still not found, check code editors
|
|
104
|
-
if targetApp is null then
|
|
105
|
-
repeat with app in codeApps
|
|
106
|
-
try
|
|
107
|
-
if application process app exists then
|
|
108
|
-
set targetApp to application process app
|
|
109
|
-
set appName to app
|
|
110
|
-
exit repeat
|
|
111
|
-
end if
|
|
112
|
-
end try
|
|
113
|
-
end repeat
|
|
114
|
-
end if
|
|
115
|
-
|
|
116
|
-
if targetApp is not null then
|
|
117
|
-
-- Activate application
|
|
118
|
-
set frontmost of targetApp to true
|
|
119
|
-
delay 0.8
|
|
120
|
-
|
|
121
|
-
-- Wait for application to fully activate
|
|
122
|
-
repeat while (frontmost of targetApp) is false
|
|
123
|
-
delay 0.1
|
|
124
|
-
end repeat
|
|
125
|
-
|
|
126
|
-
-- Execute different operations based on application type
|
|
127
|
-
if appName contains "Claude" then
|
|
128
|
-
-- Claude Code specific operations
|
|
129
|
-
try
|
|
130
|
-
-- Try to click input box
|
|
131
|
-
click (first text field of window 1)
|
|
132
|
-
delay 0.3
|
|
133
|
-
on error
|
|
134
|
-
-- If no text box, try keyboard navigation
|
|
135
|
-
key code 125 -- Down arrow
|
|
136
|
-
delay 0.2
|
|
137
|
-
end try
|
|
138
|
-
|
|
139
|
-
-- Clear current content and paste new command
|
|
140
|
-
keystroke "a" using command down
|
|
141
|
-
delay 0.2
|
|
142
|
-
keystroke "v" using command down
|
|
143
|
-
delay 0.5
|
|
144
|
-
|
|
145
|
-
-- Execute command
|
|
146
|
-
keystroke return
|
|
147
|
-
|
|
148
|
-
else if appName contains "Terminal" or appName contains "iTerm" or appName contains "Warp" then
|
|
149
|
-
-- Terminal application operations
|
|
150
|
-
delay 0.5
|
|
151
|
-
keystroke "v" using command down
|
|
152
|
-
delay 0.3
|
|
153
|
-
keystroke return
|
|
154
|
-
|
|
155
|
-
else
|
|
156
|
-
-- Other applications (code editors, etc.)
|
|
157
|
-
delay 0.5
|
|
158
|
-
keystroke "v" using command down
|
|
159
|
-
delay 0.3
|
|
160
|
-
keystroke return
|
|
161
|
-
end if
|
|
162
|
-
|
|
163
|
-
return "success:" & appName
|
|
164
|
-
else
|
|
165
|
-
return "no_app_found"
|
|
166
|
-
end if
|
|
167
|
-
end tell
|
|
168
|
-
`;
|
|
169
|
-
const osascript = (0, child_process_1.spawn)('osascript', ['-e', script]);
|
|
170
|
-
let output = '';
|
|
171
|
-
let error = '';
|
|
172
|
-
osascript.stdout.on('data', (data) => {
|
|
173
|
-
output += data.toString().trim();
|
|
174
|
-
});
|
|
175
|
-
osascript.stderr.on('data', (data) => {
|
|
176
|
-
error += data.toString();
|
|
177
|
-
});
|
|
178
|
-
osascript.on('close', (code) => {
|
|
179
|
-
if (code === 0 && output.startsWith('success:')) {
|
|
180
|
-
const appName = output.split(':')[1];
|
|
181
|
-
this.logger.info(`Command successfully sent to ${appName}`);
|
|
182
|
-
resolve(true);
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
this.logger.warn(`Full automation failed: ${output || error}`);
|
|
186
|
-
resolve(false);
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
osascript.on('error', (err) => {
|
|
190
|
-
this.logger.error('AppleScript execution error:', err.message);
|
|
191
|
-
resolve(false);
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Fallback automation solution - more forceful method
|
|
197
|
-
*/
|
|
198
|
-
async _fallbackAutomation(command) {
|
|
199
|
-
if (process.platform !== 'darwin') {
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
return new Promise((resolve) => {
|
|
203
|
-
// More forceful approach, directly input text
|
|
204
|
-
const escapedCommand = command
|
|
205
|
-
.replace(/\\/g, '\\\\')
|
|
206
|
-
.replace(/"/g, '\\"')
|
|
207
|
-
.replace(/'/g, "\\'")
|
|
208
|
-
.replace(/\n/g, '\\n');
|
|
209
|
-
const script = `
|
|
210
|
-
tell application "System Events"
|
|
211
|
-
-- Get current foreground application
|
|
212
|
-
set frontApp to first application process whose frontmost is true
|
|
213
|
-
set appName to name of frontApp
|
|
214
|
-
|
|
215
|
-
-- Wait a moment to ensure application responds
|
|
216
|
-
delay 1
|
|
217
|
-
|
|
218
|
-
-- Directly input command text (not dependent on clipboard)
|
|
219
|
-
try
|
|
220
|
-
-- First clear possible existing content
|
|
221
|
-
keystroke "a" using command down
|
|
222
|
-
delay 0.2
|
|
223
|
-
|
|
224
|
-
-- Input command
|
|
225
|
-
keystroke "${escapedCommand}"
|
|
226
|
-
delay 0.5
|
|
227
|
-
|
|
228
|
-
-- Execute
|
|
229
|
-
keystroke return
|
|
230
|
-
|
|
231
|
-
return "typed_success:" & appName
|
|
232
|
-
on error errorMsg
|
|
233
|
-
-- If direct input fails, try paste
|
|
234
|
-
try
|
|
235
|
-
keystroke "v" using command down
|
|
236
|
-
delay 0.3
|
|
237
|
-
keystroke return
|
|
238
|
-
return "paste_success:" & appName
|
|
239
|
-
on error
|
|
240
|
-
return "failed:" & errorMsg
|
|
241
|
-
end try
|
|
242
|
-
end try
|
|
243
|
-
end tell
|
|
244
|
-
`;
|
|
245
|
-
const osascript = (0, child_process_1.spawn)('osascript', ['-e', script]);
|
|
246
|
-
let output = '';
|
|
247
|
-
osascript.stdout.on('data', (data) => {
|
|
248
|
-
output += data.toString().trim();
|
|
249
|
-
});
|
|
250
|
-
osascript.on('close', (code) => {
|
|
251
|
-
if (code === 0 && (output.includes('success'))) {
|
|
252
|
-
this.logger.info(`Fallback automation succeeded: ${output}`);
|
|
253
|
-
resolve(true);
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
this.logger.error(`Fallback automation failed: ${output}`);
|
|
257
|
-
resolve(false);
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
osascript.on('error', () => {
|
|
261
|
-
resolve(false);
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Specifically activate Claude Code application
|
|
267
|
-
*/
|
|
268
|
-
async activateClaudeCode() {
|
|
269
|
-
if (process.platform !== 'darwin') {
|
|
270
|
-
return false;
|
|
271
|
-
}
|
|
272
|
-
return new Promise((resolve) => {
|
|
273
|
-
const script = `
|
|
274
|
-
tell application "System Events"
|
|
275
|
-
set claudeApps to {"Claude", "Claude Code", "Claude Desktop", "Anthropic Claude"}
|
|
276
|
-
|
|
277
|
-
repeat with appName in claudeApps
|
|
278
|
-
try
|
|
279
|
-
if application process appName exists then
|
|
280
|
-
set frontmost of application process appName to true
|
|
281
|
-
return "activated:" & appName
|
|
282
|
-
end if
|
|
283
|
-
end try
|
|
284
|
-
end repeat
|
|
285
|
-
|
|
286
|
-
return "not_found"
|
|
287
|
-
end tell
|
|
288
|
-
`;
|
|
289
|
-
const osascript = (0, child_process_1.spawn)('osascript', ['-e', script]);
|
|
290
|
-
let output = '';
|
|
291
|
-
osascript.stdout.on('data', (data) => {
|
|
292
|
-
output += data.toString().trim();
|
|
293
|
-
});
|
|
294
|
-
osascript.on('close', (code) => {
|
|
295
|
-
if (code === 0 && output.startsWith('activated:')) {
|
|
296
|
-
this.logger.info('Claude Code activated successfully');
|
|
297
|
-
resolve(true);
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
this.logger.warn('Could not activate Claude Code');
|
|
301
|
-
resolve(false);
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
osascript.on('error', () => resolve(false));
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Check system permissions and attempt to request
|
|
309
|
-
*/
|
|
310
|
-
async requestPermissions() {
|
|
311
|
-
if (process.platform !== 'darwin') {
|
|
312
|
-
return false;
|
|
313
|
-
}
|
|
314
|
-
try {
|
|
315
|
-
// Try a simple operation to trigger permission request
|
|
316
|
-
const script = `
|
|
317
|
-
tell application "System Events"
|
|
318
|
-
try
|
|
319
|
-
set frontApp to name of first application process whose frontmost is true
|
|
320
|
-
return "permission_granted"
|
|
321
|
-
on error
|
|
322
|
-
return "permission_denied"
|
|
323
|
-
end try
|
|
324
|
-
end tell
|
|
325
|
-
`;
|
|
326
|
-
const result = await this._runAppleScript(script);
|
|
327
|
-
return result === 'permission_granted';
|
|
328
|
-
}
|
|
329
|
-
catch (error) {
|
|
330
|
-
this.logger.error('Permission check failed:', error.message);
|
|
331
|
-
return false;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
async _runAppleScript(script) {
|
|
335
|
-
return new Promise((resolve, reject) => {
|
|
336
|
-
const osascript = (0, child_process_1.spawn)('osascript', ['-e', script]);
|
|
337
|
-
let output = '';
|
|
338
|
-
let error = '';
|
|
339
|
-
osascript.stdout.on('data', (data) => {
|
|
340
|
-
output += data.toString();
|
|
341
|
-
});
|
|
342
|
-
osascript.stderr.on('data', (data) => {
|
|
343
|
-
error += data.toString();
|
|
344
|
-
});
|
|
345
|
-
osascript.on('close', (code) => {
|
|
346
|
-
if (code === 0) {
|
|
347
|
-
resolve(output.trim());
|
|
348
|
-
}
|
|
349
|
-
else {
|
|
350
|
-
reject(new Error(error || `Exit code: ${code}`));
|
|
351
|
-
}
|
|
352
|
-
});
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Get status information
|
|
357
|
-
*/
|
|
358
|
-
getStatus() {
|
|
359
|
-
return {
|
|
360
|
-
platform: process.platform,
|
|
361
|
-
supported: process.platform === 'darwin',
|
|
362
|
-
name: 'Claude Code Automation'
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
module.exports = ClaudeAutomation;
|
|
367
|
-
//# sourceMappingURL=claude-automation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-automation.js","sourceRoot":"","sources":["../../../src/automation/claude-automation.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,iDAAsE;AACtE,4DAAoC;AAQpC,MAAM,gBAAgB;IAClB,MAAM,CAAS;IAEf;QACI,IAAI,CAAC,MAAM,GAAG,IAAI,gBAAM,CAAC,kBAAkB,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,OAAe,EAAE,YAAoB,EAAE;QACrD,IAAI,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;YAEnF,kCAAkC;YAClC,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAErC,mDAAmD;YACnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAEpD,IAAI,OAAO,EAAE,CAAC;gBACV,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;gBAC3D,OAAO,IAAI,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E;gBACzC,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC7B,CAAC,CAAC,CAAC;YAEH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAmB,EAAE,EAAE;gBAC1C,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;oBACb,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC3B,CAAC;qBAAM,CAAC;oBACJ,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,IAAI,cAAc,IAAI,EAAE,CAAC,CAAC,CAAC;gBACrD,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,SAAS;QACL,OAAO;YACH,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,SAAS,EAAE,OAAO,CAAC,QAAQ,KAAK,QAAQ;YACxC,IAAI,EAAE,wBAAwB;SACjC,CAAC;IACN,CAAC;CACJ;AAED,iBAAS,gBAAgB,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple Automation Solution
|
|
3
|
-
* Use simpler methods to handle email reply commands
|
|
4
|
-
*/
|
|
5
|
-
import Logger from '../core/logger';
|
|
6
|
-
interface SimpleAutomationStatus {
|
|
7
|
-
supported: boolean;
|
|
8
|
-
commandFile: string;
|
|
9
|
-
commandFileExists: boolean;
|
|
10
|
-
lastCommand: string | null;
|
|
11
|
-
}
|
|
12
|
-
declare class SimpleAutomation {
|
|
13
|
-
logger: Logger;
|
|
14
|
-
commandFile: string;
|
|
15
|
-
notificationSent: boolean;
|
|
16
|
-
constructor();
|
|
17
|
-
/**
|
|
18
|
-
* Send command - using multiple simple methods
|
|
19
|
-
*/
|
|
20
|
-
sendCommand(command: string, sessionId?: string): Promise<boolean>;
|
|
21
|
-
/**
|
|
22
|
-
* Save command to file
|
|
23
|
-
*/
|
|
24
|
-
_saveCommandToFile(command: string, sessionId: string): Promise<boolean>;
|
|
25
|
-
/**
|
|
26
|
-
* Copy to clipboard
|
|
27
|
-
*/
|
|
28
|
-
_copyToClipboard(command: string): Promise<boolean>;
|
|
29
|
-
/**
|
|
30
|
-
* Send rich notification
|
|
31
|
-
*/
|
|
32
|
-
_sendRichNotification(command: string, sessionId: string): Promise<boolean>;
|
|
33
|
-
/**
|
|
34
|
-
* Send simple notification
|
|
35
|
-
*/
|
|
36
|
-
_sendSimpleNotification(command: string): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Try simple automation (no complex permissions needed)
|
|
39
|
-
*/
|
|
40
|
-
_trySimpleAutomation(command: string): Promise<boolean>;
|
|
41
|
-
/**
|
|
42
|
-
* Open command file
|
|
43
|
-
*/
|
|
44
|
-
openCommandFile(): Promise<boolean>;
|
|
45
|
-
/**
|
|
46
|
-
* Clean up command files
|
|
47
|
-
*/
|
|
48
|
-
cleanupCommandFile(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Get status
|
|
51
|
-
*/
|
|
52
|
-
getStatus(): SimpleAutomationStatus;
|
|
53
|
-
_getLastCommand(): string | null;
|
|
54
|
-
}
|
|
55
|
-
export = SimpleAutomation;
|
|
56
|
-
//# sourceMappingURL=simple-automation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-automation.d.ts","sourceRoot":"","sources":["../../../src/automation/simple-automation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAEpC,UAAU,sBAAsB;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,cAAM,gBAAgB;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;;IAQ1B;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,MAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IA4B5E;;OAEG;IACG,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAwB9E;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA2BzD;;OAEG;IACG,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgDjF;;OAEG;IACG,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAc7D;;OAEG;IACG,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAqD7D;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAgBzC;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAW1B;;OAEG;IACH,SAAS,IAAI,sBAAsB;IASnC,eAAe,IAAI,MAAM,GAAG,IAAI;CAiBnC;AAED,SAAS,gBAAgB,CAAC"}
|