sanook-cli 0.5.1 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/.env.example +161 -3
  2. package/CHANGELOG.md +148 -10
  3. package/README.md +255 -26
  4. package/README.th.md +95 -7
  5. package/dist/approval.js +13 -0
  6. package/dist/bin.js +3552 -155
  7. package/dist/brain-consolidate.js +335 -0
  8. package/dist/brain-context.js +262 -0
  9. package/dist/brain-doctor.js +318 -0
  10. package/dist/brain-eval.js +186 -0
  11. package/dist/brain-final.js +377 -0
  12. package/dist/brain-metrics.js +277 -0
  13. package/dist/brain-new.js +402 -0
  14. package/dist/brain-pack.js +210 -0
  15. package/dist/brain-repair.js +280 -0
  16. package/dist/brain-review.js +382 -0
  17. package/dist/brain.js +15 -1
  18. package/dist/brand.js +1 -1
  19. package/dist/cli-args.js +190 -0
  20. package/dist/cli-option-values.js +16 -0
  21. package/dist/clipboard.js +65 -0
  22. package/dist/commands.js +266 -27
  23. package/dist/compaction.js +96 -11
  24. package/dist/config.js +149 -33
  25. package/dist/context-compression.js +191 -0
  26. package/dist/context-pack.js +145 -0
  27. package/dist/cost.js +49 -15
  28. package/dist/dashboard/api-helpers.js +87 -0
  29. package/dist/dashboard/server.js +179 -0
  30. package/dist/dashboard/static/app.js +277 -0
  31. package/dist/dashboard/static/index.html +39 -0
  32. package/dist/dashboard/static/styles.css +85 -0
  33. package/dist/diff.js +10 -2
  34. package/dist/first-run.js +21 -0
  35. package/dist/gateway/auth.js +49 -9
  36. package/dist/gateway/bluebubbles.js +205 -0
  37. package/dist/gateway/config.js +929 -0
  38. package/dist/gateway/deliver.js +399 -0
  39. package/dist/gateway/discord.js +124 -0
  40. package/dist/gateway/doctor.js +456 -0
  41. package/dist/gateway/email.js +501 -0
  42. package/dist/gateway/googlechat.js +207 -0
  43. package/dist/gateway/homeassistant.js +256 -0
  44. package/dist/gateway/ledger.js +38 -1
  45. package/dist/gateway/line.js +171 -0
  46. package/dist/gateway/lock.js +3 -1
  47. package/dist/gateway/matrix.js +366 -0
  48. package/dist/gateway/mattermost.js +322 -0
  49. package/dist/gateway/ntfy.js +218 -0
  50. package/dist/gateway/schedule.js +31 -4
  51. package/dist/gateway/serve.js +267 -7
  52. package/dist/gateway/server.js +253 -19
  53. package/dist/gateway/service.js +224 -0
  54. package/dist/gateway/session.js +362 -0
  55. package/dist/gateway/signal.js +351 -0
  56. package/dist/gateway/slack.js +124 -0
  57. package/dist/gateway/sms.js +169 -0
  58. package/dist/gateway/targets.js +576 -0
  59. package/dist/gateway/teams.js +106 -0
  60. package/dist/gateway/telegram.js +38 -15
  61. package/dist/gateway/webhooks.js +220 -0
  62. package/dist/gateway/whatsapp.js +230 -0
  63. package/dist/hooks.js +13 -2
  64. package/dist/hotkeys.js +21 -0
  65. package/dist/i18n/en.js +98 -0
  66. package/dist/i18n/index.js +19 -0
  67. package/dist/i18n/th.js +98 -0
  68. package/dist/i18n/types.js +1 -0
  69. package/dist/insights-args.js +55 -0
  70. package/dist/insights.js +86 -0
  71. package/dist/knowledge.js +55 -29
  72. package/dist/loop.js +157 -29
  73. package/dist/lsp/index.js +23 -5
  74. package/dist/mcp-hub.js +33 -0
  75. package/dist/mcp-registry.js +494 -0
  76. package/dist/mcp-risk.js +71 -0
  77. package/dist/mcp-server.js +1 -1
  78. package/dist/mcp.js +120 -10
  79. package/dist/memory-log.js +90 -0
  80. package/dist/memory-store.js +37 -1
  81. package/dist/memory.js +148 -37
  82. package/dist/model-picker.js +58 -0
  83. package/dist/orchestrate.js +51 -19
  84. package/dist/personality.js +58 -0
  85. package/dist/plan-handoff.js +17 -0
  86. package/dist/polyglot.js +162 -0
  87. package/dist/process-runner.js +96 -0
  88. package/dist/project-init.js +91 -0
  89. package/dist/project-registry.js +143 -0
  90. package/dist/project-scaffold.js +124 -0
  91. package/dist/prompt-size.js +155 -0
  92. package/dist/providers/codex-login.js +138 -0
  93. package/dist/providers/codex.js +89 -43
  94. package/dist/providers/keys.js +22 -1
  95. package/dist/providers/models.js +2 -2
  96. package/dist/providers/registry.js +14 -47
  97. package/dist/search/chunk.js +7 -8
  98. package/dist/search/cli.js +83 -0
  99. package/dist/search/embed-store.js +3 -0
  100. package/dist/search/embedding-config.js +22 -0
  101. package/dist/search/engine.js +2 -13
  102. package/dist/search/indexer.js +44 -1
  103. package/dist/search/store.js +23 -1
  104. package/dist/session-distill.js +84 -0
  105. package/dist/session.js +92 -16
  106. package/dist/skill-install.js +53 -13
  107. package/dist/skills.js +33 -0
  108. package/dist/slash-completion.js +155 -0
  109. package/dist/support-dump.js +206 -0
  110. package/dist/tool-catalog.js +59 -0
  111. package/dist/tools/edit.js +45 -15
  112. package/dist/tools/git.js +10 -5
  113. package/dist/tools/homeassistant.js +106 -0
  114. package/dist/tools/index.js +10 -0
  115. package/dist/tools/list.js +19 -6
  116. package/dist/tools/permission.js +992 -12
  117. package/dist/tools/polyglot.js +126 -0
  118. package/dist/tools/read.js +16 -4
  119. package/dist/tools/sandbox.js +38 -13
  120. package/dist/tools/schedule.js +19 -3
  121. package/dist/tools/search.js +226 -15
  122. package/dist/tools/task.js +40 -9
  123. package/dist/tools/timeout.js +23 -3
  124. package/dist/tools/web-fetch-tool.js +33 -0
  125. package/dist/trust.js +11 -1
  126. package/dist/turn-retrieval.js +83 -0
  127. package/dist/ui/app.js +878 -32
  128. package/dist/ui/banner.js +78 -4
  129. package/dist/ui/history.js +37 -5
  130. package/dist/ui/markdown.js +122 -0
  131. package/dist/ui/mentions.js +3 -2
  132. package/dist/ui/overlay.js +496 -0
  133. package/dist/ui/queue.js +23 -0
  134. package/dist/ui/render.js +20 -1
  135. package/dist/ui/session-panel.js +115 -0
  136. package/dist/ui/setup-providers.js +40 -0
  137. package/dist/ui/setup.js +172 -46
  138. package/dist/ui/status.js +142 -0
  139. package/dist/ui/thinking-panel.js +36 -0
  140. package/dist/ui/tool-trail.js +97 -0
  141. package/dist/ui/transcript.js +26 -0
  142. package/dist/ui/useBusyElapsed.js +19 -0
  143. package/dist/ui/useEditor.js +144 -5
  144. package/dist/ui/useGitBranch.js +57 -0
  145. package/dist/update.js +56 -17
  146. package/dist/web-fetch.js +637 -0
  147. package/dist/web-surface.js +190 -0
  148. package/dist/worktree.js +175 -4
  149. package/package.json +5 -5
  150. package/second-brain/AGENTS.md +6 -4
  151. package/second-brain/CLAUDE.md +7 -1
  152. package/second-brain/Evals/_Index.md +10 -2
  153. package/second-brain/Evals/quality-ledger.md +9 -1
  154. package/second-brain/Evals/second-brain-benchmarks.md +62 -0
  155. package/second-brain/GEMINI.md +5 -4
  156. package/second-brain/Home.md +1 -1
  157. package/second-brain/Projects/_Index.md +19 -4
  158. package/second-brain/Projects/sanook-cli/_Index.md +30 -0
  159. package/second-brain/Projects/sanook-cli/context.md +35 -0
  160. package/second-brain/Projects/sanook-cli/current-state.md +32 -0
  161. package/second-brain/Projects/sanook-cli/overview.md +41 -0
  162. package/second-brain/Projects/sanook-cli/repo.md +34 -0
  163. package/second-brain/Projects/sanook-cli/second-brain-feature-roadmap.md +197 -0
  164. package/second-brain/README.md +1 -1
  165. package/second-brain/Research/2026-06-17-ai-second-brain-method-experiment.md +108 -0
  166. package/second-brain/Research/2026-06-18-ai-token-reduction-frameworks.md +55 -0
  167. package/second-brain/Research/2026-06-18-hermes-cli-second-brain-expansion-research.md +160 -0
  168. package/second-brain/Research/2026-06-18-hermes-tui-parity-map.md +129 -0
  169. package/second-brain/Research/2026-06-18-sanook-mcp-ecosystem-and-ux-roadmap.md +181 -0
  170. package/second-brain/Research/2026-06-19-hermes-python-architecture-for-sanook.md +49 -0
  171. package/second-brain/Research/2026-06-19-terminal-ui-brand-research.md +52 -0
  172. package/second-brain/Research/_Index.md +8 -1
  173. package/second-brain/Reviews/2026-06-18-auto-improve-maintenance.md +54 -0
  174. package/second-brain/Reviews/_Index.md +1 -1
  175. package/second-brain/Runbooks/_Index.md +6 -1
  176. package/second-brain/Runbooks/ai-second-brain-operating-sequence.md +108 -0
  177. package/second-brain/SANOOK.md +45 -0
  178. package/second-brain/Sessions/2026-06-17-ai-framework-additional-zones.md +68 -0
  179. package/second-brain/Sessions/2026-06-17-ai-second-brain-sequence-experiment.md +63 -0
  180. package/second-brain/Sessions/2026-06-18-cli-args-release-readiness.md +59 -0
  181. package/second-brain/Sessions/2026-06-18-final-gate-template-final.md +192 -0
  182. package/second-brain/Sessions/2026-06-18-final-gate-template.md +71 -0
  183. package/second-brain/Sessions/2026-06-18-framework-dogfood-permission-and-memory.md +58 -0
  184. package/second-brain/Sessions/2026-06-18-hermes-second-brain-expansion-research.md +52 -0
  185. package/second-brain/Sessions/2026-06-18-mcp-ecosystem-and-sanook-ux-scan.md +81 -0
  186. package/second-brain/Sessions/2026-06-18-sanook-brain-cli-p0-implementation.md +86 -0
  187. package/second-brain/Sessions/2026-06-18-sanook-brain-final-cli-final.md +246 -0
  188. package/second-brain/Sessions/2026-06-18-sanook-brain-final-cli.md +78 -0
  189. package/second-brain/Sessions/2026-06-18-sanook-cli-second-brain-roadmap-correction.md +54 -0
  190. package/second-brain/Sessions/2026-06-18-token-reduction-framework-integration.md +69 -0
  191. package/second-brain/Sessions/_Index.md +15 -1
  192. package/second-brain/Shared/AI-Context-Index.md +22 -0
  193. package/second-brain/Shared/Context-Packs/_Index.md +9 -1
  194. package/second-brain/Shared/Context-Packs/coding-release.md +51 -0
  195. package/second-brain/Shared/Context-Packs/research-to-framework.md +51 -0
  196. package/second-brain/Shared/Context-Packs/second-brain-maintenance.md +41 -0
  197. package/second-brain/Shared/Operating-State/current-state.md +14 -4
  198. package/second-brain/Shared/Scripts/_Index.md +3 -1
  199. package/second-brain/Shared/Scripts/ai-second-brain-method-eval.mjs +198 -0
  200. package/second-brain/Shared/Tech-Standards/_Index.md +6 -1
  201. package/second-brain/Shared/Tech-Standards/mcp-integration-roadmap.md +86 -0
  202. package/second-brain/Shared/Tech-Standards/polyglot-runtime-strategy.md +46 -0
  203. package/second-brain/Shared/Tech-Standards/verification-standard.md +24 -0
  204. package/second-brain/Shared/Tech-Standards/web-search-grounding-policy.md +70 -0
  205. package/second-brain/Shared/User-Memory/_Index.md +4 -1
  206. package/second-brain/Shared/User-Memory/response-examples.md +98 -0
  207. package/second-brain/Shared/User-Memory/user-preferences.md +1 -0
  208. package/second-brain/Templates/_Index.md +9 -0
  209. package/second-brain/Templates/final-lite.md +111 -0
  210. package/second-brain/Templates/final.md +231 -0
  211. package/second-brain/Templates/project-workspace/_Index.md +31 -0
  212. package/second-brain/Templates/project-workspace/context.md +28 -0
  213. package/second-brain/Templates/project-workspace/current-state.md +29 -0
  214. package/second-brain/Templates/project-workspace/overview.md +39 -0
  215. package/second-brain/Templates/project-workspace/repo.md +33 -0
  216. package/second-brain/Vault Structure Map.md +2 -1
  217. package/skills/structured-output-llm/SKILL.md +1 -1
