Commit Graph

105 Commits

Author SHA1 Message Date
Yichen Jiang
970f893d6b feat(tui): add pi-ai Anthropic example 2026-07-26 13:30:01 +08:00
Yichen Jiang
eeab643ad9 Merge remote-tracking branch 'origin/master' into worktree/llm-reasoning-effort
# Conflicts:
#	docs/architecture.i18n.yaml
#	docs/config-catalog.md
2026-07-26 13:13:31 +08:00
Yichen Jiang
73e7e27799 refactor(llm): resolve model metadata together 2026-07-26 13:07:27 +08:00
Turtle
fca2dda37d refactor(cli): unify the arg grammar — one program, --config flag, real web subcommand
Drop the bare `dsh <config>` positional in favor of a `--config <path>` flag.
Without a root positional, `web` can be a real Commander subcommand in one
program instead of the reserved-first-token dispatch to a second parser, so
`dsh --help` lists every mode natively (no hand-pasted command text) and the
second parser + reserved-token machinery are gone.

Grammar:
  dsh                       TUI (shipped tree + ~/.dsh overlay)
  dsh --config <path>       TUI, alternate tree (demos/tests only)
  dsh --resume <id>         TUI, resume a session
  dsh -p "task"             headless one-shot
  dsh web [--host --port --dev]

`dsh` is the product front door with no positional; `--config` exists only so
demo:cordis, demo:code-mode, and the keyless PTY smokes can point the shipped
bin at an example tree. Those three sites and the /resume re-exec argv move to
`--config <path>`. The `-p` + `--config`/`--resume` mode-mixing guard and the
cordis.yml-owns-host/port-default fix are preserved.

Agent Note + Chinese pair, README, tui.ts docs updated. All 13 PTY smokes
(including code-mode via --config and the exec-replace resume handoff) green.
2026-07-25 15:47:55 +08:00
Turtle
007e8fd92f refactor(cli): bail early in the arg adapter instead of returning errors as data
Address review and cut ceremony: the adapter no longer models help/version/
errors as DshInvocation members. Commander owns those under exitOverride — it
prints usage or the diagnostic and one try/catch in parseDshArgs turns the
thrown CommanderError into process.exit with the intended code. bin.ts drops its
help/version/error cases; the union is the three real modes.

Domain checks bail via command.error(print + exit 1): --prompt rejects an empty
task or a stray config/--resume, empty --resume= fails loud, and --host/--port
are validated. A repeated --resume or a flag captured as a value is Commander's
standard behavior, left alone (a bad id fails loud downstream). dsh --help
discloses web via addHelpText. Net: args.ts 185 -> 112 lines.

Also fixes review nits: built-bin e2e resolves on `close`; the /resume handoff
uses `dsh --resume=<id> -- <config>` so a config named `web` stays a positional;
and stale prose (cordis.yml comment, app-boot module doc + duplicate JSDoc,
ui/README, two feature notes, an agent-loop test name) tracks the shipped state.
Removes tui-demo's now-dead plugin-include dep and vendor/loader + app-boot
tsconfig references.
2026-07-25 14:15:25 +08:00
Turtle
870fb1cafa refactor(cli): make dsh the sole terminal front door, drop RESUME_SESSION_ID
Remove the redundant dsh-tui-demo bin and the RESUME_SESSION_ID environment
variable, leaving dsh as the one terminal entrypoint.

The dsh-tui-demo package was a plugin (the TUI app bundle mounted by dsh's
config) plus a bin that booted a leaf cordis.yml — the same job `dsh [config]`
does. The bin, its ./bin export, its built-bin.e2e.ts, the tsdown bin entry,
and the now-unused dsh-app-boot dependency are removed; the package keeps its
plugin and invariant. demo:cordis, demo:code-mode, and the tui-agent and
cordis-agent keyless PTY smokes now launch through apps/cli/src/bin.ts with the
config as the positional argument. cli-demo/acp-demo/jsonrpc-demo keep their
bins (distinct surfaces).

RESUME_SESSION_ID was the only bridge from --resume into the shipped config;
--resume now provides the id on the boot context via ctx.provide(
RESUME_SESSION_ID_KEY, id), and the four configs read it as a bare identifier
through a quoted typeof-guarded !!js expression. The TUI resumeCommand fixtures
and docs move to `dsh --resume {session}`.

Agent Note and its Chinese pair updated; config-catalog regenerated.
2026-07-25 12:43:59 +08:00
Turtle
6cd139a25b Merge branch 'master' into worktree/dsh-arg-parser
Integrate the Commander argument adapter with master's safe session-resume
feature and dsh web --dev flag.

