happy-coder 0.1.6 → 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.
Files changed (57) hide show
  1. package/dist/index.cjs +354 -917
  2. package/dist/index.mjs +280 -843
  3. package/dist/install-B2r_gX72.cjs +109 -0
  4. package/dist/install-HKe7dyS4.mjs +107 -0
  5. package/dist/lib.cjs +32 -0
  6. package/dist/lib.d.cts +727 -0
  7. package/dist/lib.d.mts +727 -0
  8. package/dist/lib.mjs +14 -0
  9. package/dist/run-FBXkmmN7.mjs +32 -0
  10. package/dist/run-q2To6b-c.cjs +34 -0
  11. package/dist/types-fXgEaaqP.mjs +861 -0
  12. package/dist/types-mykDX2xe.cjs +872 -0
  13. package/dist/uninstall-C42CoSCI.cjs +53 -0
  14. package/dist/uninstall-CLkTtlMv.mjs +51 -0
  15. package/package.json +28 -13
  16. package/dist/auth/auth.d.ts +0 -38
  17. package/dist/auth/auth.js +0 -76
  18. package/dist/auth/auth.test.d.ts +0 -7
  19. package/dist/auth/auth.test.js +0 -96
  20. package/dist/auth/crypto.d.ts +0 -25
  21. package/dist/auth/crypto.js +0 -36
  22. package/dist/claude/claude.d.ts +0 -54
  23. package/dist/claude/claude.js +0 -170
  24. package/dist/claude/claude.test.d.ts +0 -7
  25. package/dist/claude/claude.test.js +0 -130
  26. package/dist/claude/types.d.ts +0 -37
  27. package/dist/claude/types.js +0 -7
  28. package/dist/commands/start.d.ts +0 -38
  29. package/dist/commands/start.js +0 -161
  30. package/dist/commands/start.test.d.ts +0 -7
  31. package/dist/commands/start.test.js +0 -307
  32. package/dist/handlers/message-handler.d.ts +0 -65
  33. package/dist/handlers/message-handler.js +0 -187
  34. package/dist/index.d.ts +0 -1
  35. package/dist/index.js +0 -1
  36. package/dist/session/service.d.ts +0 -27
  37. package/dist/session/service.js +0 -93
  38. package/dist/session/service.test.d.ts +0 -7
  39. package/dist/session/service.test.js +0 -71
  40. package/dist/session/types.d.ts +0 -44
  41. package/dist/session/types.js +0 -4
  42. package/dist/socket/client.d.ts +0 -50
  43. package/dist/socket/client.js +0 -136
  44. package/dist/socket/client.test.d.ts +0 -7
  45. package/dist/socket/client.test.js +0 -74
  46. package/dist/socket/types.d.ts +0 -80
  47. package/dist/socket/types.js +0 -12
  48. package/dist/utils/config.d.ts +0 -22
  49. package/dist/utils/config.js +0 -23
  50. package/dist/utils/logger.d.ts +0 -26
  51. package/dist/utils/logger.js +0 -60
  52. package/dist/utils/paths.d.ts +0 -18
  53. package/dist/utils/paths.js +0 -24
  54. package/dist/utils/qrcode.d.ts +0 -19
  55. package/dist/utils/qrcode.js +0 -37
  56. package/dist/utils/qrcode.test.d.ts +0 -7
  57. package/dist/utils/qrcode.test.js +0 -14
@@ -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();
@@ -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;
@@ -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
- }
@@ -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;
@@ -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,7 +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
- export {};
@@ -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
- });