kiku-agent 1.0.4 → 1.0.6
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 +25 -2
- package/package.json +12 -3
- package/server/agent/agentCore.js +164 -55
- package/server/agent/cli.js +1300 -695
- package/server/agent/commandRegistry.js +436 -74
- package/server/agent/commands.js +629 -63
- package/server/agent/doctor.js +7 -6
- package/server/agent/mcpClient.js +436 -364
- package/server/agent/queryDetails.js +182 -0
- package/server/agent/sanitizer.js +4 -4
- package/server/agent/subagent.js +1 -0
- package/server/agent/suggestions.js +346 -0
- package/server/agent/theme.js +12 -12
- package/server/agent/tools.js +118 -7
- package/server/agent/ui.js +433 -31
- package/server/agent/updateManager.js +438 -0
- package/server/agent/version.js +10 -0
- package/server/mcp/data/brands.js +9 -4
- package/server/mcp/server.js +2 -1
- package/src/data/brandsData.js +65 -0
|
@@ -1,74 +1,436 @@
|
|
|
1
|
-
export const COMMAND_DEFINITIONS = Object.freeze([
|
|
2
|
-
{ name: '/help', usage: '/help [command]', desc: 'Show all commands or details for one command', insert: '/help ' },
|
|
3
|
-
{ name: '/history', usage: '/history [n|search|clear]', desc: 'View or search chat history', insert: '/history ' },
|
|
4
|
-
{ name: '/session', usage: '/session [info|list|export|clear]', desc: 'Manage the current session', insert: '/session ' },
|
|
5
|
-
{ name: '/thinking', usage: '/thinking [show|hide|toggle]', desc: 'Control reasoning visibility', insert: '/thinking ' },
|
|
6
|
-
{ name: '/details', usage: '/details [Qn]', desc: '
|
|
7
|
-
{ name: '/
|
|
8
|
-
{ name: '/
|
|
9
|
-
{ name: '/
|
|
10
|
-
{ name: '/
|
|
11
|
-
{ name: '/
|
|
12
|
-
{ name: '/
|
|
13
|
-
{ name: '/
|
|
14
|
-
{ name: '/
|
|
15
|
-
{ name: '/
|
|
16
|
-
{ name: '/
|
|
17
|
-
{ name: '/
|
|
18
|
-
{ name: '/
|
|
19
|
-
{ name: '/
|
|
20
|
-
{ name: '/
|
|
21
|
-
{ name: '/
|
|
22
|
-
{ name: '/
|
|
23
|
-
{ name: '/
|
|
24
|
-
{ name: '/
|
|
25
|
-
{ name: '/
|
|
26
|
-
{ name: '/
|
|
27
|
-
{ name: '/
|
|
28
|
-
{ name: '/
|
|
29
|
-
{ name: '/
|
|
30
|
-
{ name: '/
|
|
31
|
-
{ name: '/
|
|
32
|
-
{ name: '/
|
|
33
|
-
{ name: '/
|
|
34
|
-
{ name: '/
|
|
35
|
-
{ name: '/
|
|
36
|
-
{ name: '/
|
|
37
|
-
{ name: '/
|
|
38
|
-
{ name: '/
|
|
39
|
-
{ name: '/
|
|
40
|
-
{ name: '/
|
|
41
|
-
{ name: '/
|
|
42
|
-
{ name: '/
|
|
43
|
-
{ name: '/
|
|
44
|
-
{ name: '/
|
|
45
|
-
{ name: '/
|
|
46
|
-
{ name: '/
|
|
47
|
-
{ name: '/
|
|
48
|
-
{ name: '/
|
|
49
|
-
{ name: '/
|
|
50
|
-
]
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
'/
|
|
60
|
-
'/
|
|
61
|
-
'/
|
|
62
|
-
'/
|
|
63
|
-
'/
|
|
64
|
-
'/
|
|
65
|
-
'/
|
|
66
|
-
'/
|
|
67
|
-
'/
|
|
68
|
-
'/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
export const COMMAND_DEFINITIONS = Object.freeze([
|
|
2
|
+
{ name: '/help', usage: '/help [command]', desc: 'Show all commands or details for one command', insert: '/help ' },
|
|
3
|
+
{ name: '/history', usage: '/history [n|search|clear]', desc: 'View or search chat history', insert: '/history ' },
|
|
4
|
+
{ name: '/session', usage: '/session [info|list|export|clear]', desc: 'Manage the current session', insert: '/session ' },
|
|
5
|
+
{ name: '/thinking', usage: '/thinking [show|hide|toggle]', desc: 'Control reasoning visibility', insert: '/thinking ' },
|
|
6
|
+
{ name: '/details', usage: '/details [Qn] [overview|answer|thinking|tools|tool n]', desc: 'Inspect query diagnostics (F2 opens latest overview)', insert: '/details ' },
|
|
7
|
+
{ name: '/copy', usage: '/copy [Qn] [answer|thinking|tools|tool n|all|markdown]', desc: 'Copy full untruncated model answer, thinking, or diagnostics to clipboard', insert: '/copy ' },
|
|
8
|
+
{ name: '/lang', usage: '/lang [th|zh|en|auto]', desc: 'Set the response language', insert: '/lang ' },
|
|
9
|
+
{ name: '/theme', usage: '/theme [name|list|current|reset]', desc: 'View or change the terminal color theme', insert: '/theme ' },
|
|
10
|
+
{ name: '/mem', usage: '/mem [add|del|search|list|topics|import|export|clear]', desc: 'Manage long-term memory', insert: '/mem ' },
|
|
11
|
+
{ name: '/subagent', usage: '/subagent <research task>', desc: 'Run a bounded Ju Jingyi research subagent', insert: '/subagent ' },
|
|
12
|
+
{ name: '/research', usage: '/research <question|status|last|sources|cancel>', desc: 'Run coordinated multi-source Ju Jingyi research', insert: '/research ' },
|
|
13
|
+
{ name: '/verify', usage: '/verify <claim>', desc: 'Verify a Ju Jingyi claim with independent workers', insert: '/verify ' },
|
|
14
|
+
{ name: '/sources', usage: '/sources', desc: 'Show sources from the latest research job', insert: '/sources' },
|
|
15
|
+
{ name: '/suggestion', usage: '/suggestion [list|run <id|all>|auto|refresh|topic <name>]', desc: 'Generate AI research suggestions & execute with concurrent subagents', insert: '/suggestion ' },
|
|
16
|
+
{ name: '/skill', usage: '/skill [learn|list|del|on|off|clear]', desc: 'Teach Kiku how to answer for you', insert: '/skill ' },
|
|
17
|
+
{ name: '/tool', usage: '/tool <name> [args]', desc: 'Execute a registered tool directly', insert: '/tool ' },
|
|
18
|
+
{ name: '/tools', usage: '/tools [filter]', desc: 'List registered tools', insert: '/tools ' },
|
|
19
|
+
{ name: '/stats', usage: '/stats', desc: 'Show the content database overview', insert: '/stats' },
|
|
20
|
+
{ name: '/provider', usage: '/provider [list|use <name> [model]|models [name]|info <name>|test|setkey <key>|status]', desc: 'Manage AI providers (OpenAI, Gemini, Groq, DeepSeek, OpenRouter, LM Studio)', insert: '/provider ' },
|
|
21
|
+
{ name: '/model', usage: '/model [status|list|recommend|use <id>|reconnect]', desc: 'Inspect, recommend, or switch active AI model', insert: '/model ' },
|
|
22
|
+
{ name: '/mcp', usage: '/mcp [status|list|connect <name> <url|cmd>|disconnect <name>|remove <name>|reconnect [all]|save|reload|tools]', desc: 'Manage persistent Model Context Protocol connections', insert: '/mcp ' },
|
|
23
|
+
{ name: '/ping', usage: '/ping', desc: 'Check active model server latency', insert: '/ping' },
|
|
24
|
+
{ name: '/config', usage: '/config', desc: 'Show runtime configuration', insert: '/config' },
|
|
25
|
+
{ name: '/doctor', usage: '/doctor', desc: 'Check first-run environment and optional features', insert: '/doctor' },
|
|
26
|
+
{ name: '/prompt', usage: '/prompt', desc: 'Preview the active system persona', insert: '/prompt' },
|
|
27
|
+
{ name: '/version', usage: '/version', desc: 'Show Kiku Agent version information', insert: '/version' },
|
|
28
|
+
{ name: '/update', usage: '/update [check|install [target]|channel [name]|rollback]', desc: 'Check, install, configure, or roll back npm releases', insert: '/update ' },
|
|
29
|
+
{ name: '/system', usage: '/system', desc: 'Show operating-system and memory information', insert: '/system' },
|
|
30
|
+
{ name: '/gpu', usage: '/gpu [status]', desc: 'Show GPU & VRAM hardware resource metrics', insert: '/gpu' },
|
|
31
|
+
{ name: '/about', usage: '/about', desc: 'Show information about Kiku Agent', insert: '/about' },
|
|
32
|
+
{ name: '/ads', usage: '/ads', desc: 'Show the next sponsor card', insert: '/ads' },
|
|
33
|
+
{ name: '/retry', usage: '/retry', desc: 'Retry the previous query', insert: '/retry' },
|
|
34
|
+
{ name: '/cancel', usage: '/cancel', desc: 'Abort the currently running query, tool, or subagent task', insert: '/cancel' },
|
|
35
|
+
{ name: '/clear', usage: '/clear', desc: 'Archive the session and clear the screen', insert: '/clear' },
|
|
36
|
+
{ name: '/save', usage: '/save', desc: 'Export the transcript to Markdown', insert: '/save' },
|
|
37
|
+
{ name: '/play', usage: '/play <song>', desc: 'Play music', insert: '/play ' },
|
|
38
|
+
{ name: '/stop', usage: '/stop', desc: 'Stop music playback', insert: '/stop' },
|
|
39
|
+
{ name: '/pause', usage: '/pause', desc: 'Pause music playback', insert: '/pause' },
|
|
40
|
+
{ name: '/resume', usage: '/resume', desc: 'Resume music playback', insert: '/resume' },
|
|
41
|
+
{ name: '/next', usage: '/next', desc: 'Play the next queued track', insert: '/next' },
|
|
42
|
+
{ name: '/prev', usage: '/prev', desc: 'Return to the previous track', insert: '/prev' },
|
|
43
|
+
{ name: '/mute', usage: '/mute', desc: 'Mute music playback', insert: '/mute' },
|
|
44
|
+
{ name: '/unmute', usage: '/unmute', desc: 'Unmute music playback', insert: '/unmute' },
|
|
45
|
+
{ name: '/add', usage: '/add <song>', desc: 'Add a song to the music queue', insert: '/add ' },
|
|
46
|
+
{ name: '/remove', usage: '/remove <index>', desc: 'Remove a song from the music queue', insert: '/remove ' },
|
|
47
|
+
{ name: '/clearqueue', usage: '/clearqueue', desc: 'Clear the music queue', insert: '/clearqueue' },
|
|
48
|
+
{ name: '/search', usage: '/search <query>', desc: 'Search YouTube', insert: '/search ' },
|
|
49
|
+
{ name: '/current', usage: '/current', desc: 'Show the current track', insert: '/current' },
|
|
50
|
+
{ name: '/queue', usage: '/queue [clear]', desc: 'Show or clear the active queue', insert: '/queue ' },
|
|
51
|
+
{ name: '/login', usage: '/login', desc: 'Connect a YouTube browser session', insert: '/login' },
|
|
52
|
+
{ name: '/ytstatus', usage: '/ytstatus', desc: 'Show YouTube authentication status', insert: '/ytstatus' },
|
|
53
|
+
{ name: '/exit', usage: '/exit', desc: 'Archive the session and quit', insert: '/exit' },
|
|
54
|
+
]);
|
|
55
|
+
|
|
56
|
+
export const COMMAND_NAMES = Object.freeze(COMMAND_DEFINITIONS.map(command => command.name));
|
|
57
|
+
|
|
58
|
+
export const SUB_COMMANDS = Object.freeze({
|
|
59
|
+
'/mem': ['add <fact>', 'search <query>', 'list', 'topics', 'del <id>', 'import <path>', 'export', 'clear'],
|
|
60
|
+
'/subagent': ['<research task>'],
|
|
61
|
+
'/research': ['<question>', 'status', 'last', 'sources', 'cancel'],
|
|
62
|
+
'/verify': ['<claim>'],
|
|
63
|
+
'/suggestion': ['list', 'run 1', 'run all', 'auto', 'refresh', 'topic drama', 'topic music', 'topic fashion', 'topic 2026'],
|
|
64
|
+
'/skill': ['learn <instruction>', 'list', 'del <id>', 'on', 'off', 'clear'],
|
|
65
|
+
'/provider': ['list', 'status', 'models', 'models openai', 'models gemini', 'models groq', 'models deepseek', 'models openrouter', 'models lmstudio', 'use openai', 'use openrouter', 'use groq', 'use deepseek', 'use gemini', 'use lmstudio', 'use custom', 'info', 'test', 'setkey <key>'],
|
|
66
|
+
'/model': ['status', 'list', 'recommend', 'use <model-id>', 'reconnect'],
|
|
67
|
+
'/mcp': ['status', 'list', 'tools', 'connect <name> <url>', 'disconnect <name>', 'remove <name>', 'reconnect [all]', 'save', 'reload'],
|
|
68
|
+
'/lang': ['th', 'zh', 'en', 'auto'],
|
|
69
|
+
'/theme': ['list', 'current', 'sakura', 'midnight', 'ocean', 'forest', 'sunset', 'monochrome', 'reset'],
|
|
70
|
+
'/thinking': ['show', 'hide', 'toggle'],
|
|
71
|
+
'/details': ['latest', 'overview', 'answer', 'thinking', 'tools', 'tool <n>', 'all', 'markdown', 'Q1 overview', 'Q1 tool 1'],
|
|
72
|
+
'/copy': ['answer', 'thinking', 'tools', 'tool 1', 'overview', 'all', 'markdown', 'Q1 answer', 'Q1 thinking', 'Q1 all'],
|
|
73
|
+
'/session': ['info', 'list', 'export', 'clear'],
|
|
74
|
+
'/history': ['10', '20', '50', 'search <query>', 'clear'],
|
|
75
|
+
'/queue': ['clear'],
|
|
76
|
+
'/update': ['check', 'install', 'install next', 'install canary', 'channel', 'channel latest', 'channel next', 'channel canary', 'rollback', 'help'],
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export const COMMAND_DETAILS = Object.freeze({
|
|
80
|
+
'/suggestion': {
|
|
81
|
+
summary: 'Generate AI research suggestions & execute with concurrent subagents',
|
|
82
|
+
usage: '/suggestion [list | run <id|ids|all> | auto | topic <name> | refresh]',
|
|
83
|
+
subcommands: [
|
|
84
|
+
{ cmd: 'list', desc: 'Display generated research suggestions and categories (default)', example: '/suggestion list' },
|
|
85
|
+
{ cmd: 'run <id|ids|all>', desc: 'Dispatch concurrent subagent workers to research the selected questions in parallel', example: '/suggestion run 1,2,3' },
|
|
86
|
+
{ cmd: 'auto', desc: 'Auto-generate fresh research topics and immediately dispatch parallel subagents', example: '/suggestion auto' },
|
|
87
|
+
{ cmd: 'topic <name>', desc: 'Generate research questions tailored to a specific topic (drama, music, brand, awards, 2026)', example: '/suggestion topic drama' },
|
|
88
|
+
{ cmd: 'refresh', desc: 'Re-roll and generate a fresh batch of 5 suggestion topics', example: '/suggestion refresh' },
|
|
89
|
+
],
|
|
90
|
+
examples: [
|
|
91
|
+
'/suggestion',
|
|
92
|
+
'/suggestion run 1',
|
|
93
|
+
'/suggestion run 1,2,3',
|
|
94
|
+
'/suggestion run all',
|
|
95
|
+
'/suggestion auto',
|
|
96
|
+
'/suggestion topic 2026',
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
'/mcp': {
|
|
100
|
+
summary: 'Manage persistent Model Context Protocol (MCP) server connections and external tools',
|
|
101
|
+
usage: '/mcp [status | list | connect <name> <url|stdio> | disconnect <name> | remove <name> | reconnect [all] | save [workspace|global] | reload | tools]',
|
|
102
|
+
subcommands: [
|
|
103
|
+
{ cmd: 'status / list', desc: 'Display active live MCP servers, saved offline configurations, and registered tool counts', example: '/mcp status' },
|
|
104
|
+
{ cmd: 'connect <name> <url|cmd>', desc: 'Connect and permanently save an MCP server config (auto-reconnects on startup)', example: '/mcp connect kiku https://jujingyi-kikuuu.vercel.app/mcp' },
|
|
105
|
+
{ cmd: 'save [workspace|global]', desc: 'Explicitly save all MCP configurations to workspace (.mcp.json) or global storage', example: '/mcp save workspace' },
|
|
106
|
+
{ cmd: 'reload / reconnect [name|all]', desc: 'Reload and reconnect all configured MCP servers from disk', example: '/mcp reconnect all' },
|
|
107
|
+
{ cmd: 'disconnect <name>', desc: 'Disconnect the active live session while keeping the configuration saved for later', example: '/mcp disconnect kiku' },
|
|
108
|
+
{ cmd: 'remove <name>', desc: 'Permanently remove the server from saved configuration and disconnect', example: '/mcp remove kiku' },
|
|
109
|
+
{ cmd: 'tools', desc: 'Inspect all registered MCP tools, parameters, and input schemas', example: '/mcp tools' },
|
|
110
|
+
],
|
|
111
|
+
examples: [
|
|
112
|
+
'/mcp status',
|
|
113
|
+
'/mcp connect kiku https://jujingyi-kikuuu.vercel.app/mcp',
|
|
114
|
+
'/mcp connect local stdio node ./server/mcp/stdio.js',
|
|
115
|
+
'/mcp tools',
|
|
116
|
+
'/mcp save workspace',
|
|
117
|
+
'/mcp reconnect all',
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
'/provider': {
|
|
121
|
+
summary: 'Manage AI model providers (OpenAI, Gemini, Groq, DeepSeek, OpenRouter, LM Studio)',
|
|
122
|
+
usage: '/provider [list | status | use <name> [model] | models [name] | info <name> | test | setkey <key>]',
|
|
123
|
+
subcommands: [
|
|
124
|
+
{ cmd: 'list', desc: 'List all supported providers, availability, and active status', example: '/provider list' },
|
|
125
|
+
{ cmd: 'status', desc: 'Show detailed connection metrics, latency, and credentials for active provider', example: '/provider status' },
|
|
126
|
+
{ cmd: 'use <name> [model]', desc: 'Switch active AI provider and optionally specify initial model', example: '/provider use gemini gemini-2.5-flash' },
|
|
127
|
+
{ cmd: 'models [name]', desc: 'Fetch live model catalog from the specified or active provider API', example: '/provider models groq' },
|
|
128
|
+
{ cmd: 'setkey <key>', desc: 'Configure and persist API key for the active provider', example: '/provider setkey sk-...' },
|
|
129
|
+
{ cmd: 'test', desc: 'Perform a lightweight ping/test call to verify provider responsiveness', example: '/provider test' },
|
|
130
|
+
{ cmd: 'info <name>', desc: 'Show pricing, context window, token limits, and documentation for a provider', example: '/provider info deepseek' },
|
|
131
|
+
],
|
|
132
|
+
examples: [
|
|
133
|
+
'/provider list',
|
|
134
|
+
'/provider use gemini',
|
|
135
|
+
'/provider use openai gpt-4o-mini',
|
|
136
|
+
'/provider setkey YOUR_API_KEY',
|
|
137
|
+
'/provider models',
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
'/model': {
|
|
141
|
+
summary: 'Inspect, recommend, or switch active AI model',
|
|
142
|
+
usage: '/model [status | list | recommend | use <model-id> | reconnect]',
|
|
143
|
+
subcommands: [
|
|
144
|
+
{ cmd: 'status', desc: 'Display active model name, provider, latency, and context configuration', example: '/model status' },
|
|
145
|
+
{ cmd: 'list', desc: 'List models reported by the active provider or local LM Studio instance', example: '/model list' },
|
|
146
|
+
{ cmd: 'use <model-id>', desc: 'Switch active model immediately without restarting the agent', example: '/model use google/gemma-4-e4b' },
|
|
147
|
+
{ cmd: 'recommend', desc: 'Show curated model recommendations optimized for Ju Jingyi knowledge tasks', example: '/model recommend' },
|
|
148
|
+
{ cmd: 'reconnect', desc: 'Reconnect to the local or cloud model server and verify availability', example: '/model reconnect' },
|
|
149
|
+
],
|
|
150
|
+
examples: [
|
|
151
|
+
'/model status',
|
|
152
|
+
'/model list',
|
|
153
|
+
'/model recommend',
|
|
154
|
+
'/model use gemma-4-e4b',
|
|
155
|
+
'/model reconnect',
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
'/research': {
|
|
159
|
+
summary: 'Run coordinated multi-source Ju Jingyi research (3 parallel subagents: catalog, web, verifier)',
|
|
160
|
+
usage: '/research <question | status | last | sources | cancel>',
|
|
161
|
+
subcommands: [
|
|
162
|
+
{ cmd: '<question>', desc: 'Launch multi-worker deep research across local database and web sources', example: '/research ผลงานซีรีส์ปี 2026 ของจวีจิ้งอี' },
|
|
163
|
+
{ cmd: 'status', desc: 'Check status of running background research workers', example: '/research status' },
|
|
164
|
+
{ cmd: 'last', desc: 'Display synthesized findings from the latest research job', example: '/research last' },
|
|
165
|
+
{ cmd: 'sources', desc: 'List all validated URLs and citations collected during research', example: '/research sources' },
|
|
166
|
+
{ cmd: 'cancel', desc: 'Cancel the currently active research job', example: '/research cancel' },
|
|
167
|
+
],
|
|
168
|
+
examples: [
|
|
169
|
+
'/research What are Ju Jingyi\'s 2026 drama projects?',
|
|
170
|
+
'/research status',
|
|
171
|
+
'/research sources',
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
'/verify': {
|
|
175
|
+
summary: 'Verify a Ju Jingyi claim or rumor with independent workers across official catalog & web sources',
|
|
176
|
+
usage: '/verify <claim about Ju Jingyi>',
|
|
177
|
+
subcommands: [
|
|
178
|
+
{ cmd: '<claim>', desc: 'Run multi-worker verification to produce a strict verdict (VERIFIED, UNVERIFIED, CONFLICTING, FALSE)', example: '/verify จวีจิ้งอีเป็น Brand Ambassador ของ Versace ในปี 2026' },
|
|
179
|
+
],
|
|
180
|
+
examples: [
|
|
181
|
+
'/verify จวีจิ้งอีชนะเลือกตั้ง SNH48 สองสมัยซ้อน',
|
|
182
|
+
'/verify Ju Jingyi will star in a new 2026 historical drama',
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
'/subagent': {
|
|
186
|
+
summary: 'Spawn an isolated iterative research subagent to investigate a specific task or subtopic',
|
|
187
|
+
usage: '/subagent <task | status | last | tools>',
|
|
188
|
+
subcommands: [
|
|
189
|
+
{ cmd: '<task>', desc: 'Dispatch dedicated bounded subagent with iterative tool execution', example: '/subagent Search all OST songs sung by Ju Jingyi in 2024-2026' },
|
|
190
|
+
{ cmd: 'status / last', desc: 'Inspect tool calls and synthesized evidence from the previous subagent', example: '/subagent status' },
|
|
191
|
+
],
|
|
192
|
+
examples: [
|
|
193
|
+
'/subagent Explore Versace brand ambassadorship milestones',
|
|
194
|
+
'/subagent status',
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
'/mem': {
|
|
198
|
+
summary: 'Manage long-term semantic memory and persistent facts',
|
|
199
|
+
usage: '/mem [list | add <fact> | search <query> | topics | del <id> | import <path> | export | clear]',
|
|
200
|
+
subcommands: [
|
|
201
|
+
{ cmd: 'list', desc: 'View all stored long-term memory facts', example: '/mem list' },
|
|
202
|
+
{ cmd: 'add <fact>', desc: 'Store a verified fact directly into persistent memory', example: '/mem add จวีจิ้งอีเกิดวันที่ 18 มิถุนายน 1994' },
|
|
203
|
+
{ cmd: 'search <query>', desc: 'Search stored memory facts using relevance ranking', example: '/mem search Versace' },
|
|
204
|
+
{ cmd: 'topics', desc: 'View list of categorized memory topics', example: '/mem topics' },
|
|
205
|
+
{ cmd: 'del <id>', desc: 'Delete a specific memory entry by ID', example: '/mem del m_123' },
|
|
206
|
+
{ cmd: 'export', desc: 'Export memory facts to JSON file', example: '/mem export' },
|
|
207
|
+
{ cmd: 'import <path>', desc: 'Import memory facts from a JSON file', example: '/mem import ./facts.json' },
|
|
208
|
+
{ cmd: 'clear', desc: 'Wipe all long-term memory facts', example: '/mem clear' },
|
|
209
|
+
],
|
|
210
|
+
examples: [
|
|
211
|
+
'/mem list',
|
|
212
|
+
'/mem add ผู้ใช้ชื่นชอบซีรีส์ In Blossom เป็นพิเศษ',
|
|
213
|
+
'/mem search In Blossom',
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
'/skill': {
|
|
217
|
+
summary: 'Teach Kiku custom persona rules and response preferences',
|
|
218
|
+
usage: '/skill [learn <instruction> | list | on | off | del <id> | clear]',
|
|
219
|
+
subcommands: [
|
|
220
|
+
{ cmd: 'learn <instruction>', desc: 'Teach Kiku how to format responses or adapt tone', example: '/skill learn ตอบภาษาไทยแบบสุภาพและกระชับเสมอ' },
|
|
221
|
+
{ cmd: 'list', desc: 'List all active learned skills and their IDs', example: '/skill list' },
|
|
222
|
+
{ cmd: 'on / off', desc: 'Enable or disable learned skills globally', example: '/skill off' },
|
|
223
|
+
{ cmd: 'del <id>', desc: 'Remove a specific learned skill by ID', example: '/skill del s_123' },
|
|
224
|
+
{ cmd: 'clear', desc: 'Delete all custom learned skills', example: '/skill clear' },
|
|
225
|
+
],
|
|
226
|
+
examples: [
|
|
227
|
+
'/skill learn ตอบภาษาไทยและลงท้ายด้วยค่ะเสมอ',
|
|
228
|
+
'/skill list',
|
|
229
|
+
],
|
|
230
|
+
},
|
|
231
|
+
'/details': {
|
|
232
|
+
summary: 'Inspect deep diagnostics, tool timeline, and token metrics for queries',
|
|
233
|
+
usage: '/details [Qn] [overview | answer | thinking | tools | tool <n> | all | markdown]',
|
|
234
|
+
subcommands: [
|
|
235
|
+
{ cmd: 'overview / [Qn]', desc: 'View summary of duration, iterations, token counts, and tool timeline (Press F2 for latest)', example: '/details Q1' },
|
|
236
|
+
{ cmd: 'answer', desc: 'View the complete untruncated final answer', example: '/details answer' },
|
|
237
|
+
{ cmd: 'thinking', desc: 'Inspect raw chain-of-thought and model reasoning', example: '/details thinking' },
|
|
238
|
+
{ cmd: 'tools', desc: 'List all tool calls executed during query processing', example: '/details tools' },
|
|
239
|
+
{ cmd: 'tool <n>', desc: 'Inspect exact arguments and raw return payload for tool call N', example: '/details tool 1' },
|
|
240
|
+
{ cmd: 'all / markdown', desc: 'View full formatted Markdown transcript of the query', example: '/details all' },
|
|
241
|
+
],
|
|
242
|
+
examples: [
|
|
243
|
+
'/details',
|
|
244
|
+
'/details Q1 overview',
|
|
245
|
+
'/details Q1 tool 1',
|
|
246
|
+
'/details all',
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
'/copy': {
|
|
250
|
+
summary: 'Copy complete untruncated model answer, thinking trace, tools, or markdown to system clipboard',
|
|
251
|
+
usage: '/copy [Qn] [answer | thinking | tools | tool <n> | all | markdown | overview]',
|
|
252
|
+
subcommands: [
|
|
253
|
+
{ cmd: '[Qn] [answer]', desc: 'Copy complete untruncated model answer to system clipboard (default)', example: '/copy' },
|
|
254
|
+
{ cmd: 'thinking', desc: 'Copy raw chain-of-thought and model reasoning', example: '/copy thinking' },
|
|
255
|
+
{ cmd: 'tools', desc: 'Copy JSON tool executions and arguments', example: '/copy tools' },
|
|
256
|
+
{ cmd: 'tool <n>', desc: 'Copy raw JSON result of specific tool call N', example: '/copy tool 1' },
|
|
257
|
+
{ cmd: 'all / markdown', desc: 'Copy entire Q&A transcript in clean Markdown format', example: '/copy all' },
|
|
258
|
+
{ cmd: 'overview', desc: 'Copy diagnostic overview and metadata', example: '/copy overview' },
|
|
259
|
+
],
|
|
260
|
+
examples: [
|
|
261
|
+
'/copy',
|
|
262
|
+
'/copy thinking',
|
|
263
|
+
'/copy Q2 answer',
|
|
264
|
+
'/copy tool 1',
|
|
265
|
+
'/copy all',
|
|
266
|
+
],
|
|
267
|
+
},
|
|
268
|
+
'/theme': {
|
|
269
|
+
summary: 'View or switch the terminal color theme dynamically',
|
|
270
|
+
usage: '/theme [sakura | midnight | ocean | forest | sunset | monochrome | list | current | reset]',
|
|
271
|
+
subcommands: [
|
|
272
|
+
{ cmd: 'list', desc: 'Preview all available color theme palettes and descriptions', example: '/theme list' },
|
|
273
|
+
{ cmd: 'current', desc: 'Show currently active theme and color samples', example: '/theme current' },
|
|
274
|
+
{ cmd: '<name>', desc: 'Switch theme instantly (sakura, midnight, ocean, forest, sunset, monochrome)', example: '/theme midnight' },
|
|
275
|
+
{ cmd: 'reset', desc: 'Reset to default theme (sakura)', example: '/theme reset' },
|
|
276
|
+
],
|
|
277
|
+
examples: [
|
|
278
|
+
'/theme list',
|
|
279
|
+
'/theme midnight',
|
|
280
|
+
'/theme ocean',
|
|
281
|
+
'/theme monochrome',
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
'/update': {
|
|
285
|
+
summary: 'Check, install, configure, or roll back npm package releases for kiku-agent',
|
|
286
|
+
usage: '/update [check | install [target] | channel [name] | rollback | help]',
|
|
287
|
+
subcommands: [
|
|
288
|
+
{ cmd: 'check', desc: 'Check npm registry for newer versions across release channels', example: '/update check' },
|
|
289
|
+
{ cmd: 'install [target]', desc: 'Install latest version or specific tag (next, canary, exact version)', example: '/update install' },
|
|
290
|
+
{ cmd: 'channel [name]', desc: 'Switch release channel (latest, next, canary)', example: '/update channel next' },
|
|
291
|
+
{ cmd: 'rollback', desc: 'Revert to the previously installed package version', example: '/update rollback' },
|
|
292
|
+
],
|
|
293
|
+
examples: [
|
|
294
|
+
'/update check',
|
|
295
|
+
'/update install',
|
|
296
|
+
'/update channel next',
|
|
297
|
+
'/update rollback',
|
|
298
|
+
],
|
|
299
|
+
},
|
|
300
|
+
'/session': {
|
|
301
|
+
summary: 'Manage current conversation session, storage, and snapshots',
|
|
302
|
+
usage: '/session [info | list | export | clear]',
|
|
303
|
+
subcommands: [
|
|
304
|
+
{ cmd: 'info', desc: 'Display session ID, active duration, message count, and turn stats', example: '/session info' },
|
|
305
|
+
{ cmd: 'list', desc: 'List all saved conversation sessions on disk', example: '/session list' },
|
|
306
|
+
{ cmd: 'export', desc: 'Export full conversation session history to JSON', example: '/session export' },
|
|
307
|
+
{ cmd: 'clear', desc: 'Archive current conversation session and reset history', example: '/session clear' },
|
|
308
|
+
],
|
|
309
|
+
examples: [
|
|
310
|
+
'/session info',
|
|
311
|
+
'/session list',
|
|
312
|
+
'/session clear',
|
|
313
|
+
],
|
|
314
|
+
},
|
|
315
|
+
'/history': {
|
|
316
|
+
summary: 'View or search recent chat message history',
|
|
317
|
+
usage: '/history [count | search <query> | clear]',
|
|
318
|
+
subcommands: [
|
|
319
|
+
{ cmd: '[n]', desc: 'Display the last N messages (default: 20)', example: '/history 10' },
|
|
320
|
+
{ cmd: 'search <query>', desc: 'Search messages in current session history', example: '/history search In Blossom' },
|
|
321
|
+
{ cmd: 'clear', desc: 'Clear in-memory conversation history', example: '/history clear' },
|
|
322
|
+
],
|
|
323
|
+
examples: [
|
|
324
|
+
'/history',
|
|
325
|
+
'/history 50',
|
|
326
|
+
'/history search drama',
|
|
327
|
+
],
|
|
328
|
+
},
|
|
329
|
+
'/thinking': {
|
|
330
|
+
summary: 'Control reasoning and chain-of-thought visibility during generation',
|
|
331
|
+
usage: '/thinking [show | hide | toggle]',
|
|
332
|
+
subcommands: [
|
|
333
|
+
{ cmd: 'show', desc: 'Display live model reasoning process in real time', example: '/thinking show' },
|
|
334
|
+
{ cmd: 'hide', desc: 'Hide thinking process and display only final answers', example: '/thinking hide' },
|
|
335
|
+
{ cmd: 'toggle', desc: 'Toggle thinking display mode on/off', example: '/thinking toggle' },
|
|
336
|
+
],
|
|
337
|
+
examples: [
|
|
338
|
+
'/thinking show',
|
|
339
|
+
'/thinking hide',
|
|
340
|
+
'/thinking toggle',
|
|
341
|
+
],
|
|
342
|
+
},
|
|
343
|
+
'/lang': {
|
|
344
|
+
summary: 'Set response language for AI synthesis',
|
|
345
|
+
usage: '/lang [th | zh | en | auto]',
|
|
346
|
+
subcommands: [
|
|
347
|
+
{ cmd: 'th', desc: 'Set response language to Thai (ค่ะ/นะคะ)', example: '/lang th' },
|
|
348
|
+
{ cmd: 'zh', desc: 'Set response language to Chinese (中文)', example: '/lang zh' },
|
|
349
|
+
{ cmd: 'en', desc: 'Set response language to English', example: '/lang en' },
|
|
350
|
+
{ cmd: 'auto', desc: 'Auto-detect response language from user input (default)', example: '/lang auto' },
|
|
351
|
+
],
|
|
352
|
+
examples: [
|
|
353
|
+
'/lang th',
|
|
354
|
+
'/lang zh',
|
|
355
|
+
'/lang auto',
|
|
356
|
+
],
|
|
357
|
+
},
|
|
358
|
+
'/queue': {
|
|
359
|
+
summary: 'Inspect or clear music playback audio queue',
|
|
360
|
+
usage: '/queue [clear]',
|
|
361
|
+
subcommands: [
|
|
362
|
+
{ cmd: '', desc: 'Show currently queued music tracks and playback state', example: '/queue' },
|
|
363
|
+
{ cmd: 'clear', desc: 'Wipe all pending tracks from the music queue', example: '/queue clear' },
|
|
364
|
+
],
|
|
365
|
+
examples: [
|
|
366
|
+
'/queue',
|
|
367
|
+
'/queue clear',
|
|
368
|
+
],
|
|
369
|
+
},
|
|
370
|
+
'/gpu': {
|
|
371
|
+
summary: 'Show GPU & VRAM hardware resource metrics',
|
|
372
|
+
usage: '/gpu [status]',
|
|
373
|
+
subcommands: [
|
|
374
|
+
{ cmd: 'status', desc: 'Show real-time NVIDIA/Metal GPU compute utilization and VRAM memory usage', example: '/gpu' },
|
|
375
|
+
],
|
|
376
|
+
examples: [
|
|
377
|
+
'/gpu',
|
|
378
|
+
],
|
|
379
|
+
},
|
|
380
|
+
'/tools': {
|
|
381
|
+
summary: 'List registered SSOT knowledge and external tools',
|
|
382
|
+
usage: '/tools [filter]',
|
|
383
|
+
subcommands: [
|
|
384
|
+
{ cmd: '[filter]', desc: 'List all registered tools or filter by keyword', example: '/tools drama' },
|
|
385
|
+
],
|
|
386
|
+
examples: [
|
|
387
|
+
'/tools',
|
|
388
|
+
'/tools search',
|
|
389
|
+
'/tools mcp',
|
|
390
|
+
],
|
|
391
|
+
},
|
|
392
|
+
'/cancel': {
|
|
393
|
+
summary: 'Abort the currently running query, tool, or subagent task',
|
|
394
|
+
usage: '/cancel',
|
|
395
|
+
subcommands: [
|
|
396
|
+
{ cmd: '', desc: 'Instantly cancel running model generation, tool execution, or research subagents', example: '/cancel' },
|
|
397
|
+
],
|
|
398
|
+
examples: [
|
|
399
|
+
'/cancel',
|
|
400
|
+
],
|
|
401
|
+
},
|
|
402
|
+
'/tool': {
|
|
403
|
+
summary: 'Execute a registered SSOT tool directly with arguments',
|
|
404
|
+
usage: '/tool <name> [json_args | raw_query]',
|
|
405
|
+
subcommands: [
|
|
406
|
+
{ cmd: '<name> [args]', desc: 'Call tool directly without model synthesis', example: '/tool search_works {"year":2026}' },
|
|
407
|
+
],
|
|
408
|
+
examples: [
|
|
409
|
+
'/tool get_profile_and_fandom',
|
|
410
|
+
'/tool search_works In Blossom',
|
|
411
|
+
'/tool search_discography {"category":"ost"}',
|
|
412
|
+
],
|
|
413
|
+
},
|
|
414
|
+
'/play': {
|
|
415
|
+
summary: 'Stream YouTube audio for Ju Jingyi songs and OSTs',
|
|
416
|
+
usage: '/play <song_name_or_url>',
|
|
417
|
+
subcommands: [
|
|
418
|
+
{ cmd: '<song>', desc: 'Search and play song on YouTube in the background', example: '/play 恋爱告急' },
|
|
419
|
+
],
|
|
420
|
+
examples: [
|
|
421
|
+
'/play In Blossom OST',
|
|
422
|
+
'/play 恋爱告急',
|
|
423
|
+
],
|
|
424
|
+
},
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
export function findCommandDefinition(name) {
|
|
428
|
+
const normalized = name?.startsWith('/') ? name.toLowerCase() : `/${String(name || '').toLowerCase()}`;
|
|
429
|
+
return COMMAND_DEFINITIONS.find(command => command.name === normalized) || null;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export function getCommandDetails(name) {
|
|
433
|
+
if (!name) return null;
|
|
434
|
+
const normalized = name.startsWith('/') ? name.toLowerCase() : `/${String(name).toLowerCase()}`;
|
|
435
|
+
return COMMAND_DETAILS[normalized] || null;
|
|
436
|
+
}
|