winter-super-cli 2026.5.24 → 2026.5.25

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 (62) hide show
  1. package/README.md +1 -1
  2. package/WINTER.md +6 -0
  3. package/bin/winter.js +77 -220
  4. package/package.json +1 -1
  5. package/resources/local/manifest.json +60 -57
  6. package/src/ai/providers.js +38 -11
  7. package/src/cli/commands.js +24 -3
  8. package/src/cli/commands.test.js +116 -0
  9. package/src/cli/config.js +12 -0
  10. package/src/cli/repl.js +465 -146
  11. package/src/cli/repl.test.js +203 -2
  12. package/src/cli/snowflake-logo.js +15 -7
  13. package/src/cli/terminal-ui.js +125 -0
  14. package/src/cli/terminal-ui.test.js +33 -0
  15. package/src/plugins/manager.js +3 -1
  16. package/src/session/manager.js +44 -0
  17. package/src/session/manager.test.js +72 -0
  18. package/src/tools/executor.js +1 -1
  19. package/src/tools/executor.test.js +110 -0
  20. package/resources/local/claude/settings.json +0 -33
  21. package/resources/local/claude/todos/022bdc3c-e2c0-4a20-a74f-b348ed022c75-agent-022bdc3c-e2c0-4a20-a74f-b348ed022c75.json +0 -1
  22. package/resources/local/claude/todos/316f0e7d-5512-49fa-8c7f-edc75b777612-agent-316f0e7d-5512-49fa-8c7f-edc75b777612.json +0 -1
  23. package/resources/local/claude/todos/3676dc17-fca1-4692-934b-ce35e1965af6-agent-3676dc17-fca1-4692-934b-ce35e1965af6.json +0 -1
  24. package/resources/local/claude/todos/464493de-7f2a-45cf-93e8-ad73214afa10-agent-464493de-7f2a-45cf-93e8-ad73214afa10.json +0 -1
  25. package/resources/local/claude/todos/51f2e7a7-3f31-4692-a9b2-d3f3906aafea-agent-51f2e7a7-3f31-4692-a9b2-d3f3906aafea.json +0 -1
  26. package/resources/local/claude/todos/64a67dce-3d62-4a98-a548-b9c91a8e87e8-agent-64a67dce-3d62-4a98-a548-b9c91a8e87e8.json +0 -1
  27. package/resources/local/claude/todos/727a06e6-0ac2-41ca-8b81-2c14e4d40182-agent-727a06e6-0ac2-41ca-8b81-2c14e4d40182.json +0 -1
  28. package/resources/local/claude/todos/7d34d296-9b5a-4525-9b68-600d2ae20b59-agent-7d34d296-9b5a-4525-9b68-600d2ae20b59.json +0 -1
  29. package/resources/local/claude/todos/8c0606f1-5bcc-4176-8125-c5174fd69002-agent-8c0606f1-5bcc-4176-8125-c5174fd69002.json +0 -1
  30. package/resources/local/claude/todos/905aab16-5225-43f6-8ae4-c94491fd3a6f-agent-905aab16-5225-43f6-8ae4-c94491fd3a6f.json +0 -1
  31. package/resources/local/claude/todos/9dbe93f0-d62c-4c12-b4eb-0eecc437d625-agent-9dbe93f0-d62c-4c12-b4eb-0eecc437d625.json +0 -1
  32. package/resources/local/claude/todos/ad48500f-02a5-4f18-970b-82fb595d171f-agent-ad48500f-02a5-4f18-970b-82fb595d171f.json +0 -1
  33. package/resources/local/claude/todos/af86ea71-9907-4066-907c-68055e6c0081-agent-af86ea71-9907-4066-907c-68055e6c0081.json +0 -1
  34. package/resources/local/claude/todos/dbb0dc16-5d71-4f1d-a56c-db0741b3d485-agent-dbb0dc16-5d71-4f1d-a56c-db0741b3d485.json +0 -1
  35. package/resources/local/claude/todos/ff1ac487-eb0f-4c63-9360-fbb0a81bb5ae-agent-ff1ac487-eb0f-4c63-9360-fbb0a81bb5ae.json +0 -1
  36. package/resources/local/codex/config.toml +0 -84
  37. package/resources/local/codex/memories/MEMORY.md +0 -972
  38. package/resources/local/codex/memories/extensions/ad_hoc/instructions.md +0 -13
  39. package/resources/local/codex/memories/memory_summary.md +0 -188
  40. package/resources/local/codex/memories/raw_memories.md +0 -1488
  41. package/resources/local/codex/memories/rollout_summaries/2026-03-27T04-05-14-Iirb-nsis_full_installer_build_cpp_ocr_translator.md +0 -46
  42. package/resources/local/codex/memories/rollout_summaries/2026-03-28T06-18-17-Si3U-my_translator_overlay_lockfix_portable_nsis.md +0 -112
  43. package/resources/local/codex/memories/rollout_summaries/2026-04-15T06-42-11-2JMi-qelasy_timeout_and_watch_control_stability.md +0 -90
  44. package/resources/local/codex/memories/rollout_summaries/2026-04-16T03-12-59-z6Wi-request_all_row_click_detail_navigation.md +0 -42
  45. package/resources/local/codex/memories/rollout_summaries/2026-04-17T05-49-03-tNBk-my_translator_project_readability_audio_latency_clear_button.md +0 -75
  46. package/resources/local/codex/memories/rollout_summaries/2026-04-21T04-05-04-EXnh-nsis_packaging_harfbuzz_dll_qml_runtime_debug.md +0 -108
  47. package/resources/local/codex/memories/rollout_summaries/2026-04-22T03-48-40-VnNG-openclaw_opencode_sync_and_runtime_repair.md +0 -86
  48. package/resources/local/codex/memories/rollout_summaries/2026-04-22T06-49-49-R8yZ-web_book_user_portal_and_lint_fixes.md +0 -82
  49. package/resources/local/codex/memories/rollout_summaries/2026-04-22T06-50-35-ZaS1-smoke_admin_rbac_refund_connection_refused.md +0 -35
  50. package/resources/local/codex/memories/rollout_summaries/2026-04-22T11-05-04-aotT-nextjs_build_fix_statswidget_leaflet_ssr.md +0 -78
  51. package/resources/local/codex/memories/rollout_summaries/2026-04-23T03-22-24-a5q4-ui_still_looks_cloudflare_only.md +0 -41
  52. package/resources/local/codex/memories/rollout_summaries/2026-04-23T04-35-47-amlb-bayre247_hero_slide_above_search_form.md +0 -49
  53. package/resources/local/codex/memories/rollout_summaries/2026-04-23T04-59-21-lZWv-ocr_backend_parity_easyocr_tesseract_paddle_fallback.md +0 -92
  54. package/resources/local/codex/memories/rollout_summaries/2026-04-23T07-36-22-tPuo-request_workflow_editor_drag_edge_smaller_arrows_roadmap.md +0 -72
  55. package/resources/local/codex/memories/rollout_summaries/2026-04-24T08-01-05-Gb3B-checkin_shifts_workdays_assignments_and_checkout_overhaul.md +0 -90
  56. package/resources/local/codex/memories/rollout_summaries/2026-04-25T03-39-02-mbDr-web_book_refund_admin_popup_pagination_responsiveness.md +0 -151
  57. package/resources/local/codex/memories/rollout_summaries/2026-04-25T09-20-30-4usS-tool_scv_9router_custom_provider_and_paddle_ocr.md +0 -130
  58. package/resources/local/codex/memories/rollout_summaries/2026-05-06T10-19-38-mt2X-find_db_config_in_web_book_app_env.md +0 -40
  59. package/resources/local/codex/memories/rollout_summaries/2026-05-06T11-10-23-TkwP-goirong_backend_title_crash_and_client_audio_tcp_tunnel_debu.md +0 -85
  60. package/resources/local/codex/memories/rollout_summaries/2026-05-09T07-52-18-On1F-chakra_git_cleanup_readme_bilingual_publish_config.md +0 -88
  61. package/resources/local/codex/memories/rollout_summaries/2026-05-11T08-05-34-oMEl-check_crack_gui_logo_onefile_build.md +0 -68
  62. package/resources/local/codex/memories/skills/windows-packaged-app-smoke-check/SKILL.md +0 -72
