Commit Graph
100 Commits
Author SHA1 Message Date
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 91d86f9b21 fix(cli): let cordis.yml own the web host/port default (single source)
The merge's "always pass adapter-resolved host/port to AppCLIEntry" made the
adapter's 127.0.0.1/3080 shadow apps/cli/cordis.yml's webserver row — editing
the yml port would have had no effect, a duplicated default.

The adapter now assigns no host/port default: an absent --host/--port leaves the
field undefined (WebInvocation.host?/port?), runWeb forwards each to AppCLIEntry
only when present, and AppCLIEntry patches the webserver row only for an
explicit flag. cordis.yml is the single source of the host/port default; the
adapter still validates a flag when given. Removes the now-unused
DEFAULT_WEB_PORT; LOOPBACK_HOST/ALL_INTERFACES_HOST stay as the allowed-value
vocabulary (validation + the printed URL/LAN line).
2026-07-25 15:03:17 +08:00
Turtle 2dfd8635e8 Merge branch 'master' into worktree/dsh-arg-parser
Integrate the Commander argument adapter and dsh-front-door work with master's
config-tree `dsh web` (#601: AppCLIEntry + apps/cli/cordis.yml) and the
packages/ui/acp → packages/acp/acp relocation.

- web.ts: keep master's AppCLIEntry-based boot, but take the adapter's parsed
  (host, port, dev) instead of an internal parseArgs. The adapter's host/port
  defaults (127.0.0.1/3080) match cordis.yml, so always passing them is
  behavior-equivalent to master's "undefined keeps the yml default".
- apps/cli/package.json: master's expanded config-tree dep set + commander.
- retire-readline Agent Note: point the TUI refusal proof at
  apps/cli/tests/built-bin.e2e.ts (both languages), re-record the pair.
- READMEs reconciled (demo-bin removal + master's ACP/channel rewording).
2026-07-25 14:37:57 +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 0901140b3f test(cli): cover the dsh built-bin non-TTY refusal
Removing the dsh-tui-demo bin dropped the only test of the TUI's piped-launch
refusal. Add apps/cli/tests/built-bin.e2e.ts (apps/*/tests added to the e2e
vitest include) running the built lib/bin.js under plain Node with piped stdio,
and point the refusal message at `dsh -p "task"` for automation.
2026-07-25 13:01:45 +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
Turtle ee5132c1e1 refactor(cli): dispatch web as a reserved token, drop parse machinery
Simplify the Commander adapter now that behavior can change: dispatch a leading
`web` token to its own parser instead of a subcommand of the root program, and
read opts()/processedArgs after parse() instead of action closures with a
mutable holder.

This removes enablePositionalOptions(), the parent-option leak guard, both
action closures, and the --resume/--prompt argParser threading. Behavior
changes: `dsh -p x web` is a headless prompt (extra positional dropped),
`dsh web -p x` fails loud (web has no -p), and a repeated --resume is natural
last-wins. The two real fail-loud invariants stay as post-parse checks: an empty
--resume= id (agent-loop treats '' as no-resume) and an empty -p task.

Trims args.spec.ts to the routing/fail-loud/help behavior that matters; the
tui-agent keyless PTY smoke still covers bin.ts dispatch end to end. Net ~114
fewer lines across adapter and tests.
2026-07-24 20:01:38 +08:00
Turtle 800bafda3b refactor(cli): parse dsh argv through one Commander adapter
Replace the dsh CLI's three hand-rolled parsing idioms (raw argv[0]/includes
dispatch in bin.ts, per-mode node:util parseArgs in headless.ts/web.ts, and the
bespoke parseResumeArg scanner in dsh-app-boot) with a single Commander adapter
in apps/cli/src/args.ts. parseDshArgs resolves argv into a discriminated
DshInvocation union; bin.ts switches on the mode and dynamic-imports the chosen
module, which now consumes already-parsed values.

- web is a real subcommand; --host uses choices and --port an argParser range
  check, moving validation into the parser.
- --resume rejects empty and repeated forms; --prompt rejects empty; a config
  positional after --prompt and a root flag placed before web fail loud.
- adds --help/--version; removes parseResumeArg from dsh-app-boot.
- new apps/cli/tests/args.spec.ts (apps/*/tests added to vitest include,
  apps/cli/tests to tsconfig.host.json); the tui-agent keyless PTY smoke covers
  bin.ts dispatch end to end unchanged.
2026-07-24 19:43:59 +08:00
Turtle 8975f12272 Merge pull request #593 from deepseek-harness/feat/examples-third-party-llm-docs
chore(examples): declare @deepseek-ai/dsh-llm-pi-ai as an example dep
2026-07-24 18:54:33 +08:00
Turtle e525b68106 Merge branch 'master' into feat/examples-third-party-llm-docs 2026-07-24 18:48:01 +08:00
Turtle 081bb1a8fd Merge remote-tracking branch 'origin/master' into feat/send-unify
# Conflicts:
#	packages/client/runtime/src/client/sessions/fold-adapter.ts
2026-07-24 17:17:35 +08:00
Turtle d2b2539f3e Merge remote-tracking branch 'origin/feat/send-unify' into feat/send-unify
# Conflicts:
#	docs/architecture.i18n.yaml
#	docs/architecture.md
2026-07-24 16:58:32 +08:00
Turtle 4be3301952 fix: migrate merged-in context/message references to user/message
The master merge introduced a tui goal-restore test and the guard parent
README that still used the removed context/message event. Point both at
the coalesced plugin-sourced user/message.
2026-07-24 16:56:36 +08:00
Turtle 80bbe959a7 Merge remote-tracking branch 'origin/master' into feat/send-unify 2026-07-24 16:52:46 +08:00
Turtle 49c4b7c2b4 Merge pull request #595 from deepseek-harness/fix/tui-resume-fullscreen-picker
feat(tui): add full-screen session resume
2026-07-24 16:52:16 +08:00
Turtle bb124c2869 Merge branch 'master' into feat/send-unify 2026-07-24 16:31:00 +08:00
Turtle d3b00bbdff test(tui): await fresh model selector frames 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
Turtle 4a0d8bb0d5 Merge pull request #588 from deepseek-harness/worktree/agent-message-intents
refactor(agent): name delivery methods by intent
2026-07-24 15:58:22 +08:00
Turtle bcc041829c chore: expose dsh root script 2026-07-24 15:55:47 +08:00
Turtle be29b012f1 fix(jsonrpc): update agent followup test doubles 2026-07-24 15:39:04 +08:00
Turtle b02b438667 refactor(agent): align delivery method names 2026-07-24 15:08:36 +08:00
Turtle d3e24356ba refactor(goal): loosen executor presence checks 2026-07-24 13:53:06 +08:00
Turtle d613fdb073 fix(agent-loop): third review pass — disposal discard ordering, flush guard, docs
Address a fresh-eye review of the disposal/injection fixes:
- disposal now snapshots, clears, and marks disposed BEFORE emitting
  agent/inbox/discard (mirroring cancel's snapshot→clear→emit), so a
  re-entrant send/cancel from a discard listener throws 'disposed' or
  finds an empty inbox instead of leaking or double-discarding an id.
  The discard is unconditional (even on unpublished setup-rollback) to
  match send's unconditional enqueue, keeping every id balanced.
- restore the turnRecorded guard on the idle-injection flush: a
  turn/start rejected pre-commit (append reentrancy / internal-dispatch
  veto) records nothing and owes no flush; the previous unconditional
  flush emitted a phantom-turn agent/error. The isTurnOpen/turnRecorded
  branches are reachable (reentrant inject from a session/event
  listener) and now covered by a regression test rather than v8-ignored.
- rewrite the agent/inbox/discard event JSDoc to enumerate all three
  emitters (cancel, terminal turn-stop, disposal) — every enqueued id
  gets exactly one terminal dequeue-or-discard.

Per-file coverage stays 100%.
2026-07-24 13:39:06 +08:00
Turtle d94a4916f1 fix(goal): preserve normalized argument shape 2026-07-24 13:16:14 +08:00
Turtle d436074cc2 fix(goal): accept empty update fillers 2026-07-24 13:15:39 +08:00
Turtle 0d41349002 Revert "fix(goal): tolerate strict provider filler fields"
This reverts commit 9a30dbb0f537f512180754c4778c15f9f94f1a95.
2026-07-24 13:09:13 +08:00
Turtle 2e1be7d4d7 Revert "test(goal): align master snapshots"
This reverts commit 028e63a9eee281a254f113f4721a67343e5521ca.
2026-07-24 13:09:13 +08:00
Turtle e27a1319ef test(goal): align master snapshots 2026-07-24 12:59:06 +08:00
Turtle 218c98c2c2 fix(goal): tolerate strict provider filler fields 2026-07-24 12:50:28 +08:00
Turtle c7c1b97501 fix(agent-loop): address second-round review — disposal discard, injection validation, frozen payloads
Address the review bot's five genuinely-new findings on the current code:
- disposal now discards any still-pending inbox items before the loop
  exits, so every enqueued id gets a terminal lifecycle event.
- injection (next-step/no-wakeup) validates its payload up front, before
  opening the idle one-shot turn, honoring 'invalid input throws before
  any append'; and rejects attached contexts (which belong only to inbox
  messages) rather than silently dropping them.
- agentMessage() freezes the agent/inbox/* payload so a listener cannot
  mutate the shared correlation object mid-dispatch.
- refresh the package READMEs (compact, goal, guard, hook-protocol,
  plan-mode, time-context, workspace-context) that still referenced the
  removed context/message event, with the source-based user/message
  distinction.

The up-front injection validation makes two finally branches unreachable
(v8-ignored as the turn-enclosure backstop). Adds regression tests for
disposal discard, context rejection, up-front validation, and the frozen
payload; per-file coverage stays 100%.
2026-07-24 12:05:57 +08:00
Turtle 7b7f793ee5 test: fix CI coverage + e2e for user/message coalescing
- tui.spec: exercise a goal-sourced injected context card (labels by
  source kind, not plugin name), closing the last uncovered branch in
  tui/src/index.ts that the CI coverage gate caught.
- time-context.e2e / goal.e2e: filter injected context by source now
  that it is a user/message (plugin/goal source), and count goal
  continuation rounds by round>0 rather than event type.
2026-07-23 22:57:39 +08: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
Turtle 1f9a3e1bee fix(agent-loop): second review pass — late-steering discard, dead-branch, catalog leaks
Address a second fresh-eye review of the review fixes:
- MAJOR: late steering that lands after runTurn returns terminally
  stopped (e.g. during the post-turn flush) was drained by runLoop and
  dropped without a discard, leaving a dangling outstanding id the
  negative-only invariant can't catch. Emit agent/inbox/discard for it,
  symmetric with the in-turn terminal-stop drop.
- remove the dead cancel() idle-settle branch: whenIdle's fast path
  already resolves for a lone quiet item, so no waiter is ever left for
  it to settle. Document why.
- gen-cordis-api classShape now drops private/protected/#private members
  and strips getter/setter bodies, so Session no longer leaks private
  fields and getter bodies into the model catalog.
- document that AgentMessage intentionally omits meta (durable-only).

Adds a regression test for the late-steering discard.
2026-07-23 22:33:12 +08:00
Turtle 98ee4ce429 fix(agent-loop): address review — quiet-item parking, meta, discard balance
Resolve six review findings on the unified-send change:
- quiet (wakeup:false) queued items no longer un-park the driver; the
  inbox distinguishes hasWakingQueued (drives the loop, idle/quiescence)
  from hasQueued (anything to dequeue), so a lone quiet item parks at idle
  and rides the next waking send. whenIdle/cancel settle off the waking
  signal, so cancelling a parked quiet item no longer hangs whenIdle.
- SendOptions.meta on queued/steering sends now reaches the durable
  user/message and steering/message (was dropped except on injection).
- a terminal agent/turn-stop that drops pending steering emits
  agent/inbox/discard so the enqueue-dequeue-or-discard ledger balances.
- the loop-authored continuation reason is snapshotted and frozen like a
  public send.
- gen-cordis-api collects exported classes (body-stripped) so the now-
  abstract-class Agent and its transitive shapes reappear in the API
  catalog.

Adds regression tests for each and re-records the affected snapshot.
2026-07-23 21:41:42 +08:00
Turtle c402cc2422 test(snapshot): re-record acp fixtures after merging master
Merge took master's snapshot fixtures; re-record the two keyless
scenarios so they reflect this branch's user/message coalescing and the
abstract Agent + AgentMessageId type dump.
2026-07-23 20:58:35 +08:00
Turtle a3ad5241ba Merge remote-tracking branch 'origin/master' into feat/send-unify
# Conflicts:
#	docs/persistence-catalog.md
#	examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
#	packages/context/time-context/tests/time-context.spec.ts
#	packages/cordis/tool-cordis/src/api-catalog.ts
2026-07-23 20:54:48 +08:00
Turtle 866b543700 docs(agent): fix stale 'info' param name in agent/inbox/enqueue JSDoc
The @param was renamed info→message; the body sentence still named info.
Found by fresh-eye review. Regenerated the catalog/graph docs.
2026-07-23 20:50:13 +08:00
Turtle 3fd72f7c74 feat(agent): rename InboxItemInfo to AgentMessage with an id; send returns it
Add a branded AgentMessageId assigned to each accepted send message and
returned from send/followup/steer/inject (was void). Rename the inbox
event payload InboxItemInfo to AgentMessage, carrying that id so a caller
can correlate a queued item with its enqueue/dequeue/discard events.
2026-07-23 20:45:29 +08:00
Turtle b63abe80d6 docs(agent-note): add Chinese counterpart for unified-send Agent Note
Bilingual pair required for docs dated on/after 2026-07-14; adds the
.zh.md, the language-switcher lines, and the recorded .i18n.yaml sidecar.
2026-07-23 19:54:31 +08:00
Turtle 95e75ba3e0 fix(agent-loop): balance inbox invariant on continuation-reason steer
The FIFO-conservation invariant fired on the loop-authored continuation
reason path: a continue-with-reason decision entered the steering FIFO
without an agent/inbox/enqueue, so its later dequeue/discard had no
matching enqueue. Emit the enqueue for that steer too, add a regression
test that mounts the invariant over a continue-with-reason turn and a
cancel, and hoist the duplicated inboxInfo helper into inbox.ts.

Found by fresh-eye review.
2026-07-23 19:37:21 +08:00
Turtle 44fd93fd06 feat(agent): unify send(target × wakeup), coalesce context/message into user/message
Replace send/steer/inject with one Agent.send primitive over the
(target × wakeup) matrix; followup/steer/inject become fixed-preset
alias methods on the now-abstract Agent class. Coalesce context/message
into user/message (injected context is a non-user source). Replace
agent/queued with agent/inbox/enqueue/dequeue/discard, add cancel
keepInbox, and add a FIFO-conservation invariant.
2026-07-23 19:15:45 +08:00
Turtle ae2ec5f8d7 fix(demo): build client plugin bundles before serving dsh web
demo:web and the README Web UI instructions ran only build:web (the Vite
frontend shell), never the root build that emits each web-client plugin's
lib/client.js. On a clean checkout every /plugins/<id>/client.js 404s and
the client loader shows "Failed to load plugins".

Run pnpm run build before build:web in both the demo:web script and the
README instructions for the installed ~/.dsh/source checkout.
2026-07-23 16:37:56 +08:00
Turtle 7d751d3894 test(web): provide workspace context config 2026-07-23 16:04:32 +08:00
Turtle 5cdb192e92 Merge remote-tracking branch 'origin/master' into fix/web-zstd-session-logs 2026-07-23 16:00:27 +08:00
Turtle 3b97c7b318 fix(web): compress session logs by default 2026-07-23 15:54:10 +08:00
Turtle 1f9633a8ce docs(cordis-tutorial): address review — effect-wrap demo timer, drop entry-order promise, stable ids in HMR example 2026-07-22 18:59:05 +08:00
Turtle 2cbb7848a7 docs(cordis-tutorial): trim API-key aside from full-agent pointer 2026-07-22 18:37:13 +08:00
Turtle 5fe5a6bc78 docs(cordis-tutorial): drop 'What belongs in config' section 2026-07-22 18:30:04 +08:00
Turtle 55af920def fix(vendor/include): keep config reloads resilient 2026-07-22 17:50:45 +08:00
Turtle 484b5f5a06 docs(cordis-tutorial): say short-circuit instead of veto 2026-07-22 17:44:31 +08:00
Turtle 1df2445072 docs(cordis-tutorial): rename 'Dependencies are live' heading to state the mechanism 2026-07-22 17:24:03 +08:00
Turtle bbcc8faa95 docs(cordis-tutorial): note PENDING fibers do not keep Node alive 2026-07-22 17:19:46 +08:00
Turtle 1628f50283 docs(cordis-tutorial): clarify ctx.plugin function form; add dsh badge to every chapter 2026-07-22 17:07:15 +08:00
Turtle 7b46e1f73c fix: address PR #504 review warnings
- workspace-context: a transiently unavailable but still-effective candidate
  keeps its cached trimmed digest in the directory's dedup slot, so an
  identical later sibling is not emitted as a duplicate set until the next
  successful reconciliation
- app-boot: --resume rejects a following token that is itself resume syntax
  instead of accepting it as a session id
- tui: the queued-steering badge tracks per-entry sources and a drain removes
  one matching entry, so loop-authored steering (no agent/queued) cannot
  consume a pending user message's slot
2026-07-22 16:49:50 +08:00
Turtle 21456a36ca docs: add hands-on Cordis tutorial
Seven-chapter tutorial under docs/cordis-tutorial/ for agent developers
new to Cordis: first plugin, lifecycle/effects, services, events,
config, composition/HMR, and a final chapter registering a tool against
real harness services. Every transcript was produced by running the
chapter files in a gitignored tmp/ scratch directory.

Published to both website locales as mirrored English pages under a new
'Cordis tutorial' develop-sidebar section; a Chinese pair can be added
later without route changes.
2026-07-22 16:36:48 +08:00
Turtle ab32d3ec98 test(workspace-context): make the merged suite's fixtures cross-platform
Path expectations derive from join() per the cross-platform fixtures
convention; the fake fs resolves against the host root so drive-letter
targets match seeded keys; the unreadable-candidate cases use the provider
throwOnRead fixture (host chmod 0 is a no-op for the owner on Windows),
keeping the read-failure branch covered there, with a narrow win32 skip only
for the host-chmod discovery case.
2026-07-22 15:54:01 +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
Turtle a58229187f chore(llm-pi-ai): bump pi-ai to 0.81.1 for the gpt-5.6 model catalog
pi-ai 0.80 restructured its entrypoints: the static catalog reads now
live on /providers/all as getBuiltinModels/getBuiltinProviders (keyed by
the catalog-only BuiltinProvider type, replacing KnownProvider at those
call sites), and the global streamSimple moved to /compat. The config
schema gains the new 'max' reasoning level.
2026-07-22 14:30:01 +08:00
Turtle 478079cc98 test: close the merged branches' coverage gaps
Cover the fs-provider load path without a cancellation signal, the app-level
resumeCommand forwarding, and a command returning an error result.
2026-07-22 14:30:01 +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 dfd1eeeadb test: align merged suites with master's cancel cause and optional welcome
workspace-context's abort-tool test uses agent.cancel({kind:'user'}) (master's
AgentCancelCause shape); tui-demo forwards no welcome when none is configured.
2026-07-22 14:29:52 +08:00
Turtle 30c7e76ea5 fix(tui): reconcile master's model selector and session titles with the staging footer and status line
Post-rebase reconciliation of the two TUI lines that evolved in parallel:
- header subtitle prefers the latest logged session title over the configured
  welcome; the process-local auto-title owns the whole terminal title while a
  logged session/title still wins through the suffixed form
- footer keeps staging's model/cwd/usage/cache layout and gains master's
  context-percent segment; per-step usage dedup carries cache buckets
- test harness only stubs the llm catalog when the test did not mount the
  real LlmService, and defaults the TUI clock to the real Date.now
- the plugin-shaped /reload test composes commands+llm like the shipped app
2026-07-22 14:29:52 +08:00
Turtle 2464d6169f feat(app-boot): move personal config to the Harness home (~/.dsh)
Squashes feat/personal-config-dsh-home: personal config.yaml and .env move
from ~/.config/dsh to the Harness home (~/.dsh), plus the module-graph,
lockfile, and i18n pairing regeneration that followed.
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 5773ef9b0c fix(gates): bound pre-push test gate vitest workers 2026-07-22 14:29:52 +08:00
Turtle 717f301cdd feat: curl one-liner install script for dsh
Squashes feat/install-script, feat/install-default-master, and
install-skip-clone: DSH_REF defaults to master, and running the script from
inside an existing checkout reuses it and skips the clone.
2026-07-22 14:29:52 +08:00
Turtle 8995ce367f feat(tui): remove the /cancel slash command 2026-07-22 14:29:52 +08:00
Turtle d04ec5a6db feat(tui): restore the startup banner borderless, painted in the DeepSeek brand gradient
Squashes feat/tui-borderless-banner and feat/tui-banner-brand-gradient.
2026-07-22 14:29:52 +08:00
Turtle bffd80fa12 feat(tui): add /skill:<name> manual skill invocation command 2026-07-22 14:29:52 +08:00
Turtle 2a5dfb7d35 feat(tui): session resume — /resume command, exit hint, and dsh --resume <id>
Squashes feat/tui-resume-command, fix/tui-resume-desc, and
feat/tui-resume-flag.
2026-07-22 14:29:52 +08:00
Turtle 87899ae161 feat(workspace-context): load all instruction candidates, dedup by trimmed content, follow symlinks
Squashes feat/instruction-load-all-dedup and feat/allow-instruction-symlink.
2026-07-22 14:29:52 +08:00
Turtle dd55b2cc62 feat(tui): verbose turn-phase status line with elapsed timing and cache hit rate
Squashes feat/tui-cache-hit-rate and feat/tui-verbose-status: the footer
shows cache hit rate and the running status line reports turn phase with
elapsed timing.
2026-07-22 14:29:28 +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 9c8994f65a feat(tui): experimental dev-only /reload command for loader configs
Squashes feat/tui-reload-command and fix/reload-idle-only: /reload requires
an idle agent.
2026-07-22 14:29:28 +08:00
Turtle 19f9a509aa feat(cli): tell the agent where its own source lives and invite it to extend dsh
Squashes feat/dsh-system-prompt-source-path and feat/dsh-source-extend-hint.
2026-07-22 14:29:28 +08:00
Turtle 0e06d0691d feat(examples): default agent configs to DeepSeek Pro Max Thinking 2026-07-22 14:29:28 +08:00
Turtle 7dbe99f008 feat(tui): badge queued steering count on the running status line 2026-07-22 14:29:28 +08:00
Turtle c8cc087e05 feat(workspace-context): load .local. instruction overlays by default
Load a per-directory local overlay in addition to the base instruction
file, matching the Claude Code AGENTS.local.md / CLAUDE.local.md
convention for git-ignored personal guidance.

- New config `localInstructionFileCandidates`, default
  `['AGENTS.local.md', 'CLAUDE.local.md']`; empty disables the overlay.
  The default lives in the plugin Config schema, so every front door
  (TUI/ACP/headless) reads .local. files consistently.
- Per project directory the plugin loads the first-existing base
  candidate, then additively the first-existing local candidate,
  rendered after the base so it takes precedence within the byte budget.
- Base and local tiers get distinct scope keys via a NUL sentinel
  (scopeKey/decodeScopeKey) so they never collide in the baseline map,
  pending window, or version cache.
- The fixed user-global $DSH_HOME/AGENTS.md stays base-only.

Docs: README (config, lifecycle, Known Limitations), regenerated
config-catalog, and a new bilingual Agent Note cross-linked to the
owning workspace-context note. 100% per-file coverage retained.
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 6baa030594 feat(cli): dsh CLI with personal config overlays from ~/.config/dsh 2026-07-22 14:29:28 +08:00
Turtle a2f17d71ed fix(vendor/include): config hot-reload keeps the last good tree and its patches 2026-07-22 14:29:28 +08:00
Turtle a409f8b4ba feat(tui): detect terminal color scheme and apply light-optimised palette
Squash of the linearized fix/tui-color-scheme-v2 merge and the follow-up
catalog regeneration. Renders error cause chains at every diagnostic seam
(origin/fetch-failed-diagnostics) and adds color scheme detection with a
light-terminal palette.
2026-07-22 14:29:27 +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
Turtle e97290ba9e docs(telemetry): state anonymous id as per-harness-home, not per-machine
The consolidated resolver scopes the anonymous id to $DSH_HOME rather
than the machine. Update the module contract, README, and Agent Note to
say per-harness-home explicitly instead of over-claiming a machine-global
identity, and record why DSH_HOME scoping is the intended single-root
meaning rather than a regression.
2026-07-21 15:57:17 +08:00
Turtle fac3fc090f fix(paths): treat empty DSH_HOME as unset; isolate telemetry env test
Review fixes for #462:
- resolveDshHome now treats an empty or whitespace-only $DSH_HOME as
  unset, so a blank override never resolves the home to cwd via
  resolve(''). Restores the guard telemetry's old resolver carried.
- The default-env telemetry test asserts only that globalConfigDir()
  returns an absolute path, so a machine DSH_HOME without a .dsh suffix
  cannot break it.
2026-07-21 14:43:38 +08:00
Turtle a0268d2509 fix(compact-basic): replay conversation prefix so summarization reuses KV cache
Automatic compaction fires mid-conversation, right after the loop warmed
the provider's KV cache with the last routed request. The default
summarizer then issued a separate request whose prefix shared nothing
with that warm request — a bespoke summarizer system prompt followed by
the older history flattened to one rendered transcript string — so a
differing first token invalidated the entire cached prefix and every
compaction re-processed the whole replayed history twice.

Move the compaction directive from the FRONT (a fresh system prompt) to
the END (a trailing user message), and replay the last routed request's
own system prompt, tools, message prefix, and shadowed-region messages
verbatim via session.requestHeader() + deriveEventMessage. The auxiliary
call is now a genuine prefix-extension of the warm request, so the
provider reuses the cached tokens up to the trailing instruction.

SummarizationInput carries the replayed prefix instead of a flat string;
the now-unused renderTranscript/renderContentBlocks path is removed with
its spec. Cache reuse is best-effort (head compaction guarantees a hit;
a mid-range compaction or a differently-routed summarizer forgoes it),
correctness is not.
2026-07-21 13:55:22 +08:00
Turtle 92e0d0e04f refactor(paths): collapse harness home resolution into one resolver
Delete @deepseek-ai/dsh-home and make dsh-paths the sole owner of the
single-root harness home ($DSH_HOME || ~/.dsh). Migrate tool-bash,
skill-local, and agent-spine-demo off dsh-home, and fold telemetry's
divergent globalConfigDir onto the shared resolver, dropping its second
XDG/APPDATA policy and the deepseek-harness namespace so the anonymous
id lives under the harness home. Add dshHomeDisplay() for symbolic
user-facing paths, replacing workspace-context's bespoke check.
2026-07-21 13:52:00 +08:00
Turtle dd57d3009d test(sandbox): decouple the probe-timeout test from the racy default budget
The earlier fix only widened the vitest timeout, but the real race is the
patient probe reading the 1s launcher under the 5000ms *default* probe budget:
under a full parallel run spawnSync blocks the worker and fork/exec latency can
push the launcher's wall-clock past 5000ms, so the patient probe wrongly reads
unusable and the assertion fails. Give the patient probe a generous explicit
15000ms budget (still far below its 1s launcher runtime margin) so only the
250ms impatient probe races the launcher; keep a 30s vitest timeout above the
patient budget.
2026-07-21 10:07:03 +08:00
Turtle bdbd22bb97 Merge remote-tracking branch 'origin/master' into fix/tui-color-scheme-v2
Resolve conflicts:
- packages/ui/tui/src/index.ts: keep the color-scheme detection block; drop the
  obsolete static autocomplete list (master moved to refreshCommandAutocomplete).
- docs/config-catalog.md: regenerate (tui Config source line shifted to :104).
2026-07-21 10:06:49 +08:00
Turtle a205ba4c29 test(sandbox): give the probe-timeout test headroom over vitest's default
`bounds the default probes` runs a real launcher that sleeps 1s under the
5000ms default probe budget, all wrapped in vitest's 5000ms default test
timeout. The blocking spawnSync races that wrapper and tips over under the
load spike of a full parallel run — a pre-existing, load-sensitive flake
(noted as unrelated in this PR's original description). Give the test an
explicit 20s timeout so its bounded subprocess work never races the default.
2026-07-21 09:42:12 +08:00
Turtle f81d382230 fix(tui): make color-scheme detection fully covered and race-free
The color-scheme detection block left packages/ui/tui/src/index.ts below
the 100% per-file coverage gate on three counts: the .then callback's
`scheme === undefined` branch was reachable only via the 2s query
timeout, the .catch only via a query-write failure, and the
`editor.borderColor` assignment inside applyColorScheme was dead code —
the next line's setStatus() immediately reassigns editor.borderColor.

Register the scheme listener before firing the startup query so the
query's own reply is delivered through the listener (the same path as
later theme switches), which removes the redundant .then re-application
and its uncoverable undefined branch, and closes the theoretical window
where a synchronous reply lands before the listener exists. Drop the
dead editor.borderColor line. Cover the rest: a same-scheme report
(early return) and a terminal that throws on the query write (the
swallowed .catch).
2026-07-20 22:17:35 +08:00
Turtle aa7e8ea728 Merge branch 'master' into fix/tui-color-scheme-v2 2026-07-20 21:13:57 +08:00
Turtle 734bd40bb6 docs: regenerate config catalog after stacking on #425 2026-07-20 19:03:15 +08:00