@turmind/halo 1.5.6 → 1.5.8

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 (44) hide show
  1. package/admin-out/404.html +1 -1
  2. package/admin-out/_next/static/chunks/989-df2401d289d09a7e.js +1 -0
  3. package/admin-out/_next/static/chunks/app/page-ed2976abf85a335d.js +1 -0
  4. package/admin-out/index.html +1 -1
  5. package/admin-out/index.txt +4 -4
  6. package/bundled-docs/design/agent.md +7 -7
  7. package/bundled-docs/design/architecture.md +13 -11
  8. package/bundled-docs/design/canvas-extensions.md +3 -1
  9. package/bundled-docs/design/express-self.md +16 -7
  10. package/bundled-docs/design/storage.md +11 -3
  11. package/bundled-docs/design/ws.md +1 -0
  12. package/bundled-docs/dev/add-model-provider.md +45 -27
  13. package/bundled-docs/dev/deploy.md +1 -1
  14. package/bundled-docs/dev/desktop-packaging.md +4 -3
  15. package/bundled-docs/dev/env.md +1 -1
  16. package/bundled-docs/guide/agents.md +3 -3
  17. package/bundled-docs/guide/cli.md +15 -5
  18. package/bundled-docs/guide/getting-started.md +1 -1
  19. package/bundled-docs/requirements/chat.md +2 -2
  20. package/bundled-docs/requirements/settings.md +2 -1
  21. package/dist/index.js +1545 -1152
  22. package/package.json +1 -1
  23. package/templates/canvas/self.html +162 -10
  24. package/templates/models/anthropic.yaml +2 -0
  25. package/templates/models/aws-bedrock-claude-invoke.yaml +2 -0
  26. package/templates/models/aws-bedrock-mantle.yaml +2 -0
  27. package/templates/models/aws-bedrock-openai.yaml +2 -0
  28. package/templates/models/deepseek.yaml +2 -0
  29. package/templates/models/doubao.yaml +2 -0
  30. package/templates/models/hunyuan.yaml +2 -0
  31. package/templates/models/kimi.yaml +2 -0
  32. package/templates/models/mimo-token-plan-china.yaml +2 -0
  33. package/templates/models/minimax.yaml +2 -0
  34. package/templates/models/openai.yaml +2 -0
  35. package/templates/models/qwen.yaml +2 -0
  36. package/templates/models/zhipu.yaml +2 -0
  37. package/templates/skills/extension/SKILL.md +30 -2
  38. package/templates/skills/extension/config.yaml +2 -2
  39. package/templates/skills/extension/templates/ext.sh +69 -16
  40. package/templates/skills/self/SKILL.md +23 -4
  41. package/admin-out/_next/static/chunks/989-e0faeff1c4a0b0b9.js +0 -1
  42. package/admin-out/_next/static/chunks/app/page-44f707ea8dad57da.js +0 -1
  43. /package/admin-out/_next/static/{visjvN510yFK-Ff5zwx-0 → T3x-q3QCOgSpfydoH53XD}/_buildManifest.js +0 -0
  44. /package/admin-out/_next/static/{visjvN510yFK-Ff5zwx-0 → T3x-q3QCOgSpfydoH53XD}/_ssgManifest.js +0 -0
@@ -224,7 +224,7 @@ This installs the `halo` binary on `$PATH`. Subcommands available:
224
224
  ### Upgrade flow
225
225
 
226
226
  1. `halo upgrade` — bumps the on-disk npm package
227
- 2. `halo server restart` — server's startup check sees `~/.halo/global/.template-version` is behind the new bundled `TEMPLATE_VERSION`, runs `ensureHaloHome` automatically, then starts. Refreshes `docs/`, built-in agents, built-in skills, system prompts, and the model registry. User-owned files (USER.md, custom agents/skills, INSTRUCTIONS.md overrides) are left alone. See `init.ts` for the per-category overwrite policy.
227
+ 2. `halo server restart` — server's startup check sees `~/.halo/global/.template-version` is behind the new bundled `TEMPLATE_VERSION`, runs `ensureHaloHome` automatically, then starts (`halo cli` / `halo tui` run the same check on start, so a CLI-only install refreshes without a server). Refreshes `docs/`, built-in agents, built-in skills, system prompts, and the model registry. User-owned files (USER.md, custom agents/skills, INSTRUCTIONS.md overrides) are left alone. See `init.ts` for the per-category overwrite policy.
228
228
 