- args.ts: add --dev to the web parser.
- tui.ts: keep master's process.execve in-place resume handoff, but take the
  adapter's parsed (config, resume); inject the resume id through boot's
  prepare(ctx) hook via ctx.provide(RESUME_SESSION_ID_KEY, id) instead of the
  RESUME_SESSION_ID env var; rebuild the re-exec argv as `dsh --resume <id>`.
- app-boot: drop master's replaceResumeArg (no longer needed) alongside the
  already-removed parseResumeArg; add RESUME_SESSION_ID_KEY.
- the four tui-agent/cordis configs read the ctx-provided resumeSessionId via a
  typeof-guarded !!js expression, so resume needs no env var.
- web.ts: keep master's client roster and --dev watch, take parsed host/port/dev.
2026-07-25 12:04:37 +08:00
Yichen Jiang
1bfca86128 feat(tui): select model reasoning effort 2026-07-25 08:32:38 +08:00
Tianyi Cui
f9a638b8a6 Stabilize master CI across platforms 2026-07-25 00:10:37 +08:00
Turtle
80bbe959a7 Merge remote-tracking branch 'origin/master' into feat/send-unify 2026-07-24 16:52:46 +08:00
ZiyaZhang
33ee34b58e fix(tui): make resume picker full-screen 2026-07-24 01:29:35 -07:00
Turtle
c440217fde refactor(tui): defer cross-process resume locking 2026-07-24 01:29:35 -07:00
NI0317
2ae9f4fdf3 feat(tui): add safe session resume flow 2026-07-24 01:29:35 -07:00
Turtle
d5f88f1221 Merge remote-tracking branch 'origin/master' into feat/send-unify
# Conflicts:
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/pty/pty-local/tests/index.spec.ts
#	packages/session-query/session-query/tests/tracing.spec.ts
2026-07-23 22:41:45 +08:00
Tianyi Cui
c688aa486c Merge remote-tracking branch 'origin/master' into worktree/remove-expose-internals 2026-07-23 22:08:44 +08:00
fz
5e8943fd1c fix(plan): make direct exit discoverable 2026-07-23 21:34:40 +08:00
fz
8e4f666238 feat(plan): add direct plan exit command 2026-07-23 21:06:03 +08:00
Tianyi Cui
eb0cc4eb18 refactor: drop obsolete expose-internals flag 2026-07-23 20:35:09 +08:00
Yichen Jiang
40ce342d81 Merge remote-tracking branch 'origin/master' into worktree/tui-file-autocomplete
# Conflicts:
#	docs/config-catalog.md
2026-07-23 19:32:13 +08:00
Yichen Jiang
23fc9cc226 feat(tui): add path-only @file autocomplete 2026-07-23 17:39:30 +08:00
Tianyi Cui
59e325f571 Merge refreshed typed Code Mode results into result card fix 2026-07-22 22:38:23 +08:00
Tianyi Cui
101fcdd319 Merge refreshed canonical outputs into typed Code Mode results
# Conflicts:
#	docs/event-producer-consumer.md
2026-07-22 22:34:52 +08:00
Tianyi Cui
e51b2fd834 Merge refreshed typed Code Mode results into result card fix
# Conflicts:
#	.agents/notes/implemented/architecture/2026-07-20-canonical-tool-output-contract.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-20-code-mode-typed-tool-returns.i18n.yaml
#	examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
#	examples/tui-agent/tests/snapshots/code-mode/terminal.expected.txt
2026-07-22 22:17:05 +08:00
Tianyi Cui
ce970bd31c Merge refreshed canonical outputs into typed Code Mode results
# Conflicts:
#	docs/module-graph.md
#	examples/acp-agent/tests/snapshots/advanced-toolchain/system-prompt.expected.md
#	examples/acp-agent/tests/snapshots/both-mode-turn/system-prompt.expected.md
#	examples/acp-agent/tests/snapshots/code-mode-turn/system-prompt.expected.md
#	examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
#	examples/acp-agent/tests/snapshots/code-mode-workspace-context/system-prompt.expected.md
#	packages/core/tools/src/ts-types.ts
2026-07-22 21:49:35 +08:00
Tianyi Cui
3679b4d829 Merge master into worktree/semantic-session-checkpoints 2026-07-22 21:49:24 +08:00
Tianyi Cui
78c2741d3e Merge remote-tracking branch 'origin/master' into worktree/pr504-retarget-latest-master
# Conflicts:
#	docs/event-producer-consumer.md
#	examples/tui-agent/README.md
#	examples/tui-agent/composition.md
#	examples/tui-agent/cordis.yml
#	examples/tui-agent/tests/snapshots/multi-turn-conversation/terminal.expected.txt
#	examples/tui-agent/tests/tui-keyless-smoke.e2e.ts
#	packages/ui/tui/README.md
#	vitest.config.ts
2026-07-22 20:55:12 +08:00
Tianyi Cui
2478ef7d6d Merge master into worktree/semantic-session-checkpoints 2026-07-22 20:50:46 +08:00
ZiyaZhang
1167e91409 fix(tui): polish /status diagnostics card 2026-07-22 03:29:59 -07:00
ZiyaZhang
280207c824 feat(tui): add /status session diagnostics 2026-07-22 03:10:14 -07:00
Tianyi Cui
e4840c5a88 Merge branch 'codex/code-mode-typed-results' into codex/code-mode-complete-result-card 2026-07-22 17:09:28 +08:00
Tianyi Cui
248d7bb81e Merge branch 'codex/canonical-tool-output' into codex/code-mode-typed-results 2026-07-22 17:07:49 +08:00
Tianyi Cui
c3fb3de64f Merge PR #500 into codex/tool-json-schema-dsl
# Conflicts:
#	docs/cordis-catalog/services.md
#	scripts/type-equiv.manifest.json
2026-07-22 16:57:45 +08:00
Tianyi Cui
f4185122dc refactor(plan): remove generic mode abstraction 2026-07-22 16:57:23 +08:00
Tianyi Cui
1d28743b12 feat(mode): submit optional slash-command message 2026-07-22 15:51:02 +08:00
Turtle
06827eb868 test(e2e): drive the TUI keyless smoke through the cross-platform PTY harness
The smoke's inline Python pty driver only ran on POSIX (no termios on
Windows). Rebuild every scenario — banner sweep, scripted conversation with
model switch, /skill:, Code Mode overlay, resume failure, and the dsh CLI
suite (default boot, personal overlay, invalid overlay, --resume flag,
source-path prompt) — as marker-gated action lists on pty-harness.ts, which
drives ConPTY via node-pty on Windows and the Python driver elsewhere. The
harness gains configArgs (bins with built-in default configs), prepare
(workspace seeding), and inspect (post-run log assertions); examples/
declares the session-title provider the shipped cordis.yml now mounts.
2026-07-22 15:35:19 +08:00
Turtle
2a9f248594 refactor(tui): drop the TUI-local auto-title; titles come from the session-title service
Master's log-backed session-title capability already titles sessions durably
(deterministic fallback in the spine, optional model providers). Remove the
TUI's own autoTitle generation — the latch, prompt, cap, and llm stream call —
and keep the terminal rename: the TUI folds the logged title on mount and sets
'<session title> — <configured title>' on every accepted session/title event.
The tui-agent example and the scripted PTY fixture mount
session-title-first-message-llm so titles stay model-made; the scripted
adapter's tool-less branch now answers that provider's auxiliary request.

