Commit Graph

7493 Commits

Author SHA1 Message Date
eeee0717
7a3db86567 fix(code-cli): fix oxlint import() annotations and Linux-CI test failure
oxlint's consistent-type-imports rule bans `import()` type annotations;
the two `importOriginal<typeof import(...)>()` mock helpers needed the
oxlint-disable comment already used elsewhere in the codebase for this
pattern.

The shell-quoting test pinned `isMac`/`isWin` but not `process.platform`,
which CodeCliService's terminal-launch switch branches on directly. On
Linux CI runners this fell through to the Linux/xterm branch instead of
the macOS branch the test asserts on, producing unescaped output.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-08 15:32:20 +08:00
eeee0717
988c38e44b fix(code-cli): shell-quote terminal-launch command and adjacent fixes
Resolve AtomsH4's review on #16491:

- A4 (blocker): shell-quote provider-derived fragments in the terminal-launch
  command. New shellQuote.ts (posixQuote / escapeForDoubleQuotes /
  isShellSafeModelId); OpenCode `model` is validated + rejected on unsafe ids;
  `directory` is single-quoted in the macOS fullCommand and Linux xterm arg;
  terminals.ts escapes `'` for the `osascript -e` layer and single-quotes the
  raw directory + $/backtick-escapes fullCommand in the kitty/alacritty/wezterm/
  ghostty adapters.
- A3: only update currentProvider/connection after clearCliConfig (and the
  own-login write) succeed, so a failed scrub can't leave a half-updated
  active-provider state.
- A1: parse .env via the real dotenv loader (handles `export ` prefix, inline
  comments, and multi-line quoted values), and quote newline values on render
  so scrubbing a managed key can't corrupt an adjacent user value.
- B7: redirect a persisted /app/openclaw pinned tab to /app/code on restore.

Regression tests cover model/directory with spaces/quotes/$()/backticks, the
clear-failure state ordering, dotenv export/comment/multiline round-trips, and
the OpenClaw pinned-tab recovery.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-08 15:16:21 +08:00
eeee0717
cc243363b1 refactor(code-cli): consolidate per-CLI config dispatch into adapter registry
Collapse the nine scattered `switch (cliTool)` sites across the cliConfig
layer (draft/draftUpdater/clear/parser/sanitize/providerMatching) into a
single `CLI_CONFIG_ADAPTERS` registry — one `CliConfigAdapter` per file-based
CLI. Each dispatch function is now a thin `getAdapter(cliTool).method()`
lookup, so adding a CLI touches one adapter instead of every switch.

- New `adapters.ts`: `CliConfigAdapter` interface + 6 adapters + `getAdapter`
  + the `sanitizeCliConfigBlob` dispatcher (moved from sanitize.ts, which now
  holds only the pure per-CLI sanitizers).
- Registry typed as a total `Record<FileConfiguredCli, CliConfigAdapter>`
  (keyed off `CLI_CONFIG_TARGETS`), so a missing/extra adapter is a compile
  error; a runtime completeness test also guards targets + own-login shape.
- Shared arg/context types moved to the neutral `types.ts` to break the
  adapters<->draft import cycle.
- Behavior-preserving: the existing per-CLI parity tests stay green; adds
  registry-completeness, 6-CLI updateDraftConfig/extractConfig, and own-login
  disk-read glue coverage (182 cliConfig tests).

Resolves the reviewer suggestion to centralize per-CLI config dispatch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-08 14:23:33 +08:00
eeee0717
b7100bd88c Merge remote-tracking branch 'upstream/main' into refactor/code-cli
Resolve conflicts from #16782 (TopView god-component → imperative popup/toast
tracks), which removed the window.toast/window.modal/window.popup globals:

- pages/openclaw/{OpenClawPage,UpdateButton}.tsx (modify/delete): keep the
  branch's deletion. v2 rebuilt OpenClaw into the Code CLI page (c65367a173);
  main only did a mechanical window.toast→toast rename on the removed files.
- pages/code/{CodeCliPage.tsx, __tests__/CodeCliPage.test.tsx} (content): keep
  the branch's rebuilt page/test — main's only edit was the same toast rename,
  which N/A's on the rewritten page (it never used window.toast).
