happy-coder 0.1.7 → 0.1.9
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 +354 -917
- package/dist/index.mjs +280 -843
- package/dist/install-B2r_gX72.cjs +109 -0
- package/dist/install-HKe7dyS4.mjs +107 -0
- package/dist/lib.cjs +32 -0
- package/dist/lib.d.cts +727 -0
- package/dist/lib.d.mts +727 -0
- package/dist/lib.mjs +14 -0
- package/dist/run-FBXkmmN7.mjs +32 -0
- package/dist/run-q2To6b-c.cjs +34 -0
- package/dist/types-fXgEaaqP.mjs +861 -0
- package/dist/types-mykDX2xe.cjs +872 -0
- package/dist/uninstall-C42CoSCI.cjs +53 -0
- package/dist/uninstall-CLkTtlMv.mjs +51 -0
- package/package.json +25 -10
- package/dist/auth/auth.d.ts +0 -38
- package/dist/auth/auth.js +0 -76
- package/dist/auth/auth.test.d.ts +0 -7
- package/dist/auth/auth.test.js +0 -96
- package/dist/auth/crypto.d.ts +0 -25
- package/dist/auth/crypto.js +0 -36
- package/dist/claude/claude.d.ts +0 -54
- package/dist/claude/claude.js +0 -170
- package/dist/claude/claude.test.d.ts +0 -7
- package/dist/claude/claude.test.js +0 -130
- package/dist/claude/types.d.ts +0 -37
- package/dist/claude/types.js +0 -7
- package/dist/commands/start.d.ts +0 -38
- package/dist/commands/start.js +0 -161
- package/dist/commands/start.test.d.ts +0 -7
- package/dist/commands/start.test.js +0 -307
- package/dist/handlers/message-handler.d.ts +0 -65
- package/dist/handlers/message-handler.js +0 -187
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/session/service.d.ts +0 -27
- package/dist/session/service.js +0 -93
- package/dist/session/service.test.d.ts +0 -7
- package/dist/session/service.test.js +0 -71
- package/dist/session/types.d.ts +0 -44
- package/dist/session/types.js +0 -4
- package/dist/socket/client.d.ts +0 -50
- package/dist/socket/client.js +0 -136
- package/dist/socket/client.test.d.ts +0 -7
- package/dist/socket/client.test.js +0 -74
- package/dist/socket/types.d.ts +0 -80
- package/dist/socket/types.js +0 -12
- package/dist/utils/config.d.ts +0 -22
- package/dist/utils/config.js +0 -23
- package/dist/utils/logger.d.ts +0 -26
- package/dist/utils/logger.js +0 -60
- package/dist/utils/paths.d.ts +0 -18
- package/dist/utils/paths.js +0 -24
- package/dist/utils/qrcode.d.ts +0 -19
- package/dist/utils/qrcode.js +0 -37
- package/dist/utils/qrcode.test.d.ts +0 -7
- package/dist/utils/qrcode.test.js +0 -14
package/dist/utils/logger.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Logger utility for handy-cli
|
|
3
|
-
*
|
|
4
|
-
* This module provides structured logging with different log levels and colors.
|
|
5
|
-
*
|
|
6
|
-
* Key responsibilities:
|
|
7
|
-
* - Provide consistent logging interface
|
|
8
|
-
* - Color-coded output for different log levels
|
|
9
|
-
* - Timestamp prefixes for better debugging
|
|
10
|
-
*/
|
|
11
|
-
import chalk from 'chalk';
|
|
12
|
-
export var LogLevel;
|
|
13
|
-
(function (LogLevel) {
|
|
14
|
-
LogLevel["DEBUG"] = "DEBUG";
|
|
15
|
-
LogLevel["ERROR"] = "ERROR";
|
|
16
|
-
LogLevel["INFO"] = "INFO";
|
|
17
|
-
LogLevel["WARN"] = "WARN";
|
|
18
|
-
})(LogLevel || (LogLevel = {}));
|
|
19
|
-
class Logger {
|
|
20
|
-
debug(message, ...args) {
|
|
21
|
-
if (process.env.DEBUG) {
|
|
22
|
-
this.log(LogLevel.DEBUG, message, ...args);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
error(message, ...args) {
|
|
26
|
-
this.log(LogLevel.ERROR, message, ...args);
|
|
27
|
-
}
|
|
28
|
-
info(message, ...args) {
|
|
29
|
-
this.log(LogLevel.INFO, message, ...args);
|
|
30
|
-
}
|
|
31
|
-
warn(message, ...args) {
|
|
32
|
-
this.log(LogLevel.WARN, message, ...args);
|
|
33
|
-
}
|
|
34
|
-
getTimestamp() {
|
|
35
|
-
return new Date().toISOString();
|
|
36
|
-
}
|
|
37
|
-
log(level, message, ...args) {
|
|
38
|
-
const timestamp = this.getTimestamp();
|
|
39
|
-
const prefix = `[${timestamp}] [${level}]`;
|
|
40
|
-
switch (level) {
|
|
41
|
-
case LogLevel.DEBUG: {
|
|
42
|
-
console.log(chalk.gray(prefix), message, ...args);
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
case LogLevel.ERROR: {
|
|
46
|
-
console.error(chalk.red(prefix), message, ...args);
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
case LogLevel.INFO: {
|
|
50
|
-
console.log(chalk.blue(prefix), message, ...args);
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
case LogLevel.WARN: {
|
|
54
|
-
console.log(chalk.yellow(prefix), message, ...args);
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
export const logger = new Logger();
|
package/dist/utils/paths.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Path utilities for handy-cli
|
|
3
|
-
*
|
|
4
|
-
* This module provides utilities for working with file paths,
|
|
5
|
-
* particularly for accessing user home directory and config files.
|
|
6
|
-
*
|
|
7
|
-
* Key responsibilities:
|
|
8
|
-
* - Resolve paths relative to user home directory
|
|
9
|
-
* - Provide consistent paths for config and secret files
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Get the path to the secret key file in user's home directory
|
|
13
|
-
*/
|
|
14
|
-
export declare function getSecretKeyPath(): string;
|
|
15
|
-
/**
|
|
16
|
-
* Get the user's home directory
|
|
17
|
-
*/
|
|
18
|
-
export declare function getHomeDir(): string;
|
package/dist/utils/paths.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Path utilities for handy-cli
|
|
3
|
-
*
|
|
4
|
-
* This module provides utilities for working with file paths,
|
|
5
|
-
* particularly for accessing user home directory and config files.
|
|
6
|
-
*
|
|
7
|
-
* Key responsibilities:
|
|
8
|
-
* - Resolve paths relative to user home directory
|
|
9
|
-
* - Provide consistent paths for config and secret files
|
|
10
|
-
*/
|
|
11
|
-
import { homedir } from 'node:os';
|
|
12
|
-
import { join } from 'node:path';
|
|
13
|
-
/**
|
|
14
|
-
* Get the path to the secret key file in user's home directory
|
|
15
|
-
*/
|
|
16
|
-
export function getSecretKeyPath() {
|
|
17
|
-
return join(homedir(), '.handy-claude-code.key');
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get the user's home directory
|
|
21
|
-
*/
|
|
22
|
-
export function getHomeDir() {
|
|
23
|
-
return homedir();
|
|
24
|
-
}
|
package/dist/utils/qrcode.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* QR Code utility for handy-cli
|
|
3
|
-
*
|
|
4
|
-
* This module handles QR code generation and terminal display for the handy:// URL.
|
|
5
|
-
*
|
|
6
|
-
* Key responsibilities:
|
|
7
|
-
* - Generate QR codes for terminal display
|
|
8
|
-
* - Format QR codes with proper spacing and borders
|
|
9
|
-
* - Handle errors gracefully
|
|
10
|
-
*
|
|
11
|
-
* Design decisions:
|
|
12
|
-
* - Uses qrcode-terminal for ASCII art QR codes
|
|
13
|
-
* - Displays QR codes with clear instructions
|
|
14
|
-
* - Provides fallback text if QR generation fails
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Display a QR code in the terminal for the given URL
|
|
18
|
-
*/
|
|
19
|
-
export declare function displayQRCode(url: string): void;
|
package/dist/utils/qrcode.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* QR Code utility for handy-cli
|
|
3
|
-
*
|
|
4
|
-
* This module handles QR code generation and terminal display for the handy:// URL.
|
|
5
|
-
*
|
|
6
|
-
* Key responsibilities:
|
|
7
|
-
* - Generate QR codes for terminal display
|
|
8
|
-
* - Format QR codes with proper spacing and borders
|
|
9
|
-
* - Handle errors gracefully
|
|
10
|
-
*
|
|
11
|
-
* Design decisions:
|
|
12
|
-
* - Uses qrcode-terminal for ASCII art QR codes
|
|
13
|
-
* - Displays QR codes with clear instructions
|
|
14
|
-
* - Provides fallback text if QR generation fails
|
|
15
|
-
*/
|
|
16
|
-
import qrcode from 'qrcode-terminal';
|
|
17
|
-
import { logger } from './logger.js';
|
|
18
|
-
/**
|
|
19
|
-
* Display a QR code in the terminal for the given URL
|
|
20
|
-
*/
|
|
21
|
-
export function displayQRCode(url) {
|
|
22
|
-
try {
|
|
23
|
-
logger.info('\n' + '='.repeat(50));
|
|
24
|
-
logger.info('📱 Scan this QR code with your mobile device:');
|
|
25
|
-
logger.info('='.repeat(50));
|
|
26
|
-
qrcode.generate(url, { small: true }, (qr) => {
|
|
27
|
-
console.log(qr);
|
|
28
|
-
});
|
|
29
|
-
logger.info('='.repeat(50));
|
|
30
|
-
logger.info(`📋 Or copy this URL manually: ${url}`);
|
|
31
|
-
logger.info('='.repeat(50) + '\n');
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
logger.error('Failed to generate QR code:', error);
|
|
35
|
-
logger.info(`📋 Use this URL to connect: ${url}`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for the QR code utility
|
|
3
|
-
*
|
|
4
|
-
* These tests verify the QR code generation functionality works correctly
|
|
5
|
-
* and handles edge cases gracefully.
|
|
6
|
-
*/
|
|
7
|
-
import { expect } from 'chai';
|
|
8
|
-
import { displayQRCode } from './qrcode.js';
|
|
9
|
-
describe('QR Code Utility', () => {
|
|
10
|
-
it('should render a small QR code without throwing', () => {
|
|
11
|
-
const testUrl = 'handy://test';
|
|
12
|
-
expect(() => displayQRCode(testUrl)).to.not.throw();
|
|
13
|
-
});
|
|
14
|
-
});
|