See .agents/notes/implemented/simplification/2026-07-22-tui-titles-from-session-title-service.md
2026-07-22 15:01:54 +08:00
Turtle
f1f35ccaef test(e2e): align keyless expectations with the shipped config and scope keys
The acp escalation smoke advertises the shipped deepseek-v4-pro; the
workspace-context e2e asserts the per-candidate scope key. The PTY harness
drops COLORTERM (deterministic banner) and gains configArgs/prepare/inspect
for the dsh CLI scenarios.
2026-07-22 14:48:34 +08:00
Tianyi Cui
a8a18f309a feat(mode): register one slash command per mode
Replace /mode [name] with same-named no-argument commands such as /plan. Update the TUI and ACP snapshots, and validate mode names against command syntax.
2026-07-22 14:32:35 +08:00
Turtle
cf95986d5b fix(examples): restore the tui-demo pre-boot TTY refusal and stabilize the PTY smoke
The built-bin fail-loud test needs the TTY refusal before Loader boot (a
compose-time throw is logged per-entry, not rethrown); the PTY driver drops
COLORTERM so a developer's truecolor shell cannot flip the banner to the
gradient path mid-assertion; the scripted fixture persists raw JSONL so the
smoke's system-prompt inspection can read the log.
2026-07-22 14:30:01 +08:00
Turtle
66c4a353b9 docs: regenerate catalogs, graphs, and the README pairing record after the rebase 2026-07-22 14:30:01 +08:00
Turtle
7eec0d81ec test(snapshot): reconcile replay overlays with the merged configs and fixtures
- acp/headless whole-config snapshot patches restate persistenceCompression:
  none so raw JSONL fixtures stay harvestable, and re-pin the recorded
  deepseek-v4-flash where the shipped config moved to pro