- Migrate the branch's remaining code-page window.toast usage (6 hooks/
  components) to the new @renderer/services/toast service, and switch the 4
  affected tests to the globally-mocked toast from tests/renderer.setup.ts.
2026-07-08 10:34:07 +08:00
fullex
e5e988f11b chore(migration): raise V1_REQUIRED_VERSION to 1.9.12
The final v1 release is expected around 1.9.12 (with at most 1-2 more
patches to follow), so raise the migration gate's minimum required v1
version from 1.9.0 to 1.9.12. Update the versionPolicy tests and the
migration README to match the new floor.
2026-07-07 07:13:46 -07:00
亢奋猫
9127ab44cc fix(ai-stream): restore stream after tab switch (#16816)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-07-07 22:02:18 +08:00
Gu JiaMing
5d1b94041b fix(composer): update follow-up steer affordance (#16804)
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-07-07 21:51:08 +08:00
Gu JiaMing
840a47ccda fix(selection-assistant): prevent assistant selector overflow (#16797)
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-07-07 21:50:46 +08:00
Gu JiaMing
271408d512 fix(renderer-typography): improve V2 font readability (#16802)
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-07-07 21:50:10 +08:00
fullex
74d0f4d5ef refactor(popup): replace TopView's god-component view-stack with imperative popup/toast tracks (#16782) 2026-07-07 21:37:40 +08:00
eeee0717
550dbe06de refactor(code-cli): drop 4 unconsumed IPC contract dimensions
Demand-first review (PR #16491) traced every consumer of the new code_cli.*
and openclaw.* routes and found 4 contract fields/params with zero
consumption. Remove them, plus the dead code they were the last consumers of.

- code_cli.run input: drop options.autoUpdateToLatest (no producer ever sets
  it). This orphaned the auto-update-on-launch branch and the whole
  version-check/update subsystem it was the sole caller of — getVersionInfo,
  fetchLatestVersion, getNpmRegistryUrl, updatePackage, getPackageName, the
  versionCache field, the VersionInfo type, and the regionService import — all
  removed. Version/install is owned by BinaryManager (binary.*) now.
- openclaw.get_status output: reduce to { status }; the handler projects it
  (the renderer already owns the gateway port via preference).
- code_cli.run output: drop command (no consumer reads it).
- code_cli.get_available_terminals output: drop bundleId; the handler projects
  to { id, name } (bundleId stays internal, used for macOS mdfind resolution).

IpcRouter does not re-parse handler output, so the two reduced routes strip
the dropped fields at the handler to keep them off the wire; tests pin both
runtime strips. Also drop the now-moot getPackageName regression test and fix
three doc comments the deletions falsified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-07 21:20:21 +08:00
jd
934d3b1452 feat(agent-session): add export actions to session menu (#16706)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-07-07 19:42:59 +08:00
Pleasure1234
2b6ccc6c6d fix(conversation-tabs): close deleted conversation tabs (#16769)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-07-07 18:13:25 +08:00
槑囿脑袋
958712f372 fix(right-pane-resize): throttle drag width and unstick iframe resize (#16801)
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-07 18:06:14 +08:00
Pleasure1234
edd2e4c396 fix(codex): drop unsupported max output token cap (#16805)
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-07-07 18:05:54 +08:00
Pleasure1234
c674f16dc9 fix(rich-editor): prevent destroyed editor plugin cleanup (#16806)
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-07-07 18:05:40 +08:00
kangfenmao
ec20bfe385 fix(code-cli): refine provider card controls
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-07-07 17:28:56 +08:00
Pleasurecruise
f7518621ac feat(code): pin CLI upgrades and show latest versions
BinaryManager: prefer a requested semver when `mise ls` returns multiple installed versions so installs/upgrades can pin a specific version and persist it.

Renderer/hooks: allow passing a version to runInstallTool; upgrade now pins the detected latest version. useCliVersionStatuses now uses semver to compute upgradeability, fetches latest versions via `binary.get_latest_versions` only when a supported CLI is installed, and preserves per-tool latest hints on state changes. useCodeCliPageViewProps forwards the latest-version to the upgrade action.

UI/tests: VersionStatusCard shows an up-to-date Badge, moves the upgrade action into the action group and exposes an installing state. Added/updated unit tests for BinaryManager, hooks, and components to cover these behaviors.
2026-07-07 17:24:34 +08:00
eeee0717
00d5afb108 Merge remote-tracking branch 'upstream/main' into refactor/code-cli
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>

# Conflicts:
#	src/main/ipc/handlers/ipcHandlers.ts
#	src/shared/ipc/schemas/ipcSchemas.ts
2026-07-07 16:49:42 +08:00
Pleasure1234
14edf13c9c feat(binary-manager): add binary.latest_versions IPC to query latest registry versions (#16554)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-07-07 16:42:32 +08:00
Gu JiaMing
07af3a266c feat(notes): add WindowManager-backed print and PDF export (#16681)
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-07-07 16:29:55 +08:00
亢奋猫
59ea738685 Merge branch 'main' into refactor/code-cli 2026-07-07 16:14:14 +08:00
亢奋猫
083b6dca26 feat(chat): improve toolgroup preview and tool block display (#16674)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-07-07 16:12:49 +08:00
Gu JiaMing
c54315745c Merge branch 'main' into refactor/code-cli 2026-07-07 15:05:37 +08:00
槑囿脑袋
d2414ef0b9 fix(knowledge-migration): skip vector decode when mapping loader sources (#16761)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-07 14:19:23 +08:00
jd
0b5e9a9fd0 fix(model-selector): keep detail cards within viewport (#16800)
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-07-07 14:19:10 +08:00
亢奋猫
895f592d7a refactor(chat): remove manual view switching (#16739)
Co-authored-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-07-07 14:11:38 +08:00
eeee0717
02f656a214 style(code-cli): use destructive Disable button; drop explicit configure color
- The active toggle now uses the destructive variant for its Disable state
  (kept the Power icon), leaving Enable as the solid default + Play.
- Drop the explicit text-muted-foreground/hover override on Configure so it
  inherits the outline variant's foreground color.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-07 13:40:40 +08:00
eeee0717
c13fb6d238 fix(code-cli): collapse card actions after a mouse toggle; restyle disable
- Reveal the Enable/Configure actions on hover or keyboard focus only
  (group-has-[:focus-visible] instead of group-focus-within) and drop the
  full-card click target from the tab order (tabIndex -1), so a mouse click on
  the card body no longer keeps them pinned open via lingering focus.
- Give the active toggle a distinct look: outline variant + Power icon for
  Disable, keeping the solid Play button for Enable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-07 13:35:53 +08:00
eeee0717
1a96c5c501 feat(code-cli): toggle provider cards on card-body click
- Clicking anywhere on a provider / own-login card now toggles it, via a
  full-bleed ghost Button behind the content (content is pointer-events-none
  so clicks pass through; the hover action buttons stay interactive). Uses the
  design-system Button instead of a raw <button>.
- Relabel the active toggle from "Enabled" to "Disable" to match what a click
  actually does.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-07 12:58:04 +08:00
eeee0717
775b903f76 feat(code-cli): refine provider list actions and filter OAuth providers
- Provider and own-login cards now reveal Enable + Configure only on hover
  (keeps the list clean); Enable gets a filled variant and a Play icon.
- The "add provider" hint opens Settings in a tab (openSettingsTab) instead
  of navigating in place, so the code page is preserved.
- Filter out login-based providers (Claude Code / Codex OAuth, etc.) from the
  supported-provider list — they carry no API key/baseUrl to inject and their
  own login is already surfaced by the own-login card.
- Rename the own-login card title to "{{toolName}} Official".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-07 12:31:34 +08:00
槑囿脑袋
38ac4623e4 Merge branch 'main' into refactor/code-cli 2026-07-07 10:47:15 +08:00
eeee0717
34575bb853 fix(code-cli): guard provider toggle behind CLI installation
Enabling a provider injects config into the CLI's own files, which is
meaningless until the tool is installed — the write silently no-ops on the
missing config directory while the UI still flips to "enabled". Gate the
enable path on the tool's installed status and toast a nudge to install
first instead. Disabling (scrubbing config) stays allowed regardless.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-07 10:33:17 +08:00
亢奋猫
ab9fde0ad1 fix(agent-session): mark stopped pending messages as paused (#16720)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-07-07 10:30:42 +08:00
fullex
10b233489f docs(claude-md): note barrel rule in Code Organization 2026-07-06 19:12:30 -07:00
github-actions[bot]
d0fe081ebe 🤖 Daily Auto I18N Sync: Jul 07, 2026 (#16792)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
2026-07-07 09:45:01 +08:00
Gu JiaMing
d9a5789d4a feat(agent-file-preview): show previews in files overlay (#16713)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-07-06 23:56:25 +08:00
Gu JiaMing
e08e21569e fix(model-list): show sync preview rows by id (#16765)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-07-06 23:56:12 +08:00
jd
ecb9f37713 feat(resource-catalog): add skill marketplace search (#16700)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-07-06 23:55:58 +08:00
jd
006c15c0f0 fix(chat-messages): clear multi-select state on unmount (#16770)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-07-06 23:55:23 +08:00
Pleasure1234
4679620470 fix(chat-messages): restore drag box multi-select (#16763)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-07-06 23:55:11 +08:00
jd
640d4fcb68 feat(message-branch): align branch draft actions (#16777)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-07-06 23:54:58 +08:00
槑囿脑袋
8eadc91a2e fix(mcp-migration): normalize legacy MCP server type before insert (#16778)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: eeee0717 <ct761050293@gmail.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-06 23:54:43 +08:00
Asurada
f237ad77f3 fix(chat): stabilize responsive sidebar restore (#16744)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
2026-07-06 23:54:30 +08:00
jd
0fb5f14aa0 feat(skill-import): support batch ZIP imports (#16766)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-07-06 23:54:16 +08:00
亢奋猫
47e41e41fc fix(tabs): allow closing first tab (#16771)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-07-06 23:53:55 +08:00
Asurada
8c51eec21d feat(composer): improve quick panel search aliases (#16730)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: ousugo <dkzyxh@gmail.com>
2026-07-06 23:53:44 +08:00
fullex
ea382e80c0 test(job): await job settlement instead of racing a wall-clock timeout
Racing handle.finished against a self-managed setTimeout deadline is flaky
under CI event-loop starvation: when the worker thread resumes, the job's
promotion timer and the deadline expire in the same libuv batch and the
deadline's synchronous resolve('timeout') beats the job's multi-hop async
completion chain, so the race settles 'timeout' even though the job finished
moments later. Await handle.finished directly and assert the terminal
snapshot status; vitest's per-test timeout bounds a genuine hang with a
clearer error. Applied to all five occurrences that shared the pattern.
2026-07-06 07:19:46 -07:00
fullex
1c1278aefc docs(window-manager): document the empty-htmlPath consumer-loaded contract
`htmlPath: ''` already makes WindowManager skip content loading so a domain
service can load the window itself, but the behavior was implicit — undocumented
at the type level and untested as a contract.

- types.ts: document that `htmlPath: ''` is a consumer-loaded window and how the
  consumer loads content afterward (getWindow(id) -> webContents.loadURL/loadFile,
  plus show/close ownership); fix the preload cross-reference that wrongly claimed
  htmlPath is three-state.
- WindowManager.test.ts: lock the contract — empty htmlPath skips loadFile/loadURL,
  non-empty htmlPath loads on create.
- usage guide: add a "Consumer-loaded windows" section (recipe + getWindow caveat).
2026-07-06 06:40:47 -07:00
eeee0717
02813356fb feat(code-cli): add configurable own-login virtual provider
Add a virtual "own login" entry to the provider list for login-capable CLI
tools (Claude Code, Codex, Gemini CLI, Qwen, Kimi) so users can launch with
the tool's own OAuth login instead of a Cherry provider. Selecting it marks a
reserved id so the launch gate passes and runs the CLI without injecting a
provider/model.

- The entry is draggable in the list like a normal provider and, for
  configurable tools, opens a config panel for tool params (permission mode /
  effort / toggles) with no model selection, plus the advanced raw-config editor.
- The apply flow scrubs Cherry-managed credentials/model first (clearCliConfig,
  which also clears credential-only side files like Codex auth.json / Gemini
  .env) then layers the saved tool params back on, preserving the tool's own
  login. Per-tool own-login builders strip managed keys and re-apply only the
  writable params.
- Also reorder the CLI tool list (OpenClaw last) and give Gemini CLI a specific
  add-provider hint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-07-06 21:25:27 +08:00