glad-web 1.0.46 → 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.
- package/README.md +4 -192
- package/THIRD_PARTY_NOTICES.md +27 -0
- package/bin/glad.cjs +56 -0
- package/package.json +19 -61
- package/README.zh-CN.md +0 -198
- package/assets/logo.svg +0 -43
- package/bin/cli.js +0 -65
- package/lib/ai-tools/demo/enhanced-demo.js +0 -625
- package/lib/ai-tools/demo/index.js +0 -24
- package/lib/ai-tools/demo/responses.js +0 -88
- package/lib/ai-tools/detector.js +0 -76
- package/lib/ai-tools/registry.js +0 -300
- package/lib/claude/cli-usage.js +0 -95
- package/lib/claude/config.js +0 -82
- package/lib/claude/structured-session.js +0 -884
- package/lib/claude/transcript-repository.js +0 -216
- package/lib/codex/image-store.js +0 -174
- package/lib/codex/structured-session.js +0 -1590
- package/lib/commands/config.js +0 -78
- package/lib/commands/tools.js +0 -128
- package/lib/commands/web.js +0 -605
- package/lib/config/constants.js +0 -17
- package/lib/config/manager.js +0 -108
- package/lib/git/service.js +0 -83
- package/lib/notifications/message-formatter.js +0 -94
- package/lib/notifications/notification-service.js +0 -143
- package/lib/notifications/serverchan-client.js +0 -58
- package/lib/notifications/serverchan-settings-store.js +0 -115
- package/lib/schedule/job-runner.js +0 -162
- package/lib/schedule/job-store.js +0 -167
- package/lib/schedule/key-sequences.js +0 -49
- package/lib/schedule/scheduler-service.js +0 -39
- package/lib/server/routes/notifications.js +0 -52
- package/lib/server/routes/providers.js +0 -114
- package/lib/server/routes/schedules.js +0 -54
- package/lib/server/routes/skillhub.js +0 -104
- package/lib/server/routes/usage.js +0 -23
- package/lib/server/routes/workspace.js +0 -77
- package/lib/session/buffer.js +0 -102
- package/lib/session/file-attachment-store.js +0 -168
- package/lib/session/pty-manager.js +0 -255
- package/lib/session/rendered-history.js +0 -225
- package/lib/session/session-manager.js +0 -1032
- package/lib/session/text-history.js +0 -274
- package/lib/skillhub/client.js +0 -121
- package/lib/skillhub/settings-store.js +0 -168
- package/lib/skillhub/skill-installer.js +0 -320
- package/lib/usage/ccusage-runner.js +0 -128
- package/lib/usage/source-catalog.js +0 -26
- package/lib/usage/usage-service.js +0 -226
- package/lib/utils/logger.js +0 -74
- package/lib/utils/pid.js +0 -67
- package/lib/utils/validation.js +0 -53
- package/lib/web/bootstrap.js +0 -34
- package/lib/web/claude.js +0 -1150
- package/lib/web/codex.js +0 -1045
- package/lib/web/composer.js +0 -493
- package/lib/web/core.js +0 -385
- package/lib/web/git.js +0 -535
- package/lib/web/gitgraph.js +0 -293
- package/lib/web/index.html +0 -547
- package/lib/web/layout.js +0 -69
- package/lib/web/notifications.js +0 -164
- package/lib/web/schedules.js +0 -245
- package/lib/web/session.js +0 -361
- package/lib/web/shell.js +0 -74
- package/lib/web/skillhub.js +0 -197
- package/lib/web/styles.css +0 -932
- package/lib/web/terminal-scroll.js +0 -81
- package/lib/web/theme.js +0 -60
- package/lib/web/timed-inputs.js +0 -216
- package/lib/web/usage.js +0 -323
- package/lib/workspace/service.js +0 -77
- package/scripts/check-syntax.js +0 -26
package/lib/commands/config.js
DELETED
|
@@ -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;
|
package/lib/commands/tools.js
DELETED
|
@@ -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;
|