- depth-two overlay gains the app-config re-pin master's other overlays carry
- headless-agent stays on flash: goal/ralph overlays include it via a nested
  include, which a config patch cannot reach to re-pin
- workspace-context scenarios re-record their session fixtures for the
  per-candidate scope keys and both-siblings loading; acp session fixtures
  otherwise return to master's (session/title + delegationDepth events)
2026-07-22 14:29:52 +08:00
Turtle
a5dfffcbe5 chore(examples): make todo_write opt-in for the tui-agent example
Make todo_write opt-in for the tui-agent example (disabled by default; TUI
still renders plans when the tool is loaded). Both enabled and disabled cases
covered by tests.
2026-07-22 14:29:52 +08:00
Turtle
f503d838e9 feat(tui): default auto-title on and re-derive it on resume 2026-07-22 14:29:52 +08:00
Turtle
ea93166e57 feat(tui): auto-title the terminal pane from the first user message 2026-07-22 14:29:28 +08:00
Turtle
45868b940f feat(tui): startup banner iterations — slogans, sweep reveal, then no banner
Squashes three linearized steps (feat/tui-startup, feat/banner-reveal,
feat/remove-banner): the banner experiment converged on removing the
startup banner entirely; later commits restore it borderless and add the
brand gradient.
2026-07-22 14:29:28 +08:00
Turtle
0c9a4d7c28 Retire the readline front door and the repl-agent example
Delete packages/ui/stdio and examples/repl-agent; rename stdio-demo to
@deepseek-ai/dsh-tui-demo (TUI-only, refuses pipes before Loader boot).
tui-agent owns the coding composition inline; echo-agent and the CI demo
smoke move to the one-shot cli-demo bin, which gains -p/--prompt. The
UI-independent with-key e2es move verbatim to tui-agent. SDK wizard's
'stdio' interface becomes 'tui'. PTY testing stays confined to TUI
surfaces; all other subprocess tests ride pipes.

See .agents/notes/implemented/simplification/2026-07-20-retire-readline-front-door.md
2026-07-22 14:29:27 +08:00
Tianyi Cui
c1f259bd0d Merge branch 'master' into feat/plan-mode 2026-07-22 11:29:58 +08:00
Yichen Jiang
a5302d4d64 Merge remote-tracking branch 'origin/master' into worktree/semantic-session-checkpoints
# Conflicts:
#	packages/session-persistence/session-persistence-jsonl/README.md
2026-07-22 10:54:08 +08:00
Yichen Jiang
28b358650b Merge remote-tracking branch 'origin/master' into worktree/semantic-session-checkpoints
# Conflicts:
#	docs/architecture.md
#	docs/event-producer-consumer.md
#	examples/acp-agent/tests/snapshots/cancel-tool-calls/session.jsonl
#	packages/core/agent-loop/README.md
#	packages/core/agent-loop/src/loop.ts
#	packages/core/agent-loop/tests/cancel.spec.ts
2026-07-22 10:29:09 +08:00
kingwl
7a2dff8b11 fix(mode): address PR #239 review — boundary flush ordering, disposal fence, config validation, TUI plan config
Four ds-review-bot findings:
- examples/tui-agent composed dsh-mode without the now-required
  modes.plan.section, so the TUI leaf failed at Loader startup (the keyless
  smoke only asserts the banner and missed it); graft the same deployment
  plan instructions the ACP leaf carries.
- The prompt-submit and turn-continuation flushes ran before next(), so a
  session/set_mode arriving while a downstream async listener (the shipped
  hooks listeners' shape) awaited applied one request late; both listeners
  now prepend and flush after next(), matching the request-error wrapper,
  with a regression test pinning the ordering.
- An HMR unload during the exit_plan_mode review let a later approval write
  into the disposed service and claim an exit whose flush could never land;
  the execute path now checks the fiber lifetime after the await and fails
  the call (the mode stays plan; the model re-presents).
- resolveConfig accepted empty/untrimmed mode names that list()/ACP then
  advertised while the package invariant rejected their selection,
  desynchronizing the picker; names are validated non-empty and trimmed at
  load, the same shape the invariant enforces.
2026-07-22 09:58:57 +08:00