glad-web 1.0.45 → 2.0.1

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 (68) hide show
  1. package/README.md +4 -192
  2. package/THIRD_PARTY_NOTICES.md +27 -0
  3. package/bin/glad.cjs +56 -0
  4. package/package.json +19 -58
  5. package/README.zh-CN.md +0 -198
  6. package/assets/logo.svg +0 -43
  7. package/bin/cli.js +0 -65
  8. package/lib/ai-tools/demo/enhanced-demo.js +0 -625
  9. package/lib/ai-tools/demo/index.js +0 -24
  10. package/lib/ai-tools/demo/responses.js +0 -88
  11. package/lib/ai-tools/detector.js +0 -76
  12. package/lib/ai-tools/registry.js +0 -300
  13. package/lib/claude/cli-usage.js +0 -95
  14. package/lib/claude/config.js +0 -82
  15. package/lib/claude/structured-session.js +0 -884
  16. package/lib/claude/transcript-repository.js +0 -216
  17. package/lib/codex/image-store.js +0 -174
  18. package/lib/codex/structured-session.js +0 -1578
  19. package/lib/commands/config.js +0 -78
  20. package/lib/commands/tools.js +0 -128
  21. package/lib/commands/web.js +0 -586
  22. package/lib/config/constants.js +0 -17
  23. package/lib/config/manager.js +0 -89
  24. package/lib/git/service.js +0 -83
  25. package/lib/notifications/message-formatter.js +0 -94
  26. package/lib/notifications/notification-service.js +0 -143
  27. package/lib/notifications/serverchan-client.js +0 -58
  28. package/lib/notifications/serverchan-settings-store.js +0 -115
  29. package/lib/schedule/job-runner.js +0 -162
  30. package/lib/schedule/job-store.js +0 -167
  31. package/lib/schedule/key-sequences.js +0 -49
  32. package/lib/schedule/scheduler-service.js +0 -39
  33. package/lib/server/routes/notifications.js +0 -52
  34. package/lib/server/routes/providers.js +0 -114
  35. package/lib/server/routes/schedules.js +0 -54
  36. package/lib/server/routes/usage.js +0 -23
  37. package/lib/server/routes/workspace.js +0 -77
  38. package/lib/session/buffer.js +0 -102
  39. package/lib/session/file-attachment-store.js +0 -168
  40. package/lib/session/pty-manager.js +0 -255
  41. package/lib/session/rendered-history.js +0 -225
  42. package/lib/session/session-manager.js +0 -1001
  43. package/lib/session/text-history.js +0 -274
  44. package/lib/usage/ccusage-runner.js +0 -128
  45. package/lib/usage/source-catalog.js +0 -26
  46. package/lib/usage/usage-service.js +0 -226
  47. package/lib/utils/logger.js +0 -74
  48. package/lib/utils/pid.js +0 -67
  49. package/lib/utils/validation.js +0 -53
  50. package/lib/web/claude.js +0 -1129
  51. package/lib/web/codex.js +0 -1042
  52. package/lib/web/composer.js +0 -463
  53. package/lib/web/core.js +0 -373
  54. package/lib/web/git.js +0 -535
  55. package/lib/web/gitgraph.js +0 -293
  56. package/lib/web/index.html +0 -516
  57. package/lib/web/layout.js +0 -72
  58. package/lib/web/notifications.js +0 -163
  59. package/lib/web/schedules.js +0 -245
  60. package/lib/web/session.js +0 -360
  61. package/lib/web/shell.js +0 -59
  62. package/lib/web/styles.css +0 -905
  63. package/lib/web/terminal-scroll.js +0 -81
  64. package/lib/web/theme.js +0 -60
  65. package/lib/web/timed-inputs.js +0 -216
  66. package/lib/web/usage.js +0 -323
  67. package/lib/workspace/service.js +0 -77
  68. package/scripts/check-syntax.js +0 -26