@@ -0,0 +1,160 @@
1
+ ---
2
+ tags: [research, second-brain, hermes, ai-agent, context-engineering]
3
+ note_type: research-note
4
+ created: 2026-06-18
5
+ updated: 2026-06-18
6
+ parent: "[[Research/_Index]]"
7
+ source::
8
+ - https://github.com/NousResearch/hermes-agent
9
+ - https://hermes-agent.nousresearch.com/docs/user-guide/features/context-files
10
+ - https://hermes-agent.nousresearch.com/docs/user-guide/features/memory
11
+ - https://hermes-agent.nousresearch.com/docs/user-guide/features/skills
12
+ - https://hermes-agent.nousresearch.com/docs/user-guide/features/curator
13
+ - https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
14
+ - https://docs.langchain.com/oss/python/concepts/memory
15
+ - https://arxiv.org/abs/2304.03442
16
+ - https://arxiv.org/abs/2310.08560
17
+ - https://arxiv.org/abs/2303.11366
18
+ - https://arxiv.org/abs/2210.03629
19
+ - https://fortelabs.com/blog/para/
20
+ related:: [[Runbooks/ai-second-brain-operating-sequence]]
21
+ related:: [[Shared/AI-Context-Index]]
22
+ related:: [[Evals/second-brain-benchmarks]]
23
+ ---
24
+
25
+ # Hermes CLI Second-Brain Expansion Research
26
+
27
+ > Research note for deciding what to add to this second-brain so Hermes CLI can use it better. Created after comparing the current vault structure with Hermes Agent docs, agent memory research, context-engineering guidance, eval patterns, and PARA-style knowledge management. This note becomes stale when Hermes context/memory/skills semantics change materially.
28
+
29
+ ## Bottom Line
30
+
31
+ Scope correction on 2026-06-18: this note is reference material for Hermes compatibility only. If the objective is Sanook CLI itself, use [[Projects/sanook-cli/second-brain-feature-roadmap]] instead.
32
+
33
+ อย่าเพิ่ม root-level folder เยอะตอนนี้. โครงสร้างปัจจุบันมี knowledge pipeline, memory, context packs, evals, coordination, and runbooks ครบกว่าค่าเฉลี่ยแล้ว.
34
+
35
+ สิ่งที่ควรเพิ่มถัดไปคือชั้นที่ทำให้ Hermes ใช้ของที่มีอยู่ได้แม่นขึ้น:
36
+
37
+ 1. `HERMES.md` หรือ `.hermes.md` adapter สำหรับ Hermes CLI โดยเฉพาะ.
38
+ 2. `Shared/Hermes/` หรืออย่างน้อย `Shared/Agent-Adapters/hermes.md` สำหรับ config, memory sync, toolset, and curator policy.
39
+ 3. `Evals/Benchmarks/` สำหรับ benchmark cases แยกเป็นไฟล์เล็กๆ แทนการโตในไฟล์เดียว.
40
+ 4. `Acceptance/Golden-Cases/` สำหรับ input -> expected output ของ Hermes workflows.
41
+ 5. `Reviews/Vault-Health/` สำหรับ scheduled curator-style review ของ vault/context/skills.
42
+
43
+ ## Evidence From Hermes
44
+
45
+ Hermes context files:
46
+
47
+ - Hermes supports `.hermes.md` / `HERMES.md`, `AGENTS.md`, `CLAUDE.md`, `SOUL.md`, `.cursorrules`, and Cursor rule modules.
48
+ - Priority is first-match: `.hermes.md` -> `AGENTS.md` -> `CLAUDE.md` -> `.cursorrules`; `SOUL.md` is separate global identity.
49
+ - Hermes loads one project context type per session, then progressively discovers subdirectory context files as tools touch paths.
50
+ - Context files are security scanned, truncated, and should stay concise with headers, examples, negative constraints, key paths, and stale-context hygiene.
51
+
52
+ Implication for this vault:
53
+
54
+ - Current `AGENTS.md` works as fallback, but Hermes-only usage should prefer a dedicated `HERMES.md` / `.hermes.md` so Hermes does not inherit adapter compromises meant for other agents.
55
+ - Because Hermes progressively discovers subdirectory files, scoped context files can be more useful than one giant root instruction file.
56
+
57
+ Hermes memory:
58
+
59
+ - Built-in memory is deliberately tiny: `MEMORY.md` for agent notes and `USER.md` for user profile, both loaded once as a frozen snapshot at session start.
60
+ - Hermes explicitly separates always-on memory from on-demand session search.
61
+ - Memory writes can be gated with approval, and memory entries should be compact, specific, and non-duplicative.
62
+
63
+ Implication for this vault:
64
+
65
+ - Keep Hermes memory small and use the vault as the long-term source of truth.
66
+ - Add a Hermes memory sync policy: what goes to `~/.hermes/memories/MEMORY.md`, what stays in `Shared/User-Memory`, what is retrieved on demand from vault search/session logs.
67
+
68
+ Hermes skills:
69
+
70
+ - Skills are on-demand knowledge documents with progressive disclosure.
71
+ - `SKILL.md` supports references, templates, scripts, assets, platform restrictions, required environment variables, and verification sections.
72
+ - Hermes can scan external skill directories, but writable external dirs are not a write-protection boundary.
73
+
74
+ Implication for this vault:
75
+
76
+ - Current `.agents/skills/` can become a shared skill source, but it needs an explicit policy for which skills are read-only, owner-authored, or agent-created.
77
+ - Useful repeatable vault workflows should graduate into Hermes skills only after they have examples, pitfalls, and verification.
78
+
79
+ Hermes curator:
80
+
81
+ - The curator tracks skill usage, marks stale skills, archives long-unused skills, and can optionally run an LLM consolidation pass.
82
+ - It has status, dry-run, backup, rollback, pin, and archive commands.
83
+
84
+ Implication for this vault:
85
+
86
+ - Add curator-like vault health reviews: stale context, duplicated rules, unused context packs, benchmark drift, and skills that should be archived or pinned.
87
+
88
+ ## Evidence From Agent Research
89
+
90
+ Context engineering:
91
+
92
+ - Anthropic frames context as finite and context engineering as the task of curating all tokens available to an agent across long-running loops, not just writing better prompts.
93
+ - This supports the current Scientific Loop Sequence and argues for smaller, task-specific retrieval bundles rather than a larger global instruction file.
94
+
95
+ Memory taxonomy:
96
+
97
+ - LangGraph separates short-term thread-scoped memory from long-term memory across conversations, and uses semantic, episodic, and procedural memory categories.
98
+ - Generative Agents stores experiences, synthesizes reflections, and retrieves memories dynamically for planning.
99
+ - MemGPT argues for tiered memory and movement between fast context and slower external memory.
100
+ - Reflexion stores reflective text in episodic memory after feedback to improve future trials.
101
+ - ReAct shows the value of interleaving reasoning/action with external information retrieval.
102
+
103
+ Implication for this vault:
104
+
105
+ - Current folders already map well:
106
+ - semantic memory -> `Learning/`, `Distillations/`, `Entities/`, `Shared/Core-Facts/`
107
+ - episodic memory -> `Sessions/`, `Retrospectives/`, `Traces/`
108
+ - procedural memory -> `Runbooks/`, `Playbooks/`, `Skills/`, `.agents/skills/`
109
+ - eval/reflection memory -> `Evals/`, `Acceptance/`, `Reviews/`
110
+ - The missing piece is not another generic "Resources" folder. It is sharper eval cases, Hermes adapter policy, and scheduled consolidation.
111
+
112
+ PKM / PARA:
113
+
114
+ - PARA's Projects / Areas / Resources / Archives split supports action-oriented retrieval.
115
+ - This vault already extends PARA with AI-specific layers: Evals, Acceptance, Rules, Context-Packs, Provenance, Coordination.
116
+
117
+ Implication for this vault:
118
+
119
+ - Avoid adding broad folders like `Resources/`, `Notes/`, or `AI/`; they would overlap existing canonical homes.
120
+
121
+ ## Gap Analysis
122
+
123
+ | Gap | Current coverage | Recommended addition | Priority |
124
+ |---|---|---|---|
125
+ | Hermes-specific project context | `AGENTS.md` only | `HERMES.md` or `.hermes.md` pointing to hot path and Hermes-only rules | P0 |
126
+ | Hermes memory policy | `Shared/User-Memory`, `Shared/Memory-Inbox`, `USER.md` | `Shared/Hermes/memory-sync-policy.md` or `Shared/Agent-Adapters/hermes-memory.md` | P0 |
127
+ | Hermes skill lifecycle | `.agents/skills`, `Skills/`, `Shared/Rules/skills-admission` | `Shared/Hermes/skill-lifecycle.md` plus first Hermes skill for second-brain maintenance | P1 |
128
+ | Atomic benchmarks | `Evals/second-brain-benchmarks.md` | `Evals/Benchmarks/<case-id>.md` | P1 |
129
+ | Golden fixtures | `Acceptance/golden-case-template.md` | `Acceptance/Golden-Cases/<workflow>.md` | P1 |
130
+ | Scheduled vault health | `Reviews/`, `Runbooks/sleep-time-consolidation.md` | `Reviews/Vault-Health/YYYY-MM-DD.md` | P1 |
131
+ | Prompt-injection trust boundary | `Intake/_Quarantine`, `ingest-quarantine`, Hermes scanner | `Shared/Security/trust-boundaries.md` only if rules grow beyond current files | P2 |
132
+ | Tool inventory and MCP capabilities | `Tools/`, `Shared/mcp-servers`, `Tech-Standards` | `Shared/Hermes/toolsets.md` if Hermes profiles/toolsets become important | P2 |
133
+ | Output artifacts per project | `Projects/<proj>/` role allows deliverables | Add `Projects/<proj>/Artifacts/` only inside active projects with many generated files | P2 |
134
+
135
+ ## Recommended Next Build
136
+
137
+ Best next bundle:
138
+
139
+ 1. Add `second-brain/HERMES.md`.
140
+ 2. Add `second-brain/Shared/Hermes/_Index.md`.
141
+ 3. Add `second-brain/Shared/Hermes/memory-sync-policy.md`.
142
+ 4. Add `second-brain/Shared/Hermes/skill-lifecycle.md`.
143
+ 5. Add `second-brain/Shared/Context-Packs/hermes-cli-vault-maintenance.md`.
144
+ 6. Split 3-5 high-value cases from `Evals/second-brain-benchmarks.md` into `Evals/Benchmarks/`.
145
+
146
+ Implementation caution:
147
+
148
+ - If adding new folders, update [[Vault Structure Map]] and any folder scaffold source such as `src/brain.ts`.
149
+ - If adding only files under existing folders, keep the current taxonomy stable.
150
+ - Do not mirror Hermes `~/.hermes/` wholesale into the vault; keep local runtime state in Hermes home and store only policy, reviewed snapshots, and durable decisions here.
151
+
152
+ ## Do Not Add Yet
153
+
154
+ - `Resources/` root folder: overlaps `Research/`, `Learning/`, and `Distillations/`.
155
+ - `Notes/` root folder: becomes a junk drawer and weakens routing.
156
+ - `AI/` root folder: duplicates `Shared/AI-Context-Index`, agent adapters, rules, and context packs.
157
+ - `Archive/` root folder: `Shared/Archive/` already exists.
158
+ - `Experiments/` root folder: use `Research/`, `Evals/`, or `Sessions/` depending on artifact type.
159
+
160
+ up:: [[Research/_Index]]
@@ -0,0 +1,129 @@
1
+ ---
2
+ tags: [research, cli, tui, hermes, sanook]
3
+ note_type: research
4
+ created: 2026-06-18
5
+ updated: 2026-06-18
6
+ parent: "[[Research/_Index]]"
7
+ source:
8
+ - https://github.com/nousresearch/hermes-agent
9
+ - https://github.com/nousresearch/hermes-agent/tree/main/ui-tui/src
10
+ - https://github.com/nousresearch/hermes-agent/blob/main/ui-tui/src/components/branding.tsx
11
+ - https://github.com/nousresearch/hermes-agent/blob/main/ui-tui/src/components/appChrome.tsx
12
+ - https://github.com/nousresearch/hermes-agent/blob/main/ui-tui/src/components/appOverlays.tsx
13
+ - https://github.com/nousresearch/hermes-agent/blob/main/ui-tui/src/components/textInput.tsx
14
+ - https://github.com/nousresearch/hermes-agent/blob/main/LICENSE
15
+ - https://clig.dev/
16
+ - https://github.com/google-gemini/gemini-cli
17
+ - https://github.com/openai/codex
18
+ - https://github.com/Aider-AI/aider
19
+ ---
20
+
21
+ # Hermes TUI Parity Map for Sanook
22
+
23
+ > Map Hermes Agent TUI features against Sanook's current UI so future port/rebrand work can be prioritized without losing source/license context.
24
+
25
+ Source inspected: `nousresearch/hermes-agent` at commit `646cd1b`, then rechecked against GitHub HEAD `c37fdec` (`feat(dashboard): surface full per-MCP catalog detail; fix pip-install doc`) and latest HEAD `2fa16ec` (`Merge pull request #48529 from kshitijk4poor/salvage-48372-eap`) on 2026-06-18. License is MIT; direct code copies require preserving the Nous Research copyright/license notice.
26
+
27
+ ## Answer
28
+
29
+ ยังไม่ได้เอา Hermes TUI มาทั้งหมด. Sanook ตอนนี้เอาแนวคิด startup banner/status launchpad, startup service routes panel, slash/path completion float box, compact/expanded transcript tool trail controls, Hermes-style `/details` สำหรับ thinking/tools sections, streaming markdown renderer แบบ stable-prefix/tail, grapheme-safe prompt cursor/backspace, Hermes-style long paste collapse, `/copy` clipboard/OSC52 bridge, และ floating overlay path สำหรับ `/help` pager, `/hotkeys`, `/tools` hub, `/model` picker, `/mcp` hub พร้อม lazy server test + per-server tool catalog browsing, `/skills` hub, กับ `/sessions` switcher ที่ inspect/resume/delete-confirm ได้มาแล้ว แต่ Hermes TUI เป็นระบบใหญ่กว่า banner มาก: มี custom Ink runtime, gateway RPC, fullscreen alternate screen, virtual transcript, overlays, model/session/skills/plugins hubs, terminal selection/copy-on-select, mouse wheel acceleration, richer collapsible reasoning/tool trail, todo panel, richer markdown/math/table rendering, voice hooks, and skin/theme live repaint.
30
+
31
+ ## Outside CLI Notes
32
+
33
+ - CLIG.dev emphasizes human-first design, "just enough" output, discoverability, and conversational feedback. Sanook should make the first screen explain useful next actions without becoming scrollback noise.
34
+ - Gemini CLI presents a clear screenshot-led identity and foregrounds built-in tools, MCP extensibility, terminal-first use, checkpointing, and project context files.
35
+ - OpenAI Codex uses a strong splash image plus a direct local-agent promise and very short quickstart path.
36
+ - Aider differentiates less through TUI chrome and more through workflow promises: repo map, git integration, lint/test loops, voice, image/web context, and copy/paste handoff.
37
+ - Sanook's best brand gap is therefore not a bigger logo; it is a memorable terminal service map: Code, Brain, Connect, Ship.
38
+
39
+ ## Hermes TUI Inventory
40
+
41
+ - Runtime shell: `entry.tsx`, `app.tsx`, `app/useMainApp.ts`, `gatewayClient.ts`.
42
+ - Layout/chrome: `components/appLayout.tsx`, `components/appChrome.tsx`, `components/branding.tsx`.
43
+ - Banner/session intro: responsive ASCII logo, compact fallback, session panel, caduceus hero, collapsible Tools/Skills/MCP/System sections.
44
+ - Status rule: busy indicator styles, elapsed time, model, context meter, cost/duration/background task/voice/compression segments, cwd/branch truncation.
45
+ - Transcript: virtual history, sticky scroll, transcript scrollbar, message grouping, role gutter, long system collapse.
46
+ - Streaming: incremental markdown, reasoning/tool trail grouping, pending tools, live todo panel.
47
+ - Composer: custom text input, grapheme-safe cursor movement, multiline navigation, paste collapse, path/image drop detection, queue editing.
48
+ - Completions: slash completion and path completion float box.
49
+ - Overlays: approval, confirm, clarify, sudo password, secret prompt, pager, model picker, active session switcher, skills hub, plugins hub, agents overlay, FPS/perf overlays.
50
+ - Terminal integration: alternate screen, bracketed paste, mouse tracking, copy-on-select, OSC52 clipboard, terminal parity hints, Termux mode.
51
+ - Domain/libs: block layout, providers, usage, viewport, emoji/math unicode/syntax/text sanitization, memory monitor, subagent tree.
52
+ - Tests: broad UI regression suite for status rules, input cursor drift, terminal modes, overlays, markdown, virtual scroll, queue, theme, clipboard, and slash parity.
53
+
54
+ ## Sanook Current Parity
55
+
56
+ - Done: big `SANOOK AI` wordmark and launchpad in `src/ui/banner.tsx`.
57
+ - Done: responsive banner tiers inspired by Hermes: wide wordmark, compact panel, tiny text-only panel.
58
+ - Done: startup service routes panel with Code, Brain, Connect, Ship, System, and Runtime lanes in `src/ui/session-panel.tsx`.
59
+ - Done: `/hotkeys` command adapted from Hermes hotkey discovery.
60
+ - Done: `/help` pager overlay in `src/ui/overlay.tsx`; supports line/page navigation, top/bottom jumps, and close on `Esc/q`.
61
+ - Done: slash-command and path completion float box in `src/ui/overlay.tsx` + `src/slash-completion.ts`; supports prefix filtering, `@file`/relative/home/absolute path tokens, row navigation, and Tab/Enter-to-complete before submit.
62
+ - Done: `/mcp` MCP Hub overlay in `src/ui/overlay.tsx` + `src/mcp-hub.ts`; maps Hermes plugins hub/dashboard catalog idea to Sanook's extension model by listing configured MCP servers, transport, target, secret summary, lazy selected-server testing with `t` for PASS/FAIL, and per-server advertised tool catalog browsing with ↑/↓ or j/k.
63
+ - Done: floating `/hotkeys` overlay foundation in `src/ui/overlay.tsx`; closes with `Esc`, `Enter`, or `q`.
64
+ - Done: `/tools` Tools Hub overlay in `src/ui/overlay.tsx` + `src/tool-catalog.ts`; lists built-in file/git/memory/schedule/sub-agent/diagnostics lanes and supports Enter-to-inspect details instead of dumping a long text block into scrollback.
65
+ - Done: `/model` picker overlay in `src/ui/overlay.tsx` using Sanook provider registry; supports ↑/↓ or j/k and Enter-to-switch.
66
+ - Done: `/skills` read-only Skills Hub overlay in `src/ui/overlay.tsx` using Sanook's bundled/global/project skill loader; supports list navigation and inspect view.
67
+ - Done: `/sessions` Session Switcher overlay in `src/ui/overlay.tsx` using Sanook's saved session store; supports list navigation, Enter-to-resume for current-project sessions, `i` detail inspect, and two-press `d` delete confirmation.
68
+ - Done: bounded queued-message window inspired by Hermes `QueuedMessages`, with active row selection and `Ctrl+X` deletion while busy.
69
+ - Done: Hermes-like Sanook status rule in `src/ui/status.ts` + cached git branch lookup in `src/ui/useGitBranch.ts` + busy elapsed timer in `src/ui/useBusyElapsed.ts`; prioritizes state/model/mode/context/queue, sheds lower-priority hints on narrow terminals, shows elapsed/context-compression/cost/cwd/branch when space allows, and makes cwd/branch yield before wrapping.
70
+ - Done: compact/expanded transcript tool trail controls in `src/ui/tool-trail.ts` + `src/ui/app.tsx`; `tool-call` events render as running rows, `tool-result` events mark rows done, errors mark the latest running tool, completed trails are snapshotted into the assistant turn, `/trail [compact|expanded]` and `Ctrl+T` rerender saved transcript trails, and assistant streaming text no longer gets polluted by raw tool-call markers.
71
+ - Done: `/details thinking hidden|collapsed|expanded` and `/details tools hidden|collapsed|expanded` in `src/commands.ts` + `src/ui/thinking-panel.ts` + `src/ui/app.tsx`; maps Hermes section visibility to Sanook's capped reasoning panel and tool trail visibility.
72
+ - Done: streaming/saved assistant markdown rendering in `src/ui/markdown.tsx` + `src/ui/app.tsx`; supports headings, quotes, lists, fenced code, inline code, bold, and a Hermes-inspired stable-prefix/unstable-tail split outside code fences.
73
+ - Done: grapheme-safe prompt cursor/backspace in `src/ui/useEditor.ts`; left/right/delete move across Thai combining marks, emoji, and ZWJ emoji as whole grapheme clusters.
74
+ - Done: Hermes-style long paste collapse in `src/ui/useEditor.ts` + `src/ui/app.tsx`; bracketed/multiline paste normalizes newlines, collapses long payloads into readable `[[ paste ... ]]` tokens, and expands those snippets before submit so the model receives full text.
75
+ - Done: `/copy [last]` clipboard bridge in `src/clipboard.ts` + `src/ui/app.tsx`; copies the latest assistant response via native system clipboard tools and falls back to OSC52 terminal clipboard sequences.
76
+ - Done: REPL banner only renders before conversation history exists, preserving scrollback.
77
+ - Done: simple approval prompt, prompt history, slash commands, `@file` mention expansion, model footer.
78
+ - Missing: fullscreen alternate screen and virtual transcript.
79
+ - Missing: richer plugin/MCP actions such as enable/disable and install from registry inside the TUI, schema-level tool detail panes, plus remaining session actions such as rename/cross-project switch/live session state.
80
+ - Missing: richer background-task and voice segments in the status rule.
81
+ - Missing: remaining full custom TextInput/terminal parity: visual wrap cursor layout, image/path drop detection, mouse selection, and copy-on-select.
82
+ - Missing: collapsible/interactive startup session sections for tools/skills/MCP/system.
83
+ - Missing: richer grouped reasoning trail, live todo panel parity, and full markdown/math/table/media parity.
84
+ - Missing: live theme/skin engine with user-defined banner art/colors.
85
+
86
+ ## Port Plan
87
+
88
+ P0 completed:
89
+ - Responsive SANOOK AI Launchpad in `src/ui/banner.tsx`.
90
+
91
+ P1 next, low-risk/high-value:
92
+ - Upgrade startup service panel into collapsible/interactive sections using Sanook's Tools Hub, skill loader, and MCP config.
93
+ - Expand the new floating overlay foundation into richer tools/MCP/plugin actions, richer skill actions, and richer session actions.
94
+ - Expand status with background-task/voice/compression segments.
95
+
96
+ P2 completed:
97
+ - Paged `/help` overlay using Sanook command help text.
98
+ - Tools Hub overlay using Sanook built-in tool catalog.
99
+ - Model picker overlay using Sanook provider registry.
100
+ - Session switcher overlay using Sanook saved sessions.
101
+ - Skills hub overlay using Sanook skill list/read surfaces.
102
+ - Compact/expanded transcript tool trail controls for `tool-call`/`tool-result`/`error` agent events.
103
+ - `/details thinking/tools hidden|collapsed|expanded` section controls with a capped thinking panel and hidden/compact/expanded tool trail.
104
+ - Streaming markdown renderer for live assistant output and saved assistant turns.
105
+ - Grapheme-safe prompt cursor/backspace for Thai combining marks, emoji, and ZWJ emoji.
106
+ - Long paste collapse with snippet expansion before submit.
107
+ - `/copy [last]` clipboard bridge with native clipboard + OSC52 fallback.
108
+
109
+ P2 next:
110
+ - Add richer skill actions once Sanook has stable install/remove/open/edit surfaces.
111
+ - Add remaining richer session actions: rename/title edit, cross-project switch, and live-session metadata.
112
+ - Custom command completion and richer path edge cases (quoted paths, hidden files toggle, Windows drive polish).
113
+
114
+ P3 larger:
115
+ - Virtual transcript/scrollbar/sticky prompt.
116
+ - Full rich message rendering with markdown math/tables/media, richer grouped reasoning trail, and todo panel.
117
+ - Finish remaining custom text input/terminal parity: visual wrap cursor layout, image/path drop detection, mouse selection, and copy-on-select.
118
+
119
+ P4 only if needed:
120
+ - Gateway-style RPC split between UI and backend. Sanook currently runs the agent in-process; copying Hermes' RPC architecture wholesale would be a larger framework change.
121
+
122
+ ## Rebrand Rules
123
+
124
+ - Replace Hermes Agent -> SANOOK AI / Sanook.
125
+ - Replace Hermes mythological copy -> Sanook service promise: `plan -> patch -> prove -> remember`, `readable · recoverable · remembered`.
126
+ - Keep Sanook differentiators prominent: BYOK, local-first, second brain, MCP workflows, Thai-friendly copy.
127
+ - Avoid copying Hermes Python backend assumptions unless Sanook has the equivalent feature.
128
+
129
+ up:: [[Research/_Index]]
@@ -0,0 +1,181 @@
1
+ ---
2
+ tags: [research, mcp, sanook-cli, integration, roadmap]
3
+ note_type: research
4
+ created: 2026-06-18
5
+ updated: 2026-06-18
6
+ parent: "[[Research/_Index]]"
7
+ source:
8
+ - https://registry.modelcontextprotocol.io/openapi.json
9
+ - https://registry.modelcontextprotocol.io/v0/servers
10
+ - https://registry.modelcontextprotocol.io/v0/version
11
+ - https://modelcontextprotocol.io/specification/2025-06-18/basic/transports
12
+ - https://modelcontextprotocol.io/specification/2025-06-18/server/tools
13
+ related:
14
+ - "[[Shared/Tech-Standards/mcp-integration-roadmap]]"
15
+ ---
16
+
17
+ # 2026-06-18 - Sanook MCP Ecosystem and UX Roadmap
18
+
19
+ > Research snapshot for how Sanook CLI currently handles MCP, what the official MCP registry exposes, and which integrations would make Sanook easier to use.
20
+
21
+ ## Current Sanook MCP State
22
+
23
+ Sanook already has a strong MCP foundation:
24
+
25
+ - MCP client: `src/mcp.ts`
26
+ - Loads global `~/.sanook/mcp.json`.
27
+ - Loads project `.sanook/mcp.json` only after project trust.
28
+ - Supports stdio via `command` + `args`.
29
+ - Supports remote Streamable HTTP via `url` + `headers`.
30
+ - Sanitizes server names.
31
+ - Sends minimal safe env to child MCP servers and only passes explicit `cfg.env`.
32
+ - Caps MCP tool output.
33
+ - Merges MCP tools into the main agent as `<server>__<tool>`.
34
+ - MCP server: `src/mcp-server.ts`
35
+ - `sanook mcp serve` exposes `sanook_search`, `sanook_recall`, `sanook_remember`, `sanook_index`, and `sanook_stats`.
36
+ - Uses stdio JSON-RPC and keeps stdout protocol-clean.
37
+ - CLI management: `src/bin.ts`
38
+ - `sanook mcp add <name> <command> [args...]`
39
+ - `sanook mcp add <name> https://host/mcp`
40
+ - `sanook mcp list`
41
+ - `sanook mcp remove <name>`
42
+
43
+ Main gap: Sanook can run MCP servers, but users still need to know the exact package, args, secrets, and safe configuration shape themselves.
44
+
45
+ ## Registry Findings
46
+
47
+ The official registry API is available and healthy:
48
+
49
+ - `GET /v0/version` returned registry `1.7.9`, build time `2026-05-12T21:05:57Z`.
50
+ - `GET /v0/health` returned `status: ok`.
51
+ - OpenAPI exposes list/get/validate/publish/status endpoints under `/v0` and `/v0.1`.
52
+ - Server entries include:
53
+ - `server.name`, `description`, `version`, `repository`, `websiteUrl`
54
+ - `remotes` with `type: streamable-http` or `sse`
55
+ - `packages` with `registryType`, `identifier`, `version`, `runtimeHint`, `transport`
56
+ - `environmentVariables`, `headers`, `packageArguments`, `runtimeArguments`
57
+ - `isRequired`, `isSecret`, `format`, `placeholder`, and default values for setup UX
58
+ - metadata such as `isLatest`
59
+
60
+ This means Sanook can build a first-class MCP installer without hardcoding every server.
61
+
62
+ ## High-Value MCP Categories for Sanook
63
+
64
+ | Category | Examples seen in registry | Why it matters for Sanook |
65
+ |---|---|---|
66
+ | Code hosting | GitLab official remote, GitHub variants | PRs/issues/releases/repo operations. |
67
+ | Local/cloud files | Filesystem variants, remote GCS filesystem | Safer file access outside the workspace, cloud artifacts. |
68
+ | Databases | Postgres, SQLite | Data inspection for app/debug workflows; should default read-only. |
69
+ | Project management | Linear, Jira | Turn user tasks into issue-backed work loops. |
70
+ | Observability | Sentry | Debug production errors from real issue/event context. |
71
+ | Browser/web | Playwright, Browserbase, fetch, Brave/web search | JS-rendered pages, docs extraction, web research. |
72
+ | Team/chat | Slack, Discord | Team context and delivery/notification workflows. |
73
+ | Knowledge/workspace | Notion, Gmail, Google Drive, Obsidian | Import user knowledge into second-brain workflows. |
74
+ | Docs/versioned knowledge | Context7-like docs servers | Better library/API grounding without broad web search. |
75
+ | Infrastructure | Docker, Kubernetes variants | Ops/debug workflows, but needs strict approval gates. |
76
+
77
+ ## Recommended Sanook UX Improvements
78
+
79
+ ### P0: Discover / Install / Test
80
+
81
+ Add registry-backed commands:
82
+
83
+ ```text
84
+ sanook mcp search <query>
85
+ sanook mcp info <server-name>
86
+ sanook mcp install <server-name> [--name alias]
87
+ sanook mcp test [name]
88
+ ```
89
+
90
+ Expected behavior:
91
+
92
+ - `search` calls the official registry, filters latest versions, and shows transport/package choices.
93
+ - `info` shows description, repo, remotes/packages, required env/header secrets, and risk class.
94
+ - `install` converts registry metadata to `~/.sanook/mcp.json`.
95
+ - `test` initializes the server and lists tools without starting an agent turn.
96
+
97
+ ### P1: Setup Wizard from Registry Metadata
98
+
99
+ Use `environmentVariables` and `headers`:
100
+
101
+ - prompt for required secrets without echoing them
102
+ - support `--env KEY=value` and `--header KEY=value`
103
+ - store secrets explicitly only in `~/.sanook/mcp.json`, not inherited process env
104
+ - show a redacted preview before write
105
+
106
+ ### P1: Safer Capability Review
107
+
108
+ After install/test, print:
109
+
110
+ - transport: stdio / remote HTTP
111
+ - package runtime: `npx`, `uvx`, Docker, remote
112
+ - number of tools
113
+ - tool names
114
+ - risk class:
115
+ - read-only
116
+ - file-write
117
+ - network-write
118
+ - database-write
119
+ - infra/admin
120
+
121
+ Then let users enable dangerous servers intentionally.
122
+
123
+ ### P2: Preset Packs
124
+
125
+ Sanook can ship curated packs:
126
+
127
+ ```text
128
+ sanook mcp preset dev
129
+ sanook mcp preset research
130
+ sanook mcp preset pm
131
+ sanook mcp preset ops
132
+ ```
133
+
134
+ Suggested presets:
135
+
136
+ - `dev`: GitHub/GitLab, filesystem, Sentry, Context7/docs
137
+ - `research`: fetch, Brave/web search, docs, Obsidian/GDrive
138
+ - `pm`: Linear/Jira, Slack, Notion
139
+ - `ops`: Postgres read-only, Docker/Kubernetes, Sentry
140
+
141
+ ### P2: Tool Discovery in the REPL
142
+
143
+ Improve `/tools`:
144
+
145
+ - group MCP tools by server
146
+ - show disabled/unreachable servers
147
+ - show how to fix missing env/headers
148
+ - show source config path: global vs project
149
+
150
+ ## Implementation Notes
151
+
152
+ Good fit for Sanook's existing code:
153
+
154
+ - Add a new module `src/mcp-registry.ts`.
155
+ - Keep registry parsing pure/testable.
156
+ - Do not install from arbitrary registry package metadata without showing command/env first.
157
+ - Prefer remote Streamable HTTP when no local runtime is required.
158
+ - Prefer read-only database servers by default.
159
+ - Keep project `.sanook/mcp.json` behind trust, as today.
160
+ - Add tests with mocked fetch and fake MCP servers.
161
+
162
+ ## Suggested First Integrations
163
+
164
+ For this repo and owner's likely workflows:
165
+
166
+ 1. GitLab official remote or GitHub MCP variant: repo/issues/PRs/releases.
167
+ 2. Sentry: production debugging and release verification.
168
+ 3. Linear/Jira: task loop integration if issue tracker is used.
169
+ 4. Postgres read-only: app data inspection.
170
+ 5. Context7/docs + fetch/search: better grounded research.
171
+ 6. Slack/Discord: team/message workflows.
172
+ 7. Google Drive/Gmail/Notion/Obsidian: knowledge intake into second-brain.
173
+
174
+ ## Open Questions
175
+
176
+ - Should Sanook store MCP secrets directly in `mcp.json`, or add a redacted secret store under `~/.sanook/secrets.json`?
177
+ - Should `sanook mcp install` default to global only, with `--project` requiring trust?
178
+ - Should remote OAuth flows be supported directly, or should Sanook only accept bearer tokens/headers first?
179
+ - Should dangerous MCP tool groups be disabled until the user runs `sanook mcp enable <name> --write`?
180
+
181
+ up:: [[Research/_Index]]
@@ -0,0 +1,49 @@
1
+ ---
2
+ tags: [research, hermes, sanook, cli, prompt-budget]
3
+ note_type: research
4
+ created: 2026-06-19
5
+ updated: 2026-06-19
6
+ parent: "[[Research/_Index]]"
7
+ source:
8
+ - https://github.com/nousresearch/hermes-agent
9
+ - https://github.com/nousresearch/hermes-agent/blob/main/hermes_cli/prompt_size.py
10
+ - https://github.com/nousresearch/hermes-agent/blob/main/hermes_cli/subcommands/prompt_size.py
11
+ - https://github.com/nousresearch/hermes-agent/blob/main/pyproject.toml
12
+ ---
13
+
14
+ # Hermes Python Architecture for Sanook
15
+
16
+ > Research note for converting useful Hermes Agent backend ideas into Sanook-native TypeScript features without copying Hermes runtime assumptions wholesale.
17
+
18
+ Source inspected: local clone of `nousresearch/hermes-agent` fetched on 2026-06-19, latest `origin/main` commit `0fa7d6f6609c515b6eaafda0594a1472d11d93b5` (`fix(desktop): never persist or restore a named custom provider as bare "custom" (#48547)`).
19
+
20
+ ## Finding
21
+
22
+ Hermes' Python layer is a full backend, not a small helper. It covers agent runtime, provider and gateway adapters, CLI subcommands, tools, MCP/plugin/LSP/browser support, schedulers, memory, voice/transcription, dashboards, and tests. Sanook should not port that Python runtime directly because Sanook's core loop is already TypeScript and Vercel AI SDK based.
23
+
24
+ The most useful near-term Sanook adaptation is Hermes' `prompt-size` idea: an offline diagnostic that shows fixed prompt/context/tool-schema weight before the user calls a model. This directly supports Sanook's differentiator: second-brain plus skills plus MCP, all of which can quietly grow context cost.
25
+
26
+ ## Sanook Adaptation
27
+
28
+ - Add `sanook prompt-size [--json]`.
29
+ - Count the same prompt blocks Sanook injects at runtime: base system, personality overlay, auto-memory, skills index, second-brain context, project memory, repo map, and git context.
30
+ - Count built-in tool schemas separately.
31
+ - Do not spawn MCP servers in this command. Live MCP catalogs belong in `sanook mcp list --tools`.
32
+ - Keep counts approximate because tokenizer details vary by model.
33
+
34
+ ## Why This Comes Before Bigger Ports
35
+
36
+ - It improves user trust: Sanook can explain what it is about to send.
37
+ - It makes optimization concrete: big skills, repo maps, and brain context become visible.
38
+ - It is low-risk: no Python bridge, no provider dependency, no background service architecture change.
39
+ - It fits the existing brand promise: readable, recoverable, remembered.
40
+
41
+ ## Follow-Up Ideas
42
+
43
+ - Add `/prompt-size` or a context-meter overlay inside the REPL.
44
+ - Add warning thresholds in `brain doctor` when brain context grows too large.
45
+ - Add a JSON field to support dumps so users can share context-size diagnostics without secrets.
46
+ - Later, consider Hermes-style optional dependency profiles only if Sanook starts shipping heavyweight adapters.
47
+
48
+ up:: [[Research/_Index]]
49
+
@@ -0,0 +1,52 @@
1
+ ---
2
+ tags: [research, cli, tui, brand, sanook]
3
+ note_type: research
4
+ created: 2026-06-19
5
+ updated: 2026-06-19
6
+ parent: "[[Research/_Index]]"
7
+ source:
8
+ - https://clig.dev/
9
+ - https://docs.anthropic.com/en/docs/claude-code/overview
10
+ - https://github.com/google-gemini/gemini-cli
11
+ - https://github.com/openai/codex
12
+ - https://github.com/Aider-AI/aider
13
+ - https://github.com/charmbracelet/bubbletea
14
+ - https://github.com/charmbracelet/lipgloss
15
+ ---
16
+
17
+ # Terminal UI Brand Research
18
+
19
+ > Purpose: Capture outside CLI/TUI brand references and translate them into Sanook-specific startup banner and service-route decisions.
20
+
21
+ ## Notes
22
+
23
+ - CLIG.dev: good CLIs are human-first, say just enough, and make useful next actions discoverable. For Sanook, the banner should be a launch surface, not decoration.
24
+ - Gemini CLI: the README leads with a screenshot and immediately frames benefits around built-in tools, MCP, terminal-first use, checkpointing, and project context.
25
+ - Codex CLI: the README uses a strong splash image and a short local-agent promise before the quickstart.
26
+ - Aider: the brand is workflow-first: repo map, git integration, lint/test loop, voice, images/web pages, and copy/paste handoff.
27
+ - Claude Code: the official docs position the product as an agentic terminal coding tool and emphasize project context, workflow commands, and safe collaboration inside the terminal.
28
+ - Charmbracelet/Bubble Tea/Lip Gloss: modern terminal apps can feel branded and polished without becoming noisy if the UI has strong layout, concise states, and terminal-native styling.
29
+
30
+ ## Sanook Direction
31
+
32
+ Sanook should own a "service routes" identity:
33
+
34
+ - Code: `@file`, tools, diff, edit/run.
35
+ - Brain: second-brain context, remember/recall, skills, compression.
36
+ - Connect: MCP registry, gateway serve, webhooks.
37
+ - Ship: copy handoff, cost guard, final proof, undo safety.
38
+
39
+ This is more distinctive than only changing colors because it tells users what Sanook does for them in the first five seconds.
40
+
41
+ ## 2026-06-19 Implementation Decision
42
+
43
+ Add a "startup cockpit" layer rather than only adding more ASCII art:
44
+
45
+ - Show live readiness signals: second-brain ready/missing, MCP server count, loaded skill count, and git branch.
46
+ - Keep the existing responsive tiers: wide wordmark, medium launchpad, tiny text-only fallback.
47
+ - Preserve the service-route identity so the banner reads as a promise of work: Code, Brain, Connect, Ship.
48
+ - Make the tagline more Sanook-specific: "งานหนักให้เบาลง · ไม่เบาความรับผิดชอบ · local-first memory".
49
+
50
+ Reason: other agent CLIs already have terminal-first branding, MCP/tooling, screenshots, or git-heavy workflows. Sanook's defensible difference is that it can make durable memory and extension readiness visible immediately.
51
+
52
+ up:: [[Research/_Index]]
@@ -25,6 +25,13 @@ parent: "[[Home]]"
25
25
 