package/README.md CHANGED
@@ -26,7 +26,7 @@ To install Winter globally in your system, clone the repository and run:
26
26
  *De cai dat Winter tren toan he thong, hay clone repository va chay:*
27
27
 
28
28
  ```bash
29
- npm install -g .
29
+ npm install -g winter-super-cli@latest
30
30
  ```
31
31
 
32
32
  *(Or run directly without installation using node bin/winter.js)*
package/WINTER.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Winter Project Rules
2
2
 
3
+ ## 🌨 Core Mission
4
+ - Winter exists to help smaller or weaker models think more clearly, reason more reliably, and code much better.
5
+ - When the task is ambiguous or hard, Winter should use tools, rules, memories, skills, and local resources proactively instead of guessing.
6
+ - The goal is not minimal effort; the goal is strong outcomes, correct execution, and useful engineering judgment.
7
+
3
8
  ## 📝 Project Overview
4
9
  - **Name**: [Tên dự án]
5
10
  - **Description**: [Mô tả ngắn về dự án]
@@ -20,6 +25,7 @@
20
25
  - Luôn giải thích NGẮN GỌN lý do thực hiện thay đổi trước khi sửa file.
21
26
  - Khi gặp lỗi, hãy đề xuất giải pháp thay vì chỉ báo lỗi.
