Commit Graph

615 Commits

Author SHA1 Message Date
Yichen Jiang
b77fb9036c refactor(agent-presets,web): copy-only preset authoring with a path to the files
The web YAML editor is gone. agentPreset.write (arbitrary composition
text) became agentPreset.copy { from, agentPreset, name? }: a host-side
whole-directory copy of ids the host resolves itself — symlinks
dereferenced, modes re-tightened to owner-only with owner-execute kept,
metadata rewritten to keep the source's description but never its name or
roster order. No composition text or path crosses the wire in either
authoring direction, and the entryListSchema/!!js concern dissolves with
assertComposition itself.

The settings section becomes: a read-only viewer over shipped
compositions, a copy dialog (id + optional display name) as the only
create entry, delete for custom rows, and a location action leading into
the preset's own files — agentPreset.openDocument { agentPreset } resolves
the directory host-side and opens it natively, or answers
{ opened: false, path } for the row to show as text where the deployment
has no desktop. agentPreset.list reports hasDocument beside authorable;
the gateway's nativeOpen config pins the capability where
canOpenNativePath platform detection would mislead. The privileged set is
now read/copy/openDocument/remove.

With files as the only composition editor, standing mounts grew
stamp-keyed generations: ensureStanding compares the composition file's
mtime+size and starts the next generation for later sessions, while every
joined session keeps the generation it runs on.

New keyless web lane (agent-preset-authoring, overlay pins
nativeOpen: false so goldens render one branch on every platform) drives
view/copy/reveal/delete end to end; the real-composition CLI e2e switches
to copy semantics.
2026-08-08 22:35:26 +08:00
Yichen Jiang
3926e95c61 Merge branch 'stack/agent-profiles-5-web-ui' into stack/agent-profiles-8-authoring 2026-08-08 20:16:58 +08:00
Yichen Jiang
c578ededa1 Merge branch 'stack/agent-profiles-3-wire' into stack/agent-profiles-5-web-ui 2026-08-08 20:16:58 +08:00
Yichen Jiang
132debb5fe fix(apiproxy): echo the resolved agent preset on create and session-added
session.create's reply named only the id, and the session-added frame's
agentPreset — which the server already derives via sessionListFields — was
stripped by the wire schema it never joined. A client therefore could not
label a session it just created (or learned live) until the next full list
refresh: the header's preset label rendered nothing for exactly the sessions
made in this tab. The create reply is the commit point that knows the
RESOLVED composition (a caller that named none gets the default the header
recorded), so both carriers now say it.
2026-08-08 20:16:50 +08:00
Yichen Jiang
cacc8fbca7 Merge branch 'stack/agent-profiles-5-web-ui' into stack/agent-profiles-8-authoring
Authoring meets standing mounts: write() and remove() drop the standing
pointer so the NEXT session composes the edited roster, while every session
already joined keeps the generation it runs on — a superseded generation is
never disposed while the process lives. The settings-dialog golden re-records
with this layer's Agent Preset nav entry, which the incoming layer-3 record
had overwritten.
2026-08-08 19:09:32 +08:00
Yichen Jiang
01bd8ecefe Merge branch 'stack/agent-profiles-3-wire' into stack/agent-profiles-5-web-ui
recompose becomes a parent re-link: the new preset's standing mount is
ensured BEFORE the link moves, so a failed switch leaves the agent exactly as
it was — the unmount-then-restore dance (and unmountPresetFor with it) is
gone, and the restore-failure test now asserts the agent KEEPS its tools with
the source directory deleted, because the standing mount is not the file.
2026-08-08 18:52:45 +08:00
Yichen Jiang
46649858f6 Merge branch 'stack/agent-profiles-1-seam' into stack/agent-profiles-3-wire
Rewires this layer onto the standing-mount model:

- serviceForAgent roots its search at the agent's standing mount (parent
  scope key → live mount fiber) — the composition no longer lives under the
  agent's own fiber, and two agents on one preset now address ONE instance,
  which the sharing test asserts instead of distinctness.
- viewFor/historyPage take a registry view SCOPE. A live agent is that scope;
  a cold read uses the recorded preset's standing key via standingKeyFor —
  composing plugins but starting no agent, session, or turn. A header without
  a preset (a pre-roster log) renders through the DEFAULT preset's standing
  layer; an unusable preset degrades the read to generic cards, never fails
  it. This turns produced-files and chat-scroll green structurally, with the
  token counts untouched (no resume, so the projections fold stays detached).
- The detached projections baseline now includes every standing unit's key at
  its empty fold (todos: null): the standing mount registers units
  deterministically, which is what makes the client's "omitted key =
  capability absence → clear" rule safe again. seeded-history's contract test
  asserts the new shape.
