happy-coder 0.1.9 → 0.1.10
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/index.cjs +635 -60
- package/dist/index.mjs +637 -62
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.cts +257 -457
- package/dist/lib.d.mts +257 -457
- package/dist/lib.mjs +1 -1
- package/dist/{types-mykDX2xe.cjs → types-B2JzqUiU.cjs} +57 -98
- package/dist/{types-fXgEaaqP.mjs → types-DnQGY77F.mjs} +56 -99
- package/package.json +1 -1
- package/dist/install-B2r_gX72.cjs +0 -109
- package/dist/install-HKe7dyS4.mjs +0 -107
- package/dist/run-FBXkmmN7.mjs +0 -32
- package/dist/run-q2To6b-c.cjs +0 -34
- package/dist/uninstall-C42CoSCI.cjs +0 -53
- package/dist/uninstall-CLkTtlMv.mjs +0 -51
package/dist/run-FBXkmmN7.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { l as logger } from './types-fXgEaaqP.mjs';
|
|
2
|
-
import 'axios';
|
|
3
|
-
import 'chalk';
|
|
4
|
-
import 'fs';
|
|
5
|
-
import 'node:os';
|
|
6
|
-
import 'node:path';
|
|
7
|
-
import 'node:fs/promises';
|
|
8
|
-
import 'node:fs';
|
|
9
|
-
import 'node:events';
|
|
10
|
-
import 'socket.io-client';
|
|
11
|
-
import 'zod';
|
|
12
|
-
import 'node:crypto';
|
|
13
|
-
import 'tweetnacl';
|
|
14
|
-
import 'expo-server-sdk';
|
|
15
|
-
|
|
16
|
-
async function run() {
|
|
17
|
-
if (!process.env.HAPPY_DAEMON_MODE) {
|
|
18
|
-
throw new Error("This function should only be called by the daemon system with HAPPY_DAEMON_MODE environment variable set");
|
|
19
|
-
}
|
|
20
|
-
logger.info("Happy CLI daemon started successfully");
|
|
21
|
-
while (true) {
|
|
22
|
-
try {
|
|
23
|
-
logger.debug("Daemon heartbeat");
|
|
24
|
-
await new Promise((resolve) => setTimeout(resolve, 3e4));
|
|
25
|
-
} catch (error) {
|
|
26
|
-
logger.debug("Error in daemon loop:", error);
|
|
27
|
-
await new Promise((resolve) => setTimeout(resolve, 5e3));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { run };
|
package/dist/run-q2To6b-c.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var types = require('./types-mykDX2xe.cjs');
|
|
4
|
-
require('axios');
|
|
5
|
-
require('chalk');
|
|
6
|
-
require('fs');
|
|
7
|
-
require('node:os');
|
|
8
|
-
require('node:path');
|
|
9
|
-
require('node:fs/promises');
|
|
10
|
-
require('node:fs');
|
|
11
|
-
require('node:events');
|
|
12
|
-
require('socket.io-client');
|
|
13
|
-
require('zod');
|
|
14
|
-
require('node:crypto');
|
|
15
|
-
require('tweetnacl');
|
|
16
|
-
require('expo-server-sdk');
|
|
17
|
-
|
|
18
|
-
async function run() {
|
|
19
|
-
if (!process.env.HAPPY_DAEMON_MODE) {
|
|
20
|
-
throw new Error("This function should only be called by the daemon system with HAPPY_DAEMON_MODE environment variable set");
|
|
21
|
-
}
|
|
22
|
-
types.logger.info("Happy CLI daemon started successfully");
|
|
23
|
-
while (true) {
|
|
24
|
-
try {
|
|
25
|
-
types.logger.debug("Daemon heartbeat");
|
|
26
|
-
await new Promise((resolve) => setTimeout(resolve, 3e4));
|
|
27
|
-
} catch (error) {
|
|
28
|
-
types.logger.debug("Error in daemon loop:", error);
|
|
29
|
-
await new Promise((resolve) => setTimeout(resolve, 5e3));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
exports.run = run;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var types = require('./types-mykDX2xe.cjs');
|
|
4
|
-
var fs = require('fs');
|
|
5
|
-
var child_process = require('child_process');
|
|
6
|
-
require('axios');
|
|
7
|
-
require('chalk');
|
|
8
|
-
require('node:os');
|
|
9
|
-
require('node:path');
|
|
10
|
-
require('node:fs/promises');
|
|
11
|
-
require('node:fs');
|
|
12
|
-
require('node:events');
|
|
13
|
-
require('socket.io-client');
|
|
14
|
-
require('zod');
|
|
15
|
-
require('node:crypto');
|
|
16
|
-
require('tweetnacl');
|
|
17
|
-
require('expo-server-sdk');
|
|
18
|
-
|
|
19
|
-
const PLIST_LABEL = "com.happy-cli.daemon";
|
|
20
|
-
const PLIST_FILE = `/Library/LaunchDaemons/${PLIST_LABEL}.plist`;
|
|
21
|
-
async function uninstall$1() {
|
|
22
|
-
try {
|
|
23
|
-
if (!fs.existsSync(PLIST_FILE)) {
|
|
24
|
-
types.logger.info("Daemon plist not found. Nothing to uninstall.");
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
child_process.execSync(`launchctl unload ${PLIST_FILE}`, { stdio: "inherit" });
|
|
29
|
-
types.logger.info("Daemon stopped successfully");
|
|
30
|
-
} catch (error) {
|
|
31
|
-
types.logger.info("Failed to unload daemon (it might not be running)");
|
|
32
|
-
}
|
|
33
|
-
fs.unlinkSync(PLIST_FILE);
|
|
34
|
-
types.logger.info(`Removed daemon plist from ${PLIST_FILE}`);
|
|
35
|
-
types.logger.info("Daemon uninstalled successfully");
|
|
36
|
-
} catch (error) {
|
|
37
|
-
types.logger.debug("Failed to uninstall daemon:", error);
|
|
38
|
-
throw error;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async function uninstall() {
|
|
43
|
-
if (process.platform !== "darwin") {
|
|
44
|
-
throw new Error("Daemon uninstallation is currently only supported on macOS");
|
|
45
|
-
}
|
|
46
|
-
if (process.getuid && process.getuid() !== 0) {
|
|
47
|
-
throw new Error("Daemon uninstallation requires sudo privileges. Please run with sudo.");
|
|
48
|
-
}
|
|
49
|
-
types.logger.info("Uninstalling Happy CLI daemon for macOS...");
|
|
50
|
-
await uninstall$1();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
exports.uninstall = uninstall;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { l as logger } from './types-fXgEaaqP.mjs';
|
|
2
|
-
import { existsSync, unlinkSync } from 'fs';
|
|
3
|
-
import { execSync } from 'child_process';
|
|
4
|
-
import 'axios';
|
|
5
|
-
import 'chalk';
|
|
6
|
-
import 'node:os';
|
|
7
|
-
import 'node:path';
|
|
8
|
-
import 'node:fs/promises';
|
|
9
|
-
import 'node:fs';
|
|
10
|
-
import 'node:events';
|
|
11
|
-
import 'socket.io-client';
|
|
12
|
-
import 'zod';
|
|
13
|
-
import 'node:crypto';
|
|
14
|
-
import 'tweetnacl';
|
|
15
|
-
import 'expo-server-sdk';
|
|
16
|
-
|
|
17
|
-
const PLIST_LABEL = "com.happy-cli.daemon";
|
|
18
|
-
const PLIST_FILE = `/Library/LaunchDaemons/${PLIST_LABEL}.plist`;
|
|
19
|
-
async function uninstall$1() {
|
|
20
|
-
try {
|
|
21
|
-
if (!existsSync(PLIST_FILE)) {
|
|
22
|
-
logger.info("Daemon plist not found. Nothing to uninstall.");
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
execSync(`launchctl unload ${PLIST_FILE}`, { stdio: "inherit" });
|
|
27
|
-
logger.info("Daemon stopped successfully");
|
|
28
|
-
} catch (error) {
|
|
29
|
-
logger.info("Failed to unload daemon (it might not be running)");
|
|
30
|
-
}
|
|
31
|
-
unlinkSync(PLIST_FILE);
|
|
32
|
-
logger.info(`Removed daemon plist from ${PLIST_FILE}`);
|
|
33
|
-
logger.info("Daemon uninstalled successfully");
|
|
34
|
-
} catch (error) {
|
|
35
|
-
logger.debug("Failed to uninstall daemon:", error);
|
|
36
|
-
throw error;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async function uninstall() {
|
|
41
|
-
if (process.platform !== "darwin") {
|
|
42
|
-
throw new Error("Daemon uninstallation is currently only supported on macOS");
|
|
43
|
-
}
|
|
44
|
-
if (process.getuid && process.getuid() !== 0) {
|
|
45
|
-
throw new Error("Daemon uninstallation requires sudo privileges. Please run with sudo.");
|
|
46
|
-
}
|
|
47
|
-
logger.info("Uninstalling Happy CLI daemon for macOS...");
|
|
48
|
-
await uninstall$1();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { uninstall };
|