remoat 0.2.11 → 0.2.12

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/bin/cli.js CHANGED
File without changes
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Check if Antigravity is running with CDP ports.
3
+ * If not running, output a warning log (no auto-start or restart).
4
+ *
5
+ * Called during Bot initialization.
6
+ */
7
+ export declare function ensureAntigravityRunning(): Promise<void>;
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ensureAntigravityRunning = ensureAntigravityRunning;
37
+ const logger_1 = require("../utils/logger");
38
+ const cdpPorts_1 = require("../utils/cdpPorts");
39
+ const pathUtils_1 = require("../utils/pathUtils");
40
+ const http = __importStar(require("http"));
41
+ /**
42
+ * Check if CDP responds on the specified port.
43
+ */
44
+ function checkPort(port) {
45
+ return new Promise((resolve) => {
46
+ const req = http.get(`http://127.0.0.1:${port}/json/list`, (res) => {
47
+ let data = '';
48
+ res.on('data', (chunk) => (data += chunk));
49
+ res.on('end', () => {
50
+ try {
51
+ const parsed = JSON.parse(data);
52
+ resolve(Array.isArray(parsed));
53
+ }
54
+ catch {
55
+ resolve(false);
56
+ }
57
+ });
58
+ });
59
+ req.on('error', () => resolve(false));
60
+ req.setTimeout(2000, () => {
61
+ req.destroy();
62
+ resolve(false);
63
+ });
64
+ });
65
+ }
66
+ /**
67
+ * Check if Antigravity is running with CDP ports.
68
+ * If not running, output a warning log (no auto-start or restart).
69
+ *
70
+ * Called during Bot initialization.
71
+ */
72
+ async function ensureAntigravityRunning() {
73
+ logger_1.logger.debug('[AntigravityLauncher] Checking CDP ports...');
74
+ const results = await Promise.all(cdpPorts_1.CDP_PORTS.map((port) => checkPort(port)));
75
+ const foundIndex = results.indexOf(true);
76
+ if (foundIndex !== -1) {
77
+ logger_1.logger.debug(`[AntigravityLauncher] OK — Port ${cdpPorts_1.CDP_PORTS[foundIndex]} responding`);
78
+ return;
79
+ }
80
+ logger_1.logger.warn('');
81
+ logger_1.logger.warn('='.repeat(70));
82
+ logger_1.logger.warn(' Antigravity CDP ports are not responding');
83
+ logger_1.logger.warn('');
84
+ logger_1.logger.warn(' Launch Antigravity with CDP enabled:');
85
+ logger_1.logger.warn(' remoat open');
86
+ logger_1.logger.warn('');
87
+ logger_1.logger.warn(' Or manually:');
88
+ logger_1.logger.warn(` ${(0, pathUtils_1.getAntigravityCdpHint)(9222)}`);
89
+ logger_1.logger.warn('');
90
+ logger_1.logger.warn(' The bot will auto-connect once Antigravity is running.');
91
+ logger_1.logger.warn('='.repeat(70));
92
+ logger_1.logger.warn('');
93
+ }
94
+ //# sourceMappingURL=antigravityLauncher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"antigravityLauncher.js","sourceRoot":"","sources":["../../src/services/antigravityLauncher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,4DAuBC;AA3DD,4CAAyC;AACzC,gDAA8C;AAC9C,kDAA2D;AAC3D,2CAA6B;AAE7B;;GAEG;AACH,SAAS,SAAS,CAAC,IAAY;IAC3B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,oBAAoB,IAAI,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE;YAC/D,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC;YAC3C,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBACf,IAAI,CAAC;oBACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBAChC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;gBACnC,CAAC;gBAAC,MAAM,CAAC;oBACL,OAAO,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QACtC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE;YACtB,GAAG,CAAC,OAAO,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;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1,6 +1,6 @@
1
1
  {
2
2
  "name": "remoat",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Control Antigravity from anywhere — a local Telegram Bot that lets you remotely operate Antigravity on your home PC from your smartphone.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -23,6 +23,7 @@
23
23
  "test:unit": "jest",
24
24
  "test:integration": "jest tests/e2e.bot.test.ts",
25
25
  "test:watch": "jest --watch",
26
+ "prebuild": "rm -f tsconfig.tsbuildinfo",
26
27
  "build": "tsc",
27
28
  "start": "ts-node src/bin/cli.ts",
28
29
  "start:built": "node dist/bin/cli.js",
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Postinstall welcome message — shown after `npm install -g remoat`.
4
- * Standalone script: no imports from the rest of the codebase.
5
- */
6
- declare const C: {
7
- readonly reset: "\u001B[0m";
8
- readonly bold: "\u001B[1m";
9
- readonly dim: "\u001B[2m";
10
- readonly cyan: "\u001B[36m";
11
- readonly green: "\u001B[32m";
12
- readonly yellow: "\u001B[33m";
13
- };
14
- declare const version: string;
15
- declare const logo: string;
16
- declare const width = 50;
17
- declare const borderTop: string;
18
- declare const borderBottom: string;
19
- declare const pad: (s: string) => string;
20
- declare const empty: string;
21
- /** Length of a string ignoring ANSI escape codes. */
22
- declare function visibleLength(s: string): number;
23
- declare const lines: string[];
@@ -1,64 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- /**
4
- * Postinstall welcome message — shown after `npm install -g remoat`.
5
- * Standalone script: no imports from the rest of the codebase.
6
- */
7
- const C = {
8
- reset: '\x1b[0m',
9
- bold: '\x1b[1m',
10
- dim: '\x1b[2m',
11
- cyan: '\x1b[36m',
12
- green: '\x1b[32m',
13
- yellow: '\x1b[33m',
14
- };
15
- // Read version from package.json at runtime
16
- const version = (() => {
17
- try {
18
- const pkg = require('../../package.json');
19
- return pkg.version;
20
- }
21
- catch {
22
- return 'unknown';
23
- }
24
- })();
25
- const logo = [
26
- `${C.cyan} . * .${C.reset}`,
27
- `${C.cyan} __ z Z${C.reset}`,
28
- `${C.cyan} * / o o\\________z${C.reset} *`,
29
- `${C.cyan} \\ / |${C.reset}`,
30
- `${C.cyan} | | ||---||${C.reset} .`,
31
- `${C.cyan} _|___|_ || ||${C.reset}`,
32
- ].join('\n');
33
- const width = 50;
34
- const borderTop = `╭${'─'.repeat(width)}╮`;
35
- const borderBottom = `╰${'─'.repeat(width)}╯`;
36
- const pad = (s) => `│ ${s}${''.padEnd(width - visibleLength(s) - 4)} │`;
37
- const empty = `│${''.padEnd(width)}│`;
38
- /** Length of a string ignoring ANSI escape codes. */
39
- function visibleLength(s) {
40
- return s.replace(/\x1b\[\d+m/g, '').length;
41
- }
42
- const lines = [
43
- '',
44
- borderTop,
45
- empty,
46
- ...logo.split('\n').map(l => pad(l)),
47
- empty,
48
- pad(`${C.bold}Remoat${C.reset} v${version}`),
49
- pad(`${C.dim}Control Antigravity from your phone${C.reset}`),
50
- empty,
51
- pad(`${C.yellow}Quick start:${C.reset}`),
52
- pad(` ${C.bold}1.${C.reset} ${C.green}remoat setup${C.reset} ${C.dim}— configure Telegram bot${C.reset}`),
53
- pad(` ${C.bold}2.${C.reset} ${C.green}remoat open${C.reset} ${C.dim}— launch Antigravity + CDP${C.reset}`),
54
- pad(` ${C.bold}3.${C.reset} ${C.green}remoat start${C.reset} ${C.dim}— start the bot${C.reset}`),
55
- empty,
56
- pad(`${C.dim}Troubleshoot: ${C.reset}${C.green}remoat doctor${C.reset}`),
57
- pad(`${C.dim}GitHub: ${C.reset}${C.cyan}github.com/optimistengineer/Remoat${C.reset}`),
58
- empty,
59
- borderBottom,
60
- '',
61
- ];
62
- // npm v7+ suppresses stdout from lifecycle scripts; stderr is always shown.
63
- process.stderr.write(lines.join('\n') + '\n');
64
- //# sourceMappingURL=postinstall.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../../src/bin/postinstall.ts"],"names":[],"mappings":";;AAE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