- The standard preset's realm preamble no longer claims a shared label pools
  instances — provide() throws on the second registration under one realm
  symbol; labels join REALMS.
2026-08-08 18:41:07 +08:00
Yichen Jiang
e52dd048f9 Merge branch 'stack/agent-profiles-5-web-ui' into stack/agent-profiles-8-authoring
# Conflicts:
#	packages/host/apiproxy/tests/api-proxy-agent-preset.spec.ts
2026-08-08 15:54:27 +08:00
Yichen Jiang
5e892aa6dc Merge branch 'stack/agent-profiles-3-wire' into stack/agent-profiles-5-web-ui
# Conflicts:
#	packages/host/apiproxy/tests/api-proxy-agent-preset.spec.ts
2026-08-08 15:54:16 +08:00
Yichen Jiang
a21644af59 fix(web-app,agent-presets): keep the goal service on the host plane
The Gateway serves the goal domain as Remote endpoints, and a Remote method
picks its receiver Service from a generated descriptor — `clear(agent, ref)`
takes its agent as a PARAMETER, so the invocation is direct and the receiver
resolves on the host. Behind the preset's entry-local realm there was nothing
to resolve, and every browser goal call answered `service-unavailable`: the
composer's Clear goal button left the bar on screen.

That is the `bash-env` criterion read from the other side. Injection is not the
only host relationship a Service can have; being READ from a host row is one
too. The registry is keyed by session, so one host instance serves every
session exactly as it did before presets. The preset keeps the model-facing
tool, which is the choice a preset is for.

Also reverts the cold-transcript presenter resolve: resuming an agent to reach
its presenters made the context meter drop its cache and token counts on every
cold-opened session, trading one silent degradation for another. The card
degradation it addressed is diagnosed and still open.
2026-08-08 15:53:39 +08:00
Yichen Jiang
61e7a93a66 Merge branch 'stack/agent-profiles-5-web-ui' into stack/agent-profiles-8-authoring
# Conflicts:
#	packages/host/apiproxy/tests/api-proxy-agent-preset.spec.ts
2026-08-08 15:29:22 +08:00
Yichen Jiang
43b2673b69 Merge branch 'stack/agent-profiles-3-wire' into stack/agent-profiles-5-web-ui
# Conflicts:
#	packages/host/apiproxy/tests/api-proxy-agent-preset.spec.ts
2026-08-08 15:28:41 +08:00
Yichen Jiang
1c80023b12 fix(apiproxy): give a cold transcript read the agent its presenters live in
A preset registers its tools into the agent's OWN layer, so `session.history`
served while no agent exists found no presenter at all and every card degraded
to the generic renderer — silently, because a viewless entry is also what a
tool with no presenter produces. The web client opens a session by reading its
transcript, so this was the ordinary path, not an edge: the write row lost its
diff card, and with it the `locations` the produced-files row derives from.

The read now resolves the agent through the same deduplicated resume every
other session method takes, but only when a roster is composed: a deployment
without presets keeps its tools on the host layer, which needs no agent to
address, and keeps the storage-only read unchanged. A resolution failure stays
a successful read.
2026-08-08 15:27:57 +08:00
Yichen Jiang
a06df4aa41 Merge branch 'stack/agent-profiles-5-web-ui' into stack/agent-profiles-8-authoring
The composer's preset seat stays removed here — this layer moved it to the
hero chip and the session-header action — so only the model seat takes the
`modelSeatLocked` narrowing master introduced.

Conflicts:
	apps/web/tests/snapshots/*/*.expected.md
	packages/client/connection/README.md
	packages/client/connection/README.zh.md
	packages/client/ui-conversation/src/client/skeleton/InputBar.tsx
	packages/host/apiproxy/src/fetch/client.ts
2026-08-08 15:09:37 +08:00
Yichen Jiang
beec364e04 Merge branch 'stack/agent-profiles-3-wire' into stack/agent-profiles-5-web-ui
The Client API carrier's `agentPresets` member was the one member of its class
without an `IApiClient[...]` annotation. Inferring it inlined `AgentPresetEntry`
into the emitted declaration by the specifier TS picks — the host `index.ts` —
dragging the whole gateway, and with it the host `Context` merges, into every
Client program importing the carrier. Annotated like its siblings.

`ApiRemoteAgentOptions.setup` now takes the inspected session rather than its
header alone: this layer resolves a resumed session's preset from the LOG,
because a session that switched while blank ran its turns under the newer
composition and the header is written once at creation.

Conflicts:
	apps/web/tests/snapshots/*/*.expected.md
	packages/client/ui-conversation/src/client/skeleton/InputBar.tsx
	packages/host/apiproxy/src/api-proxy.ts
	scripts/doc-budgets.manifest.json