26
26
  > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
27
 
28
- _(ยังว่าง โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
28
+ ## Research Notes
29
+
30
+ - [[Research/2026-06-17-ai-second-brain-method-experiment]] — ทดลองเปรียบเทียบวิธีใช้ second-brain ร่วมกับ AI และเลือก Scientific Loop Sequence
31
+ - [[Research/2026-06-18-hermes-cli-second-brain-expansion-research]] — research ว่าควรเพิ่มอะไรใน second-brain เพื่อให้ Hermes CLI ใช้ vault ได้ดีขึ้น
32
+ - [[Research/2026-06-18-hermes-tui-parity-map]] — inventory Hermes Agent TUI ทั้งชุด + parity/port plan สำหรับ rebrand เป็น Sanook
33
+ - [[Research/2026-06-18-sanook-mcp-ecosystem-and-ux-roadmap]] — MCP ecosystem scan + Sanook CLI registry/install/test roadmap
34
+ - [[Research/2026-06-18-ai-token-reduction-frameworks]] — compare LLMLingua, Selective Context, and Headroom for Sanook token reduction
35
+ - [[Research/2026-06-19-hermes-python-architecture-for-sanook]] — Hermes Python backend scan + Sanook-native prompt budget diagnostic choice
29
36
 
30
37
  up:: [[Home]]
@@ -0,0 +1,54 @@
1
+ ---
2
+ tags: [review, maintenance, auto-improve]
3
+ note_type: review
4
+ created: 2026-06-18
5
+ updated: 2026-06-18
6
+ parent: "[[Reviews/_Index]]"
7
+ ---
8
+
9
+ # Auto Improve Maintenance - 2026-06-18
10
+
11
+ > Purpose: Record the local recurring maintenance run, the small improvement chosen, and verification status for future agents.
12
+
13
+ ## Scope
14
+
15
+ Recurring local maintenance run for `sanook-cli`.
16
+
17
+ ## Current State
18
+
19
+ - Existing uncommitted changes already included a `serve --port` missing-value UX fix in `src/cli-args.ts`, search split-option hardening, matching tests, changelog text, and release-readiness notes.
20
+ - Full test baseline passed before this follow-up work.
21
+ - This run consolidated duplicated inline/split CLI option-value handling into `src/cli-option-values.ts`, shared by `parseArgs`, `parseServeArgs`, and `parseSearchArgs`.
22
+ - Parser behavior is intended to stay unchanged by the consolidation; existing focused parser tests cover the touched surfaces.
23
+ - This recurring follow-up added a spawned CLI regression test for `sanook gateway setup ntfy`, covering required split-option missing values and preserving single-dash secret values like `--token -tk_secret`.
24
+
25
+ ## Verification
26
+
27
+ - `npm test` before new edits - 94 files, 810 tests passed.
28
+ - `npm test -- src/search/cli.test.ts` - 1 file, 10 tests passed.
29
+ - `npm run typecheck` - passed.
30
+ - One chained full-suite attempt hit sandbox loopback `EPERM` while another listen probe was running; `npm test -- src/integration.test.ts` passed on rerun.
31
+ - `npm test` after new edits - 94 files, 811 tests passed.
32
+ - `npm run build` - passed.
33
+ - Follow-up baseline `npm test` - 94 files, 811 tests passed.
34
+ - `npm test -- src/cli-args.test.ts src/search/cli.test.ts` - 2 files, 30 tests passed.
35
+ - Follow-up `npm run typecheck` - passed.
36
+ - Follow-up `npm test` after consolidation - 94 files, 811 tests passed.
37
+ - Follow-up `npm run build` - passed.
38
+ - Recurring maintenance baseline `npm test` - 95 files, 814 tests passed.
39
+ - `npm test -- src/gateway-setup-cli.test.ts` - 1 file, 2 tests passed.
40
+ - `npm run typecheck` - passed.
41
+ - Follow-up `npm test` after gateway setup CLI regression coverage - 96 files, 816 tests passed.
42
+ - `npm run build` - passed.
43
+
44
+ ## Follow-up Audit
45
+
46
+ - Reviewed the remaining direct next-argument readers in `src/tools/permission.ts` and `src/bin.ts`.
47
+ - No safe behavior change was made this pass: the `permission.ts` readers intentionally model shell/git option semantics where a following token that begins with `-` can still be the consumed value, and the gateway setup helpers in `bin.ts` may receive secret/token values that begin with `-`.
48
+ - Avoid broad conversion to the shared CLI option helper unless the target command surface has tests proving flag-like values should be rejected.
49
+
50
+ ## Next Candidate
51
+
52
+ Consider extracting a small gateway setup option parser only if more setup command regressions appear; for now the spawned CLI regression coverage protects the known brittle edge without broad parser churn.
53
+
54
+ up:: [[Reviews/_Index]]