229
229
  ### Public release command reference
230
230
 
@@ -374,9 +374,10 @@ Still good practice: build server + admin **before** `pnpm dist:arm64`.
374
374
 
375
375
  - **Changing anything under `templates/` requires bumping `TEMPLATE_VERSION`
376
376
  (`packages/server/src/init.ts`) — otherwise the change never reaches existing
377
- installs.** Server startup only re-runs `ensureHaloHome` (the template
378
- reseed) when the on-disk `~/.halo/global/.template-version` is *strictly less
379
- than* the compiled `TEMPLATE_VERSION` (`index.ts` startup block). Equal → the
377
+ installs.** Server startup (and `halo cli` / `halo tui` start) only re-runs
378
+ `ensureHaloHome` (the template reseed) when the on-disk
379
+ `~/.halo/global/.template-version` is *strictly less than* the compiled
380
+ `TEMPLATE_VERSION` (`init.ts` `refreshTemplatesIfOutdated`). Equal → the
380
381
  whole reseed is skipped, so a template edit with no version bump is invisible
381
382
  to every machine that already has the prior version stamped. This bit the
382
383
  `team`-delegation rewrite: `default/AGENT.md` gained the "team whitelist"
@@ -82,7 +82,7 @@ Three config file types, precedence **env vars > config.yaml / settings.yaml > c
82
82
  | `~/.halo/secrets/settings.yaml` | User | Provider secrets, skill params, `general.*` server knobs (session, compaction, limits, sandbox, logging) — "preferences" |
83
83
  | `<project>/.halo/settings.yaml` | Project | Overrides of provider / skill `params` and `secrets`; every `general.*` key is global-only (a workspace value is rejected by the API and ignored at runtime) |
84
84
 