2026-08-08 15:00:31 +08:00
Yichen Jiang
c5ca12eabd Merge branch 'stack/agent-profiles-1-seam' into stack/agent-profiles-3-wire
master extracted this layer's inline cold-resume resolver into
@deepseek-ai/dsh-api-remotes, whose `setup` was a fixed AgentSetup. A resumed
session composes the preset ITS header recorded, so the option becomes a
function of that header; the resolver builds the setup before the published
re-checks so those stay adjacent to `resume`.

Conflicts:
	docs/cordis-catalog/services.md
	docs/module-graph.md
	packages/host/apiproxy/package.json
	packages/host/apiproxy/src/api-proxy.ts
	pnpm-lock.yaml
2026-08-08 14:26:38 +08:00
imccyu
d85d0806cd fix(build): align Client build metadata 2026-08-08 12:02:58 +08:00
Yichen Jiang
5cf5e0cb76 fix(agent-presets,connection): reclaim a deleted default, unpin a fence beside an open gate
Deleting the preset a user default names left the setting pointed at an id
nothing will ever supply again, and every session created without an explicit
pick then failed to start — the delete dialog called it 'new sessions cannot
select it', which understates a hard creation error. `remove` now clears the
user layer when it named the preset just deleted, exposing the deployment's own
default underneath. Storing a default that does not exist YET stays deliberate:
the roster is a live directory, so a name absent now may exist by the time a
session asks, and `resolve` still reports that case.

`agentPreset.select` also leaves the loopback set. It was pinned as a real
escalation — one preset mounts the toolset that edits the live runtime — but
`session.create` already takes an `agentPreset`, so pinning only the switch left
the same capability one method over. The deeper reason is that the capability is
not the preset's to grant: the deployment's own default already carries `bash`
and the filesystem tools, so any caller that may start a session at all can
already run commands as this process. `read`/`write`/`remove` stay pinned on
their own footing — those touch files, not sessions.
2026-08-08 11:41:47 +08:00
imccyu
9c3d5725a5 build: order Host and Client compilation faces 2026-08-08 04:20:39 +08:00
imccyu
55ccfb5a48 fix(api): preserve dynamic defaults after rebase 2026-08-07 21:47:18 +08:00
imccyu
bb61dc13f2 refactor(api): colocate gateway and remote assembly 2026-08-07 21:47:17 +08:00
imccyu
d941350227 fix(typert): preserve remote lookup semantics 2026-08-07 21:47:17 +08:00
imccyu
2fe4a53557 fix(typert): validate and mount remote contributions safely 2026-08-07 21:47:16 +08:00
imccyu
e28ac506ed perf(api-gateway): cache SRC endpoint claims 2026-08-07 21:47:16 +08:00
imccyu
5ea6311949 test(api-gateway): cover client mount rollback 2026-08-07 21:47:16 +08:00
imccyu
2e1f9a5cea fix(typert): address remote gateway review 2026-08-07 21:47:16 +08:00
imccyu
e8f2ab89bb refactor(typert): bind remote services through base class 2026-08-07 21:47:15 +08:00
imccyu
1ea5507bf8 fix(typert): close remote gateway review gaps 2026-08-07 21:47:15 +08:00
imccyu
22bec5e63f feat(typert): propagate Remote cancellation 2026-08-07 21:47:15 +08:00
imccyu
9b63d72c94 fix(typert): harden remote reflection boundaries 2026-08-07 21:47:15 +08:00
imccyu
36516e97b9 feat(connection): dispatch TypeRT remotes through shared API 2026-08-07 21:47:15 +08:00
imccyu
9a0a9350c4 fix(typert): satisfy workspace static gates 2026-08-07 21:47:14 +08:00
imccyu
64a963da0b feat: add TypeRT remote gateway infrastructure 2026-08-07 21:47:14 +08:00
Tianyi Cui
09dc20e2f2 Merge pull request #1704 from deepseek-harness/worktree/add-web-pwa-manifest
feat(web): expose install and theme metadata
2026-08-07 21:43:21 +08:00
Tianyi Cui
886dbfe67f Merge branch 'master' into worktree/add-web-pwa-manifest 2026-08-07 19:25:49 +08:00
Yichen Jiang
209fb4d355 Merge remote-tracking branch 'origin/master' into worktree/default-model-persistence
# Conflicts:
#	packages/client/ui-conversation/README.i18n.yaml
#	packages/host/apiproxy/README.i18n.yaml
2026-08-07 18:18:40 +08:00
Yichen Jiang
8669afbbbc test(apiproxy): assert this layer's roster shape on the wire
The roster gained `authorable` here, so the round trip has to expect it.
2026-08-07 16:54:40 +08:00
imccyu
a6ae15c0f6 Merge remote-tracking branch 'origin/master' into feat/web-workspace-file-links
# Conflicts:
#	packages/client/ui-conversation/README.i18n.yaml
#	packages/client/ui-conversation/src/client/chat/ToolRow.module.css
#	packages/host/apiproxy/src/native-path-opener.ts
2026-08-07 16:49:20 +08:00
Yichen Jiang
1056d47ac5 Merge branch 'stack/agent-profiles-5-web-ui' into stack/agent-profiles-8-authoring
# Conflicts:
#	packages/client/ui-agent-preset/tests/settings-store.spec.ts
#	packages/preset/agent-presets/tests/mount.spec.ts
2026-08-07 16:40:36 +08:00
Yichen Jiang
e265c6038f test: cover the agent-preset wire routes and both restore edges
master moved the RPC surface onto the fetch transport, so the two agentPreset
methods arrived there with nothing driving them. Adds the round trip, plus the
two `recompose` edges that had none: an agent that never composed a preset, so
there is nothing to restore, and a restore that fails because the composition
it reaches for is gone — the roster is a live directory.