22
27
  - KHÔNG tự tiện xóa code cũ của user trừ khi chắc chắn nó không còn dùng hoặc được yêu cầu.
28
+ - Nếu model chưa chắc chắn, hãy tự kéo thêm context bằng tool thay vì đoán.
23
29
 
24
30
  ### 3. Git & Commits
25
31
  - Viết commit message theo chuẩn Conventional Commits (VD: `feat:`, `fix:`, `docs:`).
package/bin/winter.js CHANGED
@@ -5,260 +5,117 @@
5
5
  * Build by Atus fb: iam.anhtu, github: anhtu1707 with Interactive REPL
6
6
  */
7
7
 
8
+ import { readFileSync } from 'fs';
9
+ import path from 'path';
8
10
  import { WinterREPL } from '../src/cli/repl.js';
9
11
  import { ConfigLoader } from '../src/cli/config.js';
10
- import path from 'path';
11
- import { fileURLToPath } from 'url';
12
- import { readFileSync } from 'fs';
12
+ import { SessionManager } from '../src/session/manager.js';
13
+ import { AIProviderManager } from '../src/ai/providers.js';
14
+ import { CommandParser } from '../src/cli/commands.js';
13
15
 
14
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
15
16
  const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
16
17
  const version = pkg.version;
17
18
 