85
- `init.ts` seeds these on first run with a per-category policy. Refresh trigger: `halo setup` always re-runs the seed, and the server's startup check re-runs it automatically when `~/.halo/global/.template-version` is behind the bundled `TEMPLATE_VERSION` (see `init.ts:TEMPLATE_VERSION` + `index.ts` startup block).
85
+ `init.ts` seeds these on first run with a per-category policy. Refresh trigger: `halo setup` always re-runs the seed, and the startup check re-runs it automatically when `~/.halo/global/.template-version` is behind the bundled `TEMPLATE_VERSION` — on server start and at the start of `halo cli` / `halo tui` (`init.ts` `refreshTemplatesIfOutdated`, called from `index.ts` and the CLI's `harness.ts` `initRuntime`; a never-seeded home is left to `halo setup`).
86
86
 
87
87
  - **Always overwritten** (platform-owned, refreshed when the template version moves): `~/.halo/global/{prompts,models,docs}/`, `INSTRUCTIONS.md`, the built-in agent ids (`default`, `executor`, `deep-executor`, `goal`, `__evo_agent__`, `__score__`, `__apply_agent__`), built-in skill ids (`agent`, `skill`, `workspace`, `cron`, `acp`, `send-file`, `aws-knowledge`, `web-search`, `self`, `halo`, `extension`).
88
88
  - **Built-in agents** keep the user's `model:` and `context:` blocks on overwrite — the admin UI lets users change which model an agent uses and its context limits, and that choice survives upgrades.
@@ -42,7 +42,7 @@ Click an agent in the sidebar to open the right-hand editor. Two views:
42
42
  Data-driven form for name / description / model / tools / skills / thinking. Changes auto-save about half a second after you stop editing — there's no Save button. The agent's AGENT.md is shown below the form as a read-only preview.
43
43
 
44
44
  **Model section** has four fields:
45
- - `provider` — dropdown populated from `~/.halo/global/models/*.yaml`
45
+ - `provider` — dropdown populated from `~/.halo/global/models/*.yaml` plus hub-installed `~/.halo/global/models.d/*.yaml` (`/extension models`; updates the list live)
46
46
  - `id` — combobox (input + datalist); preset options filtered by current provider, also accepts manual input of any model ID
47
47
  - `endpoint` — combobox (input + datalist); full endpoint URL (e.g. `https://bedrock-runtime.ap-northeast-1.amazonaws.com`), supports custom proxy URLs
48
48
  - `maxTokens` — optional; defaults to `maxOutputTokens` in the provider yaml
@@ -227,6 +227,6 @@ With `export NANO_BANANA_KEY=sk-xxx` in the env, the agent's system prompt gets
227
227
 
228
228
  ## Model registry — adding a new provider
229
229
 
230
- Halo ships 13 providers (`aws-bedrock-claude-invoke`, `aws-bedrock-mantle`, `aws-bedrock-openai`, `anthropic`, `openai`, `kimi`, `deepseek`, `minimax`, `qwen`, `hunyuan`, `doubao`, `zhipu`, `mimo-token-plan-china`); each one is a yaml under `~/.halo/global/models/` plus a matching case in [packages/server/src/agents/model-runtime.ts](../../../packages/server/src/agents/model-runtime.ts). For any OpenAI- or Anthropic-compatible endpoint you don't need new code: pick `openai` or `anthropic` as the provider and fill in the endpoint and model id in Form view.
230
+ Halo ships 13 providers (`aws-bedrock-claude-invoke`, `aws-bedrock-mantle`, `aws-bedrock-openai`, `anthropic`, `openai`, `kimi`, `deepseek`, `minimax`, `qwen`, `hunyuan`, `doubao`, `zhipu`, `mimo-token-plan-china`); each one is a yaml under `~/.halo/global/models/` (refreshed between releases by `/extension models`, which installs newer copies into `~/.halo/global/models.d/`) whose `runtime:` field names the implementation in [packages/server/src/agents/model-runtime.ts](../../../packages/server/src/agents/model-runtime.ts) (e.g. `anthropic-messages`, `openai-chat`, `bedrock-invoke`). For any OpenAI- or Anthropic-compatible endpoint you don't need new code: pick `openai` or `anthropic` as the provider and fill in the endpoint and model id in Form view.
231
231
 
232
- A truly new provider takes a yaml manifest plus a runtime case; the step-by-step is in [dev/add-model-provider.md](../dev/add-model-provider.md). If you drop a provider yaml without a runtime case, session spawn fails with `Unknown provider "..."`.
232
+ A provider that speaks an existing wire protocol needs only a yaml manifest with that `runtime:`; a new protocol also needs a runtime class. The step-by-step is in [dev/add-model-provider.md](../dev/add-model-provider.md). A provider yaml without `runtime:` (or with a name Halo doesn't know) makes session spawn fail with an error naming the yaml; for a bundled provider that means the seed is stale — run `halo setup` or restart the Halo server.
@@ -144,7 +144,7 @@ Multi-turn conversation. Supports all standard Halo slash commands:
144
144
  | `/workspace setup` / `/workspace tidy` / `/workspace share` | Set up / tidy the `.halo/` knowledge files, or export a shareable bundle (workspace skill) |
145
145
  | `/cron <verb>` | Manage scheduled agent runs: `create` / `list` / `update` / `enable` / `disable` / `delete` |
146
146
  | `/acp <verb>` | Ask other agents over ACP (`kiro <q>` / `claude <q>`) and manage `ask-*` bindings (`add` / `list` / `remove`) |
147
- | `/extension <verb>` | Canvas preview extensions: `install` / `list` / `remove` (full access only) |
147
+ | `/extension <verb>` | Canvas preview extensions: `install` / `list` / `remove`; `models` updates the model provider list from the hub (full access only) |
148
148
  | `/evo [hint]` | Queue a self-evolution run on this session (full access only) |
149
149
  | `/quit` | Exit |
150
150
 
@@ -211,6 +211,15 @@ Attach files or images to your message with `@file` and `@image`, or pull a dire
211
211
  - **Images**: skipped if larger than 5MB
212
212
  - If the current model does not support vision, a warning is shown and images are ignored
213
213
 
214
+ ## Model provider configs (`halo models`)
215
+
216
+ ```bash
217
+ halo models install <dir> [--yes] # install <dir>/*.yaml into ~/.halo/global/models.d/
218
+ halo models list # id · copy in effect (bundled | hub) · revision · runtime
219
+ ```
220
+
221
+ Normally run for you by `/extension models`, which downloads the hub's newest `models-v*` release (https GitHub / Gitea / Forgejo / GitLab only) and passes the unpacked directory to `halo models install`. Per provider id the copy with the higher `revision` is in effect (tie → the `models.d` copy); an older one is skipped, an identical one reported up to date. Refused per provider: a `runtime:` this halo doesn't know (needs a newer halo), no `revision`, a `secrets[].default` that isn't empty or `<<ENV_NAME>>`. If any provider is new or changes `defaultEndpoint` / `endpointPresets`, the changes are listed, **nothing is written**, and the exit code is `3` — re-run with `--yes` to apply. Writes are atomic (tmp + rename); a running server reloads its registry from `models.d/` without a restart and pushes the change to open admin pages. Existing agents keep the model / endpoint in their own `agent.yaml`. Exit codes: `0` ok (refusals listed in the summary line), `1` error, `3` needs `--yes`. To undo, delete the file from `~/.halo/global/models.d/`.
222
+
214
223
  ## Server Mode (background daemon)
215
224
 
216
225
  `halo server start|stop|restart|status|logs` manages a local server from the
@@ -251,7 +260,8 @@ Session prefix: `cli_`. Sessions are persisted to `<workspace>/.halo/sessions/`
251
260
  ### Initialization
252
261
 
253
262
  `tui` / `cli` / `agents` / `sessions` refuse to run ("~/.halo/global/ not initialized. Run halo setup first.") until `halo setup` has seeded `~/.halo/global/`. Then the CLI replicates the server's init sequence (`initRuntime()` in `harness.ts`):
254
- 1. `initLogger()` — redirect console to stderr + file logger
255
- 2. `initBwrapCheck()` — probe sandbox availability
256
- 3. `setSandboxHiddenPaths()` — configure sandbox paths
257
- 4. `new SessionManager(workspace)` — create agent session manager (the workspace's `.halo/` is seeded via `ensureWorkspaceHalo`)
263
+ 1. `refreshTemplatesIfOutdated()` — the server's template startup check: when `~/.halo/global/.template-version` is behind the bundled `TEMPLATE_VERSION` (typically right after `halo upgrade`), re-seed `~/.halo/global/` before anything reads the models registry; logs `[CLI] Templates outdated (vX → vY), refreshing ~/.halo/global/` to stderr. Runs once per upgrade — afterwards the stamp matches and it's a single file read
264
+ 2. `initLogger()` — redirect console to stderr + file logger
265
+ 3. `initBwrapCheck()` — probe sandbox availability
266
+ 4. `setSandboxHiddenPaths()` — configure sandbox paths
267
+ 5. `new SessionManager(workspace)` — create agent session manager (the workspace's `.halo/` is seeded via `ensureWorkspaceHalo`)
@@ -77,7 +77,7 @@ After `halo setup`:
77
77
  └── channels/channels.db ← per-channel account state
78
78
  ```
79
79
 
80
- **When does "refreshed on upgrade" actually run?** `halo setup` always re-runs the seed; the server's startup check also re-runs it automatically when `~/.halo/global/.template-version` is behind the bundled `TEMPLATE_VERSION`. So the routine flow `halo upgrade && halo server restart` is enough — no need to remember `halo setup`.
80
+ **When does "refreshed on upgrade" actually run?** `halo setup` always re-runs the seed; the server's startup check — and the same check at the start of `halo cli` / `halo tui` — also re-runs it automatically when `~/.halo/global/.template-version` is behind the bundled `TEMPLATE_VERSION`. So the routine flow `halo upgrade && halo server restart` is enough — no need to remember `halo setup` — and a CLI-only user just runs `halo cli` / `halo tui` after `halo upgrade`.
81
81
 
82
82
  **Server-refreshed**: `INSTRUCTIONS.md`, `prompts/`, `models/`, `docs/`, the built-in agent ids (`default`, `executor`, `deep-executor`, `goal`, `__evo_agent__`, `__score__`, `__apply_agent__`), and the built-in skill ids (`agent`, `skill`, `workspace`, `cron`, `acp`, `send-file`, `self`, `aws-knowledge`, `web-search`, `halo`, `extension`). To customize one, copy it into the workspace scope (`<project>/.halo/...`) — workspace replaces global at runtime.
83
83
 
@@ -32,7 +32,7 @@ A Bug-icon **Debug** button in the composer's left control cluster (next to the
32
32
  ### User-message actions (Expand / Copy / Delete)
33
33
  Actions on user-role turns: the blue sticky user bubble, plus the sub-agent-report (green) and compact-summary (purple) callouts — all three share the same Copy/Delete pair. The icons are **always visible** (not hover-only). On the callouts, Copy copies the body only (the `(from: session X)` / `[Conversation Summary…]` marker line is stripped); a deleted callout greys out and gains a "deleted" badge like the bubble does:
34
34
  - **Expand / Collapse** — from a **header row**, not an icon in the action group (the top-right expand arrow was removed in 1.5.3-alpha):
35
- - **User bubble**: the header row holds a chevron, the send time and, while collapsed, a preview (the first 20 characters, then `…`). A long message is **collapsed by default**: the body height is 0, so only the header row shows. Clicking anywhere on the row toggles it.
35
+ - **User bubble**: every message is a single header row — a marker, the send time and a one-line preview. A message that fits on that row (no line breaks) shows a muted `·` marker and has nothing to expand. One that has line breaks or overflows the row shows a chevron, is **collapsed by default**, and its preview is cut by width with `…` (a multi-line message previews its first line plus `…`); clicking anywhere on the row shows the full body below. The `·` and the chevron are the same width, so the times line up. Whether a message overflows is re-measured when the panel width changes.
36
36
  - **Report callout**: its "Report from sub-session" title row toggles the same way.
37
37
  - The chevron only appears when the body is actually clamped; a short body has no chevron and its row does nothing on click.
38
38
  - An expanded body is capped at 40vh and scrolls inside the bubble, because the bubbles are sticky.
@@ -97,7 +97,7 @@ When `contextEnabled` is on (default), user messages are auto-prepended with:
97
97
  - Clipboard paste
98
98
  - File-picker button
99
99
 
100
- Images ride along as base64; multimodal supported. Pasted images are also persisted to `<workspace>/.halo/assets/web/inbound/web/<date>/` so a `[图片已保存: /abs/path]` marker survives page reload and renders as a click-to-preview chip (shared with the WeChat channel's inbound media flow).
100
+ Images ride along as base64; multimodal supported. Before sending, every attachment is downscaled (long edge ≤ 1568) and re-encoded as JPEG; an SVG is rasterized the same way (long edge 1024, on white), since vision input only takes jpeg / png / gif / webp. An image the browser can't decode (e.g. HEIC / TIFF in Chrome) and that isn't one of those four is refused when attached, with an inline notice naming the file — it is never sent only to be dropped server-side. Pasted images are also persisted to `<workspace>/.halo/assets/web/inbound/web/<date>/` so a `[图片已保存: /abs/path]` marker survives page reload and renders as a click-to-preview chip (shared with the WeChat channel's inbound media flow).
101
101
 
102
102
  ### Inline media chips
103
103
  Any message containing `[图片/视频/语音/文件 已保存: /path]` markers (WeChat + web) or a leading `MEDIA: /path` line (agent-emitted, e.g. from `wechat-send`) renders a compact chip with filename + icon. Clicking opens a full-size preview modal (image/video/audio inline, file → download link). The modal has a Download button (top-right, next to close) for image/video/audio; the media URL carries a per-open cache-buster (`&t=<timestamp>`) so overwritten files (same path, new bytes) always show current content. Paths inside the active workspace or under the OS temp dir (`/tmp/`) are previewable; everything else degrades to a non-clickable chip.
@@ -62,7 +62,8 @@ Schema lives **inside the package**, alongside its other files:
62
62
  ### Provider secrets — `models/<provider-id>.yaml`
63
63
 
64
64
  ```yaml
65
- id: aws-bedrock-claude-invoke
65
+ id: aws-bedrock-claude-invoke # provider identity — also the settings namespace below
66
+ runtime: bedrock-invoke # implementation class; not part of the settings schema
66
67
  displayName: AWS Bedrock Claude (Invoke API)
67
68
  defaultEndpoint: https://bedrock-runtime.us-west-2.amazonaws.com
68
69