Marks the deliberate non-Error rejections in the store specs, which is the
branch they exist to cover.
2026-08-07 16:39:44 +08:00
Yichen Jiang
d612103135 refactor(apiproxy): one wording for a preset failure on both paths
Session create and the preset switch can be handed the same two failures, and
a client branching on the code needs them worded identically from either.
2026-08-07 15:57:23 +08:00
Yichen Jiang
9f0159e15c refactor(apiproxy): one wording for a preset failure on both paths
Session create and the preset switch can be handed the same two failures, and
a client branching on the code needs them worded identically from either.
2026-08-07 15:53:18 +08:00
Yichen Jiang
d03d3ab70b Merge remote-tracking branch 'origin/master' into worktree/default-model-persistence
Carries two edits beyond conflict resolution, both forced by what master
brought in:

- `CustomProviderCard`: master added front-end key validation and a
  component-level `keyValue` (already trimmed) while still writing
  `apiKeyEnv` unconditionally. Kept this branch's blank-key rule and its
  committed-profile retry gate, and adopted master's single `keyValue` so
  the component has one spelling of the key rather than two.
- `docs/user/guide/providers`: master merged #1810, whose default-model
  section still taught overriding the `api-gateway` row in
  `$DSH_HOME/config.yaml` — the behavior this branch replaced. Rewritten
  for the settings section the picker now writes, plus the review fix from
  #1810 replacing the colloquial 挂着 in the opener.
2026-08-07 15:44:57 +08:00
Yichen Jiang
1fa9a1cf1d chore(docs): re-record the apiproxy README pairing after the master merge 2026-08-07 15:42:49 +08:00
Yichen Jiang
2463d67c30 Merge branch 'stack/agent-profiles-5-web-ui' into stack/agent-profiles-8-authoring 2026-08-07 15:42:33 +08:00
Yichen Jiang
3b35ad4b2b chore(docs): re-record the apiproxy README pairing after the master merge 2026-08-07 15:42:26 +08:00
Yichen Jiang
5ec13a23b3 Merge branch 'stack/agent-profiles-5-web-ui' into stack/agent-profiles-8-authoring
# Conflicts:
#	packages/host/apiproxy/README.i18n.yaml
2026-08-07 15:41:18 +08:00
Yichen Jiang
df2d2adbb8 Merge branch 'stack/agent-profiles-3-wire' into stack/agent-profiles-5-web-ui
# Conflicts:
#	packages/host/apiproxy/README.i18n.yaml
2026-08-07 15:41:14 +08:00
Yichen Jiang
6093c266c6 Merge branch 'stack/agent-profiles-1-seam' into stack/agent-profiles-3-wire 2026-08-07 15:41:09 +08:00
Yichen Jiang
bb43ff4f37 feat(ui): make a session that cannot send refuse to accept one
A default naming a route the Models page has since removed left the
composer saying 选择模型 while the input still accepted a message, which
then failed inside the adapter mid-turn.

`session.prompt` now refuses with `model-unavailable` before opening a
turn. That is the enforcement boundary: the method stays callable no
matter what a client disables. `session.models` reports the same fact as
`routable`, and ui-model pushes a block through the new
`ctx.conversation.blocks` registry so the bar renders the disabled
textarea it already renders without a workspace, carrying the blocker's
own reason. The push direction is forced — ui-model already depends on
ui-conversation, so ui-conversation cannot read it back.

The gate is `routable`, not "matches no advertised group": catalog
membership is advisory, so a route serving a model it stopped advertising
is missing from the groups yet perfectly usable, and `null` before the
first load never blocks so a slow Host cannot lock a working composer.

The scaffold gains a route-only adapter for fixture-less keyless
scenarios. Registering zero providers is a test artifact — every product
composition mounts one — and the goldens that froze the seat's fallback
label now show the model those scenarios actually route to.
2026-08-07 15:26:42 +08:00