Commit Graph

329 Commits

Author SHA1 Message Date
Turtle
ff126751d8 refactor(cli): keep migrate out of scope 2026-07-29 21:41:51 +08:00
Turtle
d8e4fd3b75 fix(cli): align meta invocation contract 2026-07-29 21:39:38 +08:00
Turtle
a01c1bccd6 fix(docs): parse inserted composition rows 2026-07-29 21:30:51 +08:00
Turtle
b1697ffd29 fix(web): assemble and package the shipped overlay 2026-07-29 21:28:05 +08:00
Turtle
9bbaea45fd docs(cli): explain config overlay modes 2026-07-29 21:15:48 +08:00
Turtle
984830c940 fix(tui): isolate each process query index 2026-07-29 21:15:48 +08:00
Turtle
d44fce8a39 fix(cli): keep meta as a fresh-session command 2026-07-29 21:15:48 +08:00
Turtle
857a4941be fix(cli): restore shipped surface capabilities 2026-07-29 21:15:48 +08:00
Turtle
bee0a77aad chore: refresh generated review records 2026-07-29 21:15:48 +08:00
Turtle
030b044350 fix(cli): reject leaked config replacement flags 2026-07-29 21:15:48 +08:00
Turtle
ea9315841f refactor(session): exclude live-session registry foundation 2026-07-29 21:15:48 +08:00
Turtle
9e2c3d3093 refactor(cli): exclude tmux context and source guard 2026-07-29 21:15:48 +08:00
Turtle
c1324ee896 fix(cli): preserve overlays without session registration 2026-07-29 21:15:42 +08:00
Turtle
8f2f6ef0ac refactor(cli): exclude live-session registry surface 2026-07-29 21:15:42 +08:00
Turtle
a459a918e2 fix(cli): remove obsolete resolver dependencies 2026-07-29 21:15:42 +08:00
Turtle
571562788d chore: reconcile extracted foundation with current master 2026-07-29 21:15:42 +08:00
Turtle
10ff76de9c fix(cli): declare every plugin the shipped config trees name
The Loader resolves each config row against the composing app, so moving the
TUI composition from examples/ into apps/cli left eleven rows unresolvable from
the built bin: `node apps/cli/lib/bin.js` died at boot with "plugin(s) failed to
load". Source-mode runs hid it, because tsconfig paths resolve the whole
workspace regardless of who declares what.

Also declares `dsh-llm-pi-ai` and `dsh-tmux-context`, which a personal
`~/.dsh/config.yaml` inserts to swap the model adapter. Those previously
resolved only because the config lived under examples/, whose package.json
declares the union of every leaf's plugins.

Caught by running the built bin from a scratch directory, which is how a user
actually starts it.
2026-07-29 21:15:42 +08:00
Turtle
f290a8b851 refactor(cli)!: one shared base config with per-surface overlays
`dsh` shipped two config trees that were 43 rows the same: apps/cli/cordis.yml
composed web as 74 flat rows, while the TUI booted examples/tui-agent/cordis.yml
whose single `@deepseek-ai/dsh-tui-demo` row mounted twelve plugins behind a
twenty-key pass-through Config. Neither file was what its location claimed —
apps/cli hardcoded the "example" as the product default and the "demo" bundle
was the application — and every capability change had to be made twice.

- apps/cli/base.cordis.yml holds the 43 shared rows; tui.cordis.yml and
  web.cordis.yml are patch lists stating only what differs per surface
- overlays apply as SIBLING patch lists at one include level, because include
  patches never cross an include boundary. Precedence: base < surface <
  (--config | personal ~/.dsh/config.yaml) < launcher flag/profile patches
- `--config` now applies an overlay INSTEAD OF the personal one, so a demo or
  test tree never inherits the user's route; new `--config-replace` boots a file
  as the entire tree (the old `--config` behaviour). Both survive /resume
- vendor/include: index each `insert`ed row as it is added so a later patch can
  configure or disable it. Upstream built the id index once before the patch
  loop, leaving every surface-only row — the whole TUI front door — silently
  unpatchable from user config. Logged as local modification 8
- session identity moves to dsh-agent-loop's CONFIGURED_AGENT_IDENTITIES_KEY;
  dsh-tui's MAIN_SESSION_ID_KEY is deleted (only the bundle read it)
- delete examples/tui-agent, examples/cordis-agent, packages/examples/tui-demo;
  TUI tests → apps/cli/tests, cordis e2e → packages/cordis/tool-cordis/tests,
  examples/code-mode survives as an overlay leaf
