sanook-cli 0.5.2 → 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.
- package/CHANGELOG.md +91 -2
- package/README.md +15 -3
- package/README.th.md +8 -1
- package/dist/approval.js +7 -0
- package/dist/bin.js +623 -56
- package/dist/brain-consolidate.js +335 -0
- package/dist/brain-context.js +42 -3
- package/dist/brain-final.js +15 -9
- package/dist/brain-metrics.js +277 -0
- package/dist/brain-new.js +402 -0
- package/dist/brain-pack.js +210 -0
- package/dist/brain-repair.js +280 -0
- package/dist/brain.js +3 -0
- package/dist/cli-args.js +47 -9
- package/dist/cli-option-values.js +1 -1
- package/dist/clipboard.js +65 -0
- package/dist/commands.js +94 -14
- package/dist/config.js +31 -5
- package/dist/context-pack.js +145 -0
- package/dist/dashboard/api-helpers.js +87 -0
- package/dist/dashboard/server.js +179 -0
- package/dist/dashboard/static/app.js +277 -0
- package/dist/dashboard/static/index.html +39 -0
- package/dist/dashboard/static/styles.css +85 -0
- package/dist/diff.js +10 -2
- package/dist/gateway/auth.js +14 -3
- package/dist/gateway/deliver.js +45 -3
- package/dist/gateway/doctor.js +456 -0
- package/dist/gateway/email.js +30 -1
- package/dist/gateway/ledger.js +20 -1
- package/dist/gateway/session.js +30 -11
- package/dist/hotkeys.js +21 -0
- package/dist/i18n/en.js +98 -0
- package/dist/i18n/index.js +19 -0
- package/dist/i18n/th.js +98 -0
- package/dist/i18n/types.js +1 -0
- package/dist/insights-args.js +24 -4
- package/dist/knowledge.js +55 -29
- package/dist/loop.js +34 -5
- package/dist/mcp-hub.js +33 -0
- package/dist/mcp-registry.js +153 -9
- package/dist/mcp-risk.js +71 -0
- package/dist/mcp.js +77 -5
- package/dist/memory-log.js +90 -0
- package/dist/memory-store.js +37 -1
- package/dist/memory.js +51 -7
- package/dist/model-picker.js +58 -0
- package/dist/orchestrate.js +7 -5
- package/dist/plan-handoff.js +17 -0
- package/dist/polyglot.js +162 -0
- package/dist/process-runner.js +96 -0
- package/dist/project-init.js +91 -0
- package/dist/project-registry.js +143 -0
- package/dist/project-scaffold.js +124 -0
- package/dist/prompt-size.js +155 -0
- package/dist/providers/codex-login.js +138 -0
- package/dist/providers/codex.js +20 -8
- package/dist/providers/keys.js +21 -0
- package/dist/providers/models.js +1 -1
- package/dist/search/cli.js +9 -1
- package/dist/search/embedding-config.js +22 -0
- package/dist/search/engine.js +2 -13
- package/dist/search/indexer.js +10 -10
- package/dist/session-distill.js +84 -0
- package/dist/session.js +1 -11
- package/dist/skill-install.js +24 -1
- package/dist/skills.js +33 -0
- package/dist/slash-completion.js +155 -0
- package/dist/support-dump.js +31 -0
- package/dist/tool-catalog.js +59 -0
- package/dist/tools/index.js +5 -0
- package/dist/tools/permission.js +82 -16
- package/dist/tools/polyglot.js +126 -0
- package/dist/tools/sandbox.js +38 -13
- package/dist/tools/search.js +9 -2
- package/dist/tools/task.js +22 -2
- package/dist/tools/timeout.js +7 -5
- package/dist/tools/web-fetch-tool.js +33 -0
- package/dist/turn-retrieval.js +83 -0
- package/dist/ui/app.js +835 -29
- package/dist/ui/banner.js +78 -4
- package/dist/ui/markdown.js +122 -0
- package/dist/ui/overlay.js +496 -0
- package/dist/ui/queue.js +23 -0
- package/dist/ui/render.js +20 -1
- package/dist/ui/session-panel.js +115 -0
- package/dist/ui/setup-providers.js +40 -0
- package/dist/ui/setup.js +163 -50
- package/dist/ui/status.js +142 -0
- package/dist/ui/thinking-panel.js +36 -0
- package/dist/ui/tool-trail.js +97 -0
- package/dist/ui/transcript.js +26 -0
- package/dist/ui/useBusyElapsed.js +19 -0
- package/dist/ui/useEditor.js +144 -5
- package/dist/ui/useGitBranch.js +57 -0
- package/dist/update.js +32 -6
- package/dist/web-fetch.js +637 -0
- package/dist/web-surface.js +190 -0
- package/package.json +2 -2
- package/second-brain/Projects/_Index.md +17 -4
- package/second-brain/Projects/sanook-cli/_Index.md +7 -3
- package/second-brain/Projects/sanook-cli/context.md +35 -0
- package/second-brain/Projects/sanook-cli/current-state.md +32 -0
- package/second-brain/Projects/sanook-cli/overview.md +41 -0
- package/second-brain/Projects/sanook-cli/repo.md +34 -0
- package/second-brain/Projects/sanook-cli/second-brain-feature-roadmap.md +52 -11
- package/second-brain/Research/2026-06-18-hermes-tui-parity-map.md +129 -0
- package/second-brain/Research/2026-06-19-hermes-python-architecture-for-sanook.md +49 -0
- package/second-brain/Research/2026-06-19-terminal-ui-brand-research.md +52 -0
- package/second-brain/Research/_Index.md +2 -0
- package/second-brain/Shared/Operating-State/current-state.md +14 -23
- package/second-brain/Shared/Tech-Standards/_Index.md +2 -0
- package/second-brain/Shared/Tech-Standards/polyglot-runtime-strategy.md +46 -0
- package/second-brain/Shared/Tech-Standards/web-search-grounding-policy.md +70 -0
- package/second-brain/Templates/project-workspace/_Index.md +31 -0
- package/second-brain/Templates/project-workspace/context.md +28 -0
- package/second-brain/Templates/project-workspace/current-state.md +29 -0
- package/second-brain/Templates/project-workspace/overview.md +39 -0
- package/second-brain/Templates/project-workspace/repo.md +33 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,100 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.5
|
|
4
|
+
|
|
5
|
+
### Hermes-style setup, dashboard, and terminal parity
|
|
6
|
+
|
|
7
|
+
- **Localized setup wizard (EN/TH)** — language picker on first run; steps for provider, model, **agent** (permission mode), **tools**, **gateway**, second brain, and complete (~10 steps).
|
|
8
|
+
- **`sanook dashboard`** — local web UI on port 9119 with pages: Home, **Chat**, Models, Sessions, **Files**, **Logs**, **Cron**, **Channels**, Config, MCP, Brain; REST APIs for status, config, files, logs, cron, and channels.
|
|
9
|
+
- **Two-phase `/model` picker** — choose provider, then model (Hermes-style); `Esc` returns to provider list.
|
|
10
|
+
- **New slash commands** — `/setup` (setup section hints), `/dashboard` (open web dashboard).
|
|
11
|
+
- **Codex device-code login** — Hermes-style OAuth device flow in setup wizard (`src/providers/codex-login.ts`).
|
|
12
|
+
- **i18n foundation** — `src/i18n/` with English and Thai strings; locale persisted in global config.
|
|
13
|
+
|
|
14
|
+
## 0.5.4
|
|
15
|
+
|
|
16
|
+
### Multi-project vault — project workspace auto-detect
|
|
17
|
+
|
|
18
|
+
- **`Projects/<slug>/` workspace standard** — `overview.md`, `current-state.md`, `context.md`, `repo.md` with `repo_path` for machine-readable repo mapping.
|
|
19
|
+
- **`sanook brain new project --title "..." --repo /path`** — scaffolds full `Projects/<slug>/` workspace from `Templates/project-workspace/` and links it from `Projects/_Index.md`.
|
|
20
|
+
- **`sanook brain projects list`** — shows registered project workspaces and marks the active project for the current cwd.
|
|
21
|
+
- **Project auto-detect in agent context** — when cwd is inside a project's `repo_path`, Sanook injects `<project_workspace>` hot context (current-state, context, overview) into `loadBrainContext()` and `sanook brain context`.
|
|
22
|
+
- **`sanook brain context --project <slug>`** — force a project workspace without cwd matching.
|
|
23
|
+
- **Scaffold policy** — `sanook brain init` no longer copies bundled `Projects/<slug>/` dogfood folders into new vaults (only `Projects/_Index.md`); add projects explicitly with `brain new project`.
|
|
24
|
+
|
|
25
|
+
## 0.5.3
|
|
26
|
+
|
|
27
|
+
### Second-brain CLI — pack, create, repair, consolidate, metrics
|
|
28
|
+
|
|
29
|
+
- **`sanook brain pack list|show <name>`** — makes `Shared/Context-Packs/` first-class: list packs with descriptions and index status; show load order, done criteria, and wiki-link sources.
|
|
30
|
+
- **`sanook brain new <type> [--title "..."]`** — template-backed note creation for `session`, `bug`, `handoff`, `project`, `golden-case`, and `checklist`; fills frontmatter, sets `parent`/`up::`, appends to destination `_Index.md`, and rejects wrong-folder output paths.
|
|
31
|
+
- **`sanook brain repair [--dry-run]`** — safe one-line fixes after `doctor`/`review`: missing purpose blockquote, `parent`, `up::`, unlinked context packs, and missing scaffold folders.
|
|
32
|
+
- **`sanook brain consolidate [--apply] [--apply --archive] [--memory]`** — sleep-time consolidation runner (inbox dedup, stale → archive, retrieval eval, optional auto-memory merge); dry-run by default.
|
|
33
|
+
- **`sanook brain metrics [--no-retrieval]`** — vault counts, stale notes, index freshness, and retrieval coverage with non-zero exit on issues.
|
|
34
|
+
- **Context pack auto-select** — `buildBrainContext({ taskQuery })` and per-turn retrieval now inject the best-matching context pack before broader vault context.
|
|
35
|
+
|
|
36
|
+
### MCP trust & safety
|
|
37
|
+
|
|
38
|
+
- **`sanook mcp enable|disable <name>`** — toggle MCP servers without removing config (`enabled` flag in `mcp.json`; disabled servers are skipped by the agent, web probes, and doctor).
|
|
39
|
+
- **401 auth hints** — `mcp test` / `mcp doctor` print setup hints when hosted remotes return Unauthorized.
|
|
40
|
+
- **Risk labels** — classify servers as `read-only`, `file-write`, `network-write`, `database-write`, or `infra/admin` in search/info/list/test and the MCP hub overlay.
|
|
41
|
+
- **Registry cache** — official MCP registry responses are cached for 5 minutes to reduce repeated network fetches.
|
|
42
|
+
|
|
43
|
+
### Agent loop — web fetch, plan handoff, background tasks
|
|
44
|
+
|
|
45
|
+
- **`web_fetch` agent tool** — built-in ethical fetch ladder (direct HTML → reader → Tavily → Wayback); read-only, no approval gate; same policy as `sanook web fetch`.
|
|
46
|
+
- **`sanook plan "<task>"`** — read-only plan mode with stderr execute handoff (`sanook --yes "…"`) after success.
|
|
47
|
+
- **`/tasks` overlay + `bg N` status** — inspect running `task_spawn` background jobs from the REPL.
|
|
48
|
+
|
|
49
|
+
### Gateway — doctor, richer status, mobile replies
|
|
50
|
+
|
|
51
|
+
- **`sanook gateway doctor`** — validate configured channel tokens, webhooks, and allowlists with live probes where possible.
|
|
52
|
+
- **`sanook gateway status` (enhanced)** — pending cron jobs, recent delivery failures, and config-based channel health summary.
|
|
53
|
+
- **Mobile chat formatting** — truncate fenced code blocks and cap reply length before delivering to Telegram/Discord/Slack/LINE/WhatsApp and other chat platforms.
|
|
54
|
+
|
|
55
|
+
### TUI — sessions, transcript, launchpad
|
|
56
|
+
|
|
57
|
+
- **Session rename** — `/sessions` → `r` to rename inline.
|
|
58
|
+
- **Cross-project sessions** — list sessions from all projects (`≠` marker); resume cross-project with `--continue-any`-style cwd note.
|
|
59
|
+
- **Virtual transcript** — viewport windowing with PgUp/PgDn scroll instead of rendering full scrollback.
|
|
60
|
+
- **Collapsible launchpad** — keys `1`/`2`/`3` toggle Tools/Skills/MCP startup sections.
|
|
61
|
+
|
|
62
|
+
### Developer experience
|
|
63
|
+
|
|
64
|
+
- **`sanook init [--trust]`** — scaffold `.sanook/commands/` starter templates and print brain/MCP/trust next-step hints.
|
|
65
|
+
- **`sanook skill install <name|path>`** — install from bundled catalog or local path (shared resolver with `skill add`).
|
|
66
|
+
|
|
3
67
|
## 0.5.2
|
|
4
68
|
|
|
69
|
+
### TUI startup polish — SANOOK AI Launchpad
|
|
70
|
+
|
|
71
|
+
- **Live startup cockpit signals** — the Sanook launchpad now shows real local readiness, not just brand copy: second-brain configured/missing, MCP server count, loaded skill count, and current git branch. This turns the first screen into a useful service cockpit for Code, Brain, Connect, and Ship workflows, while keeping medium/tiny terminal fallbacks readable.
|
|
72
|
+
- **Big `SANOOK AI` startup banner** — the REPL now opens with a large gradient wordmark plus a compact launchpad for version, account mode, live model, automation mode, cwd, and high-signal slash-command hints. The banner now carries the Sanook identity directly (`งานหนักให้เบาลง · ไม่เบาความรับผิดชอบ · local-first memory`), a signature workflow (`plan -> patch -> prove -> remember`), and a service promise (`readable · recoverable · remembered`). It gives users four memorable service routes: Code (`@file`, tools, diff), Brain (`brain context`, skills, compression), Connect (`MCP`, gateway, webhooks), and Ship (`copy`, cost guard, undo). Hermes-style responsive tiers keep it usable across terminal widths: wide wordmark, compact panel, and tiny text-only fallback. It still renders only before conversation history exists, so command turns do not redraw it into terminal scrollback.
|
|
73
|
+
- **Startup service routes panel** — the empty REPL now also shows a Hermes-style Sanook service-routes panel with Code, Brain, Connect, Ship, System, and Runtime lanes. It tells new users what the CLI can do immediately: edit/run/read tools, second-brain context and worklogs, reusable skills, MCP registry/install/doctor/serve, gateway/webhook work, `/copy` handoff, ask-mode approvals, queued follow-ups, and `/hotkeys`. The panel has compact copy for medium terminals and hides on tiny terminals so the prompt stays usable.
|
|
74
|
+
- **Floating overlay foundation** — `/help` now opens a Hermes-style paged overlay with line/page navigation instead of dumping the full command reference into scrollback. Typing slash-command prefixes or path-like tokens such as `@src/foo`, `./src/`, `~/notes/`, or `/tmp/` now shows a Hermes-style completion float box with command/file metadata; ↑/↓ chooses a row and Tab/Enter completes before the command or prompt is submitted. `/tools` opens a Sanook Tools Hub overlay for built-in file/git/memory/schedule/sub-agent/diagnostics lanes, while `/mcp` opens a Sanook MCP Hub overlay, mapping Hermes' plugins hub idea onto Sanook's extension surface: configured MCP servers, stdio/http transport, target, secret summary, and lazy selected-server testing with `t` so users can see PASS/FAIL and browse the selected server's advertised tool catalog with ↑/↓ or j/k before leaving the REPL. `/hotkeys` opens a dismissible TUI overlay (`Esc`, `Enter`, or `q`). `/model` without args opens an interactive model picker overlay with ↑/↓ or j/k navigation and Enter-to-switch, while `/model <spec>` keeps the existing direct canonical switch behavior. `/skills` opens a read-only Skills Hub overlay for browsing loaded skills and inspecting description/path metadata. `/sessions` opens a Hermes-style Session Switcher for saved sessions in the current project, resumes the highlighted session with Enter, inspects session metadata with `i`, and deletes with a two-press `d` confirmation. This is the reusable Sanook overlay path for the remaining richer help/session surfaces.
|
|
75
|
+
- **Hermes-inspired REPL affordances** — added `/hotkeys`, a bounded queued-message window (`queued (n)` + `…and N more`) with an active row plus `Ctrl+X` deletion while busy, a Sanook tool trail for `tool-call`/`tool-result` events that persists into the assistant transcript after the turn completes and can be toggled with `/trail [compact|expanded]` or `Ctrl+T`, and a Sanook status rule that prioritizes state/model/mode/context/queue over secondary hints, shows elapsed time while working, shows context-compression mode (`cmp sel/hdr/off`) on roomy terminals, shows cost plus cwd/branch on wider terminals, and lets the cwd/branch segment yield before it can wrap or crowd the important left side.
|
|
76
|
+
- **Hermes-style details controls** — `/details thinking hidden|collapsed|expanded` now controls a capped Sanook thinking panel fed by provider reasoning deltas, and `/details tools hidden|collapsed|expanded` maps Hermes' tools section visibility onto Sanook's persisted tool trail (`hidden`, compact/collapsed, expanded). This gives users a cleaner way to tune how much live agent work is visible without losing the quick `/trail` toggle.
|
|
77
|
+
- **Streaming markdown rendering** — assistant live output and saved assistant turns now render common Markdown blocks instead of raw text: headings, block quotes, bullet/numbered lists, fenced code blocks, inline code, and bold spans. The live renderer keeps a Hermes-inspired stable-prefix/unstable-tail split at blank-line boundaries outside code fences, so streaming fenced code and partially-written paragraphs stay readable without pulling in a heavyweight renderer.
|
|
78
|
+
- **Grapheme-safe prompt editing** — the REPL editor now moves the cursor and backspaces by grapheme cluster instead of raw JavaScript code unit. Thai combining marks, emoji, and ZWJ emoji stay intact while editing, matching the direction of Hermes' custom TextInput correctness work without importing its runtime.
|
|
79
|
+
- **Hermes-style paste collapse** — bracketed or multiline paste now normalizes CRLF/newlines and collapses long pasted text (5+ lines or 2k+ chars) into a readable `[[ paste ... ]]` token in the composer. On submit Sanook expands the token back to the original pasted text before running the agent, so the terminal stays readable while the model still receives the full context.
|
|
80
|
+
- **Terminal clipboard bridge** — `/copy [last]` copies the latest assistant response from the REPL. Sanook first tries the native system clipboard (`pbcopy`, PowerShell, `wl-copy`, `xclip`, `xsel`) and falls back to OSC52 terminal clipboard sequences when native tools are unavailable, covering the practical core of Hermes' clipboard work while leaving full mouse-selection parity for later.
|
|
81
|
+
- **Hermes TUI parity map** — added `second-brain/Research/2026-06-18-hermes-tui-parity-map.md` so the remaining rebrand/port work is explicit: overlays, model/session/skills hubs, status rule, virtual transcript, terminal clipboard/mouse support, streaming markdown/persistent tool trails, and skin/theme parity.
|
|
82
|
+
|
|
5
83
|
### Token reduction — selective context compression for stale tool output
|
|
6
84
|
|
|
85
|
+
- **`sanook prompt-size [--json]`** — Hermes-inspired offline prompt budget diagnostic. It reports the current system prompt, personality overlay, auto-memory, skills index, second-brain context, project memory, repo map, git context, built-in tool schemas, and total rough token/byte footprint without calling a model or spawning MCP servers, so users can tune large second-brain/skill setups before context cost becomes invisible.
|
|
7
86
|
- **`contextCompression: "selective" | "headroom" | "off"`** (env `SANOOK_CONTEXT_COMPRESSION`) — default `"selective"` is a zero-LLM, per-step compressor inspired by Selective Context, LongLLMLingua-style query awareness, and Headroom-style context pruning. It keeps the latest tool results full, but compresses older huge tool outputs with recency-aware budgets and preserves anchors plus high-information lines (current-query matches, errors, paths, diffs, code structure, rare terms) before the next model request. `"headroom"` optionally wraps the Vercel AI SDK model with the `headroom-ai` GitHub/npm framework when a Headroom proxy/cloud setup is available; `"off"` disables compression.
|
|
8
87
|
|
|
88
|
+
### Polyglot runtime foundation — Python/Rust without mandatory native deps
|
|
89
|
+
|
|
90
|
+
- **`sanook runtimes [--json]`** — new runtime surface report for Sanook's language strategy. TypeScript remains the npm-distributed control plane; Python is the optional analysis/data/document/ML helper plane; Rust is the optional performance/safety/native-helper plane. The command detects Python, uv, rustc, Cargo, Pyright, and rust-analyzer, then prints install hints without making any of them required for basic Sanook usage.
|
|
91
|
+
- **`run_python` / `run_rust` agent tools** — approval-gated, no-shell runtime tools. `run_python` runs a Python snippet or workspace `.py` file for JSON/CSV transforms, document/text parsing, OCR/ML glue, and research scripts. `run_rust` compiles and runs a single-file Rust snippet or workspace `.rs` file for fast parsers/checkers and type-safe native-helper prototypes. Missing runtimes degrade to clear install messages instead of breaking the agent loop.
|
|
92
|
+
|
|
93
|
+
### Web grounding — true search readiness and source policy
|
|
94
|
+
|
|
95
|
+
- **`sanook web status [--json]` / `sanook web doctor [--json]`** — new diagnostic surface for true web/search/fetch readiness. It clearly separates `sanook search` local retrieval (vault, memory, sessions, skills) from internet search through MCP servers, detects configured web/search/fetch candidates, and optionally probes advertised tools. The report also prints the recommended `research` MCP preset and Sanook's grounding policy.
|
|
96
|
+
- **Agent web-use policy** — the system prompt now tells the agent to use configured web/search/fetch MCP tools for current or volatile external facts, prefer primary sources for technical work, cite source URLs/titles, and treat fetched/search content as untrusted data rather than instructions.
|
|
97
|
+
|
|
9
98
|
### MCP registry UX — discover, install, and diagnose servers
|
|
10
99
|
|
|
11
100
|
- **`sanook mcp search/info/install`** — browse the official MCP registry, inspect transports/packages/secret requirements, and write a ready-to-use stdio or Streamable-HTTP config into `~/.sanook/mcp.json` (or trusted project config with `--project`).
|
|
@@ -170,8 +259,8 @@ A Node-native, zero-dependency Language Server Protocol client (`src/lsp/`) give
|
|
|
170
259
|
The interactive REPL was input-locked while the agent worked, and Ctrl+C quit the whole app. Now a turn is steerable:
|
|
171
260
|
|
|
172
261
|
- **Interrupt mid-turn**: the running turn gets a real `AbortController` (wired into `runAgent`'s `signal`). Press **Esc** (or Ctrl+C) to stop the stream/tool loop right away and return to the prompt — without exiting the app. Partial output is kept for reference, the turn is dropped from the model history, and any files a tool already changed are recoverable via `/rewind`.
|
|
173
|
-
- **Type-ahead queue**: you can type while the agent is busy; pressing Enter **queues** the message
|
|
174
|
-
- Covered by
|
|
262
|
+
- **Type-ahead queue**: you can type while the agent is busy; pressing Enter **queues** the message and it runs automatically as the next turn when the current one finishes. The queue view now keeps an active row, ↑/↓ moves it while the draft is empty, and **Ctrl+X** deletes the selected queued prompt. Interrupting clears the queue.
|
|
263
|
+
- Covered by Ink integration tests (mocked agent) asserting the signal is passed, input queues while busy, Ctrl+X deletes active queued prompts, and Esc both aborts and clears the queue.
|
|
175
264
|
|
|
176
265
|
### Worktree isolation — safe parallel WRITE subagents (`task_parallel isolate:true`)
|
|
177
266
|
|
package/README.md
CHANGED
|
@@ -90,6 +90,7 @@ sanook chat -q "fix the failing test" --provider anthropic
|
|
|
90
90
|
sanook -z "summarise the diff" # one-shot, final output only
|
|
91
91
|
sanook --json "..." # JSONL output for CI / scripts
|
|
92
92
|
sanook status # redacted provider/key/brain/gateway status
|
|
93
|
+
sanook web status # true web-search/fetch readiness + grounding policy
|
|
93
94
|
sanook sessions # list saved sessions for this project
|
|
94
95
|
sanook --resume <session_id> "continue here"
|
|
95
96
|
sanook dump # support snapshot; raw secrets are never printed
|
|
@@ -100,13 +101,15 @@ sanook dump # support snapshot; raw secrets are never printe
|
|
|
100
101
|
| Area | What you get |
|
|
101
102
|
|---|---|
|
|
102
103
|
| **Agent loop** | Built on the Vercel AI SDK 6 (`streamText` + `stopWhen` + `fullStream`), with streamed output, a cost meter, a budget cap, Anthropic **prompt caching** on the static preamble, and rate-limit-aware retry/backoff (distinct from auth failures) with model fallback. |
|
|
103
|
-
| **Tools** | `read_file` · `write_file` · `edit_file` (multi-tier matcher) · `list_dir` · `glob` · `grep` · `run_bash`, plus git tools — gated by a permission layer that denies destructive commands, protected paths, and paths outside the workspace/brain by default. Non-bash tools are timeout-guarded so a runaway read/grep can't hang the loop. |
|
|
104
|
+
| **Tools** | `read_file` · `write_file` · `edit_file` (multi-tier matcher) · `list_dir` · `glob` · `grep` · `run_bash` · `run_python` · `run_rust`, plus git tools — gated by a permission layer that denies destructive commands, protected paths, and paths outside the workspace/brain by default. Non-bash tools are timeout-guarded so a runaway read/grep can't hang the loop. |
|
|
104
105
|
| **Sandbox** | `run_bash` is confined by an OS sandbox — **Seatbelt** on macOS, **bubblewrap** on Linux — so shell writes stay inside the workspace/brain/tmp (reads + network unaffected). Opt out with `SANOOK_NO_SANDBOX=1`. |
|
|
105
106
|
| **Approval** | `ask` mode is the default and prompts `y/n` before any file write or shell command. `--yes` for auto-approve; headless ask-mode safely denies mutations when no approval UI exists. |
|
|
106
107
|
| **Input** | Multiline editing, `↑`/`↓` persisted prompt history, readline keys (Ctrl-A/E/U/K/W), and `@file` mentions that inline a file's contents (or attach an **image** for vision-capable models). |
|
|
107
108
|
| **Checkpoint** | A shadow-git snapshot is taken before each turn; `/rewind` restores the files **and** truncates the conversation — recoverable (it stashes the current state first). |
|
|
108
109
|
| **Memory** | The agent writes its own notes (`remember`), recalls them across past sessions (`recall`), `--continue` resumes the latest run for the current project, `--resume <id>` resumes a specific run, and `sanook sessions` audits/exports/renames/prunes saved conversations. |
|
|
109
110
|
| **Familiar CLI surfaces** | `sanook setup`, `sanook model`, `sanook auth`, `sanook chat -q`, `sanook gateway`, `sanook status`, `sanook sessions`, `sanook dump`, `sanook tools`, and `sanook send` provide familiar management entry points, all Sanook-branded. |
|
|
111
|
+
| **Startup cockpit** | The interactive REPL opens with a Sanook-branded wordmark, service routes (Code, Brain, Connect, Ship), and live readiness signals for second-brain, MCP servers, installed skills, and the current git branch. |
|
|
112
|
+
| **Web grounding** | `sanook web status` separates local brain search from true internet search, detects configured MCP web/search/fetch candidates, and prints Sanook's citation + prompt-injection policy for current external facts. |
|
|
110
113
|
| **Repo map** | A lightweight symbol map of the repo (zero-dep, git-aware) is injected at session start so the agent picks the right files without blind grepping. |
|
|
111
114
|
| **Skills** | Built-in skills + install your own from a GitHub repo, URL, or local path. The agent can also author new skills after a repeatable task. |
|
|
112
115
|
| **Custom commands** | Drop a `.sanook/commands/<name>.md` prompt template and call it as `/<name>` (project commands require trust). Arguments replace `$ARGUMENTS` or `{{ args }}`; without a placeholder they are appended. |
|
|
@@ -118,6 +121,8 @@ sanook dump # support snapshot; raw secrets are never printe
|
|
|
118
121
|
| **Hooks** | Run your own command before/after any tool. A non-zero `PreToolUse` exit blocks the tool — enforce lint, format, or policy. |
|
|
119
122
|
| **Plan mode** | `--plan` restricts the agent to read-only tools and asks it to produce a plan before touching anything. |
|
|
120
123
|
| **Auto-compaction** | A token-aware sliding window keeps long sessions under the context limit with zero extra LLM cost. |
|
|
124
|
+
| **Prompt budget inspectability** | `sanook prompt-size [--json]` reports the offline size of Sanook's system prompt, personality overlay, auto-memory, skills index, second-brain context, project memory, repo map, git context, and built-in tool schemas. |
|
|
125
|
+
| **Polyglot runtime surface** | `sanook runtimes [--json]` shows optional Python/Rust readiness. The agent gets `run_python` for data/document/ML-style helper scripts and `run_rust` for small performance/safety-critical helpers, both approval-gated and no-shell. |
|
|
121
126
|
| **Second brain** | `sanook brain init` scaffolds a structured Obsidian "second-brain" workspace (folders + `_Index` + a portable AI operating constitution) for organising work and giving the agent durable, cross-session memory. |
|
|
122
127
|
|
|
123
128
|
## Providers
|
|
@@ -165,6 +170,10 @@ sanook sessions stats [--all]
|
|
|
165
170
|
sanook sessions prune --keep N [--all] [--yes]
|
|
166
171
|
sanook sessions rm <id>
|
|
167
172
|
sanook dump [--show-keys] support dump (keys are still redacted)
|
|
173
|
+
sanook prompt-size [--json] inspect system/brain/skill/tool context budget
|
|
174
|
+
sanook runtimes [--json] inspect optional Python/Rust runtime surface
|
|
175
|
+
sanook web status [--json] inspect true web-search/fetch readiness
|
|
176
|
+
sanook web doctor [--json] probe web/search/fetch MCP candidates
|
|
168
177
|
sanook -c "<task>" resume the latest session for this project
|
|
169
178
|
sanook --resume <id> resume a specific saved session
|
|
170
179
|
sanook --continue-any resume the newest session across all projects
|
|
@@ -463,13 +472,16 @@ sanook mcp search gitlab
|
|
|
463
472
|
sanook mcp info com.gitlab/mcp
|
|
464
473
|
sanook mcp install com.gitlab/mcp --name gitlab
|
|
465
474
|
sanook mcp preset dev
|
|
475
|
+
sanook mcp preset research
|
|
466
476
|
sanook mcp test gitlab
|
|
467
477
|
sanook mcp doctor
|
|
478
|
+
sanook web status
|
|
479
|
+
sanook web doctor
|
|
468
480
|
```
|
|
469
481
|
|
|
470
482
|
Use `--env KEY=value` or `--header KEY=value` when a registry entry requires secrets, and `--project` to write to a trusted project `.sanook/mcp.json`. Some hosted MCP endpoints may return `401 Unauthorized` until you pass an auth header, even when the registry entry does not declare it yet. You can still add servers manually: `sanook mcp add fs npx -y @modelcontextprotocol/server-filesystem /path` (stdio) or `sanook mcp add remote https://example.com/mcp` (a URL is detected as remote HTTP).
|
|
471
483
|
|
|
472
|
-
Their tools are merged into the agent's toolset automatically. `/tools` in the REPL lists everything currently available.
|
|
484
|
+
Their tools are merged into the agent's toolset automatically. `/tools` in the REPL lists everything currently available. `sanook search` is local retrieval over the second brain, sessions, memory, and skills; true internet search comes from configured MCP web/search/fetch servers. Use `sanook web status` to see which web candidates are configured, and `sanook web doctor` to probe their advertised tools.
|
|
473
485
|
|
|
474
486
|
sanook is also an MCP **server**: `sanook mcp serve` exposes your brain (`sanook_search` / `sanook_recall` / `sanook_remember` / `sanook_index` / `sanook_stats`) over stdio, so Claude Desktop, Cursor, or any MCP host can query it:
|
|
475
487
|
|
|
@@ -518,7 +530,7 @@ Quality-neutral knobs in `~/.sanook/config.json` (or the matching `SANOOK_*` env
|
|
|
518
530
|
| — | `SANOOK_SUBAGENT_MODEL=haiku` | run all sub-agent work (exploration/search) on a cheaper model while the main agent keeps the strong one |
|
|
519
531
|
| `summaryModel <spec>` | `SANOOK_SUMMARY_MODEL=<spec>` | model used for summarize-compaction (default: the fast sibling of your main model) |
|
|
520
532
|
| `embeddingModel <spec>` | `SANOOK_EMBEDDING_MODEL=<spec>` | model used for semantic search embeddings (for example `openai:text-embedding-3-small`) |
|
|
521
|
-
| `thinking 4000` | `SANOOK_THINKING=4000` | opt-in Anthropic extended thinking on the main agent
|
|
533
|
+
| `thinking on` / `thinking 4000` | `SANOOK_THINKING=on` / `4000` | opt-in Anthropic extended thinking on the main agent; use `on`, `true`, or `yes` for the default budget, `off`, `false`, or `no` to disable, or a positive integer for `budgetTokens` |
|
|
522
534
|
|
|
523
535
|
Read-side savings are automatic: the agent reads file ranges (`read_file` with `offset`/`limit`) and edits with minimal `old_string` / `replace_all` rather than rewriting whole files.
|
|
524
536
|
|
package/README.th.md
CHANGED
|
@@ -133,7 +133,10 @@ Microsoft Teams ตอนนี้รองรับ proactive delivery/cron ผ
|
|
|
133
133
|
- **BYOK + 9 providers** — Anthropic, Google, OpenAI, xAI, Mistral, Groq, Ollama, LM Studio, Codex
|
|
134
134
|
- **Familiar CLI** — `sanook setup`, `sanook model`, `sanook auth`, `sanook chat -q`, `sanook gateway`, `sanook status`, `sanook sessions`, `sanook dump`, `sanook tools`, `sanook send`
|
|
135
135
|
- **Second brain** — `sanook brain init` สร้าง workspace Obsidian ให้ AI จำงานข้ามวัน
|
|
136
|
-
- **
|
|
136
|
+
- **Startup cockpit** — เปิด `sanook` แล้วเห็น wordmark, service routes (Code, Brain, Connect, Ship), และสัญญาณ readiness จริงของ second-brain, MCP, skills, git branch ทันที
|
|
137
|
+
- **Web grounding** — `sanook web status` แยก local brain search ออกจาก true internet search, ตรวจ MCP web/search/fetch ที่ตั้งไว้, และโชว์ policy เรื่อง citation + prompt-injection จากเว็บ
|
|
138
|
+
- **Tools** — อ่าน/เขียน/แก้ไฟล์ · รัน bash/Python/Rust แบบ approval-gated · git · grep/glob พร้อม permission gate
|
|
139
|
+
- **Polyglot runtime** — TypeScript เป็น control plane หลัก; Python ใช้กับ data/document/ML helper ผ่าน `run_python`; Rust ใช้กับ helper ที่ต้องเร็ว/type-safe ผ่าน `run_rust`; ไม่มี runtime ก็ไม่ทำให้ Sanook install พัง
|
|
137
140
|
- **Gateway + cron** — `sanook gateway run` (alias: `sanook serve`) รัน 24/7 + ตั้งงานล่วงหน้า + ต่อ Telegram/Discord/Slack/Mattermost/Home Assistant/Email/LINE/SMS/ntfy/Signal/WhatsApp/Matrix/Google Chat/BlueBubbles/Teams/Webhooks; task ใช้ `--to` เพื่อส่งผลลัพธ์กลับไปยัง messaging target ได้
|
|
138
141
|
- **Messaging setup/send** — `sanook gateway setup telegram|discord|slack|mattermost|homeassistant|email|line|sms|ntfy|signal|whatsapp|matrix|googlechat|bluebubbles|teams|webhooks` บันทึก token/allowlist หรือ SMTP/IMAP/LINE/Twilio/ntfy/Mattermost/Home Assistant/Signal/WhatsApp/Matrix/Google Chat/BlueBubbles/Teams/Webhook config; `sanook gateway run` เริ่ม Telegram long-polling, Discord Gateway, Slack Socket Mode, Mattermost REST/WebSocket, Home Assistant state-change WebSocket, Email IMAP polling + SMTP threaded replies, LINE webhook, Twilio SMS webhook, ntfy topic stream, Signal ผ่าน `signal-cli` HTTP/SSE, WhatsApp Cloud webhook + Graph Messages API, Matrix Client-Server sync/send, Google Chat outbound ผ่าน incoming webhook/Chat REST API, BlueBubbles outbound ผ่าน REST API, Teams Incoming Webhook/Graph delivery และ generic webhooks เมื่อ config พร้อม; history ถูกเก็บต่อ platform/target และถ้าคำตอบสุดท้ายเป็น `[SILENT]`, `SILENT`, `NO_REPLY`, หรือ `NO REPLY` จะบันทึกไว้แต่ไม่ส่งกลับ; `sanook send --to telegram|discord|slack|mattermost|homeassistant|email|line|sms|ntfy|signal|whatsapp|matrix|googlechat|bluebubbles|teams "..."`, `sanook webhook subscribe` และ `sanook cron add --to ...` ใช้กฎส่งออกชุดเดียวกัน
|
|
139
142
|
- **MCP + Skills** — ต่อ MCP server ได้ + มี built-in skills และติดตั้งเพิ่มได้
|
|
@@ -155,6 +158,10 @@ sanook sessions stats --all
|
|
|
155
158
|
sanook sessions prune --keep 20 --yes
|
|
156
159
|
sanook sessions rm <id> # ลบ session
|
|
157
160
|
sanook dump [--show-keys] # support dump; key ยังถูก redact
|
|
161
|
+
sanook prompt-size # ดู context/prompt budget แบบ offline
|
|
162
|
+
sanook runtimes # ดู Python/Rust optional runtime ที่ Sanook ใช้ได้
|
|
163
|
+
sanook web status # ดู true web-search/fetch readiness ผ่าน MCP
|
|
164
|
+
sanook web doctor # probe MCP web/search/fetch candidates
|
|
158
165
|
```
|
|
159
166
|
|
|
160
167
|
ตั้งค่า default model ได้ด้วย:
|
package/dist/approval.js
CHANGED
|
@@ -6,6 +6,8 @@ export const MUTATE_TOOLS = new Set([
|
|
|
6
6
|
'write_file',
|
|
7
7
|
'edit_file',
|
|
8
8
|
'run_bash',
|
|
9
|
+
'run_python',
|
|
10
|
+
'run_rust',
|
|
9
11
|
'git_commit',
|
|
10
12
|
'schedule_task',
|
|
11
13
|
'cancel_scheduled',
|
|
@@ -30,6 +32,7 @@ const READ_ONLY_TOOLS = new Set([
|
|
|
30
32
|
'ha_list_entities',
|
|
31
33
|
'ha_get_state',
|
|
32
34
|
'ha_list_services',
|
|
35
|
+
'web_fetch',
|
|
33
36
|
]);
|
|
34
37
|
export function isReadOnlyTool(tool) {
|
|
35
38
|
return READ_ONLY_TOOLS.has(tool);
|
|
@@ -43,6 +46,10 @@ export function summarizeToolCall(tool, input) {
|
|
|
43
46
|
switch (tool) {
|
|
44
47
|
case 'run_bash':
|
|
45
48
|
return `$ ${String(i.cmd ?? '')}`;
|
|
49
|
+
case 'run_python':
|
|
50
|
+
return i.path ? `python ${String(i.path)}` : `python snippet (${String(i.code ?? '').length} chars)`;
|
|
51
|
+
case 'run_rust':
|
|
52
|
+
return i.path ? `rustc ${String(i.path)} && run` : `rust snippet (${String(i.code ?? '').length} chars)`;
|
|
46
53
|
case 'write_file':
|
|
47
54
|
return `เขียนไฟล์ ${String(i.path ?? '')}`;
|
|
48
55
|
case 'edit_file':
|