@@ -1,78 +0,0 @@
1
- const chalk = require('chalk');
2
- const { getConfig, setConfig, getConfigPath } = require('../config/manager');
3
- const logger = require('../utils/logger');
4
-
5
- async function configShowCommand() {
6
- const config = getConfig();
7
-
8
- console.log(chalk.bold('Glad Configuration:'));
9
- console.log('');
10
- console.log(chalk.bold.cyan('User Settings:'));
11
- console.log(` Default AI: ${config.defaultAI || '(auto-detect)'}`);
12
- console.log('');
13
- console.log(chalk.bold.cyan('System:'));
14
- console.log(` Config file: ${chalk.gray(getConfigPath())}`);
15
- console.log(` Last updated: ${config.lastUpdated || 'Never'}`);
16
- console.log('');
17
- console.log(`To change settings: ${chalk.cyan('glad config set <key> <value>')}`);
18
- }
19
-
20
- async function configGetCommand(key) {
21
- if (!key) {
22
- return configShowCommand();
23
- }
24
-
25
- const value = getConfig(key);
26
-
27
- if (value === undefined) {
28
- console.error(chalk.red(`Unknown config key: ${key}`));
29
- console.error('');
30
- console.error('Available keys: defaultAI');
31
- return;
32
- }
33
-
34
- console.log(value);
35
- }
36
-
37
- async function configSetCommand(key, value) {
38
- if (!key || !value) {
39
- console.error(chalk.red('Usage: glad config set <key> <value>'));
40
- console.error('');
41
- console.error('Examples:');
42
- console.error(chalk.cyan(' glad config set defaultAI aider'));
43
- return;
44
- }
45
-
46
- const validKeys = ['defaultAI'];
47
-
48
- if (!validKeys.includes(key)) {
49
- console.error(chalk.red(`Invalid config key: ${key}`));
50
- console.error('');
51
- console.error(`Valid keys: ${validKeys.join(', ')}`);
52
- return;
53
- }
54
-
55
- setConfig(key, value);
56
- logger.success(`Config updated: ${key} = ${value}`);
57
- }
58
-
59
- async function configCommand(action, key, value) {
60
- if (!action) {
61
- return configShowCommand();
62
- }
63
-
64
- switch (action) {
65
- case 'get':
66
- await configGetCommand(key);
67
- break;
68
-
69
- case 'set':
70
- await configSetCommand(key, value);
71
- break;
72
-
73
- default:
74
- await configGetCommand(action);
75
- }
76
- }
77
-
78
- module.exports = configCommand;
@@ -1,128 +0,0 @@
1
- const chalk = require('chalk');
2
- const { getAllTools, getToolByKey } = require('../ai-tools/registry');
3
- const { detectInstalledTools } = require('../ai-tools/detector');
4
-
5
- async function toolsListCommand() {
6
- console.log(chalk.bold('Available AI Tools:'));
7
- console.log('');
8
-
9
- const allTools = getAllTools();
10
- const installedTools = await detectInstalledTools();
11
-
12
- const installedKeys = new Set(installedTools.map(t => t.key));
13
-
14
- for (const tool of allTools) {
15
- // Skip demo mode from tools list (it's a special hidden mode)
16
- if (tool.key === 'demo') {
17
- continue;
18
- }
19
-
20
- const isInstalled = installedKeys.has(tool.key);
21
- const icon = isInstalled ? chalk.green('✓') : chalk.red('✗');
22
- const status = isInstalled ? chalk.green('installed') : chalk.gray('not installed');
23
-
24
- const installedTool = installedTools.find(t => t.key === tool.key);
25
- const version = installedTool ? ` v${installedTool.version}` : '';
26
-
27
- console.log(` ${icon} ${chalk.bold(tool.displayName)} (${tool.command})${version} - ${status}`);
28
- }
29
-
30
- console.log('');
31
- console.log(`Use ${chalk.cyan('glad')} and choose a tool from the Web UI, or start Glad in your target directory`);
32
- }
33
-
34
- async function toolsDetectCommand() {
35
- console.log(chalk.bold('🔍 Detecting installed AI tools...'));
36
- console.log('');
37
-
38
- const installedTools = await detectInstalledTools();
39
-
40
- if (installedTools.length === 0) {
41
- console.log(chalk.yellow('No AI tools found'));
42
- console.log('');
43
- console.log('Install an AI coding assistant:');
44
- console.log(' • Claude Code: https://docs.claude.com');
45
- console.log(' • Aider: pip install aider-chat');
46
- console.log(' • GitHub Copilot: gh extension install github/gh-copilot');
47
- return;
48
- }
49
-
50
- console.log(chalk.green(`Found ${installedTools.length} AI tool${installedTools.length > 1 ? 's' : ''}:`));
51
- console.log('');
52
-
53
- installedTools.forEach(tool => {
54
- console.log(` • ${chalk.bold(tool.displayName)} v${tool.version}`);
55
- });
56
-
57
- console.log('');
58
- if (installedTools.length === 1) {
59
- console.log(chalk.cyan(`Recommended: ${installedTools[0].displayName}`));
60
- }
61
- }
62
-
63
- async function toolsInfoCommand(toolName) {
64
- if (!toolName) {
65
- console.error(chalk.red('Please specify a tool name'));
66
- console.error('');
67
- console.error(`Usage: ${chalk.cyan('glad tools info <tool-name>')}`);
68
- return;
69
- }
70
-
71
- const tool = getToolByKey(toolName);
72
-
73
- if (!tool) {
74
- console.error(chalk.red(`Unknown tool: ${toolName}`));
75
- console.error('');
76
- console.error(`Use ${chalk.cyan('glad tools list')} to see available tools`);
77
- return;
78
- }
79
-
80
- console.log(chalk.bold(tool.displayName));
81
- console.log('─'.repeat(tool.displayName.length));
82
- console.log(`${chalk.gray('Command:')} ${tool.command}`);
83
- console.log(`${chalk.gray('Description:')} ${tool.description}`);
84
- console.log(`${chalk.gray('Website:')} ${tool.website}`);
85
-
86
- const { isToolInstalled } = require('../ai-tools/detector');
87
- const result = await isToolInstalled(tool.key);
88
-
89
- if (result.installed) {
90
- console.log(`${chalk.gray('Installed:')} ${chalk.green('✓ Yes')} (v${result.tool.version})`);
91
- } else {
92
- console.log(`${chalk.gray('Installed:')} ${chalk.red('✗ No')}`);
93
- }
94
-
95
- console.log('');
96
- console.log(chalk.bold('Example usage:'));
97
- console.log(chalk.cyan(` glad`));
98
-
99
- if (tool.key === 'aider') {
100
- console.log(chalk.cyan(' glad /path/to/project'));
101
- }
102
- }
103
-
104
- async function toolsCommand(action, toolName) {
105
- switch (action) {
106
- case 'list':
107
- await toolsListCommand();
108
- break;
109
-
110
- case 'detect':
111
- await toolsDetectCommand();
112
- break;
113
-
114
- case 'info':
115
- await toolsInfoCommand(toolName);
116
- break;
117
-
118
- default:
119
- console.error(chalk.red(`Unknown action: ${action}`));
120
- console.error('');
121
- console.error('Available actions:');
122
- console.error(chalk.cyan(' glad tools list'));
123
- console.error(chalk.cyan(' glad tools detect'));
124
- console.error(chalk.cyan(' glad tools info <tool-name>'));
125
- }
126
- }
127
-
128
- module.exports = toolsCommand;