- `dsh web` gains --config, threaded into AppCLIEntry as an extra overlay

Three latent defects surfaced and are fixed here: the TUI captured the optional
sessionQuery service once at construction and could permanently disable /resume
when it won the mount race; the session-store root silently reverted to a
project-local ./.sessions; --config-replace was dropped by the resume handoff.

Verified by booting each tree through the real Loader (TUI 55 entries, web 75,
zero unsettled) rather than reading YAML. All eight terminal snapshots replay
byte-identically; 14/14 PTY smoke, 112/112 snapshots, 25/25 doc-sync, hygiene
and lint clean.
2026-07-29 21:15:42 +08:00
Turtle
e7c0a5b794 Merge origin/master: web permission sandbox, default pi-ai providers 2026-07-29 21:15:34 +08:00
Chinesezjc
b588060b90 fix(web): close a run at the line end and count columns correctly
Eight findings, each terminal case verified in a real terminal first:

`\x1b[32mdone\rok\x1b[0m` then `plain` shows `okne` green and `plain` in the
DEFAULT color. The replay returned the last written cell's state, so a reset
landing after the final write vanished from both the text and the returned
state — and every build tool writes exactly that shape, so the color leaked
onto all later output. The replay now converges to the state the scan ended
in, which is also what it hands to the next line.

`abcd\b\x1b[1K|` shows `   |`: CSI 1K erases THROUGH the cursor column, and
the loop stopped before it. The erase mode also reads only the first
parameter now, since a terminal treats `1;2K` exactly as `1K`.

`éx\rYZ` shows `YZ`: a combining mark takes no column, so it attaches
to the cell already written instead of advancing the cursor and leaving the
`x` standing.

`中x\rA` shows `A x`: overwriting a wide character's lead cell leaves its
spacer as a blank rather than closing the gap, which would shift everything
after it one column left.

The banner lost its span when the gutter became padding — a plain block child
only reaches the content box, so the reserved column was painted in the body
color and the card's top-left radius drawn in it. Invisible in the light
theme, where banner and body share a token; visible in the dark one. The
header now pulls back across the gutter and re-insets by the same amount.

The replay trigger matches the same CSI shape the parser accepts, so a form
like `\x1b[1;2K` can no longer skip its own erase, and `replayLine`'s JSDoc
documents its new parameter and returned pair.

Docs: four places still described the dot as sitting left of the card surface,
which stopped being true when the gutter became the card's own padding, and
two fixture comments still referenced the exit marker that was deliberately
removed.
2026-07-29 16:10:37 +08:00
Chinesezjc
c87a20b506 Merge remote-tracking branch 'origin/master' into feat/web-terminal-card
# Conflicts:
#	packages/client/ui-conversation/README.i18n.yaml
#	packages/client/ui-conversation/README.md
#	packages/client/ui-conversation/README.zh.md
2026-07-29 15:44:58 +08:00
Chinesezjc
43de478d10 fix(web): model erase-in-line, tab stops, and cross-line SGR
Six findings. Each terminal-semantics case was checked in a real terminal
(tmux, reading back the painted screen) before changing anything:

`100%\r\x1b[KOK` shows `OK`. Modelling the `\r` without its erase left the
previous frame's tail standing — a regression against the old truncate, since
`\r\x1b[K` is the single idiom every spinner and progress bar writes. Erase is
now part of the same replay, in all three parameter forms.

`a\tb\rXY` shows `XY      b`. Counting a tab as one column produced `XYb` and
destroyed the alignment this card exists to hold, so the cursor now advances
by terminal columns: tabs reach the next 8-column stop and a wide character
takes two cells.

`\x1b[31mabc\rX\nnext` paints BOTH lines red. A newline does not reset the
graphic state, so state threads from one replayed line to the next instead of
closing at each line end.

Only `m` accumulates into a cell's style now. Folding cursor and erase
sequences in grew the state string per redraw and emitted boundaries anser
had to discard.

The empty check reads the parsed lines the card renders rather than the raw
text: output that is only escapes or control bytes survives `trim()` yet
parses to nothing, and drew blank rows plus a copy control for invisible
bytes instead of the placeholder.

The gutter is the card's own left padding rather than a margin. Every render
site rewrites `margin` wholesale for its own indent, which silently cancelled
the reservation and let a container clip the dot.

