kiku-agent 1.0.11 → 1.2.0
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 +300 -495
- package/package.json +12 -11
- package/public/fonts/GoogleSans-Bold.ttf +0 -0
- package/public/fonts/GoogleSans-Bold.woff2 +0 -0
- package/public/fonts/GoogleSans-BoldItalic.ttf +0 -0
- package/public/fonts/GoogleSans-Italic.ttf +0 -0
- package/public/fonts/GoogleSans-Latin-400.woff2 +0 -0
- package/public/fonts/GoogleSans-Latin-500.woff2 +0 -0
- package/public/fonts/GoogleSans-Latin-600.woff2 +0 -0
- package/public/fonts/GoogleSans-Latin-700.woff2 +0 -0
- package/public/fonts/GoogleSans-Medium.ttf +0 -0
- package/public/fonts/GoogleSans-Medium.woff2 +0 -0
- package/public/fonts/GoogleSans-Regular.ttf +0 -0
- package/public/fonts/GoogleSans-Regular.woff2 +0 -0
- package/public/fonts/GoogleSans-Thai-400.woff2 +0 -0
- package/public/fonts/GoogleSans-Thai-500.woff2 +0 -0
- package/public/fonts/GoogleSans-Thai-600.woff2 +0 -0
- package/public/fonts/GoogleSans-Thai-700.woff2 +0 -0
- package/public/fonts/NotoSansThai-Bold.woff2 +0 -0
- package/public/fonts/NotoSansThai-Regular.woff2 +0 -0
- package/public/fonts/google-sans-official.css +900 -0
- package/public/images/0040jbadgy1id6am4yxqfj61s82dn1kx02.jpg +0 -0
- package/public/images/0040jbadgy1id6am708pbj62c0340qv602.jpg +0 -0
- package/public/images/0040jbadgy1id6amb81uqj62c0340x6q02.jpg +0 -0
- package/public/images/0040jbadgy1id6amcqte3j62c0340qv602.jpg +0 -0
- package/public/images/0040jbadgy1id6amdg3xcj62b232wqv502.jpg +0 -0
- package/public/images/0040jbadgy1id6amexv23j620v2pau0x02.jpg +0 -0
- package/public/images/0040jbadly8icq3if7twwj60qy0qy0uc02.jpg +0 -0
- package/public/images/008ET7Legy1ig9s89nri5j30i20n1gn4.jpg +0 -0
- package/public/images/008ET7Legy1ig9s8a2lmlj30i20ny409.jpg +0 -0
- package/public/images/008ET7Legy1ig9s8ay1hsj30i20nk3zv.jpg +0 -0
- package/public/images/008ET7Legy1ig9s8bab6sj30i20o7go1.jpg +0 -0
- package/public/images/008ET7Legy1ig9s8blqsxj30i20oiq4r.jpg +0 -0
- package/public/images/008ET7Legy1ig9s8cbxkzj30i20mxmzh.jpg +0 -0
- package/public/images/douyin-update/thumbs//346/212/226/351/237/2632026820-399915.jpg +0 -0
- package/public/images/douyin-update/thumbs//346/212/226/351/237/2632026820-424041.jpg +0 -0
- package/public/images/douyin-update/thumbs//346/212/226/351/237/2632026820-588166.jpg +0 -0
- package/public/images/douyin-update/thumbs//346/212/226/351/237/2632026820-672198.jpg +0 -0
- package/public/images/douyin-update/thumbs//346/212/226/351/237/2632026820-700522.jpg +0 -0
- package/public/images/douyin-update/thumbs//346/212/226/351/237/2632026820-839722.jpg +0 -0
- package/public/images/douyin-update/thumbs//346/212/226/351/237/2632026825-460586.jpg +0 -0
- package/public/images/douyin-update/thumbs//346/212/226/351/237/263202694-689407.jpg +0 -0
- package/public/images/douyin-update//346/212/226/351/237/2632026820-399915.mp4 +0 -0
- package/public/images/douyin-update//346/212/226/351/237/2632026820-424041.mp4 +0 -0
- package/public/images/douyin-update//346/212/226/351/237/2632026820-588166.mp4 +0 -0
- package/public/images/douyin-update//346/212/226/351/237/2632026820-672198.mp4 +0 -0
- package/public/images/douyin-update//346/212/226/351/237/2632026820-700522.mp4 +0 -0
- package/public/images/douyin-update//346/212/226/351/237/2632026820-839722.mp4 +0 -0
- package/public/images/douyin-update//346/212/226/351/237/2632026825-460586.mp4 +0 -0
- package/public/images/douyin-update//346/212/226/351/237/263202694-689407.mp4 +0 -0
- package/public/images/general/0040jbadgy1id6am4yxqfj61s82dn1kx02.jpg +0 -0
- package/public/images/general/0040jbadgy1id6am708pbj62c0340qv602.jpg +0 -0
- package/public/images/general/0040jbadgy1id6amb81uqj62c0340x6q02.jpg +0 -0
- package/public/images/general/0040jbadgy1id6amcqte3j62c0340qv602.jpg +0 -0
- package/public/images/general/0040jbadgy1id6amdg3xcj62b232wqv502.jpg +0 -0
- package/public/images/general/0040jbadgy1id6amexv23j620v2pau0x02.jpg +0 -0
- package/public/images/general/0040jbadly8icq3if7twwj60qy0qy0uc02.jpg +0 -0
- package/public/images/general/008ET7Legy1ig9s89nri5j30i20n1gn4.jpg +0 -0
- package/public/images/general/008ET7Legy1ig9s8a2lmlj30i20ny409.jpg +0 -0
- package/public/images/general/008ET7Legy1ig9s8ay1hsj30i20nk3zv.jpg +0 -0
- package/public/images/general/008ET7Legy1ig9s8bab6sj30i20o7go1.jpg +0 -0
- package/public/images/general/008ET7Legy1ig9s8blqsxj30i20oiq4r.jpg +0 -0
- package/public/images/general/008ET7Legy1ig9s8cbxkzj30i20mxmzh.jpg +0 -0
- package/public/images/general/jujingyi_portrait.jpg +0 -0
- package/public/images/jujingyi_portrait.jpg +0 -0
- package/public/images/series/a-millenniums-wait/poster.jpg +0 -0
- package/public/images/series/beauty-of-resilience/poster.jpg +0 -0
- package/public/images/series/detective-samoyeds/poster.jpg +0 -0
- package/public/images/series/everyday/poster.jpg +0 -0
- package/public/images/series/fu-rong-ancient-painting/poster.jpg +0 -0
- package/public/images/series/in-a-class-of-her-own/poster.jpg +0 -0
- package/public/images/series/in-blossom/poster.jpg +0 -0
- package/public/images/series/legend-of-yunxi/poster.jpg +0 -0
- package/public/images/series/lets-fight/poster-2.jpg +0 -0
- package/public/images/series/lets-fight/poster.jpg +0 -0
- package/public/images/series/love-emergency/poster.jpg +0 -0
- package/public/images/series/love-under-the-full-moon/poster.jpg +0 -0
- package/public/images/series/money-bastion/poster.jpg +0 -0
- package/public/images/series/mr-swimmer/poster.jpg +0 -0
- package/public/images/series/novoland-castle-in-the-sky/poster.jpg +0 -0
- package/public/images/series/please-give-me-a-pair-of-wings/poster.jpg +0 -0
- package/public/images/series/rebirth-for-you/poster.jpg +0 -0
- package/public/images/series/sword-and-fairy-4/poster.jpg +0 -0
- package/public/images/series/the-blooms-at-ruyi-pavilion/poster.jpg +0 -0
- package/public/images/series/the-eternal-fragrance/poster-2.jpg +0 -0
- package/public/images/series/the-eternal-fragrance/poster.jpg +0 -0
- package/public/images/series/the-fallen-flowers/poster.jpg +0 -0
- package/public/images/series/the-legend-of-white-snake/poster.jpg +0 -0
- package/public/images/series/veil-of-shadows/poster.jpg +0 -0
- package/public/images/series/wanhua-sin/poster-2.jpg +0 -0
- package/public/images/series/wanhua-sin/poster.jpg +0 -0
- package/public/images/weibo-update/41/345/210/206/351/222/237/345/211/215/0040jbadgy1igrkj10yogj62u03s0npe02.jpg +0 -0
- package/public/images/weibo-update/41/345/210/206/351/222/237/345/211/215/0040jbadgy1igrkj2pdvyj61li25jkjl02.jpg +0 -0
- package/public/images/weibo-update/41/345/210/206/351/222/237/345/211/215/0040jbadgy1igrkj71177j62672w9e8302.jpg +0 -0
- package/public/images/weibo-update/41/345/210/206/351/222/237/345/211/215/0040jbadgy1igrkj7twpfj62192197rw02.jpg +0 -0
- package/public/images/weibo-update/41/345/210/206/351/222/237/345/211/215/0040jbadgy1igrkj8jfu8j62c03401kx02.jpg +0 -0
- package/public/images/weibo-update/41/345/210/206/351/222/237/345/211/215/0040jbadgy1igrkj9dhdsj622k2l77wh02.jpg +0 -0
- package/public/images/weibo-update/41/345/210/206/351/222/237/345/211/215/0040jbadgy1igrkja31s4j62bw3407r802.jpg +0 -0
- package/public/images/weibo-update/41/345/210/206/351/222/237/345/211/215/0040jbadgy1igrkjcf331j61402ey1kx02.jpg +0 -0
- package/public/images/weibo-update/41/345/210/206/351/222/237/345/211/215/0040jbadgy1igrkjdx8gqj62602pihdt02.jpg +0 -0
- package/public/images/weibo-update/41/345/210/206/351/222/237/345/211/215/0040jbadgy1igrkjfvxnzj62432n57wh02.jpg +0 -0
- package/public/images/weibo-update/8-14-17-16/0040jbadgy1ig3ixniv2yj627y4fxb2b02.jpg +0 -0
- package/public/images/weibo-update/8-14-17-16/0040jbadgy1ig3ixsvbdaj625k2vfu1102.jpg +0 -0
- package/public/images/weibo-update/8-14-17-16/0040jbadgy1ig3ixxxdaoj62c03501l202.jpg +0 -0
- package/public/images/weibo-update/8-14-17-16/0040jbadgy1ig3ixzeef9j62c0340npd02.jpg +0 -0
- package/public/images/weibo-update/8-14-17-16/0040jbadgy1ig3iy0vs6tj626t4rbhdu02.jpg +0 -0
- package/public/images/weibo-update/8-14-17-16/0040jbadgy1ig3iy21wwuj62bt34hx6q02.jpg +0 -0
- package/public/images/weibo-update/8-8-17-39/0040jbadgy1ifwly4wr85j62z629y7wh02.jpg +0 -0
- package/public/images/weibo-update/8-8-17-39/0040jbadgy1ifwly67oilj623u2t5npd02.jpg +0 -0
- package/public/images/weibo-update/8-8-17-39/0040jbadgy1ifwly9qtw8j62c0340u0x02.jpg +0 -0
- package/public/images/weibo-update/8-8-17-39/0040jbadgy1ifwlyem4m4j63402c01kz02.jpg +0 -0
- package/public/images/weibo-update/8-8-17-39/0040jbadgy1ifwlygkoq4j627s2yeavd02.jpg +0 -0
- package/public/images/weibo-update/8-8-17-39/0040jbadgy1ifwlyjh0daj62bw340nm102.jpg +0 -0
- package/public/images/weibo-update/8-8-17-39/0040jbadgy1ifwlylejlhj62bw3401kx02.jpg +0 -0
- package/public/images/weibo-update/today/0040jbadgy1igaiaa8b7fj627j2y67wh02.jpg +0 -0
- package/public/images/weibo-update/today/0040jbadgy1igaiagw3ezj61s02ebu0x02.jpg +0 -0
- package/public/images/weibo-update/today/0040jbadgy1igaiaivng3j61rv2ebx6p02.jpg +0 -0
- package/public/images/weibo-update/today/0040jbadgy1igaiajuixvj62bw340qv502.jpg +0 -0
- package/public/images/weibo-update/today/0040jbadgy1igaiapyartj62bw340hdt02.jpg +0 -0
- package/public/images/weibo-update/today/0040jbadgy1igaibkwu4ij61vy2iq1kx02.jpg +0 -0
- package/public/images/weibo-update/today/0040jbadgy1igaic1fvkpj61u92eo1ky02.jpg +0 -0
- package/public/images/weibo-update/today/0040jbadgy1igaic3cruhj62822ywb2902.jpg +0 -0
- package/public/manifest.json +25 -0
- package/public/mcp-logo-128.png +0 -0
- package/public/mcp-logo-64.png +0 -0
- package/public/mcp-logo.svg +16 -0
- package/server/agent/agentCore.js +542 -74
- package/server/agent/appPaths.js +1 -0
- package/server/agent/audioPlayer.js +4 -2
- package/server/agent/citations.js +294 -0
- package/server/agent/clarificationAnalytics.js +477 -0
- package/server/agent/clarifyingQuestions.js +1089 -0
- package/server/agent/cli.js +549 -125
- package/server/agent/commandFeatures.js +1 -0
- package/server/agent/commandRegistry.js +946 -879
- package/server/agent/commands.js +546 -272
- package/server/agent/config.js +581 -412
- package/server/agent/contextCompactor.js +2 -2
- package/server/agent/debate.js +235 -0
- package/server/agent/eventBus.js +3 -0
- package/server/agent/feedbackLearning.js +217 -0
- package/server/agent/llmClient.js +512 -394
- package/server/agent/mcpClient.js +182 -32
- package/server/agent/memory.js +283 -224
- package/server/agent/modelManager.js +79 -39
- package/server/agent/profiles.js +178 -0
- package/server/agent/publicTools.js +22 -0
- package/server/agent/queryDetails.js +68 -8
- package/server/agent/quizData.js +398 -384
- package/server/agent/research.js +121 -79
- package/server/agent/sanitizer.js +104 -13
- package/server/agent/session.js +319 -11
- package/server/agent/subagent.js +8 -3
- package/server/agent/suggestionTui.js +294 -0
- package/server/agent/suggestions.js +69 -3
- package/server/agent/telemetry.js +119 -0
- package/server/agent/terminalImage.js +146 -27
- package/server/agent/theme.js +17 -0
- package/server/agent/toolRouter.js +16 -1
- package/server/agent/tools.js +424 -225
- package/server/agent/ui.js +486 -64
- package/server/agent/version.js +2 -4
- package/server/agent/webSearch.js +111 -11
- package/server/agent/youtubeAuth.js +24 -6
- package/server/apiRouter.js +4222 -0
- package/server/mcp/data/discography.js +25 -16
- package/server/mcp/data/gallery.js +308 -20
- package/server/mcp/data/profile.js +74 -44
- package/server/mcp/data/timeline.js +1 -1
- package/server/mcp/data/works.js +51 -17
- package/server/mcp/dataAdapter.js +5 -3
- package/server/mcp/handler.js +5 -11
- package/server/mcp/prompts.js +86 -0
- package/server/mcp/security.js +18 -15
- package/server/mcp/server.js +7 -2
- package/server/mcp/tools.js +66 -2
- package/server/web-chat/core/browserLauncher.js +18 -0
- package/server/web-chat/core/connection.js +194 -0
- package/server/web-chat/core/conversationContext.js +82 -0
- package/server/web-chat/core/directCatalogEngine.js +196 -0
- package/server/web-chat/core/dramaKnowledge.js +142 -0
- package/server/web-chat/core/errorHandler.js +51 -0
- package/server/web-chat/core/followUpEngine.js +182 -0
- package/server/web-chat/core/futureEventGuard.js +80 -0
- package/server/web-chat/core/memorySnapshot.js +12 -0
- package/server/web-chat/core/security.js +146 -0
- package/server/web-chat/core/toolInspector.js +52 -0
- package/server/web-chat/router.js +120 -0
- package/server/web-chat/routes/chatRoute.js +397 -0
- package/server/web-chat/routes/clarifyConfigRoute.js +98 -0
- package/server/web-chat/routes/clarifyRoute.js +83 -0
- package/server/web-chat/routes/compareRoute.js +79 -0
- package/server/web-chat/routes/exportRoute.js +59 -0
- package/server/web-chat/routes/feedbackRoute.js +57 -0
- package/server/web-chat/routes/newsRoute.js +33 -0
- package/server/web-chat/routes/quizRoute.js +11 -0
- package/server/web-chat/routes/staticRoute.js +103 -0
- package/server/web-chat/routes/statusRoute.js +52 -0
- package/server/web-chat/routes/suggestRoute.js +77 -0
- package/server/web-chat/routes/timelineRoute.js +34 -0
- package/server/web-chat/routes/verifyRoute.js +57 -0
- package/server/web-chat/server.js +116 -0
- package/server/web-chat/ui/htmlBuilder.js +91 -0
- package/server/web-chat/ui/previews/agentBubble.preview.html +134 -0
- package/server/web-chat/ui/scripts/agentBubbleSystem.js +320 -0
- package/server/web-chat/ui/scripts/client.js +8397 -0
- package/server/web-chat/ui/scripts/kikuDb.js +177 -0
- package/server/web-chat/ui/scripts/suggestionsData.js +118 -0
- package/server/web-chat/ui/scripts/webchatI18n.js +291 -0
- package/server/web-chat/ui/styles/main.css +8568 -0
- package/server/web-chat/ui/templates/body.html +796 -0
- package/server/webChatHtml.js +1 -0
- package/server/webChatServer.js +6 -0
- package/src/data/discographyData.js +892 -866
- package/src/data/galleryData.js +1805 -561
- package/src/data/profileData.js +79 -2
- package/src/data/socialUpdatesData.js +106 -47
- package/src/data/timelineData.js +1 -1
- package/src/data/worksData.js +25 -4
- package/tokens.css +97 -0
- package/server/agent/updateManager.js +0 -456
package/README.md
CHANGED
|
@@ -1,463 +1,279 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- **
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
npm
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Kiku uses the published `kiku-agent` package on npm as its update source. Inside an interactive session:
|
|
76
|
-
|
|
77
|
-
```text
|
|
78
|
-
/update # Check the configured release channel
|
|
79
|
-
/update install # Install the stable `latest` release
|
|
80
|
-
/update install next # Install a preview release
|
|
81
|
-
/update install 1.2.3 # Install an exact published version
|
|
82
|
-
/update channel next # Persist the preferred channel
|
|
83
|
-
/update rollback # Restore the previously recorded version
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Automatic installation is available for global npm installs. Source checkouts, local dependencies, and `npx` executions receive a safe manual command instead of having their files replaced. Major updates require `--allow-major`; deprecated releases require `--allow-deprecated`. npm commands are executed without a shell and only allow known channel names or strict semantic versions.
|
|
87
|
-
|
|
88
|
-
After an update or rollback, restart `kiku-agent` and any application hosting `kiku-mcp`. Update settings and rollback history are stored in the normal Kiku user data directory as `update-state.json`; sessions, memory, `.env`, and YouTube cookies are not modified.
|
|
89
|
-
|
|
90
|
-
For a local checkout before the package is published, use `npm pack` followed by `npm install -g ./kiku-agent-1.0.11.tgz`.
|
|
91
|
-
|
|
92
|
-
### ✨ Features
|
|
93
|
-
- **LM Studio Integration**: Connects seamlessly to LM Studio's OpenAI-compatible server at `http://127.0.0.1:1234/v1` (default model `google/gemma-4-e4b`, with auto-detection of loaded models).
|
|
94
|
-
- **Validated Tool Calling**: Schema validation, argument coercion, timeouts, duplicate-call caching, normalized results, and 38 catalog/media/web/filesystem/music tools.
|
|
95
|
-
- **Music Player**: Search YouTube, stream audio locally through ffmpeg, and control a queue with play/pause/skip commands.
|
|
96
|
-
- **Multilingual Support**: Automatically detects and responds in Thai, Chinese, or English based on user input language.
|
|
97
|
-
- **Multi-turn Memory**: Retains conversation context with memory inspection and clear controls.
|
|
98
|
-
- **Resilient ReAct Loop**: Supports OpenAI function calling as well as structured JSON tool parsing optimized for Gemma models.
|
|
99
|
-
- **Graceful Diagnostics**: Displays real-time connection status, loaded model names, and fallback search modes if LM Studio is offline.
|
|
100
|
-
- **Interactive TUI**: Optional Ink-based terminal UI (`npm run kiku-ink`) with themes, thinking panels, and tool result rendering.
|
|
101
|
-
- **Sourced Research**: `/research`, `/verify`, and `/subagent` run bounded workers that cite source URLs; `/sources` lists them and `/suggestion` auto-generates research prompts.
|
|
102
|
-
- **Fan Collection & Discovery**: `/favorites` persists a reusable collection (JSON/Markdown export); `/discover` recommends items by type, year, and mood; `/quiz` awards Developer VIP keys.
|
|
103
|
-
- **Background Jobs**: `/jobs` tracks research, verification, subagent, and suggestion runs with show/cancel/clear controls.
|
|
104
|
-
- **Learned Response Skills**: `/skill learn <instruction>` persists reusable response preferences across sessions.
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## 🛠️ LM Studio Quick Setup
|
|
109
|
-
|
|
110
|
-
1. Open **LM Studio** on your computer.
|
|
111
|
-
2. In the Search tab, download or load **`google/gemma-4-e4b`** (quantization: `Q4_K_M`, `Q6_K`, or `Q8_0`).
|
|
112
|
-
3. Click the **Developer / Local Server** tab (icon with `<->`) on the left bar.
|
|
113
|
-
4. Select your loaded Gemma model and click **Start Server** on port `1234` (`http://localhost:1234`).
|
|
114
|
-
5. In this terminal, run:
|
|
115
|
-
```bash
|
|
116
|
-
npm run kiku-agent
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## 💻 CLI Usage
|
|
122
|
-
|
|
123
|
-
### Interactive Chat Mode
|
|
124
|
-
```bash
|
|
125
|
-
npm run kiku-agent
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Launch with Specific Cloud Provider & Model
|
|
129
|
-
```bash
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="./public/images/jujingyi_portrait.jpg" width="96" height="96" style="border-radius: 50%; object-fit: cover;" alt="Ju Jingyi Icon" />
|
|
4
|
+
|
|
5
|
+
# Ju Jingyi (鞠婧祎) Portal & Kiku AI Agent
|
|
6
|
+
|
|
7
|
+
*Full-stack fan archive, REST API Suite v1.0, and autonomous AI Agent CLI + MCP Server*
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/kiku-agent)
|
|
10
|
+
[](https://nodejs.org)
|
|
11
|
+
[](https://nodejs.org/api/esm.html)
|
|
12
|
+
[](https://modelcontextprotocol.io)
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
|
|
15
|
+
⭐ If you find this project helpful, star it on GitHub!
|
|
16
|
+
|
|
17
|
+
[Overview](#overview) • [Quick Start](#quick-start) • [Features](#features) • [CLI Commands](#interactive-chat-slash-commands) • [Agent Tools](#available-agent-tools-45) • [Cloud & Local Models](#multi-provider-cloud--local-models) • [MCP Integration](#model-context-protocol-mcp) • [Web App & REST API](#web-app--rest-api) • [Troubleshooting](#troubleshooting)
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Overview
|
|
24
|
+
|
|
25
|
+
This repository ships a complete full-stack ecosystem for Chinese singer and actress **Ju Jingyi (鞠婧祎)**, packaged and distributed under the single [`kiku-agent`](https://www.npmjs.com/package/kiku-agent) npm package:
|
|
26
|
+
|
|
27
|
+
| Deliverable | Location | Description |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| **Fan Portal (SPA)** | `src/` | Vite + React 19 + Tailwind 4 interactive showcase featuring discography, filmography, 4K visual gallery, trivia quiz, and timeline. |
|
|
30
|
+
| **REST API v1** | `server/apiRouter.js` | Framework-free Node `http` REST API suite serving 16 endpoints, OpenAPI 3.0 specs, and live interactive `/api-docs`. |
|
|
31
|
+
| **AI Agent CLI & MCP Server** | `server/agent/`, `server/mcp/` | Autonomous ReAct agent CLI (`kiku-agent`) and Model Context Protocol server (`kiku-mcp`) connecting to local LM Studio or cloud LLMs. |
|
|
32
|
+
|
|
33
|
+
> [!TIP]
|
|
34
|
+
> **100% Free Local Inference**: Kiku Agent runs completely offline with zero API token cost when connected to [LM Studio](https://lmstudio.ai/) running `google/gemma-4-e4b`. If no LLM is running, Kiku automatically starts in **catalog-only mode** instead of crashing.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
39
|
+
|
|
40
|
+
### Global Installation
|
|
41
|
+
|
|
42
|
+
Install the Kiku Agent CLI and MCP server globally via npm:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install -g kiku-agent
|
|
46
|
+
kiku-agent
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
> [!NOTE]
|
|
50
|
+
> The global package deliberately excludes native binary build dependencies (Python, `node-gyp`, Visual Studio C++ build tools are not required). For a local checkout before publishing, pack and install via `npm install -g ./kiku-agent-1.2.0.tgz`.
|
|
51
|
+
|
|
52
|
+
### Zero-Install One-Shot Query
|
|
53
|
+
|
|
54
|
+
Ask questions directly from your terminal using `npx`:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx kiku-agent --query "ผลงานซีรีส์ปี 2026 มีเรื่องอะไรบ้างและรับบทเป็นใคร"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Local LM Studio Setup
|
|
61
|
+
|
|
62
|
+
1. Open **LM Studio** on your machine.
|
|
63
|
+
2. Download or load **`google/gemma-4-e4b`** (quantization: `Q4_K_M`, `Q6_K`, or `Q8_0`).
|
|
64
|
+
3. Click the **Developer / Local Server** tab (`<->`) on the left sidebar.
|
|
65
|
+
4. Select your loaded Gemma model and click **Start Server** on port `1234` (`http://localhost:1234`).
|
|
66
|
+
5. Launch Kiku Agent:
|
|
67
|
+
```bash
|
|
68
|
+
kiku-agent
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Launch with Cloud Providers
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# OpenAI (GPT-5.6 / GPT-4o)
|
|
130
75
|
npm run kiku-agent -- --provider openai --model gpt-5.6-luna
|
|
76
|
+
|
|
77
|
+
# Google Gemini (Gemini 3.7 Flash)
|
|
131
78
|
npm run kiku-agent -- --provider gemini --model gemini-3.7-flash
|
|
79
|
+
|
|
80
|
+
# Groq (Ultra-fast LPU inference)
|
|
132
81
|
npm run kiku-agent -- --provider groq --model openai/gpt-oss-120b
|
|
82
|
+
|
|
83
|
+
# DeepSeek (DeepSeek V4)
|
|
133
84
|
npm run kiku-agent -- --provider deepseek --model deepseek-v4-flash
|
|
85
|
+
|
|
86
|
+
# OpenRouter (Dynamic routing)
|
|
134
87
|
npm run kiku-agent -- --provider openrouter --model openrouter/auto
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### One-shot Question Query
|
|
138
|
-
```bash
|
|
139
|
-
npm run kiku-agent -- --query "ผลงานซีรีส์ปี 2026 มีเรื่องอะไรบ้างและรับบทเป็นใคร"
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Specify Custom Model or Base URL
|
|
143
|
-
```bash
|
|
144
|
-
npm run kiku-agent -- --model google/gemma-4-e4b-Q4_K_M --url http://127.0.0.1:1234/v1
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### CLI Flags
|
|
148
|
-
| Flag | Description |
|
|
149
|
-
|---|---|
|
|
150
|
-
| `-h`, `--help` | Show usage help |
|
|
151
|
-
| `-V`, `--version` | Print the installed package version and exit |
|
|
152
|
-
| `-P`, `--provider <name>` | Select active provider (`lmstudio`, `openai`, `gemini`, `groq`, `deepseek`, `openrouter`, `custom`) |
|
|
153
|
-
| `-k`, `--api-key <key>` | Specify API key for cloud provider |
|
|
154
|
-
| `-m`, `--model <id>` | Override model ID (e.g. `gpt-5.6-luna`, `google/gemma-4-e4b-Q4_K_M`) |
|
|
155
|
-
| `-u`, `--url <url>` | Override provider base URL |
|
|
156
|
-
| `-t`, `--tools` | List all registered tools |
|
|
157
|
-
| `-s`, `--stats` | Print catalog overview statistics |
|
|
158
|
-
| `-v`, `--verbose` | Verbose mode with reasoning shown |
|
|
159
|
-
| `--thinking [show\|hide]` | Toggle reasoning visibility |
|
|
160
|
-
| `-q`, `--query "<text>"` | One-shot query mode |
|
|
161
|
-
|
|
162
|
-
### Interactive Chat Slash Commands
|
|
163
|
-
|
|
164
|
-
Run `/help` inside a session for the full list. Commonly used:
|
|
165
|
-
|
|
166
|
-
- `/provider` — View active AI provider status, model, URL, and API key status
|
|
167
|
-
- `/provider list` — View all 7 supported AI providers and readiness status
|
|
168
|
-
- `/provider use <name> [model]` — Switch provider and model in a single command
|
|
169
|
-
- `/provider models [name]` — List curated active cost-effective models with pricing & context window
|
|
170
|
-
- `/provider info <name>` — Display developer documentation links, API references, and required ENV keys
|
|
171
|
-
- `/provider test [name]` — Test live endpoint connection and measure latency in milliseconds
|
|
172
|
-
- `/provider setkey <key>` — Dynamically set or update API key at runtime
|
|
173
|
-
- `/model` — Inspect active models currently loaded in LM Studio or cloud provider
|
|
174
|
-
- `/model list` — List loaded models from server alongside recommended models
|
|
175
|
-
- `/model recommend` — Show recommended active models for current provider
|
|
176
|
-
- `/model use <model-id>` — Switch runtime model without restarting the CLI
|
|
177
|
-
- `/model reconnect` — Recheck server and leave catalog-only mode after a chat model is loaded
|
|
178
|
-
- `/doctor` — Check Node, writable app data, LM Studio, model availability, FFmpeg, speaker, and yt-dlp
|
|
179
|
-
- `/update [check|install|channel|rollback]` — Manage npm-backed CLI and MCP package updates
|
|
180
|
-
- `/tools` — View all tool names and parameter descriptions
|
|
181
|
-
- `/find <query> [--type <type>] [--year YYYY]` — Search works, songs, roles, brands, awards, photos, and stages without a chat model; when an LLM is available it adds a short explanation of why the top results match your query
|
|
182
|
-
- `/compare <item-a> -- <item-b>` — Compare two catalog entries or two career years side by side; when an LLM is available it adds a natural-language summary of the differences
|
|
183
|
-
- `/favorites [list|add|remove|export|suggest]` — Build a persistent personal collection and export it as JSON or Markdown; `suggest` uses an LLM (when available) to recommend items that fit your saved taste
|
|
184
|
-
- `/news [topic] [--days N] [--official-only]` — Find recent source-backed coverage with available dates and URLs; when an LLM is available it adds a short desk-style summary of the results
|
|
185
|
-
- `/jobs [list|show|cancel|clear]` — Inspect and control research, verification, subagent, and suggestion jobs
|
|
186
|
-
- `/discover [drama|song|stage|photo]` — Pick a catalog recommendation with optional year and mood filters; when an LLM is available it also adds a short AI rationale for the pick (falls back to catalog-only offline)
|
|
187
|
-
- `/details [Qn]` — Open a compact diagnostic overview for the latest or selected question (F2 opens latest)
|
|
188
|
-
- `/details [Qn] answer|thinking|tools` — Inspect one diagnostic section without dumping every raw result
|
|
189
|
-
- `/details [Qn] tool <n>` — Inspect bounded raw arguments and result for one tool call
|
|
190
|
-
- `/stats` — Print summary counts of dramas, songs, brands, and awards; when an LLM is available it adds a one-line insight about the snapshot
|
|
191
|
-
- `/thinking [show|hide]` — Toggle reasoning process visibility
|
|
192
|
-
- `/save` — Export session transcript to Markdown file
|
|
193
|
-
- `/history` — Review conversation history
|
|
194
|
-
- `/theme` — Switch terminal color theme
|
|
195
|
-
- `/subagent <task>` — Send a focused Ju Jingyi research subtask to a bounded worker with catalog and web-research tools
|
|
196
|
-
- `/research <question>` — Coordinate catalog, current-web, and verification workers in parallel, then synthesize one sourced answer
|
|
197
|
-
- `/verify <claim>` — Classify a claim as verified, unverified, conflicting, or false
|
|
198
|
-
- `/sources` — Show the source URLs captured by the latest research run
|
|
199
|
-
- `/skill learn <instruction>` — Teach Kiku a persistent response preference, such as “ตอบภาษาไทยแบบสั้น กระชับ”
|
|
200
|
-
- `/skill list`, `/skill del <id>`, `/skill on|off`, `/skill clear` — Review and control learned response skills
|
|
201
|
-
- Music controls: `/play <song>`, `/stop`, `/pause`, `/resume`, `/next`, `/prev`, `/queue`, `/add <song>`, `/remove <n>`, `/clearqueue`, `/mute`, `/unmute`, `/current`
|
|
202
|
-
- `/clear` — Reset conversation history
|
|
203
|
-
- `/exit` — Exit the agent
|
|
204
|
-
|
|
205
|
-
##### AI-compatible commands
|
|
206
|
-
`/find`, `/compare`, `/favorites suggest`, `/news`, `/discover`, and `/stats` are **catalog-native + AI-enhanced**: they run fully in catalog-only mode with no model, and layer a short, bounded AI narration on top whenever a chat model is available. All AI output is sanitized (ANSI-injection-safe), length-capped, respects `/lang`, and **always** falls back silently to the plain result if the model is missing or errors — so the commands never crash or block in offline mode. Deliberately **not** AI-driven are commands that execute side effects or mutate config/credentials (`/tool`, `/mcp`, `/provider`, `/model`, `/key`, `/login`, `/play` & music controls, `/update`, `/copy`, `/exit`).
|
|
207
|
-
|
|
208
|
-
#### Memory & Session commands
|
|
209
|
-
- `/mem add <fact>` / `/mem search <query>` — Add to or search long-term memory
|
|
210
|
-
- `/mem list`, `/mem topics`, `/mem del <id>` — Review, summarize, or delete stored facts
|
|
211
|
-
- `/mem import <path>` / `/mem export` / `/mem clear` — Back up, restore, or reset memory
|
|
212
|
-
- `/session info|list|export|clear` — Manage the current session and its transcript
|
|
213
|
-
- `/history [n|search|clear]` — View or search prior conversation turns
|
|
214
|
-
- `/save` — Export the session transcript to a Markdown file
|
|
215
|
-
- `/copy [Qn] [answer|thinking|tools|all|markdown]` — Copy untruncated model output or diagnostics to the clipboard
|
|
216
|
-
|
|
217
|
-
#### Language & Appearance
|
|
218
|
-
- `/lang [th|zh|en|auto]` — Set the response language
|
|
219
|
-
- `/theme [name|list|current|reset]` — Switch or inspect the terminal color theme
|
|
220
|
-
- `/thinking [show|hide|toggle]` — Control reasoning-visibility
|
|
221
|
-
|
|
222
|
-
#### Diagnostics & System
|
|
223
|
-
- `/details [Qn] [overview|answer|thinking|tools|tool n]` — Inspect query diagnostics (F2 opens the latest)
|
|
224
|
-
- `/stats` — Print summary counts of the catalog database
|
|
225
|
-
- `/system` — Show OS, CPU, RAM, and heap information
|
|
226
|
-
- `/gpu [status]` — Show GPU & VRAM resource metrics (NVIDIA)
|
|
227
|
-
- `/ping` — Check active model server latency
|
|
228
|
-
- `/config` — Show runtime configuration
|
|
229
|
-
- `/prompt` — Preview the active system persona
|
|
230
|
-
- `/doctor` — Check first-run environment and optional features
|
|
231
|
-
- `/about` / `/version` — Show info and installed package version
|
|
232
|
-
|
|
233
|
-
#### Extras & Engagement
|
|
234
|
-
- `/gallery` — Render the next Ju Jingyi image directly in the terminal
|
|
235
|
-
- `/quiz [lang]` — Take the 15-question quiz; correctly completing it claims a Developer VIP Key
|
|
236
|
-
- `/key [show|apply <key>|clear]` — Manage your Developer VIP API Key
|
|
237
|
-
- `/ads` — Show the next sponsor card
|
|
238
|
-
- `/retry` — Retry the previous query
|
|
239
|
-
- `/cancel` — Abort the running query, tool, or subagent task
|
|
240
|
-
|
|
241
|
-
#### Research & Collection (advanced)
|
|
242
|
-
- `/suggestion [list|run <id|all>|auto|refresh|topic <name>]` — Auto-generate research prompts and execute them with concurrent subagents
|
|
243
|
-
- `/subagent <task>` — Run a single bounded Ju Jingyi research worker
|
|
244
|
-
- `/research <question|status|last|sources|cancel>` — Coordinate parallel catalog/web/verification workers and synthesize a sourced answer
|
|
245
|
-
- `/verify <claim>` — Classify a claim as verified, unverified, conflicting, or false
|
|
246
|
-
- `/sources` — Show source URLs captured by the latest research run
|
|
247
|
-
- `/jobs [list|show|cancel|clear]` — Inspect and control research, verification, subagent, and suggestion jobs
|
|
248
|
-
|
|
249
|
-
Examples:
|
|
250
|
-
|
|
251
|
-
```text
|
|
252
|
-
/find "In Blossom" --type work
|
|
253
|
-
/compare "In Blossom" -- "Beauty of Resilience"
|
|
254
|
-
/compare 2024 -- 2025
|
|
255
|
-
/favorites add song "Rain Love"
|
|
256
|
-
/favorites list --type song
|
|
257
|
-
/favorites export markdown
|
|
258
|
-
/news ซีรีส์ใหม่ --days 14 --official-only
|
|
259
|
-
/jobs list
|
|
260
|
-
/discover song --mood calm
|
|
261
|
-
/research "Ju Jingyi 2026 upcoming dramas"
|
|
262
|
-
/verify "Ju Jingyi is a Versace brand ambassador"
|
|
263
|
-
/suggestion auto
|
|
264
|
-
/subagent "List Ju Jingyi's fashion brand partnerships"
|
|
265
|
-
/skill learn "ตอบภาษาไทยแบบสั้น กระชับ"
|
|
266
|
-
/quiz lang th
|
|
267
|
-
/mem add "Ju Jingyi debuted with SNH48 in 2013"
|
|
268
88
|
```
|
|
269
89
|
|
|
270
90
|
---
|
|
271
|
-
|
|
272
|
-
##
|
|
273
|
-
|
|
274
|
-
**
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
|
294
|
-
|
|
295
|
-
|
|
|
296
|
-
|
|
|
297
|
-
|
|
|
298
|
-
|
|
|
299
|
-
| `
|
|
300
|
-
| `
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
91
|
+
|
|
92
|
+
## Features
|
|
93
|
+
|
|
94
|
+
- **Autonomous ReAct Agent**: Equipped with **45 validated tools** covering catalog knowledge, live web search, YouTube audio playback, filesystem inspection, and research workers.
|
|
95
|
+
- **Dynamic Multiline TUI & Instant Paste**: Terminal input area auto-expands up to 6 rows with continuation prefixes, `Shift+Enter` multiline editing, `Ctrl+V` clipboard paste, and bracketed paste batch rendering (pasting 5,000+ characters completes in <30ms without UI freezing).
|
|
96
|
+
- **Multi-Agent Adversarial Debate**: The `/debate` command orchestrates dialectic affirmative vs. negative agent workers to challenge factual claims against catalog records and synthesize evidence-backed truth matrices.
|
|
97
|
+
- **Smart Memory 2.0**: Long-term conversational memory (`/mem`) featuring TF-IDF keyword indexing, recency decay scoring, topic categorization, and JSON export/import.
|
|
98
|
+
- **Multi-Provider Engine**: Seamless switching between local LM Studio and 6 top cloud providers (OpenAI, Gemini, Groq, DeepSeek, OpenRouter, and custom OpenAI-compatible endpoints) with runtime health and latency diagnostics.
|
|
99
|
+
- **Local Audio Player**: YouTube streaming via `yt-dlp` and `ffmpeg` with play, pause, skip, track queueing, and mute/unmute controls.
|
|
100
|
+
- **Model Context Protocol (MCP)**: Official stdio (`kiku-mcp`) and Streamable HTTP endpoints exposing **43 tools**, **7 resources**, and **7 prompt templates** for Claude Desktop, Cursor, and VS Code.
|
|
101
|
+
- **Standalone Web Chat Portal**: Interactive browser chatbot (`/chat` or `/web` on port 3300) with character network visualization, mini Jukebox player, and direct catalog fallback.
|
|
102
|
+
- **Developer VIP Keys**: Integrated 15-question trivia quiz (`/quiz`) allowing users to test fan knowledge and earn Developer VIP API keys with elevated rate limits.
|
|
103
|
+
- **Rich Transcript Export**: `/save` and `/session export` output single-file self-contained HTML (with embedded CSS & dark mode), Markdown, JSON, or plain text.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## CLI Usage
|
|
108
|
+
|
|
109
|
+
### Command-Line Flags
|
|
110
|
+
|
|
111
|
+
| Flag | Description |
|
|
112
|
+
|---|---|
|
|
113
|
+
| `-h`, `--help` | Display usage instructions and options |
|
|
114
|
+
| `-V`, `--version` | Print installed package version |
|
|
115
|
+
| `-P`, `--provider <name>` | Select provider (`lmstudio`, `openai`, `gemini`, `groq`, `deepseek`, `openrouter`, `custom`) |
|
|
116
|
+
| `-k`, `--api-key <key>` | Cloud provider API key override |
|
|
117
|
+
| `-m`, `--model <id>` | Model ID override (e.g. `gpt-5.6-luna`, `gemini-3.7-flash`, `google/gemma-4-e4b`) |
|
|
118
|
+
| `-u`, `--url <url>` | Provider base URL override |
|
|
119
|
+
| `-t`, `--tools` | List all 45 registered tools |
|
|
120
|
+
| `-s`, `--stats` | Print catalog overview statistics |
|
|
121
|
+
| `-v`, `--verbose` | Verbose mode with reasoning output |
|
|
122
|
+
| `--thinking [show\|hide]` | Toggle visibility of reasoning process |
|
|
123
|
+
| `-q`, `--query "<text>"` | One-shot query mode |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Interactive Chat Slash Commands
|
|
128
|
+
|
|
129
|
+
Type `/help` inside any active session for the interactive command palette. Commands are organized by functional domain:
|
|
130
|
+
|
|
131
|
+
### 🤖 Provider & Model
|
|
132
|
+
- `/provider [list|use|models|info|test|setkey]` — Inspect, switch, and test AI providers, or set API keys at runtime
|
|
133
|
+
- `/model [list|recommend|use|reconnect]` — Switch models on the fly without restarting, or reconnect after starting LM Studio
|
|
134
|
+
|
|
135
|
+
### 🧠 Memory & Conversation Sessions
|
|
136
|
+
- `/mem [add|search|list|topics|summary|del|import|export|clear]` — Long-term conversational memory with TF-IDF keyword scoring & recency decay
|
|
137
|
+
- `/session [info|summary|list|load|export|clear]` — Manage, restore, or summarize conversation sessions
|
|
138
|
+
- `/history [n|search|summary|clear]` — Review and search past conversation turns
|
|
139
|
+
- `/save [markdown|html|json|text]` — Export session transcript (single-file HTML with dark mode, Markdown, JSON, plain text)
|
|
140
|
+
- `/copy [session|[Qn] [answer|thinking|tools|tool n|all|json]]` — Copy transcript, answers, or diagnostic info to clipboard
|
|
141
|
+
- `/clear` — Reset active conversation history
|
|
142
|
+
|
|
143
|
+
### 🔍 Catalog & Discovery
|
|
144
|
+
- `/find <query> [--type <type>] [--year YYYY]` — Search works, songs, roles, brands, awards, and stages (AI-enhanced)
|
|
145
|
+
- `/compare <item-a> -- <item-b>` — Side-by-side comparison of catalog items or career years (AI-enhanced)
|
|
146
|
+
- `/favorites [list|add|remove|export|suggest]` — Personal collection builder with AI recommendations
|
|
147
|
+
- `/discover [drama|song|stage|photo]` — Recommendations by type, year, and mood (AI-enhanced)
|
|
148
|
+
- `/news [topic] [--days N] [--official-only]` — Dated coverage and recent source-backed updates (AI-enhanced)
|
|
149
|
+
- `/stats` — Print summary counts of dramas, songs, brands, and awards (AI-enhanced)
|
|
150
|
+
- `/gallery` — Render Ju Jingyi images directly in the terminal
|
|
151
|
+
|
|
152
|
+
### 🔬 Research, Debate & Subagents (Advanced)
|
|
153
|
+
- `/debate <claim|status|last>` — Multi-agent adversarial debate with affirmative/negative roles and truth matrix synthesis
|
|
154
|
+
- `/timeline [year|era]` — Render career milestone ASCII timeline graphic in terminal
|
|
155
|
+
- `/subagent <task>` — Dispatch a bounded research subagent with catalog & web access
|
|
156
|
+
- `/research <question>` — Coordinate parallel catalog, web, and verification workers
|
|
157
|
+
- `/verify <claim>` — Classify a claim as verified, unverified, conflicting, or false
|
|
158
|
+
- `/suggestion [list|run|auto|refresh|topic]` — Auto-generate exploration prompts and execute them with subagents
|
|
159
|
+
- `/sources` — Show source URLs captured by the latest research run
|
|
160
|
+
- `/jobs [list|show|cancel|clear]` — Inspect and control background research jobs
|
|
161
|
+
- `/skill [learn|list|del|on|off|clear]` — Teach persistent response persona preferences across sessions
|
|
162
|
+
|
|
163
|
+
### 🎵 Music Player (Local Audio)
|
|
164
|
+
- `/play <song>` / `/stop` / `/pause` / `/resume` — YouTube audio streaming via yt-dlp & FFmpeg
|
|
165
|
+
- `/next` / `/prev` / `/queue` / `/add` / `/remove` / `/clearqueue` — Queue and track management
|
|
166
|
+
- `/mute` / `/unmute` / `/current` — Volume and playback status
|
|
167
|
+
|
|
168
|
+
### 🛠️ System, UI & Diagnostics
|
|
169
|
+
- `/doctor` — Diagnostic check for Node, app data, LM Studio, models, FFmpeg, speaker, and yt-dlp
|
|
170
|
+
- `/details [Qn]` — Diagnostic overview of answers, reasoning process, and bounded tool calls (F2)
|
|
171
|
+
- `/tools` — View all 45 registered tools with parameter descriptions
|
|
172
|
+
- `/lang [th|zh|en|auto]` — Set response language (Thai, Chinese, English)
|
|
173
|
+
- `/theme [name|list|current|next|prev|reset]` — Switch terminal color theme
|
|
174
|
+
- `/thinking [show|hide|toggle]` — Toggle reasoning process visibility
|
|
175
|
+
- `/system` / `/gpu` / `/ping` / `/config` — System info, NVIDIA GPU/VRAM monitor, server latency, and runtime config
|
|
176
|
+
- `/quiz [lang]` — 15-question fan trivia quiz to claim a Developer VIP API key
|
|
177
|
+
- `/key [show|apply <key>|clear]` — Manage Developer VIP API Key
|
|
178
|
+
- `/web [start|open|stop|status|restart] [port]` — Launch or open standalone Web Chat interface (port 3300)
|
|
179
|
+
- `/cancel` / `/retry` / `/exit` — Abort query, retry, or exit the agent
|
|
180
|
+
|
|
181
|
+
> [!NOTE]
|
|
182
|
+
> `/find`, `/compare`, `/favorites suggest`, `/news`, `/discover`, and `/stats` are **catalog-native + AI-enhanced**: they run in catalog-only mode without an LLM, and layer an AI summary on top whenever a model is active.
|
|
183
|
+
|
|
184
|
+
### Example CLI Workflows
|
|
185
|
+
|
|
186
|
+
```text
|
|
187
|
+
/find "In Blossom" --type work
|
|
188
|
+
/compare "In Blossom" -- "Beauty of Resilience"
|
|
189
|
+
/favorites add song "Rain Love"
|
|
190
|
+
/debate "Ju Jingyi debuted with SNH48 in 2013"
|
|
191
|
+
/timeline 2024
|
|
192
|
+
/research "Ju Jingyi 2026 upcoming dramas"
|
|
193
|
+
/skill learn "ตอบภาษาไทยแบบสั้น กระชับ"
|
|
194
|
+
/quiz lang th
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Available Agent Tools (45)
|
|
200
|
+
|
|
201
|
+
Kiku Agent includes **45 validated tools** across 5 categories that the agent autonomously invokes during conversations:
|
|
202
|
+
|
|
203
|
+
- **Catalog (14)**: Profile, fandom facts, quotes, filmography (2013–2026), character roles, discography, music videos, brands, career timeline, awards, Weibo/Douyin feeds, 4K gallery, and global fuzzy search.
|
|
204
|
+
- **Web & Network (6)**: Live DuckDuckGo search, article extraction, raw webpage fetch, JSON parser, page screenshots, and REST API querying.
|
|
205
|
+
- **Music Player (15)**: YouTube streaming via `yt-dlp` & `ffmpeg`, playlist queue management, track playback controls, and volume mute/unmute.
|
|
206
|
+
- **Filesystem & System (3)**: Directory listing, safe local file reader, and archive statistics.
|
|
207
|
+
- **Research, Skills & VIP (7)**: Autonomous research subagents, deep research coordinator, claim verification, topic suggestion, persistent skill learning, trivia quiz challenge, and Developer VIP key management.
|
|
208
|
+
|
|
209
|
+
> [!TIP]
|
|
210
|
+
> Run `/tools` inside the CLI or visit [`/api-docs`](https://jujingyi-kikuuu.vercel.app/api-docs) to inspect parameter schemas and test all tools interactively.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Multi-Provider Cloud & Local Models
|
|
215
|
+
|
|
216
|
+
`kiku-agent` natively supports local LM Studio inference alongside top Cloud AI Providers with official endpoints, active cost-effective models, and tool-calling capabilities:
|
|
217
|
+
|
|
218
|
+
| Provider | Recommended Active Models | Pricing / Cost Tier | Doc & API Reference | Required ENV Variable |
|
|
219
|
+
|---|---|---|---|---|
|
|
220
|
+
| **LM Studio** (Local) | `google/gemma-4-e4b` *(Q4_K_M, Q6_K, Q8_0)* | **100% Free / Local** (Zero token cost) | [Docs](https://lmstudio.ai/docs) • [API Ref](https://lmstudio.ai/docs/api/local-server) | `LMSTUDIO_BASE_URL` (default: `http://127.0.0.1:1234/v1`) |
|
|
328
221
|
| **OpenAI** | `gpt-5.6-luna` *(default)*, `gpt-5.6-terra`, `gpt-5.6-sol` | **Cost-sensitive → Flagship** ($0.20 - $4.00 / 1M input) | [Docs](https://developers.openai.com/api/docs/models) • [API Ref](https://developers.openai.com/api/reference) | `OPENAI_API_KEY` |
|
|
329
222
|
| **Google Gemini** | `gemini-3.7-flash` *(default)*, `gemini-3.5-flash-lite`, `gemini-3.6-flash` | **Free tier / Stable Flash** ($0.30 - $0.75 / 1M input) | [Docs](https://ai.google.dev/gemini-api/docs/models) • [API Ref](https://ai.google.dev/api/generate-content) | `GEMINI_API_KEY` |
|
|
330
223
|
| **Groq** | `openai/gpt-oss-120b` *(default)*, `openai/gpt-oss-20b` | **LPU Ultra-Fast** ($0.075 - $0.15 / 1M input) | [Docs](https://console.groq.com/docs/quickstart) • [API Ref](https://console.groq.com/docs/api-reference) | `GROQ_API_KEY` |
|
|
331
224
|
| **DeepSeek** | `deepseek-v4-flash` *(default)*, `deepseek-v4-pro` | **V4 / 1M context** ($0.22 - $1.32 / 1M uncached input) | [Docs](https://api-docs.deepseek.com/quick_start/pricing/) • [API Ref](https://api-docs.deepseek.com/api/create-chat-completion) | `DEEPSEEK_API_KEY` |
|
|
332
225
|
| **OpenRouter** | `openrouter/auto` *(default, dynamic catalog)* | **Automatic routing** (billed at routed model rate) | [Docs](https://openrouter.ai/docs/guides/routing/routers/auto-router) • [API Ref](https://openrouter.ai/docs/api/reference/overview) | `OPENROUTER_API_KEY` |
|
|
333
|
-
| **Custom Gateway** | Any OpenAI-compatible server (vLLM, Ollama, TGI, Azure) | **Custom** | [OpenAI Spec](https://platform.openai.com/docs/api-reference) | `LLM_BASE_URL`, `LLM_API_KEY` |
|
|
334
|
-
|
|
335
|
-
```bash
|
|
336
|
-
#
|
|
337
|
-
|
|
338
|
-
npm run kiku-agent -- --provider gemini --model gemini-3.7-flash
|
|
339
|
-
npm run kiku-agent -- --provider groq --model openai/gpt-oss-120b
|
|
340
|
-
npm run kiku-agent -- --provider deepseek --model deepseek-v4-flash
|
|
341
|
-
npm run kiku-agent -- --provider openrouter --model openrouter/auto
|
|
342
|
-
|
|
343
|
-
# Manage providers interactively within the agent CLI
|
|
344
|
-
/provider list # View all 7 providers and key status
|
|
226
|
+
| **Custom Gateway** | Any OpenAI-compatible server (vLLM, Ollama, TGI, Azure) | **Custom** | [OpenAI Spec](https://platform.openai.com/docs/api-reference) | `LLM_BASE_URL`, `LLM_API_KEY` |
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# Manage providers interactively within the agent CLI:
|
|
230
|
+
/provider list # View all 7 providers and key status
|
|
345
231
|
/provider use groq openai/gpt-oss-120b # Switch provider and model in one command
|
|
346
|
-
/provider models gemini # List curated cost-effective models with pricing & context
|
|
347
|
-
/provider info openai # Show developer documentation & API details
|
|
348
|
-
/provider test groq # Test live endpoint connection and measure latency
|
|
349
|
-
/provider setkey groq gsk-... # Set or update API key dynamically at runtime
|
|
350
|
-
/model recommend # View recommended models for active provider
|
|
232
|
+
/provider models gemini # List curated cost-effective models with pricing & context
|
|
233
|
+
/provider info openai # Show developer documentation & API details
|
|
234
|
+
/provider test groq # Test live endpoint connection and measure latency
|
|
235
|
+
/provider setkey groq gsk-... # Set or update API key dynamically at runtime
|
|
236
|
+
/model recommend # View recommended models for active provider
|
|
351
237
|
/model use gpt-5.6-luna # Switch active model on current provider
|
|
352
238
|
```
|
|
353
239
|
|
|
354
|
-
At interactive startup, provider switches, and before a one-shot query, the CLI checks the provider's live `/models` catalog. If a configured model has been retired, it selects the first available model from that provider's maintained recommendation list and reports the fallback. Legacy IDs for Groq, DeepSeek, and selected renamed models are normalized automatically.
|
|
355
|
-
|
|
356
|
-
---
|
|
357
|
-
|
|
358
|
-
## 🔌 Model Context Protocol (MCP)
|
|
359
|
-
|
|
360
|
-
### 1. MCP Server (`kiku-mcp`)
|
|
361
|
-
The package ships a Model Context Protocol server exposing the catalog as tools, resources, and prompts:
|
|
362
|
-
```bash
|
|
363
|
-
# stdio transport (Claude Desktop, Cursor, ...)
|
|
364
|
-
npm run kiku-mcp
|
|
365
|
-
```
|
|
366
|
-
The production deployment exposes a stateless Streamable HTTP endpoint at `https://jujingyi-kikuuu.vercel.app/mcp` (`POST /mcp`). The server offers catalog tools (`search_works`, `get_work_detail`, `search_discography`, `get_brand_endorsements`, `get_awards`, `get_career_timeline`, `global_search`, …), resources, and prompts — see `server/mcp/`.
|
|
367
|
-
|
|
368
|
-
**HTTP security** — the remote MCP endpoint is guarded by a bearer token and CORS allow-list:
|
|
369
|
-
- Set `MCP_API_KEY` to require `Authorization: Bearer <MCP_API_KEY>` on `POST /mcp`.
|
|
370
|
-
- Set `MCP_CORS_ORIGINS` to a comma-separated list of allowed browser origins (empty = no CORS).
|
|
371
|
-
|
|
372
|
-
```bash
|
|
373
|
-
# Example: curl the Streamable HTTP endpoint
|
|
374
|
-
curl -X POST https://jujingyi-kikuuu.vercel.app/mcp \
|
|
375
|
-
-H "Authorization: Bearer $MCP_API_KEY" \
|
|
376
|
-
-H "Content-Type: application/json" \
|
|
377
|
-
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
### 2. MCP Client in `kiku-agent`
|
|
381
|
-
`kiku-agent` can connect to external MCP servers (Streamable HTTP, Stdio) and dynamically load their tools:
|
|
382
|
-
```bash
|
|
383
|
-
# Connect to an MCP server from CLI:
|
|
384
|
-
/mcp connect kiku-remote https://jujingyi-kikuuu.vercel.app/mcp
|
|
385
|
-
/mcp connect filesystem stdio npx -y @modelcontextprotocol/server-filesystem ./
|
|
386
|
-
/mcp tools
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
`/mcp` shows the connection summary plus every available MCP tool command in a compact list. `/mcp tools` expands the same list with parameters and descriptions. Long command panels open at their first page in the classic TUI; use Page Down or End to continue through the result. Manage persistent connections with `/mcp status|list|disconnect <name>|remove <name>|reconnect [all]|save|reload`.
|
|
390
|
-
|
|
391
|
-
> **Note on web tools:** MCP web tools are gated behind `KIKU_MCP_ENABLE_WEB_TOOLS=true`.
|
|
392
|
-
|
|
393
|
-
---
|
|
394
|
-
|
|
395
|
-
## ⚙️ Environment Variables
|
|
396
|
-
|
|
397
|
-
Copy `.env.example` → `.env` (parsed automatically when the CLI runs; only unset variables are filled):
|
|
398
|
-
|
|
399
|
-
| Variable | Purpose |
|
|
400
|
-
|---|---|
|
|
401
|
-
| `LLM_PROVIDER` | Active provider override (`openai`, `openrouter`, `groq`, `deepseek`, `gemini`, `lmstudio`, `custom`) |
|
|
402
|
-
| `OPENAI_API_KEY` | OpenAI API Key |
|
|
403
|
-
| `OPENROUTER_API_KEY` | OpenRouter API Key |
|
|
404
|
-
| `GROQ_API_KEY` | Groq Cloud API Key |
|
|
405
|
-
| `DEEPSEEK_API_KEY` | DeepSeek API Key |
|
|
406
|
-
| `GEMINI_API_KEY` | Google Gemini API Key |
|
|
407
|
-
| `LMSTUDIO_BASE_URL` | LM Studio endpoint (default `http://127.0.0.1:1234/v1`) |
|
|
408
|
-
| `KIKU_YT_COOKIES` | Path to a `cookies.txt` file for YouTube playback |
|
|
409
|
-
| `KIKU_YT_BROWSER` | Import cookies from a browser (`chrome`, `edge`, `firefox`) |
|
|
410
|
-
| `KIKU_YTDLP` | Path/command for yt-dlp binary (default `yt-dlp`) |
|
|
411
|
-
| `KIKU_YTDLP_CLIENT` | YouTube player client override (`tv`, `ios`, `web`) |
|
|
412
|
-
| `MCP_API_KEY` | Bearer token required by the HTTP MCP endpoint (`POST /mcp`) |
|
|
413
|
-
| `MCP_CORS_ORIGINS` | Comma-separated allowed origins for browser MCP calls |
|
|
414
|
-
| `KIKU_MCP_ENABLE_WEB_TOOLS` | Set `true` to enable web tools in the MCP server |
|
|
415
|
-
| `KIKU_API_KEYS` | Pre-seeded REST API keys (higher rate limits) |
|
|
416
|
-
| `KIKU_VIP_KEYS` | Pre-seeded Developer VIP API keys (highest rate limits) |
|
|
417
|
-
|
|
418
|
-
> `.env` is gitignored — never commit it. The checked-in `.env.example` contains placeholders only.
|
|
419
|
-
> Likewise, `cookies.txt` at the repo root contains real YouTube session cookies and must never be staged.
|
|
420
|
-
|
|
421
|
-
---
|
|
422
|
-
|
|
423
|
-
## 🧭 Web App & API Development
|
|
424
|
-
|
|
425
|
-
### Frontend (Vite + React 19 + Tailwind 4)
|
|
426
|
-
```bash
|
|
427
|
-
# Start frontend dev server (API v1 works in-process)
|
|
428
|
-
npm run dev
|
|
429
|
-
|
|
430
|
-
# Production build
|
|
431
|
-
npm run build
|
|
432
|
-
```
|
|
433
|
-
The SPA lives in `src/` (entry `src/App.jsx`) and is state-navigated via `NavigationContext` (no react-router). All non-API paths rewrite to `/` in `vercel.json`.
|
|
434
|
-
|
|
435
|
-
### REST API v1
|
|
436
|
-
The API is a single framework-free Node handler in `server/apiRouter.js` (~2000 lines) serving every `/api/v1/*` route plus interactive docs and an OpenAPI spec.
|
|
437
|
-
|
|
438
|
-
- **Base URL (prod):** `https://jujingyi-kikuuu.vercel.app/api/v1`
|
|
439
|
-
- **Base URL (dev):** `http://localhost:3000/api/v1`
|
|
440
|
-
- **Interactive docs:** `https://jujingyi-kikuuu.vercel.app/api-docs`
|
|
441
|
-
- **OpenAPI 3.0 JSON:** `https://jujingyi-kikuuu.vercel.app/api/v1/openapi.json`
|
|
442
|
-
- **Health check:** `GET /api/v1/health`
|
|
443
|
-
|
|
444
|
-
```bash
|
|
445
|
-
|
|
446
240
|
---
|
|
447
241
|
|
|
448
|
-
##
|
|
242
|
+
## Model Context Protocol (MCP)
|
|
449
243
|
|
|
450
244
|
### 1. MCP Server (`kiku-mcp`)
|
|
451
|
-
|
|
245
|
+
|
|
246
|
+
The package ships an official Model Context Protocol server exposing the Ju Jingyi encyclopedia as **43 tools**, **7 resources**, and **7 prompt templates**:
|
|
247
|
+
|
|
452
248
|
```bash
|
|
453
|
-
#
|
|
454
|
-
|
|
249
|
+
# Stdio transport (Claude Desktop, Cursor, VS Code)
|
|
250
|
+
kiku-mcp
|
|
251
|
+
|
|
252
|
+
# Zero-install via npx:
|
|
253
|
+
npx -y kiku-agent kiku-mcp
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
#### Claude Desktop & Cursor Integration
|
|
257
|
+
|
|
258
|
+
Add the following snippet to your `claude_desktop_config.json` or Cursor MCP configuration:
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"mcpServers": {
|
|
263
|
+
"kiku": {
|
|
264
|
+
"command": "npx",
|
|
265
|
+
"args": ["-y", "kiku-agent", "kiku-mcp"]
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
455
269
|
```
|
|
456
|
-
The production deployment exposes a stateless Streamable HTTP endpoint at `https://jujingyi-kikuuu.vercel.app/mcp` (`POST /mcp`). The server offers catalog tools (`search_works`, `get_work_detail`, `search_discography`, `get_brand_endorsements`, `get_awards`, `get_career_timeline`, `global_search`, …), resources, and prompts — see `server/mcp/`.
|
|
457
270
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
271
|
+
The production deployment exposes a stateless Streamable HTTP endpoint at `https://jujingyi-kikuuu.vercel.app/mcp` (`POST /mcp`).
|
|
272
|
+
|
|
273
|
+
> [!IMPORTANT]
|
|
274
|
+
> **HTTP Security**: The remote MCP endpoint is guarded by a bearer token and CORS allow-list:
|
|
275
|
+
> - Set `MCP_API_KEY` to require `Authorization: Bearer <MCP_API_KEY>` on `POST /mcp`.
|
|
276
|
+
> - Set `MCP_CORS_ORIGINS` to a comma-separated list of allowed browser origins (empty = no CORS).
|
|
461
277
|
|
|
462
278
|
```bash
|
|
463
279
|
# Example: curl the Streamable HTTP endpoint
|
|
@@ -468,21 +284,19 @@ curl -X POST https://jujingyi-kikuuu.vercel.app/mcp \
|
|
|
468
284
|
```
|
|
469
285
|
|
|
470
286
|
### 2. MCP Client in `kiku-agent`
|
|
287
|
+
|
|
471
288
|
`kiku-agent` can connect to external MCP servers (Streamable HTTP, Stdio) and dynamically load their tools:
|
|
289
|
+
|
|
472
290
|
```bash
|
|
473
|
-
# Connect to an MCP server from CLI:
|
|
291
|
+
# Connect to an MCP server from the CLI:
|
|
474
292
|
/mcp connect kiku-remote https://jujingyi-kikuuu.vercel.app/mcp
|
|
475
293
|
/mcp connect filesystem stdio npx -y @modelcontextprotocol/server-filesystem ./
|
|
476
294
|
/mcp tools
|
|
477
295
|
```
|
|
478
296
|
|
|
479
|
-
`/mcp` shows the connection summary plus every available MCP tool command in a compact list. `/mcp tools` expands the same list with parameters and descriptions. Long command panels open at their first page in the classic TUI; use Page Down or End to continue through the result. Manage persistent connections with `/mcp status|list|disconnect <name>|remove <name>|reconnect [all]|save|reload`.
|
|
480
|
-
|
|
481
|
-
> **Note on web tools:** MCP web tools are gated behind `KIKU_MCP_ENABLE_WEB_TOOLS=true`.
|
|
482
|
-
|
|
483
297
|
---
|
|
484
298
|
|
|
485
|
-
##
|
|
299
|
+
## Environment Variables
|
|
486
300
|
|
|
487
301
|
Copy `.env.example` → `.env` (parsed automatically when the CLI runs; only unset variables are filled):
|
|
488
302
|
|
|
@@ -505,14 +319,16 @@ Copy `.env.example` → `.env` (parsed automatically when the CLI runs; only uns
|
|
|
505
319
|
| `KIKU_API_KEYS` | Pre-seeded REST API keys (higher rate limits) |
|
|
506
320
|
| `KIKU_VIP_KEYS` | Pre-seeded Developer VIP API keys (highest rate limits) |
|
|
507
321
|
|
|
322
|
+
> [!CAUTION]
|
|
508
323
|
> `.env` is gitignored — never commit it. The checked-in `.env.example` contains placeholders only.
|
|
509
|
-
> Likewise, `cookies.txt` at the repo root contains real YouTube session cookies and must never be staged.
|
|
324
|
+
> Likewise, `cookies.txt` at the repo root contains real YouTube session cookies and must never be staged or committed.
|
|
510
325
|
|
|
511
326
|
---
|
|
512
327
|
|
|
513
|
-
##
|
|
328
|
+
## Web App & REST API
|
|
514
329
|
|
|
515
330
|
### Frontend (Vite + React 19 + Tailwind 4)
|
|
331
|
+
|
|
516
332
|
```bash
|
|
517
333
|
# Start frontend dev server (API v1 works in-process)
|
|
518
334
|
npm run dev
|
|
@@ -520,83 +336,72 @@ npm run dev
|
|
|
520
336
|
# Production build
|
|
521
337
|
npm run build
|
|
522
338
|
```
|
|
523
|
-
|
|
339
|
+
|
|
340
|
+
The SPA lives in `src/` (entry `src/App.jsx`) and uses state-based navigation via `NavigationContext` (no react-router). All non-API paths rewrite to `/` in `vercel.json`.
|
|
524
341
|
|
|
525
342
|
### REST API v1
|
|
526
|
-
|
|
343
|
+
|
|
344
|
+
The API is a single framework-free Node handler in `server/apiRouter.js` (~2000 lines) serving every `/api/v1/*` route plus OpenAPI specifications and interactive documentation:
|
|
527
345
|
|
|
528
346
|
- **Base URL (prod):** `https://jujingyi-kikuuu.vercel.app/api/v1`
|
|
529
|
-
- **Base URL (dev):** `http://localhost:3000/api/v1`
|
|
347
|
+
- **Base URL (dev):** `http://localhost:3000/api/v1` *(or dynamically assigned port e.g. 5173)*
|
|
530
348
|
- **Interactive docs:** `https://jujingyi-kikuuu.vercel.app/api-docs`
|
|
531
349
|
- **OpenAPI 3.0 JSON:** `https://jujingyi-kikuuu.vercel.app/api/v1/openapi.json`
|
|
532
350
|
- **Health check:** `GET /api/v1/health`
|
|
351
|
+
- **Web Chat:** `https://jujingyi-kikuuu.vercel.app/chat` *(or local `/web` on port 3300)*
|
|
533
352
|
|
|
534
353
|
```bash
|
|
535
354
|
curl https://jujingyi-kikuuu.vercel.app/api/v1/health
|
|
536
355
|
```
|
|
537
356
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
In production `/api/*` is served by the Vercel serverless wrapper.
|
|
357
|
+
#### 🌟 Kiku Agent Showcase on `/api-docs`
|
|
541
358
|
|
|
542
|
-
|
|
359
|
+
The interactive `/api-docs` portal features a dedicated **Kiku AI Agent & MCP Ecosystem Showcase** card:
|
|
360
|
+
- One-click copyable global CLI installation (`npm install -g kiku-agent`, `kiku-agent`).
|
|
361
|
+
- Zero-install one-shot command (`npx kiku-agent --query "..."`).
|
|
362
|
+
- Instant MCP server commands (`kiku-mcp`) and ready-to-paste `claude_desktop_config.json` / Cursor JSON snippets.
|
|
363
|
+
- Direct links to npm, GitHub, and the live Web Chat interface.
|
|
543
364
|
|
|
544
|
-
|
|
545
|
-
- **Packaging**: `package.json` `"files"` ships `src/data/**/*.js` because the agent imports them — don't move that directory without updating both `"files"` and every importer. Bins are `kiku-agent` and `kiku-mcp`; package exports map `.` → `server/agent/agentCore.js`.
|
|
546
|
-
- **Path aliases**: the `@/*` alias in `jsconfig.json` is unused — use relative imports everywhere (no matching alias in `vite.config.js`).
|
|
547
|
-
- **No linter/formatter/typecheck**: verification is `npm test` plus a successful build. CI (GitHub Actions) only runs Snyk + secret scanning.
|
|
365
|
+
Endpoint groups include catalog (works, discography, brands, awards, timeline, profile, gallery), stats, quiz challenges and Developer VIP key claiming (`/api/v1/quiz/challenge`, `/api/v1/keys/claim`), plus agent/REST integration. `?key=` or bearer auth with a `KIKU_API_KEYS` / `KIKU_VIP_KEYS` value unlocks higher rate limits.
|
|
548
366
|
|
|
549
367
|
---
|
|
550
368
|
|
|
551
|
-
##
|
|
369
|
+
## Data Architecture & Gotchas
|
|
552
370
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
│ │ # research/subagent/verify, suggestions, job manager,
|
|
564
|
-
│ │ # audio player, MCP client, model/provider manager, …
|
|
565
|
-
│ ├── mcp/ # MCP server (stdio.js) + compact English catalog data
|
|
566
|
-
│ └── supabase_schema.sql # Optional SQL for a hosted database
|
|
567
|
-
├── api/ # Vercel serverless wrappers (delegate to apiRouter)
|
|
568
|
-
├── test_api.ps1 # API verification suite
|
|
569
|
-
└── .env.example # Environment variable template
|
|
570
|
-
```
|
|
371
|
+
> [!IMPORTANT]
|
|
372
|
+
> **Dual Catalog Notice**: The catalog data lives in two independent copies with the same export names but different contents:
|
|
373
|
+
> - `src/data/*.js` (used by the SPA, REST API, and agent tools): Rich, Thai-heavy.
|
|
374
|
+
> - `server/mcp/data/*.js` (used by the MCP server): Compact English.
|
|
375
|
+
>
|
|
376
|
+
> **Any catalog change must be applied to both trees**, or MCP answers will drift from the site/API.
|
|
377
|
+
|
|
378
|
+
- **Packaging**: `package.json` `"files"` ships `src/data/**/*.js` because the agent imports them — don't move that directory without updating both `"files"` and every importer. Bins are `kiku-agent` and `kiku-mcp`; package exports map `.` → `server/agent/agentCore.js`.
|
|
379
|
+
- **Path aliases**: The `@/*` alias in `jsconfig.json` is unused — use relative imports everywhere (no matching alias in `vite.config.js`).
|
|
380
|
+
- **Testing & Verification**: There is no linter or typechecker setup. Verification is `npm test` (running 330 unit/integration tests) plus `npm run build`.
|
|
571
381
|
|
|
572
382
|
---
|
|
573
383
|
|
|
574
|
-
##
|
|
384
|
+
## Troubleshooting
|
|
575
385
|
|
|
576
386
|
**Agent won't start or stays in catalog-only mode**
|
|
577
|
-
- Ensure LM Studio is running with a Gemma model loaded and the local server on `127.0.0.1:1234`, or
|
|
578
|
-
- Run `/doctor` inside the session to diagnose Node, app data, LM Studio, model, FFmpeg, speaker, and yt-dlp availability.
|
|
579
|
-
|
|
580
|
-
**Windows install
|
|
581
|
-
- Close
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
387
|
+
- Ensure LM Studio is running with a Gemma model loaded and the local server started on `127.0.0.1:1234`, or specify a cloud provider with `-P <provider> -k <key>`.
|
|
388
|
+
- Run `/doctor` inside the session to diagnose Node, app data, LM Studio, model, FFmpeg, speaker, and yt-dlp availability.
|
|
389
|
+
|
|
390
|
+
**Windows install reports `EBUSY` for `ffmpeg-static`**
|
|
391
|
+
- Close all active terminal windows running Node or Kiku. In a fresh PowerShell window:
|
|
392
|
+
```powershell
|
|
393
|
+
npm uninstall -g kiku-agent
|
|
394
|
+
$stale = Join-Path (npm root -g) 'kiku-agent'
|
|
395
|
+
if (Test-Path $stale) { Remove-Item -Recurse -Force $stale }
|
|
396
|
+
npm cache verify
|
|
397
|
+
npm install -g kiku-agent
|
|
398
|
+
```
|
|
585
399
|
|
|
586
400
|
**YouTube playback fails**
|
|
587
401
|
- Re-authenticate with `/login`, or point `KIKU_YT_COOKIES` / `KIKU_YT_BROWSER` at a valid session and `KIKU_YTDLP` at a working yt-dlp binary. Some regions/clients need `KIKU_YTDLP_CLIENT` set to `tv` or `ios`.
|
|
588
402
|
|
|
589
|
-
**Remote MCP returns 401**
|
|
590
|
-
- Set `MCP_API_KEY` on the server and send `Authorization: Bearer <MCP_API_KEY
|
|
591
|
-
|
|
592
|
-
**MCP answers disagree with the site/API**
|
|
593
|
-
- The catalog lives in two copies (`src/data` vs `server/mcp/data`). Update both trees whenever a fact changes.
|
|
403
|
+
**Remote MCP returns 401 Unauthorized**
|
|
404
|
+
- Set `MCP_API_KEY` on the server and send `Authorization: Bearer <MCP_API_KEY>`. For browser clients, set `MCP_CORS_ORIGINS` to the allowed origins.
|
|
594
405
|
|
|
595
406
|
**Reports of missing or stale model after switching providers**
|
|
596
|
-
- The CLI
|
|
597
|
-
|
|
598
|
-
---
|
|
599
|
-
|
|
600
|
-
## 📄 License
|
|
601
|
-
|
|
602
|
-
This project is licensed under the [GNU General Public License v3.0 (GPL-3.0)](LICENSE).
|
|
407
|
+
- The CLI automatically queries the provider's live `/models` endpoint at startup, on provider switches, and before one-shot queries, falling back gracefully to recommended active models if a configured model was retired.
|