18
- async function main() {
19
- const args = process.argv.slice(2);
20
-
21
- // Parse commands
22
- if (args.length === 0 || args.includes('i') || args.includes('interactive') || args.includes('--session')) {
23
- // Start interactive REPL mode
24
- const config = new ConfigLoader();
25
- const cfg = await config.load();
26
-
27
- let projectPath = process.cwd();
28
- let sessionId = null;
29
-
30
- const sessionIndex = args.indexOf('--session');
31
- if (sessionIndex !== -1 && args[sessionIndex + 1]) {
32
- sessionId = args[sessionIndex + 1];
33
- }
34
-
35
- // Lấy projectPath từ tham số không phải cờ (nếu có)
36
- const nonFlagArgs = args.filter(a => !a.startsWith('-') && a !== 'i' && a !== 'interactive' && a !== sessionId);
37
- if (nonFlagArgs[0]) {
38
- projectPath = path.resolve(nonFlagArgs[0]);
39
- }
40
-
41
- const repl = new WinterREPL({ projectPath, sessionId, version });
42
- await repl.start();
43
- return;
44
- }
45
-
46
- // Handle commands
47
- const [command, ...rest] = args;
19
+ const COMMANDS = new Set([
20
+ 'chat', 'call', 'session', 'skill', 'plugin', 'design', 'config', 'init',
21
+ 'help', 'project', 'code', 'review',
22
+ ]);
48
23
 
49
- switch (command) {
50
- case 'chat':
51
- await handleChatWithTools(rest);
52
- break;
53
- case 'call':
54
- await handleCallAll(rest);
55
- break;
56
- case 'session':
57
- await handleSession(rest);
58
- break;
59
- case 'skill':
60
- await handleSkill(rest);
61
- break;
62
- case 'plugin':
63
- await handlePlugin(rest);
64
- break;
65
- case 'design':
66
- await handleDesign(rest);
67
- break;
68
- case 'config':
69
- await handleConfig(rest);
70
- break;
71
- case 'init':
72
- await handleInit(rest);
73
- break;
74
- case '--help':
75
- case '-h':
76
- printHelp();
77
- break;
78
- case '--version':
79
- case '-v':
80
- console.log(`❄️ Winter CLI v${version}\n`);
81
- break;
82
- default: {
83
- // If no recognized command, treat the full input as a prompt.
84
- const config = new ConfigLoader();
85
- const cfg = await config.load();
86
- const repl = new WinterREPL({ projectPath: cfg.project?.current || process.cwd() });
87
- await repl.session.init();
88
- await repl.ai.init();
89
- await repl.chat([command, ...rest].join(' '));
90
- break;
91
- }
92
- }
24
+ function isInteractiveRequest(args) {
25
+ return args.length === 0 || args.includes('i') || args.includes('interactive') || args.includes('--session');
93
26
  }
94
27
 
95
- async function handleChatWithTools(args) {
96
- const config = new ConfigLoader();
97
- const message = args.join(' ');
98
- if (!message) {
99
- console.log('Usage: winter chat <message>');
100
- return;
101
- }
102
-
103
- try {
104
- const cfg = await config.load();
105
- const repl = new WinterREPL({ projectPath: cfg.project?.current || process.cwd() });
106
- await repl.session.init();
107
- await repl.ai.init();
108
- await repl.chat(message);
109
- } catch (error) {
110
- console.error(`\nWinter error: ${error.message}\n`);
111
- }
112
- }
113
-
114
- async function handleCallAll(args) {
115
- const { AIProviderManager } = await import('../src/ai/providers.js');
116
- const config = new ConfigLoader();
117
- const prompt = args.join(' ');
118
-
119
- if (!prompt) {
120
- console.log('Usage: winter call <prompt>');
121
- return;
122
- }
123
-
124
- const ai = new AIProviderManager(config);
125
- const results = await ai.callAllProviders(prompt);
126
-
127
- for (const [provider, result] of Object.entries(results)) {
128
- if (result.error) {
129
- console.log(`\n[${provider}] ERROR\n${result.error}`);
130
- } else {
131
- console.log(`\n[${provider}] ${result.model}\n${result.content}`);
132
- }
133
- }
134
- }
135
-
136
- async function handleSession(args) {
137
- const { SessionManager } = await import('../src/session/manager.js');
28
+ async function createRuntime(projectPath, sessionId = null) {
138
29
  const config = new ConfigLoader();
139
30
  const session = new SessionManager(config);
140
- await session.init();
31
+ await session.init({ project: projectPath, sessionId });
141
32
 
142
- const [action, ...rest] = args;
33
+ const ai = new AIProviderManager(config);
34
+ await ai.init();
143
35
 
144
- switch (action) {
145
- case 'new':
146
- const s = await session.newSession();
147
- console.log(`✓ New session: ${s.id.substring(0, 8)}`);
148
- break;
149
- case 'list':
150
- const sessions = await session.listSessions();
151
- console.log(`\nSessions:`);
152
- sessions.forEach(s => console.log(` ${s.id.substring(0, 8)} - ${s.createdAt}`));
153
- break;
154
- default:
155
- console.log(`Session: ${session.getSessionId().substring(0, 8)}`);
156
- }
36
+ const parser = new CommandParser({ session, ai, config });
37
+ return { config, session, ai, parser };
157
38
  }
158
39
 
159
- async function handleSkill(args) {
160
- const { SkillManager } = await import('../src/skills/manager.js');
161
- const config = new ConfigLoader();
162
- const session = new SessionManager(config);
163
- await session.init();
164
-
165
- const skills = new SkillManager(session);
166
- const list = await skills.listSkills();
40
+ function printHelp() {
41
+ console.log(`
42
+ WINTER CLI
43
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
167
44
 
168
- console.log(`\n❄️ Available Skills:`);
169
- list.forEach(s => console.log(` ${s.icon} ${s.name} - ${s.description}`));
170
- console.log('');
171
- }
45
+ Usage:
172
46
 
173
- async function handlePlugin(args) {
174
- const { PluginManager } = await import('../src/plugins/manager.js');
175
- const session = new SessionManager({});
176
- const plugins = new PluginManager(session);
177
- const list = await plugins.listPlugins();
47
+ winter Start interactive REPL
48
+ winter help Show this help
49
+ winter chat <message> Chat with AI
50
+ winter <prompt> Treat plain text as a chat prompt
178
51
 
179
- console.log(`\n❄️ Installed Plugins:`);
180
- list.forEach(p => console.log(` ${p.icon} ${p.name} v${p.version}`));
181
- console.log('');
182
- }
52
+ Commands:
183
53
 
184
- async function handleDesign(args) {
185
- const { DesignCommands } = await import('../src/design/commands.js');
186
- const config = new ConfigLoader();
187
- const session = new SessionManager(config);
188
- await session.init();
54
+ winter call <prompt> Call all configured providers
55
+ winter session <action> Session management
56
+ winter skill <action> Skill management
57
+ winter plugin <action> Plugin management
58
+ winter design <action> Design commands
59
+ winter project <action> Project commands
60
+ winter config Show config
61
+ winter init Initialize local state
62
+ winter review Code review mode
63
+ winter code Code analysis mode
189
64
 
190
- const design = new DesignCommands(session, config);
191
- await design.execute(args[0], args.slice(1));
192
- }
65
+ Flags:
193
66
 
194
- async function handleConfig(args) {
195
- const config = new ConfigLoader();
196
- const cfg = await config.load();
197
- console.log(`\n❄️ Configuration:\n`);
198
- console.log(JSON.stringify(cfg, null, 2));
199
- console.log('');
200
- }
67
+ winter -h, --help Show help
68
+ winter -v, --version Show version
201
69
 
202
- async function handleInit(args) {
203
- console.log('❄️ Initializing Winter CLI...');
204
- // Create necessary directories and files
205
- console.log('✓ Ready!');
70
+ Version ${version}
71
+ `);
206
72
  }
207
73
 
208
- function printHelp() {
209
- console.log(`
210
- WINTER CLI
211
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
212
-
213
- Commands:
74
+ async function main() {
75
+ const args = process.argv.slice(2);
214
76
 
215
- winter Start interactive REPL
216
- winter i Interactive mode
217
- winter chat <msg> Chat with AI
218
- winter call <prompt> Call all configured providers
219
- winter session Session management
220
- winter skill List skills
221
- winter plugin List plugins
222
- winter design Design commands
223
- winter config Show config
77
+ if (args.includes('--help') || args.includes('-h')) {
78
+ printHelp();
79
+ return;
80
+ }
224
81
 
225
- Important REPL slash commands:
82
+ if (args.includes('--version') || args.includes('-v')) {
83
+ console.log(`❄️ Winter CLI v${version}\n`);
84
+ return;
85
+ }
226
86
 
227
- /provider <name> Switch provider and save default
228
- /model <model-id> Set model for active provider
229
- /models List configured and cached models
230
- /codex [section] Browse ~/.codex resources
231
- /claude [section] Browse ~/.claude resources
232
- /karpathy Browse ~/karpathy-tools
233
- /designs [query] List/search awesome-design-md systems
234
- /agents Read ~/agents.md
235
- /skills List Winter/Codex/Claude skills
87
+ if (isInteractiveRequest(args)) {
88
+ const config = new ConfigLoader();
236
89
 
237
- Version ${version}
238
- `);
239
- return;
240
- console.log(`
241
- ❄️ WINTER CLI ❄️
242
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
90
+ let projectPath = process.cwd();
91
+ let sessionId = null;
243
92
 
244
- 📋 Commands:
93
+ const sessionIndex = args.indexOf('--session');
94
+ if (sessionIndex !== -1 && args[sessionIndex + 1]) {
95
+ sessionId = args[sessionIndex + 1];
96
+ }
245
97
 
246
- winter Start interactive REPL ( winter)
247
- winter i Interactive mode
248
- winter chat <msg> Chat with AI
98
+ const nonFlagArgs = args.filter(a => !a.startsWith('-') && a !== 'i' && a !== 'interactive' && a !== sessionId);
99
+ if (nonFlagArgs[0]) {
100
+ projectPath = path.resolve(nonFlagArgs[0]);
101
+ }
249
102
 
250
- winter session Session management
251
- winter skill List skills
252
- winter plugin List plugins
253
- winter design Design commands
254
- winter config Show config
103
+ const repl = new WinterREPL({ projectPath, sessionId, version });
104
+ await repl.start();
105
+ return;
106
+ }
255
107
 
256
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
108
+ const config = new ConfigLoader();
109
+ const projectPath = process.cwd();
110
+ const { parser } = await createRuntime(projectPath);
111
+ const [command] = args;
257
112
 
258
- 💡 Just type 'winter' to start chatting with your project!
113
+ if (!command || (!command.startsWith('/') && !COMMANDS.has(command))) {
114
+ await parser.parse(['chat', ...args]);
115
+ return;
116
+ }
259
117
 
260
- ❄️ Version ${version}
261
- `);
118
+ await parser.parse(args);
262
119
  }
263
120
 
264
121
  main().catch(err => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "winter-super-cli",
3
- "version": "2026.5.24",
3
+ "version": "2026.5.25",
4
4
  "description": "❄️ AI-Powered Development CLI with Interactive REPL",
5
5
  "type": "module",
6
6
  "main": "bin/winter.js",
@@ -1,57 +1,60 @@
1
- {
2
- "generatedAt": "2026-05-14T18:37:11.5585557+07:00",
3
- "root": "E:\\dev\\app\\winter\\resources\\local",
4
- "localResources": [
5
- {
6
- "name": "agents.md",
7
- "path": "E:\\dev\\app\\winter\\resources\\local\\agents.md",
8
- "files": 90,
9
- "bytes": 2546038
10
- },
11
- {
12
- "name": "awesome-design-md",
13
- "path": "E:\\dev\\app\\winter\\resources\\local\\awesome-design-md",
14
- "files": 142,
15
- "bytes": 1912402
16
- },
17
- {
18
- "name": "claude",
19
- "path": "E:\\dev\\app\\winter\\resources\\local\\claude",
20
- "files": 971,
21
- "bytes": 17626519
22
- },
23
- {
24
- "name": "codex",
25
- "path": "E:\\dev\\app\\winter\\resources\\local\\codex",
26
- "files": 259,
27
- "bytes": 3425257
28
- },
29
- {
30
- "name": "karpathy-tools",
31
- "path": "E:\\dev\\app\\winter\\resources\\local\\karpathy-tools",
32
- "files": 2,
33
- "bytes": 6068
34
- },
35
- {
36
- "name": "manifest.json",
37
- "path": "E:\\dev\\app\\winter\\resources\\local\\manifest.json",
38
- "files": 1,
39
- "bytes": 2936
40
- }
41
- ],
42
- "excludedForSafety": [
43
- "C:\\Users\\PHUCANSOLUTIONS\\.codex\\auth.json",
44
- "C:\\Users\\PHUCANSOLUTIONS\\.codex\\sessions",
45
- "C:\\Users\\PHUCANSOLUTIONS\\.codex\\history.jsonl",
46
- "C:\\Users\\PHUCANSOLUTIONS\\.codex\\*.sqlite*",
47
- "C:\\Users\\PHUCANSOLUTIONS\\.codex\\log and tmp/cache runtime folders",
48
- "C:\\Users\\PHUCANSOLUTIONS\\.claude\\history.jsonl",
49
- "C:\\Users\\PHUCANSOLUTIONS\\.claude\\sessions",
50
- "C:\\Users\\PHUCANSOLUTIONS\\.claude\\projects",
51
- "C:\\Users\\PHUCANSOLUTIONS\\.claude\\plugins\\cache",
52
- "runtime logs, tmp, cache, auth, local settings, and session state"
53
- ],
54
- "redacted": [
55
- "resources/local/claude/settings.json: ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN"
56
- ]
57
- }
1
+ {
2
+ "generatedAt": "2026-05-14T18:37:11.5585557+07:00",
3
+ "root": "resources/local",
4
+ "localResources": [
5
+ {
6
+ "name": "agents.md",
7
+ "path": "resources/local/agents.md",
8
+ "files": 90,
9
+ "bytes": 2546038
10
+ },
11
+ {
12
+ "name": "awesome-design-md",
13
+ "path": "resources/local/awesome-design-md",
14
+ "files": 142,
15
+ "bytes": 1912402
16
+ },
17
+ {
18
+ "name": "claude",
19
+ "path": "resources/local/claude",
20
+ "files": 971,
21
+ "bytes": 17626519
22
+ },
23
+ {
24
+ "name": "codex",
25
+ "path": "resources/local/codex",
26
+ "files": 259,
27
+ "bytes": 3425257
28
+ },
29
+ {
30
+ "name": "karpathy-tools",
31
+ "path": "resources/local/karpathy-tools",
32
+ "files": 2,
33
+ "bytes": 6068
34
+ },
35
+ {
36
+ "name": "manifest.json",
37
+ "path": "resources/local/manifest.json",
38
+ "files": 1,
39
+ "bytes": 2936
40
+ }
41
+ ],
42
+ "excludedForSafety": [
43
+ "$HOME/.codex/auth.json",
44
+ "$HOME/.codex/sessions",
45
+ "$HOME/.codex/history.jsonl",
46
+ "$HOME/.codex/*.sqlite*",
47
+ "$HOME/.codex log and tmp/cache runtime folders",
48
+ "$HOME/.claude/history.jsonl",
49
+ "$HOME/.claude/sessions",
50
+ "$HOME/.claude/projects",
51
+ "$HOME/.claude/plugins/cache",
52
+ "runtime logs, tmp, cache, auth, local settings, and session state"
53
+ ],
54
+ "redacted": [
55
+ "resources/local/claude/settings.json: excluded from npm package",
56
+ "resources/local/codex/config.toml: excluded from npm package",
57
+ "resources/local/codex/memories: excluded from npm package",
58
+ "resources/local/claude/tasks and todos: excluded from npm package"
59
+ ]
60
+ }
@@ -86,20 +86,47 @@ export class AIProviderManager {
86
86
  }
87
87
 
88
88
  async loadAuthToken() {
89
+ // 1) Honor explicit environment variables (highest priority)
90
+ const envToken = process.env.CLAUDE_AUTH_TOKEN || process.env.ANTHROPIC_API_KEY || process.env.CLAUDE_TOKEN || null;
91
+ if (envToken) return envToken;
92
+
93
+ // 2) Look into user home directories (platform-agnostic, no hardcoded username)
89
94
  try {
90
95
  const fs = await import('fs');
91
- const authPath = 'C:\\Users\\PHUCANSOLUTIONS\\.codex\\auth.json';
92
- const data = JSON.parse(fs.readFileSync(authPath, 'utf8'));
93
- return data.tokens?.access_token || null;
94
- } catch {
95
- // Try Claude's auth
96
- try {
97
- const fs = await import('fs');
98
- const authPath = 'C:\\Users\\PHUCANSOLUTIONS\\.claude\\sessions\\*\\auth.json';
99
- // This won't work with glob, so skip
100
- } catch {}
101
- return null;
96
+ const path = await import('path');
97
+ const os = await import('os');
98
+ const home = os.homedir();
99
+
100
+ // Try ~/.codex/auth.json
101
+ const codexAuth = path.join(home, '.codex', 'auth.json');
102
+ if (fs.existsSync(codexAuth)) {
103
+ try {
104
+ const data = JSON.parse(fs.readFileSync(codexAuth, 'utf8'));
105
+ return data.tokens?.access_token || data.access_token || null;
106
+ } catch {}
107
+ }
108
+
109
+ // Try ~/.claude/sessions/*/auth.json
110
+ const claudeSessionsDir = path.join(home, '.claude', 'sessions');
111
+ if (fs.existsSync(claudeSessionsDir)) {
112
+ const entries = await fs.promises.readdir(claudeSessionsDir, { withFileTypes: true });
113
+ for (const e of entries) {
114
+ if (!e.isDirectory()) continue;
115
+ const candidate = path.join(claudeSessionsDir, e.name, 'auth.json');
116
+ if (fs.existsSync(candidate)) {
117
+ try {
118
+ const data = JSON.parse(fs.readFileSync(candidate, 'utf8'));
119
+ return data.tokens?.access_token || data.access_token || null;
120
+ } catch {}
121
+ }
122
+ }
123
+ }
124
+ } catch (err) {
125
+ // ignore and fall through
102
126
  }
127
+
128
+ // No token found
129
+ return null;
103
130
  }
104
131
 
105
132
  setProvider(name) {
@@ -10,6 +10,25 @@ import { DesignCommands } from '../design/commands.js';
10
10
  import { SkillManager } from '../skills/manager.js';
11
11
  import { PluginManager } from '../plugins/manager.js';
12
12
 
13
+ const SECRET_KEY_PATTERN = /(api[-_]?key|auth[-_]?token|access[-_]?token|refresh[-_]?token|secret|password)/i;
14
+
15
+ export function redactSecrets(value) {
16
+ if (Array.isArray(value)) {
17
+ return value.map(item => redactSecrets(item));
18
+ }
19
+
20
+ if (!value || typeof value !== 'object') {
21
+ return value;
22
+ }
23
+
24
+ return Object.fromEntries(
25
+ Object.entries(value).map(([key, entry]) => [
26
+ key,
27
+ SECRET_KEY_PATTERN.test(key) ? '[redacted]' : redactSecrets(entry),
28
+ ])
29
+ );
30
+ }
31
+
13
32
  export class CommandParser {
14
33
  constructor({ session, ai, config }) {
15
34
  this.session = session;
@@ -177,6 +196,7 @@ export class CommandParser {
177
196
  const [action, ...rest] = args;
178
197
 
179
198
  switch (action) {
199
+ case undefined:
180
200
  case 'list':
181
201
  const skills = await this.skills.listSkills();
182
202
  console.log(`\n${colors.cyan}Available Skills:${colors.reset}`);
@@ -199,16 +219,17 @@ export class CommandParser {
199
219
  const [action, ...rest] = args;
200
220
 
201
221
  switch (action) {
222
+ case undefined:
202
223
  case 'list':
203
224
  const plugins = await this.plugins.listPlugins();
204
225
  console.log(`\n${colors.cyan}Installed Plugins:${colors.reset}`);
205
226
  plugins.forEach(p => console.log(` ${p.icon} ${p.name} v${p.version}`));
206
227
  break;
207
228
  case 'install':
208
- console.log(`${statusIcons.success} Installing plugin: ${rest[0]}`);
229
+ await this.plugins.installPlugin(rest[0]);
209
230
  break;
210
231
  case 'remove':
211
- console.log(`${statusIcons.success} Removed plugin: ${rest[0]}`);
232
+ await this.plugins.removePlugin(rest[0]);
212
233
  break;
213
234
  default:
214
235
  console.log(`${colors.yellow}Usage: winter plugin <list|install|remove>${colors.reset}`);
@@ -231,7 +252,7 @@ export class CommandParser {
231
252
  async handleConfig(args) {
232
253
  const config = await this.config.load();
233
254
  console.log(`\n${colors.cyan}Current Configuration:${colors.reset}`);
234
- console.log(JSON.stringify(config, null, 2));
255
+ console.log(JSON.stringify(redactSecrets(config), null, 2));
235
256
  }
236
257
 
237
258
  async handleInit(args) {