The fixture sample no longer carries an `[exit code: 1]` line: the real bash
presenter consumes that marker precisely because the card shows the exit as
its own pill, so the built-bundle snapshot had pinned a frame showing it
twice — one the product path cannot produce.
2026-07-29 15:36:16 +08:00
imccyu
4da1026956 Merge branch 'master' into xtr/dsh-source-launch-tsx-esm 2026-07-29 15:29:00 +08:00
07akioni
59c0f92cb6 Merge branch 'master' into feat/agent-action 2026-07-29 15:09:04 +08:00
imccyu
f7f51e29dc Merge branch 'master' into fix/web-details-session-lifecycle 2026-07-29 15:02:39 +08:00
imccyu
66d650e4fb refactor: simplify sidebar logics 2026-07-29 14:52:41 +08:00
Chinesezjc
612b3c7c4e Merge remote-tracking branch 'origin/master' into feat/web-terminal-card
# Conflicts:
#	packages/client/ui-conversation/README.i18n.yaml
2026-07-29 14:45:23 +08:00
07akioni
4aa1aa4a66 test(web): refresh aria goldens for message IconActions and clocks
Settled history now exposes user/assistant chrome (including date-aware
clocks) in the accessibility tree; collapse clocks via scaffold and update
keyless scenario goldens.
2026-07-29 14:30:09 +08:00
07akioni
afab428c0c Merge branch 'master' into feat/agent-action 2026-07-29 14:21:44 +08:00
kingwl
b48c76a63a Merge remote-tracking branch 'origin/master' into xtr/dsh-source-launch-tsx-esm
# Conflicts:
#	apps/cli/README.i18n.yaml
2026-07-29 13:45:21 +08:00
imccyu
07262d967c Merge branch 'master' into web-permission-sandbox 2026-07-29 13:41:23 +08:00
kingwl
2ca6f54c9e Merge remote-tracking branch 'origin/master' into xtr/dsh-source-launch-tsx-esm
# Conflicts:
#	apps/cli/README.i18n.yaml
2026-07-29 13:39:57 +08:00
Yichen Jiang
0dce3f57ca Merge remote-tracking branch 'origin/master' into worktree/default-pi-ai-providers
# Conflicts:
#	apps/cli/README.i18n.yaml
2026-07-29 13:25:06 +08:00
kingwl
aebf9c863b feat(cli): launch dsh source through the tsx ESM hook
Node 26.0.0 removed --experimental-transform-types, so the native
source-launch chain cannot start anywhere on that line, and strip-only
mode rejects the vendored syntax (parameter properties, decorators,
runtime enums/namespaces). Switch bin/dsh, the root dsh/demo:tui/
demo:web scripts, and the Code Mode TUI overlay to node --import
tsx/esm: one launch vector across the whole engines range, ~0.4s faster
than the full tsx default (the CJS hook stays off; the graph is
ESM-only).

Delete scripts/tspath-loader.ts and apps/cli/src/tsconfig-paths-loader.ts:
tsx owns both transformation and tsconfig paths projection. Add
dsh-source-launch-smoke to the node-compat gates so the 22.19/26 matrix
executes the real launch vector; no CI job did, which is how the Node 26
breakage shipped silently.

Supersedes the native-TypeScript-source-launch Agent Note (new note
records the profiling evidence and rejected alternatives).
2026-07-29 13:15:24 +08:00
Chinesezjc
0f70886e0c fix(web): label only the first prompt row with the working directory
A multi-line command repeated the cwd label on every prompt row, which
states something the view does not know: it carries ONE working directory —
where the call started — and a `cd` in the command moves later lines
elsewhere. `cd ~` then `ls` rendered both rows labelled with the session
workspace while `ls` actually listed the home directory.

The label now appears on the first row only, and later rows keep a bare `$`
so they still read as prompts. Same reasoning as the run-state dot: neither
a per-line directory nor a per-line exit status exists to report.

The built-bundle snapshot records the effect on fixture turn 60's two-line
command (`fixture echo done` becomes `$ echo done`).
2026-07-29 12:10:34 +08:00
Chinesezjc
eba81fe1f2 Merge remote-tracking branch 'origin/master' into feat/web-terminal-card
# Conflicts:
#	packages/client/ui-conversation/README.i18n.yaml
2026-07-29 11:49:10 +08:00
Chinesezjc
439c206658 fix(web): honor the terminal view's description and resolved workdir
Three review findings, each verified against the presentation contract:

The call view's `description` was dropped, so a presenter that authors one
(`terminal_send` declares `Terminal <id>`) lost the contract's above-card text
and the row fell back to an unrelated args-derived summary. It now rides the
same derivation and outranks that summary.

A relative workdir was concatenated but never normalized, while the bash
executor resolves it before running: with session cwd `/w/app` and workdir
`..` the command runs in `/w`, yet the card displayed the label `..`. The
resolved path now collapses `.`/`..` segments, drops a `..` that would climb
past a root the way a filesystem does, and keeps a Windows path's separators
since the value is only ever displayed.

`run_code` sub-dispatches carry no presenter views on the shipped wire —
`session.ts` folds `tool/code-dispatch(-start)` with null views and the host's
`viewFor` presents only top-level call/result events — so a nested bash call
cannot reach a terminal card. The existing test only passed by injecting views
that path cannot produce; it now says so, and a second arm pins the no-view
shape the wire actually delivers.

Restoring master's fixture also fixed the todo snapshot lane, which my earlier
merge had broken by dropping the projection support the todo dock reads. The
terminal sample turn moved ahead of the todo turn, because the standing plan
retires at the next `turn/start` and a turn appended after it emptied the dock.

The card props are now nested under `card` so a render site spreads exactly the
primitive's own surface, and the fixture reads each sample's authored exit
status instead of re-implementing the bash tool's `parseExitStatus`.
2026-07-29 11:43:23 +08:00
NI0317
f280a97c56 test(web): isolate details session lifecycle e2e 2026-07-29 11:32:03 +08:00
NI0317
ca2e6207b5 Merge origin/master into fix/web-details-session-lifecycle 2026-07-29 11:21:48 +08:00
NI0317
406cd3602b fix(web): close details when current session changes 2026-07-29 11:21:13 +08:00
imccyu
5c432955ed Merge remote-tracking branch 'origin/master' into web-permission-sandbox-merge-master 2026-07-29 11:16:49 +08:00
imccyu
8d0249d392 Merge branch 'feat/directory-picker' into feat/workspace-directory-browser 2026-07-29 10:42:19 +08:00
imccyu
ecc447daf5 Merge branch 'doc/host-client-group-readmes' into feat/directory-picker 2026-07-29 10:42:13 +08:00
imccyu
fa64ad39cb Merge branch 'master' into doc/host-client-group-readmes 2026-07-29 10:42:00 +08:00
Turtle
c7e6cb5753 fix(tui): complete launcher integration and rationale 2026-07-29 10:25:07 +08:00
creatixchu
9a5fe52678 Merge remote-tracking branch 'origin/feat/directory-picker' into feat/workspace-directory-browser 2026-07-29 06:45:12 +08:00
creatixchu
c5ae7dd65e Merge remote-tracking branch 'origin/doc/host-client-group-readmes' into feat/directory-picker
# Conflicts:
#	packages/host/apiproxy/package.json
#	pnpm-lock.yaml
2026-07-29 06:43:09 +08:00
creatixchu
1779488c99 Merge remote-tracking branch 'origin/master' into doc/host-client-group-readmes 2026-07-29 06:40:26 +08:00
creatixchu
53240f4664 fix(host,client): abort superseded listings on the wire; keep the native swap resolvable
Supersession (newer navigation, path editing, closing, unmount) now
aborts the in-flight listing's request instead of only discarding its
result: the browser mints an AbortController per listing, the signal
rides the workspace face (IWorkspaces.listDirectory gains an optional
signal) onto the fetch carrier, and the Host scan stops with it (817's
cancellation chain). apps/cli keeps both picker packages as dependencies
so the documented one-row cordis.yml swap to the native backend resolves
at boot.
2026-07-29 06:19:18 +08:00
imccyu
40e3e10831 Merge origin/master (plan line #590) into web-permission-sandbox-merge-master
Shared-surface conflicts resolve as unions: the fixture serves all five
projection keys (title/todos/permissions/plan/goal) with the /permission
and /plan command mirrors side by side, the connection specs assert the
five-key baseline and the shifted approval/question replay indices, and
the cli roster/deps, tsconfig aggregate, and README allowlist carry both
lines' rows. Plan-side content lands verbatim from master.

One end-state consolidation both branches half-did: with questions
(ui-question) and approvals (ApprovalPanel) each owning a composer
takeover, PendingCard retires outright — ChatView renders no pending
placeholder, the card component and its specs go, and both README halves
state the takeover-only contract.
2026-07-29 03:52:55 +08:00